(function(n){function t(r){if(i[r])return i[r].exports;var u=i[r]={exports:{},id:r,loaded:!1};return n[r].call(u.exports,u,u.exports,t),u.loaded=!0,u.exports}var i={};return t.m=n,t.c=i,t.p="",t(0)})([function(n,t,i){n.exports=i(1)},function(n,t,i){"use strict";function f(n){var t,i;if(n&&n.__esModule)return n;if(t={},n!=null)for(i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t.default=n,t}var r=i(2),u=f(r);(function(){var n={hashtag:"#Hazloconlagorra",cache:!1,cacheTimeInHours:1,pylonFeeds:{facebook:document.querySelector(".facebook_pylon")?!0:!1,instagram:document.querySelector(".instagram_pylon")?!0:!1,twitter:document.querySelector(".twitter_pylon")?!0:!1},smContainerId:"#SocialMediaContainer"};u.init(n)})()},function(n,t,i){(function(n){"use strict";function l(n){return n&&n.__esModule?n:{"default":n}}function ut(t){try{ft(t);n===undefined||n.fn.jquery<"2.2.4"?v("https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js",function(){u=p=n.noConflict(!0);v("http://durexofa-dev-cs.hyperlab.pl/css/CmsPlugins/RB-StarterKit/themes/durexsk/js/modernizr-custom.js",function(){w()})}):(u=p=n,v("http://durexofa-dev-cs.hyperlab.pl/css/CmsPlugins/RB-StarterKit/themes/durexsk/js/modernizr-custom.js",function(){w()}))}catch(i){handleError(i)}}function v(n,t){var i=document.createElement("script"),r=document.querySelector('script[src="'+n+'"]');r&&r.parentNode.removeChild(r);i.setAttribute("type","text/javascript");i.setAttribute("src",n);typeof t!="undefined"&&(i.readyState?i.onreadystatechange=function(){(this.readyState==="complete"||this.readyState==="loaded")&&t()}:i.onload=t);(document.getElementsByTagName("head")[0]||document.documentElement).appendChild(i)}function w(){window.Promise||(window.Promise=f.default);et();r.cache?lt():s()}function ft(n){var t,u,i;try{if(n)for(t in n)if(n.hasOwnProperty(t))if(u=Object.prototype.toString.call(o[t]),o.hasOwnProperty(t)&&Object.prototype.toString.call(n[t])===u)switch(u){case"[object Object]":for(i in n[t])o[t].hasOwnProperty(i)&&n[t].hasOwnProperty(i)&&(o[t][i]=n[t][i]);break;default:o[t]=n[t]}else throw Error(e.wrongSettings);Object.assign(r,rt,o)}catch(f){c(f)}}function et(){var n,i,s,h,l,f,o,t;try{if(u(r.smContainerId).length<1)throw new Error(e.lackOfContainer);n={facebook:"",twitter:"",instagram:""};i="";r.feeds.facebook&&(s=r.feedsSums.facebook?'<div class="feeds-sum"><\/div>':"",n.facebook='<div id="FacebookFeeds" class="feeds"><h2 class="feeds-header"><span class="feeds-header__icon feeds-header__icon_social"><i class="fa fa-facebook" aria-hidden="true"><\/i><\/span><span class="feeds-header__name">Facebook<\/span><span class="feeds-header__icon feeds-header__icon_accordion-arrow"><i class="fa fa-angle-down" aria-hidden="true"><\/i><\/span><\/h2><div class="feeds-list"><div class="feeds-list__wrapper feeds-list__wrapper_fb"><\/div><\/div>'+s+"<\/div>");r.feeds.twitter&&(h=r.feedsSums.twitter?'<div class="feeds-sum"><\/div>':"",n.twitter='<div id="TwitterFeeds" class="feeds"><h2 class="feeds-header"><span class="feeds-header__icon feeds-header__icon_social"><i class="fa fa-twitter" aria-hidden="true"><\/i><\/span><span class="feeds-header__name">Twitter<\/span><span class="feeds-header__icon feeds-header__icon_accordion-arrow"><i class="fa fa-angle-down" aria-hidden="true"><\/i><\/span><\/h2><div class="feeds-list"><div class="feeds-list__wrapper feeds-list__wrapper_twitter"><\/div><\/div>'+h+"<\/div>");r.feeds.instagram&&(l=r.feedsSums.instagram?'<div class="feeds-sum"><\/div>':"",n.instagram='<div id="InstaFeeds" class="feeds"><h2 class="feeds-header"><span class="feeds-header__icon feeds-header__icon_social"><i class="fa fa-instagram" aria-hidden="true"><\/i><\/span><span class="feeds-header__name">Instagram<\/span><span class="feeds-header__icon feeds-header__icon_accordion-arrow"><i class="fa fa-angle-down" aria-hidden="true"><\/i><\/span><\/h2><div class="feeds-list"><div class="feeds-list__wrapper feeds-list__wrapper_instagram"><\/div><\/div>'+l+"<\/div>");for(f in r.feeds)r.feeds.hasOwnProperty(f)&&(i+=n[f]);for(u(r.smContainerId).html('<div class="feeds-wrapper" data-column="'+ot()+'">'+i+"<\/div>"),o=document.querySelectorAll(".feeds-list"),t=0;t<o.length;t++)it.default.initialize(o[t]);u(".feeds-header").on("click",st)}catch(a){c(a)}}function ot(){var n=0,t;for(t in r.feeds)r.feeds[t]&&n++;return n}function st(n){n.preventDefault();var r=n.currentTarget,t=n.currentTarget.nextElementSibling,i=u(r).children(".feeds-header__icon_accordion-arrow");u(t).hasClass("open")?(u(i).removeClass("open"),u(t).removeClass("open")):(u(i).addClass("open"),u(t).addClass("open"))}function ht(n,t){try{if(!t||!n)return;if(Modernizr.localstorage)localStorage.removeItem(n),localStorage.setItem(n,t);else throw new Error(e.noLocalStorage);}catch(i){c(i)}}function ct(n){try{if(Modernizr.localstorage)return localStorage.getItem(n);throw new Error(e.noLocalStorage);}catch(t){c(t)}}function lt(){var n=JSON.parse(ct(r.lsFeedKey)),t=n?h(null,new Date(Date.parse(n.date))):null;n&&t.hours<r.cacheTimeInHours?(r.feeds.instagram&&(n.instagram?b(n.instagram,n.instagramSum):s()),r.feeds.twitter&&(n.twitter?k(n.twitter,n.twitterSum):s()),r.feeds.facebook&&(n.facebook?d(n.facebook,n.facebookSum):s())):s()}function s(){var n=[],i=void 0,e=void 0,o=void 0,s=void 0,h=void 0,l=void 0,t={date:(new Date).toString()},a,v,y,p,w,g;r.feeds.instagram&&(a=r.pylonFeeds.instagram?r.pylonApi.instagram:r.api.instagram,i=new f.default(function(n){u.ajax(a).done(function(t){n(t)}).fail(function(){n(!1)})}),r.feedsSums.instagram&&(v=r.pylonFeeds.instagram?r.pylonApi.instagramFeedSum:r.api.instagramFeedSum,e=new f.default(function(n){u.ajax(v).done(function(t){n(t)}).fail(function(){n(!1)})})));r.feeds.twitter&&(y=r.pylonFeeds.twitter?r.pylonApi.twitter:r.api.twitter,o=new f.default(function(n){u.ajax(y).done(function(t){n(t)}).fail(function(){n(!1)})}),r.feedsSums.twitter&&(p=r.pylonFeeds.twitter?r.pylonApi.twitterFeedSum:r.api.twitterFeedSum,s=new f.default(function(n){u.ajax(p).done(function(t){n(t)}).fail(function(){n(!1)})})));r.feeds.facebook&&(w=r.pylonFeeds.facebook?r.pylonApi.facebook:r.api.facebook,h=new f.default(function(n){u.ajax(w).done(function(t){n(t)}).fail(function(){n(!1)})}),r.feedsSums.facebook&&(g=r.pylonFeeds.facebook?r.pylonApi.facebookFeedSum:r.api.facebookFeedSum,l=new f.default(function(n){u.ajax(g).done(function(t){n(t)}).fail(function(){n(!1)})})));n[0]=r.feeds.instagram?i:null;n[1]=r.feeds.instagram?e:null;n[2]=r.feeds.twitter?o:null;n[3]=r.feeds.twitter?s:null;n[4]=r.feeds.facebook?h:null;n[5]=r.feeds.facebook?l:null;f.default.all(n).then(function(n){var i,u,f,e,o,s;r.feeds.instagram&&n[0]&&(i=r.pylonFeeds.instagram?vt(n[0]):at(n[0]),u=n[1]?n[1].feed_sum:0,b(i,u),t.instagram=i,t.instagramSum=u);r.feeds.twitter&&n[2]&&(f=pt(n[2]),e=n[3]?n[3].feed_sum:0,k(f,e),t.twitter=f,t.twitterSum=e);r.feeds.facebook&&n[4]&&(o=yt(n[4]),s=n[5]?n[5].feed_sum:0,d(o,s),t.facebook=o,t.facebookSum=s);ht(r.lsFeedKey,JSON.stringify(t))},function(n){c(n)})}function at(n){var f=[],r=n.hasOwnProperty("data")?n.data:null,u;if(r&&r.length>0)for(u in r)if(r.hasOwnProperty(u)){var t=r[u],e=h(null,new Date(t.created_time*1e3)).toString()+" ago",i={created_time:e?e:"",capiton_text:t.caption.text,link:t.link};t.hasOwnProperty("user")&&(i.user_full_name=t.user.hasOwnProperty("full_name")?t.user.full_name:"",i.user_username=t.user.hasOwnProperty("username")?t.user.username:"",i.user_profile_picture=t.user.hasOwnProperty("profile_picture")?t.user.profile_picture:"");t.hasOwnProperty("images")&&(i.images_low_resolution=t.images.hasOwnProperty("low_resolution")?t.images.low_resolution.url:"",i.images_standard_resolution=t.images.hasOwnProperty("standard_resolution")?t.images.standard_resolution.url:"",i.images_thumbnail=t.images.hasOwnProperty("thumbnail")?t.images.thumbnail.url:"");f.push(i)}return f}function vt(n){var e=[],i=n.hasOwnProperty("result")?n.result:null,r,t,u,f;if(i&&i.length>0)for(r=0;r<i.length;r++)t=i[r],u=h(null,Date.parse(t.created_time)).toString()+" ago",t.hasOwnProperty("data")&&(f={user_full_name:t.data.hasOwnProperty("from_full_name")?t.data.from_full_name:"",user_username:t.data.hasOwnProperty("from_username")?t.data.from_username:"",user_profile_picture:t.data.hasOwnProperty("from_profile_picture")?t.data.from_profile_picture:"",images_low_resolution:t.data.hasOwnProperty("image_url_lowres")?t.data.image_url_lowres:"",images_standard_resolution:t.data.hasOwnProperty("image_url_standard")?t.data.image_url_standard:"",images_thumbnail:t.data.hasOwnProperty("image_url_thumbnail")?t.data.image_url_thumbnail:"",created_time:u?u:"",capiton_text:t.data.hasOwnProperty("message")?t.data.message:"",link:t.data.hasOwnProperty("external_url")?t.data.external_url:""},console.log(f),e.push(f));return e}function yt(n){var f=[],r=n.hasOwnProperty("data")?n.data:null,u;if(r&&r.length>0)for(u in r)if(r.hasOwnProperty(u)){var t=r[u],e=h(null,new Date(t.created_time)).toString()+" ago",i={images_standard_resolution:t.hasOwnProperty("picture")?t.picture:"",created_time:e?e:"",capiton_text:t.hasOwnProperty("message")?t.message:"",id:t.hasOwnProperty("id")?t.id:""};t.hasOwnProperty("from")&&(i.user_full_name=t.from.hasOwnProperty("name")?t.from.name:"",i.user_username=t.from.hasOwnProperty("username")?t.from.username:"",i.user_profile_picture=t.from.hasOwnProperty("profile_picture")?t.from.profile_picture:"");t.hasOwnProperty("images")&&(i.images_low_resolution=t.images.hasOwnProperty("low_resolution")?t.images.low_resolution.url:"",i.images_thumbnail=t.images.hasOwnProperty("thumbnail")?t.images.thumbnail.url:"");f.push(i)}return f}function pt(n){var e=[],u=n.hasOwnProperty("statuses")?n.statuses:null,f,i;if(u&&u.length>0)for(f in u)if(u.hasOwnProperty(f)){var t=u[f],o=h(null,new Date(t.created_at)).toString()+" ago",r={created_time:o?o:"",capiton_text:t.text,id:t.id};if(t.hasOwnProperty("user")&&(r.user_full_name=t.user.hasOwnProperty("name")?t.user.name:"",r.user_username=t.user.hasOwnProperty("screen_name")?t.user.screen_name:"",r.user_profile_picture=t.user.hasOwnProperty("profile_image_url")?t.user.profile_image_url:""),t.hasOwnProperty("entities")&&t.entities.hasOwnProperty("media"))for(i=0;i<t.entities.media.length;i++)r.images_low_resolution=t.entities.media[i].hasOwnProperty("media_url")?t.entities.media[i].media_url:"",r.images_standard_resolution=t.entities.media[i].hasOwnProperty("media_url")?t.entities.media[i].media_url:"",r.images_thumbnail=t.entities.media[i].hasOwnProperty("media_url")?t.entities.media[i].media_url:"";e.push(r)}return e}function h(n,t){return y.default(n,t,y.default.DEFAULTS,1)}function b(n,t){var o,i;if(n.length>0){for(o="",i=0;i<n.length;i++){var s=n[i].user_profile_picture?'<img src="'+n[i].user_profile_picture+'" alt="" />':'<img src="/css/CmsPlugins/RB-StarterKit/themes/durexsk/images/avatar.jpg" alt="">',f=n[i].capiton_text,h=n[i].images_standard_resolution?'<img src="'+n[i].images_standard_resolution+'" alt="" >':"",c=n[i].user_username?"@ "+n[i].user_username:"";f.indexOf(r.hashtag)>-1&&(f=f.replace(r.hashtag,'<a href="https://www.instagram.com/explore/tags/'+r.hashtag.substr(1)+'/" target="_blank" rel="nofollow" class="feed__hashtag">'+r.hashtag+"<\/a>"));o+='<div class="feed"><div class="feed__avatar">'+s+'<\/div><a href="https://www.instagram.com/'+n[i].user_username+'/" target="_blank" rel="nofollow" class="feed__user"><span class="feed__user_name">'+n[i].user_full_name+'<\/span><span class="feed__user_nick"> '+c+'<\/span><\/a><p class="feed__message">'+f+'<\/p><div class="feed__media">'+h+'<\/div><div class="feed__date">'+n[i].created_time+"<\/div><\/div>"}u("#InstaFeeds .feeds-list__wrapper_instagram")&&u("#InstaFeeds .feeds-list__wrapper_instagram").html(o)}else u("#InstaFeeds .feeds-list__wrapper_instagram")&&u("#InstaFeeds .feeds-list__wrapper_instagram").html(e.noFeedsToShow("Instagram"));u("#InstaFeeds .feeds-sum")&&u("#InstaFeeds .feeds-sum").html("On Instagram now we have: "+t+" feeds")}function k(n,t){var o,i;if(n.length>0){for(o="",i=0;i<n.length;i++){var s=n[i].user_profile_picture?'<img src="'+n[i].user_profile_picture+'" alt="" />':'<img src="/css/CmsPlugins/RB-StarterKit/themes/durexsk/images/avatar.jpg" alt="">',f=n[i].capiton_text,h=n[i].images_standard_resolution?'<img src="'+n[i].images_standard_resolution+'" alt="" >':"",c=n[i].user_username?"@ "+n[i].user_username:"";f.indexOf(r.hashtag)>-1&&(f=f.replace(r.hashtag,'<a href="https://twitter.com/search?q=%23'+r.hashtag.substr(1)+'/" target="_blank" rel="nofollow" class="feed__hashtag">'+r.hashtag+"<\/a>"));o+='<div class="feed"><div class="feed__avatar">'+s+'<\/div><a href="https://twitter.com/'+n[i].user_username+'/" target="_blank" rel="nofollow" class="feed__user"><span class="feed__user_name">'+n[i].user_full_name+'<\/span><span class="feed__user_nick"> '+c+'<\/span><\/a><p class="feed__message">'+f+'<\/p><div class="feed__media">'+h+'<\/div><div class="feed__date">'+n[i].created_time+"<\/div><\/div>"}u("#TwitterFeeds .feeds-list__wrapper_twitter")&&u("#TwitterFeeds .feeds-list__wrapper_twitter").html(o)}else u("#TwitterFeeds .feeds-list__wrapper_twitter")&&u("#TwitterFeeds .feeds-list__wrapper_twitter").html(e.noFeedsToShow("Twitter"));u("#TwitterFeeds .feeds-sum")&&u("#TwitterFeeds .feeds-sum").html("On Twitter now we have: "+t+" feeds")}function d(n,t){var o,i;if(n.length>0){for(o="",i=0;i<n.length;i++){var s=n[i].user_profile_picture?'<img src="'+n[i].user_profile_picture+'" alt="" />':'<img src="/css/CmsPlugins/RB-StarterKit/themes/durexsk/images/avatar.jpg" alt="">',f=n[i].capiton_text,h=n[i].images_standard_resolution?'<img src="'+n[i].images_standard_resolution+'" alt="" >':"",c=n[i].user_username?"@ "+n[i].user_username:"";f.indexOf(r.hashtag)>-1&&(f=f.replace(r.hashtag,'<a href="https://www.facebook.com/search/top/?q=%23'+r.hashtag.substr(1)+'/" target="_blank" rel="nofollow" class="feed__hashtag">'+r.hashtag+"<\/a>"));o+='<div class="feed"><div class="feed__avatar">'+s+'<\/div><a href="https://www.facebook.com/'+n[i].id+'/" target="_blank" rel="nofollow" class="feed__user"><span class="feed__user_name">'+n[i].user_full_name+'<\/span><span class="feed__user_nick"> '+c+'<\/span><\/a><p class="feed__message">'+f+'<\/p><div class="feed__media">'+h+'<\/div><div class="feed__date">'+n[i].created_time+"<\/div><\/div>"}u("#FacebookFeeds .feeds-list__wrapper_fb")&&u("#FacebookFeeds .feeds-list__wrapper_fb").html(o)}else u("#FacebookFeeds .feeds-list__wrapper_fb")&&u("#FacebookFeeds .feeds-list__wrapper_fb").html(e.noFeedsToShow("Facebook"));u("#FacebookFeeds .feeds-sum")&&u("#FacebookFeeds .feeds-sum").html("On Facebook now we have: "+t+" feeds")}function c(n){console.error(n)}Object.defineProperty(t,"__esModule",{value:!0});t.init=ut;var g=i(4),f=l(g),nt=i(8),y=l(nt),tt=i(9),it=l(tt);var u=void 0,p=null,a=window.location.pathname;a=a.substr(0,a.lastIndexOf("/"));var r=Object.create(null),rt={lsFeedKey:"feeds",lsFeedSumKey:"feedsSum",api:{instagram:{contentType:!1,crossDomain:!0,cache:!0,jsonpCallback:"insta_feed",dataType:"jsonp",url:"http://hazloconlagorra.hyperlab.pl/instagram.json"},twitter:{contentType:!1,crossDomain:!0,cache:!0,jsonpCallback:"twit_feed",dataType:"jsonp",url:"http://hazloconlagorra.hyperlab.pl/twitter_austria.json"},facebook:{contentType:!1,crossDomain:!0,cache:!0,jsonpCallback:"fb_feed",dataType:"jsonp",url:"http://hazloconlagorra.hyperlab.pl/facebook.json"},instagramFeedSum:{contentType:!1,crossDomain:!0,cache:!0,jsonpCallback:"insta_feedSum",dataType:"jsonp",url:"http://hazloconlagorra.hyperlab.pl/instagram_feedSum.json"},twitterFeedSum:{contentType:!1,crossDomain:!0,cache:!0,jsonpCallback:"tweet_feedSum",dataType:"jsonp",url:"http://hazloconlagorra.hyperlab.pl/twitter_feedSum.json"},facebookFeedSum:{contentType:!1,crossDomain:!0,cache:!0,jsonpCallback:"fb_feedSum",dataType:"jsonp",url:"http://hazloconlagorra.hyperlab.pl/facebook_feedSum.json"}},pylonApi:{instagram:{contentType:!1,crossDomain:!0,cache:!0,jsonpCallback:"insta_feed",dataType:"jsonp",url:"http://hazloconlagorra.hyperlab.pl/instagram_pylon.json"},twitter:{contentType:!1,crossDomain:!0,cache:!0,jsonpCallback:"twit_feed",dataType:"jsonp",url:"http://hazloconlagorra.hyperlab.pl/twitter_pylon.json"},facebook:{contentType:!1,crossDomain:!0,cache:!0,jsonpCallback:"fb_feed",dataType:"jsonp",url:"http://hazloconlagorra.hyperlab.pl/facebook_pylon.json"},instagramFeedSum:{contentType:!1,crossDomain:!0,cache:!0,jsonpCallback:"insta_feedSum",dataType:"jsonp",url:"http://hazloconlagorra.hyperlab.pl/instagram_feedSum.json"},twitterFeedSum:{contentType:!1,crossDomain:!0,cache:!0,jsonpCallback:"tweet_feedSum",dataType:"jsonp",url:"http://hazloconlagorra.hyperlab.pl/twitter_feedSum.json"},facebookFeedSum:{contentType:!1,crossDomain:!0,cache:!0,jsonpCallback:"fb_feedSum",dataType:"jsonp",url:"http://hazloconlagorra.hyperlab.pl/facebook_feedSum.json"}}},o={hashtag:"#testpylon",smContainerId:"#SMToolContainer",counterContainerId:"#CounterContainer",feeds:{facebook:!0,twitter:!0,instagram:!0},feedsSums:{facebook:!1,twitter:!1,instagram:!1},pylonFeeds:{facebook:!1,instagram:!1,twitter:!1},cache:!1,cacheTimeInHours:1},e={wrongSettings:"Added settings is wrong or have wrong type",wrongConfigObj:"",lackOfContainer:"Lack of container with id="+r.smContainerId,noLocalStorage:"Your browser doesn't support a local storage. Please update it now to use this app",noFeedsToShow:function(n){return n?"0 feeds from "+n+" to show":"0 feeds to show"}}}).call(t,i(3))},function(n,t){var r,i;(function(t,i){"use strict";typeof n=="object"&&typeof n.exports=="object"?n.exports=t.document?i(t,!0):function(n){if(!n.document)throw new Error("jQuery requires a window with a document");return i(n)}:i(t)})(typeof window!="undefined"?window:this,function(u,f){"use strict";function er(n,t){t=t||s;var i=t.createElement("script");i.text=n;t.head.appendChild(i).parentNode.removeChild(i)}function hi(n){var t=!!n&&"length"in n&&n.length,i=e.type(n);return i==="function"||e.isWindow(n)?!1:i==="array"||t===0||typeof t=="number"&&t>0&&t-1 in n}function p(n,t){return n.nodeName&&n.nodeName.toLowerCase()===t.toLowerCase()}function li(n,t,i){return e.isFunction(t)?e.grep(n,function(n,r){return!!t.call(n,r,n)!==i}):t.nodeType?e.grep(n,function(n){return n===t!==i}):typeof t!="string"?e.grep(n,function(n){return lt.call(t,n)>-1!==i}):cr.test(t)?e.filter(t,n,i):(t=e.filter(t,n),e.grep(n,function(n){return lt.call(t,n)>-1!==i&&n.nodeType===1}))}function wr(n,t){while((n=n[t])&&n.nodeType!==1);return n}function ue(n){var t={};return e.each(n.match(v)||[],function(n,i){t[i]=!0}),t}function ut(n){return n}function dt(n){throw n;}function br(n,t,i,r){var u;try{n&&e.isFunction(u=n.promise)?u.call(n).done(t).fail(i):n&&e.isFunction(u=n.then)?u.call(n,t,i):t.apply(undefined,[n].slice(r))}catch(n){i.apply(undefined,[n])}}function ni(){s.removeEventListener("DOMContentLoaded",ni);u.removeEventListener("load",ni);e.ready()}function vt(){this.expando=e.expando+vt.uid++}function oe(n){return n==="true"?!0:n==="false"?!1:n==="null"?null:n===+n+""?+n:fe.test(n)?JSON.parse(n):n}function dr(n,t,i){var r;if(i===undefined&&n.nodeType===1)if(r="data-"+t.replace(ee,"-$&").toLowerCase(),i=n.getAttribute(r),typeof i=="string"){try{i=oe(i)}catch(u){}c.set(n,t,i)}else i=undefined;return i}function tu(n,t,i,r){var h,f=1,l=20,c=r?function(){return r.cur()}:function(){return e.css(n,t,"")},s=c(),o=i&&i[3]||(e.cssNumber[t]?"":"px"),u=(e.cssNumber[t]||o!=="px"&&+s)&&yt.exec(e.css(n,t));if(u&&u[3]!==o){o=o||u[3];i=i||[];u=+s||1;do f=f||".5",u=u/f,e.style(n,t,u+o);while(f!==(f=c()/s)&&f!==1&&--l)}return i&&(u=+u||+s||0,h=i[1]?u+(i[1]+1)*i[2]:+i[2],r&&(r.unit=o,r.start=u,r.end=h)),h}function se(n){var i,u=n.ownerDocument,r=n.nodeName,t=ai[r];return t?t:(i=u.body.appendChild(u.createElement(r)),t=e.css(i,"display"),i.parentNode.removeChild(i),t==="none"&&(t="block"),ai[r]=t,t)}function ft(n,t){for(var f,r,u=[],i=0,e=n.length;i<e;i++)(r=n[i],r.style)&&(f=r.style.display,t?(f==="none"&&(u[i]=o.get(r,"display")||null,u[i]||(r.style.display="")),r.style.display===""&&ti(r)&&(u[i]=se(r))):f!=="none"&&(u[i]="none",o.set(r,"display",f)));for(i=0;i<e;i++)u[i]!=null&&(n[i].style.display=u[i]);return n}function l(n,t){var i;return(i=typeof n.getElementsByTagName!="undefined"?n.getElementsByTagName(t||"*"):typeof n.querySelectorAll!="undefined"?n.querySelectorAll(t||"*"):[],t===undefined||t&&p(n,t))?e.merge([n],i):i}function vi(n,t){for(var i=0,r=n.length;i<r;i++)o.set(n[i],"globalEval",!t||o.get(t[i],"globalEval"))}function eu(n,t,i,r,u){for(var f,o,p,c,w,a,s=t.createDocumentFragment(),v=[],h=0,b=n.length;h<b;h++)if(f=n[h],f||f===0)if(e.type(f)==="object")e.merge(v,f.nodeType?[f]:f);else if(fu.test(f)){for(o=o||s.appendChild(t.createElement("div")),p=(ru.exec(f)||["",""])[1].toLowerCase(),c=y[p]||y._default,o.innerHTML=c[1]+e.htmlPrefilter(f)+c[2],a=c[0];a--;)o=o.lastChild;e.merge(v,o.childNodes);o=s.firstChild;o.textContent=""}else v.push(t.createTextNode(f));for(s.textContent="",h=0;f=v[h++];){if(r&&e.inArray(f,r)>-1){u&&u.push(f);continue}if(w=e.contains(f.ownerDocument,f),o=l(s.appendChild(f),"script"),w&&vi(o),i)for(a=0;f=o[a++];)uu.test(f.type||"")&&i.push(f)}return s}function ri(){return!0}function et(){return!1}function su(){try{return s.activeElement}catch(n){}}function yi(n,t,i,r,u,f){var o,s;if(typeof t=="object"){typeof i!="string"&&(r=r||i,i=undefined);for(s in t)yi(n,s,i,r,t[s],f);return n}if(r==null&&u==null?(u=i,r=i=undefined):u==null&&(typeof i=="string"?(u=r,r=undefined):(u=r,r=i,i=undefined)),u===!1)u=et;else if(!u)return n;return f===1&&(o=u,u=function(n){return e().off(n),o.apply(this,arguments)},u.guid=o.guid||(o.guid=e.guid++)),n.each(function(){e.event.add(this,t,u,r,i)})}function hu(n,t){return p(n,"table")&&p(t.nodeType!==11?t:t.firstChild,"tr")?e(">tbody",n)[0]||n:n}function we(n){return n.type=(n.getAttribute("type")!==null)+"/"+n.type,n}function be(n){var t=ye.exec(n.type);return t?n.type=t[1]:n.removeAttribute("type"),n}function cu(n,t){var r,h,u,f,s,l,a,i;if(t.nodeType===1){if(o.hasData(n)&&(f=o.access(n),s=o.set(t,f),i=f.events,i)){delete s.handle;s.events={};for(u in i)for(r=0,h=i[u].length;r<h;r++)e.event.add(t,u,i[u][r])}c.hasData(n)&&(l=c.access(n),a=e.extend({},l),c.set(t,a))}}function ke(n,t){var i=t.nodeName.toLowerCase();i==="input"&&iu.test(n.type)?t.checked=n.checked:(i==="input"||i==="textarea")&&(t.defaultValue=n.defaultValue)}function ot(n,t,i,r){t=rr.apply([],t);var c,p,s,a,u,w,f=0,v=n.length,k=v-1,y=t[0],b=e.isFunction(y);if(b||v>1&&typeof y=="string"&&!h.checkClone&&ve.test(y))return n.each(function(u){var f=n.eq(u);b&&(t[0]=y.call(this,u,f.html()));ot(f,t,i,r)});if(v&&(c=eu(t,n[0].ownerDocument,!1,n,r),p=c.firstChild,c.childNodes.length===1&&(c=p),p||r)){for(s=e.map(l(c,"script"),we),a=s.length;f<v;f++)u=c,f!==k&&(u=e.clone(u,!0,!0),a&&e.merge(s,l(u,"script"))),i.call(n[f],u,f);if(a)for(w=s[s.length-1].ownerDocument,e.map(s,be),f=0;f<a;f++)u=s[f],uu.test(u.type||"")&&!o.access(u,"globalEval")&&e.contains(w,u)&&(u.src?e._evalUrl&&e._evalUrl(u.src):er(u.textContent.replace(pe,""),w))}return n}function lu(n,t,i){for(var r,f=t?e.filter(t,n):n,u=0;(r=f[u])!=null;u++)i||r.nodeType!==1||e.cleanData(l(r)),r.parentNode&&(i&&e.contains(r.ownerDocument,r)&&vi(l(r,"script")),r.parentNode.removeChild(r));return n}function pt(n,t,i){var f,o,s,r,u=n.style;return i=i||ui(n),i&&(r=i.getPropertyValue(t)||i[t],r!==""||e.contains(n.ownerDocument,n)||(r=e.style(n,t)),!h.pixelMarginRight()&&pi.test(r)&&au.test(t)&&(f=u.width,o=u.minWidth,s=u.maxWidth,u.minWidth=u.maxWidth=u.width=r,r=i.width,u.width=f,u.minWidth=o,u.maxWidth=s)),r!==undefined?r+"":r}function vu(n,t){return{get:function(){if(n()){delete this.get;return}return(this.get=t).apply(this,arguments)}}}function no(n){if(n in bu)return n;for(var i=n[0].toUpperCase()+n.slice(1),t=wu.length;t--;)if(n=wu[t]+i,n in bu)return n}function ku(n){var t=e.cssProps[n];return t||(t=e.cssProps[n]=no(n)||n),t}function du(n,t,i){var r=yt.exec(t);return r?Math.max(0,r[2]-(i||0))+(r[3]||"px"):t}function gu(n,t,i,r,u){for(var o=0,f=i===(r?"border":"content")?4:t==="width"?1:0;f<4;f+=2)i==="margin"&&(o+=e.css(n,i+nt[f],!0,u)),r?(i==="content"&&(o-=e.css(n,"padding"+nt[f],!0,u)),i!=="margin"&&(o-=e.css(n,"border"+nt[f]+"Width",!0,u))):(o+=e.css(n,"padding"+nt[f],!0,u),i!=="padding"&&(o+=e.css(n,"border"+nt[f]+"Width",!0,u)));return o}function nf(n,t,i){var f,u=ui(n),r=pt(n,t,u),o=e.css(n,"boxSizing",!1,u)==="border-box";return pi.test(r)?r:(f=o&&(h.boxSizingReliable()||r===n.style[t]),r==="auto"&&(r=n["offset"+t[0].toUpperCase()+t.slice(1)]),r=parseFloat(r)||0,r+gu(n,t,i||(o?"border":"content"),f,u)+"px")}function a(n,t,i,r,u){return new a.prototype.init(n,t,i,r,u)}function wi(){fi&&(s.hidden===!1&&u.requestAnimationFrame?u.requestAnimationFrame(wi):u.setTimeout(wi,e.fx.interval),e.fx.tick())}function uf(){return u.setTimeout(function(){st=undefined}),st=e.now()}function ei(n,t){var r,u=0,i={height:n};for(t=t?1:0;u<4;u+=2-t)r=nt[u],i["margin"+r]=i["padding"+r]=n;return t&&(i.opacity=i.width=n),i}function ff(n,t,i){for(var u,f=(w.tweeners[t]||[]).concat(w.tweeners["*"]),r=0,e=f.length;r<e;r++)if(u=f[r].call(i,t,n))return u}function to(n,t,i){var r,y,w,c,b,s,f,l,k="width"in t||"height"in t,v=this,p={},h=n.style,a=n.nodeType&&ti(n),u=o.get(n,"fxshow");i.queue||(c=e._queueHooks(n,"fx"),c.unqueued==null&&(c.unqueued=0,b=c.empty.fire,c.empty.fire=function(){c.unqueued||b()}),c.unqueued++,v.always(function(){v.always(function(){c.unqueued--;e.queue(n,"fx").length||c.empty.fire()})}));for(r in t)if(y=t[r],tf.test(y)){if(delete t[r],w=w||y==="toggle",y===(a?"hide":"show"))if(y==="show"&&u&&u[r]!==undefined)a=!0;else continue;p[r]=u&&u[r]||e.style(n,r)}if(s=!e.isEmptyObject(t),s||!e.isEmptyObject(p)){k&&n.nodeType===1&&(i.overflow=[h.overflow,h.overflowX,h.overflowY],f=u&&u.display,f==null&&(f=o.get(n,"display")),l=e.css(n,"display"),l==="none"&&(f?l=f:(ft([n],!0),f=n.style.display||f,l=e.css(n,"display"),ft([n]))),(l==="inline"||l==="inline-block"&&f!=null)&&e.css(n,"float")==="none"&&(s||(v.done(function(){h.display=f}),f==null&&(l=h.display,f=l==="none"?"":l)),h.display="inline-block"));i.overflow&&(h.overflow="hidden",v.always(function(){h.overflow=i.overflow[0];h.overflowX=i.overflow[1];h.overflowY=i.overflow[2]}));s=!1;for(r in p)s||(u?"hidden"in u&&(a=u.hidden):u=o.access(n,"fxshow",{display:f}),w&&(u.hidden=!a),a&&ft([n],!0),v.done(function(){a||ft([n]);o.remove(n,"fxshow");for(r in p)e.style(n,r,p[r])})),s=ff(a?u[r]:0,r,v),r in u||(u[r]=s.start,a&&(s.end=s.start,s.start=0))}}function io(n,t){var i,u,f,r,o;for(i in n)if(u=e.camelCase(i),f=t[u],r=n[i],Array.isArray(r)&&(f=r[1],r=n[i]=r[0]),i!==u&&(n[u]=r,delete n[i]),o=e.cssHooks[u],o&&"expand"in o){r=o.expand(r);delete n[u];for(i in r)i in n||(n[i]=r[i],t[i]=f)}else t[u]=f}function w(n,t,i){var f,o,s=0,l=w.prefilters.length,u=e.Deferred().always(function(){delete c.elem}),c=function(){if(o)return!1;for(var s=st||uf(),t=Math.max(0,r.startTime+r.duration-s),h=t/r.duration||0,i=1-h,f=0,e=r.tweens.length;f<e;f++)r.tweens[f].run(i);return(u.notifyWith(n,[r,i,t]),i<1&&e)?t:(e||u.notifyWith(n,[r,1,0]),u.resolveWith(n,[r]),!1)},r=u.promise({elem:n,props:e.extend({},t),opts:e.extend(!0,{specialEasing:{},easing:e.easing._default},i),originalProperties:t,originalOptions:i,startTime:st||uf(),duration:i.duration,tweens:[],createTween:function(t,i){var u=e.Tween(n,r.opts,t,i,r.opts.specialEasing[t]||r.opts.easing);return r.tweens.push(u),u},stop:function(t){var i=0,f=t?r.tweens.length:0;if(o)return this;for(o=!0;i<f;i++)r.tweens[i].run(1);return t?(u.notifyWith(n,[r,1,0]),u.resolveWith(n,[r,t])):u.rejectWith(n,[r,t]),this}}),h=r.props;for(io(h,r.opts.specialEasing);s<l;s++)if(f=w.prefilters[s].call(r,n,h,r.opts),f)return e.isFunction(f.stop)&&(e._queueHooks(r.elem,r.opts.queue).stop=e.proxy(f.stop,f)),f;return e.map(h,ff,r),e.isFunction(r.opts.start)&&r.opts.start.call(n,r),r.progress(r.opts.progress).done(r.opts.done,r.opts.complete).fail(r.opts.fail).always(r.opts.always),e.fx.timer(e.extend(c,{elem:n,anim:r,queue:r.opts.queue})),r}function tt(n){var t=n.match(v)||[];return t.join(" ")}function it(n){return n.getAttribute&&n.getAttribute("class")||""}function di(n,t,i,r){var u;if(Array.isArray(t))e.each(t,function(t,u){i||ro.test(n)?r(n,u):di(n+"["+(typeof u=="object"&&u!=null?t:"")+"]",u,i,r)});else if(i||e.type(t)!=="object")r(n,t);else for(u in t)di(n+"["+u+"]",t[u],i,r)}function yf(n){return function(t,i){typeof t!="string"&&(i=t,t="*");var r,u=0,f=t.toLowerCase().match(v)||[];if(e.isFunction(i))while(r=f[u++])r[0]==="+"?(r=r.slice(1)||"*",(n[r]=n[r]||[]).unshift(i)):(n[r]=n[r]||[]).push(i)}}function pf(n,t,i,r){function f(s){var h;return u[s]=!0,e.each(n[s]||[],function(n,e){var s=e(t,i,r);if(typeof s!="string"||o||u[s]){if(o)return!(h=s)}else return t.dataTypes.unshift(s),f(s),!1}),h}var u={},o=n===gi;return f(t.dataTypes[0])||!u["*"]&&f("*")}function tr(n,t){var i,r,u=e.ajaxSettings.flatOptions||{};for(i in t)t[i]!==undefined&&((u[i]?n:r||(r={}))[i]=t[i]);return r&&e.extend(!0,n,r),n}function ao(n,t,i){for(var e,u,f,o,s=n.contents,r=n.dataTypes;r[0]==="*";)r.shift(),e===undefined&&(e=n.mimeType||t.getResponseHeader("Content-Type"));if(e)for(u in s)if(s[u]&&s[u].test(e)){r.unshift(u);break}if(r[0]in i)f=r[0];else{for(u in i){if(!r[0]||n.converters[u+" "+r[0]]){f=u;break}o||(o=u)}f=f||o}if(f)return f!==r[0]&&r.unshift(f),i[f]}function vo(n,t,i,r){var h,u,f,s,e,o={},c=n.dataTypes.slice();if(c[1])for(f in n.converters)o[f.toLowerCase()]=n.converters[f];for(u=c.shift();u;)if(n.responseFields[u]&&(i[n.responseFields[u]]=t),!e&&r&&n.dataFilter&&(t=n.dataFilter(t,n.dataType)),e=u,u=c.shift(),u)if(u==="*")u=e;else if(e!=="*"&&e!==u){if(f=o[e+" "+u]||o["* "+u],!f)for(h in o)if(s=h.split(" "),s[1]===u&&(f=o[e+" "+s[0]]||o["* "+s[0]],f)){f===!0?f=o[h]:o[h]!==!0&&(u=s[0],c.unshift(s[1]));break}if(f!==!0)if(f&&n.throws)t=f(t);else try{t=f(t)}catch(l){return{state:"parsererror",error:f?l:"No conversion from "+e+" to "+u}}}return{state:"success",data:t}}var d=[],s=u.document,df=Object.getPrototypeOf,g=d.slice,rr=d.concat,si=d.push,lt=d.indexOf,bt={},ur=bt.toString,kt=bt.hasOwnProperty,fr=kt.toString,gf=fr.call(Object),h={},or="3.2.1",e=function(n,t){return new e.fn.init(n,t)},ne=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,te=/^-ms-/,ie=/-([a-z])/g,re=function(n,t){return t.toUpperCase()},k,ci,cr,lr,ar,vr,yr,pr,v,kr,gt,b,at,ai,fu,st,fi,tf,rf,ef,ht,of,sf,hf,bi,wf,ct,ir,oi,bf,kf;e.fn=e.prototype={jquery:or,constructor:e,length:0,toArray:function(){return g.call(this)},get:function(n){return n==null?g.call(this):n<0?this[n+this.length]:this[n]},pushStack:function(n){var t=e.merge(this.constructor(),n);return t.prevObject=this,t},each:function(n){return e.each(this,n)},map:function(n){return this.pushStack(e.map(this,function(t,i){return n.call(t,i,t)}))},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(n){var i=this.length,t=+n+(n<0?i:0);return this.pushStack(t>=0&&t<i?[this[t]]:[])},end:function(){return this.prevObject||this.constructor()},push:si,sort:d.sort,splice:d.splice};e.extend=e.fn.extend=function(){var f,u,i,t,o,s,n=arguments[0]||{},r=1,c=arguments.length,h=!1;for(typeof n=="boolean"&&(h=n,n=arguments[r]||{},r++),typeof n=="object"||e.isFunction(n)||(n={}),r===c&&(n=this,r--);r<c;r++)if((f=arguments[r])!=null)for(u in f)(i=n[u],t=f[u],n!==t)&&(h&&t&&(e.isPlainObject(t)||(o=Array.isArray(t)))?(o?(o=!1,s=i&&Array.isArray(i)?i:[]):s=i&&e.isPlainObject(i)?i:{},n[u]=e.extend(h,s,t)):t!==undefined&&(n[u]=t));return n};e.extend({expando:"jQuery"+(or+Math.random()).replace(/\D/g,""),isReady:!0,error:function(n){throw new Error(n);},noop:function(){},isFunction:function(n){return e.type(n)==="function"},isWindow:function(n){return n!=null&&n===n.window},isNumeric:function(n){var t=e.type(n);return(t==="number"||t==="string")&&!isNaN(n-parseFloat(n))},isPlainObject:function(n){var t,i;return!n||ur.call(n)!=="[object Object]"?!1:(t=df(n),!t)?!0:(i=kt.call(t,"constructor")&&t.constructor,typeof i=="function"&&fr.call(i)===gf)},isEmptyObject:function(n){var t;for(t in n)return!1;return!0},type:function(n){return n==null?n+"":typeof n=="object"||typeof n=="function"?bt[ur.call(n)]||"object":typeof n},globalEval:function(n){er(n)},camelCase:function(n){return n.replace(te,"ms-").replace(ie,re)},each:function(n,t){var r,i=0;if(hi(n)){for(r=n.length;i<r;i++)if(t.call(n[i],i,n[i])===!1)break}else for(i in n)if(t.call(n[i],i,n[i])===!1)break;return n},trim:function(n){return n==null?"":(n+"").replace(ne,"")},makeArray:function(n,t){var i=t||[];return n!=null&&(hi(Object(n))?e.merge(i,typeof n=="string"?[n]:n):si.call(i,n)),i},inArray:function(n,t,i){return t==null?-1:lt.call(t,n,i)},merge:function(n,t){for(var u=+t.length,i=0,r=n.length;i<u;i++)n[r++]=t[i];return n.length=r,n},grep:function(n,t,i){for(var u,f=[],r=0,e=n.length,o=!i;r<e;r++)u=!t(n[r],r),u!==o&&f.push(n[r]);return f},map:function(n,t,i){var e,u,r=0,f=[];if(hi(n))for(e=n.length;r<e;r++)u=t(n[r],r,i),u!=null&&f.push(u);else for(r in n)u=t(n[r],r,i),u!=null&&f.push(u);return rr.apply([],f)},guid:1,proxy:function(n,t){var r,u,i;return(typeof t=="string"&&(r=n[t],t=n,n=r),!e.isFunction(n))?undefined:(u=g.call(arguments,2),i=function(){return n.apply(t||this,u.concat(g.call(arguments)))},i.guid=n.guid=n.guid||e.guid++,i)},now:Date.now,support:h});typeof Symbol=="function"&&(e.fn[Symbol.iterator]=d[Symbol.iterator]);e.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(n,t){bt["[object "+t+"]"]=t.toLowerCase()});k=function(n){function u(n,t,r,u){var s,w,l,a,d,y,g,p=t&&t.ownerDocument,v=t?t.nodeType:9;if(r=r||[],typeof n!="string"||!n||v!==1&&v!==9&&v!==11)return r;if(!u&&((t?t.ownerDocument||t:c)!==i&&b(t),t=t||i,h)){if(v!==11&&(d=cr.exec(n)))if(s=d[1]){if(v===9)if(l=t.getElementById(s)){if(l.id===s)return r.push(l),r}else return r;else if(p&&(l=p.getElementById(s))&&et(t,l)&&l.id===s)return r.push(l),r}else{if(d[2])return k.apply(r,t.getElementsByTagName(n)),r;if((s=d[3])&&e.getElementsByClassName&&t.getElementsByClassName)return k.apply(r,t.getElementsByClassName(s)),r}if(e.qsa&&!lt[n+" "]&&(!o||!o.test(n))){if(v!==1)p=t,g=n;else if(t.nodeName.toLowerCase()!=="object"){for((a=t.getAttribute("id"))?a=a.replace(vi,yi):t.setAttribute("id",a=f),y=ft(n),w=y.length;w--;)y[w]="#"+a+" "+yt(y[w]);g=y.join(",");p=ni.test(n)&&ri(t.parentNode)||t}if(g)try{return k.apply(r,p.querySelectorAll(g)),r}catch(nt){}finally{a===f&&t.removeAttribute("id")}}}return si(n.replace(at,"$1"),t,r,u)}function ti(){function n(r,u){return i.push(r+" ")>t.cacheLength&&delete n[i.shift()],n[r+" "]=u}var i=[];return n}function l(n){return n[f]=!0,n}function a(n){var t=i.createElement("fieldset");try{return!!n(t)}catch(r){return!1}finally{t.parentNode&&t.parentNode.removeChild(t);t=null}}function ii(n,i){for(var r=n.split("|"),u=r.length;u--;)t.attrHandle[r[u]]=i}function wi(n,t){var i=t&&n,r=i&&n.nodeType===1&&t.nodeType===1&&n.sourceIndex-t.sourceIndex;if(r)return r;if(i)while(i=i.nextSibling)if(i===t)return-1;return n?1:-1}function ar(n){return function(t){var i=t.nodeName.toLowerCase();return i==="input"&&t.type===n}}function vr(n){return function(t){var i=t.nodeName.toLowerCase();return(i==="input"||i==="button")&&t.type===n}}function bi(n){return function(t){return"form"in t?t.parentNode&&t.disabled===!1?"label"in t?"label"in t.parentNode?t.parentNode.disabled===n:t.disabled===n:t.isDisabled===n||t.isDisabled!==!n&&lr(t)===n:t.disabled===n:"label"in t?t.disabled===n:!1}}function it(n){return l(function(t){return t=+t,l(function(i,r){for(var u,f=n([],i.length,t),e=f.length;e--;)i[u=f[e]]&&(i[u]=!(r[u]=i[u]))})})}function ri(n){return n&&typeof n.getElementsByTagName!="undefined"&&n}function ki(){}function yt(n){for(var t=0,r=n.length,i="";t<r;t++)i+=n[t].value;return i}function pt(n,t,i){var r=t.dir,u=t.next,e=u||r,o=i&&e==="parentNode",s=di++;return t.first?function(t,i,u){while(t=t[r])if(t.nodeType===1||o)return n(t,i,u);return!1}:function(t,i,h){var c,l,a,y=[v,s];if(h){while(t=t[r])if((t.nodeType===1||o)&&n(t,i,h))return!0}else while(t=t[r])if(t.nodeType===1||o)if(a=t[f]||(t[f]={}),l=a[t.uniqueID]||(a[t.uniqueID]={}),u&&u===t.nodeName.toLowerCase())t=t[r]||t;else{if((c=l[e])&&c[0]===v&&c[1]===s)return y[2]=c[2];if(l[e]=y,y[2]=n(t,i,h))return!0}return!1}}function ui(n){return n.length>1?function(t,i,r){for(var u=n.length;u--;)if(!n[u](t,i,r))return!1;return!0}:n[0]}function yr(n,t,i){for(var r=0,f=t.length;r<f;r++)u(n,t[r],i);return i}function wt(n,t,i,r,u){for(var e,o=[],f=0,s=n.length,h=t!=null;f<s;f++)(e=n[f])&&(!i||i(e,r,u))&&(o.push(e),h&&t.push(f));return o}function fi(n,t,i,r,u,e){return r&&!r[f]&&(r=fi(r)),u&&!u[f]&&(u=fi(u,e)),l(function(f,e,o,s){var l,c,a,p=[],y=[],w=e.length,b=f||yr(t||"*",o.nodeType?[o]:o,[]),v=n&&(f||!t)?wt(b,p,n,o,s):b,h=i?u||(f?n:w||r)?[]:e:v;if(i&&i(v,h,o,s),r)for(l=wt(h,y),r(l,[],o,s),c=l.length;c--;)(a=l[c])&&(h[y[c]]=!(v[y[c]]=a));if(f){if(u||n){if(u){for(l=[],c=h.length;c--;)(a=h[c])&&l.push(v[c]=a);u(null,h=[],l,s)}for(c=h.length;c--;)(a=h[c])&&(l=u?nt(f,a):p[c])>-1&&(f[l]=!(e[l]=a))}}else h=wt(h===e?h.splice(w,h.length):h),u?u(null,e,h,s):k.apply(e,h)})}function ei(n){for(var o,u,r,s=n.length,h=t.relative[n[0].type],c=h||t.relative[" "],i=h?1:0,l=pt(function(n){return n===o},c,!0),a=pt(function(n){return nt(o,n)>-1},c,!0),e=[function(n,t,i){var r=!h&&(i||t!==ht)||((o=t).nodeType?l(n,t,i):a(n,t,i));return o=null,r}];i<s;i++)if(u=t.relative[n[i].type])e=[pt(ui(e),u)];else{if(u=t.filter[n[i].type].apply(null,n[i].matches),u[f]){for(r=++i;r<s;r++)if(t.relative[n[r].type])break;return fi(i>1&&ui(e),i>1&&yt(n.slice(0,i-1).concat({value:n[i-2].type===" "?"*":""})).replace(at,"$1"),u,i<r&&ei(n.slice(i,r)),r<s&&ei(n=n.slice(r)),r<s&&yt(n))}e.push(u)}return ui(e)}function pr(n,r){var f=r.length>0,e=n.length>0,o=function(o,s,c,l,a){var y,nt,d,g=0,p="0",tt=o&&[],w=[],it=ht,rt=o||e&&t.find.TAG("*",a),ut=v+=it==null?1:Math.random()||.1,ft=rt.length;for(a&&(ht=s===i||s||a);p!==ft&&(y=rt[p])!=null;p++){if(e&&y){for(nt=0,s||y.ownerDocument===i||(b(y),c=!h);d=n[nt++];)if(d(y,s||i,c)){l.push(y);break}a&&(v=ut)}f&&((y=!d&&y)&&g--,o&&tt.push(y))}if(g+=p,f&&p!==g){for(nt=0;d=r[nt++];)d(tt,w,s,c);if(o){if(g>0)while(p--)tt[p]||w[p]||(w[p]=nr.call(l));w=wt(w)}k.apply(l,w);a&&!o&&w.length>0&&g+r.length>1&&u.uniqueSort(l)}return a&&(v=ut,ht=it),tt};return f?l(o):o}var rt,e,t,st,oi,ft,bt,si,ht,w,ut,b,i,s,h,o,d,ct,et,f="sizzle"+1*new Date,c=n.document,v=0,di=0,hi=ti(),ci=ti(),lt=ti(),kt=function(n,t){return n===t&&(ut=!0),0},gi={}.hasOwnProperty,g=[],nr=g.pop,tr=g.push,k=g.push,li=g.slice,nt=function(n,t){for(var i=0,r=n.length;i<r;i++)if(n[i]===t)return i;return-1},dt="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",r="[\\x20\\t\\r\\n\\f]",tt="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",ai="\\["+r+"*("+tt+")(?:"+r+"*([*^$|!~]?=)"+r+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+tt+"))|)"+r+"*\\]",gt=":("+tt+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ai+")*)|.*)\\)|)",ir=new RegExp(r+"+","g"),at=new RegExp("^"+r+"+|((?:^|[^\\\\])(?:\\\\.)*)"+r+"+$","g"),rr=new RegExp("^"+r+"*,"+r+"*"),ur=new RegExp("^"+r+"*([>+~]|"+r+")"+r+"*"),fr=new RegExp("="+r+"*([^\\]'\"]*?)"+r+"*\\]","g"),er=new RegExp(gt),or=new RegExp("^"+tt+"$"),vt={ID:new RegExp("^#("+tt+")"),CLASS:new RegExp("^\\.("+tt+")"),TAG:new RegExp("^("+tt+"|[*])"),ATTR:new RegExp("^"+ai),PSEUDO:new RegExp("^"+gt),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+r+"*(even|odd|(([+-]|)(\\d*)n|)"+r+"*(?:([+-]|)"+r+"*(\\d+)|))"+r+"*\\)|)","i"),bool:new RegExp("^(?:"+dt+")$","i"),needsContext:new RegExp("^"+r+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+r+"*((?:-\\d)?\\d*)"+r+"*\\)|)(?=[^-]|$)","i")},sr=/^(?:input|select|textarea|button)$/i,hr=/^h\d$/i,ot=/^[^{]+\{\s*\[native \w/,cr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ni=/[+~]/,y=new RegExp("\\\\([\\da-f]{1,6}"+r+"?|("+r+")|.)","ig"),p=function(n,t,i){var r="0x"+t-65536;return r!==r||i?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,r&1023|56320)},vi=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,yi=function(n,t){return t?n==="\0"?"�":n.slice(0,-1)+"\\"+n.charCodeAt(n.length-1).toString(16)+" ":"\\"+n},pi=function(){b()},lr=pt(function(n){return n.disabled===!0&&("form"in n||"label"in n)},{dir:"parentNode",next:"legend"});try{k.apply(g=li.call(c.childNodes),c.childNodes);g[c.childNodes.length].nodeType}catch(wr){k={apply:g.length?function(n,t){tr.apply(n,li.call(t))}:function(n,t){for(var i=n.length,r=0;n[i++]=t[r++];);n.length=i-1}}}e=u.support={};oi=u.isXML=function(n){var t=n&&(n.ownerDocument||n).documentElement;return t?t.nodeName!=="HTML":!1};b=u.setDocument=function(n){var v,u,l=n?n.ownerDocument||n:c;return l===i||l.nodeType!==9||!l.documentElement?i:(i=l,s=i.documentElement,h=!oi(i),c!==i&&(u=i.defaultView)&&u.top!==u&&(u.addEventListener?u.addEventListener("unload",pi,!1):u.attachEvent&&u.attachEvent("onunload",pi)),e.attributes=a(function(n){return n.className="i",!n.getAttribute("className")}),e.getElementsByTagName=a(function(n){return n.appendChild(i.createComment("")),!n.getElementsByTagName("*").length}),e.getElementsByClassName=ot.test(i.getElementsByClassName),e.getById=a(function(n){return s.appendChild(n).id=f,!i.getElementsByName||!i.getElementsByName(f).length}),e.getById?(t.filter.ID=function(n){var t=n.replace(y,p);return function(n){return n.getAttribute("id")===t}},t.find.ID=function(n,t){if(typeof t.getElementById!="undefined"&&h){var i=t.getElementById(n);return i?[i]:[]}}):(t.filter.ID=function(n){var t=n.replace(y,p);return function(n){var i=typeof n.getAttributeNode!="undefined"&&n.getAttributeNode("id");return i&&i.value===t}},t.find.ID=function(n,t){if(typeof t.getElementById!="undefined"&&h){var i,u,f,r=t.getElementById(n);if(r){if(i=r.getAttributeNode("id"),i&&i.value===n)return[r];for(f=t.getElementsByName(n),u=0;r=f[u++];)if(i=r.getAttributeNode("id"),i&&i.value===n)return[r]}return[]}}),t.find.TAG=e.getElementsByTagName?function(n,t){return typeof t.getElementsByTagName!="undefined"?t.getElementsByTagName(n):e.qsa?t.querySelectorAll(n):void 0}:function(n,t){var i,r=[],f=0,u=t.getElementsByTagName(n);if(n==="*"){while(i=u[f++])i.nodeType===1&&r.push(i);return r}return u},t.find.CLASS=e.getElementsByClassName&&function(n,t){if(typeof t.getElementsByClassName!="undefined"&&h)return t.getElementsByClassName(n)},d=[],o=[],(e.qsa=ot.test(i.querySelectorAll))&&(a(function(n){s.appendChild(n).innerHTML="<a id='"+f+"'><\/a><select id='"+f+"-\r\\' msallowcapture=''><option selected=''><\/option><\/select>";n.querySelectorAll("[msallowcapture^='']").length&&o.push("[*^$]="+r+"*(?:''|\"\")");n.querySelectorAll("[selected]").length||o.push("\\["+r+"*(?:value|"+dt+")");n.querySelectorAll("[id~="+f+"-]").length||o.push("~=");n.querySelectorAll(":checked").length||o.push(":checked");n.querySelectorAll("a#"+f+"+*").length||o.push(".#.+[+~]")}),a(function(n){n.innerHTML="<a href='' disabled='disabled'><\/a><select disabled='disabled'><option/><\/select>";var t=i.createElement("input");t.setAttribute("type","hidden");n.appendChild(t).setAttribute("name","D");n.querySelectorAll("[name=d]").length&&o.push("name"+r+"*[*^$|!~]?=");n.querySelectorAll(":enabled").length!==2&&o.push(":enabled",":disabled");s.appendChild(n).disabled=!0;n.querySelectorAll(":disabled").length!==2&&o.push(":enabled",":disabled");n.querySelectorAll("*,:x");o.push(",.*:")})),(e.matchesSelector=ot.test(ct=s.matches||s.webkitMatchesSelector||s.mozMatchesSelector||s.oMatchesSelector||s.msMatchesSelector))&&a(function(n){e.disconnectedMatch=ct.call(n,"*");ct.call(n,"[s!='']:x");d.push("!=",gt)}),o=o.length&&new RegExp(o.join("|")),d=d.length&&new RegExp(d.join("|")),v=ot.test(s.compareDocumentPosition),et=v||ot.test(s.contains)?function(n,t){var r=n.nodeType===9?n.documentElement:n,i=t&&t.parentNode;return n===i||!!(i&&i.nodeType===1&&(r.contains?r.contains(i):n.compareDocumentPosition&&n.compareDocumentPosition(i)&16))}:function(n,t){if(t)while(t=t.parentNode)if(t===n)return!0;return!1},kt=v?function(n,t){if(n===t)return ut=!0,0;var r=!n.compareDocumentPosition-!t.compareDocumentPosition;return r?r:(r=(n.ownerDocument||n)===(t.ownerDocument||t)?n.compareDocumentPosition(t):1,r&1||!e.sortDetached&&t.compareDocumentPosition(n)===r)?n===i||n.ownerDocument===c&&et(c,n)?-1:t===i||t.ownerDocument===c&&et(c,t)?1:w?nt(w,n)-nt(w,t):0:r&4?-1:1}:function(n,t){if(n===t)return ut=!0,0;var r,u=0,o=n.parentNode,s=t.parentNode,f=[n],e=[t];if(o&&s){if(o===s)return wi(n,t)}else return n===i?-1:t===i?1:o?-1:s?1:w?nt(w,n)-nt(w,t):0;for(r=n;r=r.parentNode;)f.unshift(r);for(r=t;r=r.parentNode;)e.unshift(r);while(f[u]===e[u])u++;return u?wi(f[u],e[u]):f[u]===c?-1:e[u]===c?1:0},i)};u.matches=function(n,t){return u(n,null,null,t)};u.matchesSelector=function(n,t){if((n.ownerDocument||n)!==i&&b(n),t=t.replace(fr,"='$1']"),e.matchesSelector&&h&&!lt[t+" "]&&(!d||!d.test(t))&&(!o||!o.test(t)))try{var r=ct.call(n,t);if(r||e.disconnectedMatch||n.document&&n.document.nodeType!==11)return r}catch(f){}return u(t,i,null,[n]).length>0};u.contains=function(n,t){return(n.ownerDocument||n)!==i&&b(n),et(n,t)};u.attr=function(n,r){(n.ownerDocument||n)!==i&&b(n);var f=t.attrHandle[r.toLowerCase()],u=f&&gi.call(t.attrHandle,r.toLowerCase())?f(n,r,!h):undefined;return u!==undefined?u:e.attributes||!h?n.getAttribute(r):(u=n.getAttributeNode(r))&&u.specified?u.value:null};u.escape=function(n){return(n+"").replace(vi,yi)};u.error=function(n){throw new Error("Syntax error, unrecognized expression: "+n);};u.uniqueSort=function(n){var r,u=[],t=0,i=0;if(ut=!e.detectDuplicates,w=!e.sortStable&&n.slice(0),n.sort(kt),ut){while(r=n[i++])r===n[i]&&(t=u.push(i));while(t--)n.splice(u[t],1)}return w=null,n};st=u.getText=function(n){var r,i="",u=0,t=n.nodeType;if(t){if(t===1||t===9||t===11){if(typeof n.textContent=="string")return n.textContent;for(n=n.firstChild;n;n=n.nextSibling)i+=st(n)}else if(t===3||t===4)return n.nodeValue}else while(r=n[u++])i+=st(r);return i};t=u.selectors={cacheLength:50,createPseudo:l,match:vt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(n){return n[1]=n[1].replace(y,p),n[3]=(n[3]||n[4]||n[5]||"").replace(y,p),n[2]==="~="&&(n[3]=" "+n[3]+" "),n.slice(0,4)},CHILD:function(n){return n[1]=n[1].toLowerCase(),n[1].slice(0,3)==="nth"?(n[3]||u.error(n[0]),n[4]=+(n[4]?n[5]+(n[6]||1):2*(n[3]==="even"||n[3]==="odd")),n[5]=+(n[7]+n[8]||n[3]==="odd")):n[3]&&u.error(n[0]),n},PSEUDO:function(n){var i,t=!n[6]&&n[2];return vt.CHILD.test(n[0])?null:(n[3]?n[2]=n[4]||n[5]||"":t&&er.test(t)&&(i=ft(t,!0))&&(i=t.indexOf(")",t.length-i)-t.length)&&(n[0]=n[0].slice(0,i),n[2]=t.slice(0,i)),n.slice(0,3))}},filter:{TAG:function(n){var t=n.replace(y,p).toLowerCase();return n==="*"?function(){return!0}:function(n){return n.nodeName&&n.nodeName.toLowerCase()===t}},CLASS:function(n){var t=hi[n+" "];return t||(t=new RegExp("(^|"+r+")"+n+"("+r+"|$)"))&&hi(n,function(n){return t.test(typeof n.className=="string"&&n.className||typeof n.getAttribute!="undefined"&&n.getAttribute("class")||"")})},ATTR:function(n,t,i){return function(r){var f=u.attr(r,n);return f==null?t==="!=":t?(f+="",t==="="?f===i:t==="!="?f!==i:t==="^="?i&&f.indexOf(i)===0:t==="*="?i&&f.indexOf(i)>-1:t==="$="?i&&f.slice(-i.length)===i:t==="~="?(" "+f.replace(ir," ")+" ").indexOf(i)>-1:t==="|="?f===i||f.slice(0,i.length+1)===i+"-":!1):!0}},CHILD:function(n,t,i,r,u){var s=n.slice(0,3)!=="nth",o=n.slice(-4)!=="last",e=t==="of-type";return r===1&&u===0?function(n){return!!n.parentNode}:function(t,i,h){var p,w,y,c,a,b,k=s!==o?"nextSibling":"previousSibling",d=t.parentNode,nt=e&&t.nodeName.toLowerCase(),g=!h&&!e,l=!1;if(d){if(s){while(k){for(c=t;c=c[k];)if(e?c.nodeName.toLowerCase()===nt:c.nodeType===1)return!1;b=k=n==="only"&&!b&&"nextSibling"}return!0}if(b=[o?d.firstChild:d.lastChild],o&&g){for(c=d,y=c[f]||(c[f]={}),w=y[c.uniqueID]||(y[c.uniqueID]={}),p=w[n]||[],a=p[0]===v&&p[1],l=a&&p[2],c=a&&d.childNodes[a];c=++a&&c&&c[k]||(l=a=0)||b.pop();)if(c.nodeType===1&&++l&&c===t){w[n]=[v,a,l];break}}else if(g&&(c=t,y=c[f]||(c[f]={}),w=y[c.uniqueID]||(y[c.uniqueID]={}),p=w[n]||[],a=p[0]===v&&p[1],l=a),l===!1)while(c=++a&&c&&c[k]||(l=a=0)||b.pop())if((e?c.nodeName.toLowerCase()===nt:c.nodeType===1)&&++l&&(g&&(y=c[f]||(c[f]={}),w=y[c.uniqueID]||(y[c.uniqueID]={}),w[n]=[v,l]),c===t))break;return l-=u,l===r||l%r==0&&l/r>=0}}},PSEUDO:function(n,i){var e,r=t.pseudos[n]||t.setFilters[n.toLowerCase()]||u.error("unsupported pseudo: "+n);return r[f]?r(i):r.length>1?(e=[n,n,"",i],t.setFilters.hasOwnProperty(n.toLowerCase())?l(function(n,t){for(var u,f=r(n,i),e=f.length;e--;)u=nt(n,f[e]),n[u]=!(t[u]=f[e])}):function(n){return r(n,0,e)}):r}},pseudos:{not:l(function(n){var t=[],r=[],i=bt(n.replace(at,"$1"));return i[f]?l(function(n,t,r,u){for(var e,o=i(n,null,u,[]),f=n.length;f--;)(e=o[f])&&(n[f]=!(t[f]=e))}):function(n,u,f){return t[0]=n,i(t,null,f,r),t[0]=null,!r.pop()}}),has:l(function(n){return function(t){return u(n,t).length>0}}),contains:l(function(n){return n=n.replace(y,p),function(t){return(t.textContent||t.innerText||st(t)).indexOf(n)>-1}}),lang:l(function(n){return or.test(n||"")||u.error("unsupported lang: "+n),n=n.replace(y,p).toLowerCase(),function(t){var i;do if(i=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return i=i.toLowerCase(),i===n||i.indexOf(n+"-")===0;while((t=t.parentNode)&&t.nodeType===1);return!1}}),target:function(t){var i=n.location&&n.location.hash;return i&&i.slice(1)===t.id},root:function(n){return n===s},focus:function(n){return n===i.activeElement&&(!i.hasFocus||i.hasFocus())&&!!(n.type||n.href||~n.tabIndex)},enabled:bi(!1),disabled:bi(!0),checked:function(n){var t=n.nodeName.toLowerCase();return t==="input"&&!!n.checked||t==="option"&&!!n.selected},selected:function(n){return n.parentNode&&n.parentNode.selectedIndex,n.selected===!0},empty:function(n){for(n=n.firstChild;n;n=n.nextSibling)if(n.nodeType<6)return!1;return!0},parent:function(n){return!t.pseudos.empty(n)},header:function(n){return hr.test(n.nodeName)},input:function(n){return sr.test(n.nodeName)},button:function(n){var t=n.nodeName.toLowerCase();return t==="input"&&n.type==="button"||t==="button"},text:function(n){var t;return n.nodeName.toLowerCase()==="input"&&n.type==="text"&&((t=n.getAttribute("type"))==null||t.toLowerCase()==="text")},first:it(function(){return[0]}),last:it(function(n,t){return[t-1]}),eq:it(function(n,t,i){return[i<0?i+t:i]}),even:it(function(n,t){for(var i=0;i<t;i+=2)n.push(i);return n}),odd:it(function(n,t){for(var i=1;i<t;i+=2)n.push(i);return n}),lt:it(function(n,t,i){for(var r=i<0?i+t:i;--r>=0;)n.push(r);return n}),gt:it(function(n,t,i){for(var r=i<0?i+t:i;++r<t;)n.push(r);return n})}};t.pseudos.nth=t.pseudos.eq;for(rt in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})t.pseudos[rt]=ar(rt);for(rt in{submit:!0,reset:!0})t.pseudos[rt]=vr(rt);return ki.prototype=t.filters=t.pseudos,t.setFilters=new ki,ft=u.tokenize=function(n,i){var e,f,s,o,r,h,c,l=ci[n+" "];if(l)return i?0:l.slice(0);for(r=n,h=[],c=t.preFilter;r;){(!e||(f=rr.exec(r)))&&(f&&(r=r.slice(f[0].length)||r),h.push(s=[]));e=!1;(f=ur.exec(r))&&(e=f.shift(),s.push({value:e,type:f[0].replace(at," ")}),r=r.slice(e.length));for(o in t.filter)(f=vt[o].exec(r))&&(!c[o]||(f=c[o](f)))&&(e=f.shift(),s.push({value:e,type:o,matches:f}),r=r.slice(e.length));if(!e)break}return i?r.length:r?u.error(n):ci(n,h).slice(0)},bt=u.compile=function(n,t){var r,u=[],e=[],i=lt[n+" "];if(!i){for(t||(t=ft(n)),r=t.length;r--;)i=ei(t[r]),i[f]?u.push(i):e.push(i);i=lt(n,pr(e,u));i.selector=n}return i},si=u.select=function(n,i,r,u){var o,f,e,l,a,c=typeof n=="function"&&n,s=!u&&ft(n=c.selector||n);if(r=r||[],s.length===1){if(f=s[0]=s[0].slice(0),f.length>2&&(e=f[0]).type==="ID"&&i.nodeType===9&&h&&t.relative[f[1].type]){if(i=(t.find.ID(e.matches[0].replace(y,p),i)||[])[0],i)c&&(i=i.parentNode);else return r;n=n.slice(f.shift().value.length)}for(o=vt.needsContext.test(n)?0:f.length;o--;){if(e=f[o],t.relative[l=e.type])break;if((a=t.find[l])&&(u=a(e.matches[0].replace(y,p),ni.test(f[0].type)&&ri(i.parentNode)||i))){if(f.splice(o,1),n=u.length&&yt(f),!n)return k.apply(r,u),r;break}}}return(c||bt(n,s))(u,i,!h,r,!i||ni.test(n)&&ri(i.parentNode)||i),r},e.sortStable=f.split("").sort(kt).join("")===f,e.detectDuplicates=!!ut,b(),e.sortDetached=a(function(n){return n.compareDocumentPosition(i.createElement("fieldset"))&1}),a(function(n){return n.innerHTML="<a href='#'><\/a>",n.firstChild.getAttribute("href")==="#"})||ii("type|href|height|width",function(n,t,i){if(!i)return n.getAttribute(t,t.toLowerCase()==="type"?1:2)}),e.attributes&&a(function(n){return n.innerHTML="<input/>",n.firstChild.setAttribute("value",""),n.firstChild.getAttribute("value")===""})||ii("value",function(n,t,i){if(!i&&n.nodeName.toLowerCase()==="input")return n.defaultValue}),a(function(n){return n.getAttribute("disabled")==null})||ii(dt,function(n,t,i){var r;if(!i)return n[t]===!0?t.toLowerCase():(r=n.getAttributeNode(t))&&r.specified?r.value:null}),u}(u);e.find=k;e.expr=k.selectors;e.expr[":"]=e.expr.pseudos;e.uniqueSort=e.unique=k.uniqueSort;e.text=k.getText;e.isXMLDoc=k.isXML;e.contains=k.contains;e.escapeSelector=k.escape;var rt=function(n,t,i){for(var r=[],u=i!==undefined;(n=n[t])&&n.nodeType!==9;)if(n.nodeType===1){if(u&&e(n).is(i))break;r.push(n)}return r},sr=function(n,t){for(var i=[];n;n=n.nextSibling)n.nodeType===1&&n!==t&&i.push(n);return i},hr=e.expr.match.needsContext;ci=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;cr=/^.[^:#\[\.,]*$/;e.filter=function(n,t,i){var r=t[0];return(i&&(n=":not("+n+")"),t.length===1&&r.nodeType===1)?e.find.matchesSelector(r,n)?[r]:[]:e.find.matches(n,e.grep(t,function(n){return n.nodeType===1}))};e.fn.extend({find:function(n){var t,i,r=this.length,u=this;if(typeof n!="string")return this.pushStack(e(n).filter(function(){for(t=0;t<r;t++)if(e.contains(u[t],this))return!0}));for(i=this.pushStack([]),t=0;t<r;t++)e.find(n,u[t],i);return r>1?e.uniqueSort(i):i},filter:function(n){return this.pushStack(li(this,n||[],!1))},not:function(n){return this.pushStack(li(this,n||[],!0))},is:function(n){return!!li(this,typeof n=="string"&&hr.test(n)?e(n):n||[],!1).length}});ar=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;vr=e.fn.init=function(n,t,i){var r,u;if(!n)return this;if(i=i||lr,typeof n=="string"){if(r=n[0]==="<"&&n[n.length-1]===">"&&n.length>=3?[null,n,null]:ar.exec(n),r&&(r[1]||!t)){if(r[1]){if(t=t instanceof e?t[0]:t,e.merge(this,e.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:s,!0)),ci.test(r[1])&&e.isPlainObject(t))for(r in t)e.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return u=s.getElementById(r[2]),u&&(this[0]=u,this.length=1),this}return!t||t.jquery?(t||i).find(n):this.constructor(t).find(n)}return n.nodeType?(this[0]=n,this.length=1,this):e.isFunction(n)?i.ready!==undefined?i.ready(n):n(e):e.makeArray(n,this)};vr.prototype=e.fn;lr=e(s);yr=/^(?:parents|prev(?:Until|All))/;pr={children:!0,contents:!0,next:!0,prev:!0};e.fn.extend({has:function(n){var t=e(n,this),i=t.length;return this.filter(function(){for(var n=0;n<i;n++)if(e.contains(this,t[n]))return!0})},closest:function(n,t){var i,u=0,o=this.length,r=[],f=typeof n!="string"&&e(n);if(!hr.test(n))for(;u<o;u++)for(i=this[u];i&&i!==t;i=i.parentNode)if(i.nodeType<11&&(f?f.index(i)>-1:i.nodeType===1&&e.find.matchesSelector(i,n))){r.push(i);break}return this.pushStack(r.length>1?e.uniqueSort(r):r)},index:function(n){return n?typeof n=="string"?lt.call(e(n),this[0]):lt.call(this,n.jquery?n[0]:n):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(n,t){return this.pushStack(e.uniqueSort(e.merge(this.get(),e(n,t))))},addBack:function(n){return this.add(n==null?this.prevObject:this.prevObject.filter(n))}});e.each({parent:function(n){var t=n.parentNode;return t&&t.nodeType!==11?t:null},parents:function(n){return rt(n,"parentNode")},parentsUntil:function(n,t,i){return rt(n,"parentNode",i)},next:function(n){return wr(n,"nextSibling")},prev:function(n){return wr(n,"previousSibling")},nextAll:function(n){return rt(n,"nextSibling")},prevAll:function(n){return rt(n,"previousSibling")},nextUntil:function(n,t,i){return rt(n,"nextSibling",i)},prevUntil:function(n,t,i){return rt(n,"previousSibling",i)},siblings:function(n){return sr((n.parentNode||{}).firstChild,n)},children:function(n){return sr(n.firstChild)},contents:function(n){return p(n,"iframe")?n.contentDocument:(p(n,"template")&&(n=n.content||n),e.merge([],n.childNodes))}},function(n,t){e.fn[n]=function(i,r){var u=e.map(this,t,i);return n.slice(-5)!=="Until"&&(r=i),r&&typeof r=="string"&&(u=e.filter(r,u)),this.length>1&&(pr[n]||e.uniqueSort(u),yr.test(n)&&u.reverse()),this.pushStack(u)}});v=/[^\x20\t\r\n\f]+/g;e.Callbacks=function(n){n=typeof n=="string"?ue(n):e.extend({},n);var f,i,h,r,t=[],o=[],u=-1,c=function(){for(r=r||n.once,h=f=!0;o.length;u=-1)for(i=o.shift();++u<t.length;)t[u].apply(i[0],i[1])===!1&&n.stopOnFalse&&(u=t.length,i=!1);n.memory||(i=!1);f=!1;r&&(t=i?[]:"")},s={add:function(){return t&&(i&&!f&&(u=t.length-1,o.push(i)),function r(i){e.each(i,function(i,u){e.isFunction(u)?n.unique&&s.has(u)||t.push(u):u&&u.length&&e.type(u)!=="string"&&r(u)})}(arguments),i&&!f&&c()),this},remove:function(){return e.each(arguments,function(n,i){for(var r;(r=e.inArray(i,t,r))>-1;)t.splice(r,1),r<=u&&u--}),this},has:function(n){return n?e.inArray(n,t)>-1:t.length>0},empty:function(){return t&&(t=[]),this},disable:function(){return r=o=[],t=i="",this},disabled:function(){return!t},lock:function(){return r=o=[],i||f||(t=i=""),this},locked:function(){return!!r},fireWith:function(n,t){return r||(t=t||[],t=[n,t.slice?t.slice():t],o.push(t),f||c()),this},fire:function(){return s.fireWith(this,arguments),this},fired:function(){return!!h}};return s};e.extend({Deferred:function(n){var i=[["notify","progress",e.Callbacks("memory"),e.Callbacks("memory"),2],["resolve","done",e.Callbacks("once memory"),e.Callbacks("once memory"),0,"resolved"],["reject","fail",e.Callbacks("once memory"),e.Callbacks("once memory"),1,"rejected"]],f="pending",r={state:function(){return f},always:function(){return t.done(arguments).fail(arguments),this},"catch":function(n){return r.then(null,n)},pipe:function(){var n=arguments;return e.Deferred(function(r){e.each(i,function(i,u){var f=e.isFunction(n[u[4]])&&n[u[4]];t[u[1]](function(){var n=f&&f.apply(this,arguments);n&&e.isFunction(n.promise)?n.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[u[0]+"With"](this,f?[n]:arguments)})});n=null}).promise()},then:function(n,t,r){function o(n,t,i,r){return function(){var s=this,h=arguments,l=function(){var u,c;if(!(n<f)){if(u=i.apply(s,h),u===t.promise())throw new TypeError("Thenable self-resolution");c=u&&(typeof u=="object"||typeof u=="function")&&u.then;e.isFunction(c)?r?c.call(u,o(f,t,ut,r),o(f,t,dt,r)):(f++,c.call(u,o(f,t,ut,r),o(f,t,dt,r),o(f,t,ut,t.notifyWith))):(i!==ut&&(s=undefined,h=[u]),(r||t.resolveWith)(s,h))}},c=r?l:function(){try{l()}catch(r){e.Deferred.exceptionHook&&e.Deferred.exceptionHook(r,c.stackTrace);n+1>=f&&(i!==dt&&(s=undefined,h=[r]),t.rejectWith(s,h))}};n?c():(e.Deferred.getStackHook&&(c.stackTrace=e.Deferred.getStackHook()),u.setTimeout(c))}}var f=0;return e.Deferred(function(u){i[0][3].add(o(0,u,e.isFunction(r)?r:ut,u.notifyWith));i[1][3].add(o(0,u,e.isFunction(n)?n:ut));i[2][3].add(o(0,u,e.isFunction(t)?t:dt))}).promise()},promise:function(n){return n!=null?e.extend(n,r):r}},t={};return e.each(i,function(n,u){var e=u[2],o=u[5];r[u[1]]=e.add;o&&e.add(function(){f=o},i[3-n][2].disable,i[0][2].lock);e.add(u[3].fire);t[u[0]]=function(){return t[u[0]+"With"](this===t?undefined:this,arguments),this};t[u[0]+"With"]=e.fireWith}),r.promise(t),n&&n.call(t,t),t},when:function(n){var u=arguments.length,t=u,f=Array(t),r=g.call(arguments),i=e.Deferred(),o=function(n){return function(t){f[n]=this;r[n]=arguments.length>1?g.call(arguments):t;--u||i.resolveWith(f,r)}};if(u<=1&&(br(n,i.done(o(t)).resolve,i.reject,!u),i.state()==="pending"||e.isFunction(r[t]&&r[t].then)))return i.then();while(t--)br(r[t],o(t),i.reject);return i.promise()}});kr=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;e.Deferred.exceptionHook=function(n,t){u.console&&u.console.warn&&n&&kr.test(n.name)&&u.console.warn("jQuery.Deferred exception: "+n.message,n.stack,t)};e.readyException=function(n){u.setTimeout(function(){throw n;})};gt=e.Deferred();e.fn.ready=function(n){return gt.then(n).catch(function(n){e.readyException(n)}),this};e.extend({isReady:!1,readyWait:1,ready:function(n){(n===!0?--e.readyWait:e.isReady)||(e.isReady=!0,n!==!0&&--e.readyWait>0)||gt.resolveWith(s,[e])}});e.ready.then=gt.then;s.readyState!=="complete"&&(s.readyState==="loading"||s.documentElement.doScroll)?(s.addEventListener("DOMContentLoaded",ni),u.addEventListener("load",ni)):u.setTimeout(e.ready);b=function(n,t,i,r,u,f,o){var s=0,c=n.length,h=i==null;if(e.type(i)==="object"){u=!0;for(s in i)b(n,t,s,i[s],!0,f,o)}else if(r!==undefined&&(u=!0,e.isFunction(r)||(o=!0),h&&(o?(t.call(n,r),t=null):(h=t,t=function(n,t,i){return h.call(e(n),i)})),t))for(;s<c;s++)t(n[s],i,o?r:r.call(n[s],s,t(n[s],i)));return u?n:h?t.call(n):c?t(n[0],i):f};at=function(n){return n.nodeType===1||n.nodeType===9||!+n.nodeType};vt.uid=1;vt.prototype={cache:function(n){var t=n[this.expando];return t||(t={},at(n)&&(n.nodeType?n[this.expando]=t:Object.defineProperty(n,this.expando,{value:t,configurable:!0}))),t},set:function(n,t,i){var r,u=this.cache(n);if(typeof t=="string")u[e.camelCase(t)]=i;else for(r in t)u[e.camelCase(r)]=t[r];return u},get:function(n,t){return t===undefined?this.cache(n):n[this.expando]&&n[this.expando][e.camelCase(t)]},access:function(n,t,i){return t===undefined||t&&typeof t=="string"&&i===undefined?this.get(n,t):(this.set(n,t,i),i!==undefined?i:t)},remove:function(n,t){var r,i=n[this.expando];if(i!==undefined){if(t!==undefined)for(Array.isArray(t)?t=t.map(e.camelCase):(t=e.camelCase(t),t=t in i?[t]:t.match(v)||[]),r=t.length;r--;)delete i[t[r]];(t===undefined||e.isEmptyObject(i))&&(n.nodeType?n[this.expando]=undefined:delete n[this.expando])}},hasData:function(n){var t=n[this.expando];return t!==undefined&&!e.isEmptyObject(t)}};var o=new vt,c=new vt,fe=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ee=/[A-Z]/g;e.extend({hasData:function(n){return c.hasData(n)||o.hasData(n)},data:function(n,t,i){return c.access(n,t,i)},removeData:function(n,t){c.remove(n,t)},_data:function(n,t,i){return o.access(n,t,i)},_removeData:function(n,t){o.remove(n,t)}});e.fn.extend({data:function(n,t){var u,r,f,i=this[0],s=i&&i.attributes;if(n===undefined){if(this.length&&(f=c.get(i),i.nodeType===1&&!o.get(i,"hasDataAttrs"))){for(u=s.length;u--;)s[u]&&(r=s[u].name,r.indexOf("data-")===0&&(r=e.camelCase(r.slice(5)),dr(i,r,f[r])));o.set(i,"hasDataAttrs",!0)}return f}return typeof n=="object"?this.each(function(){c.set(this,n)}):b(this,function(t){var r;if(i&&t===undefined)return(r=c.get(i,n),r!==undefined)?r:(r=dr(i,n),r!==undefined)?r:void 0;this.each(function(){c.set(this,n,t)})},null,t,arguments.length>1,null,!0)},removeData:function(n){return this.each(function(){c.remove(this,n)})}});e.extend({queue:function(n,t,i){var r;if(n)return t=(t||"fx")+"queue",r=o.get(n,t),i&&(!r||Array.isArray(i)?r=o.access(n,t,e.makeArray(i)):r.push(i)),r||[]},dequeue:function(n,t){t=t||"fx";var i=e.queue(n,t),f=i.length,r=i.shift(),u=e._queueHooks(n,t),o=function(){e.dequeue(n,t)};r==="inprogress"&&(r=i.shift(),f--);r&&(t==="fx"&&i.unshift("inprogress"),delete u.stop,r.call(n,o,u));!f&&u&&u.empty.fire()},_queueHooks:function(n,t){var i=t+"queueHooks";return o.get(n,i)||o.access(n,i,{empty:e.Callbacks("once memory").add(function(){o.remove(n,[t+"queue",i])})})}});e.fn.extend({queue:function(n,t){var i=2;return(typeof n!="string"&&(t=n,n="fx",i--),arguments.length<i)?e.queue(this[0],n):t===undefined?this:this.each(function(){var i=e.queue(this,n,t);e._queueHooks(this,n);n==="fx"&&i[0]!=="inprogress"&&e.dequeue(this,n)})},dequeue:function(n){return this.each(function(){e.dequeue(this,n)})},clearQueue:function(n){return this.queue(n||"fx",[])},promise:function(n,t){var i,u=1,f=e.Deferred(),r=this,s=this.length,h=function(){--u||f.resolveWith(r,[r])};for(typeof n!="string"&&(t=n,n=undefined),n=n||"fx";s--;)i=o.get(r[s],n+"queueHooks"),i&&i.empty&&(u++,i.empty.add(h));return h(),f.promise(t)}});var gr=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,yt=new RegExp("^(?:([+-])=|)("+gr+")([a-z%]*)$","i"),nt=["Top","Right","Bottom","Left"],ti=function(n,t){return n=t||n,n.style.display==="none"||n.style.display===""&&e.contains(n.ownerDocument,n)&&e.css(n,"display")==="none"},nu=function(n,t,i,r){var f,u,e={};for(u in t)e[u]=n.style[u],n.style[u]=t[u];f=i.apply(n,r||[]);for(u in t)n.style[u]=e[u];return f};ai={};e.fn.extend({show:function(){return ft(this,!0)},hide:function(){return ft(this)},toggle:function(n){return typeof n=="boolean"?n?this.show():this.hide():this.each(function(){ti(this)?e(this).show():e(this).hide()})}});var iu=/^(?:checkbox|radio)$/i,ru=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,uu=/^$|\/(?:java|ecma)script/i,y={option:[1,"<select multiple='multiple'>","<\/select>"],thead:[1,"<table>","<\/table>"],col:[2,"<table><colgroup>","<\/colgroup><\/table>"],tr:[2,"<table><tbody>","<\/tbody><\/table>"],td:[3,"<table><tbody><tr>","<\/tr><\/tbody><\/table>"],_default:[0,"",""]};y.optgroup=y.option;y.tbody=y.tfoot=y.colgroup=y.caption=y.thead;y.th=y.td;fu=/<|&#?\w+;/,function(){var i=s.createDocumentFragment(),n=i.appendChild(s.createElement("div")),t=s.createElement("input");t.setAttribute("type","radio");t.setAttribute("checked","checked");t.setAttribute("name","t");n.appendChild(t);h.checkClone=n.cloneNode(!0).cloneNode(!0).lastChild.checked;n.innerHTML="<textarea>x<\/textarea>";h.noCloneChecked=!!n.cloneNode(!0).lastChild.defaultValue}();var ii=s.documentElement,he=/^key/,ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ou=/^([^.]*)(?:\.(.+)|)/;e.event={global:{},add:function(n,t,i,r,u){var a,y,w,p,b,h,s,c,f,k,d,l=o.get(n);if(l)for(i.handler&&(a=i,i=a.handler,u=a.selector),u&&e.find.matchesSelector(ii,u),i.guid||(i.guid=e.guid++),(p=l.events)||(p=l.events={}),(y=l.handle)||(y=l.handle=function(t){return typeof e!="undefined"&&e.event.triggered!==t.type?e.event.dispatch.apply(n,arguments):undefined}),t=(t||"").match(v)||[""],b=t.length;b--;)(w=ou.exec(t[b])||[],f=d=w[1],k=(w[2]||"").split(".").sort(),f)&&(s=e.event.special[f]||{},f=(u?s.delegateType:s.bindType)||f,s=e.event.special[f]||{},h=e.extend({type:f,origType:d,data:r,handler:i,guid:i.guid,selector:u,needsContext:u&&e.expr.match.needsContext.test(u),namespace:k.join(".")},a),(c=p[f])||(c=p[f]=[],c.delegateCount=0,s.setup&&s.setup.call(n,r,k,y)!==!1||n.addEventListener&&n.addEventListener(f,y)),s.add&&(s.add.call(n,h),h.handler.guid||(h.handler.guid=i.guid)),u?c.splice(c.delegateCount++,0,h):c.push(h),e.event.global[f]=!0)},remove:function(n,t,i,r,u){var y,k,h,a,p,s,c,l,f,b,d,w=o.hasData(n)&&o.get(n);if(w&&(a=w.events)){for(t=(t||"").match(v)||[""],p=t.length;p--;){if(h=ou.exec(t[p])||[],f=d=h[1],b=(h[2]||"").split(".").sort(),!f){for(f in a)e.event.remove(n,f+t[p],i,r,!0);continue}for(c=e.event.special[f]||{},f=(r?c.delegateType:c.bindType)||f,l=a[f]||[],h=h[2]&&new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"),k=y=l.length;y--;)s=l[y],(u||d===s.origType)&&(!i||i.guid===s.guid)&&(!h||h.test(s.namespace))&&(!r||r===s.selector||r==="**"&&s.selector)&&(l.splice(y,1),s.selector&&l.delegateCount--,c.remove&&c.remove.call(n,s));k&&!l.length&&(c.teardown&&c.teardown.call(n,b,w.handle)!==!1||e.removeEvent(n,f,w.handle),delete a[f])}e.isEmptyObject(a)&&o.remove(n,"handle events")}},dispatch:function(n){var t=e.event.fix(n),i,c,s,u,r,l,h=new Array(arguments.length),a=(o.get(this,"events")||{})[t.type]||[],f=e.event.special[t.type]||{};for(h[0]=t,i=1;i<arguments.length;i++)h[i]=arguments[i];if(t.delegateTarget=this,!f.preDispatch||f.preDispatch.call(this,t)!==!1){for(l=e.event.handlers.call(this,t,a),i=0;(u=l[i++])&&!t.isPropagationStopped();)for(t.currentTarget=u.elem,c=0;(r=u.handlers[c++])&&!t.isImmediatePropagationStopped();)(!t.rnamespace||t.rnamespace.test(r.namespace))&&(t.handleObj=r,t.data=r.data,s=((e.event.special[r.origType]||{}).handle||r.handler).apply(u.elem,h),s!==undefined&&(t.result=s)===!1&&(t.preventDefault(),t.stopPropagation()));return f.postDispatch&&f.postDispatch.call(this,t),t.result}},handlers:function(n,t){var u,f,r,o,s,c=[],h=t.delegateCount,i=n.target;if(h&&i.nodeType&&!(n.type==="click"&&n.button>=1))for(;i!==this;i=i.parentNode||this)if(i.nodeType===1&&!(n.type==="click"&&i.disabled===!0)){for(o=[],s={},u=0;u<h;u++)f=t[u],r=f.selector+" ",s[r]===undefined&&(s[r]=f.needsContext?e(r,this).index(i)>-1:e.find(r,this,null,[i]).length),s[r]&&o.push(f);o.length&&c.push({elem:i,handlers:o})}return i=this,h<t.length&&c.push({elem:i,handlers:t.slice(h)}),c},addProp:function(n,t){Object.defineProperty(e.Event.prototype,n,{enumerable:!0,configurable:!0,get:e.isFunction(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[n]},set:function(t){Object.defineProperty(this,n,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(n){return n[e.expando]?n:new e.Event(n)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==su()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===su()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if(this.type==="checkbox"&&this.click&&p(this,"input"))return this.click(),!1},_default:function(n){return p(n.target,"a")}},beforeunload:{postDispatch:function(n){n.result!==undefined&&n.originalEvent&&(n.originalEvent.returnValue=n.result)}}}};e.removeEvent=function(n,t,i){n.removeEventListener&&n.removeEventListener(t,i)};e.Event=function(n,t){if(!(this instanceof e.Event))return new e.Event(n,t);n&&n.type?(this.originalEvent=n,this.type=n.type,this.isDefaultPrevented=n.defaultPrevented||n.defaultPrevented===undefined&&n.returnValue===!1?ri:et,this.target=n.target&&n.target.nodeType===3?n.target.parentNode:n.target,this.currentTarget=n.currentTarget,this.relatedTarget=n.relatedTarget):this.type=n;t&&e.extend(this,t);this.timeStamp=n&&n.timeStamp||e.now();this[e.expando]=!0};e.Event.prototype={constructor:e.Event,isDefaultPrevented:et,isPropagationStopped:et,isImmediatePropagationStopped:et,isSimulated:!1,preventDefault:function(){var n=this.originalEvent;this.isDefaultPrevented=ri;n&&!this.isSimulated&&n.preventDefault()},stopPropagation:function(){var n=this.originalEvent;this.isPropagationStopped=ri;n&&!this.isSimulated&&n.stopPropagation()},stopImmediatePropagation:function(){var n=this.originalEvent;this.isImmediatePropagationStopped=ri;n&&!this.isSimulated&&n.stopImmediatePropagation();this.stopPropagation()}};e.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(n){var t=n.button;return n.which==null&&he.test(n.type)?n.charCode!=null?n.charCode:n.keyCode:!n.which&&t!==undefined&&ce.test(n.type)?t&1?1:t&2?3:t&4?2:0:n.which}},e.event.addProp);e.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(n,t){e.event.special[n]={delegateType:t,bindType:t,handle:function(n){var r,u=this,i=n.relatedTarget,f=n.handleObj;return i&&(i===u||e.contains(u,i))||(n.type=f.origType,r=f.handler.apply(this,arguments),n.type=t),r}}});e.fn.extend({on:function(n,t,i,r){return yi(this,n,t,i,r)},one:function(n,t,i,r){return yi(this,n,t,i,r,1)},off:function(n,t,i){var r,u;if(n&&n.preventDefault&&n.handleObj)return r=n.handleObj,e(n.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if(typeof n=="object"){for(u in n)this.off(u,t,n[u]);return this}return(t===!1||typeof t=="function")&&(i=t,t=undefined),i===!1&&(i=et),this.each(function(){e.event.remove(this,n,i,t)})}});var le=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,ae=/<script|<style|<link/i,ve=/checked\s*(?:[^=]|=\s*.checked.)/i,ye=/^true\/(.*)/,pe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;e.extend({htmlPrefilter:function(n){return n.replace(le,"<$1><\/$2>")},clone:function(n,t,i){var r,s,f,u,o=n.cloneNode(!0),c=e.contains(n.ownerDocument,n);if(!h.noCloneChecked&&(n.nodeType===1||n.nodeType===11)&&!e.isXMLDoc(n))for(u=l(o),f=l(n),r=0,s=f.length;r<s;r++)ke(f[r],u[r]);if(t)if(i)for(f=f||l(n),u=u||l(o),r=0,s=f.length;r<s;r++)cu(f[r],u[r]);else cu(n,o);return u=l(o,"script"),u.length>0&&vi(u,!c&&l(n,"script")),o},cleanData:function(n){for(var i,t,r,f=e.event.special,u=0;(t=n[u])!==undefined;u++)if(at(t)){if(i=t[o.expando]){if(i.events)for(r in i.events)f[r]?e.event.remove(t,r):e.removeEvent(t,r,i.handle);t[o.expando]=undefined}t[c.expando]&&(t[c.expando]=undefined)}}});e.fn.extend({detach:function(n){return lu(this,n,!0)},remove:function(n){return lu(this,n)},text:function(n){return b(this,function(n){return n===undefined?e.text(this):this.empty().each(function(){(this.nodeType===1||this.nodeType===11||this.nodeType===9)&&(this.textContent=n)})},null,n,arguments.length)},append:function(){return ot(this,arguments,function(n){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=hu(this,n);t.appendChild(n)}})},prepend:function(){return ot(this,arguments,function(n){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=hu(this,n);t.insertBefore(n,t.firstChild)}})},before:function(){return ot(this,arguments,function(n){this.parentNode&&this.parentNode.insertBefore(n,this)})},after:function(){return ot(this,arguments,function(n){this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling)})},empty:function(){for(var n,t=0;(n=this[t])!=null;t++)n.nodeType===1&&(e.cleanData(l(n,!1)),n.textContent="");return this},clone:function(n,t){return n=n==null?!1:n,t=t==null?n:t,this.map(function(){return e.clone(this,n,t)})},html:function(n){return b(this,function(n){var t=this[0]||{},i=0,r=this.length;if(n===undefined&&t.nodeType===1)return t.innerHTML;if(typeof n=="string"&&!ae.test(n)&&!y[(ru.exec(n)||["",""])[1].toLowerCase()]){n=e.htmlPrefilter(n);try{for(;i<r;i++)t=this[i]||{},t.nodeType===1&&(e.cleanData(l(t,!1)),t.innerHTML=n);t=0}catch(u){}}t&&this.empty().append(n)},null,n,arguments.length)},replaceWith:function(){var n=[];return ot(this,arguments,function(t){var i=this.parentNode;e.inArray(this,n)<0&&(e.cleanData(l(this)),i&&i.replaceChild(t,this))},n)}});e.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(n,t){e.fn[n]=function(n){for(var r,u=[],f=e(n),o=f.length-1,i=0;i<=o;i++)r=i===o?this:this.clone(!0),e(f[i])[t](r),si.apply(u,r.get());return this.pushStack(u)}});var au=/^margin/,pi=new RegExp("^("+gr+")(?!px)[a-z%]+$","i"),ui=function(n){var t=n.ownerDocument.defaultView;return t&&t.opener||(t=u),t.getComputedStyle(n)};(function(){function t(){if(n){n.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%";n.innerHTML="";ii.appendChild(i);var t=u.getComputedStyle(n);r=t.top!=="1%";c=t.marginLeft==="2px";f=t.width==="4px";n.style.marginRight="50%";o=t.marginRight==="4px";ii.removeChild(i);n=null}}var r,f,o,c,i=s.createElement("div"),n=s.createElement("div");n.style&&(n.style.backgroundClip="content-box",n.cloneNode(!0).style.backgroundClip="",h.clearCloneStyle=n.style.backgroundClip==="content-box",i.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",i.appendChild(n),e.extend(h,{pixelPosition:function(){return t(),r},boxSizingReliable:function(){return t(),f},pixelMarginRight:function(){return t(),o},reliableMarginLeft:function(){return t(),c}}))})();var de=/^(none|table(?!-c[ea]).+)/,yu=/^--/,ge={position:"absolute",visibility:"hidden",display:"block"},pu={letterSpacing:"0",fontWeight:"400"},wu=["Webkit","Moz","ms"],bu=s.createElement("div").style;e.extend({cssHooks:{opacity:{get:function(n,t){if(t){var i=pt(n,"opacity");return i===""?"1":i}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:"cssFloat"},style:function(n,t,i,r){if(n&&n.nodeType!==3&&n.nodeType!==8&&n.style){var u,o,f,c=e.camelCase(t),l=yu.test(t),s=n.style;if(l||(t=ku(c)),f=e.cssHooks[t]||e.cssHooks[c],i!==undefined){if(o=typeof i,o==="string"&&(u=yt.exec(i))&&u[1]&&(i=tu(n,t,u),o="number"),i==null||i!==i)return;o==="number"&&(i+=u&&u[3]||(e.cssNumber[c]?"":"px"));h.clearCloneStyle||i!==""||t.indexOf("background")!==0||(s[t]="inherit");f&&"set"in f&&(i=f.set(n,i,r))===undefined||(l?s.setProperty(t,i):s[t]=i)}else return f&&"get"in f&&(u=f.get(n,!1,r))!==undefined?u:s[t]}},css:function(n,t,i,r){var u,o,f,s=e.camelCase(t),h=yu.test(t);return(h||(t=ku(s)),f=e.cssHooks[t]||e.cssHooks[s],f&&"get"in f&&(u=f.get(n,!0,i)),u===undefined&&(u=pt(n,t,r)),u==="normal"&&t in pu&&(u=pu[t]),i===""||i)?(o=parseFloat(u),i===!0||isFinite(o)?o||0:u):u}});e.each(["height","width"],function(n,t){e.cssHooks[t]={get:function(n,i,r){if(i)return de.test(e.css(n,"display"))&&(!n.getClientRects().length||!n.getBoundingClientRect().width)?nu(n,ge,function(){return nf(n,t,r)}):nf(n,t,r)},set:function(n,i,r){var u,f=r&&ui(n),o=r&&gu(n,t,r,e.css(n,"boxSizing",!1,f)==="border-box",f);return o&&(u=yt.exec(i))&&(u[3]||"px")!=="px"&&(n.style[t]=i,i=e.css(n,t)),du(n,i,o)}}});e.cssHooks.marginLeft=vu(h.reliableMarginLeft,function(n,t){if(t)return(parseFloat(pt(n,"marginLeft"))||n.getBoundingClientRect().left-nu(n,{marginLeft:0},function(){return n.getBoundingClientRect().left}))+"px"});e.each({margin:"",padding:"",border:"Width"},function(n,t){e.cssHooks[n+t]={expand:function(i){for(var r=0,f={},u=typeof i=="string"?i.split(" "):[i];r<4;r++)f[n+nt[r]+t]=u[r]||u[r-2]||u[0];return f}};au.test(n)||(e.cssHooks[n+t].set=du)});e.fn.extend({css:function(n,t){return b(this,function(n,t,i){var u,f,o={},r=0;if(Array.isArray(t)){for(u=ui(n),f=t.length;r<f;r++)o[t[r]]=e.css(n,t[r],!1,u);return o}return i!==undefined?e.style(n,t,i):e.css(n,t)},n,t,arguments.length>1)}});e.Tween=a;a.prototype={constructor:a,init:function(n,t,i,r,u,f){this.elem=n;this.prop=i;this.easing=u||e.easing._default;this.options=t;this.start=this.now=this.cur();this.end=r;this.unit=f||(e.cssNumber[i]?"":"px")},cur:function(){var n=a.propHooks[this.prop];return n&&n.get?n.get(this):a.propHooks._default.get(this)},run:function(n){var t,i=a.propHooks[this.prop];return this.pos=this.options.duration?t=e.easing[this.easing](n,this.options.duration*n,0,1,this.options.duration):t=n,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):a.propHooks._default.set(this),this}};a.prototype.init.prototype=a.prototype;a.propHooks={_default:{get:function(n){var t;return n.elem.nodeType!==1||n.elem[n.prop]!=null&&n.elem.style[n.prop]==null?n.elem[n.prop]:(t=e.css(n.elem,n.prop,""),!t||t==="auto"?0:t)},set:function(n){e.fx.step[n.prop]?e.fx.step[n.prop](n):n.elem.nodeType===1&&(n.elem.style[e.cssProps[n.prop]]!=null||e.cssHooks[n.prop])?e.style(n.elem,n.prop,n.now+n.unit):n.elem[n.prop]=n.now}}};a.propHooks.scrollTop=a.propHooks.scrollLeft={set:function(n){n.elem.nodeType&&n.elem.parentNode&&(n.elem[n.prop]=n.now)}};e.easing={linear:function(n){return n},swing:function(n){return.5-Math.cos(n*Math.PI)/2},_default:"swing"};e.fx=a.prototype.init;e.fx.step={};tf=/^(?:toggle|show|hide)$/;rf=/queueHooks$/;e.Animation=e.extend(w,{tweeners:{"*":[function(n,t){var i=this.createTween(n,t);return tu(i.elem,n,yt.exec(t),i),i}]},tweener:function(n,t){e.isFunction(n)?(t=n,n=["*"]):n=n.match(v);for(var i,r=0,u=n.length;r<u;r++)i=n[r],w.tweeners[i]=w.tweeners[i]||[],w.tweeners[i].unshift(t)},prefilters:[to],prefilter:function(n,t){t?w.prefilters.unshift(n):w.prefilters.push(n)}});e.speed=function(n,t,i){var r=n&&typeof n=="object"?e.extend({},n):{complete:i||!i&&t||e.isFunction(n)&&n,duration:n,easing:i&&t||t&&!e.isFunction(t)&&t};return e.fx.off?r.duration=0:typeof r.duration!="number"&&(r.duration=r.duration in e.fx.speeds?e.fx.speeds[r.duration]:e.fx.speeds._default),(r.queue==null||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){e.isFunction(r.old)&&r.old.call(this);r.queue&&e.dequeue(this,r.queue)},r};e.fn.extend({fadeTo:function(n,t,i,r){return this.filter(ti).css("opacity",0).show().end().animate({opacity:t},n,i,r)},animate:function(n,t,i,r){var s=e.isEmptyObject(n),f=e.speed(t,i,r),u=function(){var t=w(this,e.extend({},n),f);(s||o.get(this,"finish"))&&t.stop(!0)};return u.finish=u,s||f.queue===!1?this.each(u):this.queue(f.queue,u)},stop:function(n,t,i){var r=function(n){var t=n.stop;delete n.stop;t(i)};return typeof n!="string"&&(i=t,t=n,n=undefined),t&&n!==!1&&this.queue(n||"fx",[]),this.each(function(){var s=!0,t=n!=null&&n+"queueHooks",f=e.timers,u=o.get(this);if(t)u[t]&&u[t].stop&&r(u[t]);else for(t in u)u[t]&&u[t].stop&&rf.test(t)&&r(u[t]);for(t=f.length;t--;)f[t].elem===this&&(n==null||f[t].queue===n)&&(f[t].anim.stop(i),s=!1,f.splice(t,1));(s||!i)&&e.dequeue(this,n)})},finish:function(n){return n!==!1&&(n=n||"fx"),this.each(function(){var t,u=o.get(this),i=u[n+"queue"],f=u[n+"queueHooks"],r=e.timers,s=i?i.length:0;for(u.finish=!0,e.queue(this,n,[]),f&&f.stop&&f.stop.call(this,!0),t=r.length;t--;)r[t].elem===this&&r[t].queue===n&&(r[t].anim.stop(!0),r.splice(t,1));for(t=0;t<s;t++)i[t]&&i[t].finish&&i[t].finish.call(this);delete u.finish})}});e.each(["toggle","show","hide"],function(n,t){var i=e.fn[t];e.fn[t]=function(n,r,u){return n==null||typeof n=="boolean"?i.apply(this,arguments):this.animate(ei(t,!0),n,r,u)}});e.each({slideDown:ei("show"),slideUp:ei("hide"),slideToggle:ei("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(n,t){e.fn[n]=function(n,i,r){return this.animate(t,n,i,r)}});e.timers=[];e.fx.tick=function(){var i,n=0,t=e.timers;for(st=e.now();n<t.length;n++)i=t[n],i()||t[n]!==i||t.splice(n--,1);t.length||e.fx.stop();st=undefined};e.fx.timer=function(n){e.timers.push(n);e.fx.start()};e.fx.interval=13;e.fx.start=function(){fi||(fi=!0,wi())};e.fx.stop=function(){fi=null};e.fx.speeds={slow:600,fast:200,_default:400};e.fn.delay=function(n,t){return n=e.fx?e.fx.speeds[n]||n:n,t=t||"fx",this.queue(t,function(t,i){var r=u.setTimeout(t,n);i.stop=function(){u.clearTimeout(r)}})},function(){var n=s.createElement("input"),t=s.createElement("select"),i=t.appendChild(s.createElement("option"));n.type="checkbox";h.checkOn=n.value!=="";h.optSelected=i.selected;n=s.createElement("input");n.value="t";n.type="radio";h.radioValue=n.value==="t"}();ht=e.expr.attrHandle;e.fn.extend({attr:function(n,t){return b(this,e.attr,n,t,arguments.length>1)},removeAttr:function(n){return this.each(function(){e.removeAttr(this,n)})}});e.extend({attr:function(n,t,i){var r,u,f=n.nodeType;if(f!==3&&f!==8&&f!==2){if(typeof n.getAttribute=="undefined")return e.prop(n,t,i);if(f===1&&e.isXMLDoc(n)||(u=e.attrHooks[t.toLowerCase()]||(e.expr.match.bool.test(t)?ef:undefined)),i!==undefined){if(i===null){e.removeAttr(n,t);return}return u&&"set"in u&&(r=u.set(n,i,t))!==undefined?r:(n.setAttribute(t,i+""),i)}return u&&"get"in u&&(r=u.get(n,t))!==null?r:(r=e.find.attr(n,t),r==null?undefined:r)}},attrHooks:{type:{set:function(n,t){if(!h.radioValue&&t==="radio"&&p(n,"input")){var i=n.value;return n.setAttribute("type",t),i&&(n.value=i),t}}}},removeAttr:function(n,t){var i,u=0,r=t&&t.match(v);if(r&&n.nodeType===1)while(i=r[u++])n.removeAttribute(i)}});ef={set:function(n,t,i){return t===!1?e.removeAttr(n,i):n.setAttribute(i,i),i}};e.each(e.expr.match.bool.source.match(/\w+/g),function(n,t){var i=ht[t]||e.find.attr;ht[t]=function(n,t,r){var f,e,u=t.toLowerCase();return r||(e=ht[u],ht[u]=f,f=i(n,t,r)!=null?u:null,ht[u]=e),f}});of=/^(?:input|select|textarea|button)$/i;sf=/^(?:a|area)$/i;e.fn.extend({prop:function(n,t){return b(this,e.prop,n,t,arguments.length>1)},removeProp:function(n){return this.each(function(){delete this[e.propFix[n]||n]})}});e.extend({prop:function(n,t,i){var u,r,f=n.nodeType;if(f!==3&&f!==8&&f!==2)return(f===1&&e.isXMLDoc(n)||(t=e.propFix[t]||t,r=e.propHooks[t]),i!==undefined)?r&&"set"in r&&(u=r.set(n,i,t))!==undefined?u:n[t]=i:r&&"get"in r&&(u=r.get(n,t))!==null?u:n[t]},propHooks:{tabIndex:{get:function(n){var t=e.find.attr(n,"tabindex");return t?parseInt(t,10):of.test(n.nodeName)||sf.test(n.nodeName)&&n.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}});h.optSelected||(e.propHooks.selected={get:function(n){var t=n.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(n){var t=n.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}});e.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){e.propFix[this.toLowerCase()]=this});e.fn.extend({addClass:function(n){var o,i,t,r,u,s,f,h=0;if(e.isFunction(n))return this.each(function(t){e(this).addClass(n.call(this,t,it(this)))});if(typeof n=="string"&&n)for(o=n.match(v)||[];i=this[h++];)if(r=it(i),t=i.nodeType===1&&" "+tt(r)+" ",t){for(s=0;u=o[s++];)t.indexOf(" "+u+" ")<0&&(t+=u+" ");f=tt(t);r!==f&&i.setAttribute("class",f)}return this},removeClass:function(n){var o,i,t,r,u,s,f,h=0;if(e.isFunction(n))return this.each(function(t){e(this).removeClass(n.call(this,t,it(this)))});if(!arguments.length)return this.attr("class","");if(typeof n=="string"&&n)for(o=n.match(v)||[];i=this[h++];)if(r=it(i),t=i.nodeType===1&&" "+tt(r)+" ",t){for(s=0;u=o[s++];)while(t.indexOf(" "+u+" ")>-1)t=t.replace(" "+u+" "," ");f=tt(t);r!==f&&i.setAttribute("class",f)}return this},toggleClass:function(n,t){var i=typeof n;return typeof t=="boolean"&&i==="string"?t?this.addClass(n):this.removeClass(n):e.isFunction(n)?this.each(function(i){e(this).toggleClass(n.call(this,i,it(this),t),t)}):this.each(function(){var t,u,r,f;if(i==="string")for(u=0,r=e(this),f=n.match(v)||[];t=f[u++];)r.hasClass(t)?r.removeClass(t):r.addClass(t);else(n===undefined||i==="boolean")&&(t=it(this),t&&o.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||n===!1?"":o.get(this,"__className__")||""))})},hasClass:function(n){for(var t,r=0,i=" "+n+" ";t=this[r++];)if(t.nodeType===1&&(" "+tt(it(t))+" ").indexOf(i)>-1)return!0;return!1}});hf=/\r/g;e.fn.extend({val:function(n){var t,i,u,r=this[0];return arguments.length?(u=e.isFunction(n),this.each(function(i){var r;this.nodeType===1&&(r=u?n.call(this,i,e(this).val()):n,r==null?r="":typeof r=="number"?r+="":Array.isArray(r)&&(r=e.map(r,function(n){return n==null?"":n+""})),t=e.valHooks[this.type]||e.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&t.set(this,r,"value")!==undefined||(this.value=r))})):r?(t=e.valHooks[r.type]||e.valHooks[r.nodeName.toLowerCase()],t&&"get"in t&&(i=t.get(r,"value"))!==undefined)?i:(i=r.value,typeof i=="string")?i.replace(hf,""):i==null?"":i:void 0}});e.extend({valHooks:{option:{get:function(n){var t=e.find.attr(n,"value");return t!=null?t:tt(e.text(n))}},select:{get:function(n){for(var f,t,o=n.options,r=n.selectedIndex,u=n.type==="select-one",s=u?null:[],h=u?r+1:o.length,i=r<0?h:u?r:0;i<h;i++)if(t=o[i],(t.selected||i===r)&&!t.disabled&&(!t.parentNode.disabled||!p(t.parentNode,"optgroup"))){if(f=e(t).val(),u)return f;s.push(f)}return s},set:function(n,t){for(var r,i,u=n.options,f=e.makeArray(t),o=u.length;o--;)i=u[o],(i.selected=e.inArray(e.valHooks.option.get(i),f)>-1)&&(r=!0);return r||(n.selectedIndex=-1),f}}}});e.each(["radio","checkbox"],function(){e.valHooks[this]={set:function(n,t){if(Array.isArray(t))return n.checked=e.inArray(e(n).val(),t)>-1}};h.checkOn||(e.valHooks[this].get=function(n){return n.getAttribute("value")===null?"on":n.value})});bi=/^(?:focusinfocus|focusoutblur)$/;e.extend(e.event,{trigger:function(n,t,i,r){var w,f,c,b,a,v,l,p=[i||s],h=kt.call(n,"type")?n.type:n,y=kt.call(n,"namespace")?n.namespace.split("."):[];if((f=c=i=i||s,i.nodeType!==3&&i.nodeType!==8)&&!bi.test(h+e.event.triggered)&&(h.indexOf(".")>-1&&(y=h.split("."),h=y.shift(),y.sort()),a=h.indexOf(":")<0&&"on"+h,n=n[e.expando]?n:new e.Event(h,typeof n=="object"&&n),n.isTrigger=r?2:3,n.namespace=y.join("."),n.rnamespace=n.namespace?new RegExp("(^|\\.)"+y.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=undefined,n.target||(n.target=i),t=t==null?[n]:e.makeArray(t,[n]),l=e.event.special[h]||{},r||!l.trigger||l.trigger.apply(i,t)!==!1)){if(!r&&!l.noBubble&&!e.isWindow(i)){for(b=l.delegateType||h,bi.test(b+h)||(f=f.parentNode);f;f=f.parentNode)p.push(f),c=f;c===(i.ownerDocument||s)&&p.push(c.defaultView||c.parentWindow||u)}for(w=0;(f=p[w++])&&!n.isPropagationStopped();)n.type=w>1?b:l.bindType||h,v=(o.get(f,"events")||{})[n.type]&&o.get(f,"handle"),v&&v.apply(f,t),v=a&&f[a],v&&v.apply&&at(f)&&(n.result=v.apply(f,t),n.result===!1&&n.preventDefault());return n.type=h,r||n.isDefaultPrevented()||(!l._default||l._default.apply(p.pop(),t)===!1)&&at(i)&&a&&e.isFunction(i[h])&&!e.isWindow(i)&&(c=i[a],c&&(i[a]=null),e.event.triggered=h,i[h](),e.event.triggered=undefined,c&&(i[a]=c)),n.result}},simulate:function(n,t,i){var r=e.extend(new e.Event,i,{type:n,isSimulated:!0});e.event.trigger(r,null,t)}});e.fn.extend({trigger:function(n,t){return this.each(function(){e.event.trigger(n,t,this)})},triggerHandler:function(n,t){var i=this[0];if(i)return e.event.trigger(n,t,i,!0)}});e.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(n,t){e.fn[t]=function(n,i){return arguments.length>0?this.on(t,null,n,i):this.trigger(t)}});e.fn.extend({hover:function(n,t){return this.mouseenter(n).mouseleave(t||n)}});h.focusin="onfocusin"in u;h.focusin||e.each({focus:"focusin",blur:"focusout"},function(n,t){var i=function(n){e.event.simulate(t,n.target,e.event.fix(n))};e.event.special[t]={setup:function(){var r=this.ownerDocument||this,u=o.access(r,t);u||r.addEventListener(n,i,!0);o.access(r,t,(u||0)+1)},teardown:function(){var r=this.ownerDocument||this,u=o.access(r,t)-1;u?o.access(r,t,u):(r.removeEventListener(n,i,!0),o.remove(r,t))}}});var wt=u.location,cf=e.now(),ki=/\?/;e.parseXML=function(n){var t;if(!n||typeof n!="string")return null;try{t=(new u.DOMParser).parseFromString(n,"text/xml")}catch(i){t=undefined}return(!t||t.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+n),t};var ro=/\[\]$/,lf=/\r?\n/g,uo=/^(?:submit|button|image|reset|file)$/i,fo=/^(?:input|select|textarea|keygen)/i;e.param=function(n,t){var i,r=[],u=function(n,t){var i=e.isFunction(t)?t():t;r[r.length]=encodeURIComponent(n)+"="+encodeURIComponent(i==null?"":i)};if(Array.isArray(n)||n.jquery&&!e.isPlainObject(n))e.each(n,function(){u(this.name,this.value)});else for(i in n)di(i,n[i],t,u);return r.join("&")};e.fn.extend({serialize:function(){return e.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var n=e.prop(this,"elements");return n?e.makeArray(n):this}).filter(function(){var n=this.type;return this.name&&!e(this).is(":disabled")&&fo.test(this.nodeName)&&!uo.test(n)&&(this.checked||!iu.test(n))}).map(function(n,t){var i=e(this).val();return i==null?null:Array.isArray(i)?e.map(i,function(n){return{name:t.name,value:n.replace(lf,"\r\n")}}):{name:t.name,value:i.replace(lf,"\r\n")}}).get()}});var eo=/%20/g,oo=/#.*$/,so=/([?&])_=[^&]*/,ho=/^(.*?):[ \t]*([^\r\n]*)$/mg,co=/^(?:GET|HEAD)$/,lo=/^\/\//,af={},gi={},vf="*/".concat("*"),nr=s.createElement("a");return nr.href=wt.href,e.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:wt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(wt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":vf,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":e.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(n,t){return t?tr(tr(n,e.ajaxSettings),t):tr(e.ajaxSettings,n)},ajaxPrefilter:yf(af),ajaxTransport:yf(gi),ajax:function(n,t){function b(n,t,s,l){var y,rt,g,p,b,v=t;o||(o=!0,d&&u.clearTimeout(d),c=undefined,k=l||"",r.readyState=n>0?4:0,y=n>=200&&n<300||n===304,s&&(p=ao(i,r,s)),p=vo(i,p,r,y),y?(i.ifModified&&(b=r.getResponseHeader("Last-Modified"),b&&(e.lastModified[f]=b),b=r.getResponseHeader("etag"),b&&(e.etag[f]=b)),n===204||i.type==="HEAD"?v="nocontent":n===304?v="notmodified":(v=p.state,rt=p.data,g=p.error,y=!g)):(g=v,(n||!v)&&(v="error",n<0&&(n=0))),r.status=n,r.statusText=(t||v)+"",y?tt.resolveWith(h,[rt,v,r]):tt.rejectWith(h,[r,v,g]),r.statusCode(w),w=undefined,a&&nt.trigger(y?"ajaxSuccess":"ajaxError",[r,i,y?rt:g]),it.fireWith(h,[r,v]),a&&(nt.trigger("ajaxComplete",[r,i]),--e.active||e.event.trigger("ajaxStop")))}typeof n=="object"&&(t=n,n=undefined);t=t||{};var c,f,k,y,d,l,o,a,g,p,i=e.ajaxSetup({},t),h=i.context||i,nt=i.context&&(h.nodeType||h.jquery)?e(h):e.event,tt=e.Deferred(),it=e.Callbacks("once memory"),w=i.statusCode||{},rt={},ut={},ft="canceled",r={readyState:0,getResponseHeader:function(n){var t;if(o){if(!y)for(y={};t=ho.exec(k);)y[t[1].toLowerCase()]=t[2];t=y[n.toLowerCase()]}return t==null?null:t},getAllResponseHeaders:function(){return o?k:null},setRequestHeader:function(n,t){return o==null&&(n=ut[n.toLowerCase()]=ut[n.toLowerCase()]||n,rt[n]=t),this},overrideMimeType:function(n){return o==null&&(i.mimeType=n),this},statusCode:function(n){var t;if(n)if(o)r.always(n[r.status]);else for(t in n)w[t]=[w[t],n[t]];return this},abort:function(n){var t=n||ft;return c&&c.abort(t),b(0,t),this}};if(tt.promise(r),i.url=((n||i.url||wt.href)+"").replace(lo,wt.protocol+"//"),i.type=t.method||t.type||i.method||i.type,i.dataTypes=(i.dataType||"*").toLowerCase().match(v)||[""],i.crossDomain==null){l=s.createElement("a");try{l.href=i.url;l.href=l.href;i.crossDomain=nr.protocol+"//"+nr.host!=l.protocol+"//"+l.host}catch(et){i.crossDomain=!0}}if(i.data&&i.processData&&typeof i.data!="string"&&(i.data=e.param(i.data,i.traditional)),pf(af,i,t,r),o)return r;a=e.event&&i.global;a&&e.active++==0&&e.event.trigger("ajaxStart");i.type=i.type.toUpperCase();i.hasContent=!co.test(i.type);f=i.url.replace(oo,"");i.hasContent?i.data&&i.processData&&(i.contentType||"").indexOf("application/x-www-form-urlencoded")===0&&(i.data=i.data.replace(eo,"+")):(p=i.url.slice(f.length),i.data&&(f+=(ki.test(f)?"&":"?")+i.data,delete i.data),i.cache===!1&&(f=f.replace(so,"$1"),p=(ki.test(f)?"&":"?")+"_="+cf+++p),i.url=f+p);i.ifModified&&(e.lastModified[f]&&r.setRequestHeader("If-Modified-Since",e.lastModified[f]),e.etag[f]&&r.setRequestHeader("If-None-Match",e.etag[f]));(i.data&&i.hasContent&&i.contentType!==!1||t.contentType)&&r.setRequestHeader("Content-Type",i.contentType);r.setRequestHeader("Accept",i.dataTypes[0]&&i.accepts[i.dataTypes[0]]?i.accepts[i.dataTypes[0]]+(i.dataTypes[0]!=="*"?", "+vf+"; q=0.01":""):i.accepts["*"]);for(g in i.headers)r.setRequestHeader(g,i.headers[g]);if(i.beforeSend&&(i.beforeSend.call(h,r,i)===!1||o))return r.abort();if(ft="abort",it.add(i.complete),r.done(i.success),r.fail(i.error),c=pf(gi,i,t,r),c){if(r.readyState=1,a&&nt.trigger("ajaxSend",[r,i]),o)return r;i.async&&i.timeout>0&&(d=u.setTimeout(function(){r.abort("timeout")},i.timeout));try{o=!1;c.send(rt,b)}catch(et){if(o)throw et;b(-1,et)}}else b(-1,"No Transport");return r},getJSON:function(n,t,i){return e.get(n,t,i,"json")},getScript:function(n,t){return e.get(n,undefined,t,"script")}}),e.each(["get","post"],function(n,t){e[t]=function(n,i,r,u){return e.isFunction(i)&&(u=u||r,r=i,i=undefined),e.ajax(e.extend({url:n,type:t,dataType:u,data:i,success:r},e.isPlainObject(n)&&n))}}),e._evalUrl=function(n){return e.ajax({url:n,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},e.fn.extend({wrapAll:function(n){var t;return this[0]&&(e.isFunction(n)&&(n=n.call(this[0])),t=e(n,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var n=this;n.firstElementChild;)n=n.firstElementChild;return n}).append(this)),this},wrapInner:function(n){return e.isFunction(n)?this.each(function(t){e(this).wrapInner(n.call(this,t))}):this.each(function(){var t=e(this),i=t.contents();i.length?i.wrapAll(n):t.append(n)})},wrap:function(n){var t=e.isFunction(n);return this.each(function(i){e(this).wrapAll(t?n.call(this,i):n)})},unwrap:function(n){return this.parent(n).not("body").each(function(){e(this).replaceWith(this.childNodes)}),this}}),e.expr.pseudos.hidden=function(n){return!e.expr.pseudos.visible(n)},e.expr.pseudos.visible=function(n){return!!(n.offsetWidth||n.offsetHeight||n.getClientRects().length)},e.ajaxSettings.xhr=function(){try{return new u.XMLHttpRequest}catch(n){}},wf={0:200,1223:204},ct=e.ajaxSettings.xhr(),h.cors=!!ct&&"withCredentials"in ct,h.ajax=ct=!!ct,e.ajaxTransport(function(n){var t,i;if(h.cors||ct&&!n.crossDomain)return{send:function(r,f){var o,e=n.xhr();if(e.open(n.type,n.url,n.async,n.username,n.password),n.xhrFields)for(o in n.xhrFields)e[o]=n.xhrFields[o];n.mimeType&&e.overrideMimeType&&e.overrideMimeType(n.mimeType);n.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(o in r)e.setRequestHeader(o,r[o]);t=function(n){return function(){t&&(t=i=e.onload=e.onerror=e.onabort=e.onreadystatechange=null,n==="abort"?e.abort():n==="error"?typeof e.status!="number"?f(0,"error"):f(e.status,e.statusText):f(wf[e.status]||e.status,e.statusText,(e.responseType||"text")!=="text"||typeof e.responseText!="string"?{binary:e.response}:{text:e.responseText},e.getAllResponseHeaders()))}};e.onload=t();i=e.onerror=t("error");e.onabort!==undefined?e.onabort=i:e.onreadystatechange=function(){e.readyState===4&&u.setTimeout(function(){t&&i()})};t=t("abort");try{e.send(n.hasContent&&n.data||null)}catch(s){if(t)throw s;}},abort:function(){t&&t()}}}),e.ajaxPrefilter(function(n){n.crossDomain&&(n.contents.script=!1)}),e.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(n){return e.globalEval(n),n}}}),e.ajaxPrefilter("script",function(n){n.cache===undefined&&(n.cache=!1);n.crossDomain&&(n.type="GET")}),e.ajaxTransport("script",function(n){if(n.crossDomain){var i,t;return{send:function(r,u){i=e("<script>").prop({charset:n.scriptCharset,src:n.url}).on("load error",t=function(n){i.remove();t=null;n&&u(n.type==="error"?404:200,n.type)});s.head.appendChild(i[0])},abort:function(){t&&t()}}}}),ir=[],oi=/(=)\?(?=&|$)|\?\?/,e.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var n=ir.pop()||e.expando+"_"+cf++;return this[n]=!0,n}}),e.ajaxPrefilter("json jsonp",function(n,t,i){var r,f,o,s=n.jsonp!==!1&&(oi.test(n.url)?"url":typeof n.data=="string"&&(n.contentType||"").indexOf("application/x-www-form-urlencoded")===0&&oi.test(n.data)&&"data");if(s||n.dataTypes[0]==="jsonp")return r=n.jsonpCallback=e.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,s?n[s]=n[s].replace(oi,"$1"+r):n.jsonp!==!1&&(n.url+=(ki.test(n.url)?"&":"?")+n.jsonp+"="+r),n.converters["script json"]=function(){return o||e.error(r+" was not called"),o[0]},n.dataTypes[0]="json",f=u[r],u[r]=function(){o=arguments},i.always(function(){f===undefined?e(u).removeProp(r):u[r]=f;n[r]&&(n.jsonpCallback=t.jsonpCallback,ir.push(r));o&&e.isFunction(f)&&f(o[0]);o=f=undefined}),"script"}),h.createHTMLDocument=function(){var n=s.implementation.createHTMLDocument("").body;return n.innerHTML="<form><\/form><form><\/form>",n.childNodes.length===2}(),e.parseHTML=function(n,t,i){if(typeof n!="string")return[];typeof t=="boolean"&&(i=t,t=!1);var f,r,u;return(t||(h.createHTMLDocument?(t=s.implementation.createHTMLDocument(""),f=t.createElement("base"),f.href=s.location.href,t.head.appendChild(f)):t=s),r=ci.exec(n),u=!i&&[],r)?[t.createElement(r[1])]:(r=eu([n],t,u),u&&u.length&&e(u).remove(),e.merge([],r.childNodes))},e.fn.load=function(n,t,i){var r,o,s,u=this,f=n.indexOf(" ");return f>-1&&(r=tt(n.slice(f)),n=n.slice(0,f)),e.isFunction(t)?(i=t,t=undefined):t&&typeof t=="object"&&(o="POST"),u.length>0&&e.ajax({url:n,type:o||"GET",dataType:"html",data:t}).done(function(n){s=arguments;u.html(r?e("<div>").append(e.parseHTML(n)).find(r):n)}).always(i&&function(n,t){u.each(function(){i.apply(this,s||[n.responseText,t,n])})}),this},e.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(n,t){e.fn[t]=function(n){return this.on(t,n)}}),e.expr.pseudos.animated=function(n){return e.grep(e.timers,function(t){return n===t.elem}).length},e.offset={setOffset:function(n,t,i){var f,o,s,h,r,c,v,l=e.css(n,"position"),a=e(n),u={};l==="static"&&(n.style.position="relative");r=a.offset();s=e.css(n,"top");c=e.css(n,"left");v=(l==="absolute"||l==="fixed")&&(s+c).indexOf("auto")>-1;v?(f=a.position(),h=f.top,o=f.left):(h=parseFloat(s)||0,o=parseFloat(c)||0);e.isFunction(t)&&(t=t.call(n,i,e.extend({},r)));t.top!=null&&(u.top=t.top-r.top+h);t.left!=null&&(u.left=t.left-r.left+o);"using"in t?t.using.call(n,u):a.css(u)}},e.fn.extend({offset:function(n){if(arguments.length)return n===undefined?this:this.each(function(t){e.offset.setOffset(this,n,t)});var i,r,u,f,t=this[0];if(t)return t.getClientRects().length?(u=t.getBoundingClientRect(),i=t.ownerDocument,r=i.documentElement,f=i.defaultView,{top:u.top+f.pageYOffset-r.clientTop,left:u.left+f.pageXOffset-r.clientLeft}):{top:0,left:0}},position:function(){if(this[0]){var t,i,r=this[0],n={top:0,left:0};return e.css(r,"position")==="fixed"?i=r.getBoundingClientRect():(t=this.offsetParent(),i=this.offset(),p(t[0],"html")||(n=t.offset()),n={top:n.top+e.css(t[0],"borderTopWidth",!0),left:n.left+e.css(t[0],"borderLeftWidth",!0)}),{top:i.top-n.top-e.css(r,"marginTop",!0),left:i.left-n.left-e.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var n=this.offsetParent;n&&e.css(n,"position")==="static";)n=n.offsetParent;return n||ii})}}),e.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(n,t){var i="pageYOffset"===t;e.fn[n]=function(r){return b(this,function(n,r,u){var f;if(e.isWindow(n)?f=n:n.nodeType===9&&(f=n.defaultView),u===undefined)return f?f[t]:n[r];f?f.scrollTo(i?f.pageXOffset:u,i?u:f.pageYOffset):n[r]=u},n,r,arguments.length)}}),e.each(["top","left"],function(n,t){e.cssHooks[t]=vu(h.pixelPosition,function(n,i){if(i)return i=pt(n,t),pi.test(i)?e(n).position()[t]+"px":i})}),e.each({Height:"height",Width:"width"},function(n,t){e.each({padding:"inner"+n,content:t,"":"outer"+n},function(i,r){e.fn[r]=function(u,f){var o=arguments.length&&(i||typeof u!="boolean"),s=i||(u===!0||f===!0?"margin":"border");return b(this,function(t,i,u){var f;return e.isWindow(t)?r.indexOf("outer")===0?t["inner"+n]:t.document.documentElement["client"+n]:t.nodeType===9?(f=t.documentElement,Math.max(t.body["scroll"+n],f["scroll"+n],t.body["offset"+n],f["offset"+n],f["client"+n])):u===undefined?e.css(t,i,s):e.style(t,i,u,s)},t,o?u:undefined,o)}})}),e.fn.extend({bind:function(n,t,i){return this.on(n,null,t,i)},unbind:function(n,t){return this.off(n,null,t)},delegate:function(n,t,i,r){return this.on(t,n,i,r)},undelegate:function(n,t,i){return arguments.length===1?this.off(n,"**"):this.off(t,n||"**",i)}}),e.holdReady=function(n){n?e.readyWait++:e.ready(!0)},e.isArray=Array.isArray,e.parseJSON=JSON.parse,e.nodeName=p,!0&&!(r=[],i=function(){return e}.apply(t,r),i!==undefined&&(n.exports=i)),bf=u.jQuery,kf=u.$,e.noConflict=function(n){return u.$===e&&(u.$=kf),n&&u.jQuery===e&&(u.jQuery=bf),e},f||(u.jQuery=u.$=e),e})},function(n,t,i){(function(t){(function(i){function c(){}function l(n,t){return function(){n.apply(t,arguments)}}function r(n){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");if(typeof n!="function")throw new TypeError("not a function");this._state=0;this._handled=!1;this._value=undefined;this._deferreds=[];s(n,this)}function o(n,t){while(n._state===3)n=n._value;if(n._state===0){n._deferreds.push(t);return}n._handled=!0;r._immediateFn(function(){var i=n._state===1?t.onFulfilled:t.onRejected,r;if(i===null){(n._state===1?f:u)(t.promise,n._value);return}try{r=i(n._value)}catch(e){u(t.promise,e);return}f(t.promise,r)})}function f(n,t){try{if(t===n)throw new TypeError("A promise cannot be resolved with itself.");if(t&&(typeof t=="object"||typeof t=="function")){var i=t.then;if(t instanceof r){n._state=3;n._value=t;e(n);return}if(typeof i=="function"){s(l(i,t),n);return}}n._state=1;n._value=t;e(n)}catch(f){u(n,f)}}function u(n,t){n._state=2;n._value=t;e(n)}function e(n){n._state===2&&n._deferreds.length===0&&r._immediateFn(function(){n._handled||r._unhandledRejectionFn(n._value)});for(var t=0,i=n._deferreds.length;t<i;t++)o(n,n._deferreds[t]);n._deferreds=null}function a(n,t,i){this.onFulfilled=typeof n=="function"?n:null;this.onRejected=typeof t=="function"?t:null;this.promise=i}function s(n,t){var i=!1;try{n(function(n){i||(i=!0,f(t,n))},function(n){i||(i=!0,u(t,n))})}catch(r){if(i)return;i=!0;u(t,r)}}var h=setTimeout;r.prototype["catch"]=function(n){return this.then(null,n)};r.prototype.then=function(n,t){var i=new this.constructor(c);return o(this,new a(n,t,i)),i};r.all=function(n){var t=Array.prototype.slice.call(n);return new r(function(n,i){function f(r,e){try{if(e&&(typeof e=="object"||typeof e=="function")){var o=e.then;if(typeof o=="function"){o.call(e,function(n){f(r,n)},i);return}}t[r]=e;--u==0&&n(t)}catch(s){i(s)}}var u,r;if(t.length===0)return n([]);for(u=t.length,r=0;r<t.length;r++)f(r,t[r])})};r.resolve=function(n){return n&&typeof n=="object"&&n.constructor===r?n:new r(function(t){t(n)})};r.reject=function(n){return new r(function(t,i){i(n)})};r.race=function(n){return new r(function(t,i){for(var r=0,u=n.length;r<u;r++)n[r].then(t,i)})};r._immediateFn=typeof t=="function"&&function(n){t(n)}||function(n){h(n,0)};r._unhandledRejectionFn=function(n){typeof console!="undefined"&&console&&console.warn("Possible Unhandled Promise Rejection:",n)};r._setImmediateFn=function(n){r._immediateFn=n};r._setUnhandledRejectionFn=function(n){r._unhandledRejectionFn=n};typeof n!="undefined"&&n.exports?n.exports=r:i.Promise||(i.Promise=r)})(this)}).call(t,i(5).setImmediate)},function(n,t,i){function r(n,t){this._id=n;this._clearFn=t}var u=Function.prototype.apply;t.setTimeout=function(){return new r(u.call(setTimeout,window,arguments),clearTimeout)};t.setInterval=function(){return new r(u.call(setInterval,window,arguments),clearInterval)};t.clearTimeout=t.clearInterval=function(n){n&&n.close()};r.prototype.unref=r.prototype.ref=function(){};r.prototype.close=function(){this._clearFn.call(window,this._id)};t.enroll=function(n,t){clearTimeout(n._idleTimeoutId);n._idleTimeout=t};t.unenroll=function(n){clearTimeout(n._idleTimeoutId);n._idleTimeout=-1};t._unrefActive=t.active=function(n){clearTimeout(n._idleTimeoutId);var t=n._idleTimeout;t>=0&&(n._idleTimeoutId=setTimeout(function(){n._onTimeout&&n._onTimeout()},t))};i(6);t.setImmediate=setImmediate;t.clearImmediate=clearImmediate},function(n,t,i){(function(n,t){(function(n,i){"use strict";function l(n){var i,t,r;for(typeof n!="function"&&(n=new Function(""+n)),i=new Array(arguments.length-1),t=0;t<i.length;t++)i[t]=arguments[t+1];return r={callback:n,args:i},s[o]=r,u(o),o++}function c(n){delete s[n]}function a(n){var r=n.callback,t=n.args;switch(t.length){case 0:r();break;case 1:r(t[0]);break;case 2:r(t[0],t[1]);break;case 3:r(t[0],t[1],t[2]);break;default:r.apply(i,t)}}function f(n){if(h)setTimeout(f,0,n);else{var t=s[n];if(t){h=!0;try{a(t)}finally{c(n);h=!1}}}}function v(){u=function(n){t.nextTick(function(){f(n)})}}function y(){if(n.postMessage&&!n.importScripts){var t=!0,i=n.onmessage;return n.onmessage=function(){t=!1},n.postMessage("","*"),n.onmessage=i,t}}function p(){var t="setImmediate$"+Math.random()+"$",i=function(i){i.source===n&&typeof i.data=="string"&&i.data.indexOf(t)===0&&f(+i.data.slice(t.length))};n.addEventListener?n.addEventListener("message",i,!1):n.attachEvent("onmessage",i);u=function(i){n.postMessage(t+i,"*")}}function w(){var n=new MessageChannel;n.port1.onmessage=function(n){var t=n.data;f(t)};u=function(t){n.port2.postMessage(t)}}function b(){var n=e.documentElement;u=function(t){var i=e.createElement("script");i.onreadystatechange=function(){f(t);i.onreadystatechange=null;n.removeChild(i);i=null};n.appendChild(i)}}function k(){u=function(n){setTimeout(f,0,n)}}var r;if(!n.setImmediate){var o=1,s={},h=!1,e=n.document,u;r=Object.getPrototypeOf&&Object.getPrototypeOf(n);r=r&&r.setTimeout?r:n,{}.toString.call(n.process)==="[object process]"?v():y()?p():n.MessageChannel?w():e&&"onreadystatechange"in e.createElement("script")?b():k();r.setImmediate=l;r.clearImmediate=c}})(typeof self=="undefined"?typeof n=="undefined"?this:n:self)}).call(t,function(){return this}(),i(7))},function(n){function h(){throw new Error("setTimeout has not been defined");}function c(){throw new Error("clearTimeout has not been defined");}function l(n){if(i===setTimeout)return setTimeout(n,0);if((i===h||!i)&&setTimeout)return i=setTimeout,setTimeout(n,0);try{return i(n,0)}catch(t){try{return i.call(null,n,0)}catch(t){return i.call(this,n,0)}}}function y(n){if(r===clearTimeout)return clearTimeout(n);if((r===c||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(n);try{return r(n)}catch(t){try{return r.call(null,n)}catch(t){return r.call(this,n)}}}function p(){o&&e&&(o=!1,e.length?u=e.concat(u):s=-1,u.length&&a())}function a(){var t,n;if(!o){for(t=l(p),o=!0,n=u.length;n;){for(e=u,u=[];++s<n;)e&&e[s].run();s=-1;n=u.length}e=null;o=!1;y(t)}}function v(n,t){this.fun=n;this.array=t}function f(){}var t=n.exports={},i,r;(function(){try{i=typeof setTimeout=="function"?setTimeout:h}catch(n){i=h}try{r=typeof clearTimeout=="function"?clearTimeout:c}catch(n){r=c}})();var u=[],o=!1,e,s=-1;t.nextTick=function(n){var i=new Array(arguments.length-1),t;if(arguments.length>1)for(t=1;t<arguments.length;t++)i[t-1]=arguments[t];u.push(new v(n,i));u.length!==1||o||l(a)};v.prototype.run=function(){this.fun.apply(null,this.array)};t.title="browser";t.browser=!0;t.env={};t.argv=[];t.version="";t.versions={};t.on=f;t.addListener=f;t.once=f;t.off=f;t.removeListener=f;t.removeAllListeners=f;t.emit=f;t.prependListener=f;t.prependOnceListener=f;t.listeners=function(){return[]};t.binding=function(){throw new Error("process.binding is not supported");};t.cwd=function(){return"/"};t.chdir=function(){throw new Error("process.chdir is not supported");};t.umask=function(){return 0}},function(n){var n,t=function(n){"use strict";function kt(n,t){var i=n.getTime();return n.setMonth(n.getMonth()+t),Math.round((n.getTime()-i)/lt)}function at(n){var t=n.getTime(),i=new Date(t);return i.setMonth(n.getMonth()+1),Math.round((i.getTime()-t)/lt)}function ii(n){var t=n.getTime(),i=new Date(t);return i.setFullYear(n.getFullYear()+1),Math.round((i.getTime()-t)/lt)}function vt(n,t){if(t=t instanceof Date||t!==null&&isFinite(t)?new Date(+t):new Date,!n)return t;var i=+n.value||0;return i?(t.setTime(t.getTime()+i),t):(i=+n.milliseconds||0,i&&t.setMilliseconds(t.getMilliseconds()+i),i=+n.seconds||0,i&&t.setSeconds(t.getSeconds()+i),i=+n.minutes||0,i&&t.setMinutes(t.getMinutes()+i),i=+n.hours||0,i&&t.setHours(t.getHours()+i),i=+n.weeks||0,i&&(i*=u),i+=+n.days||0,i&&t.setDate(t.getDate()+i),i=+n.months||0,i&&t.setMonth(t.getMonth()+i),i=+n.millennia||0,i&&(i*=v),i+=+n.centuries||0,i&&(i*=a),i+=+n.decades||0,i&&(i*=l),i+=+n.years||0,i&&t.setFullYear(t.getFullYear()+i),t)}function ai(n,t){return yt(n)+(n===1?it[t]:rt[t])}function y(){}function vi(n,t){switch(t){case"seconds":if(n.seconds!==r||isNaN(n.minutes))return;n.minutes++;n.seconds=0;case"minutes":if(n.minutes!==e||isNaN(n.hours))return;n.hours++;n.minutes=0;case"hours":if(n.hours!==o||isNaN(n.days))return;n.days++;n.hours=0;case"days":if(n.days!==u||isNaN(n.weeks))return;n.weeks++;n.days=0;case"weeks":if(n.weeks!==at(n.refMonth)/u||isNaN(n.months))return;n.months++;n.weeks=0;case"months":if(n.months!==c||isNaN(n.years))return;n.years++;n.months=0;case"years":if(n.years!==l||isNaN(n.decades))return;n.decades++;n.years=0;case"decades":if(n.decades!==a||isNaN(n.centuries))return;n.centuries++;n.decades=0;case"centuries":if(n.centuries!==v||isNaN(n.millennia))return;n.millennia++;n.centuries=0}}function h(n,t,i,r,u,f){return(n[i]>=0&&(t+=n[i],delete n[i]),t/=u,t+1<=1)?0:n[r]>=0?(n[r]=+(n[r]+t).toFixed(f),vi(n,r),0):t}function yi(n,t){var f=h(n,0,"milliseconds","seconds",i,t);if(f&&(f=h(n,f,"seconds","minutes",r,t),f)&&(f=h(n,f,"minutes","hours",e,t),f)&&(f=h(n,f,"hours","days",o,t),f)&&(f=h(n,f,"days","weeks",u,t),f)&&(f=h(n,f,"weeks","months",at(n.refMonth)/u,t),f)&&(f=h(n,f,"months","years",ii(n.refMonth)/at(n.refMonth),t),f)&&(f=h(n,f,"years","decades",l,t),f)&&(f=h(n,f,"decades","centuries",a,t),f)&&(f=h(n,f,"centuries","millennia",v,t),f))throw new Error("Fractional unit overflow");}function pi(n){var t;for(n.milliseconds<0?(t=d(-n.milliseconds/i),n.seconds-=t,n.milliseconds+=t*i):n.milliseconds>=i&&(n.seconds+=s(n.milliseconds/i),n.milliseconds%=i),n.seconds<0?(t=d(-n.seconds/r),n.minutes-=t,n.seconds+=t*r):n.seconds>=r&&(n.minutes+=s(n.seconds/r),n.seconds%=r),n.minutes<0?(t=d(-n.minutes/e),n.hours-=t,n.minutes+=t*e):n.minutes>=e&&(n.hours+=s(n.minutes/e),n.minutes%=e),n.hours<0?(t=d(-n.hours/o),n.days-=t,n.hours+=t*o):n.hours>=o&&(n.days+=s(n.hours/o),n.hours%=o);n.days<0;)n.months--,n.days+=kt(n.refMonth,1);n.days>=u&&(n.weeks+=s(n.days/u),n.days%=u);n.months<0?(t=d(-n.months/c),n.years-=t,n.months+=t*c):n.months>=c&&(n.years+=s(n.months/c),n.months%=c);n.years>=l&&(n.decades+=s(n.years/l),n.years%=l,n.decades>=a&&(n.centuries+=s(n.decades/a),n.decades%=a,n.centuries>=v&&(n.millennia+=s(n.centuries/v),n.centuries%=v)))}function wi(n,t,f,h){var y=0;!(t&ct)||y>=f?(n.centuries+=n.millennia*v,delete n.millennia):n.millennia&&y++;!(t&ht)||y>=f?(n.decades+=n.centuries*a,delete n.centuries):n.centuries&&y++;!(t&st)||y>=f?(n.years+=n.decades*l,delete n.decades):n.decades&&y++;!(t&tt)||y>=f?(n.months+=n.years*c,delete n.years):n.years&&y++;!(t&nt)||y>=f?(n.months&&(n.days+=kt(n.refMonth,n.months)),delete n.months,n.days>=u&&(n.weeks+=s(n.days/u),n.days%=u)):n.months&&y++;!(t&ot)||y>=f?(n.days+=n.weeks*u,delete n.weeks):n.weeks&&y++;!(t&k)||y>=f?(n.hours+=n.days*o,delete n.days):n.days&&y++;!(t&b)||y>=f?(n.minutes+=n.hours*e,delete n.hours):n.hours&&y++;!(t&w)||y>=f?(n.seconds+=n.minutes*r,delete n.minutes):n.minutes&&y++;!(t&p)||y>=f?(n.milliseconds+=n.seconds*i,delete n.seconds):n.seconds&&y++;(!(t&g)||y>=f)&&yi(n,h)}function ni(n,t,i,r,u,f){var e=new Date,o;n.start=t=t||e;n.end=i=i||e;n.units=r;n.value=i.getTime()-t.getTime();n.value<0&&(o=i,i=t,t=o);n.refMonth=new Date(t.getFullYear(),t.getMonth(),15,12,0,0);try{n.millennia=0;n.centuries=0;n.decades=0;n.years=i.getFullYear()-t.getFullYear();n.months=i.getMonth()-t.getMonth();n.weeks=0;n.days=i.getDate()-t.getDate();n.hours=i.getHours()-t.getHours();n.minutes=i.getMinutes()-t.getMinutes();n.seconds=i.getSeconds()-t.getSeconds();n.milliseconds=i.getMilliseconds()-t.getMilliseconds();pi(n);wi(n,r,u,f)}finally{delete n.refMonth}return n}function bi(n){return n&g?i/30:n&p?i:n&w?i*r:n&b?i*r*e:n&k?i*r*e*o:i*r*e*o*u}function t(n,t,i,r,u){var e,f,o,h,c,s;return(i=+i||bt,r=r>0?r:NaN,u=u>0?u<20?Math.round(u):20:0,f=null,"function"==typeof n?(e=n,n=null):n instanceof Date||(n!==null&&isFinite(n)?n=new Date(+n):("object"==typeof f&&(f=n),n=null)),o=null,"function"==typeof t?(e=t,t=null):t instanceof Date||(t!==null&&isFinite(t)?t=new Date(+t):("object"==typeof t&&(o=t),t=null)),f&&(n=vt(f,t)),o&&(t=vt(o,n)),!n&&!t)?new y:e?(h=bi(i),s=function(){e(ni(new y,n,t,i,r,u),c)},s(),c=setInterval(s,h)):ni(new y,n,t,i,r,u)}var g=1,p=2,w=4,b=8,k=16,ot=32,nt=64,tt=128,st=256,ht=512,ct=1024,bt=tt|nt|k|b|w|p,i=1e3,r=60,e=60,o=24,lt=o*e*r*i,u=7,c=12,l=10,a=10,v=10,d=Math.ceil,s=Math.floor,dt=0,ri=1,ui=2,fi=3,ei=4,oi=5,si=6,hi=7,ci=8,li=9,gt=10,it,rt,ut,ft,et,f,yt,pt,ti,wt;return y.prototype.toString=function(n){var t=pt(this),i=t.length,r;return i?i===1?t[0]:(r=ut+t.pop(),t.join(ft)+r):n?""+n:et},y.prototype.toHTML=function(n,t){var i,u,r,f;if(n=n||"span",i=pt(this),u=i.length,!u)return t=t||et,t?"<"+n+">"+t+"<\/"+n+">":t;for(r=0;r<u;r++)i[r]="<"+n+">"+i[r]+"<\/"+n+">";return u===1?i[0]:(f=ut+i.pop(),i.join(ft)+f)},y.prototype.addTo=function(n){return vt(this,n)},pt=function(n){var i=[],t=n.millennia;return t&&i.push(f(t,gt)),t=n.centuries,t&&i.push(f(t,li)),t=n.decades,t&&i.push(f(t,ci)),t=n.years,t&&i.push(f(t,hi)),t=n.months,t&&i.push(f(t,si)),t=n.weeks,t&&i.push(f(t,oi)),t=n.days,t&&i.push(f(t,ei)),t=n.hours,t&&i.push(f(t,fi)),t=n.minutes,t&&i.push(f(t,ui)),t=n.seconds,t&&i.push(f(t,ri)),t=n.milliseconds,t&&i.push(f(t,dt)),i},t.MILLISECONDS=g,t.SECONDS=p,t.MINUTES=w,t.HOURS=b,t.DAYS=k,t.WEEKS=ot,t.MONTHS=nt,t.YEARS=tt,t.DECADES=st,t.CENTURIES=ht,t.MILLENNIA=ct,t.DEFAULTS=bt,t.ALL=ct|ht|st|tt|nt|ot|k|b|w|p|g,ti=t.setFormat=function(n){var i,r,t;if(n){if("singular"in n||"plural"in n)for(i=n.singular||[],i.split&&(i=i.split("|")),r=n.plural||[],r.split&&(r=r.split("|")),t=dt;t<=gt;t++)it[t]=i[t]||it[t],rt[t]=r[t]||rt[t];"string"==typeof n.last&&(ut=n.last);"string"==typeof n.delim&&(ft=n.delim);"string"==typeof n.empty&&(et=n.empty);"function"==typeof n.formatNumber&&(yt=n.formatNumber);"function"==typeof n.formatter&&(f=n.formatter)}},wt=t.resetFormat=function(){it=" millisecond| second| minute| hour| day| week| month| year| decade| century| millennium".split("|");rt=" milliseconds| seconds| minutes| hours| days| weeks| months| years| decades| centuries| millennia".split("|");ut=" and ";ft=", ";et="";yt=function(n){return n};f=ai},t.setLabels=function(n,t,i,r,u,f,e){ti({singular:n,plural:t,last:i,delim:r,empty:u,formatNumber:f,formatter:e})},t.resetLabels=wt,wt(),n&&n.exports?n.exports=t:typeof window.define=="function"&&typeof window.define.amd!="undefined"&&window.define("countdown",[],function(){return t}),t}(n)},function(n,t,i){"use strict";n.exports=i(10)},function(n,t,i){"use strict";var r=i(11),u=i(19),f=i(29);n.exports={initialize:u,update:f,destroy:r}},function(n,t,i){"use strict";var f=i(12),r=i(14),u=i(15);n.exports=function(n){var t=u.get(n);t&&(t.event.unbindAll(),r.remove(t.scrollbarX),r.remove(t.scrollbarY),r.remove(t.scrollbarXRail),r.remove(t.scrollbarYRail),f.removePsClasses(n),u.remove(n))}},function(n,t,i){"use strict";function o(n){return function(t,i){n(t,"ps--in-scrolling");typeof i!="undefined"?n(t,"ps--"+i):(n(t,"ps--x"),n(t,"ps--y"))}}var f=i(13),r=i(14),u=t.toInt=function(n){return parseInt(n,10)||0},e=t.clone=function(n){var t,i;if(n){if(Array.isArray(n))return n.map(e);if(typeof n=="object"){t={};for(i in n)t[i]=e(n[i]);return t}return n}return null};t.extend=function(n,t){var r=e(n),i;for(i in t)r[i]=e(t[i]);return r};t.isEditable=function(n){return r.matches(n,"input,[contenteditable]")||r.matches(n,"select,[contenteditable]")||r.matches(n,"textarea,[contenteditable]")||r.matches(n,"button,[contenteditable]")};t.removePsClasses=function(n){for(var r=f.list(n),i,t=0;t<r.length;t++)i=r[t],i.indexOf("ps-")===0&&f.remove(n,i)};t.outerWidth=function(n){return u(r.css(n,"width"))+u(r.css(n,"paddingLeft"))+u(r.css(n,"paddingRight"))+u(r.css(n,"borderLeftWidth"))+u(r.css(n,"borderRightWidth"))};t.startScrolling=o(f.add);t.stopScrolling=o(f.remove);t.env={isWebKit:typeof document!="undefined"&&"WebkitAppearance"in document.documentElement.style,supportsTouch:typeof window!="undefined"&&("ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:typeof window!="undefined"&&window.navigator.msMaxTouchPoints!==null}},function(n,t){"use strict";function i(n,t){var i=n.className.split(" ");i.indexOf(t)<0&&i.push(t);n.className=i.join(" ")}function r(n,t){var i=n.className.split(" "),r=i.indexOf(t);r>=0&&i.splice(r,1);n.className=i.join(" ")}t.add=function(n,t){n.classList?n.classList.add(t):i(n,t)};t.remove=function(n,t){n.classList?n.classList.remove(t):r(n,t)};t.list=function(n){return n.classList?Array.prototype.slice.apply(n.classList):n.className.split(" ")}},function(n){"use strict";function i(n,t){return window.getComputedStyle(n)[t]}function r(n,t,i){return typeof i=="number"&&(i=i.toString()+"px"),n.style[t]=i,n}function u(n,t){var r,i;for(r in t)i=t[r],typeof i=="number"&&(i=i.toString()+"px"),n.style[r]=i;return n}var t={};t.e=function(n,t){var i=document.createElement(n);return i.className=t,i};t.appendTo=function(n,t){return t.appendChild(n),n};t.css=function(n,t,f){return typeof t=="object"?u(n,t):typeof f=="undefined"?i(n,t):r(n,t,f)};t.matches=function(n,t){return typeof n.matches!="undefined"?n.matches(t):typeof n.matchesSelector!="undefined"?n.matchesSelector(t):typeof n.webkitMatchesSelector!="undefined"?n.webkitMatchesSelector(t):typeof n.mozMatchesSelector!="undefined"?n.mozMatchesSelector(t):typeof n.msMatchesSelector!="undefined"?n.msMatchesSelector(t):void 0};t.remove=function(n){typeof n.remove!="undefined"?n.remove():n.parentNode&&n.parentNode.removeChild(n)};t.queryChildren=function(n,i){return Array.prototype.filter.call(n.childNodes,function(n){return t.matches(n,i)})};n.exports=t},function(n,t,i){"use strict";function l(n){function i(){e.add(n,"ps--focus")}function f(){e.remove(n,"ps--focus")}var t=this;t.settings=u.clone(s);t.containerWidth=null;t.containerHeight=null;t.contentWidth=null;t.contentHeight=null;t.isRtl=r.css(n,"direction")==="rtl";t.isNegativeScroll=function(){var i=n.scrollLeft,t=null;return n.scrollLeft=-1,t=n.scrollLeft<0,n.scrollLeft=i,t}();t.negativeScrollAdjustment=t.isNegativeScroll?n.scrollWidth-n.clientWidth:0;t.event=new h;t.ownerDocument=n.ownerDocument||document;t.scrollbarXRail=r.appendTo(r.e("div","ps__scrollbar-x-rail"),n);t.scrollbarX=r.appendTo(r.e("div","ps__scrollbar-x"),t.scrollbarXRail);t.scrollbarX.setAttribute("tabindex",0);t.event.bind(t.scrollbarX,"focus",i);t.event.bind(t.scrollbarX,"blur",f);t.scrollbarXActive=null;t.scrollbarXWidth=null;t.scrollbarXLeft=null;t.scrollbarXBottom=u.toInt(r.css(t.scrollbarXRail,"bottom"));t.isScrollbarXUsingBottom=t.scrollbarXBottom===t.scrollbarXBottom;t.scrollbarXTop=t.isScrollbarXUsingBottom?null:u.toInt(r.css(t.scrollbarXRail,"top"));t.railBorderXWidth=u.toInt(r.css(t.scrollbarXRail,"borderLeftWidth"))+u.toInt(r.css(t.scrollbarXRail,"borderRightWidth"));r.css(t.scrollbarXRail,"display","block");t.railXMarginWidth=u.toInt(r.css(t.scrollbarXRail,"marginLeft"))+u.toInt(r.css(t.scrollbarXRail,"marginRight"));r.css(t.scrollbarXRail,"display","");t.railXWidth=null;t.railXRatio=null;t.scrollbarYRail=r.appendTo(r.e("div","ps__scrollbar-y-rail"),n);t.scrollbarY=r.appendTo(r.e("div","ps__scrollbar-y"),t.scrollbarYRail);t.scrollbarY.setAttribute("tabindex",0);t.event.bind(t.scrollbarY,"focus",i);t.event.bind(t.scrollbarY,"blur",f);t.scrollbarYActive=null;t.scrollbarYHeight=null;t.scrollbarYTop=null;t.scrollbarYRight=u.toInt(r.css(t.scrollbarYRail,"right"));t.isScrollbarYUsingRight=t.scrollbarYRight===t.scrollbarYRight;t.scrollbarYLeft=t.isScrollbarYUsingRight?null:u.toInt(r.css(t.scrollbarYRail,"left"));t.scrollbarYOuterWidth=t.isRtl?u.outerWidth(t.scrollbarY):null;t.railBorderYWidth=u.toInt(r.css(t.scrollbarYRail,"borderTopWidth"))+u.toInt(r.css(t.scrollbarYRail,"borderBottomWidth"));r.css(t.scrollbarYRail,"display","block");t.railYMarginHeight=u.toInt(r.css(t.scrollbarYRail,"marginTop"))+u.toInt(r.css(t.scrollbarYRail,"marginBottom"));r.css(t.scrollbarYRail,"display","");t.railYHeight=null;t.railYRatio=null}function o(n){return n.getAttribute("data-ps-id")}function a(n,t){n.setAttribute("data-ps-id",t)}function v(n){n.removeAttribute("data-ps-id")}var u=i(12),e=i(13),s=i(16),r=i(14),h=i(17),c=i(18),f={};t.add=function(n){var t=c();return a(n,t),f[t]=new l(n),f[t]};t.remove=function(n){delete f[o(n)];v(n)};t.get=function(n){return f[o(n)]}},function(n){"use strict";n.exports={handlers:["click-rail","drag-scrollbar","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipePropagation:!0,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!1,wheelSpeed:1,theme:"default"}},function(n){"use strict";var i=function(n){this.element=n;this.events={}},t;i.prototype.bind=function(n,t){typeof this.events[n]=="undefined"&&(this.events[n]=[]);this.events[n].push(t);this.element.addEventListener(n,t,!1)};i.prototype.unbind=function(n,t){var i=typeof t!="undefined";this.events[n]=this.events[n].filter(function(r){return i&&r!==t?!0:(this.element.removeEventListener(n,r,!1),!1)},this)};i.prototype.unbindAll=function(){for(var n in this.events)this.unbind(n)};t=function(){this.eventElements=[]};t.prototype.eventElement=function(n){var t=this.eventElements.filter(function(t){return t.element===n})[0];return typeof t=="undefined"&&(t=new i(n),this.eventElements.push(t)),t};t.prototype.bind=function(n,t,i){this.eventElement(n).bind(t,i)};t.prototype.unbind=function(n,t,i){this.eventElement(n).unbind(t,i)};t.prototype.unbindAll=function(){for(var n=0;n<this.eventElements.length;n++)this.eventElements[n].unbindAll()};t.prototype.once=function(n,t,i){var r=this.eventElement(n),u=function(n){r.unbind(t,u);i(n)};r.bind(t,u)};n.exports=t},function(n){"use strict";n.exports=function(){function n(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return function(){return n()+n()+"-"+n()+"-"+n()+"-"+n()+"-"+n()+n()+n()}}()},function(n,t,i){"use strict";var u=i(12),r=i(13),f=i(15),e=i(20),o={"click-rail":i(22),"drag-scrollbar":i(23),keyboard:i(24),wheel:i(25),touch:i(26),selection:i(27)},s=i(28);n.exports=function(n,t){t=typeof t=="object"?t:{};r.add(n,"ps");var i=f.add(n);i.settings=u.extend(i.settings,t);r.add(n,"ps--theme_"+i.settings.theme);i.settings.handlers.forEach(function(t){o[t](n)});s(n);e(n)}},function(n,t,i){"use strict";function o(n,t){return n.settings.minScrollbarLength&&(t=Math.max(t,n.settings.minScrollbarLength)),n.settings.maxScrollbarLength&&(t=Math.min(t,n.settings.maxScrollbarLength)),t}function h(n,t){var i={width:t.railXWidth},u;i.left=t.isRtl?t.negativeScrollAdjustment+n.scrollLeft+t.containerWidth-t.contentWidth:n.scrollLeft;t.isScrollbarXUsingBottom?i.bottom=t.scrollbarXBottom-n.scrollTop:i.top=t.scrollbarXTop+n.scrollTop;r.css(t.scrollbarXRail,i);u={top:n.scrollTop,height:t.railYHeight};t.isScrollbarYUsingRight?u.right=t.isRtl?t.contentWidth-(t.negativeScrollAdjustment+n.scrollLeft)-t.scrollbarYRight-t.scrollbarYOuterWidth:t.scrollbarYRight-n.scrollLeft:u.left=t.isRtl?t.negativeScrollAdjustment+n.scrollLeft+t.containerWidth*2-t.contentWidth-t.scrollbarYLeft-t.scrollbarYOuterWidth:t.scrollbarYLeft+n.scrollLeft;r.css(t.scrollbarYRail,u);r.css(t.scrollbarX,{left:t.scrollbarXLeft,width:t.scrollbarXWidth-t.railBorderXWidth});r.css(t.scrollbarY,{top:t.scrollbarYTop,height:t.scrollbarYHeight-t.railBorderYWidth})}var u=i(12),f=i(13),r=i(14),s=i(15),e=i(21);n.exports=function(n){var t=s.get(n),i;t.containerWidth=n.clientWidth;t.containerHeight=n.clientHeight;t.contentWidth=n.scrollWidth;t.contentHeight=n.scrollHeight;n.contains(t.scrollbarXRail)||(i=r.queryChildren(n,".ps__scrollbar-x-rail"),i.length>0&&i.forEach(function(n){r.remove(n)}),r.appendTo(t.scrollbarXRail,n));n.contains(t.scrollbarYRail)||(i=r.queryChildren(n,".ps__scrollbar-y-rail"),i.length>0&&i.forEach(function(n){r.remove(n)}),r.appendTo(t.scrollbarYRail,n));!t.settings.suppressScrollX&&t.containerWidth+t.settings.scrollXMarginOffset<t.contentWidth?(t.scrollbarXActive=!0,t.railXWidth=t.containerWidth-t.railXMarginWidth,t.railXRatio=t.containerWidth/t.railXWidth,t.scrollbarXWidth=o(t,u.toInt(t.railXWidth*t.containerWidth/t.contentWidth)),t.scrollbarXLeft=u.toInt((t.negativeScrollAdjustment+n.scrollLeft)*(t.railXWidth-t.scrollbarXWidth)/(t.contentWidth-t.containerWidth))):t.scrollbarXActive=!1;!t.settings.suppressScrollY&&t.containerHeight+t.settings.scrollYMarginOffset<t.contentHeight?(t.scrollbarYActive=!0,t.railYHeight=t.containerHeight-t.railYMarginHeight,t.railYRatio=t.containerHeight/t.railYHeight,t.scrollbarYHeight=o(t,u.toInt(t.railYHeight*t.containerHeight/t.contentHeight)),t.scrollbarYTop=u.toInt(n.scrollTop*(t.railYHeight-t.scrollbarYHeight)/(t.contentHeight-t.containerHeight))):t.scrollbarYActive=!1;t.scrollbarXLeft>=t.railXWidth-t.scrollbarXWidth&&(t.scrollbarXLeft=t.railXWidth-t.scrollbarXWidth);t.scrollbarYTop>=t.railYHeight-t.scrollbarYHeight&&(t.scrollbarYTop=t.railYHeight-t.scrollbarYHeight);h(n,t);t.scrollbarXActive?f.add(n,"ps--active-x"):(f.remove(n,"ps--active-x"),t.scrollbarXWidth=0,t.scrollbarXLeft=0,e(n,"left",0));t.scrollbarYActive?f.add(n,"ps--active-y"):(f.remove(n,"ps--active-y"),t.scrollbarYHeight=0,t.scrollbarYTop=0,e(n,"top",0))}},function(n,t,i){"use strict";var u=i(15),r=function(n){var t=document.createEvent("Event");return t.initEvent(n,!0,!0),t};n.exports=function(n,t,i){if(typeof n=="undefined")throw"You must provide an element to the update-scroll function";if(typeof t=="undefined")throw"You must provide an axis to the update-scroll function";if(typeof i=="undefined")throw"You must provide a value to the update-scroll function";t==="top"&&i<=0&&(n.scrollTop=i=0,n.dispatchEvent(r("ps-y-reach-start")));t==="left"&&i<=0&&(n.scrollLeft=i=0,n.dispatchEvent(r("ps-x-reach-start")));var f=u.get(n);t==="top"&&i>=f.contentHeight-f.containerHeight&&(i=f.contentHeight-f.containerHeight,i-n.scrollTop<=1?i=n.scrollTop:n.scrollTop=i,n.dispatchEvent(r("ps-y-reach-end")));t==="left"&&i>=f.contentWidth-f.containerWidth&&(i=f.contentWidth-f.containerWidth,i-n.scrollLeft<=1?i=n.scrollLeft:n.scrollLeft=i,n.dispatchEvent(r("ps-x-reach-end")));f.lastTop===undefined&&(f.lastTop=n.scrollTop);f.lastLeft===undefined&&(f.lastLeft=n.scrollLeft);t==="top"&&i<f.lastTop&&n.dispatchEvent(r("ps-scroll-up"));t==="top"&&i>f.lastTop&&n.dispatchEvent(r("ps-scroll-down"));t==="left"&&i<f.lastLeft&&n.dispatchEvent(r("ps-scroll-left"));t==="left"&&i>f.lastLeft&&n.dispatchEvent(r("ps-scroll-right"));t==="top"&&i!==f.lastTop&&(n.scrollTop=f.lastTop=i,n.dispatchEvent(r("ps-scroll-y")));t==="left"&&i!==f.lastLeft&&(n.scrollLeft=f.lastLeft=i,n.dispatchEvent(r("ps-scroll-x")))}},function(n,t,i){"use strict";function e(n,t){function i(n){return n.getBoundingClientRect()}var f=function(n){n.stopPropagation()};t.event.bind(t.scrollbarY,"click",f);t.event.bind(t.scrollbarYRail,"click",function(f){var e=f.pageY-window.pageYOffset-i(t.scrollbarYRail).top,o=e>t.scrollbarYTop?1:-1;u(n,"top",n.scrollTop+o*t.containerHeight);r(n);f.stopPropagation()});t.event.bind(t.scrollbarX,"click",f);t.event.bind(t.scrollbarXRail,"click",function(f){var e=f.pageX-window.pageXOffset-i(t.scrollbarXRail).left,o=e>t.scrollbarXLeft?1:-1;u(n,"left",n.scrollLeft+o*t.containerWidth);r(n);f.stopPropagation()})}var f=i(15),r=i(20),u=i(21);n.exports=function(n){var t=f.get(n);e(n,t)}},function(n,t,i){"use strict";function s(n,t){function h(u){var f=i+u*t.railXRatio,o=Math.max(0,t.scrollbarXRail.getBoundingClientRect().left)+t.railXRatio*(t.railXWidth-t.scrollbarXWidth),s;t.scrollbarXLeft=f<0?0:f>o?o:f;s=r.toInt(t.scrollbarXLeft*(t.contentWidth-t.containerWidth)/(t.containerWidth-t.railXRatio*t.scrollbarXWidth))-t.negativeScrollAdjustment;e(n,"left",s)}var i=null,o=null,s=function(t){h(t.pageX-o);f(n);t.stopPropagation();t.preventDefault()},c=function(){r.stopScrolling(n,"x");t.event.unbind(t.ownerDocument,"mousemove",s)};t.event.bind(t.scrollbarX,"mousedown",function(f){o=f.pageX;i=r.toInt(u.css(t.scrollbarX,"left"))*t.railXRatio;r.startScrolling(n,"x");t.event.bind(t.ownerDocument,"mousemove",s);t.event.once(t.ownerDocument,"mouseup",c);f.stopPropagation();f.preventDefault()})}function h(n,t){function h(u){var f=i+u*t.railYRatio,o=Math.max(0,t.scrollbarYRail.getBoundingClientRect().top)+t.railYRatio*(t.railYHeight-t.scrollbarYHeight),s;t.scrollbarYTop=f<0?0:f>o?o:f;s=r.toInt(t.scrollbarYTop*(t.contentHeight-t.containerHeight)/(t.containerHeight-t.railYRatio*t.scrollbarYHeight));e(n,"top",s)}var i=null,o=null,s=function(t){h(t.pageY-o);f(n);t.stopPropagation();t.preventDefault()},c=function(){r.stopScrolling(n,"y");t.event.unbind(t.ownerDocument,"mousemove",s)};t.event.bind(t.scrollbarY,"mousedown",function(f){o=f.pageY;i=r.toInt(u.css(t.scrollbarY,"top"))*t.railYRatio;r.startScrolling(n,"y");t.event.bind(t.ownerDocument,"mousemove",s);t.event.once(t.ownerDocument,"mouseup",c);f.stopPropagation();f.preventDefault()})}var r=i(12),u=i(14),o=i(15),f=i(20),e=i(21);n.exports=function(n){var t=o.get(n);s(n,t);h(n,t)}},function(n,t,i){"use strict";function s(n,t){function s(i,r){var f=n.scrollTop,u;if(i===0){if(!t.scrollbarYActive)return!1;if(f===0&&r>0||f>=t.contentHeight-t.containerHeight&&r<0)return!t.settings.wheelPropagation}if(u=n.scrollLeft,r===0){if(!t.scrollbarXActive)return!1;if(u===0&&i<0||u>=t.contentWidth-t.containerWidth&&i>0)return!t.settings.wheelPropagation}return!0}var i=!1,e;t.event.bind(n,"mouseenter",function(){i=!0});t.event.bind(n,"mouseleave",function(){i=!1});e=!1;t.event.bind(t.ownerDocument,"keydown",function(h){var v,l,a,c;if((!h.isDefaultPrevented||!h.isDefaultPrevented())&&!h.defaultPrevented&&(v=r.matches(t.scrollbarX,":focus")||r.matches(t.scrollbarY,":focus"),i||v)){if(l=document.activeElement?document.activeElement:t.ownerDocument.activeElement,l){if(l.tagName==="IFRAME")l=l.contentDocument.activeElement;else while(l.shadowRoot)l=l.shadowRoot.activeElement;if(f.isEditable(l))return}a=0;c=0;switch(h.which){case 37:a=h.metaKey?-t.contentWidth:h.altKey?-t.containerWidth:-30;break;case 38:c=h.metaKey?t.contentHeight:h.altKey?t.containerHeight:30;break;case 39:a=h.metaKey?t.contentWidth:h.altKey?t.containerWidth:30;break;case 40:c=h.metaKey?-t.contentHeight:h.altKey?-t.containerHeight:-30;break;case 33:c=90;break;case 32:c=h.shiftKey?90:-90;break;case 34:c=-90;break;case 35:c=h.ctrlKey?-t.contentHeight:-t.containerHeight;break;case 36:c=h.ctrlKey?n.scrollTop:t.containerHeight;break;default:return}u(n,"top",n.scrollTop-c);u(n,"left",n.scrollLeft+a);o(n);e=s(a,c);e&&h.preventDefault()}})}var f=i(12),r=i(14),e=i(15),o=i(20),u=i(21);n.exports=function(n){var t=e.get(n);s(n,t)}},function(n,t,i){"use strict";function e(n,t){function e(i,r){var f=n.scrollTop,u;if(i===0){if(!t.scrollbarYActive)return!1;if(f===0&&r>0||f>=t.contentHeight-t.containerHeight&&r<0)return!t.settings.wheelPropagation}if(u=n.scrollLeft,r===0){if(!t.scrollbarXActive)return!1;if(u===0&&i<0||u>=t.contentWidth-t.containerWidth&&i>0)return!t.settings.wheelPropagation}return!0}function o(n){var t=n.deltaX,i=-1*n.deltaY;return((typeof t=="undefined"||typeof i=="undefined")&&(t=n.wheelDeltaX/-6,i=n.wheelDeltaY/6),n.deltaMode&&n.deltaMode===1&&(t*=10,i*=10),t!==t&&i!==i&&(t=0,i=n.wheelDelta),n.shiftKey)?[-i,-t]:[t,i]}function s(t,i){var r=n.querySelector("textarea:hover, select[multiple]:hover, .ps-child:hover"),u,o,f,e;if(r){if(u=window.getComputedStyle(r),o=[u.overflow,u.overflowX,u.overflowY].join(""),!o.match(/(scroll|auto)/))return!1;if((f=r.scrollHeight-r.clientHeight,f>0&&!(r.scrollTop===0&&i>0)&&!(r.scrollTop===f&&i<0))||(e=r.scrollLeft-r.clientWidth,e>0&&!(r.scrollLeft===0&&t<0)&&!(r.scrollLeft===e&&t>0)))return!0}return!1}function u(u){var l=o(u),h=l[0],c=l[1];s(h,c)||(i=!1,t.settings.useBothWheelAxes?t.scrollbarYActive&&!t.scrollbarXActive?(c?r(n,"top",n.scrollTop-c*t.settings.wheelSpeed):r(n,"top",n.scrollTop+h*t.settings.wheelSpeed),i=!0):t.scrollbarXActive&&!t.scrollbarYActive&&(h?r(n,"left",n.scrollLeft+h*t.settings.wheelSpeed):r(n,"left",n.scrollLeft-c*t.settings.wheelSpeed),i=!0):(r(n,"top",n.scrollTop-c*t.settings.wheelSpeed),r(n,"left",n.scrollLeft+h*t.settings.wheelSpeed)),f(n),i=i||e(h,c),i&&(u.stopPropagation(),u.preventDefault()))}var i=!1;typeof window.onwheel!="undefined"?t.event.bind(n,"wheel",u):typeof window.onmousewheel!="undefined"&&t.event.bind(n,"mousewheel",u)}var u=i(15),f=i(20),r=i(21);n.exports=function(n){var t=u.get(n);e(n,t)}},function(n,t,i){"use strict";function o(n,t,i,r){function nt(i,r){var u=n.scrollTop,f=n.scrollLeft,e=Math.abs(i),o=Math.abs(r);if(o>e){if(r<0&&u===t.contentHeight-t.containerHeight||r>0&&u===0)return!t.settings.swipePropagation}else if(e>o&&(i<0&&f===t.contentWidth-t.containerWidth||i>0&&f===0))return!t.settings.swipePropagation;return!0}function k(t,i){f(n,"top",n.scrollTop-i);f(n,"left",n.scrollLeft-t);e(n)}function y(){l=!0}function p(){l=!1}function d(n){return n.targetTouches?n.targetTouches[0]:n}function g(n){return n.targetTouches&&n.targetTouches.length===1?!0:n.pointerType&&n.pointerType!=="mouse"&&n.pointerType!==n.MSPOINTER_TYPE_MOUSE?!0:!1}function a(n){if(g(n)){c=!0;var t=d(n);h.pageX=t.pageX;h.pageY=t.pageY;v=(new Date).getTime();s!==null&&clearInterval(s);n.stopPropagation()}}function w(n){var e,i;if(!c&&t.settings.swipePropagation&&a(n),!l&&c&&g(n)){var s=d(n),r={pageX:s.pageX,pageY:s.pageY},u=r.pageX-h.pageX,f=r.pageY-h.pageY;k(u,f);h=r;e=(new Date).getTime();i=e-v;i>0&&(o.x=u/i,o.y=f/i,v=e);nt(u,f)&&(n.stopPropagation(),n.preventDefault())}}function b(){!l&&c&&(c=!1,t.settings.swipeEasing&&(clearInterval(s),s=setInterval(function(){if(!u.get(n)){clearInterval(s);return}if(!o.x&&!o.y){clearInterval(s);return}if(Math.abs(o.x)<.01&&Math.abs(o.y)<.01){clearInterval(s);return}k(o.x*30,o.y*30);o.x*=.8;o.y*=.8},10)))}var h={},v=0,o={},s=null,l=!1,c=!1;i?(t.event.bind(window,"touchstart",y),t.event.bind(window,"touchend",p),t.event.bind(n,"touchstart",a),t.event.bind(n,"touchmove",w),t.event.bind(n,"touchend",b)):r&&(window.PointerEvent?(t.event.bind(window,"pointerdown",y),t.event.bind(window,"pointerup",p),t.event.bind(n,"pointerdown",a),t.event.bind(n,"pointermove",w),t.event.bind(n,"pointerup",b)):window.MSPointerEvent&&(t.event.bind(window,"MSPointerDown",y),t.event.bind(window,"MSPointerUp",p),t.event.bind(n,"MSPointerDown",a),t.event.bind(n,"MSPointerMove",w),t.event.bind(n,"MSPointerUp",b)))}var r=i(12),u=i(15),e=i(20),f=i(21);n.exports=function(n){if(r.env.supportsTouch||r.env.supportsIePointer){var t=u.get(n);o(n,t,r.env.supportsTouch,r.env.supportsIePointer)}}},function(n,t,i){"use strict";function o(n,t){function c(){var n=window.getSelection?window.getSelection():document.getSelection?document.getSelection():"";return n.toString().length===0?null:n.getRangeAt(0).commonAncestorContainer}function l(){s||(s=setInterval(function(){if(!u.get(n)){clearInterval(s);return}f(n,"top",n.scrollTop+i.top);f(n,"left",n.scrollLeft+i.left);e(n)},50))}function h(){s&&(clearInterval(s),s=null);r.stopScrolling(n)}var s=null,i={top:0,left:0},o=!1;t.event.bind(t.ownerDocument,"selectionchange",function(){n.contains(c())?o=!0:(o=!1,h())});t.event.bind(window,"mouseup",function(){o&&(o=!1,h())});t.event.bind(window,"keyup",function(){o&&(o=!1,h())});t.event.bind(window,"mousemove",function(t){if(o){var u={x:t.pageX,y:t.pageY},f={left:n.offsetLeft,right:n.offsetLeft+n.offsetWidth,top:n.offsetTop,bottom:n.offsetTop+n.offsetHeight};u.x<f.left+3?(i.left=-5,r.startScrolling(n,"x")):u.x>f.right-3?(i.left=5,r.startScrolling(n,"x")):i.left=0;u.y<f.top+3?(i.top=f.top+3-u.y<5?-5:-20,r.startScrolling(n,"y")):u.y>f.bottom-3?(i.top=u.y-f.bottom+3<5?5:20,r.startScrolling(n,"y")):i.top=0;i.top===0&&i.left===0?h():l()}})}var r=i(12),u=i(15),e=i(20),f=i(21);n.exports=function(n){var t=u.get(n);o(n,t)}},function(n,t,i){"use strict";function f(n,t){t.event.bind(n,"scroll",function(){u(n)})}var r=i(15),u=i(20);n.exports=function(n){var t=r.get(n);f(n,t)}},function(n,t,i){"use strict";var u=i(12),r=i(14),e=i(15),o=i(20),f=i(21);n.exports=function(n){var t=e.get(n);t&&(t.negativeScrollAdjustment=t.isNegativeScroll?n.scrollWidth-n.clientWidth:0,r.css(t.scrollbarXRail,"display","block"),r.css(t.scrollbarYRail,"display","block"),t.railXMarginWidth=u.toInt(r.css(t.scrollbarXRail,"marginLeft"))+u.toInt(r.css(t.scrollbarXRail,"marginRight")),t.railYMarginHeight=u.toInt(r.css(t.scrollbarYRail,"marginTop"))+u.toInt(r.css(t.scrollbarYRail,"marginBottom")),r.css(t.scrollbarXRail,"display","none"),r.css(t.scrollbarYRail,"display","none"),o(n),f(n,"top",n.scrollTop),f(n,"left",n.scrollLeft),r.css(t.scrollbarXRail,"display",""),r.css(t.scrollbarYRail,"display",""))}}]),function(){".sk-hpm-emoji-adaptacion"&&$(".sk-segment-bottom").prepend('<a class="hpm-logo-js" href="https://www.durex.es"><\/a>')}();$(window).on("load",function(){var n;$("body").hasClass("sk-hpm-durex-red-rpa")&&(n=document.body,n.classList.add("sk-hpm-global"));$("div").hasClass("pos-fixed")&&(n=document.body,n.classList.add("sk-hpm-global"));$("div").hasClass("pos-fixed-one")&&(n=document.body,n.classList.add("sk-hpm-global-red"));$(".sk-grid-content").insertBefore($(".clp-page"))});(function(n,t){typeof exports=="object"&&typeof module!="undefined"?module.exports=t():typeof define=="function"&&define.amd?define("dotPaintWidget",t):n.dotPaintWidget=t()})(this,function(){"use strict";function bt(){}function t(n,t){this.x=n||0;this.y=t||0}function o(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function g(n,t,i,r){this._x=n||0;this._y=t||0;this._z=i||0;this._w=r!==undefined?r:1}function n(n,t,i){this.x=n||0;this.y=t||0;this.z=i||0}function ot(){this.elements=[1,0,0,0,1,0,0,0,1];arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}function b(n,i,r,u,f,e,o,s,c,l){Object.defineProperty(this,"id",{value:ly++});this.uuid=h.generateUUID();this.name="";this.image=n!==undefined?n:b.DEFAULT_IMAGE;this.mipmaps=[];this.mapping=i!==undefined?i:b.DEFAULT_MAPPING;this.wrapS=r!==undefined?r:yt;this.wrapT=u!==undefined?u:yt;this.magFilter=f!==undefined?f:et;this.minFilter=e!==undefined?e:so;this.anisotropy=c!==undefined?c:1;this.format=o!==undefined?o:ai;this.type=s!==undefined?s:wc;this.offset=new t(0,0);this.repeat=new t(1,1);this.center=new t(0,0);this.rotation=0;this.matrixAutoUpdate=!0;this.matrix=new ot;this.generateMipmaps=!0;this.premultiplyAlpha=!1;this.flipY=!0;this.unpackAlignment=4;this.encoding=l!==undefined?l:yo;this.version=0;this.onUpdate=null}function p(n,t,i,r){this.x=n||0;this.y=t||0;this.z=i||0;this.w=r!==undefined?r:1}function ef(n,t,i){this.uuid=h.generateUUID();this.width=n;this.height=t;this.scissor=new p(0,0,n,t);this.scissorTest=!1;this.viewport=new p(0,0,n,t);i=i||{};i.minFilter===undefined&&(i.minFilter=et);this.texture=new b(undefined,undefined,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding);this.depthBuffer=i.depthBuffer!==undefined?i.depthBuffer:!0;this.stencilBuffer=i.stencilBuffer!==undefined?i.stencilBuffer:!0;this.depthTexture=i.depthTexture!==undefined?i.depthTexture:null}function of(n,t,i){ef.call(this,n,t,i);this.activeCubeFace=0;this.activeMipMapLevel=0}function gr(n,t,i,r,u,f,e,o,s,h,c,l){b.call(this,null,f,e,o,s,h,r,u,c,l);this.image={data:n,width:t,height:i};this.magFilter=s!==undefined?s:pt;this.minFilter=h!==undefined?h:pt;this.generateMipmaps=!1;this.flipY=!1;this.unpackAlignment=1}function di(n,t,i,r,u,f,e,o,s,h){n=n!==undefined?n:[];t=t!==undefined?t:hc;b.call(this,n,t,i,r,u,f,e,o,s,h);this.flipY=!1}function ay(){this.seq=[];this.map={}}function nu(n,t,i){var e=n[0],u,r,f,o;if(e<=0||e>0)return n;if(u=t*i,r=vy[u],r===undefined&&(r=new Float32Array(u),vy[u]=r),t!==0)for(e.toArray(r,0),f=1,o=0;f!==t;++f)o+=i,n[f].toArray(r,o);return r}function by(n,t){var i=yy[t],r;for(i===undefined&&(i=new Int32Array(t),yy[t]=i),r=0;r!==t;++r)i[r]=n.allocTextureUnit();return i}function ld(n,t){n.uniform1f(this.addr,t)}function ad(n,t){n.uniform1i(this.addr,t)}function vd(n,t){t.x===undefined?n.uniform2fv(this.addr,t):n.uniform2f(this.addr,t.x,t.y)}function yd(n,t){t.x!==undefined?n.uniform3f(this.addr,t.x,t.y,t.z):t.r!==undefined?n.uniform3f(this.addr,t.r,t.g,t.b):n.uniform3fv(this.addr,t)}function pd(n,t){t.x===undefined?n.uniform4fv(this.addr,t):n.uniform4f(this.addr,t.x,t.y,t.z,t.w)}function wd(n,t){n.uniformMatrix2fv(this.addr,!1,t.elements||t)}function bd(n,t){t.elements===undefined?n.uniformMatrix3fv(this.addr,!1,t):(wy.set(t.elements),n.uniformMatrix3fv(this.addr,!1,wy))}function kd(n,t){t.elements===undefined?n.uniformMatrix4fv(this.addr,!1,t):(py.set(t.elements),n.uniformMatrix4fv(this.addr,!1,py))}function dd(n,t,i){var r=i.allocTextureUnit();n.uniform1i(this.addr,r);i.setTexture2D(t||dc,r)}function gd(n,t,i){var r=i.allocTextureUnit();n.uniform1i(this.addr,r);i.setTextureCube(t||gc,r)}function ky(n,t){n.uniform2iv(this.addr,t)}function dy(n,t){n.uniform3iv(this.addr,t)}function gy(n,t){n.uniform4iv(this.addr,t)}function ng(n){switch(n){case 5126:return ld;case 35664:return vd;case 35665:return yd;case 35666:return pd;case 35674:return wd;case 35675:return bd;case 35676:return kd;case 35678:case 36198:return dd;case 35680:return gd;case 5124:case 35670:return ad;case 35667:case 35671:return ky;case 35668:case 35672:return dy;case 35669:case 35673:return gy}}function tg(n,t){n.uniform1fv(this.addr,t)}function ig(n,t){n.uniform1iv(this.addr,t)}function rg(n,t){n.uniform2fv(this.addr,nu(t,this.size,2))}function ug(n,t){n.uniform3fv(this.addr,nu(t,this.size,3))}function fg(n,t){n.uniform4fv(this.addr,nu(t,this.size,4))}function eg(n,t){n.uniformMatrix2fv(this.addr,!1,nu(t,this.size,4))}function og(n,t){n.uniformMatrix3fv(this.addr,!1,nu(t,this.size,9))}function sg(n,t){n.uniformMatrix4fv(this.addr,!1,nu(t,this.size,16))}function hg(n,t,i){var u=t.length,f=by(i,u),r;for(n.uniform1iv(this.addr,f),r=0;r!==u;++r)i.setTexture2D(t[r]||dc,f[r])}function cg(n,t,i){var u=t.length,f=by(i,u),r;for(n.uniform1iv(this.addr,f),r=0;r!==u;++r)i.setTextureCube(t[r]||gc,f[r])}function lg(n){switch(n){case 5126:return tg;case 35664:return rg;case 35665:return ug;case 35666:return fg;case 35674:return eg;case 35675:return og;case 35676:return sg;case 35678:return hg;case 35680:return cg;case 5124:case 35670:return ig;case 35667:case 35671:return ky;case 35668:case 35672:return dy;case 35669:case 35673:return gy}}function ag(n,t,i){this.id=n;this.addr=i;this.setValue=ng(t.type)}function vg(n,t,i){this.id=n;this.addr=i;this.size=t.size;this.setValue=lg(t.type)}function np(n){this.id=n;ay.call(this)}function tp(n,t){n.seq.push(t);n.map[t.id]=t}function yg(n,t,i){var o=n.name,h=o.length,s,u;for(po.lastIndex=0;;){var f=po.exec(o),c=po.lastIndex,r=f[1],l=f[2]==="]",e=f[3];if(l&&(r=r|0),e===undefined||e==="["&&c+2===h){tp(i,e===undefined?new ag(r,n,t):new vg(r,n,t));break}else s=i.map,u=s[r],u===undefined&&(u=new np(r),tp(i,u)),i=u}}function gi(n,t,i){var e=this,u,r;for(ay.call(this),this.renderer=i,u=n.getProgramParameter(t,n.ACTIVE_UNIFORMS),r=0;r<u;++r){var f=n.getActiveUniform(t,r),o=f.name,s=n.getUniformLocation(t,o);yg(f,s,e)}}function f(n,t,i){return t===undefined&&i===undefined?this.set(n):this.setRGB(n,t,i)}function nl(n,i){this.min=n!==undefined?n:new t(+ Infinity,+ Infinity);this.max=i!==undefined?i:new t(- Infinity,- Infinity)}function pg(i,r,u,f,e){function p(){var n=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),t=new Uint16Array([0,1,2,0,2,3]);l=r.createBuffer();a=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,l);r.bufferData(r.ARRAY_BUFFER,n,r.STATIC_DRAW);r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,a);r.bufferData(r.ELEMENT_ARRAY_BUFFER,t,r.STATIC_DRAW);c=r.createTexture();v=r.createTexture();u.bindTexture(r.TEXTURE_2D,c);r.texImage2D(r.TEXTURE_2D,0,r.RGB,16,16,0,r.RGB,r.UNSIGNED_BYTE,null);r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE);r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE);r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST);r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST);u.bindTexture(r.TEXTURE_2D,v);r.texImage2D(r.TEXTURE_2D,0,r.RGBA,16,16,0,r.RGBA,r.UNSIGNED_BYTE,null);r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE);r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE);r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST);r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST);y={vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\n\tvUV = uv;\n\tvec2 pos = position;\n\tif ( renderType == 2 ) {\n\t\tvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\n\t\tvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\n\t\tvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\n\t\tvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\n\t\tvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\n\t\tvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\n\t\tvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\n\t\tvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\n\t\tvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\n\t\tvVisibility =        visibility.r / 9.0;\n\t\tvVisibility *= 1.0 - visibility.g / 9.0;\n\t\tvVisibility *=       visibility.b / 9.0;\n\t\tvVisibility *= 1.0 - visibility.a / 9.0;\n\t\tpos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\n\t\tpos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n\t}\n\tgl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",fragmentShader:"uniform lowp int renderType;\nuniform sampler2D map;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\n\tif ( renderType == 0 ) {\n\t\tgl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n\t} else if ( renderType == 1 ) {\n\t\tgl_FragColor = texture2D( map, vUV );\n\t} else {\n\t\tvec4 texture = texture2D( map, vUV );\n\t\ttexture.a *= opacity * vVisibility;\n\t\tgl_FragColor = texture;\n\t\tgl_FragColor.rgb *= color;\n\t}\n}"};o=w(y);h={vertex:r.getAttribLocation(o,"position"),uv:r.getAttribLocation(o,"uv")};s={renderType:r.getUniformLocation(o,"renderType"),map:r.getUniformLocation(o,"map"),occlusionMap:r.getUniformLocation(o,"occlusionMap"),opacity:r.getUniformLocation(o,"opacity"),color:r.getUniformLocation(o,"color"),scale:r.getUniformLocation(o,"scale"),rotation:r.getUniformLocation(o,"rotation"),screenPosition:r.getUniformLocation(o,"screenPosition")}}function w(n){var t=r.createProgram(),i=r.createShader(r.FRAGMENT_SHADER),u=r.createShader(r.VERTEX_SHADER),f="precision "+e.precision+" float;\n";return r.shaderSource(i,f+n.fragmentShader),r.shaderSource(u,f+n.vertexShader),r.compileShader(i),r.compileShader(u),r.attachShader(t,i),r.attachShader(t,u),r.linkProgram(t),t}var l,a,y,o,h,s,c,v;this.render=function(i,e,y,w){var rt,ht,d,ut,ct,b;if(i.length!==0){var it=new n,ft=w.w/w.z,ot=w.z*.5,st=w.w*.5,g=16/w.w,nt=new t(g*ft,g),k=new n(1,1,0),tt=new t(1,1),et=new nl;for(et.min.set(w.x,w.y),et.max.set(w.x+(w.z-16),w.y+(w.w-16)),o===undefined&&p(),u.useProgram(o),u.initAttributes(),u.enableAttribute(h.vertex),u.enableAttribute(h.uv),u.disableUnusedAttributes(),r.uniform1i(s.occlusionMap,0),r.uniform1i(s.map,1),r.bindBuffer(r.ARRAY_BUFFER,l),r.vertexAttribPointer(h.vertex,2,r.FLOAT,!1,16,0),r.vertexAttribPointer(h.uv,2,r.FLOAT,!1,16,8),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,a),u.disable(r.CULL_FACE),u.buffers.depth.setMask(!1),rt=0,ht=i.length;rt<ht;rt++)if(g=16/w.w,nt.set(g*ft,g),d=i[rt],it.set(d.matrixWorld.elements[12],d.matrixWorld.elements[13],d.matrixWorld.elements[14]),it.applyMatrix4(y.matrixWorldInverse),it.applyMatrix4(y.projectionMatrix),k.copy(it),tt.x=w.x+k.x*ot+ot-8,tt.y=w.y+k.y*st+st-8,et.containsPoint(tt)===!0)for(u.activeTexture(r.TEXTURE0),u.bindTexture(r.TEXTURE_2D,null),u.activeTexture(r.TEXTURE1),u.bindTexture(r.TEXTURE_2D,c),r.copyTexImage2D(r.TEXTURE_2D,0,r.RGB,tt.x,tt.y,16,16,0),r.uniform1i(s.renderType,0),r.uniform2f(s.scale,nt.x,nt.y),r.uniform3f(s.screenPosition,k.x,k.y,k.z),u.disable(r.BLEND),u.enable(r.DEPTH_TEST),r.drawElements(r.TRIANGLES,6,r.UNSIGNED_SHORT,0),u.activeTexture(r.TEXTURE0),u.bindTexture(r.TEXTURE_2D,v),r.copyTexImage2D(r.TEXTURE_2D,0,r.RGBA,tt.x,tt.y,16,16,0),r.uniform1i(s.renderType,1),u.disable(r.DEPTH_TEST),u.activeTexture(r.TEXTURE1),u.bindTexture(r.TEXTURE_2D,c),r.drawElements(r.TRIANGLES,6,r.UNSIGNED_SHORT,0),d.positionScreen.copy(k),d.customUpdateCallback?d.customUpdateCallback(d):d.updateLensFlares(),r.uniform1i(s.renderType,2),u.enable(r.BLEND),ut=0,ct=d.lensFlares.length;ut<ct;ut++)b=d.lensFlares[ut],b.opacity>.001&&b.scale>.001&&(k.x=b.x,k.y=b.y,k.z=b.z,g=b.size*b.scale/w.w,nt.x=g*ft,nt.y=g,r.uniform3f(s.screenPosition,k.x,k.y,k.z),r.uniform2f(s.scale,nt.x,nt.y),r.uniform1f(s.rotation,b.rotation),r.uniform1f(s.opacity,b.opacity),r.uniform3f(s.color,b.color.r,b.color.g,b.color.b),u.setBlending(b.blending,b.blendEquation,b.blendSrc,b.blendDst),f.setTexture2D(b.texture,1),r.drawElements(r.TRIANGLES,6,r.UNSIGNED_SHORT,0));u.enable(r.CULL_FACE);u.enable(r.DEPTH_TEST);u.buffers.depth.setMask(!0);u.reset()}}}function wo(n,t,i,r,u,f,e,o,s){b.call(this,n,t,i,r,u,f,e,o,s);this.needsUpdate=!0}function wg(t,i,r,u,f){function p(){var r=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),u=new Uint16Array([0,1,2,0,2,3]),n,t;h=i.createBuffer();c=i.createBuffer();i.bindBuffer(i.ARRAY_BUFFER,h);i.bufferData(i.ARRAY_BUFFER,r,i.STATIC_DRAW);i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,c);i.bufferData(i.ELEMENT_ARRAY_BUFFER,u,i.STATIC_DRAW);e=w();s={position:i.getAttribLocation(e,"position"),uv:i.getAttribLocation(e,"uv")};o={uvOffset:i.getUniformLocation(e,"uvOffset"),uvScale:i.getUniformLocation(e,"uvScale"),rotation:i.getUniformLocation(e,"rotation"),scale:i.getUniformLocation(e,"scale"),color:i.getUniformLocation(e,"color"),map:i.getUniformLocation(e,"map"),opacity:i.getUniformLocation(e,"opacity"),modelViewMatrix:i.getUniformLocation(e,"modelViewMatrix"),projectionMatrix:i.getUniformLocation(e,"projectionMatrix"),fogType:i.getUniformLocation(e,"fogType"),fogDensity:i.getUniformLocation(e,"fogDensity"),fogNear:i.getUniformLocation(e,"fogNear"),fogFar:i.getUniformLocation(e,"fogFar"),fogColor:i.getUniformLocation(e,"fogColor"),fogDepth:i.getUniformLocation(e,"fogDepth"),alphaTest:i.getUniformLocation(e,"alphaTest")};n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");n.width=8;n.height=8;t=n.getContext("2d");t.fillStyle="white";t.fillRect(0,0,8,8);a=new wo(n)}function w(){var n=i.createProgram(),t=i.createShader(i.VERTEX_SHADER),r=i.createShader(i.FRAGMENT_SHADER);return i.shaderSource(t,["precision "+f.precision+" float;","#define SHADER_NAME SpriteMaterial","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float rotation;","uniform vec2 scale;","uniform vec2 uvOffset;","uniform vec2 uvScale;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","varying float fogDepth;","void main() {","\tvUV = uvOffset + uv * uvScale;","\tvec2 alignedPosition = position * scale;","\tvec2 rotatedPosition;","\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;","\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;","\tvec4 mvPosition;","\tmvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );","\tmvPosition.xy += rotatedPosition;","\tgl_Position = projectionMatrix * mvPosition;","\tfogDepth = - mvPosition.z;","}"].join("\n")),i.shaderSource(r,["precision "+f.precision+" float;","#define SHADER_NAME SpriteMaterial","uniform vec3 color;","uniform sampler2D map;","uniform float opacity;","uniform int fogType;","uniform vec3 fogColor;","uniform float fogDensity;","uniform float fogNear;","uniform float fogFar;","uniform float alphaTest;","varying vec2 vUV;","varying float fogDepth;","void main() {","\tvec4 texture = texture2D( map, vUV );","\tgl_FragColor = vec4( color * texture.xyz, texture.a * opacity );","\tif ( gl_FragColor.a < alphaTest ) discard;","\tif ( fogType > 0 ) {","\t\tfloat fogFactor = 0.0;","\t\tif ( fogType == 1 ) {","\t\t\tfogFactor = smoothstep( fogNear, fogFar, fogDepth );","\t\t} else {","\t\t\tconst float LOG2 = 1.442695;","\t\t\tfogFactor = exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 );","\t\t\tfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","\t\t}","\t\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );","\t}","}"].join("\n")),i.compileShader(t),i.compileShader(r),i.attachShader(n,t),i.attachShader(n,r),i.linkProgram(n),n}function b(n,t){return n.renderOrder!==t.renderOrder?n.renderOrder-t.renderOrder:n.z!==t.z?t.z-n.z:t.id-n.id}var h,c,e,s,o,a,v=new n,y=new g,l=new n;this.render=function(n,f,w){var ft,nt,it,d,k,rt;if(n.length!==0){e===undefined&&p();r.useProgram(e);r.initAttributes();r.enableAttribute(s.position);r.enableAttribute(s.uv);r.disableUnusedAttributes();r.disable(i.CULL_FACE);r.enable(i.BLEND);i.bindBuffer(i.ARRAY_BUFFER,h);i.vertexAttribPointer(s.position,2,i.FLOAT,!1,16,0);i.vertexAttribPointer(s.uv,2,i.FLOAT,!1,16,8);i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,c);i.uniformMatrix4fv(o.projectionMatrix,!1,w.projectionMatrix.elements);r.activeTexture(i.TEXTURE0);i.uniform1i(o.map,0);var tt=0,ut=0,g=f.fog;for(g?(i.uniform3f(o.fogColor,g.color.r,g.color.g,g.color.b),g.isFog?(i.uniform1f(o.fogNear,g.near),i.uniform1f(o.fogFar,g.far),i.uniform1i(o.fogType,1),tt=1,ut=1):g.isFogExp2&&(i.uniform1f(o.fogDensity,g.density),i.uniform1i(o.fogType,2),tt=2,ut=2)):(i.uniform1i(o.fogType,0),tt=0,ut=0),nt=0,it=n.length;nt<it;nt++)d=n[nt],d.modelViewMatrix.multiplyMatrices(w.matrixWorldInverse,d.matrixWorld),d.z=-d.modelViewMatrix.elements[14];for(n.sort(b),ft=[],nt=0,it=n.length;nt<it;nt++)if(d=n[nt],k=d.material,k.visible!==!1){d.onBeforeRender(t,f,w,undefined,k,undefined);i.uniform1f(o.alphaTest,k.alphaTest);i.uniformMatrix4fv(o.modelViewMatrix,!1,d.modelViewMatrix.elements);d.matrixWorld.decompose(v,y,l);ft[0]=l.x;ft[1]=l.y;rt=0;f.fog&&k.fog&&(rt=ut);tt!==rt&&(i.uniform1i(o.fogType,rt),tt=rt);k.map!==null?(i.uniform2f(o.uvOffset,k.map.offset.x,k.map.offset.y),i.uniform2f(o.uvScale,k.map.repeat.x,k.map.repeat.y)):(i.uniform2f(o.uvOffset,0,0),i.uniform2f(o.uvScale,1,1));i.uniform1f(o.opacity,k.opacity);i.uniform3f(o.color,k.color.r,k.color.g,k.color.b);i.uniform1f(o.rotation,k.rotation);i.uniform2fv(o.scale,ft);r.setBlending(k.blending,k.blendEquation,k.blendSrc,k.blendDst,k.blendEquationAlpha,k.blendSrcAlpha,k.blendDstAlpha,k.premultipliedAlpha);r.buffers.depth.setTest(k.depthTest);r.buffers.depth.setMask(k.depthWrite);r.buffers.color.setMask(k.colorWrite);u.setTexture2D(k.map||a,0);i.drawElements(i.TRIANGLES,6,i.UNSIGNED_SHORT,0);d.onAfterRender(t,f,w,undefined,k,undefined)}r.enable(i.CULL_FACE);r.reset()}}}function l(){Object.defineProperty(this,"id",{value:rp++});this.uuid=h.generateUUID();this.name="";this.type="Material";this.fog=!0;this.lights=!0;this.blending=tf;this.side=gu;this.flatShading=!1;this.vertexColors=ic;this.opacity=1;this.transparent=!1;this.blendSrc=wv;this.blendDst=fc;this.blendEquation=av;this.blendSrcAlpha=null;this.blendDstAlpha=null;this.blendEquationAlpha=null;this.depthFunc=ec;this.depthTest=!0;this.depthWrite=!0;this.clippingPlanes=null;this.clipIntersection=!1;this.clipShadows=!1;this.colorWrite=!0;this.precision=null;this.polygonOffset=!1;this.polygonOffsetFactor=0;this.polygonOffsetUnits=0;this.dithering=!1;this.alphaTest=0;this.premultipliedAlpha=!1;this.overdraw=0;this.visible=!0;this.userData={};this.needsUpdate=!0}function nr(n){l.call(this);this.type="MeshDepthMaterial";this.depthPacking=hd;this.skinning=!1;this.morphTargets=!1;this.map=null;this.alphaMap=null;this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.wireframe=!1;this.wireframeLinewidth=1;this.fog=!1;this.lights=!1;this.setValues(n)}function tr(t){l.call(this);this.type="MeshDistanceMaterial";this.referencePosition=new n;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.lights=!1;this.setValues(t)}function vi(t,i){this.min=t!==undefined?t:new n(+ Infinity,+ Infinity,+ Infinity);this.max=i!==undefined?i:new n(- Infinity,- Infinity,- Infinity)}function ti(t,i){this.center=t!==undefined?t:new n;this.radius=i!==undefined?i:0}function kt(t,i){this.normal=t!==undefined?t:new n(1,0,0);this.constant=i!==undefined?i:0}function tl(n,t,i,r,u,f){this.planes=[n!==undefined?n:new kt,t!==undefined?t:new kt,i!==undefined?i:new kt,r!==undefined?r:new kt,u!==undefined?u:new kt,f!==undefined?f:new kt]}function up(i,r,u){function rt(n,t,r,u,f,e){var s=n.geometry,o=null,nt=k,b=n.customDepthMaterial,p,tt,w,y,h;if(r&&(nt=d,b=n.customDistanceMaterial),b?o=b:(p=!1,t.morphTargets&&(s&&s.isBufferGeometry?p=s.morphAttributes&&s.morphAttributes.position&&s.morphAttributes.position.length>0:s&&s.isGeometry&&(p=s.morphTargets&&s.morphTargets.length>0)),n.isSkinnedMesh&&t.skinning===!1&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",n),tt=n.isSkinnedMesh&&t.skinning,w=0,p&&(w|=a),tt&&(w|=v),o=nt[w]),i.localClippingEnabled&&t.clipShadows===!0&&t.clippingPlanes.length!==0){var it=o.uuid,rt=t.uuid,l=g[it];l===undefined&&(l={},g[it]=l);y=l[rt];y===undefined&&(y=o.clone(),l[rt]=y);o=y}return o.visible=t.visible,o.wireframe=t.wireframe,h=t.side,c.renderSingleSided&&h==nf&&(h=gu),c.renderReverseSided&&(h===gu?h=ki:h===ki&&(h=gu)),o.side=h,o.clipShadows=t.clipShadows,o.clippingPlanes=t.clippingPlanes,o.clipIntersection=t.clipIntersection,o.wireframeLinewidth=t.wireframeLinewidth,o.linewidth=t.linewidth,r&&o.isMeshDistanceMaterial&&(o.referencePosition.copy(u),o.nearDistance=f,o.farDistance=e),o}function ut(n,t,u,f){var b,h,o,v,c,k,y,l,s,p,a,d;if(n.visible!==!1){if(b=n.layers.test(t.layers),b&&(n.isMesh||n.isLine||n.isPoints)&&n.castShadow&&(!n.frustumCulled||w.intersectsObject(n)))if(n.modelViewMatrix.multiplyMatrices(u.matrixWorldInverse,n.matrixWorld),h=r.update(n),o=n.material,Array.isArray(o))for(v=h.groups,c=0,k=v.length;c<k;c++)y=v[c],l=o[y.materialIndex],l&&l.visible&&(s=rt(n,l,f,e,u.near,u.far),i.renderBufferDirect(u,null,h,s,n,y));else o.visible&&(s=rt(n,o,f,e,u.near,u.far),i.renderBufferDirect(u,null,h,s,n,null));for(p=n.children,a=0,d=p.length;a<d;a++)ut(p[a],t,u,f)}}for(var w=new tl,b=new o,f=new t,ft=new t(u,u),l=new n,e=new n,a=1,v=2,y=(a|v)+1,k=new Array(y),d=new Array(y),g={},et=[new n(1,0,0),new n(-1,0,0),new n(0,0,1),new n(0,0,-1),new n(0,1,0),new n(0,-1,0)],ot=[new n(0,1,0),new n(0,1,0),new n(0,1,0),new n(0,1,0),new n(0,0,1),new n(0,0,-1)],s=[new p,new p,new p,new p,new p,new p],it,c,h=0;h!==y;++h){var nt=(h&a)!=0,tt=(h&v)!=0,st=new nr({depthPacking:cd,morphTargets:nt,skinning:tt});k[h]=st;it=new tr({morphTargets:nt,skinning:tt});d[h]=it}c=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=ev;this.renderReverseSided=!0;this.renderSingleSided=!0;this.render=function(n,t,r){var tt,y,nt,d,it,u,o,h,rt,st,k,p,ht;if(c.enabled!==!1&&(c.autoUpdate!==!1||c.needsUpdate!==!1)&&n.length!==0){for(tt=i.context,y=i.state,y.disable(tt.BLEND),y.buffers.color.setClear(1,1,1,1),y.buffers.depth.setTest(!0),y.setScissorTest(!1),d=0,it=n.length;d<it;d++){var v=n[d],a=v.shadow,g=v&&v.isPointLight;if(a===undefined){console.warn("THREE.WebGLShadowMap:",v,"has no shadow.");continue}for(u=a.camera,f.copy(a.mapSize),f.min(ft),g&&(o=f.x,h=f.y,s[0].set(o*2,h,o,h),s[1].set(0,h,o,h),s[2].set(o*3,h,o,h),s[3].set(o,h,o,h),s[4].set(o*3,0,o,h),s[5].set(o,0,o,h),f.x*=4,f.y*=2),a.map===null&&(rt={minFilter:pt,magFilter:pt,format:ai},a.map=new ef(f.x,f.y,rt),a.map.texture.name=v.name+".shadowMap",u.updateProjectionMatrix()),a.isSpotLightShadow&&a.update(v),st=a.map,k=a.matrix,e.setFromMatrixPosition(v.matrixWorld),u.position.copy(e),g?(nt=6,k.makeTranslation(-e.x,-e.y,-e.z)):(nt=1,l.setFromMatrixPosition(v.target.matrixWorld),u.lookAt(l),u.updateMatrixWorld(),k.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),k.multiply(u.projectionMatrix),k.multiply(u.matrixWorldInverse)),i.setRenderTarget(st),i.clear(),p=0;p<nt;p++)g&&(l.copy(u.position),l.add(et[p]),u.up.copy(ot[p]),u.lookAt(l),u.updateMatrixWorld(),ht=s[p],y.viewport(ht)),b.multiplyMatrices(u.projectionMatrix,u.matrixWorldInverse),w.setFromMatrix(b),ut(t,r,u,g)}c.needsUpdate=!1}}}function bg(n){function i(t,i){var r=t.array,e=t.dynamic?n.DYNAMIC_DRAW:n.STATIC_DRAW,f=n.createBuffer(),u;return n.bindBuffer(i,f),n.bufferData(i,r,e),t.onUploadCallback(),u=n.FLOAT,r instanceof Float32Array?u=n.FLOAT:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?u=n.UNSIGNED_SHORT:r instanceof Int16Array?u=n.SHORT:r instanceof Uint32Array?u=n.UNSIGNED_INT:r instanceof Int32Array?u=n.INT:r instanceof Int8Array?u=n.BYTE:r instanceof Uint8Array&&(u=n.UNSIGNED_BYTE),{buffer:f,type:u,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version}}function r(t,i,r){var f=i.array,u=i.updateRange;n.bindBuffer(r,t);i.dynamic===!1?n.bufferData(r,f,n.STATIC_DRAW):u.count===-1?n.bufferSubData(r,0,f):u.count===0?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(n.bufferSubData(r,u.offset*f.BYTES_PER_ELEMENT,f.subarray(u.offset,u.offset+u.count)),u.count=-1)}function u(n){return n.isInterleavedBufferAttribute&&(n=n.data),t[n.uuid]}function f(i){i.isInterleavedBufferAttribute&&(i=i.data);var r=t[i.uuid];r&&(n.deleteBuffer(r.buffer),delete t[i.uuid])}function e(n,u){n.isInterleavedBufferAttribute&&(n=n.data);var f=t[n.uuid];f===undefined?t[n.uuid]=i(n,u):f.version<n.version&&(r(f.buffer,n,u),f.version=n.version)}var t={};return{get:u,remove:f,update:e}}function yi(n,t,i,r){this._x=n||0;this._y=t||0;this._z=i||0;this._order=r||yi.DefaultOrder}function fp(){this.mask=1}function r(){function e(){i.setFromEuler(t,!1)}function s(){t.setFromQuaternion(i,undefined,!1)}Object.defineProperty(this,"id",{value:ep++});this.uuid=h.generateUUID();this.name="";this.type="Object3D";this.parent=null;this.children=[];this.up=r.DefaultUp.clone();var u=new n,t=new yi,i=new g,f=new n(1,1,1);t.onChange(e);i.onChange(s);Object.defineProperties(this,{position:{enumerable:!0,value:u},rotation:{enumerable:!0,value:t},quaternion:{enumerable:!0,value:i},scale:{enumerable:!0,value:f},modelViewMatrix:{value:new o},normalMatrix:{value:new ot}});this.matrix=new o;this.matrixWorld=new o;this.matrixAutoUpdate=r.DefaultMatrixAutoUpdate;this.matrixWorldNeedsUpdate=!1;this.layers=new fp;this.visible=!0;this.castShadow=!1;this.receiveShadow=!1;this.frustumCulled=!0;this.renderOrder=0;this.userData={}}function oi(){r.call(this);this.type="Camera";this.matrixWorldInverse=new o;this.projectionMatrix=new o}function sf(n,t,i,r,u,f){oi.call(this);this.type="OrthographicCamera";this.zoom=1;this.view=null;this.left=n;this.right=t;this.top=i;this.bottom=r;this.near=u!==undefined?u:.1;this.far=f!==undefined?f:2e3;this.updateProjectionMatrix()}function ir(t,i,r,u,e,o){this.a=t;this.b=i;this.c=r;this.normal=u&&u.isVector3?u:new n;this.vertexNormals=Array.isArray(u)?u:[];this.color=e&&e.isColor?e:new f;this.vertexColors=Array.isArray(e)?e:[];this.materialIndex=o!==undefined?o:0}function s(){Object.defineProperty(this,"id",{value:op+=2});this.uuid=h.generateUUID();this.name="";this.type="Geometry";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingBox=null;this.boundingSphere=null;this.elementsNeedUpdate=!1;this.verticesNeedUpdate=!1;this.uvsNeedUpdate=!1;this.normalsNeedUpdate=!1;this.colorsNeedUpdate=!1;this.lineDistancesNeedUpdate=!1;this.groupsNeedUpdate=!1}function c(n,t,i){if(Array.isArray(n))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.uuid=h.generateUUID();this.name="";this.array=n;this.itemSize=t;this.count=n!==undefined?n.length/t:0;this.normalized=i===!0;this.dynamic=!1;this.updateRange={offset:0,count:-1};this.onUploadCallback=function(){};this.version=0}function il(n,t,i){c.call(this,new Int8Array(n),t,i)}function rl(n,t,i){c.call(this,new Uint8Array(n),t,i)}function ul(n,t,i){c.call(this,new Uint8ClampedArray(n),t,i)}function fl(n,t,i){c.call(this,new Int16Array(n),t,i)}function hf(n,t,i){c.call(this,new Uint16Array(n),t,i)}function el(n,t,i){c.call(this,new Int32Array(n),t,i)}function cf(n,t,i){c.call(this,new Uint32Array(n),t,i)}function i(n,t,i){c.call(this,new Float32Array(n),t,i)}function ol(n,t,i){c.call(this,new Float64Array(n),t,i)}function sp(){this.indices=[];this.vertices=[];this.normals=[];this.colors=[];this.uvs=[];this.uvs2=[];this.groups=[];this.morphTargets={};this.skinWeights=[];this.skinIndices=[];this.boundingBox=null;this.boundingSphere=null;this.verticesNeedUpdate=!1;this.normalsNeedUpdate=!1;this.colorsNeedUpdate=!1;this.uvsNeedUpdate=!1;this.groupsNeedUpdate=!1}function sl(n){var i,t,r;if(n.length===0)return- Infinity;for(i=n[0],t=1,r=n.length;t<r;++t)n[t]>i&&(i=n[t]);return i}function u(){Object.defineProperty(this,"id",{value:hp+=2});this.uuid=h.generateUUID();this.name="";this.type="BufferGeometry";this.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingBox=null;this.boundingSphere=null;this.drawRange={start:0,count:Infinity}}function lf(n,t,i,r,u,f){s.call(this);this.type="BoxGeometry";this.parameters={width:n,height:t,depth:i,widthSegments:r,heightSegments:u,depthSegments:f};this.fromBufferGeometry(new iu(n,t,i,r,u,f));this.mergeVertices()}function iu(t,r,f,e,o,s){function h(t,i,r,u,f,e,o,s,h,b,k){for(var st=e/h,ht=o/b,ct=e/2,lt=o/2,at=s/2,tt=h+1,vt=b+1,rt=0,it=0,d,nt=new n,ut,ft,g=0;g<vt;g++)for(ut=g*ht-lt,d=0;d<tt;d++)ft=d*st-ct,nt[t]=ft*u,nt[i]=ut*f,nt[r]=at,y.push(nt.x,nt.y,nt.z),nt[t]=0,nt[i]=0,nt[r]=s>0?1:-1,p.push(nt.x,nt.y,nt.z),a.push(d/h),a.push(1-g/b),rt+=1;for(g=0;g<b;g++)for(d=0;d<h;d++){var yt=c+d+tt*g,et=c+d+tt*(g+1),pt=c+(d+1)+tt*(g+1),ot=c+(d+1)+tt*g;l.push(yt,et,ot);l.push(et,pt,ot);it+=6}v.addGroup(w,it,k);w+=it;c+=rt}var v;u.call(this);this.type="BoxBufferGeometry";this.parameters={width:t,height:r,depth:f,widthSegments:e,heightSegments:o,depthSegments:s};v=this;t=t||1;r=r||1;f=f||1;e=Math.floor(e)||1;o=Math.floor(o)||1;s=Math.floor(s)||1;var l=[],y=[],p=[],a=[],c=0,w=0;h("z","y","x",-1,-1,f,r,t,s,o,0);h("z","y","x",1,-1,f,r,-t,s,o,1);h("x","z","y",1,1,t,f,r,e,s,2);h("x","z","y",1,-1,t,f,-r,e,s,3);h("x","y","z",1,-1,t,r,f,e,o,4);h("x","y","z",-1,-1,t,r,-f,e,o,5);this.setIndex(l);this.addAttribute("position",new i(y,3));this.addAttribute("normal",new i(p,3));this.addAttribute("uv",new i(a,2))}function bo(n,t,i,r){s.call(this);this.type="PlaneGeometry";this.parameters={width:n,height:t,widthSegments:i,heightSegments:r};this.fromBufferGeometry(new ru(n,t,i,r));this.mergeVertices()}function ru(n,t,r,f){var p,w;u.call(this);this.type="PlaneBufferGeometry";this.parameters={width:n,height:t,widthSegments:r,heightSegments:f};n=n||1;t=t||1;for(var d=n/2,g=t/2,h=Math.floor(r)||1,c=Math.floor(f)||1,s=h+1,nt=c+1,tt=n/h,it=t/c,e,l=[],v=[],y=[],a=[],o=0;o<nt;o++)for(p=o*it-g,e=0;e<s;e++)w=e*tt-d,v.push(w,-p,0),y.push(0,0,1),a.push(e/h),a.push(1-o/c);for(o=0;o<c;o++)for(e=0;e<h;e++){var rt=e+s*o,b=e+s*(o+1),ut=e+1+s*(o+1),k=e+1+s*o;l.push(rt,b,k);l.push(b,ut,k)}this.setIndex(l);this.addAttribute("position",new i(v,3));this.addAttribute("normal",new i(y,3));this.addAttribute("uv",new i(a,2))}function ht(n){l.call(this);this.type="MeshBasicMaterial";this.color=new f(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=oo;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.lights=!1;this.setValues(n)}function dt(n){l.call(this);this.type="ShaderMaterial";this.defines={};this.uniforms={};this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}";this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";this.linewidth=1;this.wireframe=!1;this.wireframeLinewidth=1;this.fog=!1;this.lights=!1;this.clipping=!1;this.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=undefined;n!==undefined&&(n.attributes!==undefined&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(n))}function uu(t,i){this.origin=t!==undefined?t:new n;this.direction=i!==undefined?i:new n}function af(t,i){this.start=t!==undefined?t:new n;this.end=i!==undefined?i:new n}function pi(t,i,r){this.a=t!==undefined?t:new n;this.b=i!==undefined?i:new n;this.c=r!==undefined?r:new n}function tt(n,t){r.call(this);this.type="Mesh";this.geometry=n!==undefined?n:new u;this.material=t!==undefined?t:new ht({color:Math.random()*16777215});this.drawMode=hy;this.updateMorphTargets()}function kg(n,t,i,r){function l(t,r,f,l){var a=r.background;a===null?h(s,e):a&&a.isColor&&(h(a,1),l=!0);(n.autoClear||l)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil);a&&a.isCubeTexture?(u===undefined&&(u=new tt(new iu(1,1,1),new dt({uniforms:tu.cube.uniforms,vertexShader:tu.cube.vertexShader,fragmentShader:tu.cube.fragmentShader,side:ki,depthTest:!0,depthWrite:!1,fog:!1})),u.geometry.removeAttribute("normal"),u.geometry.removeAttribute("uv"),u.onBeforeRender=function(n,t,i){this.matrixWorld.copyPosition(i.matrixWorld)},i.update(u.geometry)),u.material.uniforms.tCube.value=a,t.push(u,u.geometry,u.material,0,null)):a&&a.isTexture&&(c===undefined&&(c=new sf(-1,1,1,-1,0,1),o=new tt(new ru(2,2),new ht({depthTest:!1,depthWrite:!1,fog:!1})),i.update(o.geometry)),o.material.map=a,n.renderBufferDirect(c,null,o.geometry,o.material,o,null))}function h(n,i){t.buffers.color.setClear(n.r,n.g,n.b,i,r)}var s=new f(0),e=0,c,o,u;return{getClearColor:function(){return s},setClearColor:function(n,t){s.set(n);e=t!==undefined?t:1;h(s,e)},getClearAlpha:function(){return e},setClearAlpha:function(n){e=n;h(s,e)},render:l}}function dg(n,t){return n.renderOrder!==t.renderOrder?n.renderOrder-t.renderOrder:n.program&&t.program&&n.program!==t.program?n.program.id-t.program.id:n.material.id!==t.material.id?n.material.id-t.material.id:n.z!==t.z?n.z-t.z:n.id-t.id}function gg(n,t){return n.renderOrder!==t.renderOrder?n.renderOrder-t.renderOrder:n.z!==t.z?t.z-n.z:n.id-t.id}function nn(){function u(){i=0;n.length=0;t.length=0}function f(u,f,e,o,s){var h=r[i];h===undefined?(h={id:u.id,object:u,geometry:f,material:e,program:e.program,renderOrder:u.renderOrder,z:o,group:s},r[i]=h):(h.id=u.id,h.object=u,h.geometry=f,h.material=e,h.program=e.program,h.renderOrder=u.renderOrder,h.z=o,h.group=s);(e.transparent===!0?t:n).push(h);i++}function e(){n.length>1&&n.sort(dg);t.length>1&&t.sort(gg)}var r=[],i=0,n=[],t=[];return{opaque:n,transparent:t,init:u,push:f,sort:e}}function tn(){function t(t,i){var u=t.id+","+i.id,r=n[u];return r===undefined&&(r=new nn,n[u]=r),r}function i(){n={}}var n={};return{get:t,dispose:i}}function rn(n,t){return Math.abs(t[1])-Math.abs(n[1])}function un(n){function r(r,u,f,e){var p=r.morphTargetInfluences,a=p.length,h=i[u.id],c,l,o,s,v,y;if(h===undefined){for(h=[],o=0;o<a;o++)h[o]=[o,0];i[u.id]=h}for(c=f.morphTargets&&u.morphAttributes.position,l=f.morphNormals&&u.morphAttributes.normal,o=0;o<a;o++)s=h[o],s[1]!==0&&(c&&u.removeAttribute("morphTarget"+o),l&&u.removeAttribute("morphNormal"+o));for(o=0;o<a;o++)s=h[o],s[0]=o,s[1]=p[o];for(h.sort(rn),o=0;o<8;o++){if(s=h[o],s&&(v=s[0],y=s[1],y)){c&&u.addAttribute("morphTarget"+o,c[v]);l&&u.addAttribute("morphNormal"+o,l[v]);t[o]=y;continue}t[o]=0}e.getUniforms().setValue(n,"morphTargetInfluences",t)}var i={},t=new Float32Array(8);return{update:r}}function fn(n,t,i){function e(n){r=n}function o(n){u=n.type;f=n.bytesPerElement}function s(t,e){n.drawElements(r,e,u,t*f);i.calls++;i.vertices+=e;r===n.TRIANGLES?i.faces+=e/3:r===n.POINTS&&(i.points+=e)}function h(e,o,s){var h=t.get("ANGLE_instanced_arrays");if(h===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}h.drawElementsInstancedANGLE(r,s,u,o*f,e.maxInstancedCount);i.calls++;i.vertices+=s*e.maxInstancedCount;r===n.TRIANGLES?i.faces+=e.maxInstancedCount*s/3:r===n.POINTS&&(i.points+=e.maxInstancedCount*s)}var r,u,f;this.setMode=e;this.setIndex=o;this.render=s;this.renderInstances=h}function en(n,t,i){function u(n){r=n}function f(t,u){n.drawArrays(r,t,u);i.calls++;i.vertices+=u;r===n.TRIANGLES?i.faces+=u/3:r===n.POINTS&&(i.points+=u)}function e(u,f,e){var o=t.get("ANGLE_instanced_arrays"),s;if(o===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}s=u.attributes.position;s.isInterleavedBufferAttribute?(e=s.data.count,o.drawArraysInstancedANGLE(r,0,e,u.maxInstancedCount)):o.drawArraysInstancedANGLE(r,f,e,u.maxInstancedCount);i.calls++;i.vertices+=e*u.maxInstancedCount;r===n.TRIANGLES?i.faces+=u.maxInstancedCount*e/3:r===n.POINTS&&(i.points+=u.maxInstancedCount*e)}var r;this.setMode=u;this.render=f;this.renderInstances=e}function on(n,t,i){function e(n){var s=n.target,u=f[s.id],h,o;u.index!==null&&t.remove(u.index);for(h in u.attributes)t.remove(u.attributes[h]);s.removeEventListener("dispose",e);delete f[s.id];o=r[s.id];o&&(t.remove(o),delete r[s.id]);o=r[u.id];o&&(t.remove(o),delete r[u.id]);i.geometries--}function o(n,t){var r=f[t.id];return r?r:(t.addEventListener("dispose",e),t.isBufferGeometry?r=t:t.isGeometry&&(t._bufferGeometry===undefined&&(t._bufferGeometry=(new u).setFromObject(n)),r=t._bufferGeometry),f[t.id]=r,i.geometries++,r)}function s(i){var o=i.index,s=i.attributes,f,r,e,u,h;o!==null&&t.update(o,n.ELEMENT_ARRAY_BUFFER);for(r in s)t.update(s[r],n.ARRAY_BUFFER);f=i.morphAttributes;for(r in f)for(e=f[r],u=0,h=e.length;u<h;u++)t.update(e[u],n.ARRAY_BUFFER)}function h(i){var e=r[i.id],f,u,o;if(e)return e;var l=[],a=i.index,v=i.attributes;if(a!==null)for(f=a.array,u=0,o=f.length;u<o;u+=3){var s=f[u+0],h=f[u+1],c=f[u+2];l.push(s,h,h,c,c,s)}else for(f=v.position.array,u=0,o=f.length/3-1;u<o;u+=3){var s=u+0,h=u+1,c=u+2;l.push(s,h,h,c,c,s)}return e=new(sl(l)>65535?cf:hf)(l,1),t.update(e,n.ELEMENT_ARRAY_BUFFER),r[i.id]=e,e}var f={},r={};return{get:o,update:s,getWireframeAttribute:h}}function sn(){var i={};return{get:function(r){if(i[r.id]!==undefined)return i[r.id];var u;switch(r.type){case"DirectionalLight":u={direction:new n,color:new f,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new t};break;case"SpotLight":u={position:new n,direction:new n,color:new f,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new t};break;case"PointLight":u={position:new n,color:new f,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new t,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":u={direction:new n,skyColor:new f,groundColor:new f};break;case"RectAreaLight":u={color:new f,position:new n,halfWidth:new n,halfHeight:new n}}return i[r.id]=u,u}}}function hn(){function e(n,e,o){for(var nt=0,tt=0,it=0,v=0,y=0,p=0,b=0,k=0,l=o.matrixWorldInverse,c,s,d=0,rt=n.length;d<rt;d++){var h=n[d],w=h.color,a=h.intensity,ut=h.distance,g=h.shadow&&h.shadow.map?h.shadow.map.texture:null;h.isAmbientLight?(nt+=w.r*a,tt+=w.g*a,it+=w.b*a):h.isDirectionalLight?(s=i.get(h),s.color.copy(h.color).multiplyScalar(h.intensity),s.direction.setFromMatrixPosition(h.matrixWorld),r.setFromMatrixPosition(h.target.matrixWorld),s.direction.sub(r),s.direction.transformDirection(l),s.shadow=h.castShadow,h.castShadow&&(c=h.shadow,s.shadowBias=c.bias,s.shadowRadius=c.radius,s.shadowMapSize=c.mapSize),t.directionalShadowMap[v]=g,t.directionalShadowMatrix[v]=h.shadow.matrix,t.directional[v]=s,v++):h.isSpotLight?(s=i.get(h),s.position.setFromMatrixPosition(h.matrixWorld),s.position.applyMatrix4(l),s.color.copy(w).multiplyScalar(a),s.distance=ut,s.direction.setFromMatrixPosition(h.matrixWorld),r.setFromMatrixPosition(h.target.matrixWorld),s.direction.sub(r),s.direction.transformDirection(l),s.coneCos=Math.cos(h.angle),s.penumbraCos=Math.cos(h.angle*(1-h.penumbra)),s.decay=h.distance===0?0:h.decay,s.shadow=h.castShadow,h.castShadow&&(c=h.shadow,s.shadowBias=c.bias,s.shadowRadius=c.radius,s.shadowMapSize=c.mapSize),t.spotShadowMap[p]=g,t.spotShadowMatrix[p]=h.shadow.matrix,t.spot[p]=s,p++):h.isRectAreaLight?(s=i.get(h),s.color.copy(w).multiplyScalar(a/(h.width*h.height)),s.position.setFromMatrixPosition(h.matrixWorld),s.position.applyMatrix4(l),u.identity(),f.copy(h.matrixWorld),f.premultiply(l),u.extractRotation(f),s.halfWidth.set(h.width*.5,0,0),s.halfHeight.set(0,h.height*.5,0),s.halfWidth.applyMatrix4(u),s.halfHeight.applyMatrix4(u),t.rectArea[b]=s,b++):h.isPointLight?(s=i.get(h),s.position.setFromMatrixPosition(h.matrixWorld),s.position.applyMatrix4(l),s.color.copy(h.color).multiplyScalar(h.intensity),s.distance=h.distance,s.decay=h.distance===0?0:h.decay,s.shadow=h.castShadow,h.castShadow&&(c=h.shadow,s.shadowBias=c.bias,s.shadowRadius=c.radius,s.shadowMapSize=c.mapSize,s.shadowCameraNear=c.camera.near,s.shadowCameraFar=c.camera.far),t.pointShadowMap[y]=g,t.pointShadowMatrix[y]=h.shadow.matrix,t.point[y]=s,y++):h.isHemisphereLight&&(s=i.get(h),s.direction.setFromMatrixPosition(h.matrixWorld),s.direction.transformDirection(l),s.direction.normalize(),s.skyColor.copy(h.color).multiplyScalar(a),s.groundColor.copy(h.groundColor).multiplyScalar(a),t.hemi[k]=s,k++)}t.ambient[0]=nt;t.ambient[1]=tt;t.ambient[2]=it;t.directional.length=v;t.spot.length=p;t.rectArea.length=b;t.point.length=y;t.hemi.length=k;t.hash=v+","+y+","+p+","+b+","+k+","+e.length}var i=new sn,t={hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},r=new n,f=new o,u=new o;return{setup:e,state:t}}function cn(n,t){function r(r){var f=t.frame,e=r.geometry,u=n.get(r,e);return i[u.id]!==f&&(e.isGeometry&&u.updateFromObject(r),n.update(u),i[u.id]=f),u}function u(){i={}}var i={};return{update:r,clear:u}}function ln(n){for(var i=n.split("\n"),t=0;t<i.length;t++)i[t]=t+1+": "+i[t];return i.join("\n")}function cp(n,t,i){var r=n.createShader(t);return n.shaderSource(r,i),n.compileShader(r),n.getShaderParameter(r,n.COMPILE_STATUS)===!1&&console.error("THREE.WebGLShader: Shader couldn't compile."),n.getShaderInfoLog(r)!==""&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",t===n.VERTEX_SHADER?"vertex":"fragment",n.getShaderInfoLog(r),ln(i)),r}function ap(n){switch(n){case yo:return["Linear","( value )"];case ud:return["sRGB","( value )"];case fd:return["RGBE","( value )"];case ed:return["RGBM","( value, 7.0 )"];case od:return["RGBM","( value, 16.0 )"];case sd:return["RGBD","( value, 256.0 )"];case cy:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+n);}}function hl(n,t){var i=ap(t);return"vec4 "+n+"( vec4 value ) { return "+i[0]+"ToLinear"+i[1]+"; }"}function an(n,t){var i=ap(t);return"vec4 "+n+"( vec4 value ) { return LinearTo"+i[0]+i[1]+"; }"}function vn(n,t){var i;switch(t){case bv:i="Linear";break;case ok:i="Reinhard";break;case sk:i="Uncharted2";break;case hk:i="OptimizedCineon";break;default:throw new Error("unsupported toneMapping: "+t);}return"vec3 "+n+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function yn(n,t,i){n=n||{};var r=[n.derivatives||t.envMapCubeUV||t.bumpMap||t.normalMap||t.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(n.fragDepth||t.logarithmicDepthBuffer)&&i.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",n.drawBuffers&&i.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(n.shaderTextureLOD||t.envMap)&&i.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""];return r.filter(vf).join("\n")}function pn(n){var r=[],t,i;for(t in n)(i=n[t],i!==!1)&&r.push("#define "+t+" "+i);return r.join("\n")}function wn(n,t){for(var u={},e=n.getProgramParameter(t,n.ACTIVE_ATTRIBUTES),f,r,i=0;i<e;i++)f=n.getActiveAttrib(t,i),r=f.name,u[r]=n.getAttribLocation(t,r);return u}function vf(n){return n!==""}function vp(n,t){return n.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights)}function cl(n){function t(n,t){var i=v[t];if(i===undefined)throw new Error("Can not resolve #include <"+t+">");return cl(i)}return n.replace(/^[ \t]*#include +<([\w\d.]+)>/gm,t)}function yp(n){function t(n,t,i,r){for(var f="",u=parseInt(t);u<parseInt(i);u++)f+=r.replace(/\[ i \]/g,"[ "+u+" ]");return f}return n.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,t)}function bn(n,t,i,r,u,f){var e=n.context,st=r.defines,s=u.vertexShader,h=u.fragmentShader,y="SHADOWMAP_TYPE_BASIC",it,rt;f.shadowMapType===ev?y="SHADOWMAP_TYPE_PCF":f.shadowMapType===sb&&(y="SHADOWMAP_TYPE_PCF_SOFT");var a="ENVMAP_TYPE_CUBE",g="ENVMAP_MODE_REFLECTION",p="ENVMAP_BLENDING_MULTIPLY";if(f.envMap){switch(r.envMap.mapping){case hc:case cc:a="ENVMAP_TYPE_CUBE";break;case ac:case vc:a="ENVMAP_TYPE_CUBE_UV";break;case kv:case lc:a="ENVMAP_TYPE_EQUIREC";break;case dv:a="ENVMAP_TYPE_SPHERE"}switch(r.envMap.mapping){case cc:case lc:g="ENVMAP_MODE_REFRACTION"}switch(r.combine){case oo:p="ENVMAP_BLENDING_MULTIPLY";break;case fk:p="ENVMAP_BLENDING_MIX";break;case ek:p="ENVMAP_BLENDING_ADD"}}var ut=n.gammaFactor>0?n.gammaFactor:1,ft=yn(r.extensions,f,t),w=pn(st),o=e.createProgram(),c,l;r.isRawShaderMaterial?(c=[w].filter(vf).join("\n"),c.length>0&&(c+="\n"),l=[ft,w].filter(vf).join("\n"),l.length>0&&(l+="\n")):(c=["precision "+f.precision+" float;","precision "+f.precision+" int;","#define SHADER_NAME "+u.name,w,f.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+ut,"#define MAX_BONES "+f.maxBones,f.useFog&&f.fog?"#define USE_FOG":"",f.useFog&&f.fogExp?"#define FOG_EXP2":"",f.map?"#define USE_MAP":"",f.envMap?"#define USE_ENVMAP":"",f.envMap?"#define "+g:"",f.lightMap?"#define USE_LIGHTMAP":"",f.aoMap?"#define USE_AOMAP":"",f.emissiveMap?"#define USE_EMISSIVEMAP":"",f.bumpMap?"#define USE_BUMPMAP":"",f.normalMap?"#define USE_NORMALMAP":"",f.displacementMap&&f.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",f.specularMap?"#define USE_SPECULARMAP":"",f.roughnessMap?"#define USE_ROUGHNESSMAP":"",f.metalnessMap?"#define USE_METALNESSMAP":"",f.alphaMap?"#define USE_ALPHAMAP":"",f.vertexColors?"#define USE_COLOR":"",f.flatShading?"#define FLAT_SHADED":"",f.skinning?"#define USE_SKINNING":"",f.useVertexTexture?"#define BONE_TEXTURE":"",f.morphTargets?"#define USE_MORPHTARGETS":"",f.morphNormals&&f.flatShading===!1?"#define USE_MORPHNORMALS":"",f.doubleSided?"#define DOUBLE_SIDED":"",f.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+f.numClippingPlanes,f.shadowMapEnabled?"#define USE_SHADOWMAP":"",f.shadowMapEnabled?"#define "+y:"",f.sizeAttenuation?"#define USE_SIZEATTENUATION":"",f.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",f.logarithmicDepthBuffer&&t.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","\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(vf).join("\n"),l=[ft,"precision "+f.precision+" float;","precision "+f.precision+" int;","#define SHADER_NAME "+u.name,w,f.alphaTest?"#define ALPHATEST "+f.alphaTest:"","#define GAMMA_FACTOR "+ut,f.useFog&&f.fog?"#define USE_FOG":"",f.useFog&&f.fogExp?"#define FOG_EXP2":"",f.map?"#define USE_MAP":"",f.envMap?"#define USE_ENVMAP":"",f.envMap?"#define "+a:"",f.envMap?"#define "+g:"",f.envMap?"#define "+p:"",f.lightMap?"#define USE_LIGHTMAP":"",f.aoMap?"#define USE_AOMAP":"",f.emissiveMap?"#define USE_EMISSIVEMAP":"",f.bumpMap?"#define USE_BUMPMAP":"",f.normalMap?"#define USE_NORMALMAP":"",f.specularMap?"#define USE_SPECULARMAP":"",f.roughnessMap?"#define USE_ROUGHNESSMAP":"",f.metalnessMap?"#define USE_METALNESSMAP":"",f.alphaMap?"#define USE_ALPHAMAP":"",f.vertexColors?"#define USE_COLOR":"",f.gradientMap?"#define USE_GRADIENTMAP":"",f.flatShading?"#define FLAT_SHADED":"",f.doubleSided?"#define DOUBLE_SIDED":"",f.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+f.numClippingPlanes,"#define UNION_CLIPPING_PLANES "+(f.numClippingPlanes-f.numClipIntersection),f.shadowMapEnabled?"#define USE_SHADOWMAP":"",f.shadowMapEnabled?"#define "+y:"",f.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",f.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",f.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",f.logarithmicDepthBuffer&&t.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",f.envMap&&t.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",f.toneMapping!==oc?"#define TONE_MAPPING":"",f.toneMapping!==oc?v.tonemapping_pars_fragment:"",f.toneMapping!==oc?vn("toneMapping",f.toneMapping):"",f.dithering?"#define DITHERING":"",f.outputEncoding||f.mapEncoding||f.envMapEncoding||f.emissiveMapEncoding?v.encodings_pars_fragment:"",f.mapEncoding?hl("mapTexelToLinear",f.mapEncoding):"",f.envMapEncoding?hl("envMapTexelToLinear",f.envMapEncoding):"",f.emissiveMapEncoding?hl("emissiveMapTexelToLinear",f.emissiveMapEncoding):"",f.outputEncoding?an("linearToOutputTexel",f.outputEncoding):"",f.depthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(vf).join("\n"));s=cl(s);s=vp(s,f);h=cl(h);h=vp(h,f);r.isShaderMaterial||(s=yp(s),h=yp(h));var ht=c+s,ct=l+h,b=cp(e,e.VERTEX_SHADER,ht),k=cp(e,e.FRAGMENT_SHADER,ct);e.attachShader(o,b);e.attachShader(o,k);r.index0AttributeName!==undefined?e.bindAttribLocation(o,0,r.index0AttributeName):f.morphTargets===!0&&e.bindAttribLocation(o,0,"position");e.linkProgram(o);var d=e.getProgramInfoLog(o),nt=e.getShaderInfoLog(b),tt=e.getShaderInfoLog(k),et=!0,ot=!0;return e.getProgramParameter(o,e.LINK_STATUS)===!1?(et=!1,console.error("THREE.WebGLProgram: shader error: ",e.getError(),"gl.VALIDATE_STATUS",e.getProgramParameter(o,e.VALIDATE_STATUS),"gl.getProgramInfoLog",d,nt,tt)):d!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",d):(nt===""||tt==="")&&(ot=!1),ot&&(this.diagnostics={runnable:et,material:r,programLog:d,vertexShader:{log:nt,prefix:c},fragmentShader:{log:tt,prefix:l}}),e.deleteShader(b),e.deleteShader(k),this.getUniforms=function(){return it===undefined&&(it=new gi(e,o,n)),it},this.getAttributes=function(){return rt===undefined&&(rt=wn(e,o)),rt},this.destroy=function(){e.deleteProgram(o);this.program=undefined},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.id=lp++,this.code=i,this.usedTimes=1,this.program=o,this.vertexShader=b,this.fragmentShader=k,this}function kn(n,t,i){function o(n){var u=n.skeleton,t=u.bones;if(i.floatVertexTextures)return 1024;var f=i.maxVertexUniforms,e=Math.floor((f-20)/4),r=Math.min(e,t.length);return r<t.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+r+"."),0):r}function u(n,t){var i;return n?n.isTexture?i=n.encoding:n.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),i=n.texture.encoding):i=yo,i===yo&&t&&(i=cy),i}var r=[],e={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow"},f=["precision","supportsVertexTextures","map","mapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering"];this.getParameters=function(t,r,f,s,h,c,l){var w=e[t.type],y=l.isSkinnedMesh?o(l):0,a=i.precision,v,p;return t.precision!==null&&(a=i.getMaxPrecision(t.precision),a!==t.precision&&console.warn("THREE.WebGLProgram.getParameters:",t.precision,"not supported, using",a,"instead.")),v=n.getRenderTarget(),p={shaderID:w,precision:a,supportsVertexTextures:i.vertexTextures,outputEncoding:u(v?v.texture:null,n.gammaOutput),map:!!t.map,mapEncoding:u(t.map,n.gammaInput),envMap:!!t.envMap,envMapMode:t.envMap&&t.envMap.mapping,envMapEncoding:u(t.envMap,n.gammaInput),envMapCubeUV:!!t.envMap&&(t.envMap.mapping===ac||t.envMap.mapping===vc),lightMap:!!t.lightMap,aoMap:!!t.aoMap,emissiveMap:!!t.emissiveMap,emissiveMapEncoding:u(t.emissiveMap,n.gammaInput),bumpMap:!!t.bumpMap,normalMap:!!t.normalMap,displacementMap:!!t.displacementMap,roughnessMap:!!t.roughnessMap,metalnessMap:!!t.metalnessMap,specularMap:!!t.specularMap,alphaMap:!!t.alphaMap,gradientMap:!!t.gradientMap,combine:t.combine,vertexColors:t.vertexColors,fog:!!s,useFog:t.fog,fogExp:s&&s.isFogExp2,flatShading:t.flatShading,sizeAttenuation:t.sizeAttenuation,logarithmicDepthBuffer:i.logarithmicDepthBuffer,skinning:t.skinning&&y>0,maxBones:y,useVertexTexture:i.floatVertexTextures,morphTargets:t.morphTargets,morphNormals:t.morphNormals,maxMorphTargets:n.maxMorphTargets,maxMorphNormals:n.maxMorphNormals,numDirLights:r.directional.length,numPointLights:r.point.length,numSpotLights:r.spot.length,numRectAreaLights:r.rectArea.length,numHemiLights:r.hemi.length,numClippingPlanes:h,numClipIntersection:c,dithering:t.dithering,shadowMapEnabled:n.shadowMap.enabled&&l.receiveShadow&&f.length>0,shadowMapType:n.shadowMap.type,toneMapping:n.toneMapping,physicallyCorrectLights:n.physicallyCorrectLights,premultipliedAlpha:t.premultipliedAlpha,alphaTest:t.alphaTest,doubleSided:t.side===nf,flipSided:t.side===ki,depthPacking:t.depthPacking!==undefined?t.depthPacking:!1},p};this.getProgramCode=function(t,i){var r=[],e,u;if(i.shaderID?r.push(i.shaderID):(r.push(t.fragmentShader),r.push(t.vertexShader)),t.defines!==undefined)for(e in t.defines)r.push(e),r.push(t.defines[e]);for(u=0;u<f.length;u++)r.push(i[f[u]]);return r.push(t.onBeforeCompile.toString()),r.push(n.gammaOutput),r.join()};this.acquireProgram=function(i,u,f,e){for(var o,h,s=0,c=r.length;s<c;s++)if(h=r[s],h.code===e){o=h;++o.usedTimes;break}return o===undefined&&(o=new bn(n,t,e,i,u,f),r.push(o)),o};this.releaseProgram=function(n){if(--n.usedTimes==0){var t=r.indexOf(n);r[t]=r[r.length-1];r.pop();n.destroy()}};this.programs=r}function dn(n,t,i,r,u,f,e){function v(n,t){var r,i,u;return n.width>t||n.height>t?(r=t/Math.max(n.width,n.height),i=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),i.width=Math.floor(n.width*r),i.height=Math.floor(n.height*r),u=i.getContext("2d"),u.drawImage(n,0,0,n.width,n.height,0,0,i.width,i.height),console.warn("THREE.WebGLRenderer: image is too big ("+n.width+"x"+n.height+"). Resized to "+i.width+"x"+i.height,n),i):n}function o(n){return h.isPowerOfTwo(n.width)&&h.isPowerOfTwo(n.height)}function d(n){var t,i;return n instanceof HTMLImageElement||n instanceof HTMLCanvasElement||n instanceof ImageBitmap?(t=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),t.width=h.floorPowerOfTwo(n.width),t.height=h.floorPowerOfTwo(n.height),i=t.getContext("2d"),i.drawImage(n,0,0,t.width,t.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+n.width+"x"+n.height+"). Resized to "+t.width+"x"+t.height,n),t):n}function g(n){return n.wrapS!==yt||n.wrapT!==yt||n.minFilter!==pt&&n.minFilter!==et}function s(n,t){return n.generateMipmaps&&t&&n.minFilter!==pt&&n.minFilter!==et}function y(t){return t===pt||t===yc||t===pc?n.NEAREST:n.LINEAR}function l(n){var t=n.target;t.removeEventListener("dispose",l);nt(t);e.textures--}function p(n){var t=n.target;t.removeEventListener("dispose",p);tt(t);e.textures--}function nt(t){var i=r.get(t);if(t.image&&i.__image__webglTextureCube)n.deleteTexture(i.__image__webglTextureCube);else{if(i.__webglInit===undefined)return;n.deleteTexture(i.__webglTexture)}r.remove(t)}function tt(t){var i=r.get(t),f=r.get(t.texture),u;if(t){if(f.__webglTexture!==undefined&&n.deleteTexture(f.__webglTexture),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLRenderTargetCube)for(u=0;u<6;u++)n.deleteFramebuffer(i.__webglFramebuffer[u]),i.__webglDepthbuffer&&n.deleteRenderbuffer(i.__webglDepthbuffer[u]);else n.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&n.deleteRenderbuffer(i.__webglDepthbuffer);r.remove(t.texture);r.remove(t)}}function w(t,u){var f=r.get(t),e;if(t.version>0&&f.__version!==t.version)if(e=t.image,e===undefined)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",t);else if(e.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",t);else{ut(f,t,u);return}i.activeTexture(n.TEXTURE0+u);i.bindTexture(n.TEXTURE_2D,f.__webglTexture)}function it(t,h){var b=r.get(t),a,w,nt,k,rt;if(t.image.length===6)if(t.version>0&&b.__version!==t.version){b.__image__webglTextureCube||(t.addEventListener("dispose",l),b.__image__webglTextureCube=n.createTexture(),e.textures++);i.activeTexture(n.TEXTURE0+h);i.bindTexture(n.TEXTURE_CUBE_MAP,b.__image__webglTextureCube);n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,t.flipY);var tt=t&&t.isCompressedTexture,d=t.image[0]&&t.image[0].isDataTexture,p=[];for(a=0;a<6;a++)p[a]=tt||d?d?t.image[a].image:t.image[a]:v(t.image[a],u.maxCubemapSize);var ut=p[0],it=o(ut),y=f.convert(t.format),g=f.convert(t.type);for(c(n.TEXTURE_CUBE_MAP,t,it),a=0;a<6;a++)if(tt)for(nt=p[a].mipmaps,k=0,rt=nt.length;k<rt;k++)w=nt[k],t.format!==ai&&t.format!==uf?i.getCompressedTextureFormats().indexOf(y)>-1?i.compressedTexImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+a,k,y,w.width,w.height,0,w.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):i.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+a,k,y,w.width,w.height,0,y,g,w.data);else d?i.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+a,0,y,p[a].width,p[a].height,0,y,g,p[a].data):i.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+a,0,y,y,g,p[a]);if(s(t,it)&&n.generateMipmap(n.TEXTURE_CUBE_MAP),b.__version=t.version,t.onUpdate)t.onUpdate(t)}else i.activeTexture(n.TEXTURE0+h),i.bindTexture(n.TEXTURE_CUBE_MAP,b.__image__webglTextureCube)}function rt(t,u){i.activeTexture(n.TEXTURE0+u);i.bindTexture(n.TEXTURE_CUBE_MAP,r.get(t).__webglTexture)}function c(i,e,o){var s;if(o?(n.texParameteri(i,n.TEXTURE_WRAP_S,f.convert(e.wrapS)),n.texParameteri(i,n.TEXTURE_WRAP_T,f.convert(e.wrapT)),n.texParameteri(i,n.TEXTURE_MAG_FILTER,f.convert(e.magFilter)),n.texParameteri(i,n.TEXTURE_MIN_FILTER,f.convert(e.minFilter))):(n.texParameteri(i,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(i,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(e.wrapS!==yt||e.wrapT!==yt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",e),n.texParameteri(i,n.TEXTURE_MAG_FILTER,y(e.magFilter)),n.texParameteri(i,n.TEXTURE_MIN_FILTER,y(e.minFilter)),e.minFilter!==pt&&e.minFilter!==et&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",e)),s=t.get("EXT_texture_filter_anisotropic"),s){if(e.type===rf&&t.get("OES_texture_float_linear")===null)return;if(e.type===bc&&t.get("OES_texture_half_float_linear")===null)return;(e.anisotropy>1||r.get(e).__currentAnisotropy)&&(n.texParameterf(i,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(e.anisotropy,u.getMaxAnisotropy())),r.get(e).__currentAnisotropy=e.anisotropy)}}function ut(t,r,h){var b,w,k,it,y,tt;t.__webglInit===undefined&&(t.__webglInit=!0,r.addEventListener("dispose",l),t.__webglTexture=n.createTexture(),e.textures++);i.activeTexture(n.TEXTURE0+h);i.bindTexture(n.TEXTURE_2D,t.__webglTexture);n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,r.flipY);n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha);n.pixelStorei(n.UNPACK_ALIGNMENT,r.unpackAlignment);b=v(r.image,u.maxTextureSize);g(r)&&o(b)===!1&&(b=d(b));var rt=o(b),p=f.convert(r.format),nt=f.convert(r.type);if(c(n.TEXTURE_2D,r,rt),k=r.mipmaps,r.isDepthTexture){if(it=n.DEPTH_COMPONENT,r.type===rf){if(!a)throw new Error("Float Depth Texture only supported in WebGL2.0");it=n.DEPTH_COMPONENT32F}else a&&(it=n.DEPTH_COMPONENT16);r.format===br&&it===n.DEPTH_COMPONENT&&r.type!==ho&&r.type!==ny&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=ho,nt=f.convert(r.type));r.format===ff&&(it=n.DEPTH_STENCIL,r.type!==co&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=co,nt=f.convert(r.type)));i.texImage2D(n.TEXTURE_2D,0,it,b.width,b.height,0,p,nt,null)}else if(r.isDataTexture)if(k.length>0&&rt){for(y=0,tt=k.length;y<tt;y++)w=k[y],i.texImage2D(n.TEXTURE_2D,y,p,w.width,w.height,0,p,nt,w.data);r.generateMipmaps=!1}else i.texImage2D(n.TEXTURE_2D,0,p,b.width,b.height,0,p,nt,b.data);else if(r.isCompressedTexture)for(y=0,tt=k.length;y<tt;y++)w=k[y],r.format!==ai&&r.format!==uf?i.getCompressedTextureFormats().indexOf(p)>-1?i.compressedTexImage2D(n.TEXTURE_2D,y,p,w.width,w.height,0,w.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):i.texImage2D(n.TEXTURE_2D,y,p,w.width,w.height,0,p,nt,w.data);else if(k.length>0&&rt){for(y=0,tt=k.length;y<tt;y++)w=k[y],i.texImage2D(n.TEXTURE_2D,y,p,p,nt,w);r.generateMipmaps=!1}else i.texImage2D(n.TEXTURE_2D,0,p,p,nt,b);if(s(r,rt)&&n.generateMipmap(n.TEXTURE_2D),t.__version=r.version,r.onUpdate)r.onUpdate(r)}function b(t,u,e,o){var s=f.convert(u.texture.format),h=f.convert(u.texture.type);i.texImage2D(o,0,s,u.width,u.height,0,s,h,null);n.bindFramebuffer(n.FRAMEBUFFER,t);n.framebufferTexture2D(n.FRAMEBUFFER,e,o,r.get(u.texture).__webglTexture,0);n.bindFramebuffer(n.FRAMEBUFFER,null)}function k(t,i){n.bindRenderbuffer(n.RENDERBUFFER,t);i.depthBuffer&&!i.stencilBuffer?(n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,i.width,i.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,t)):i.depthBuffer&&i.stencilBuffer?(n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,i.width,i.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,t)):n.renderbufferStorage(n.RENDERBUFFER,n.RGBA4,i.width,i.height);n.bindRenderbuffer(n.RENDERBUFFER,null)}function ft(t,i){var f=i&&i.isWebGLRenderTargetCube,u;if(f)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(n.FRAMEBUFFER,t),!(i.depthTexture&&i.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");if(r.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),w(i.depthTexture,0),u=r.get(i.depthTexture).__webglTexture,i.depthTexture.format===br)n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,u,0);else if(i.depthTexture.format===ff)n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,u,0);else throw new Error("Unknown depthTexture format");}function ot(t){var i=r.get(t),f=t.isWebGLRenderTargetCube===!0,u;if(t.depthTexture){if(f)throw new Error("target.depthTexture not supported in Cube render targets");ft(i.__webglFramebuffer,t)}else if(f)for(i.__webglDepthbuffer=[],u=0;u<6;u++)n.bindFramebuffer(n.FRAMEBUFFER,i.__webglFramebuffer[u]),i.__webglDepthbuffer[u]=n.createRenderbuffer(),k(i.__webglDepthbuffer[u],t);else n.bindFramebuffer(n.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer=n.createRenderbuffer(),k(i.__webglDepthbuffer,t);n.bindFramebuffer(n.FRAMEBUFFER,null)}function st(t){var f=r.get(t),l=r.get(t.texture),a,h,u;if(t.addEventListener("dispose",p),l.__webglTexture=n.createTexture(),e.textures++,a=t.isWebGLRenderTargetCube===!0,h=o(t),a)for(f.__webglFramebuffer=[],u=0;u<6;u++)f.__webglFramebuffer[u]=n.createFramebuffer();else f.__webglFramebuffer=n.createFramebuffer();if(a){for(i.bindTexture(n.TEXTURE_CUBE_MAP,l.__webglTexture),c(n.TEXTURE_CUBE_MAP,t.texture,h),u=0;u<6;u++)b(f.__webglFramebuffer[u],t,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+u);s(t.texture,h)&&n.generateMipmap(n.TEXTURE_CUBE_MAP);i.bindTexture(n.TEXTURE_CUBE_MAP,null)}else i.bindTexture(n.TEXTURE_2D,l.__webglTexture),c(n.TEXTURE_2D,t.texture,h),b(f.__webglFramebuffer,t,n.COLOR_ATTACHMENT0,n.TEXTURE_2D),s(t.texture,h)&&n.generateMipmap(n.TEXTURE_2D),i.bindTexture(n.TEXTURE_2D,null);t.depthBuffer&&ot(t)}function ht(t){var f=t.texture,h=o(t),u,e;s(f,h)&&(u=t.isWebGLRenderTargetCube?n.TEXTURE_CUBE_MAP:n.TEXTURE_2D,e=r.get(f).__webglTexture,i.bindTexture(u,e),n.generateMipmap(u),i.bindTexture(u,null))}var a=typeof WebGL2RenderingContext!="undefined"&&n instanceof window.WebGL2RenderingContext;this.setTexture2D=w;this.setTextureCube=it;this.setTextureCubeDynamic=rt;this.setupRenderTarget=st;this.updateRenderTargetMipmap=ht}function gn(){function t(t){var r=t.uuid,i=n[r];return i===undefined&&(i={},n[r]=i),i}function i(t){delete n[t.uuid]}function r(){n={}}var n={};return{get:t,remove:i,clear:r}}function ntt(n,t,i){function dt(){var t=!1,i=new p,r=null,u=new p(0,0,0,0);return{setMask:function(i){r===i||t||(n.colorMask(i,i,i,i),r=i)},setLocked:function(n){t=n},setClear:function(t,r,f,e,o){o===!0&&(t*=e,r*=e,f*=e);i.set(t,r,f,e);u.equals(i)===!1&&(n.clearColor(t,r,f,e),u.copy(i))},reset:function(){t=!1;r=null;u.set(-1,0,0,0)}}}function gt(){var t=!1,i=null,u=null,e=null;return{setTest:function(t){t?r(n.DEPTH_TEST):f(n.DEPTH_TEST)},setMask:function(r){i===r||t||(n.depthMask(r),i=r)},setFunc:function(t){if(u!==t){if(t)switch(t){case db:n.depthFunc(n.NEVER);break;case gb:n.depthFunc(n.ALWAYS);break;case nk:n.depthFunc(n.LESS);break;case ec:n.depthFunc(n.LEQUAL);break;case tk:n.depthFunc(n.EQUAL);break;case ik:n.depthFunc(n.GEQUAL);break;case rk:n.depthFunc(n.GREATER);break;case uk:n.depthFunc(n.NOTEQUAL);break;default:n.depthFunc(n.LEQUAL)}else n.depthFunc(n.LEQUAL);u=t}},setLocked:function(n){t=n},setClear:function(t){e!==t&&(n.clearDepth(t),e=t)},reset:function(){t=!1;i=null;u=null;e=null}}}function ni(){var t=!1,i=null,u=null,e=null,o=null,s=null,h=null,c=null,l=null;return{setTest:function(t){t?r(n.STENCIL_TEST):f(n.STENCIL_TEST)},setMask:function(r){i===r||t||(n.stencilMask(r),i=r)},setFunc:function(t,i,r){(u!==t||e!==i||o!==r)&&(n.stencilFunc(t,i,r),u=t,e=i,o=r)},setOp:function(t,i,r){(s!==t||h!==i||c!==r)&&(n.stencilOp(t,i,r),s=t,h=i,c=r)},setLocked:function(n){t=n},setClear:function(t){l!==t&&(n.clearStencil(t),l=t)},reset:function(){t=!1;i=null;u=null;e=null;o=null;s=null;h=null;c=null;l=null}}}function pt(t,i,r){var e=new Uint8Array(4),f=n.createTexture(),u;for(n.bindTexture(t,f),n.texParameteri(t,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(t,n.TEXTURE_MAG_FILTER,n.NEAREST),u=0;u<r;u++)n.texImage2D(i+u,0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,e);return f}function ui(){for(var n=0,t=s.length;n<t;n++)s[n]=0}function fi(i){if(s[i]=1,u[i]===0&&(n.enableVertexAttribArray(i),u[i]=1),a[i]!==0){var r=t.get("ANGLE_instanced_arrays");r.vertexAttribDivisorANGLE(i,0);a[i]=0}}function ei(i,r){if(s[i]=1,u[i]===0&&(n.enableVertexAttribArray(i),u[i]=1),a[i]!==r){var f=t.get("ANGLE_instanced_arrays");f.vertexAttribDivisorANGLE(i,r);a[i]=r}}function oi(){for(var t=0,i=u.length;t!==i;++t)u[t]!==s[t]&&(n.disableVertexAttribArray(t),u[t]=0)}function r(t){h[t]!==!0&&(n.enable(t),h[t]=!0)}function f(t){h[t]!==!1&&(n.disable(t),h[t]=!1)}function si(){var r,i;if(c===null&&(c=[],t.get("WEBGL_compressed_texture_pvrtc")||t.get("WEBGL_compressed_texture_s3tc")||t.get("WEBGL_compressed_texture_etc1")))for(r=n.getParameter(n.COMPRESSED_TEXTURE_FORMATS),i=0;i<r.length;i++)c.push(r[i]);return c}function hi(t){return b!==t?(n.useProgram(t),b=t,!0):!1}function v(t,u,e,o,s,h,c,l){if(t!==rc?r(n.BLEND):f(n.BLEND),t!==uc){if(t!==k||l!==ht)switch(t){case hv:l?(n.blendEquationSeparate(n.FUNC_ADD,n.FUNC_ADD),n.blendFuncSeparate(n.ONE,n.ONE,n.ONE,n.ONE)):(n.blendEquation(n.FUNC_ADD),n.blendFunc(n.SRC_ALPHA,n.ONE));break;case cv:l?(n.blendEquationSeparate(n.FUNC_ADD,n.FUNC_ADD),n.blendFuncSeparate(n.ZERO,n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ONE_MINUS_SRC_ALPHA)):(n.blendEquation(n.FUNC_ADD),n.blendFunc(n.ZERO,n.ONE_MINUS_SRC_COLOR));break;case lv:l?(n.blendEquationSeparate(n.FUNC_ADD,n.FUNC_ADD),n.blendFuncSeparate(n.ZERO,n.SRC_COLOR,n.ZERO,n.SRC_ALPHA)):(n.blendEquation(n.FUNC_ADD),n.blendFunc(n.ZERO,n.SRC_COLOR));break;default:l?(n.blendEquationSeparate(n.FUNC_ADD,n.FUNC_ADD),n.blendFuncSeparate(n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA)):(n.blendEquationSeparate(n.FUNC_ADD,n.FUNC_ADD),n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA))}d=null;g=null;nt=null;tt=null;it=null;rt=null}else s=s||u,h=h||e,c=c||o,(u!==d||s!==tt)&&(n.blendEquationSeparate(i.convert(u),i.convert(s)),d=u,tt=s),(e!==g||o!==nt||h!==it||c!==rt)&&(n.blendFuncSeparate(i.convert(e),i.convert(o),i.convert(h),i.convert(c)),g=e,nt=o,it=h,rt=c);k=t;ht=l}function ci(t){t.side===nf?f(n.CULL_FACE):r(n.CULL_FACE);st(t.side===ki);t.transparent===!0?v(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha):v(rc);e.setFunc(t.depthFunc);e.setTest(t.depthTest);e.setMask(t.depthWrite);l.setMask(t.colorWrite);bt(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)}function st(t){ut!==t&&(t?n.frontFace(n.CW):n.frontFace(n.CCW),ut=t)}function wt(t){t!==eb?(r(n.CULL_FACE),t!==ft&&(t===eo?n.cullFace(n.BACK):t===fv?n.cullFace(n.FRONT):n.cullFace(n.FRONT_AND_BACK))):f(n.CULL_FACE);ft=t}function li(t){t!==ct&&(ri&&n.lineWidth(t),ct=t)}function bt(t,i,u){t?(r(n.POLYGON_OFFSET_FILL),(lt!==i||at!==u)&&(n.polygonOffset(i,u),lt=i,at=u)):f(n.POLYGON_OFFSET_FILL)}function ai(t){t?r(n.SCISSOR_TEST):f(n.SCISSOR_TEST)}function kt(t){t===undefined&&(t=n.TEXTURE0+ti-1);o!==t&&(n.activeTexture(t),o=t)}function vi(t,i){o===null&&kt();var r=et[o];r===undefined&&(r={type:undefined,texture:undefined},et[o]=r);(r.type!==t||r.texture!==i)&&(n.bindTexture(t,i||ot[t]),r.type=t,r.texture=i)}function yi(){try{n.compressedTexImage2D.apply(n,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function pi(){try{n.texImage2D.apply(n,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function wi(t){vt.equals(t)===!1&&(n.scissor(t.x,t.y,t.z,t.w),vt.copy(t))}function bi(t){yt.equals(t)===!1&&(n.viewport(t.x,t.y,t.z,t.w),yt.copy(t))}function di(){for(var t=0;t<u.length;t++)u[t]===1&&(n.disableVertexAttribArray(t),u[t]=0);h={};c=null;o=null;et={};b=null;k=null;ut=null;ft=null;l.reset();e.reset();y.reset()}var l=new dt,e=new gt,y=new ni,w=n.getParameter(n.MAX_VERTEX_ATTRIBS),s=new Uint8Array(w),u=new Uint8Array(w),a=new Uint8Array(w),h={},c=null,b=null,k=null,d=null,g=null,nt=null,tt=null,it=null,rt=null,ht=!1,ut=null,ft=null,ct=null,lt=null,at=null,ti=n.getParameter(n.MAX_COMBINED_TEXTURE_IMAGE_UNITS),ii=parseFloat(/^WebGL\ ([0-9])/.exec(n.getParameter(n.VERSION))[1]),ri=parseFloat(ii)>=1,o=null,et={},vt=new p,yt=new p,ot={};return ot[n.TEXTURE_2D]=pt(n.TEXTURE_2D,n.TEXTURE_2D,1),ot[n.TEXTURE_CUBE_MAP]=pt(n.TEXTURE_CUBE_MAP,n.TEXTURE_CUBE_MAP_POSITIVE_X,6),l.setClear(0,0,0,1),e.setClear(1),y.setClear(0),r(n.DEPTH_TEST),e.setFunc(ec),st(!1),wt(eo),r(n.CULL_FACE),r(n.BLEND),v(tf),{buffers:{color:l,depth:e,stencil:y},initAttributes:ui,enableAttribute:fi,enableAttributeAndDivisor:ei,disableUnusedAttributes:oi,enable:r,disable:f,getCompressedTextureFormats:si,useProgram:hi,setBlending:v,setMaterial:ci,setFlipSided:st,setCullFace:wt,setLineWidth:li,setPolygonOffset:bt,setScissorTest:ai,activeTexture:kt,bindTexture:vi,compressedTexImage2D:yi,texImage2D:pi,scissor:wi,viewport:bi,reset:di}}function ttt(n,t,i){function c(){if(r!==undefined)return r;var i=t.get("EXT_texture_filter_anisotropic");return r=i!==null?n.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}function e(t){if(t==="highp"){if(n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return t==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var r,u=i.precision!==undefined?i.precision:"highp",f=e(u);f!==u&&(console.warn("THREE.WebGLRenderer:",u,"not supported, using",f,"instead."),u=f);var l=i.logarithmicDepthBuffer===!0,a=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),o=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=n.getParameter(n.MAX_TEXTURE_SIZE),y=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),p=n.getParameter(n.MAX_VERTEX_ATTRIBS),w=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),b=n.getParameter(n.MAX_VARYING_VECTORS),k=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),s=o>0,h=!!t.get("OES_texture_float"),d=s&&h;return{getMaxAnisotropy:c,getMaxPrecision:e,precision:u,logarithmicDepthBuffer:l,maxTextures:a,maxVertexTextures:o,maxTextureSize:v,maxCubemapSize:y,maxAttributes:p,maxVertexUniforms:w,maxVaryings:b,maxFragmentUniforms:k,vertexTextures:s,floatFragmentTextures:h,floatVertexTextures:d}}function nt(n,t,i,r){oi.call(this);this.type="PerspectiveCamera";this.fov=n!==undefined?n:50;this.zoom=1;this.near=i!==undefined?i:.1;this.far=r!==undefined?r:2e3;this.focus=10;this.aspect=t!==undefined?t:1;this.view=null;this.filmGauge=35;this.filmOffset=0;this.updateProjectionMatrix()}function ll(n){nt.call(this);this.cameras=n||[]}function itt(n){function a(){if(t!==null&&t.isPresenting){var i=t.getEyeParameters("left"),r=i.renderWidth,u=i.renderHeight;l=n.getPixelRatio();c=n.getSize();n.setDrawingBufferSize(r*2,u,1)}else v.enabled&&n.setDrawingBufferSize(c.width,c.height,l)}var v=this,t=null,u=null,r,f,c,l;typeof window!="undefined"&&"VRFrameData"in window&&(u=new window.VRFrameData);var h=new o,e=new o,s=new o,i=new nt;i.bounds=new p(0,0,.5,1);i.layers.enable(1);r=new nt;r.bounds=new p(.5,0,.5,1);r.layers.enable(2);f=new ll([i,r]);f.layers.enable(1);f.layers.enable(2);typeof window!="undefined"&&window.addEventListener("vrdisplaypresentchange",a,!1);this.enabled=!1;this.standing=!1;this.getDevice=function(){return t};this.setDevice=function(n){n!==undefined&&(t=n)};this.getCamera=function(n){var c,l,a,v,o;return t===null?n:(t.depthNear=n.near,t.depthFar=n.far,t.getFrameData(u),c=u.pose,c.position!==null?n.position.fromArray(c.position):n.position.set(0,0,0),c.orientation!==null&&n.quaternion.fromArray(c.orientation),n.updateMatrixWorld(),l=t.stageParameters,this.standing&&l&&(e.fromArray(l.sittingToStandingTransform),s.getInverse(e),n.matrixWorld.multiply(e),n.matrixWorldInverse.multiply(s)),t.isPresenting===!1)?n:(i.near=n.near,r.near=n.near,i.far=n.far,r.far=n.far,f.matrixWorld.copy(n.matrixWorld),f.matrixWorldInverse.copy(n.matrixWorldInverse),i.matrixWorldInverse.fromArray(u.leftViewMatrix),r.matrixWorldInverse.fromArray(u.rightViewMatrix),this.standing&&l&&(i.matrixWorldInverse.multiply(s),r.matrixWorldInverse.multiply(s)),a=n.parent,a!==null&&(h.getInverse(a.matrixWorld),i.matrixWorldInverse.multiply(h),r.matrixWorldInverse.multiply(h)),i.matrixWorld.getInverse(i.matrixWorldInverse),r.matrixWorld.getInverse(r.matrixWorldInverse),i.projectionMatrix.fromArray(u.leftProjectionMatrix),r.projectionMatrix.fromArray(u.rightProjectionMatrix),f.projectionMatrix.copy(i.projectionMatrix),v=t.getLayers(),v.length&&(o=v[0],o.leftBounds!==null&&o.leftBounds.length===4&&i.bounds.fromArray(o.leftBounds),o.rightBounds!==null&&o.rightBounds.length===4&&r.bounds.fromArray(o.rightBounds)),f)};this.getStandingMatrix=function(){return e};this.submitFrame=function(){t&&t.isPresenting&&t.submitFrame()};this.dispose=function(){typeof window!="undefined"&&window.removeEventListener("vrdisplaypresentchange",a)}}function rtt(n){var t={};return{get:function(i){if(t[i]!==undefined)return t[i];var r;switch(i){case"WEBGL_depth_texture":r=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":r=n.getExtension("WEBGL_compressed_texture_etc1");break;default:r=n.getExtension(i)}return r===null&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),t[i]=r,r}}}function utt(){function h(){n.value!==r&&(n.value=r,n.needsUpdate=t>0);f.numPlanes=t;f.numIntersection=0}function u(t,i,r,u){var h=t!==null?t.length:0,e=null,a,v,c,l;if(h!==0){if(e=n.value,u!==!0||e===null)for(a=r+h*4,v=i.matrixWorldInverse,s.getNormalMatrix(v),(e===null||e.length<a)&&(e=new Float32Array(a)),c=0,l=r;c!==h;++c,l+=4)o.copy(t[c]).applyMatrix4(v,s),o.normal.toArray(e,l),e[l+3]=o.constant;n.value=e;n.needsUpdate=!0}return f.numPlanes=h,e}var f=this,r=null,t=0,e=!1,i=!1,o=new kt,s=new ot,n={value:null,needsUpdate:!1};this.uniform=n;this.numPlanes=0;this.numIntersection=0;this.init=function(n,i,f){var o=n.length!==0||i||t!==0||e;return e=i,r=u(n,f,0),t=n.length,o};this.beginShadows=function(){i=!0;u(null)};this.endShadows=function(){i=!1;h()};this.setState=function(f,o,s,c,l,a){var v;if(e&&f!==null&&f.length!==0&&(!i||s)){var p=i?0:t,w=p*4,y=l.clippingState||null;for(n.value=y,y=u(f,c,w,a),v=0;v!==w;++v)y[v]=r[v];l.clippingState=y;this.numIntersection=o?this.numPlanes:0;this.numPlanes+=p}else i?u(null):h()}}function ftt(n,t){function i(i){var r;if(i===li)return n.REPEAT;if(i===yt)return n.CLAMP_TO_EDGE;if(i===wr)return n.MIRRORED_REPEAT;if(i===pt)return n.NEAREST;if(i===yc)return n.NEAREST_MIPMAP_NEAREST;if(i===pc)return n.NEAREST_MIPMAP_LINEAR;if(i===et)return n.LINEAR;if(i===gv)return n.LINEAR_MIPMAP_NEAREST;if(i===so)return n.LINEAR_MIPMAP_LINEAR;if(i===wc)return n.UNSIGNED_BYTE;if(i===vk)return n.UNSIGNED_SHORT_4_4_4_4;if(i===yk)return n.UNSIGNED_SHORT_5_5_5_1;if(i===pk)return n.UNSIGNED_SHORT_5_6_5;if(i===ck)return n.BYTE;if(i===lk)return n.SHORT;if(i===ho)return n.UNSIGNED_SHORT;if(i===ak)return n.INT;if(i===ny)return n.UNSIGNED_INT;if(i===rf)return n.FLOAT;if(i===bc&&(r=t.get("OES_texture_half_float"),r!==null))return r.HALF_FLOAT_OES;if(i===wk)return n.ALPHA;if(i===uf)return n.RGB;if(i===ai)return n.RGBA;if(i===bk)return n.LUMINANCE;if(i===kk)return n.LUMINANCE_ALPHA;if(i===br)return n.DEPTH_COMPONENT;if(i===ff)return n.DEPTH_STENCIL;if(i===av)return n.FUNC_ADD;if(i===hb)return n.FUNC_SUBTRACT;if(i===cb)return n.FUNC_REVERSE_SUBTRACT;if(i===lb)return n.ZERO;if(i===pv)return n.ONE;if(i===ab)return n.SRC_COLOR;if(i===vb)return n.ONE_MINUS_SRC_COLOR;if(i===wv)return n.SRC_ALPHA;if(i===fc)return n.ONE_MINUS_SRC_ALPHA;if(i===yb)return n.DST_ALPHA;if(i===pb)return n.ONE_MINUS_DST_ALPHA;if(i===wb)return n.DST_COLOR;if(i===bb)return n.ONE_MINUS_DST_COLOR;if(i===kb)return n.SRC_ALPHA_SATURATE;if((i===ty||i===iy||i===ry||i===uy)&&(r=t.get("WEBGL_compressed_texture_s3tc"),r!==null)){if(i===ty)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===iy)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===ry)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===uy)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((i===fy||i===ey||i===oy||i===sy)&&(r=t.get("WEBGL_compressed_texture_pvrtc"),r!==null)){if(i===fy)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===ey)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===oy)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===sy)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(i===dk&&(r=t.get("WEBGL_compressed_texture_etc1"),r!==null))return r.COMPRESSED_RGB_ETC1_WEBGL;if((i===vv||i===yv)&&(r=t.get("EXT_blend_minmax"),r!==null)){if(i===vv)return r.MIN_EXT;if(i===yv)return r.MAX_EXT}return i===co&&(r=t.get("WEBGL_depth_texture"),r!==null)?r.UNSIGNED_INT_24_8_WEBGL:0}return{convert:i}}function al(t){function ir(){return si===null?l:1}function sr(){f=new rtt(i);f.get("WEBGL_depth_texture");f.get("OES_texture_float");f.get("OES_texture_float_linear");f.get("OES_texture_half_float");f.get("OES_texture_half_float_linear");f.get("OES_standard_derivatives");f.get("OES_element_index_uint");f.get("ANGLE_instanced_arrays");ut=new ftt(i,f);w=new ttt(i,f,t);r=new ntt(i,f,ut);r.scissor(lt.copy(bt).multiplyScalar(l));r.viewport(rt.copy(wt).multiplyScalar(l));v=new gn;nt=new dn(i,f,r,v,w,ut,yi);gt=new bg(i);ni=new on(i,gt,yi);wi=new cn(ni,g);rr=new un(i);ct=new kn(u,f,w);s=new hn;ti=new tn;it=new kg(u,r,ni,nr);ur=new en(i,f,g);fr=new fn(i,f,g);er=new pg(u,i,r,nt,w);or=new wg(u,i,r,nt,w);u.info.programs=ct.programs;u.context=i;u.capabilities=w;u.extensions=f;u.properties=v;u.renderLists=ti;u.state=r}function hr(n){n.preventDefault();console.log("THREE.WebGLRenderer: Context Lost.");oi=!0}function cr(){console.log("THREE.WebGLRenderer: Context Restored.");oi=!1;sr()}function lr(n){var t=n.target;t.removeEventListener("dispose",lr);eu(t)}function eu(n){ar(n);v.remove(n)}function ar(n){var t=v.get(n).program;n.program=undefined;t!==undefined&&ct.releaseProgram(t)}function ou(n,t,i){n.render(function(n){u.renderBufferImmediate(n,t,i)})}function su(n,t,u,e){var l,o,s,h;if(u&&u.isInstancedBufferGeometry&&f.get("ANGLE_instanced_arrays")===null){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}e===undefined&&(e=0);r.initAttributes();var nt=u.attributes,p=t.getAttributes(),w=n.defaultAttributeValues;for(l in p)if(o=p[l],o>=0)if(s=nt[l],s!==undefined){var b=s.normalized,v=s.itemSize,a=gt.get(s);if(a===undefined)continue;var k=a.buffer,d=a.type,y=a.bytesPerElement;if(s.isInterleavedBufferAttribute){var c=s.data,g=c.stride,tt=s.offset;c&&c.isInstancedInterleavedBuffer?(r.enableAttributeAndDivisor(o,c.meshPerAttribute),u.maxInstancedCount===undefined&&(u.maxInstancedCount=c.meshPerAttribute*c.count)):r.enableAttribute(o);i.bindBuffer(i.ARRAY_BUFFER,k);i.vertexAttribPointer(o,v,d,b,g*y,(e*g+tt)*y)}else s.isInstancedBufferAttribute?(r.enableAttributeAndDivisor(o,s.meshPerAttribute),u.maxInstancedCount===undefined&&(u.maxInstancedCount=s.meshPerAttribute*s.count)):r.enableAttribute(o),i.bindBuffer(i.ARRAY_BUFFER,k),i.vertexAttribPointer(o,v,d,b,0,e*v*y)}else if(w!==undefined&&(h=w[l],h!==undefined))switch(h.length){case 2:i.vertexAttrib2fv(o,h);break;case 3:i.vertexAttrib3fv(o,h);break;case 4:i.vertexAttrib4fv(o,h);break;default:i.vertexAttrib1fv(o,h)}r.disableUnusedAttributes()}function hu(){if(!ki){var n=b.getDevice();n&&n.isPresenting?n.requestAnimationFrame(ri):window.requestAnimationFrame(ri);ki=!0}}function ri(n){ii!==null&&ii(n);var t=b.getDevice();t&&t.isPresenting?t.requestAnimationFrame(ri):window.requestAnimationFrame(ri)}function vr(n,t,i){var l,e,u,s,h,o,c,r,f;if(n.visible!==!1){if(l=n.layers.test(t.layers),l)if(n.isLight)et.push(n),n.castShadow&&tt.push(n);else if(n.isSprite)(!n.frustumCulled||li.intersectsSprite(n))&&fi.push(n);else if(n.isLensFlare)ei.push(n);else if(n.isImmediateRenderObject)i&&ht.setFromMatrixPosition(n.matrixWorld).applyMatrix4(dt),k.push(n,null,n.material,ht.z,null);else if((n.isMesh||n.isLine||n.isPoints)&&(n.isSkinnedMesh&&n.skeleton.update(),!n.frustumCulled||li.intersectsObject(n)))if(i&&ht.setFromMatrixPosition(n.matrixWorld).applyMatrix4(dt),e=wi.update(n),u=n.material,Array.isArray(u))for(s=e.groups,r=0,f=s.length;r<f;r++)h=s[r],o=u[h.materialIndex],o&&o.visible&&k.push(n,e,o,ht.z,h);else u.visible&&k.push(n,e,u,ht.z,null);for(c=n.children,r=0,f=c.length;r<f;r++)vr(c[r],t,i)}}function ui(n,t,i,u){for(var v,o,k,s,f=0,y=n.length;f<y;f++){var e=n[f],c=e.object,p=e.geometry,w=u===undefined?e.material:u,b=e.group;if(i.isArrayCamera){for(pt=i,v=i.cameras,o=0,k=v.length;o<k;o++)if(s=v[o],c.layers.test(s.layers)){var h=s.bounds,g=h.x*d,nt=h.y*a,tt=h.z*d,it=h.w*a;r.viewport(rt.set(g,nt,tt,it).multiplyScalar(l));yr(c,t,s,p,w,b)}}else pt=null,yr(c,t,i,p,w,b)}}function yr(n,t,i,f,e,o){n.onBeforeRender(u,t,i,f,e,o);if(n.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,n.matrixWorld),n.normalMatrix.getNormalMatrix(n.modelViewMatrix),n.isImmediateRenderObject){r.setMaterial(e);var s=pr(i,t.fog,e,n);yt="";ou(n,s,e)}else u.renderBufferDirect(i,t.fog,f,e,n,o);n.onAfterRender(u,t,i,f,e,o)}function di(n,t,i){var f=v.get(n),h=ct.getParameters(n,s.state,tt,t,y.numPlanes,y.numIntersection,i),a=ct.getProgramCode(n,h),o=f.program,p=!0,c,l,e,r,w,b;if(o===undefined)n.addEventListener("dispose",lr);else if(o.code!==a)ar(n);else{if(h.shaderID!==undefined)return;p=!1}if(p){h.shaderID?(c=tu[h.shaderID],f.shader={name:n.type,uniforms:st.clone(c.uniforms),vertexShader:c.vertexShader,fragmentShader:c.fragmentShader}):f.shader={name:n.type,uniforms:n.uniforms,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader};n.onBeforeCompile(f.shader);o=ct.acquireProgram(n,f.shader,h,a);f.program=o;n.program=o}if(l=o.getAttributes(),n.morphTargets)for(n.numSupportedMorphTargets=0,e=0;e<u.maxMorphTargets;e++)l["morphTarget"+e]>=0&&n.numSupportedMorphTargets++;if(n.morphNormals)for(n.numSupportedMorphNormals=0,e=0;e<u.maxMorphNormals;e++)l["morphNormal"+e]>=0&&n.numSupportedMorphNormals++;r=f.shader.uniforms;(n.isShaderMaterial||n.isRawShaderMaterial)&&n.clipping!==!0||(f.numClippingPlanes=y.numPlanes,f.numIntersection=y.numIntersection,r.clippingPlanes=y.uniform);f.fog=t;f.lightsHash=s.state.hash;n.lights&&(r.ambientLightColor.value=s.state.ambient,r.directionalLights.value=s.state.directional,r.spotLights.value=s.state.spot,r.rectAreaLights.value=s.state.rectArea,r.pointLights.value=s.state.point,r.hemisphereLights.value=s.state.hemi,r.directionalShadowMap.value=s.state.directionalShadowMap,r.directionalShadowMatrix.value=s.state.directionalShadowMatrix,r.spotShadowMap.value=s.state.spotShadowMap,r.spotShadowMatrix.value=s.state.spotShadowMatrix,r.pointShadowMap.value=s.state.pointShadowMap,r.pointShadowMatrix.value=s.state.pointShadowMatrix);w=f.program.getUniforms();b=gi.seqWithValue(w.seq,r);f.uniformsList=b}function pr(n,t,f,o){var a,it,tt,p,ut,b,d,et;ci=0;a=v.get(f);kt&&(vi||n!==ot)&&(it=n===ot&&f.id===vt,y.setState(f.clippingPlanes,f.clipIntersection,f.clipShadows,n,a,it));f.needsUpdate===!1&&(a.program===undefined?f.needsUpdate=!0:f.fog&&a.fog!==t?f.needsUpdate=!0:f.lights&&a.lightsHash!==s.state.hash?f.needsUpdate=!0:a.numClippingPlanes!==undefined&&(a.numClippingPlanes!==y.numPlanes||a.numIntersection!==y.numIntersection)&&(f.needsUpdate=!0));f.needsUpdate&&(di(f,t,o),f.needsUpdate=!1);var rt=!1,k=!1,g=!1,nt=a.program,l=nt.getUniforms(),c=a.shader.uniforms;return r.useProgram(nt.program)&&(rt=!0,k=!0,g=!0),f.id!==vt&&(vt=f.id,k=!0),(rt||n!==ot)&&(l.setValue(i,"projectionMatrix",n.projectionMatrix),w.logarithmicDepthBuffer&&l.setValue(i,"logDepthBufFC",2/(Math.log(n.far+1)/Math.LN2)),ot!==(pt||n)&&(ot=pt||n,k=!0,g=!0),(f.isShaderMaterial||f.isMeshPhongMaterial||f.isMeshStandardMaterial||f.envMap)&&(tt=l.map.cameraPosition,tt!==undefined&&tt.setValue(i,ht.setFromMatrixPosition(n.matrixWorld))),(f.isMeshPhongMaterial||f.isMeshLambertMaterial||f.isMeshBasicMaterial||f.isMeshStandardMaterial||f.isShaderMaterial||f.skinning)&&l.setValue(i,"viewMatrix",n.matrixWorldInverse)),f.skinning&&(l.setOptional(i,o,"bindMatrix"),l.setOptional(i,o,"bindMatrixInverse"),p=o.skeleton,p&&(ut=p.bones,w.floatVertexTextures?(p.boneTexture===undefined&&(b=Math.sqrt(ut.length*4),b=h.ceilPowerOfTwo(b),b=Math.max(b,4),d=new Float32Array(b*b*4),d.set(p.boneMatrices),et=new gr(d,b,b,ai,rf),p.boneMatrices=d,p.boneTexture=et,p.boneTextureSize=b),l.setValue(i,"boneTexture",p.boneTexture),l.setValue(i,"boneTextureSize",p.boneTextureSize)):l.setOptional(i,p,"boneMatrices"))),k&&(l.setValue(i,"toneMappingExposure",u.toneMappingExposure),l.setValue(i,"toneMappingWhitePoint",u.toneMappingWhitePoint),f.lights&&gu(c,g),t&&f.fog&&vu(c,t),f.isMeshBasicMaterial?ft(c,f):f.isMeshLambertMaterial?(ft(c,f),yu(c,f)):f.isMeshPhongMaterial?(ft(c,f),f.isMeshToonMaterial?pu(c,f):wr(c,f)):f.isMeshStandardMaterial?(ft(c,f),f.isMeshPhysicalMaterial?wu(c,f):br(c,f)):f.isMeshDepthMaterial?(ft(c,f),bu(c,f)):f.isMeshDistanceMaterial?(ft(c,f),ku(c,f)):f.isMeshNormalMaterial?(ft(c,f),du(c,f)):f.isLineBasicMaterial?(cu(c,f),f.isLineDashedMaterial&&lu(c,f)):f.isPointsMaterial?au(c,f):f.isShadowMaterial&&(c.color.value=f.color,c.opacity.value=f.opacity),c.ltcMat!==undefined&&(c.ltcMat.value=e.LTC_MAT_TEXTURE),c.ltcMag!==undefined&&(c.ltcMag.value=e.LTC_MAG_TEXTURE),gi.upload(i,a.uniformsList,c,u)),l.setValue(i,"modelViewMatrix",o.modelViewMatrix),l.setValue(i,"normalMatrix",o.normalMatrix),l.setValue(i,"modelMatrix",o.matrixWorld),nt}function ft(n,t){var i;if(n.opacity.value=t.opacity,t.color&&(n.diffuse.value=t.color),t.emissive&&n.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),t.map&&(n.map.value=t.map),t.alphaMap&&(n.alphaMap.value=t.alphaMap),t.specularMap&&(n.specularMap.value=t.specularMap),t.envMap&&(n.envMap.value=t.envMap,n.flipEnvMap.value=(t.envMap&&t.envMap.isCubeTexture)?-1:1,n.reflectivity.value=t.reflectivity,n.refractionRatio.value=t.refractionRatio),t.lightMap&&(n.lightMap.value=t.lightMap,n.lightMapIntensity.value=t.lightMapIntensity),t.aoMap&&(n.aoMap.value=t.aoMap,n.aoMapIntensity.value=t.aoMapIntensity),t.map?i=t.map:t.specularMap?i=t.specularMap:t.displacementMap?i=t.displacementMap:t.normalMap?i=t.normalMap:t.bumpMap?i=t.bumpMap:t.roughnessMap?i=t.roughnessMap:t.metalnessMap?i=t.metalnessMap:t.alphaMap?i=t.alphaMap:t.emissiveMap&&(i=t.emissiveMap),i!==undefined){if(i.isWebGLRenderTarget&&(i=i.texture),i.matrixAutoUpdate===!0){var r=i.offset,u=i.repeat,e=i.rotation,f=i.center;i.matrix.setUvTransform(r.x,r.y,u.x,u.y,e,f.x,f.y)}n.uvTransform.value.copy(i.matrix)}}function cu(n,t){n.diffuse.value=t.color;n.opacity.value=t.opacity}function lu(n,t){n.dashSize.value=t.dashSize;n.totalSize.value=t.dashSize+t.gapSize;n.scale.value=t.scale}function au(n,t){if(n.diffuse.value=t.color,n.opacity.value=t.opacity,n.size.value=t.size*l,n.scale.value=a*.5,n.map.value=t.map,t.map!==null){if(t.map.matrixAutoUpdate===!0){var i=t.map.offset,r=t.map.repeat,f=t.map.rotation,u=t.map.center;t.map.matrix.setUvTransform(i.x,i.y,r.x,r.y,f,u.x,u.y)}n.uvTransform.value.copy(t.map.matrix)}}function vu(n,t){n.fogColor.value=t.color;t.isFog?(n.fogNear.value=t.near,n.fogFar.value=t.far):t.isFogExp2&&(n.fogDensity.value=t.density)}function yu(n,t){t.emissiveMap&&(n.emissiveMap.value=t.emissiveMap)}function wr(n,t){n.specular.value=t.specular;n.shininess.value=Math.max(t.shininess,.0001);t.emissiveMap&&(n.emissiveMap.value=t.emissiveMap);t.bumpMap&&(n.bumpMap.value=t.bumpMap,n.bumpScale.value=t.bumpScale);t.normalMap&&(n.normalMap.value=t.normalMap,n.normalScale.value.copy(t.normalScale));t.displacementMap&&(n.displacementMap.value=t.displacementMap,n.displacementScale.value=t.displacementScale,n.displacementBias.value=t.displacementBias)}function pu(n,t){wr(n,t);t.gradientMap&&(n.gradientMap.value=t.gradientMap)}function br(n,t){n.roughness.value=t.roughness;n.metalness.value=t.metalness;t.roughnessMap&&(n.roughnessMap.value=t.roughnessMap);t.metalnessMap&&(n.metalnessMap.value=t.metalnessMap);t.emissiveMap&&(n.emissiveMap.value=t.emissiveMap);t.bumpMap&&(n.bumpMap.value=t.bumpMap,n.bumpScale.value=t.bumpScale);t.normalMap&&(n.normalMap.value=t.normalMap,n.normalScale.value.copy(t.normalScale));t.displacementMap&&(n.displacementMap.value=t.displacementMap,n.displacementScale.value=t.displacementScale,n.displacementBias.value=t.displacementBias);t.envMap&&(n.envMapIntensity.value=t.envMapIntensity)}function wu(n,t){n.clearCoat.value=t.clearCoat;n.clearCoatRoughness.value=t.clearCoatRoughness;br(n,t)}function bu(n,t){t.displacementMap&&(n.displacementMap.value=t.displacementMap,n.displacementScale.value=t.displacementScale,n.displacementBias.value=t.displacementBias)}function ku(n,t){t.displacementMap&&(n.displacementMap.value=t.displacementMap,n.displacementScale.value=t.displacementScale,n.displacementBias.value=t.displacementBias);n.referencePosition.value.copy(t.referencePosition);n.nearDistance.value=t.nearDistance;n.farDistance.value=t.farDistance}function du(n,t){t.bumpMap&&(n.bumpMap.value=t.bumpMap,n.bumpScale.value=t.bumpScale);t.normalMap&&(n.normalMap.value=t.normalMap,n.normalScale.value.copy(t.normalScale));t.displacementMap&&(n.displacementMap.value=t.displacementMap,n.displacementScale.value=t.displacementScale,n.displacementBias.value=t.displacementBias)}function gu(n,t){n.ambientLightColor.needsUpdate=t;n.directionalLights.needsUpdate=t;n.pointLights.needsUpdate=t;n.spotLights.needsUpdate=t;n.rectAreaLights.needsUpdate=t;n.hemisphereLights.needsUpdate=t}function nf(){var n=ci;return n>=w.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+n+" texture units while this GPU supports only "+w.maxTextures),ci+=1,n}var i,pi,f,w,r,v,nt,gt,ni,wi,s,ct,ti,it,rr,ur,fr,er,or,ut,b,bi,ki,ii;console.log("THREE.WebGLRenderer",fb);t=t||{};var c=t.canvas!==undefined?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),kr=t.context!==undefined?t.context:null,dr=t.alpha!==undefined?t.alpha:!1,nu=t.depth!==undefined?t.depth:!0,iu=t.stencil!==undefined?t.stencil:!0,ru=t.antialias!==undefined?t.antialias:!1,nr=t.premultipliedAlpha!==undefined?t.premultipliedAlpha:!0,uu=t.preserveDrawingBuffer!==undefined?t.preserveDrawingBuffer:!1,et=[],tt=[],k=null,fi=[],ei=[];this.domElement=c;this.context=null;this.autoClear=!0;this.autoClearColor=!0;this.autoClearDepth=!0;this.autoClearStencil=!0;this.sortObjects=!0;this.clippingPlanes=[];this.localClippingEnabled=!1;this.gammaFactor=2;this.gammaInput=!1;this.gammaOutput=!1;this.physicallyCorrectLights=!1;this.toneMapping=bv;this.toneMappingExposure=1;this.toneMappingWhitePoint=1;this.maxMorphTargets=8;this.maxMorphNormals=4;var u=this,oi=!1,si=null,at=null,vt=-1,yt="",ot=null,pt=null,rt=new p,lt=new p,hi=null,ci=0,d=c.width,a=c.height,l=1,wt=new p(0,0,d,a),bt=new p(0,0,d,a),tr=!1,li=new tl,y=new utt,kt=!1,vi=!1,dt=new o,ht=new n,yi={geometries:0,textures:0},g={frame:0,calls:0,vertices:0,faces:0,points:0};this.info={render:g,memory:yi,programs:null};try{if(pi={alpha:dr,depth:nu,stencil:iu,antialias:ru,premultipliedAlpha:nr,preserveDrawingBuffer:uu},i=kr||c.getContext("webgl",pi)||c.getContext("experimental-webgl",pi),i===null)if(c.getContext("webgl")!==null)throw"Error creating WebGL context with your selected attributes.";else throw"Error creating WebGL context.";i.getShaderPrecisionFormat===undefined&&(i.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});c.addEventListener("webglcontextlost",hr,!1);c.addEventListener("webglcontextrestored",cr,!1)}catch(fu){console.error("THREE.WebGLRenderer: "+fu)}sr();b=new itt(u);this.vr=b;bi=new up(u,wi,w.maxTextureSize);this.shadowMap=bi;this.getContext=function(){return i};this.getContextAttributes=function(){return i.getContextAttributes()};this.forceContextLoss=function(){var n=f.get("WEBGL_lose_context");n&&n.loseContext()};this.forceContextRestore=function(){var n=f.get("WEBGL_lose_context");n&&n.restoreContext()};this.getPixelRatio=function(){return l};this.setPixelRatio=function(n){n!==undefined&&(l=n,this.setSize(d,a,!1))};this.getSize=function(){return{width:d,height:a}};this.setSize=function(n,t,i){var r=b.getDevice();if(r&&r.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}d=n;a=t;c.width=n*l;c.height=t*l;i!==!1&&(c.style.width=n+"px",c.style.height=t+"px");this.setViewport(0,0,n,t)};this.getDrawingBufferSize=function(){return{width:d*l,height:a*l}};this.setDrawingBufferSize=function(n,t,i){d=n;a=t;l=i;c.width=n*i;c.height=t*i;this.setViewport(0,0,n,t)};this.setViewport=function(n,t,i,u){wt.set(n,a-t-u,i,u);r.viewport(rt.copy(wt).multiplyScalar(l))};this.setScissor=function(n,t,i,u){bt.set(n,a-t-u,i,u);r.scissor(lt.copy(bt).multiplyScalar(l))};this.setScissorTest=function(n){r.setScissorTest(tr=n)};this.getClearColor=function(){return it.getClearColor()};this.setClearColor=function(){it.setClearColor.apply(it,arguments)};this.getClearAlpha=function(){return it.getClearAlpha()};this.setClearAlpha=function(){it.setClearAlpha.apply(it,arguments)};this.clear=function(n,t,r){var u=0;(n===undefined||n)&&(u|=i.COLOR_BUFFER_BIT);(t===undefined||t)&&(u|=i.DEPTH_BUFFER_BIT);(r===undefined||r)&&(u|=i.STENCIL_BUFFER_BIT);i.clear(u)};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.clearTarget=function(n,t,i,r){this.setRenderTarget(n);this.clear(t,i,r)};this.dispose=function(){c.removeEventListener("webglcontextlost",hr,!1);c.removeEventListener("webglcontextrestored",cr,!1);ti.dispose();b.dispose()};this.renderBufferImmediate=function(n,t,u){var o,s,f,a;if(r.initAttributes(),o=v.get(n),n.hasPositions&&!o.position&&(o.position=i.createBuffer()),n.hasNormals&&!o.normal&&(o.normal=i.createBuffer()),n.hasUvs&&!o.uv&&(o.uv=i.createBuffer()),n.hasColors&&!o.color&&(o.color=i.createBuffer()),s=t.getAttributes(),n.hasPositions&&(i.bindBuffer(i.ARRAY_BUFFER,o.position),i.bufferData(i.ARRAY_BUFFER,n.positionArray,i.DYNAMIC_DRAW),r.enableAttribute(s.position),i.vertexAttribPointer(s.position,3,i.FLOAT,!1,0,0)),n.hasNormals){if(i.bindBuffer(i.ARRAY_BUFFER,o.normal),!u.isMeshPhongMaterial&&!u.isMeshStandardMaterial&&!u.isMeshNormalMaterial&&u.flatShading===!0)for(f=0,a=n.count*3;f<a;f+=9){var e=n.normalArray,h=(e[f+0]+e[f+3]+e[f+6])/3,c=(e[f+1]+e[f+4]+e[f+7])/3,l=(e[f+2]+e[f+5]+e[f+8])/3;e[f+0]=h;e[f+1]=c;e[f+2]=l;e[f+3]=h;e[f+4]=c;e[f+5]=l;e[f+6]=h;e[f+7]=c;e[f+8]=l}i.bufferData(i.ARRAY_BUFFER,n.normalArray,i.DYNAMIC_DRAW);r.enableAttribute(s.normal);i.vertexAttribPointer(s.normal,3,i.FLOAT,!1,0,0)}n.hasUvs&&u.map&&(i.bindBuffer(i.ARRAY_BUFFER,o.uv),i.bufferData(i.ARRAY_BUFFER,n.uvArray,i.DYNAMIC_DRAW),r.enableAttribute(s.uv),i.vertexAttribPointer(s.uv,2,i.FLOAT,!1,0,0));n.hasColors&&u.vertexColors!==ic&&(i.bindBuffer(i.ARRAY_BUFFER,o.color),i.bufferData(i.ARRAY_BUFFER,n.colorArray,i.DYNAMIC_DRAW),r.enableAttribute(s.color),i.vertexAttribPointer(s.color,3,i.FLOAT,!1,0,0));r.disableUnusedAttributes();i.drawArrays(i.TRIANGLES,0,n.count);n.count=0};this.renderBufferDirect=function(n,t,u,f,e,o){var p,s,l,a;r.setMaterial(f);var v=pr(n,t,f,e),k=u.id+"_"+v.id+"_"+(f.wireframe===!0),y=!1;k!==yt&&(yt=k,y=!0);e.morphTargetInfluences&&(rr.update(e,u,f,v),y=!0);var h=u.index,d=u.attributes.position,c=1;f.wireframe===!0&&(h=ni.getWireframeAttribute(u),c=2);s=ur;h!==null&&(p=gt.get(h),s=fr,s.setIndex(p));y&&(su(f,v,u),h!==null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,p.buffer));l=0;h!==null?l=h.count:d!==undefined&&(l=d.count);var g=u.drawRange.start*c,tt=u.drawRange.count*c,nt=o!==null?o.start*c:0,it=o!==null?o.count*c:Infinity,w=Math.max(g,nt),rt=Math.min(l,g+tt,nt+it)-1,b=Math.max(0,rt-w+1);if(b!==0){if(e.isMesh)if(f.wireframe===!0)r.setLineWidth(f.wireframeLinewidth*ir()),s.setMode(i.LINES);else switch(e.drawMode){case hy:s.setMode(i.TRIANGLES);break;case id:s.setMode(i.TRIANGLE_STRIP);break;case rd:s.setMode(i.TRIANGLE_FAN)}else e.isLine?(a=f.linewidth,a===undefined&&(a=1),r.setLineWidth(a*ir()),e.isLineSegments?s.setMode(i.LINES):e.isLineLoop?s.setMode(i.LINE_LOOP):s.setMode(i.LINE_STRIP)):e.isPoints&&s.setMode(i.POINTS);u&&u.isInstancedBufferGeometry?u.maxInstancedCount>0&&s.renderInstances(u,w,b):s.render(w,b)}};this.compile=function(n,t){et.length=0;tt.length=0;n.traverse(function(n){n.isLight&&(et.push(n),n.castShadow&&tt.push(n))});s.setup(et,tt,t);n.traverse(function(t){if(t.material)if(Array.isArray(t.material))for(var i=0;i<t.material.length;i++)di(t.material[i],n.fog,t);else di(t.material,n.fog,t)})};ki=!1;ii=null;this.animate=function(n){ii=n;hu()};this.render=function(n,t,i,f){var e,o,h;if(!(t&&t.isCamera)){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}oi||(yt="",vt=-1,ot=null,n.autoUpdate===!0&&n.updateMatrixWorld(),t.parent===null&&t.updateMatrixWorld(),b.enabled&&(t=b.getCamera(t)),dt.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),li.setFromMatrix(dt),et.length=0,tt.length=0,fi.length=0,ei.length=0,vi=this.localClippingEnabled,kt=y.init(this.clippingPlanes,vi,t),k=ti.get(n,t),k.init(),vr(n,t,u.sortObjects),u.sortObjects===!0&&k.sort(),kt&&y.beginShadows(),bi.render(tt,n,t),s.setup(et,tt,t),kt&&y.endShadows(),g.frame++,g.calls=0,g.vertices=0,g.faces=0,g.points=0,i===undefined&&(i=null),this.setRenderTarget(i),it.render(k,n,t,f),e=k.opaque,o=k.transparent,n.overrideMaterial?(h=n.overrideMaterial,e.length&&ui(e,n,t,h),o.length&&ui(o,n,t,h)):(e.length&&ui(e,n,t),o.length&&ui(o,n,t)),or.render(fi,n,t),er.render(ei,n,t,rt),i&&nt.updateRenderTargetMipmap(i),r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),r.setPolygonOffset(!1),b.enabled&&b.submitFrame())};this.setFaceCulling=function(n,t){r.setCullFace(n);r.setFlipSided(t===ob)};this.allocTextureUnit=nf;this.setTexture2D=function(){var n=!1;return function(t,i){t&&t.isWebGLRenderTarget&&(n||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),n=!0),t=t.texture);nt.setTexture2D(t,i)}}();this.setTexture=function(){var n=!1;return function(t,i){n||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),n=!0);nt.setTexture2D(t,i)}}();this.setTextureCube=function(){var n=!1;return function(t,i){t&&t.isWebGLRenderTargetCube&&(n||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),n=!0),t=t.texture);t&&t.isCubeTexture||Array.isArray(t.image)&&t.image.length===6?nt.setTextureCube(t,i):nt.setTextureCubeDynamic(t,i)}}();this.getRenderTarget=function(){return si};this.setRenderTarget=function(n){var t,u,f,e;si=n;n&&v.get(n).__webglFramebuffer===undefined&&nt.setupRenderTarget(n);t=null;u=!1;n?(f=v.get(n).__webglFramebuffer,n.isWebGLRenderTargetCube?(t=f[n.activeCubeFace],u=!0):t=f,rt.copy(n.viewport),lt.copy(n.scissor),hi=n.scissorTest):(rt.copy(wt).multiplyScalar(l),lt.copy(bt).multiplyScalar(l),hi=tr);at!==t&&(i.bindFramebuffer(i.FRAMEBUFFER,t),at=t);r.viewport(rt);r.scissor(lt);r.setScissorTest(hi);u&&(e=v.get(n.texture),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+n.activeCubeFace,e.__webglTexture,n.activeMipMapLevel))};this.readRenderTargetPixels=function(n,t,r,u,e,o){var h,c;if(!(n&&n.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}if(h=v.get(n).__webglFramebuffer,h){c=!1;h!==at&&(i.bindFramebuffer(i.FRAMEBUFFER,h),c=!0);try{var a=n.texture,l=a.format,s=a.type;if(l!==ai&&ut.convert(l)!==i.getParameter(i.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(s!==wc&&ut.convert(s)!==i.getParameter(i.IMPLEMENTATION_COLOR_READ_TYPE)&&!(s===rf&&(f.get("OES_texture_float")||f.get("WEBGL_color_buffer_float")))&&!(s===bc&&f.get("EXT_color_buffer_half_float"))){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}i.checkFramebufferStatus(i.FRAMEBUFFER)===i.FRAMEBUFFER_COMPLETE?t>=0&&t<=n.width-u&&r>=0&&r<=n.height-e&&i.readPixels(t,r,u,e,ut.convert(l),ut.convert(s),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{c&&i.bindFramebuffer(i.FRAMEBUFFER,at)}}}}function yf(n,t){this.name="";this.color=new f(n);this.density=t!==undefined?t:.00025}function pf(n,t,i){this.name="";this.color=new f(n);this.near=t!==undefined?t:1;this.far=i!==undefined?i:1e3}function ko(){r.call(this);this.type="Scene";this.background=null;this.fog=null;this.overrideMaterial=null;this.autoUpdate=!0}function pp(t,i,u,f,e){r.call(this);this.lensFlares=[];this.positionScreen=new n;this.customUpdateCallback=undefined;t!==undefined&&this.add(t,i,u,f,e)}function rr(n){l.call(this);this.type="SpriteMaterial";this.color=new f(16777215);this.map=null;this.rotation=0;this.fog=!1;this.lights=!1;this.setValues(n)}function vl(n){r.call(this);this.type="Sprite";this.material=n!==undefined?n:new rr}function go(){r.call(this);this.type="LOD";Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function ns(n,t){var u=this,i,r;if(n=n||[],this.bones=n.slice(0),this.boneMatrices=new Float32Array(this.bones.length*16),t===undefined)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else for(console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[],i=0,r=this.bones.length;i<r;i++)u.boneInverses.push(new o)}function yl(){r.call(this);this.type="Bone"}function pl(n,t){tt.call(this,n,t);this.type="SkinnedMesh";this.bindMode="attached";this.bindMatrix=new o;this.bindMatrixInverse=new o;var i=this.initBones(),r=new ns(i);this.bind(r,this.matrixWorld);this.normalizeSkinWeights()}function y(n){l.call(this);this.type="LineBasicMaterial";this.color=new f(16777215);this.linewidth=1;this.linecap="round";this.linejoin="round";this.lights=!1;this.setValues(n)}function ct(n,t,i){if(i===1)return console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new w(n,t);r.call(this);this.type="Line";this.geometry=n!==undefined?n:new u;this.material=t!==undefined?t:new y({color:Math.random()*16777215})}function w(n,t){ct.call(this,n,t);this.type="LineSegments"}function wl(n,t){ct.call(this,n,t);this.type="LineLoop"}function ur(n){l.call(this);this.type="PointsMaterial";this.color=new f(16777215);this.map=null;this.size=1;this.sizeAttenuation=!0;this.lights=!1;this.setValues(n)}function bl(n,t){r.call(this);this.type="Points";this.geometry=n!==undefined?n:new u;this.material=t!==undefined?t:new ur({color:Math.random()*16777215})}function wf(){r.call(this);this.type="Group"}function kl(n,t,i,r,u,f,e,o,s){function c(){var n=h.image;n.readyState>=n.HAVE_CURRENT_DATA&&(h.needsUpdate=!0);requestAnimationFrame(c)}b.call(this,n,t,i,r,u,f,e,o,s);this.generateMipmaps=!1;var h=this;requestAnimationFrame(c)}function bf(n,t,i,r,u,f,e,o,s,h,c,l){b.call(this,null,f,e,o,s,h,r,u,c,l);this.image={width:t,height:i};this.mipmaps=n;this.flipY=!1;this.generateMipmaps=!1}function ts(n,t,i,r,u,f,e,o,s,h){if(h=h!==undefined?h:br,h!==br&&h!==ff)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===undefined&&h===br&&(i=ho);i===undefined&&h===ff&&(i=co);b.call(this,null,r,u,f,e,o,h,i,s);this.image={width:n,height:t};this.magFilter=e!==undefined?e:pt;this.minFilter=o!==undefined?o:pt;this.flipY=!1;this.generateMipmaps=!1}function is(t){var d,g,l,k,w,nt,tt,ut,ft,et;u.call(this);this.type="WireframeGeometry";var c=[],e,f,a,b,it,o=[0,0],h={},v,y,p,s,rt=["a","b","c"],r;if(t&&t.isGeometry){for(d=t.faces,e=0,a=d.length;e<a;e++)for(g=d[e],f=0;f<3;f++)y=g[rt[f]],p=g[rt[(f+1)%3]],o[0]=Math.min(y,p),o[1]=Math.max(y,p),s=o[0]+","+o[1],h[s]===undefined&&(h[s]={index1:o[0],index2:o[1]});for(s in h)v=h[s],r=t.vertices[v.index1],c.push(r.x,r.y,r.z),r=t.vertices[v.index2],c.push(r.x,r.y,r.z)}else if(t&&t.isBufferGeometry)if(r=new n,t.index!==null){for(l=t.attributes.position,k=t.index,w=t.groups,w.length===0&&(w=[{start:0,count:k.count,materialIndex:0}]),b=0,it=w.length;b<it;++b)for(nt=w[b],tt=nt.start,ut=nt.count,e=tt,a=tt+ut;e<a;e+=3)for(f=0;f<3;f++)y=k.getX(e+f),p=k.getX(e+(f+1)%3),o[0]=Math.min(y,p),o[1]=Math.max(y,p),s=o[0]+","+o[1],h[s]===undefined&&(h[s]={index1:o[0],index2:o[1]});for(s in h)v=h[s],r.fromBufferAttribute(l,v.index1),c.push(r.x,r.y,r.z),r.fromBufferAttribute(l,v.index2),c.push(r.x,r.y,r.z)}else for(l=t.attributes.position,e=0,a=l.count/3;e<a;e++)for(f=0;f<3;f++)ft=3*e+f,r.fromBufferAttribute(l,ft),c.push(r.x,r.y,r.z),et=3*e+(f+1)%3,r.fromBufferAttribute(l,et),c.push(r.x,r.y,r.z);this.addAttribute("position",new i(c,3))}function rs(n,t,i){s.call(this);this.type="ParametricGeometry";this.parameters={func:n,slices:t,stacks:i};this.fromBufferGeometry(new kf(n,t,i));this.mergeVertices()}function kf(t,r,f){var c,l;u.call(this);this.type="ParametricBufferGeometry";this.parameters={func:t,slices:r,stacks:f};for(var p=[],k=[],d=[],g=[],a=1e-5,v=new n,h=new n,e=new n,w=new n,b=new n,s,y=r+1,o=0;o<=f;o++)for(c=o/f,s=0;s<=r;s++)l=s/r,h=t(l,c,h),k.push(h.x,h.y,h.z),l-a>=0?(e=t(l-a,c,e),w.subVectors(h,e)):(e=t(l+a,c,e),w.subVectors(e,h)),c-a>=0?(e=t(l,c-a,e),b.subVectors(h,e)):(e=t(l,c+a,e),b.subVectors(e,h)),v.crossVectors(w,b).normalize(),d.push(v.x,v.y,v.z),g.push(l,c);for(o=0;o<f;o++)for(s=0;s<r;s++){var it=o*y+s,nt=o*y+s+1,rt=(o+1)*y+s+1,tt=(o+1)*y+s;p.push(it,nt,tt);p.push(nt,rt,tt)}this.setIndex(p);this.addAttribute("position",new i(k,3));this.addAttribute("normal",new i(d,3));this.addAttribute("uv",new i(g,2))}function us(n,t,i,r){s.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:n,indices:t,radius:i,detail:r};this.fromBufferGeometry(new lt(n,t,i,r));this.mergeVertices()}function lt(r,f,e,o){function y(t){for(var r=new n,u=new n,e=new n,i=0;i<f.length;i+=3)l(f[i+0],r),l(f[i+1],u),l(f[i+2],e),p(r,u,e,t)}function p(n,t,i,r){for(var o=Math.pow(2,r),e=[],f,s,u=0;u<=o;u++){e[u]=[];var h=n.clone().lerp(i,u/o),a=t.clone().lerp(i,u/o),l=o-u;for(f=0;f<=l;f++)e[u][f]=f===0&&u===o?h:h.clone().lerp(a,f/l)}for(u=0;u<o;u++)for(f=0;f<2*(o-u)-1;f++)s=Math.floor(f/2),f%2==0?(c(e[u][s+1]),c(e[u+1][s]),c(e[u][s])):(c(e[u][s+1]),c(e[u+1][s+1]),c(e[u+1][s]))}function w(t){for(var r=new n,i=0;i<s.length;i+=3)r.x=s[i+0],r.y=s[i+1],r.z=s[i+2],r.normalize().multiplyScalar(t),s[i+0]=r.x,s[i+1]=r.y,s[i+2]=r.z}function b(){for(var i=new n,r,u,t=0;t<s.length;t+=3)i.x=s[t+0],i.y=s[t+1],i.z=s[t+2],r=v(i)/2/Math.PI+.5,u=g(i)/Math.PI+.5,h.push(r,1-u);d();k()}function k(){for(var n=0;n<h.length;n+=6){var t=h[n+0],i=h[n+2],r=h[n+4],u=Math.max(t,i,r),f=Math.min(t,i,r);u>.9&&f<.1&&(t<.2&&(h[n+0]+=1),i<.2&&(h[n+2]+=1),r<.2&&(h[n+4]+=1))}}function c(n){s.push(n.x,n.y,n.z)}function l(n,t){var i=n*3;t.x=r[i+0];t.y=r[i+1];t.z=r[i+2]}function d(){for(var f=new n,e=new n,o=new n,c=new n,l=new t,y=new t,p=new t,u,i=0,r=0;i<s.length;i+=9,r+=6)f.set(s[i+0],s[i+1],s[i+2]),e.set(s[i+3],s[i+4],s[i+5]),o.set(s[i+6],s[i+7],s[i+8]),l.set(h[r+0],h[r+1]),y.set(h[r+2],h[r+3]),p.set(h[r+4],h[r+5]),c.copy(f).add(e).add(o).divideScalar(3),u=v(c),a(l,r+0,f,u),a(y,r+2,e,u),a(p,r+4,o,u)}function a(n,t,i,r){r<0&&n.x===1&&(h[t]=n.x-1);i.x===0&&i.z===0&&(h[t]=r/2/Math.PI+.5)}function v(n){return Math.atan2(n.z,-n.x)}function g(n){return Math.atan2(-n.y,Math.sqrt(n.x*n.x+n.z*n.z))}u.call(this);this.type="PolyhedronBufferGeometry";this.parameters={vertices:r,indices:f,radius:e,detail:o};e=e||1;o=o||0;var s=[],h=[];y(o);w(e);b();this.addAttribute("position",new i(s,3));this.addAttribute("normal",new i(s.slice(),3));this.addAttribute("uv",new i(h,2));o===0?this.computeVertexNormals():this.normalizeNormals()}function fs(n,t){s.call(this);this.type="TetrahedronGeometry";this.parameters={radius:n,detail:t};this.fromBufferGeometry(new df(n,t));this.mergeVertices()}function df(n,t){lt.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],n,t);this.type="TetrahedronBufferGeometry";this.parameters={radius:n,detail:t}}function es(n,t){s.call(this);this.type="OctahedronGeometry";this.parameters={radius:n,detail:t};this.fromBufferGeometry(new fu(n,t));this.mergeVertices()}function fu(n,t){lt.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],n,t);this.type="OctahedronBufferGeometry";this.parameters={radius:n,detail:t}}function os(n,t){s.call(this);this.type="IcosahedronGeometry";this.parameters={radius:n,detail:t};this.fromBufferGeometry(new gf(n,t));this.mergeVertices()}function gf(n,t){var i=(1+Math.sqrt(5))/2,r=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1];lt.call(this,r,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],n,t);this.type="IcosahedronBufferGeometry";this.parameters={radius:n,detail:t}}function ss(n,t){s.call(this);this.type="DodecahedronGeometry";this.parameters={radius:n,detail:t};this.fromBufferGeometry(new ne(n,t));this.mergeVertices()}function ne(n,t){var i=(1+Math.sqrt(5))/2,r=1/i,u=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r];lt.call(this,u,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],n,t);this.type="DodecahedronBufferGeometry";this.parameters={radius:n,detail:t}}function hs(n,t,i,r,u,f){s.call(this);this.type="TubeGeometry";this.parameters={path:n,tubularSegments:t,radius:i,radialSegments:r,closed:u};f!==undefined&&console.warn("THREE.TubeGeometry: taper has been removed.");var e=new te(n,t,i,r,u);this.tangents=e.tangents;this.normals=e.normals;this.binormals=e.binormals;this.fromBufferGeometry(e);this.mergeVertices()}function te(r,f,e,o,s){function nt(){for(h=0;h<f;h++)g(h);g(s===!1?f:0);it();tt()}function g(n){var t,i;for(y=r.getPointAt(n/f,y),t=a.normals[n],i=a.binormals[n],c=0;c<=o;c++){var h=c/o*Math.PI*2,u=Math.sin(h),s=-Math.cos(h);l.x=s*t.x+u*i.x;l.y=s*t.y+u*i.y;l.z=s*t.z+u*i.z;l.normalize();k.push(l.x,l.y,l.z);v.x=y.x+e*l.x;v.y=y.y+e*l.y;v.z=y.z+e*l.z;b.push(v.x,v.y,v.z)}}function tt(){for(c=1;c<=f;c++)for(h=1;h<=o;h++){var i=(o+1)*(c-1)+(h-1),n=(o+1)*c+(h-1),r=(o+1)*c+h,t=(o+1)*(c-1)+h;w.push(i,n,t);w.push(n,r,t)}}function it(){for(h=0;h<=f;h++)for(c=0;c<=o;c++)p.x=h/f,p.y=c/o,d.push(p.x,p.y)}var a;u.call(this);this.type="TubeBufferGeometry";this.parameters={path:r,tubularSegments:f,radius:e,radialSegments:o,closed:s};f=f||64;e=e||1;o=o||8;s=s||!1;a=r.computeFrenetFrames(f,s);this.tangents=a.tangents;this.normals=a.normals;this.binormals=a.binormals;var v=new n,l=new n,p=new t,y=new n,h,c,b=[],k=[],d=[],w=[];nt();this.setIndex(w);this.addAttribute("position",new i(b,3));this.addAttribute("normal",new i(k,3));this.addAttribute("uv",new i(d,2))}function cs(n,t,i,r,u,f,e){s.call(this);this.type="TorusKnotGeometry";this.parameters={radius:n,tube:t,tubularSegments:i,radialSegments:r,p:u,q:f};e!==undefined&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead.");this.fromBufferGeometry(new ie(n,t,i,r,u,f));this.mergeVertices()}function ie(t,r,f,e,o,s){function ot(n,t,i,r,u){var o=Math.cos(n),s=Math.sin(n),f=i/t*n,e=Math.cos(f);u.x=r*(2+e)*.5*o;u.y=r*(2+e)*s*.5;u.z=r*Math.sin(f)*.5}var g;u.call(this);this.type="TorusKnotBufferGeometry";this.parameters={radius:t,tube:r,tubularSegments:f,radialSegments:e,p:o,q:s};t=t||1;r=r||.4;f=Math.floor(f)||64;e=Math.floor(e)||8;o=o||2;s=s||3;for(var w=[],it=[],rt=[],b=[],c,l=new n,p=new n,a=new n,k=new n,y=new n,d=new n,v=new n,h=0;h<=f;++h)for(g=h/f*o*Math.PI*2,ot(g,o,s,t,a),ot(g+.01,o,s,t,k),d.subVectors(k,a),v.addVectors(k,a),y.crossVectors(d,v),v.crossVectors(y,d),y.normalize(),v.normalize(),c=0;c<=e;++c){var ut=c/e*Math.PI*2,nt=-r*Math.cos(ut),tt=r*Math.sin(ut);l.x=a.x+(nt*v.x+tt*y.x);l.y=a.y+(nt*v.y+tt*y.y);l.z=a.z+(nt*v.z+tt*y.z);it.push(l.x,l.y,l.z);p.subVectors(l,a).normalize();rt.push(p.x,p.y,p.z);b.push(h/f);b.push(c/e)}for(c=1;c<=f;c++)for(h=1;h<=e;h++){var st=(e+1)*(c-1)+(h-1),ft=(e+1)*c+(h-1),ht=(e+1)*c+h,et=(e+1)*(c-1)+h;w.push(st,ft,et);w.push(ft,ht,et)}this.setIndex(w);this.addAttribute("position",new i(it,3));this.addAttribute("normal",new i(rt,3));this.addAttribute("uv",new i(b,2))}function ls(n,t,i,r,u){s.call(this);this.type="TorusGeometry";this.parameters={radius:n,tube:t,radialSegments:i,tubularSegments:r,arc:u};this.fromBufferGeometry(new re(n,t,i,r,u));this.mergeVertices()}function re(t,r,f,e,o){var l,v;u.call(this);this.type="TorusBufferGeometry";this.parameters={radius:t,tube:r,radialSegments:f,tubularSegments:e,arc:o};t=t||1;r=r||.4;f=Math.floor(f)||8;e=Math.floor(e)||6;o=o||Math.PI*2;for(var y=[],b=[],k=[],p=[],w=new n,c=new n,a=new n,h,s=0;s<=f;s++)for(h=0;h<=e;h++)l=h/e*o,v=s/f*Math.PI*2,c.x=(t+r*Math.cos(v))*Math.cos(l),c.y=(t+r*Math.cos(v))*Math.sin(l),c.z=r*Math.sin(v),b.push(c.x,c.y,c.z),w.x=t*Math.cos(l),w.y=t*Math.sin(l),a.subVectors(c,w).normalize(),k.push(a.x,a.y,a.z),p.push(h/e),p.push(s/f);for(s=1;s<=f;s++)for(h=1;h<=e;h++){var nt=(e+1)*s+h-1,d=(e+1)*(s-1)+h-1,tt=(e+1)*(s-1)+h,g=(e+1)*s+h;y.push(nt,d,g);y.push(d,tt,g)}this.setIndex(y);this.addAttribute("position",new i(b,3));this.addAttribute("normal",new i(k,3));this.addAttribute("uv",new i(p,2))}function fr(n,t){s.call(this);this.type="ExtrudeGeometry";this.parameters={shapes:n,options:t};this.fromBufferGeometry(new ii(n,t));this.mergeVertices()}function ii(n,t){typeof n!="undefined"&&(u.call(this),this.type="ExtrudeBufferGeometry",n=Array.isArray(n)?n:[n],this.addShapeList(n,t),this.computeVertexNormals())}function as(n,t){s.call(this);this.type="TextGeometry";this.parameters={text:n,parameters:t};this.fromBufferGeometry(new ue(n,t));this.mergeVertices()}function ue(n,t){var i,r;if(t=t||{},i=t.font,!(i&&i.isFont))return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new s;r=i.generateShapes(n,t.size,t.curveSegments);t.amount=t.height!==undefined?t.height:50;t.bevelThickness===undefined&&(t.bevelThickness=10);t.bevelSize===undefined&&(t.bevelSize=8);t.bevelEnabled===undefined&&(t.bevelEnabled=!1);ii.call(this,r,t);this.type="TextBufferGeometry"}function vs(n,t,i,r,u,f,e){s.call(this);this.type="SphereGeometry";this.parameters={radius:n,widthSegments:t,heightSegments:i,phiStart:r,phiLength:u,thetaStart:f,thetaLength:e};this.fromBufferGeometry(new eu(n,t,i,r,u,f,e));this.mergeVertices()}function eu(t,r,f,e,o,s,h){var k,y,w;u.call(this);this.type="SphereBufferGeometry";this.parameters={radius:t,widthSegments:r,heightSegments:f,phiStart:e,phiLength:o,thetaStart:s,thetaLength:h};t=t||1;r=Math.max(3,Math.floor(r)||8);f=Math.max(2,Math.floor(f)||6);e=e!==undefined?e:0;o=o!==undefined?o:Math.PI*2;s=s!==undefined?s:0;h=h!==undefined?h:Math.PI;for(var rt=s+h,l,ut=0,v=[],a=new n,p=new n,b=[],d=[],g=[],nt=[],c=0;c<=f;c++){for(k=[],y=c/f,l=0;l<=r;l++)w=l/r,a.x=-t*Math.cos(e+w*o)*Math.sin(s+y*h),a.y=t*Math.cos(s+y*h),a.z=t*Math.sin(e+w*o)*Math.sin(s+y*h),d.push(a.x,a.y,a.z),p.set(a.x,a.y,a.z).normalize(),g.push(p.x,p.y,p.z),nt.push(w,1-y),k.push(ut++);v.push(k)}for(c=0;c<f;c++)for(l=0;l<r;l++){var ft=v[c][l+1],tt=v[c][l],et=v[c+1][l],it=v[c+1][l+1];(c!==0||s>0)&&b.push(ft,tt,it);(c!==f-1||rt<Math.PI)&&b.push(tt,et,it)}this.setIndex(b);this.addAttribute("position",new i(d,3));this.addAttribute("normal",new i(g,3));this.addAttribute("uv",new i(nt,2))}function ys(n,t,i,r,u,f){s.call(this);this.type="RingGeometry";this.parameters={innerRadius:n,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:u,thetaLength:f};this.fromBufferGeometry(new fe(n,t,i,r,u,f));this.mergeVertices()}function fe(r,f,e,o,s,h){var g;u.call(this);this.type="RingBufferGeometry";this.parameters={innerRadius:r,outerRadius:f,thetaSegments:e,phiSegments:o,thetaStart:s,thetaLength:h};r=r||.5;f=f||1;s=s!==undefined?s:0;h=h!==undefined?h:Math.PI*2;e=e!==undefined?Math.max(3,e):8;o=o!==undefined?Math.max(1,o):1;for(var p=[],b=[],k=[],d=[],c,w=r,it=(f-r)/o,a=new n,y=new t,l,v=0;v<=o;v++){for(l=0;l<=e;l++)c=s+l/e*h,a.x=w*Math.cos(c),a.y=w*Math.sin(c),b.push(a.x,a.y,a.z),k.push(0,0,1),y.x=(a.x/f+1)/2,y.y=(a.y/f+1)/2,d.push(y.x,y.y);w+=it}for(v=0;v<o;v++)for(g=v*(e+1),l=0;l<e;l++){c=l+g;var rt=c,nt=c+e+1,ut=c+e+2,tt=c+1;p.push(rt,nt,tt);p.push(nt,ut,tt)}this.setIndex(p);this.addAttribute("position",new i(b,3));this.addAttribute("normal",new i(k,3));this.addAttribute("uv",new i(d,2))}function ps(n,t,i,r){s.call(this);this.type="LatheGeometry";this.parameters={points:n,segments:t,phiStart:i,phiLength:r};this.fromBufferGeometry(new ee(n,t,i,r));this.mergeVertices()}function ee(r,f,e,o){u.call(this);this.type="LatheBufferGeometry";this.parameters={points:r,segments:f,phiStart:e,phiLength:o};f=Math.floor(f)||12;e=e||0;o=o||Math.PI*2;o=h.clamp(o,0,Math.PI*2);for(var k=[],d=[],g=[],c,rt=1/f,v=new n,y=new t,s,l=0;l<=f;l++){var nt=e+l*rt*o,ut=Math.sin(nt),ft=Math.cos(nt);for(s=0;s<=r.length-1;s++)v.x=r[s].x*ut,v.y=r[s].y,v.z=r[s].x*ft,d.push(v.x,v.y,v.z),y.x=l/f,y.y=s/(r.length-1),g.push(y.x,y.y)}for(l=0;l<f;l++)for(s=0;s<r.length-1;s++){c=s+l*r.length;var et=c,tt=c+r.length,ot=c+r.length+1,it=c+1;k.push(et,tt,it);k.push(tt,ot,it)}if(this.setIndex(k),this.addAttribute("position",new i(d,3)),this.addAttribute("uv",new i(g,2)),this.computeVertexNormals(),o===Math.PI*2){var a=this.attributes.normal.array,p=new n,w=new n,b=new n;for(c=f*r.length*3,l=0,s=0;l<r.length;l++,s+=3)p.x=a[s+0],p.y=a[s+1],p.z=a[s+2],w.x=a[c+s+0],w.y=a[c+s+1],w.z=a[c+s+2],b.addVectors(p,w).normalize(),a[s+0]=a[c+s+0]=b.x,a[s+1]=a[c+s+1]=b.y,a[s+2]=a[c+s+2]=b.z}}function oe(n,t){s.call(this);this.type="ShapeGeometry";typeof t=="object"&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),t=t.curveSegments);this.parameters={shapes:n,curveSegments:t};this.fromBufferGeometry(new se(n,t));this.mergeVertices()}function se(n,t){function l(n){var i,r,l,v=e.length/3,w=n.extractPoints(t),u=w.shape,c=w.holes,y,a;if(gt.isClockWise(u)===!1)for(u=u.reverse(),i=0,r=c.length;i<r;i++)l=c[i],gt.isClockWise(l)===!0&&(c[i]=l.reverse());for(y=gt.triangulateShape(u,c),i=0,r=c.length;i<r;i++)l=c[i],u=u.concat(l);for(i=0,r=u.length;i<r;i++)a=u[i],e.push(a.x,a.y,0),s.push(0,0,1),h.push(a.x,a.y);for(i=0,r=y.length;i<r;i++){var p=y[i],b=p[0]+v,k=p[1]+v,d=p[2]+v;o.push(b,k,d);f+=3}}var a=this,r;u.call(this);this.type="ShapeBufferGeometry";this.parameters={shapes:n,curveSegments:t};t=t||12;var o=[],e=[],s=[],h=[],c=0,f=0;if(Array.isArray(n)===!1)l(n);else for(r=0;r<n.length;r++)l(n[r]),a.addGroup(c,f,r),c+=f,f=0;this.setIndex(o);this.addAttribute("position",new i(e,3));this.addAttribute("normal",new i(s,3));this.addAttribute("uv",new i(h,2))}function ws(n,t){var k,v,c,nt,d,y,l,r;u.call(this);this.type="EdgesGeometry";this.parameters={thresholdAngle:t};t=t!==undefined?t:1;var p=[],tt=Math.cos(h.DEG2RAD*t),e=[0,0],a={},w,b,o,g=["a","b","c"],f;for(n.isBufferGeometry?(f=new s,f.fromBufferGeometry(n)):f=n.clone(),f.mergeVertices(),f.computeFaceNormals(),k=f.vertices,v=f.faces,c=0,nt=v.length;c<nt;c++)for(d=v[c],y=0;y<3;y++)w=d[g[y]],b=d[g[(y+1)%3]],e[0]=Math.min(w,b),e[1]=Math.max(w,b),o=e[0]+","+e[1],a[o]===undefined?a[o]={index1:e[0],index2:e[1],face1:c,face2:undefined}:a[o].face2=c;for(o in a)l=a[o],(l.face2===undefined||v[l.face1].normal.dot(v[l.face2].normal)<=tt)&&(r=k[l.index1],p.push(r.x,r.y,r.z),r=k[l.index2],p.push(r.x,r.y,r.z));this.addAttribute("position",new i(p,3))}function ou(n,t,i,r,u,f,e,o){s.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:n,radiusBottom:t,height:i,radialSegments:r,heightSegments:u,openEnded:f,thetaStart:e,thetaLength:o};this.fromBufferGeometry(new wi(n,t,i,r,u,f,e,o));this.mergeVertices()}function wi(r,f,e,o,s,h,c,l){function tt(){for(var t,h=new n,u=new n,nt=0,ct=(f-r)/e,i=0;i<=s;i++){var it=[],tt=i/s,rt=tt*(f-r)+r;for(t=0;t<=o;t++){var ut=t/o,ft=ut*l+c,et=Math.sin(ft),ot=Math.cos(ft);u.x=rt*et;u.y=-tt*e+g;u.z=rt*ot;p.push(u.x,u.y,u.z);h.set(et,ct,ot).normalize();w.push(h.x,h.y,h.z);b.push(ut,1-tt);it.push(v++)}y.push(it)}for(t=0;t<o;t++)for(i=0;i<s;i++){var lt=y[i][t],st=y[i+1][t],at=y[i+1][t+1],ht=y[i][t+1];a.push(lt,st,ht);a.push(st,at,ht);nt+=6}d.addGroup(k,nt,0);k+=nt}function nt(i){for(var rt,y=new t,e=new n,nt=0,ut=i===!0?r:f,s=i===!0?1:-1,tt,h,it=v,u=1;u<=o;u++)p.push(0,g*s,0),w.push(0,s,0),b.push(.5,.5),v++;for(rt=v,u=0;u<=o;u++){var st=u/o,ft=st*l+c,et=Math.cos(ft),ot=Math.sin(ft);e.x=ut*ot;e.y=g*s;e.z=ut*et;p.push(e.x,e.y,e.z);w.push(0,s,0);y.x=et*.5+.5;y.y=ot*.5*s+.5;b.push(y.x,y.y);v++}for(u=0;u<o;u++)tt=it+u,h=rt+u,i===!0?a.push(h,h+1,tt):a.push(h+1,h,tt),nt+=3;d.addGroup(k,nt,i===!0?1:2);k+=nt}var d;u.call(this);this.type="CylinderBufferGeometry";this.parameters={radiusTop:r,radiusBottom:f,height:e,radialSegments:o,heightSegments:s,openEnded:h,thetaStart:c,thetaLength:l};d=this;r=r!==undefined?r:1;f=f!==undefined?f:1;e=e||1;o=Math.floor(o)||8;s=Math.floor(s)||1;h=h!==undefined?h:!1;c=c!==undefined?c:0;l=l!==undefined?l:Math.PI*2;var a=[],p=[],w=[],b=[],v=0,y=[],g=e/2,k=0;tt();h===!1&&(r>0&&nt(!0),f>0&&nt(!1));this.setIndex(a);this.addAttribute("position",new i(p,3));this.addAttribute("normal",new i(w,3));this.addAttribute("uv",new i(b,2))}function bs(n,t,i,r,u,f,e){ou.call(this,0,n,t,i,r,u,f,e);this.type="ConeGeometry";this.parameters={radius:n,height:t,radialSegments:i,heightSegments:r,openEnded:u,thetaStart:f,thetaLength:e}}function ks(n,t,i,r,u,f,e){wi.call(this,0,n,t,i,r,u,f,e);this.type="ConeBufferGeometry";this.parameters={radius:n,height:t,radialSegments:i,heightSegments:r,openEnded:u,thetaStart:f,thetaLength:e}}function ds(n,t,i,r){s.call(this);this.type="CircleGeometry";this.parameters={radius:n,segments:t,thetaStart:i,thetaLength:r};this.fromBufferGeometry(new he(n,t,i,r));this.mergeVertices()}function he(r,f,e,o){var p;u.call(this);this.type="CircleBufferGeometry";this.parameters={radius:r,segments:f,thetaStart:e,thetaLength:o};r=r||1;f=f!==undefined?Math.max(3,f):8;e=e!==undefined?e:0;o=o!==undefined?o:Math.PI*2;var w=[],h=[],v=[],y=[],s,l,c=new n,a=new t;for(h.push(0,0,0),v.push(0,0,1),y.push(.5,.5),l=0,s=3;l<=f;l++,s+=3)p=e+l/f*o,c.x=r*Math.cos(p),c.y=r*Math.sin(p),h.push(c.x,c.y,c.z),v.push(0,0,1),a.x=(h[s]/r+1)/2,a.y=(h[s+1]/r+1)/2,y.push(a.x,a.y);for(s=1;s<=f;s++)w.push(s,s+1,0);this.setIndex(w);this.addAttribute("position",new i(h,3));this.addAttribute("normal",new i(v,3));this.addAttribute("uv",new i(y,2))}function ce(n){l.call(this);this.type="ShadowMaterial";this.color=new f(0);this.opacity=1;this.lights=!0;this.transparent=!0;this.setValues(n)}function le(n){dt.call(this,n);this.type="RawShaderMaterial"}function si(n){l.call(this);this.defines={STANDARD:""};this.type="MeshStandardMaterial";this.color=new f(16777215);this.roughness=.5;this.metalness=.5;this.map=null;this.lightMap=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.emissive=new f(0);this.emissiveIntensity=1;this.emissiveMap=null;this.bumpMap=null;this.bumpScale=1;this.normalMap=null;this.normalScale=new t(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.setValues(n)}function su(n){si.call(this);this.defines={PHYSICAL:""};this.type="MeshPhysicalMaterial";this.reflectivity=.5;this.clearCoat=0;this.clearCoatRoughness=0;this.setValues(n)}function vt(n){l.call(this);this.type="MeshPhongMaterial";this.color=new f(16777215);this.specular=new f(1118481);this.shininess=30;this.map=null;this.lightMap=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.emissive=new f(0);this.emissiveIntensity=1;this.emissiveMap=null;this.bumpMap=null;this.bumpScale=1;this.normalMap=null;this.normalScale=new t(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.specularMap=null;this.alphaMap=null;this.envMap=null;this.combine=oo;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.morphNormals=!1;this.setValues(n)}function hu(n){vt.call(this);this.defines={TOON:""};this.type="MeshToonMaterial";this.gradientMap=null;this.setValues(n)}function er(n){l.call(this);this.type="MeshNormalMaterial";this.bumpMap=null;this.bumpScale=1;this.normalMap=null;this.normalScale=new t(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.wireframe=!1;this.wireframeLinewidth=1;this.fog=!1;this.lights=!1;this.skinning=!1;this.morphTargets=!1;this.morphNormals=!1;this.setValues(n)}function cu(n){l.call(this);this.type="MeshLambertMaterial";this.color=new f(16777215);this.map=null;this.lightMap=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.emissive=new f(0);this.emissiveIntensity=1;this.emissiveMap=null;this.specularMap=null;this.alphaMap=null;this.envMap=null;this.combine=oo;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.morphNormals=!1;this.setValues(n)}function lu(n){y.call(this);this.type="LineDashedMaterial";this.scale=1;this.dashSize=3;this.gapSize=1;this.setValues(n)}function bp(n,t,i){var r=this,e=!1,u=0,f=0,o=undefined;this.onStart=undefined;this.onLoad=n;this.onProgress=t;this.onError=i;this.itemStart=function(n){if(f++,e===!1&&r.onStart!==undefined)r.onStart(n,u,f);e=!0};this.itemEnd=function(n){if(u++,r.onProgress!==undefined)r.onProgress(n,u,f);u===f&&(e=!1,r.onLoad!==undefined&&r.onLoad())};this.itemError=function(n){if(r.onError!==undefined)r.onError(n)};this.resolveURL=function(n){return o?o(n):n};this.setURLModifier=function(n){o=n}}function ui(n){this.manager=n!==undefined?n:ft}function ett(n){this.manager=n!==undefined?n:ft;this._parser=null}function ott(n){this.manager=n!==undefined?n:ft;this._parser=null}function gs(n){this.manager=n!==undefined?n:ft}function stt(n){this.manager=n!==undefined?n:ft}function dl(n){this.manager=n!==undefined?n:ft}function k(n,t){r.call(this);this.type="Light";this.color=new f(n);this.intensity=t!==undefined?t:1;this.receiveShadow=undefined}function gl(n,t,i){k.call(this,n,i);this.type="HemisphereLight";this.castShadow=undefined;this.position.copy(r.DefaultUp);this.updateMatrix();this.groundColor=new f(t)}function au(n){this.camera=n;this.bias=0;this.radius=1;this.mapSize=new t(512,512);this.map=null;this.matrix=new o}function na(){au.call(this,new nt(50,1,.5,500))}function ta(n,t,i,u,f,e){k.call(this,n,t);this.type="SpotLight";this.position.copy(r.DefaultUp);this.updateMatrix();this.target=new r;Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(n){this.intensity=n/Math.PI}});this.distance=i!==undefined?i:0;this.angle=u!==undefined?u:Math.PI/3;this.penumbra=f!==undefined?f:0;this.decay=e!==undefined?e:1;this.shadow=new na}function nh(n,t,i,r){k.call(this,n,t);this.type="PointLight";Object.defineProperty(this,"power",{get:function(){return this.intensity*4*Math.PI},set:function(n){this.intensity=n/(4*Math.PI)}});this.distance=i!==undefined?i:0;this.decay=r!==undefined?r:1;this.shadow=new au(new nt(90,1,.5,500))}function ia(){au.call(this,new sf(-5,5,5,-5,.5,500))}function ra(n,t){k.call(this,n,t);this.type="DirectionalLight";this.position.copy(r.DefaultUp);this.updateMatrix();this.target=new r;this.shadow=new ia}function th(n,t){k.call(this,n,t);this.type="AmbientLight";this.castShadow=undefined}function ua(n,t,i,r){k.call(this,n,t);this.type="RectAreaLight";this.position.set(0,1,0);this.updateMatrix();this.width=i!==undefined?i:10;this.height=r!==undefined?r:10}function wt(n,t,i,r){this.parameterPositions=n;this._cachedIndex=0;this.resultBuffer=r!==undefined?r:new t.constructor(i);this.sampleValues=t;this.valueSize=i}function fa(n,t,i,r){wt.call(this,n,t,i,r);this._weightPrev=-0;this._offsetPrev=-0;this._weightNext=-0;this._offsetNext=-0}function ih(n,t,i,r){wt.call(this,n,t,i,r)}function ea(n,t,i,r){wt.call(this,n,t,i,r)}function or(n,t,i,r){if(n===undefined)throw new Error("track name is undefined");if(t===undefined||t.length===0)throw new Error("no keyframes in track named "+n);this.name=n;this.times=it.convertArray(t,this.TimeBufferType);this.values=it.convertArray(i,this.ValueBufferType);this.setInterpolation(r||this.DefaultInterpolation);this.validate();this.optimize()}function ve(n,t,i,r){or.call(this,n,t,i,r)}function oa(n,t,i,r){wt.call(this,n,t,i,r)}function rh(n,t,i,r){or.call(this,n,t,i,r)}function ye(n,t,i,r){or.call(this,n,t,i,r)}function sa(n,t,i,r){or.call(this,n,t,i,r)}function ha(n,t,i){or.call(this,n,t,i)}function ca(n,t,i,r){or.call(this,n,t,i,r)}function vu(n,t,i,r){or.apply(this,n,t,i,r)}function ni(n,t,i){this.name=n;this.tracks=i;this.duration=t!==undefined?t:-1;this.uuid=h.generateUUID();this.duration<0&&this.resetDuration();this.optimize()}function la(n){this.manager=n!==undefined?n:ft;this.textures={}}function kp(n){this.manager=n!==undefined?n:ft}function pe(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}}function dp(n){typeof n=="boolean"&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),n=undefined);this.manager=n!==undefined?n:ft;this.withCredentials=!1}function htt(n){this.manager=n!==undefined?n:ft;this.texturePath=""}function tw(n,t,i,r,u){var f=(r-t)*.5,e=(u-i)*.5,o=n*n,s=n*o;return(2*i-2*r+f+e)*s+(-3*i+3*r-2*f-e)*o+f*n+i}function ltt(n,t){var i=1-n;return i*i*t}function att(n,t){return 2*(1-n)*n*t}function vtt(n,t){return n*n*t}function sr(n,t,i,r){return ltt(n,t)+att(n,i)+vtt(n,r)}function ytt(n,t){var i=1-n;return i*i*i*t}function ptt(n,t){var i=1-n;return 3*i*i*n*t}function wtt(n,t){return 3*(1-n)*n*n*t}function btt(n,t){return n*n*n*t}function hr(n,t,i,r,u){return ytt(n,t)+ptt(n,i)+wtt(n,r)+btt(n,u)}function a(){this.type="Curve";this.arcLengthDivisions=200}function fi(n,i){a.call(this);this.type="LineCurve";this.v1=n||new t;this.v2=i||new t}function yu(){a.call(this);this.type="CurvePath";this.curves=[];this.autoClose=!1}function ci(n,t,i,r,u,f,e,o){a.call(this);this.type="EllipseCurve";this.aX=n||0;this.aY=t||0;this.xRadius=i||1;this.yRadius=r||1;this.aStartAngle=u||0;this.aEndAngle=f||2*Math.PI;this.aClockwise=e||!1;this.aRotation=o||0}function cr(n){a.call(this);this.type="SplineCurve";this.points=n||[]}function lr(n,i,r,u){a.call(this);this.type="CubicBezierCurve";this.v0=n||new t;this.v1=i||new t;this.v2=r||new t;this.v3=u||new t}function ar(n,i,r){a.call(this);this.type="QuadraticBezierCurve";this.v0=n||new t;this.v1=i||new t;this.v2=r||new t}function pu(n){yu.call(this);this.type="Path";this.currentPoint=new t;n&&this.setFromPoints(n)}function wu(n){pu.call(this,n);this.type="Shape";this.holes=[]}function iw(){this.type="ShapePath";this.subPaths=[];this.currentPath=null}function rw(n){this.type="Font";this.data=n}function ktt(n){this.manager=n!==undefined?n:ft}function uw(n){this.manager=n!==undefined?n:ft}function dtt(){this.type="StereoCamera";this.aspect=1;this.eyeSep=.064;this.cameraL=new nt;this.cameraL.layers.enable(1);this.cameraL.matrixAutoUpdate=!1;this.cameraR=new nt;this.cameraR.layers.enable(2);this.cameraR.matrixAutoUpdate=!1}function eh(t,i,u){var o,s,h,c,l,v;r.call(this);this.type="CubeCamera";var f=90,e=1,a=new nt(f,e,t,i);a.up.set(0,-1,0);a.lookAt(new n(1,0,0));this.add(a);o=new nt(f,e,t,i);o.up.set(0,-1,0);o.lookAt(new n(-1,0,0));this.add(o);s=new nt(f,e,t,i);s.up.set(0,0,1);s.lookAt(new n(0,1,0));this.add(s);h=new nt(f,e,t,i);h.up.set(0,0,-1);h.lookAt(new n(0,-1,0));this.add(h);c=new nt(f,e,t,i);c.up.set(0,-1,0);c.lookAt(new n(0,0,1));this.add(c);l=new nt(f,e,t,i);l.up.set(0,-1,0);l.lookAt(new n(0,0,-1));this.add(l);v={format:uf,magFilter:et,minFilter:et};this.renderTarget=new of(u,u,v);this.renderTarget.texture.name="CubeCamera";this.update=function(n,t){this.parent===null&&this.updateMatrixWorld();var i=this.renderTarget,r=i.texture.generateMipmaps;i.texture.generateMipmaps=!1;i.activeCubeFace=0;n.render(t,a,i);i.activeCubeFace=1;n.render(t,o,i);i.activeCubeFace=2;n.render(t,s,i);i.activeCubeFace=3;n.render(t,h,i);i.activeCubeFace=4;n.render(t,c,i);i.texture.generateMipmaps=r;i.activeCubeFace=5;n.render(t,l,i);n.setRenderTarget(null)};this.clear=function(n,t,i,r){for(var f=this.renderTarget,u=0;u<6;u++)f.activeCubeFace=u,n.setRenderTarget(f),n.clear(t,i,r);n.setRenderTarget(null)}}function fw(){r.call(this);this.type="AudioListener";this.context=va.getContext();this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.filter=null}function we(n){r.call(this);this.type="Audio";this.context=n.context;this.gain=this.context.createGain();this.gain.connect(n.getInput());this.autoplay=!1;this.buffer=null;this.loop=!1;this.startTime=0;this.offset=0;this.playbackRate=1;this.isPlaying=!1;this.hasPlaybackControl=!0;this.sourceType="empty";this.filters=[]}function ew(n){we.call(this,n);this.panner=this.context.createPanner();this.panner.connect(this.gain)}function ow(n,t){this.analyser=n.context.createAnalyser();this.analyser.fftSize=t!==undefined?t:2048;this.data=new Uint8Array(this.analyser.frequencyBinCount);n.getOutput().connect(this.analyser)}function sw(n,t,i){this.binding=n;this.valueSize=i;var u=Float64Array,r;switch(t){case"quaternion":r=this._slerp;break;case"string":case"bool":u=Array;r=this._select;break;default:r=this._lerp}this.buffer=new u(i*4);this._mixBufferRegion=r;this.cumulativeWeight=0;this.useCount=0;this.referenceCount=0}function hw(n,t,i){var r=i||rt.parseTrackName(t);this._targetGroup=n;this._bindings=n.subscribe_(t,r)}function rt(n,t,i){this.path=t;this.parsedPath=i||rt.parseTrackName(t);this.node=rt.findNode(n,this.parsedPath.nodeName)||n;this.rootNode=n}function gtt(){var u=arguments,i,n,r,t;for(this.uuid=h.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0,i={},this._indicesByUUID=i,n=0,r=arguments.length;n!==r;++n)i[u[n].uuid]=n;this._paths=[];this._parsedPaths=[];this._bindings=[];this._bindingsIndicesByPath={};t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}function cw(n,t,i){var r,f;this._mixer=n;this._clip=t;this._localRoot=i||null;var e=t.tracks,u=e.length,o=new Array(u),s={endingStart:kr,endingEnd:kr};for(r=0;r!==u;++r)f=e[r].createInterpolant(null),o[r]=f,f.settings=s;this._interpolantSettings=s;this._interpolants=o;this._propertyBindings=new Array(u);this._cacheIndex=null;this._byClipCacheIndex=null;this._timeScaleInterpolant=null;this._weightInterpolant=null;this.loop=nd;this._loopCount=-1;this._startTime=null;this.time=0;this.timeScale=1;this._effectiveTimeScale=1;this.weight=1;this._effectiveWeight=1;this.repetitions=Infinity;this.paused=!1;this.enabled=!0;this.clampWhenFinished=!1;this.zeroSlopeAtStart=!0;this.zeroSlopeAtEnd=!0}function nit(n){this._root=n;this._initMemoryManager();this._accuIndex=0;this.time=0;this.timeScale=1}function ya(n){typeof n=="string"&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),n=arguments[1]);this.value=n}function lw(){u.call(this);this.type="InstancedBufferGeometry";this.maxInstancedCount=undefined}function aw(n,t,i,r){this.uuid=h.generateUUID();this.data=n;this.itemSize=t;this.offset=i;this.normalized=r===!0}function be(n,t){this.uuid=h.generateUUID();this.array=n;this.stride=t;this.count=n!==undefined?n.length/t:0;this.dynamic=!1;this.updateRange={offset:0,count:-1};this.onUploadCallback=function(){};this.version=0}function vw(n,t,i){be.call(this,n,t);this.meshPerAttribute=i||1}function yw(n,t,i){c.call(this,n,t);this.meshPerAttribute=i||1}function pw(n,t,i,r){this.ray=new uu(n,t);this.near=i||0;this.far=r||Infinity;this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}};Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function ww(n,t){return n.distance-t.distance}function pa(n,t,i,r){var f,u,e;if(n.visible!==!1&&(n.raycast(t,i),r===!0))for(f=n.children,u=0,e=f.length;u<e;u++)pa(f[u],t,i,!0)}function tit(n){this.autoStart=n!==undefined?n:!0;this.startTime=0;this.oldTime=0;this.elapsedTime=0;this.running=!1}function iit(n,t,i){return this.radius=n!==undefined?n:1,this.phi=t!==undefined?t:0,this.theta=i!==undefined?i:0,this}function rit(n,t,i){return this.radius=n!==undefined?n:1,this.theta=t!==undefined?t:0,this.y=i!==undefined?i:0,this}function oh(n){r.call(this);this.material=n;this.render=function(){}}function sh(n,t,r,f){var s,h;this.object=n;this.size=t!==undefined?t:1;var c=r!==undefined?r:16711680,l=f!==undefined?f:1,o=0,e=this.object.geometry;e&&e.isGeometry?o=e.faces.length*3:e&&e.isBufferGeometry&&(o=e.attributes.normal.count);s=new u;h=new i(o*6,3);s.addAttribute("position",h);w.call(this,s,new y({color:c,linewidth:l}));this.matrixAutoUpdate=!1;this.update()}function ke(n,t){var f,e,h,c,a;r.call(this);this.light=n;this.light.updateMatrixWorld();this.matrix=n.matrixWorld;this.matrixAutoUpdate=!1;this.color=t;f=new u;e=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(var o=0,l=1,s=32;o<s;o++,l++)h=o/s*Math.PI*2,c=l/s*Math.PI*2,e.push(Math.cos(h),Math.sin(h),1,Math.cos(c),Math.sin(c),1);f.addAttribute("position",new i(e,3));a=new y({fog:!1});this.cone=new w(f,a);this.add(this.cone);this.update()}function bw(n){var t=[],i;for(n&&n.isBone&&t.push(n),i=0;i<n.children.length;i++)t.push.apply(t,bw(n.children[i]));return t}function de(n){for(var r=bw(n),e=new u,o=[],s=[],h=new f(0,0,1),c=new f(0,1,0),l,a,t=0;t<r.length;t++)l=r[t],l.parent&&l.parent.isBone&&(o.push(0,0,0),o.push(0,0,0),s.push(h.r,h.g,h.b),s.push(c.r,c.g,c.b));e.addAttribute("position",new i(o,3));e.addAttribute("color",new i(s,3));a=new y({vertexColors:pr,depthTest:!1,depthWrite:!1,transparent:!0});w.call(this,e,a);this.root=n;this.bones=r;this.matrix=n.matrixWorld;this.matrixAutoUpdate=!1}function ge(n,t,i){this.light=n;this.light.updateMatrixWorld();this.color=i;var r=new eu(t,4,2),u=new ht({wireframe:!0,fog:!1});tt.call(this,r,u);this.matrix=this.light.matrixWorld;this.matrixAutoUpdate=!1;this.update()}function no(n,t){r.call(this);this.light=n;this.light.updateMatrixWorld();this.matrix=n.matrixWorld;this.matrixAutoUpdate=!1;this.color=t;var f=new y({fog:!1}),i=new u;i.addAttribute("position",new c(new Float32Array(15),3));this.line=new ct(i,f);this.add(this.line);this.update()}function to(n,t,i){var u,f,e;r.call(this);this.light=n;this.light.updateMatrixWorld();this.matrix=n.matrixWorld;this.matrixAutoUpdate=!1;this.color=i;u=new fu(t);u.rotateY(Math.PI*.5);this.material=new ht({wireframe:!0,fog:!1});this.color===undefined&&(this.material.vertexColors=pr);f=u.getAttribute("position");e=new Float32Array(f.count*3);u.addAttribute("color",new c(e,3));this.add(new tt(u,this.material));this.update()}function hh(n,t,r,e){var l,a,b;n=n||10;t=t||10;r=new f(r!==undefined?r:4473924);e=new f(e!==undefined?e:8947848);for(var k=t/2,d=n/t,s=n/2,v=[],h=[],p=0,o=0,c=-s;p<=t;p++,c+=d)v.push(-s,0,c,s,0,c),v.push(c,0,-s,c,0,s),l=p===k?r:e,l.toArray(h,o),o+=3,l.toArray(h,o),o+=3,l.toArray(h,o),o+=3,l.toArray(h,o),o+=3;a=new u;a.addAttribute("position",new i(v,3));a.addAttribute("color",new i(h,3));b=new y({vertexColors:pr});w.call(this,a,b)}function wa(n,t,r,e,o,s){var a,v,p,b,l,c,k,d,h,g,nt;for(n=n||10,t=t||16,r=r||8,e=e||64,o=new f(o!==undefined?o:4473924),s=new f(s!==undefined?s:8947848),a=[],v=[],c=0;c<=t;c++)l=c/t*Math.PI*2,p=Math.sin(l)*n,b=Math.cos(l)*n,a.push(0,0,0),a.push(p,0,b),h=c&1?o:s,v.push(h.r,h.g,h.b),v.push(h.r,h.g,h.b);for(c=0;c<=r;c++)for(h=c&1?o:s,d=n-n/r*c,k=0;k<e;k++)l=k/e*Math.PI*2,p=Math.sin(l)*d,b=Math.cos(l)*d,a.push(p,0,b),v.push(h.r,h.g,h.b),l=(k+1)/e*Math.PI*2,p=Math.sin(l)*d,b=Math.cos(l)*d,a.push(p,0,b),v.push(h.r,h.g,h.b);g=new u;g.addAttribute("position",new i(a,3));g.addAttribute("color",new i(v,3));nt=new y({vertexColors:pr});w.call(this,g,nt)}function ch(n,t,r,f){var o,h;this.object=n;this.size=t!==undefined?t:1;var c=r!==undefined?r:16776960,l=f!==undefined?f:1,s=0,e=this.object.geometry;e&&e.isGeometry?s=e.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");o=new u;h=new i(s*6,3);o.addAttribute("position",h);w.call(this,o,new y({color:c,linewidth:l}));this.matrixAutoUpdate=!1;this.update()}function io(n,t,f){var e,o;r.call(this);this.light=n;this.light.updateMatrixWorld();this.matrix=n.matrixWorld;this.matrixAutoUpdate=!1;this.color=f;t===undefined&&(t=1);e=new u;e.addAttribute("position",new i([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));o=new y({fog:!1});this.lightPlane=new ct(e,o);this.add(this.lightPlane);e=new u;e.addAttribute("position",new i([0,0,0,0,0,1],3));this.targetLine=new ct(e,o);this.add(this.targetLine);this.update()}function lh(n){function t(n,t,i){v(n,i);v(t,i)}function v(n,t){c.push(0,0,0);a.push(t.r,t.g,t.b);o[n]===undefined&&(o[n]=[]);o[n].push(c.length/3-1)}var h=new u,p=new y({color:16777215,vertexColors:sv}),c=[],a=[],o={},r=new f(16755200),s=new f(16711680),l=new f(43775),b=new f(16777215),e=new f(3355443);t("n1","n2",r);t("n2","n4",r);t("n4","n3",r);t("n3","n1",r);t("f1","f2",r);t("f2","f4",r);t("f4","f3",r);t("f3","f1",r);t("n1","f1",r);t("n2","f2",r);t("n3","f3",r);t("n4","f4",r);t("p","n1",s);t("p","n2",s);t("p","n3",s);t("p","n4",s);t("u1","u2",l);t("u2","u3",l);t("u3","u1",l);t("c","t",b);t("p","c",e);t("cn1","cn2",e);t("cn3","cn4",e);t("cf1","cf2",e);t("cf3","cf4",e);h.addAttribute("position",new i(c,3));h.addAttribute("color",new i(a,3));w.call(this,h,p);this.camera=n;this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix();this.matrix=n.matrixWorld;this.matrixAutoUpdate=!1;this.pointMap=o;this.update()}function ro(n,t){this.object=n;t===undefined&&(t=16776960);var r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),f=new Float32Array(24),i=new u;i.setIndex(new c(r,1));i.addAttribute("position",new c(f,3));w.call(this,i,new y({color:t}));this.matrixAutoUpdate=!1;this.update()}function ah(n,t){this.type="Box3Helper";this.box=n;var f=t!==undefined?t:16776960,e=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new u;r.setIndex(new c(e,1));r.addAttribute("position",new i([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3));w.call(this,r,new y({color:f}));this.geometry.computeBoundingSphere()}function vh(n,t,r){var s,f;this.type="PlaneHelper";this.plane=n;this.size=t===undefined?1:t;var o=r!==undefined?r:16776960,e=new u;e.addAttribute("position",new i([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3));e.computeBoundingSphere();ct.call(this,e,new y({color:o}));s=[1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1];f=new u;f.addAttribute("position",new i(s,3));f.computeBoundingSphere();this.add(new tt(f,new ht({color:o,opacity:.2,transparent:!0,depthWrite:!1})))}function bu(n,t,f,e,o,s){r.call(this);e===undefined&&(e=16776960);f===undefined&&(f=1);o===undefined&&(o=.2*f);s===undefined&&(s=.2*o);yh===undefined&&(yh=new u,yh.addAttribute("position",new i([0,0,0,0,1,0],3)),ba=new wi(0,.5,1,5,1),ba.translate(0,-.5,0));this.position.copy(t);this.line=new ct(yh,new y({color:e}));this.line.matrixAutoUpdate=!1;this.add(this.line);this.cone=new tt(ba,new ht({color:e}));this.cone.matrixAutoUpdate=!1;this.add(this.cone);this.setDirection(n);this.setLength(f,o,s)}function ka(n){var r;n=n||1;var f=[0,0,0,n,0,0,0,0,0,0,n,0,0,0,0,0,0,n],t=new u;t.addAttribute("position",new i(f,3));t.addAttribute("color",new i([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));r=new y({vertexColors:pr});w.call(this,t,r)}function da(){function u(u,f,e,o){n=u;t=e;i=-3*u+3*f-2*e-o;r=2*u-2*f+e+o}var n=0,t=0,i=0,r=0;return{initCatmullRom:function(n,t,i,r,f){u(t,i,f*(i-n),f*(r-t))},initNonuniformCatmullRom:function(n,t,i,r,f,e,o){var s=(t-n)/f-(i-n)/(f+e)+(i-t)/e,h=(i-t)/e-(r-t)/(e+o)+(r-i)/o;s*=e;h*=e;u(t,i,s,h)},calc:function(u){var f=u*u,e=f*u;return n+t*u+i*f+r*e}}}function bi(n,t,i,r){a.call(this);this.type="CatmullRomCurve3";this.points=n||[];this.closed=t||!1;this.curveType=i||"centripetal";this.tension=r||.5}function ku(t,i,r,u){a.call(this);this.type="CubicBezierCurve3";this.v0=t||new n;this.v1=i||new n;this.v2=r||new n;this.v3=u||new n}function du(t,i,r){a.call(this);this.type="QuadraticBezierCurve3";this.v0=t||new n;this.v1=i||new n;this.v2=r||new n}function vr(t,i){a.call(this);this.type="LineCurve3";this.v1=t||new n;this.v2=i||new n}function wh(n,t,i,r,u,f){ci.call(this,n,t,i,i,r,u,f);this.type="ArcCurve"}function kw(n){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead.");bi.call(this,n);this.type="catmullrom"}function uit(){return new iv}function sit(){var n={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materialLibraries:[],startObject:function(n,t){var i,r;if(this.object&&this.object.fromDeclaration===!1){this.object.name=n;this.object.fromDeclaration=t!==!1;return}i=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():undefined;this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0);this.object={name:n||"",fromDeclaration:t!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[]},materials:[],smooth:!0,startMaterial:function(n,t){var i=this._finalize(!1),r;return i&&(i.inherited||i.groupCount<=0)&&this.materials.splice(i.index,1),r={index:this.materials.length,name:n||"",mtllib:Array.isArray(t)&&t.length>0?t[t.length-1]:"",smooth:i!==undefined?i.smooth:this.smooth,groupStart:i!==undefined?i.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(n){var t={index:typeof n=="number"?n:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}},this.materials.push(r),r},currentMaterial:function(){return this.materials.length>0?this.materials[this.materials.length-1]:undefined},_finalize:function(n){var r=this,t=this.currentMaterial(),i;if(t&&t.groupEnd===-1&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),n&&this.materials.length>1)for(i=this.materials.length-1;i>=0;i--)r.materials[i].groupCount<=0&&r.materials.splice(i,1);return n&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),t}};i&&i.name&&typeof i.clone=="function"&&(r=i.clone(0),r.inherited=!0,this.object.materials.push(r));this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(n,t){var i=parseInt(n,10);return(i>=0?i-1:i+t/3)*3},parseNormalIndex:function(n,t){var i=parseInt(n,10);return(i>=0?i-1:i+t/3)*3},parseUVIndex:function(n,t){var i=parseInt(n,10);return(i>=0?i-1:i+t/2)*2},addVertex:function(n,t,i){var r=this.vertices,u=this.object.geometry.vertices;u.push(r[n+0],r[n+1],r[n+2]);u.push(r[t+0],r[t+1],r[t+2]);u.push(r[i+0],r[i+1],r[i+2])},addVertexLine:function(n){var t=this.vertices,i=this.object.geometry.vertices;i.push(t[n+0],t[n+1],t[n+2])},addNormal:function(n,t,i){var r=this.normals,u=this.object.geometry.normals;u.push(r[n+0],r[n+1],r[n+2]);u.push(r[t+0],r[t+1],r[t+2]);u.push(r[i+0],r[i+1],r[i+2])},addColor:function(n,t,i){var r=this.colors,u=this.object.geometry.colors;u.push(r[n+0],r[n+1],r[n+2]);u.push(r[t+0],r[t+1],r[t+2]);u.push(r[i+0],r[i+1],r[i+2])},addUV:function(n,t,i){var r=this.uvs,u=this.object.geometry.uvs;u.push(r[n+0],r[n+1]);u.push(r[t+0],r[t+1]);u.push(r[i+0],r[i+1])},addUVLine:function(n){var t=this.uvs,i=this.object.geometry.uvs;i.push(t[n+0],t[n+1])},addFace:function(n,t,i,r,u,f,e,o,s){var y=this.vertices.length,h=this.parseVertexIndex(n,y),c=this.parseVertexIndex(t,y),l=this.parseVertexIndex(i,y),a,v;this.addVertex(h,c,l);r!==undefined&&(a=this.uvs.length,h=this.parseUVIndex(r,a),c=this.parseUVIndex(u,a),l=this.parseUVIndex(f,a),this.addUV(h,c,l));e!==undefined&&(v=this.normals.length,h=this.parseNormalIndex(e,v),c=e===o?h:this.parseNormalIndex(o,v),l=e===s?h:this.parseNormalIndex(s,v),this.addNormal(h,c,l));this.colors.length>0&&this.addColor(h,c,l)},addLineGeometry:function(n,t){var r=this,e,o,u,f,i;for(this.object.geometry.type="Line",e=this.vertices.length,o=this.uvs.length,u=0,i=n.length;u<i;u++)r.addVertexLine(r.parseVertexIndex(n[u],e));for(f=0,i=t.length;f<i;f++)r.addUVLine(r.parseUVIndex(t[f],o))}};return n.startObject("",!1),n}function iv(n){this.manager=n!==undefined?n:ft;this.materials=null}function git(n,t){return new d(n,t)}function d(n,t){this.objects=[];this.setConfig(t);this.setRenderer(n,this.config);this.setScene(this.config);this._transparentMaterial=null;this.needsRender=!0;this.animate=this.animate.bind(this);this._animationRequest=null;this.width=0;this.height=0;this.resetSize();this.isVisible=!0;this.setVisible(this.isVisible);this.config.animate&&this.animate()}function dw(n){return new Promise(function(t,i){var r=document.createElement("img");r.onload=function(){t(r);r=null};r.onerror=function(n){i(n);r=null};r.src=n})}function nrt(n){return new kh(n)}function kh(n){this.setConfig(n)}function dh(t,r,f,e){function b(){var r,o=new u,i=[],s=new n,p=new n,b,d,k,f;if(t.geometry.isGeometry?o.fromGeometry(t.geometry):o.copy(t.geometry),b=o.attributes.position,d=o.attributes.normal,o.index!==null)for(k=o.index,r=0;r<k.count;r++)s.fromBufferAttribute(b,k.getX(r)),p.fromBufferAttribute(d,k.getX(r)),w(i,s,p);else for(r=0;r<b.count;r++)s.fromBufferAttribute(b,r),p.fromBufferAttribute(d,r),w(i,s,p);for(i=c(i,h.set(1,0,0)),i=c(i,h.set(-1,0,0)),i=c(i,h.set(0,1,0)),i=c(i,h.set(0,-1,0)),i=c(i,h.set(0,0,1)),i=c(i,h.set(0,0,-1)),r=0;r<i.length;r++)f=i[r],y.push(.5+f.position.x/e.x,.5+f.position.y/e.y),f.position.applyMatrix4(l),a.push(f.position.x,f.position.y,f.position.z),v.push(f.normal.x,f.normal.y,f.normal.z)}function w(n,i,r){i.applyMatrix4(t.matrix);i.applyMatrix4(p);n.push(new gh(i.clone(),r.clone()))}function c(n,t){for(var r=[],o=.5*Math.abs(e.dot(t)),i=0;i<n.length;i+=3){var l,a,v,y=0,u,f,h,c,p=n[i+0].position.dot(t)-o,w=n[i+1].position.dot(t)-o,b=n[i+2].position.dot(t)-o;l=p>0;a=w>0;v=b>0;y=(l?1:0)+(a?1:0)+(v?1:0);switch(y){case 0:r.push(n[i]);r.push(n[i+1]);r.push(n[i+2]);break;case 1:if(l&&(u=n[i+1],f=n[i+2],h=s(n[i],u,t,o),c=s(n[i],f,t,o)),a){u=n[i];f=n[i+2];h=s(n[i+1],u,t,o);c=s(n[i+1],f,t,o);r.push(h);r.push(f.clone());r.push(u.clone());r.push(f.clone());r.push(h.clone());r.push(c);break}v&&(u=n[i],f=n[i+1],h=s(n[i+2],u,t,o),c=s(n[i+2],f,t,o));r.push(u.clone());r.push(f.clone());r.push(h);r.push(c);r.push(h.clone());r.push(f.clone());break;case 2:l||(u=n[i].clone(),f=s(u,n[i+1],t,o),h=s(u,n[i+2],t,o),r.push(u),r.push(f),r.push(h));a||(u=n[i+1].clone(),f=s(u,n[i+2],t,o),h=s(u,n[i],t,o),r.push(u),r.push(f),r.push(h));v||(u=n[i+2].clone(),f=s(u,n[i],t,o),h=s(u,n[i+1],t,o),r.push(u),r.push(f),r.push(h))}}return r}function s(t,i,r,u){var e=t.position.dot(r)-u,o=i.position.dot(r)-u,f=e/(e-o);return new gh(new n(t.position.x+f*(i.position.x-t.position.x),t.position.y+f*(i.position.y-t.position.y),t.position.z+f*(i.position.z-t.position.z)),new n(t.normal.x+f*(i.normal.x-t.normal.x),t.normal.y+f*(i.normal.y-t.normal.y),t.normal.z+f*(i.normal.z-t.normal.z)))}var p;u.call(this);this.type="DecalGeometry";var a=[],v=[],y=[],h=new n,l=new o;l.makeRotationFromEuler(f);l.setPosition(r);p=(new o).getInverse(l);b();this.addAttribute("position",new i(a,3));this.addAttribute("normal",new i(v,3));this.addAttribute("uv",new i(y,2))}function gh(n,t){this.position=n;this.normal=t}function ut(n){this.dots=[];this.setConfig(n)}function frt(n){if(!trt(n))return new f(n);var t=n.map(ert),r=t[0],u=t[1],e=t[2],o=t[3],i=new f(r,u,e);return i.alpha=o||1,i}function ert(n){return n>1?n/irt:n}function crt(n){return new uo(n)}function uo(t){var i=this;this.setConfig(t);ut.call(this,this.config);this.ready=new Promise(function(n,t){var r=new dl;i.decalTexture=r.load(i.config.textureURL,n,null,function(n){return t(n.statusText||"Decal texture load error")})});this.decalMaterial=new vt({specular:srt,map:this.decalTexture,shininess:this.config.dotShininess||nb,transparent:!0,depthTest:!0,depthWrite:!1,polygonOffset:!0,polygonOffsetFactor:hrt,wireframe:!1,blending:uc,blendSrc:pv,blendDst:fc});this._intersection={intersects:!1,point:new n,normal:new n};this._position=new n;this._orientation=new yi;this._size=new n(1,1,1);this._mouseHelper=null}function lrt(n){return new fo(n)}function fo(n,t){this.config=Object.assign({debug:console.log.bind(console)},t);this.url=n;this.retries=nc;this.socket=null;this.ready=n?this.open(n):null}function vrt(n){return new tc(n)}function tc(n){var t=this;this.error=null;this.img=null;this.domElement=null;this.x=0;this.y=0;this.h=uv;this.url=n;this._onWidgetResize=null;this.ready=dw(this.url).then(function(n){return t.img=n,n.setAttribute("class","packshot"),n.style.position="absolute",n.style.pointerEvents="none",n.style.left="50%",n.style.zIndex="5",t.img}).catch(function(n){t.error=n})}function yrt(n){var t=0;return function(i){return i===undefined?t+=1:t=Number(i),n(t),t}}function prt(n){return new yr(n)}function yr(n){this.wait=n.wait||0;this.set(this.wait);this.domElement=document.createElement("div");this.domElement.setAttribute("class","limiter");var t=this.domElement.style;t.position="absolute";t.pointerEvents="none";t.left="0";t.bottom="0";t.width="100%";t.transform="scale(1, 1)";t.transition="transform 0.4s linear";t.zIndex="5";t.backgroundColor="#009a4a"}function wrt(n,t){var i=null;return t<=0?n:function(){clearTimeout(i);i=setTimeout(n,t)}}function brt(n,t){var i=null,r=!1,u;return t<=0?n:function(f){if(i){r=!0;u=f;return}n(f);i=setTimeout(function(){i=null;r&&(r=!1,n(u),u=undefined)},t)}}function krt(n,t,i){return i===void 0&&(i=0),new Promise(function(r,u){var e,f=function(i){console.log(this);e&&clearTimeout(e);t.removeEventListener(n,f);f=null;r(i)};i>0&&(e=setTimeout(function(){t.removeEventListener(n,f);f=null;u(new Error("Timeout while waiting for: "+n))},i));t.addEventListener(n,f)})}function iut(n){return new ei(n)}function ei(n){if(typeof document!="object")return null;this.version="20171212140505";this.setConfig(n);this.config.debug&&this.config.debug("DotPaintWidget v"+this.version);this._unconfirmedDots=[];var t=[this.setBox(this.config),this.setPainter({textureURL:this.config.dotURL}),this.setDotLimiter(this.config),this.setMessenger(this.config),this.setDotCounter(this.config),this.setPackshot(this.config)];this.total=0;this.ready=Promise.all(t)}function rut(n){if(!n||!n.host)return null;var t="wss://";return n.protocol==="http:"&&(t="ws://"),t+n.host}function uut(n){var t=this,i=this.box&&this.box.renderer.domElement.getBoundingClientRect(),r=null,u=null,f,e,o;if(!i)throw new Error("Could not paint: box is missing");if(f=this.dotLimiter.check(),f){this.dispatchEvent({type:"dot:limit",wait:f});return}e=rb?window.pageXOffset:ub?document.documentElement.scrollLeft:document.body.scrollLeft;o=rb?window.pageYOffset:ub?document.documentElement.scrollTop:document.body.scrollTop;n.changedTouches?(r=n.changedTouches[0].pageX-i.left-e,u=n.changedTouches[0].pageY-i.top-o):(r=n.pageX-i.left-e,u=n.pageY-i.top-o);this.painter.ready.then(function(){return t.painter.paint(t.box,{x:r,y:u})}).then(function(n){return n?t.messenger?(t._unconfirmedDots.push(n),t.messenger.send({type:"dot",x:n.x,y:n.y,c:n.colorIndex,s:n.size})):(t.dotCounter(),null):null}).catch(function(n){t.config.debug&&t.config.debug(n);t.dispatchEvent({type:"dot:error",message:n.message||n})})}function fut(n){n.detail>1&&n.preventDefault()}var ly,dc,gc,po,ip,rp,ep,op,hp,lp,gt,at,wp,ae,ft,ri,it,hi,aa,uh,fh,va,yh,ba,uv,ib;Number.EPSILON===undefined&&(Number.EPSILON=Math.pow(2,-52));Number.isInteger===undefined&&(Number.isInteger=function(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n});Math.sign===undefined&&(Math.sign=function(n){return n<0?-1:n>0?1:+n});"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}});Object.assign===undefined&&function(){Object.assign=function(n){var f=arguments,u,i,t,r;if(n===undefined||n===null)throw new TypeError("Cannot convert undefined or null to object");for(u=Object(n),i=1;i<arguments.length;i++)if(t=f[i],t!==undefined&&t!==null)for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&(u[r]=t[r]);return u}}();Object.assign(bt.prototype,{addEventListener:function(n,t){this._listeners===undefined&&(this._listeners={});var i=this._listeners;i[n]===undefined&&(i[n]=[]);i[n].indexOf(t)===-1&&i[n].push(t)},hasEventListener:function(n,t){if(this._listeners===undefined)return!1;var i=this._listeners;return i[n]!==undefined&&i[n].indexOf(t)!==-1},removeEventListener:function(n,t){var u,i,r;this._listeners!==undefined&&(u=this._listeners,i=u[n],i!==undefined&&(r=i.indexOf(t),r!==-1&&i.splice(r,1)))},dispatchEvent:function(n){var e=this,u,i,r,t,f;if(this._listeners!==undefined&&(u=this._listeners,i=u[n.type],i!==undefined))for(n.target=this,r=i.slice(0),t=0,f=r.length;t<f;t++)r[t].call(e,n)}});var fb="88",eb=0,eo=1,fv=2,ob=0,ev=1,sb=2,gu=0,ki=1,nf=2,ov=1,ic=0,sv=1,pr=2,rc=0,tf=1,hv=2,cv=3,lv=4,uc=5,av=100,hb=101,cb=102,vv=103,yv=104,lb=200,pv=201,ab=202,vb=203,wv=204,fc=205,yb=206,pb=207,wb=208,bb=209,kb=210,db=0,gb=1,nk=2,ec=3,tk=4,ik=5,rk=6,uk=7,oo=0,fk=1,ek=2,oc=0,bv=1,ok=2,sk=3,hk=4,sc=300,hc=301,cc=302,kv=303,lc=304,dv=305,ac=306,vc=307,li=1e3,yt=1001,wr=1002,pt=1003,yc=1004,pc=1005,et=1006,gv=1007,so=1008,wc=1009,ck=1010,lk=1011,ho=1012,ak=1013,ny=1014,rf=1015,bc=1016,vk=1017,yk=1018,pk=1019,co=1020,wk=1021,uf=1022,ai=1023,bk=1024,kk=1025,br=1026,ff=1027,ty=2001,iy=2002,ry=2003,uy=2004,fy=2100,ey=2101,oy=2102,sy=2103,dk=2151,gk=2200,nd=2201,td=2202,lo=2300,ao=2301,kc=2302,kr=2400,dr=2401,vo=2402,hy=0,id=1,rd=2,yo=3e3,ud=3001,cy=3007,fd=3002,ed=3004,od=3005,sd=3006,hd=3200,cd=3201,h={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=0,t;return function(){for(var u="",r=0;r<36;r++)r===8||r===13||r===18||r===23?u+="-":r===14?u+="4":(n<=2&&(n=33554432+Math.random()*16777216|0),t=n&15,n=n>>4,u+=i[r===19?t&3|8:t]);return u}}(),clamp:function(n,t,i){return Math.max(t,Math.min(i,n))},euclideanModulo:function(n,t){return(n%t+t)%t},mapLinear:function(n,t,i,r,u){return r+(n-t)*(u-r)/(i-t)},lerp:function(n,t,i){return(1-i)*n+i*t},smoothstep:function(n,t,i){return n<=t?0:n>=i?1:(n=(n-t)/(i-t),n*n*(3-2*n))},smootherstep:function(n,t,i){return n<=t?0:n>=i?1:(n=(n-t)/(i-t),n*n*n*(n*(n*6-15)+10))},randInt:function(n,t){return n+Math.floor(Math.random()*(t-n+1))},randFloat:function(n,t){return n+Math.random()*(t-n)},randFloatSpread:function(n){return n*(.5-Math.random())},degToRad:function(n){return n*h.DEG2RAD},radToDeg:function(n){return n*h.RAD2DEG},isPowerOfTwo:function(n){return(n&n-1)==0&&n!==0},ceilPowerOfTwo:function(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))},floorPowerOfTwo:function(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}};Object.defineProperties(t.prototype,{width:{get:function(){return this.x},set:function(n){this.x=n}},height:{get:function(){return this.y},set:function(n){this.y=n}}});Object.assign(t.prototype,{isVector2:!0,set:function(n,t){return this.x=n,this.y=t,this},setScalar:function(n){return this.x=n,this.y=n,this},setX:function(n){return this.x=n,this},setY:function(n){return this.y=n,this},setComponent:function(n,t){switch(n){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+n);}return this},getComponent:function(n){switch(n){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+n);}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(n){return this.x=n.x,this.y=n.y,this},add:function(n,t){return t!==undefined?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(n,t)):(this.x+=n.x,this.y+=n.y,this)},addScalar:function(n){return this.x+=n,this.y+=n,this},addVectors:function(n,t){return this.x=n.x+t.x,this.y=n.y+t.y,this},addScaledVector:function(n,t){return this.x+=n.x*t,this.y+=n.y*t,this},sub:function(n,t){return t!==undefined?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(n,t)):(this.x-=n.x,this.y-=n.y,this)},subScalar:function(n){return this.x-=n,this.y-=n,this},subVectors:function(n,t){return this.x=n.x-t.x,this.y=n.y-t.y,this},multiply:function(n){return this.x*=n.x,this.y*=n.y,this},multiplyScalar:function(n){return this.x*=n,this.y*=n,this},divide:function(n){return this.x/=n.x,this.y/=n.y,this},divideScalar:function(n){return this.multiplyScalar(1/n)},applyMatrix3:function(n){var i=this.x,r=this.y,t=n.elements;return this.x=t[0]*i+t[3]*r+t[6],this.y=t[1]*i+t[4]*r+t[7],this},min:function(n){return this.x=Math.min(this.x,n.x),this.y=Math.min(this.y,n.y),this},max:function(n){return this.x=Math.max(this.x,n.x),this.y=Math.max(this.y,n.y),this},clamp:function(n,t){return this.x=Math.max(n.x,Math.min(t.x,this.x)),this.y=Math.max(n.y,Math.min(t.y,this.y)),this},clampScalar:function(){var n=new t,i=new t;return function(t,r){return n.set(t,t),i.set(r,r),this.clamp(n,i)}}(),clampLength:function(n,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(n,Math.min(t,i)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(n){return this.x*n.x+this.y*n.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var n=Math.atan2(this.y,this.x);return n<0&&(n+=2*Math.PI),n},distanceTo:function(n){return Math.sqrt(this.distanceToSquared(n))},distanceToSquared:function(n){var t=this.x-n.x,i=this.y-n.y;return t*t+i*i},manhattanDistanceTo:function(n){return Math.abs(this.x-n.x)+Math.abs(this.y-n.y)},setLength:function(n){return this.normalize().multiplyScalar(n)},lerp:function(n,t){return this.x+=(n.x-this.x)*t,this.y+=(n.y-this.y)*t,this},lerpVectors:function(n,t,i){return this.subVectors(t,n).multiplyScalar(i).add(n)},equals:function(n){return n.x===this.x&&n.y===this.y},fromArray:function(n,t){return t===undefined&&(t=0),this.x=n[t],this.y=n[t+1],this},toArray:function(n,t){return n===undefined&&(n=[]),t===undefined&&(t=0),n[t]=this.x,n[t+1]=this.y,n},fromBufferAttribute:function(n,t,i){return i!==undefined&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=n.getX(t),this.y=n.getY(t),this},rotateAround:function(n,t){var i=Math.cos(t),r=Math.sin(t),u=this.x-n.x,f=this.y-n.y;return this.x=u*i-f*r+n.x,this.y=u*r+f*i+n.y,this}});Object.assign(o.prototype,{isMatrix4:!0,set:function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p){var w=this.elements;return w[0]=n,w[4]=t,w[8]=i,w[12]=r,w[1]=u,w[5]=f,w[9]=e,w[13]=o,w[2]=s,w[6]=h,w[10]=c,w[14]=l,w[3]=a,w[7]=v,w[11]=y,w[15]=p,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new o).fromArray(this.elements)},copy:function(n){var t=this.elements,i=n.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this},copyPosition:function(n){var t=this.elements,i=n.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this},extractBasis:function(n,t,i){return n.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this},makeBasis:function(n,t,i){return this.set(n.x,t.x,i.x,0,n.y,t.y,i.y,0,n.z,t.z,i.z,0,0,0,0,1),this},extractRotation:function(){var t=new n;return function(n){var i=this.elements,r=n.elements,u=1/t.setFromMatrixColumn(n,0).length(),f=1/t.setFromMatrixColumn(n,1).length(),e=1/t.setFromMatrixColumn(n,2).length();return i[0]=r[0]*u,i[1]=r[1]*u,i[2]=r[2]*u,i[4]=r[4]*f,i[5]=r[5]*f,i[6]=r[6]*f,i[8]=r[8]*e,i[9]=r[9]*e,i[10]=r[10]*e,this}}(),makeRotationFromEuler:function(n){n&&n.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,g=n.x,nt=n.y,tt=n.z,f=Math.cos(g),i=Math.sin(g),e=Math.cos(nt),r=Math.sin(nt),o=Math.cos(tt),u=Math.sin(tt);if(n.order==="XYZ"){var s=f*o,h=f*u,c=i*o,l=i*u;t[0]=e*o;t[4]=-e*u;t[8]=r;t[1]=h+c*r;t[5]=s-l*r;t[9]=-i*e;t[2]=l-s*r;t[6]=c+h*r;t[10]=f*e}else if(n.order==="YXZ"){var a=e*o,v=e*u,y=r*o,p=r*u;t[0]=a+p*i;t[4]=y*i-v;t[8]=f*r;t[1]=f*u;t[5]=f*o;t[9]=-i;t[2]=v*i-y;t[6]=p+a*i;t[10]=f*e}else if(n.order==="ZXY"){var a=e*o,v=e*u,y=r*o,p=r*u;t[0]=a-p*i;t[4]=-f*u;t[8]=y+v*i;t[1]=v+y*i;t[5]=f*o;t[9]=p-a*i;t[2]=-f*r;t[6]=i;t[10]=f*e}else if(n.order==="ZYX"){var s=f*o,h=f*u,c=i*o,l=i*u;t[0]=e*o;t[4]=c*r-h;t[8]=s*r+l;t[1]=e*u;t[5]=l*r+s;t[9]=h*r-c;t[2]=-r;t[6]=i*e;t[10]=f*e}else if(n.order==="YZX"){var w=f*e,b=f*r,k=i*e,d=i*r;t[0]=e*o;t[4]=d-w*u;t[8]=k*u+b;t[1]=u;t[5]=f*o;t[9]=-i*o;t[2]=-r*o;t[6]=b*u+k;t[10]=w-d*u}else if(n.order==="XZY"){var w=f*e,b=f*r,k=i*e,d=i*r;t[0]=e*o;t[4]=-u;t[8]=r*o;t[1]=w*u+d;t[5]=f*o;t[9]=b*u-k;t[2]=k*u-b;t[6]=i*o;t[10]=d*u+w}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:function(n){var t=this.elements,i=n._x,r=n._y,f=n._z,e=n._w,s=i+i,o=r+r,u=f+f,h=i*s,c=i*o,l=i*u,a=r*o,v=r*u,y=f*u,p=e*s,w=e*o,b=e*u;return t[0]=1-(a+y),t[4]=c-b,t[8]=l+w,t[1]=c+b,t[5]=1-(h+y),t[9]=v-p,t[2]=l-w,t[6]=v+p,t[10]=1-(h+a),t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},lookAt:function(){var i=new n,r=new n,t=new n;return function(n,u,f){var e=this.elements;return t.subVectors(n,u),t.lengthSq()===0&&(t.z=1),t.normalize(),i.crossVectors(f,t),i.lengthSq()===0&&(Math.abs(f.z)===1?t.x+=.0001:t.z+=.0001,t.normalize(),i.crossVectors(f,t)),i.normalize(),r.crossVectors(t,i),e[0]=i.x,e[4]=r.x,e[8]=t.x,e[1]=i.y,e[5]=r.y,e[9]=t.y,e[2]=i.z,e[6]=r.z,e[10]=t.z,this}}(),multiply:function(n,t){return t!==undefined?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(n,t)):this.multiplyMatrices(this,n)},premultiply:function(n){return this.multiplyMatrices(n,this)},multiplyMatrices:function(n,t){var i=n.elements,r=t.elements,u=this.elements,f=i[0],e=i[4],o=i[8],s=i[12],h=i[1],c=i[5],l=i[9],a=i[13],v=i[2],y=i[6],p=i[10],w=i[14],b=i[3],k=i[7],d=i[11],g=i[15],nt=r[0],tt=r[4],it=r[8],rt=r[12],ut=r[1],ft=r[5],et=r[9],ot=r[13],st=r[2],ht=r[6],ct=r[10],lt=r[14],at=r[3],vt=r[7],yt=r[11],pt=r[15];return u[0]=f*nt+e*ut+o*st+s*at,u[4]=f*tt+e*ft+o*ht+s*vt,u[8]=f*it+e*et+o*ct+s*yt,u[12]=f*rt+e*ot+o*lt+s*pt,u[1]=h*nt+c*ut+l*st+a*at,u[5]=h*tt+c*ft+l*ht+a*vt,u[9]=h*it+c*et+l*ct+a*yt,u[13]=h*rt+c*ot+l*lt+a*pt,u[2]=v*nt+y*ut+p*st+w*at,u[6]=v*tt+y*ft+p*ht+w*vt,u[10]=v*it+y*et+p*ct+w*yt,u[14]=v*rt+y*ot+p*lt+w*pt,u[3]=b*nt+k*ut+d*st+g*at,u[7]=b*tt+k*ft+d*ht+g*vt,u[11]=b*it+k*et+d*ct+g*yt,u[15]=b*rt+k*ot+d*lt+g*pt,this},multiplyScalar:function(n){var t=this.elements;return t[0]*=n,t[4]*=n,t[8]*=n,t[12]*=n,t[1]*=n,t[5]*=n,t[9]*=n,t[13]*=n,t[2]*=n,t[6]*=n,t[10]*=n,t[14]*=n,t[3]*=n,t[7]*=n,t[11]*=n,t[15]*=n,this},applyToBufferAttribute:function(){var t=new n;return function(n){for(var u=this,i=0,r=n.count;i<r;i++)t.x=n.getX(i),t.y=n.getY(i),t.z=n.getZ(i),t.applyMatrix4(u),n.setXYZ(i,t.x,t.y,t.z);return n}}(),determinant:function(){var n=this.elements,t=n[0],i=n[4],r=n[8],u=n[12],f=n[1],e=n[5],o=n[9],s=n[13],h=n[2],c=n[6],l=n[10],a=n[14],v=n[3],y=n[7],p=n[11],w=n[15];return v*(+u*o*c-r*s*c-u*e*l+i*s*l+r*e*a-i*o*a)+y*(+t*o*a-t*s*l+u*f*l-r*f*a+r*s*h-u*o*h)+p*(+t*s*c-t*e*a-u*f*c+i*f*a+u*e*h-i*s*h)+w*(-r*e*h-t*o*c+t*e*l+r*f*c-i*f*l+i*o*h)},transpose:function(){var n=this.elements,t;return t=n[1],n[1]=n[4],n[4]=t,t=n[2],n[2]=n[8],n[8]=t,t=n[6],n[6]=n[9],n[9]=t,t=n[3],n[3]=n[12],n[12]=t,t=n[7],n[7]=n[13],n[13]=t,t=n[11],n[11]=n[14],n[14]=t,this},setPosition:function(n){var t=this.elements;return t[12]=n.x,t[13]=n.y,t[14]=n.z,this},getInverse:function(n,t){var d=this.elements,g=n.elements,i=g[0],r=g[1],u=g[2],f=g[3],e=g[4],o=g[5],s=g[6],h=g[7],c=g[8],l=g[9],a=g[10],v=g[11],y=g[12],p=g[13],w=g[14],b=g[15],tt=l*w*h-p*a*h+p*s*v-o*w*v-l*s*b+o*a*b,it=y*a*h-c*w*h-y*s*v+e*w*v+c*s*b-e*a*b,rt=c*p*h-y*l*h+y*o*v-e*p*v-c*o*b+e*l*b,ut=y*l*s-c*p*s-y*o*a+e*p*a+c*o*w-e*l*w,ft=i*tt+r*it+u*rt+f*ut,nt,k;if(ft===0){if(nt="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0",t===!0)throw new Error(nt);else console.warn(nt);return this.identity()}return k=1/ft,d[0]=tt*k,d[1]=(p*a*f-l*w*f-p*u*v+r*w*v+l*u*b-r*a*b)*k,d[2]=(o*w*f-p*s*f+p*u*h-r*w*h-o*u*b+r*s*b)*k,d[3]=(l*s*f-o*a*f-l*u*h+r*a*h+o*u*v-r*s*v)*k,d[4]=it*k,d[5]=(c*w*f-y*a*f+y*u*v-i*w*v-c*u*b+i*a*b)*k,d[6]=(y*s*f-e*w*f-y*u*h+i*w*h+e*u*b-i*s*b)*k,d[7]=(e*a*f-c*s*f+c*u*h-i*a*h-e*u*v+i*s*v)*k,d[8]=rt*k,d[9]=(y*l*f-c*p*f-y*r*v+i*p*v+c*r*b-i*l*b)*k,d[10]=(e*p*f-y*o*f+y*r*h-i*p*h-e*r*b+i*o*b)*k,d[11]=(c*o*f-e*l*f-c*r*h+i*l*h+e*r*v-i*o*v)*k,d[12]=ut*k,d[13]=(c*p*u-y*l*u+y*r*a-i*p*a-c*r*w+i*l*w)*k,d[14]=(y*o*u-e*p*u-y*r*s+i*p*s+e*r*w-i*o*w)*k,d[15]=(e*l*u-c*o*u+c*r*s-i*l*s-e*r*a+i*o*a)*k,this},scale:function(n){var t=this.elements,i=n.x,r=n.y,u=n.z;return t[0]*=i,t[4]*=r,t[8]*=u,t[1]*=i,t[5]*=r,t[9]*=u,t[2]*=i,t[6]*=r,t[10]*=u,t[3]*=i,t[7]*=r,t[11]*=u,this},getMaxScaleOnAxis:function(){var n=this.elements,t=n[0]*n[0]+n[1]*n[1]+n[2]*n[2],i=n[4]*n[4]+n[5]*n[5]+n[6]*n[6],r=n[8]*n[8]+n[9]*n[9]+n[10]*n[10];return Math.sqrt(Math.max(t,i,r))},makeTranslation:function(n,t,i){return this.set(1,0,0,n,0,1,0,t,0,0,1,i,0,0,0,1),this},makeRotationX:function(n){var t=Math.cos(n),i=Math.sin(n);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this},makeRotationY:function(n){var t=Math.cos(n),i=Math.sin(n);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this},makeRotationZ:function(n){var t=Math.cos(n),i=Math.sin(n);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(n,t){var e=Math.cos(t),r=Math.sin(t),s=1-e,o=n.x,u=n.y,i=n.z,f=s*o,h=s*u;return this.set(f*o+e,f*u-r*i,f*i+r*u,0,f*u+r*i,h*u+e,h*i-r*o,0,f*i-r*u,h*i+r*o,s*i*i+e,0,0,0,0,1),this},makeScale:function(n,t,i){return this.set(n,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this},makeShear:function(n,t,i){return this.set(1,t,i,0,n,1,i,0,n,t,1,0,0,0,0,1),this},compose:function(n,t,i){return this.makeRotationFromQuaternion(t),this.scale(i),this.setPosition(n),this},decompose:function(){var i=new n,t=new o;return function(n,r,u){var f=this.elements,e=i.set(f[0],f[1],f[2]).length(),c=i.set(f[4],f[5],f[6]).length(),l=i.set(f[8],f[9],f[10]).length(),a=this.determinant();a<0&&(e=-e);n.x=f[12];n.y=f[13];n.z=f[14];t.copy(this);var o=1/e,s=1/c,h=1/l;return t.elements[0]*=o,t.elements[1]*=o,t.elements[2]*=o,t.elements[4]*=s,t.elements[5]*=s,t.elements[6]*=s,t.elements[8]*=h,t.elements[9]*=h,t.elements[10]*=h,r.setFromRotationMatrix(t),u.x=e,u.y=c,u.z=l,this}}(),makePerspective:function(n,t,i,r,u,f){f===undefined&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var e=this.elements,o=2*u/(t-n),s=2*u/(i-r),h=(t+n)/(t-n),c=(i+r)/(i-r),l=-(f+u)/(f-u),a=-2*f*u/(f-u);return e[0]=o,e[4]=0,e[8]=h,e[12]=0,e[1]=0,e[5]=s,e[9]=c,e[13]=0,e[2]=0,e[6]=0,e[10]=l,e[14]=a,e[3]=0,e[7]=0,e[11]=-1,e[15]=0,this},makeOrthographic:function(n,t,i,r,u,f){var e=this.elements,o=1/(t-n),s=1/(i-r),h=1/(f-u),c=(t+n)*o,l=(i+r)*s,a=(f+u)*h;return e[0]=2*o,e[4]=0,e[8]=0,e[12]=-c,e[1]=0,e[5]=2*s,e[9]=0,e[13]=-l,e[2]=0,e[6]=0,e[10]=-2*h,e[14]=-a,e[3]=0,e[7]=0,e[11]=0,e[15]=1,this},equals:function(n){for(var i=this.elements,r=n.elements,t=0;t<16;t++)if(i[t]!==r[t])return!1;return!0},fromArray:function(n,t){var r=this,i;for(t===undefined&&(t=0),i=0;i<16;i++)r.elements[i]=n[i+t];return this},toArray:function(n,t){n===undefined&&(n=[]);t===undefined&&(t=0);var i=this.elements;return n[t]=i[0],n[t+1]=i[1],n[t+2]=i[2],n[t+3]=i[3],n[t+4]=i[4],n[t+5]=i[5],n[t+6]=i[6],n[t+7]=i[7],n[t+8]=i[8],n[t+9]=i[9],n[t+10]=i[10],n[t+11]=i[11],n[t+12]=i[12],n[t+13]=i[13],n[t+14]=i[14],n[t+15]=i[15],n}});Object.assign(g,{slerp:function(n,t,i,r){return i.copy(n).slerp(t,r)},slerpFlat:function(n,t,i,r,u,f,e){var o=i[r+0],s=i[r+1],h=i[r+2],c=i[r+3],w=u[f+0],b=u[f+1],k=u[f+2],d=u[f+3],p,g,a,v;if(c!==d||o!==w||s!==b||h!==k){var l=1-e,y=o*w+s*b+h*k+c*d,nt=y>=0?1:-1,tt=1-y*y;tt>Number.EPSILON&&(p=Math.sqrt(tt),g=Math.atan2(p,y*nt),l=Math.sin(l*g)/p,e=Math.sin(e*g)/p);a=e*nt;o=o*l+w*a;s=s*l+b*a;h=h*l+k*a;c=c*l+d*a;l===1-e&&(v=1/Math.sqrt(o*o+s*s+h*h+c*c),o*=v,s*=v,h*=v,c*=v)}n[t]=o;n[t+1]=s;n[t+2]=h;n[t+3]=c}});Object.defineProperties(g.prototype,{x:{get:function(){return this._x},set:function(n){this._x=n;this.onChangeCallback()}},y:{get:function(){return this._y},set:function(n){this._y=n;this.onChangeCallback()}},z:{get:function(){return this._z},set:function(n){this._z=n;this.onChangeCallback()}},w:{get:function(){return this._w},set:function(n){this._w=n;this.onChangeCallback()}}});Object.assign(g.prototype,{set:function(n,t,i,r){return this._x=n,this._y=t,this._z=i,this._w=r,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(n){return this._x=n.x,this._y=n.y,this._z=n.z,this._w=n.w,this.onChangeCallback(),this},setFromEuler:function(n,t){if(!(n&&n.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var l=n._x,a=n._y,v=n._z,s=n.order,h=Math.cos,c=Math.sin,i=h(l/2),r=h(a/2),u=h(v/2),f=c(l/2),e=c(a/2),o=c(v/2);return s==="XYZ"?(this._x=f*r*u+i*e*o,this._y=i*e*u-f*r*o,this._z=i*r*o+f*e*u,this._w=i*r*u-f*e*o):s==="YXZ"?(this._x=f*r*u+i*e*o,this._y=i*e*u-f*r*o,this._z=i*r*o-f*e*u,this._w=i*r*u+f*e*o):s==="ZXY"?(this._x=f*r*u-i*e*o,this._y=i*e*u+f*r*o,this._z=i*r*o+f*e*u,this._w=i*r*u-f*e*o):s==="ZYX"?(this._x=f*r*u-i*e*o,this._y=i*e*u+f*r*o,this._z=i*r*o-f*e*u,this._w=i*r*u+f*e*o):s==="YZX"?(this._x=f*r*u+i*e*o,this._y=i*e*u+f*r*o,this._z=i*r*o-f*e*u,this._w=i*r*u-f*e*o):s==="XZY"&&(this._x=f*r*u-i*e*o,this._y=i*e*u-f*r*o,this._z=i*r*o+f*e*u,this._w=i*r*u+f*e*o),t!==!1&&this.onChangeCallback(),this},setFromAxisAngle:function(n,t){var r=t/2,i=Math.sin(r);return this._x=n.x*i,this._y=n.y*i,this._z=n.z*i,this._w=Math.cos(r),this.onChangeCallback(),this},setFromRotationMatrix:function(n){var i=n.elements,r=i[0],e=i[4],o=i[8],s=i[1],u=i[5],h=i[9],c=i[2],l=i[6],f=i[10],a=r+u+f,t;return a>0?(t=.5/Math.sqrt(a+1),this._w=.25/t,this._x=(l-h)*t,this._y=(o-c)*t,this._z=(s-e)*t):r>u&&r>f?(t=2*Math.sqrt(1+r-u-f),this._w=(l-h)/t,this._x=.25*t,this._y=(e+s)/t,this._z=(o+c)/t):u>f?(t=2*Math.sqrt(1+u-r-f),this._w=(o-c)/t,this._x=(e+s)/t,this._y=.25*t,this._z=(h+l)/t):(t=2*Math.sqrt(1+f-r-u),this._w=(s-e)/t,this._x=(o+c)/t,this._y=(h+l)/t,this._z=.25*t),this.onChangeCallback(),this},setFromUnitVectors:function(){var t=new n,i,r=1e-6;return function(u,f){return t===undefined&&(t=new n),i=u.dot(f)+1,i<r?(i=0,Math.abs(u.x)>Math.abs(u.z)?t.set(-u.y,u.x,0):t.set(0,-u.z,u.y)):t.crossVectors(u,f),this._x=t.x,this._y=t.y,this._z=t.z,this._w=i,this.normalize()}}(),inverse:function(){return this.conjugate().normalize()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(n){return this._x*n._x+this._y*n._y+this._z*n._z+this._w*n._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var n=this.length();return n===0?(this._x=0,this._y=0,this._z=0,this._w=1):(n=1/n,this._x=this._x*n,this._y=this._y*n,this._z=this._z*n,this._w=this._w*n),this.onChangeCallback(),this},multiply:function(n,t){return t!==undefined?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(n,t)):this.multiplyQuaternions(this,n)},premultiply:function(n){return this.multiplyQuaternions(n,this)},multiplyQuaternions:function(n,t){var i=n._x,r=n._y,u=n._z,f=n._w,e=t._x,o=t._y,s=t._z,h=t._w;return this._x=i*h+f*e+r*s-u*o,this._y=r*h+f*o+u*e-i*s,this._z=u*h+f*s+i*o-r*e,this._w=f*h-i*e-r*o-u*s,this.onChangeCallback(),this},slerp:function(n,t){var r;if(t===0)return this;if(t===1)return this.copy(n);var u=this._x,f=this._y,e=this._z,o=this._w,i=o*n._w+u*n._x+f*n._y+e*n._z;if(i<0?(this._w=-n._w,this._x=-n._x,this._y=-n._y,this._z=-n._z,i=-i):this.copy(n),i>=1)return this._w=o,this._x=u,this._y=f,this._z=e,this;if(r=Math.sqrt(1-i*i),Math.abs(r)<.001)return this._w=.5*(o+this._w),this._x=.5*(u+this._x),this._y=.5*(f+this._y),this._z=.5*(e+this._z),this;var c=Math.atan2(r,i),s=Math.sin((1-t)*c)/r,h=Math.sin(t*c)/r;return this._w=o*s+this._w*h,this._x=u*s+this._x*h,this._y=f*s+this._y*h,this._z=e*s+this._z*h,this.onChangeCallback(),this},equals:function(n){return n._x===this._x&&n._y===this._y&&n._z===this._z&&n._w===this._w},fromArray:function(n,t){return t===undefined&&(t=0),this._x=n[t],this._y=n[t+1],this._z=n[t+2],this._w=n[t+3],this.onChangeCallback(),this},toArray:function(n,t){return n===undefined&&(n=[]),t===undefined&&(t=0),n[t]=this._x,n[t+1]=this._y,n[t+2]=this._z,n[t+3]=this._w,n},onChange:function(n){return this.onChangeCallback=n,this},onChangeCallback:function(){}});Object.assign(n.prototype,{isVector3:!0,set:function(n,t,i){return this.x=n,this.y=t,this.z=i,this},setScalar:function(n){return this.x=n,this.y=n,this.z=n,this},setX:function(n){return this.x=n,this},setY:function(n){return this.y=n,this},setZ:function(n){return this.z=n,this},setComponent:function(n,t){switch(n){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+n);}return this},getComponent:function(n){switch(n){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+n);}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(n){return this.x=n.x,this.y=n.y,this.z=n.z,this},add:function(n,t){return t!==undefined?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(n,t)):(this.x+=n.x,this.y+=n.y,this.z+=n.z,this)},addScalar:function(n){return this.x+=n,this.y+=n,this.z+=n,this},addVectors:function(n,t){return this.x=n.x+t.x,this.y=n.y+t.y,this.z=n.z+t.z,this},addScaledVector:function(n,t){return this.x+=n.x*t,this.y+=n.y*t,this.z+=n.z*t,this},sub:function(n,t){return t!==undefined?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(n,t)):(this.x-=n.x,this.y-=n.y,this.z-=n.z,this)},subScalar:function(n){return this.x-=n,this.y-=n,this.z-=n,this},subVectors:function(n,t){return this.x=n.x-t.x,this.y=n.y-t.y,this.z=n.z-t.z,this},multiply:function(n,t){return t!==undefined?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(n,t)):(this.x*=n.x,this.y*=n.y,this.z*=n.z,this)},multiplyScalar:function(n){return this.x*=n,this.y*=n,this.z*=n,this},multiplyVectors:function(n,t){return this.x=n.x*t.x,this.y=n.y*t.y,this.z=n.z*t.z,this},applyEuler:function(){var n=new g;return function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(n.setFromEuler(t))}}(),applyAxisAngle:function(){var n=new g;return function(t,i){return this.applyQuaternion(n.setFromAxisAngle(t,i))}}(),applyMatrix3:function(n){var i=this.x,r=this.y,u=this.z,t=n.elements;return this.x=t[0]*i+t[3]*r+t[6]*u,this.y=t[1]*i+t[4]*r+t[7]*u,this.z=t[2]*i+t[5]*r+t[8]*u,this},applyMatrix4:function(n){var i=this.x,r=this.y,u=this.z,t=n.elements,f=1/(t[3]*i+t[7]*r+t[11]*u+t[15]);return this.x=(t[0]*i+t[4]*r+t[8]*u+t[12])*f,this.y=(t[1]*i+t[5]*r+t[9]*u+t[13])*f,this.z=(t[2]*i+t[6]*r+t[10]*u+t[14])*f,this},applyQuaternion:function(n){var f=this.x,e=this.y,o=this.z,t=n.x,i=n.y,r=n.z,u=n.w,s=u*f+i*o-r*e,h=u*e+r*f-t*o,c=u*o+t*e-i*f,l=-t*f-i*e-r*o;return this.x=s*u+l*-t+h*-r-c*-i,this.y=h*u+l*-i+c*-t-s*-r,this.z=c*u+l*-r+s*-i-h*-t,this},project:function(){var n=new o;return function(t){return n.multiplyMatrices(t.projectionMatrix,n.getInverse(t.matrixWorld)),this.applyMatrix4(n)}}(),unproject:function(){var n=new o;return function(t){return n.multiplyMatrices(t.matrixWorld,n.getInverse(t.projectionMatrix)),this.applyMatrix4(n)}}(),transformDirection:function(n){var i=this.x,r=this.y,u=this.z,t=n.elements;return this.x=t[0]*i+t[4]*r+t[8]*u,this.y=t[1]*i+t[5]*r+t[9]*u,this.z=t[2]*i+t[6]*r+t[10]*u,this.normalize()},divide:function(n){return this.x/=n.x,this.y/=n.y,this.z/=n.z,this},divideScalar:function(n){return this.multiplyScalar(1/n)},min:function(n){return this.x=Math.min(this.x,n.x),this.y=Math.min(this.y,n.y),this.z=Math.min(this.z,n.z),this},max:function(n){return this.x=Math.max(this.x,n.x),this.y=Math.max(this.y,n.y),this.z=Math.max(this.z,n.z),this},clamp:function(n,t){return this.x=Math.max(n.x,Math.min(t.x,this.x)),this.y=Math.max(n.y,Math.min(t.y,this.y)),this.z=Math.max(n.z,Math.min(t.z,this.z)),this},clampScalar:function(){var t=new n,i=new n;return function(n,r){return t.set(n,n,n),i.set(r,r,r),this.clamp(t,i)}}(),clampLength:function(n,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(n,Math.min(t,i)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(n){return this.x*n.x+this.y*n.y+this.z*n.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(n){return this.normalize().multiplyScalar(n)},lerp:function(n,t){return this.x+=(n.x-this.x)*t,this.y+=(n.y-this.y)*t,this.z+=(n.z-this.z)*t,this},lerpVectors:function(n,t,i){return this.subVectors(t,n).multiplyScalar(i).add(n)},cross:function(n,t){return t!==undefined?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(n,t)):this.crossVectors(this,n)},crossVectors:function(n,t){var i=n.x,r=n.y,u=n.z,f=t.x,e=t.y,o=t.z;return this.x=r*o-u*e,this.y=u*f-i*o,this.z=i*e-r*f,this},projectOnVector:function(n){var t=n.dot(this)/n.lengthSq();return this.copy(n).multiplyScalar(t)},projectOnPlane:function(){var t=new n;return function(n){return t.copy(this).projectOnVector(n),this.sub(t)}}(),reflect:function(){var t=new n;return function(n){return this.sub(t.copy(n).multiplyScalar(2*this.dot(n)))}}(),angleTo:function(n){var t=this.dot(n)/Math.sqrt(this.lengthSq()*n.lengthSq());return Math.acos(h.clamp(t,-1,1))},distanceTo:function(n){return Math.sqrt(this.distanceToSquared(n))},distanceToSquared:function(n){var t=this.x-n.x,i=this.y-n.y,r=this.z-n.z;return t*t+i*i+r*r},manhattanDistanceTo:function(n){return Math.abs(this.x-n.x)+Math.abs(this.y-n.y)+Math.abs(this.z-n.z)},setFromSpherical:function(n){var t=Math.sin(n.phi)*n.radius;return this.x=t*Math.sin(n.theta),this.y=Math.cos(n.phi)*n.radius,this.z=t*Math.cos(n.theta),this},setFromCylindrical:function(n){return this.x=n.radius*Math.sin(n.theta),this.y=n.y,this.z=n.radius*Math.cos(n.theta),this},setFromMatrixPosition:function(n){var t=n.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(n){var t=this.setFromMatrixColumn(n,0).length(),i=this.setFromMatrixColumn(n,1).length(),r=this.setFromMatrixColumn(n,2).length();return this.x=t,this.y=i,this.z=r,this},setFromMatrixColumn:function(n,t){return this.fromArray(n.elements,t*4)},equals:function(n){return n.x===this.x&&n.y===this.y&&n.z===this.z},fromArray:function(n,t){return t===undefined&&(t=0),this.x=n[t],this.y=n[t+1],this.z=n[t+2],this},toArray:function(n,t){return n===undefined&&(n=[]),t===undefined&&(t=0),n[t]=this.x,n[t+1]=this.y,n[t+2]=this.z,n},fromBufferAttribute:function(n,t,i){return i!==undefined&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=n.getX(t),this.y=n.getY(t),this.z=n.getZ(t),this}});Object.assign(ot.prototype,{isMatrix3:!0,set:function(n,t,i,r,u,f,e,o,s){var h=this.elements;return h[0]=n,h[1]=r,h[2]=e,h[3]=t,h[4]=u,h[5]=o,h[6]=i,h[7]=f,h[8]=s,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(n){var t=this.elements,i=n.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this},setFromMatrix4:function(n){var t=n.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},applyToBufferAttribute:function(){var t=new n;return function(n){for(var u=this,i=0,r=n.count;i<r;i++)t.x=n.getX(i),t.y=n.getY(i),t.z=n.getZ(i),t.applyMatrix3(u),n.setXYZ(i,t.x,t.y,t.z);return n}}(),multiply:function(n){return this.multiplyMatrices(this,n)},premultiply:function(n){return this.multiplyMatrices(n,this)},multiplyMatrices:function(n,t){var i=n.elements,r=t.elements,u=this.elements,f=i[0],e=i[3],o=i[6],s=i[1],h=i[4],c=i[7],l=i[2],a=i[5],v=i[8],y=r[0],p=r[3],w=r[6],b=r[1],k=r[4],d=r[7],g=r[2],nt=r[5],tt=r[8];return u[0]=f*y+e*b+o*g,u[3]=f*p+e*k+o*nt,u[6]=f*w+e*d+o*tt,u[1]=s*y+h*b+c*g,u[4]=s*p+h*k+c*nt,u[7]=s*w+h*d+c*tt,u[2]=l*y+a*b+v*g,u[5]=l*p+a*k+v*nt,u[8]=l*w+a*d+v*tt,this},multiplyScalar:function(n){var t=this.elements;return t[0]*=n,t[3]*=n,t[6]*=n,t[1]*=n,t[4]*=n,t[7]*=n,t[2]*=n,t[5]*=n,t[8]*=n,this},determinant:function(){var n=this.elements,t=n[0],i=n[1],r=n[2],u=n[3],f=n[4],e=n[5],o=n[6],s=n[7],h=n[8];return t*f*h-t*e*s-i*u*h+i*e*o+r*u*s-r*f*o},getInverse:function(n,t){var y,i;n&&n.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var r=n.elements,u=this.elements,f=r[0],e=r[1],o=r[2],s=r[3],h=r[4],c=r[5],l=r[6],a=r[7],v=r[8],p=v*h-c*a,w=c*l-v*s,b=a*s-h*l,k=f*p+e*w+o*b;if(k===0){if(y="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0",t===!0)throw new Error(y);else console.warn(y);return this.identity()}return i=1/k,u[0]=p*i,u[1]=(o*a-v*e)*i,u[2]=(c*e-o*h)*i,u[3]=w*i,u[4]=(v*f-o*l)*i,u[5]=(o*s-c*f)*i,u[6]=b*i,u[7]=(e*l-a*f)*i,u[8]=(h*f-e*s)*i,this},transpose:function(){var t,n=this.elements;return t=n[1],n[1]=n[3],n[3]=t,t=n[2],n[2]=n[6],n[6]=t,t=n[5],n[5]=n[7],n[7]=t,this},getNormalMatrix:function(n){return this.setFromMatrix4(n).getInverse(this).transpose()},transposeIntoArray:function(n){var t=this.elements;return n[0]=t[0],n[1]=t[3],n[2]=t[6],n[3]=t[1],n[4]=t[4],n[5]=t[7],n[6]=t[2],n[7]=t[5],n[8]=t[8],this},setUvTransform:function(n,t,i,r,u,f,e){var o=Math.cos(u),s=Math.sin(u);this.set(i*o,i*s,-i*(o*f+s*e)+f+n,-r*s,r*o,-r*(-s*f+o*e)+e+t,0,0,1)},scale:function(n,t){var i=this.elements;return i[0]*=n,i[3]*=n,i[6]*=n,i[1]*=t,i[4]*=t,i[7]*=t,this},rotate:function(n){var i=Math.cos(n),r=Math.sin(n),t=this.elements,u=t[0],f=t[3],e=t[6],o=t[1],s=t[4],h=t[7];return t[0]=i*u+r*o,t[3]=i*f+r*s,t[6]=i*e+r*h,t[1]=-r*u+i*o,t[4]=-r*f+i*s,t[7]=-r*e+i*h,this},translate:function(n,t){var i=this.elements;return i[0]+=n*i[2],i[3]+=n*i[5],i[6]+=n*i[8],i[1]+=t*i[2],i[4]+=t*i[5],i[7]+=t*i[8],this},equals:function(n){for(var i=this.elements,r=n.elements,t=0;t<9;t++)if(i[t]!==r[t])return!1;return!0},fromArray:function(n,t){var r=this,i;for(t===undefined&&(t=0),i=0;i<9;i++)r.elements[i]=n[i+t];return this},toArray:function(n,t){n===undefined&&(n=[]);t===undefined&&(t=0);var i=this.elements;return n[t]=i[0],n[t+1]=i[1],n[t+2]=i[2],n[t+3]=i[3],n[t+4]=i[4],n[t+5]=i[5],n[t+6]=i[6],n[t+7]=i[7],n[t+8]=i[8],n}});ly=0;b.DEFAULT_IMAGE=undefined;b.DEFAULT_MAPPING=sc;Object.defineProperty(b.prototype,"needsUpdate",{set:function(n){n===!0&&this.version++}});Object.assign(b.prototype,bt.prototype,{constructor:b,isTexture:!0,clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.name=n.name,this.image=n.image,this.mipmaps=n.mipmaps.slice(0),this.mapping=n.mapping,this.wrapS=n.wrapS,this.wrapT=n.wrapT,this.magFilter=n.magFilter,this.minFilter=n.minFilter,this.anisotropy=n.anisotropy,this.format=n.format,this.type=n.type,this.offset.copy(n.offset),this.repeat.copy(n.repeat),this.center.copy(n.center),this.rotation=n.rotation,this.matrixAutoUpdate=n.matrixAutoUpdate,this.matrix.copy(n.matrix),this.generateMipmaps=n.generateMipmaps,this.premultiplyAlpha=n.premultiplyAlpha,this.flipY=n.flipY,this.unpackAlignment=n.unpackAlignment,this.encoding=n.encoding,this},toJSON:function(n){function u(n){var t,i;return n instanceof HTMLCanvasElement?t=n:(t=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),t.width=n.width,t.height=n.height,i=t.getContext("2d"),n instanceof ImageData?i.putImageData(n,0,0):i.drawImage(n,0,0,n.width,n.height)),t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}var r=n===undefined||typeof n=="string",i,t;return!r&&n.textures[this.uuid]!==undefined?n.textures[this.uuid]:(i={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],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY},this.image!==undefined&&(t=this.image,t.uuid===undefined&&(t.uuid=h.generateUUID()),r||n.images[t.uuid]!==undefined||(n.images[t.uuid]={uuid:t.uuid,url:u(t)}),i.image=t.uuid),r||(n.textures[this.uuid]=i),i)},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(n){if(this.mapping===sc){if(n.applyMatrix3(this.matrix),n.x<0||n.x>1)switch(this.wrapS){case li:n.x=n.x-Math.floor(n.x);break;case yt:n.x=n.x<0?0:1;break;case wr:n.x=Math.abs(Math.floor(n.x)%2)===1?Math.ceil(n.x)-n.x:n.x-Math.floor(n.x)}if(n.y<0||n.y>1)switch(this.wrapT){case li:n.y=n.y-Math.floor(n.y);break;case yt:n.y=n.y<0?0:1;break;case wr:n.y=Math.abs(Math.floor(n.y)%2)===1?Math.ceil(n.y)-n.y:n.y-Math.floor(n.y)}this.flipY&&(n.y=1-n.y)}}});Object.assign(p.prototype,{isVector4:!0,set:function(n,t,i,r){return this.x=n,this.y=t,this.z=i,this.w=r,this},setScalar:function(n){return this.x=n,this.y=n,this.z=n,this.w=n,this},setX:function(n){return this.x=n,this},setY:function(n){return this.y=n,this},setZ:function(n){return this.z=n,this},setW:function(n){return this.w=n,this},setComponent:function(n,t){switch(n){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+n);}return this},getComponent:function(n){switch(n){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: "+n);}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(n){return this.x=n.x,this.y=n.y,this.z=n.z,this.w=n.w!==undefined?n.w:1,this},add:function(n,t){return t!==undefined?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(n,t)):(this.x+=n.x,this.y+=n.y,this.z+=n.z,this.w+=n.w,this)},addScalar:function(n){return this.x+=n,this.y+=n,this.z+=n,this.w+=n,this},addVectors:function(n,t){return this.x=n.x+t.x,this.y=n.y+t.y,this.z=n.z+t.z,this.w=n.w+t.w,this},addScaledVector:function(n,t){return this.x+=n.x*t,this.y+=n.y*t,this.z+=n.z*t,this.w+=n.w*t,this},sub:function(n,t){return t!==undefined?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(n,t)):(this.x-=n.x,this.y-=n.y,this.z-=n.z,this.w-=n.w,this)},subScalar:function(n){return this.x-=n,this.y-=n,this.z-=n,this.w-=n,this},subVectors:function(n,t){return this.x=n.x-t.x,this.y=n.y-t.y,this.z=n.z-t.z,this.w=n.w-t.w,this},multiplyScalar:function(n){return this.x*=n,this.y*=n,this.z*=n,this.w*=n,this},applyMatrix4:function(n){var i=this.x,r=this.y,u=this.z,f=this.w,t=n.elements;return this.x=t[0]*i+t[4]*r+t[8]*u+t[12]*f,this.y=t[1]*i+t[5]*r+t[9]*u+t[13]*f,this.z=t[2]*i+t[6]*r+t[10]*u+t[14]*f,this.w=t[3]*i+t[7]*r+t[11]*u+t[15]*f,this},divideScalar:function(n){return this.multiplyScalar(1/n)},setAxisAngleFromQuaternion:function(n){this.w=2*Math.acos(n.w);var t=Math.sqrt(1-n.w*n.w);return t<.0001?(this.x=1,this.y=0,this.z=0):(this.x=n.x/t,this.y=n.y/t,this.z=n.z/t),this},setAxisAngleFromRotationMatrix:function(n){var g,t,i,r,f=.01,v=.1,u=n.elements,b=u[0],e=u[4],o=u[8],s=u[1],k=u[5],h=u[9],c=u[2],l=u[6],d=u[10],a;if(Math.abs(e-s)<f&&Math.abs(o-c)<f&&Math.abs(h-l)<f){if(Math.abs(e+s)<v&&Math.abs(o+c)<v&&Math.abs(h+l)<v&&Math.abs(b+k+d-3)<v)return this.set(1,0,0,0),this;g=Math.PI;var y=(b+1)/2,p=(k+1)/2,w=(d+1)/2,nt=(e+s)/4,tt=(o+c)/4,it=(h+l)/4;return y>p&&y>w?y<f?(t=0,i=.707106781,r=.707106781):(t=Math.sqrt(y),i=nt/t,r=tt/t):p>w?p<f?(t=.707106781,i=0,r=.707106781):(i=Math.sqrt(p),t=nt/i,r=it/i):w<f?(t=.707106781,i=.707106781,r=0):(r=Math.sqrt(w),t=tt/r,i=it/r),this.set(t,i,r,g),this}return a=Math.sqrt((l-h)*(l-h)+(o-c)*(o-c)+(s-e)*(s-e)),Math.abs(a)<.001&&(a=1),this.x=(l-h)/a,this.y=(o-c)/a,this.z=(s-e)/a,this.w=Math.acos((b+k+d-1)/2),this},min:function(n){return this.x=Math.min(this.x,n.x),this.y=Math.min(this.y,n.y),this.z=Math.min(this.z,n.z),this.w=Math.min(this.w,n.w),this},max:function(n){return this.x=Math.max(this.x,n.x),this.y=Math.max(this.y,n.y),this.z=Math.max(this.z,n.z),this.w=Math.max(this.w,n.w),this},clamp:function(n,t){return this.x=Math.max(n.x,Math.min(t.x,this.x)),this.y=Math.max(n.y,Math.min(t.y,this.y)),this.z=Math.max(n.z,Math.min(t.z,this.z)),this.w=Math.max(n.w,Math.min(t.w,this.w)),this},clampScalar:function(){var n,t;return function(i,r){return n===undefined&&(n=new p,t=new p),n.set(i,i,i,i),t.set(r,r,r,r),this.clamp(n,t)}}(),clampLength:function(n,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(n,Math.min(t,i)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(n){return this.x*n.x+this.y*n.y+this.z*n.z+this.w*n.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(n){return this.normalize().multiplyScalar(n)},lerp:function(n,t){return this.x+=(n.x-this.x)*t,this.y+=(n.y-this.y)*t,this.z+=(n.z-this.z)*t,this.w+=(n.w-this.w)*t,this},lerpVectors:function(n,t,i){return this.subVectors(t,n).multiplyScalar(i).add(n)},equals:function(n){return n.x===this.x&&n.y===this.y&&n.z===this.z&&n.w===this.w},fromArray:function(n,t){return t===undefined&&(t=0),this.x=n[t],this.y=n[t+1],this.z=n[t+2],this.w=n[t+3],this},toArray:function(n,t){return n===undefined&&(n=[]),t===undefined&&(t=0),n[t]=this.x,n[t+1]=this.y,n[t+2]=this.z,n[t+3]=this.w,n},fromBufferAttribute:function(n,t,i){return i!==undefined&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=n.getX(t),this.y=n.getY(t),this.z=n.getZ(t),this.w=n.getW(t),this}});Object.assign(ef.prototype,bt.prototype,{isWebGLRenderTarget:!0,setSize:function(n,t){(this.width!==n||this.height!==t)&&(this.width=n,this.height=t,this.dispose());this.viewport.set(0,0,n,t);this.scissor.set(0,0,n,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.width=n.width,this.height=n.height,this.viewport.copy(n.viewport),this.texture=n.texture.clone(),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.depthTexture=n.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});of.prototype=Object.create(ef.prototype);of.prototype.constructor=of;of.prototype.isWebGLRenderTargetCube=!0;gr.prototype=Object.create(b.prototype);gr.prototype.constructor=gr;gr.prototype.isDataTexture=!0;di.prototype=Object.create(b.prototype);di.prototype.constructor=di;di.prototype.isCubeTexture=!0;Object.defineProperty(di.prototype,"images",{get:function(){return this.image},set:function(n){this.image=n}});dc=new b;gc=new di;var vy=[],yy=[],py=new Float32Array(16),wy=new Float32Array(9);np.prototype.setValue=function(n,t){for(var u=this.seq,r,i=0,f=u.length;i!==f;++i)r=u[i],r.setValue(n,t[r.id])};po=/([\w\d_]+)(\])?(\[|\.)?/g;gi.prototype.setValue=function(n,t,i){var r=this.map[t];r!==undefined&&r.setValue(n,i,this.renderer)};gi.prototype.setOptional=function(n,t,i){var r=t[i];r!==undefined&&this.setValue(n,i,r)};gi.upload=function(n,t,i,r){for(var f,e,u=0,o=t.length;u!==o;++u)f=t[u],e=i[f.id],e.needsUpdate!==!1&&f.setValue(n,e.value,r)};gi.seqWithValue=function(n,t){for(var u=[],r,i=0,f=n.length;i!==f;++i)r=n[i],r.id in t&&u.push(r);return u};ip={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};Object.assign(f.prototype,{isColor:!0,r:1,g:1,b:1,set:function(n){return n&&n.isColor?this.copy(n):typeof n=="number"?this.setHex(n):typeof n=="string"&&this.setStyle(n),this},setScalar:function(n){return this.r=n,this.g=n,this.b=n,this},setHex:function(n){return n=Math.floor(n),this.r=(n>>16&255)/255,this.g=(n>>8&255)/255,this.b=(n&255)/255,this},setRGB:function(n,t,i){return this.r=n,this.g=t,this.b=i,this},setHSL:function(){function n(n,t,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?n+(t-n)*6*i:i<1/2?t:i<2/3?n+(t-n)*6*(2/3-i):n}return function(t,i,r){if(t=h.euclideanModulo(t,1),i=h.clamp(i,0,1),r=h.clamp(r,0,1),i===0)this.r=this.g=this.b=r;else{var u=r<=.5?r*(1+i):r+i-r*i,f=2*r-u;this.r=n(f,u,t+1/3);this.g=n(f,u,t);this.b=n(f,u,t-1/3)}return this}}(),setStyle:function(n){function f(t){t!==undefined&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+n+" will be ignored.")}var r,i,o,u,e,t;if(r=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(n)){o=r[1];u=r[2];switch(o){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(u))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,f(i[5]),this;if(i=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(u))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,f(i[5]),this;break;case"hsl":case"hsla":if(i=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(u)){var s=parseFloat(i[1])/360,h=parseInt(i[2],10)/100,c=parseInt(i[3],10)/100;return f(i[5]),this.setHSL(s,h,c)}}}else if(r=/^\#([A-Fa-f0-9]+)$/.exec(n)){if(t=r[1],e=t.length,e===3)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(e===6)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 n&&n.length>0&&(t=ip[n],t!==undefined?this.setHex(t):console.warn("THREE.Color: Unknown color "+n)),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(n){return this.r=n.r,this.g=n.g,this.b=n.b,this},copyGammaToLinear:function(n,t){return t===undefined&&(t=2),this.r=Math.pow(n.r,t),this.g=Math.pow(n.g,t),this.b=Math.pow(n.b,t),this},copyLinearToGamma:function(n,t){t===undefined&&(t=2);var i=t>0?1/t:1;return this.r=Math.pow(n.r,i),this.g=Math.pow(n.g,i),this.b=Math.pow(n.b,i),this},convertGammaToLinear:function(){var n=this.r,t=this.g,i=this.b;return this.r=n*n,this.g=t*t,this.b=i*i,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return this.r*255<<16^this.g*255<<8^this.b*255<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(n){var s=n||{h:0,s:0,l:0},e=this.r,t=this.g,i=this.b,r=Math.max(e,t,i),o=Math.min(e,t,i),u,h,c=(o+r)/2,f;if(o===r)u=0,h=0;else{f=r-o;h=c<=.5?f/(r+o):f/(2-r-o);switch(r){case e:u=(t-i)/f+(t<i?6:0);break;case t:u=(i-e)/f+2;break;case i:u=(e-t)/f+4}u/=6}return s.h=u,s.s=h,s.l=c,s},getStyle:function(){return"rgb("+(this.r*255|0)+","+(this.g*255|0)+","+(this.b*255|0)+")"},offsetHSL:function(n,t,i){var r=this.getHSL();return r.h+=n,r.s+=t,r.l+=i,this.setHSL(r.h,r.s,r.l),this},add:function(n){return this.r+=n.r,this.g+=n.g,this.b+=n.b,this},addColors:function(n,t){return this.r=n.r+t.r,this.g=n.g+t.g,this.b=n.b+t.b,this},addScalar:function(n){return this.r+=n,this.g+=n,this.b+=n,this},sub:function(n){return this.r=Math.max(0,this.r-n.r),this.g=Math.max(0,this.g-n.g),this.b=Math.max(0,this.b-n.b),this},multiply:function(n){return this.r*=n.r,this.g*=n.g,this.b*=n.b,this},multiplyScalar:function(n){return this.r*=n,this.g*=n,this.b*=n,this},lerp:function(n,t){return this.r+=(n.r-this.r)*t,this.g+=(n.g-this.g)*t,this.b+=(n.b-this.b)*t,this},equals:function(n){return n.r===this.r&&n.g===this.g&&n.b===this.b},fromArray:function(n,t){return t===undefined&&(t=0),this.r=n[t],this.g=n[t+1],this.b=n[t+2],this},toArray:function(n,t){return n===undefined&&(n=[]),t===undefined&&(t=0),n[t]=this.r,n[t+1]=this.g,n[t+2]=this.b,n},toJSON:function(){return this.getHex()}});var e={common:{diffuse:{value:new f(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new ot},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98}},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 t(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:.00025},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new f(16777215)}},lights:{ambientLightColor:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new f(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new ot}}},st={merge:function(n){for(var f=this,u={},i,r,t=0;t<n.length;t++){i=f.clone(n[t]);for(r in i)u[r]=i[r]}return u},clone:function(n){var r={},i,u,t;for(i in n){r[i]={};for(u in n[i])t=n[i][u],r[i][u]=t&&(t.isColor||t.isMatrix3||t.isMatrix4||t.isVector2||t.isVector3||t.isVector4||t.isTexture)?t.clone():Array.isArray(t)?t.slice():t}return r}},v={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"\nvec3 transformed = vec3( position );\n",beginnormal_vertex:"\nvec3 objectNormal = vec3( normal );\n",bsdfs:"float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t}\n\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE  = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS  = 0.5 / LUT_SIZE;\n\tfloat theta = acos( dot( N, V ) );\n\tvec2 uv = vec2(\n\t\tsqrt( saturate( roughness ) ),\n\t\tsaturate( theta / ( 0.5 * PI ) ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.86267 + (0.49788 + 0.01436 * y ) * y;\n\tfloat b = 3.45068 + (4.18814 + y) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = (x > 0.0) ? v : 0.5 * inversesqrt( 1.0 - x * x ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tvec3 result = vec3( LTC_ClippedSphereFormFactor( vectorFormFactor ) );\n\treturn result;\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\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\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\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;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; ++ i ) {\n\t\tvec4 plane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t\t\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; ++ i ) {\n\t\t\tvec4 plane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t\n\t#endif\n#endif\n",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif\n",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvarying vec3 vViewPosition;\n#endif\n",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\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 ) ); }\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}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\n",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1  (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale =  bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif\n",defaultnormal_vertex:"vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",encodings_fragment:"  gl_FragColor = linearToOutputTexel( gl_FragColor );\n",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\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.w );\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.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\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}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, 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}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat D      = max( maxRange / maxRGB, 1.0 );\n\tD            = min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\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 = value.rgb * cLogLuvM;\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}\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 = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n\treturn vec4( max(vRGB, 0.0), 1.0 );\n}\n",envmap_fragment:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",envmap_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif\n",envmap_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif\n",fog_vertex:"\n#ifdef USE_FOG\nfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n  varying float fogDepth;\n#endif\n",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif\n",gradientmap_pars_fragment:"#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif\n",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",lights_pars:"uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\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\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight  ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\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\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltcMat;\tuniform sampler2D ltcMag;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif\n",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\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\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos - halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos + halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos + halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos - halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tfloat norm = texture2D( ltcMag, uv ).a;\n\t\tvec4 t = texture2D( ltcMat, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3(   1,   0, t.y ),\n\t\t\tvec3(   0, t.z,   0 ),\n\t\t\tvec3( t.w,   0, t.x )\n\t\t);\n\t\treflectedLight.directSpecular += lightColor * material.specularColor * norm * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\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#define Material_BlinnShininessExponent( material )   GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material )   GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",lights_template:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\t#ifndef STANDARD\n\t\tvec3 clearCoatRadiance = getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 8 );\n\t#else\n\t\tvec3 clearCoatRadiance = vec3( 0.0 );\n\t#endif\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif\n",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\tgl_Position.z *= gl_Position.w;\n\t#endif\n#endif\n",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",map_particle_fragment:"#ifdef USE_MAP\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",map_particle_pars_fragment:"#ifdef USE_MAP\n\tuniform mat3 uvTransform;\n\tuniform sampler2D map;\n#endif\n",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif\n",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n",normal_fragment:"#ifdef FLAT_SHADED\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#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\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\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256.,  256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\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}\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:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;\n",dithering_fragment:"#if defined( DITHERING )\n  gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif\n",dithering_pars_fragment:"#if defined( DITHERING )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif\n",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif\n",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\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\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\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( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, 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( 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 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\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\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\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\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif\n",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix  = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n  gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",tonemapping_pars_fragment:"#ifndef saturate\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\n",uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif\n",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldPosition;\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\tgl_FragColor.a *= opacity;\n}\n",cube_vert:"varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}\n",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}\n",depth_vert:"#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>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}\n",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}\n",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\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>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}\n",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}\n",equirect_vert:"varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}\n",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}\n",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\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_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",meshbasic_vert:"#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>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}\n",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\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_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\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>\nvoid main() {\n\t#include <clipping_planes_fragment>\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\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\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\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:"#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\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>\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>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <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_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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\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>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\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",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\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>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_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#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",meshphysical_frag:"#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\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_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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\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>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\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",meshphysical_vert:"#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\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>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_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#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}\n",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\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>\nvoid main() {\n\t#include <uv_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#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}\n",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <fog_fragment>\n}\n",shadow_vert:"#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n"},tu={basic:{uniforms:st.merge([e.common,e.specularmap,e.envmap,e.aomap,e.lightmap,e.fog]),vertexShader:v.meshbasic_vert,fragmentShader:v.meshbasic_frag},lambert:{uniforms:st.merge([e.common,e.specularmap,e.envmap,e.aomap,e.lightmap,e.emissivemap,e.fog,e.lights,{emissive:{value:new f(0)}}]),vertexShader:v.meshlambert_vert,fragmentShader:v.meshlambert_frag},phong:{uniforms:st.merge([e.common,e.specularmap,e.envmap,e.aomap,e.lightmap,e.emissivemap,e.bumpmap,e.normalmap,e.displacementmap,e.gradientmap,e.fog,e.lights,{emissive:{value:new f(0)},specular:{value:new f(1118481)},shininess:{value:30}}]),vertexShader:v.meshphong_vert,fragmentShader:v.meshphong_frag},standard:{uniforms:st.merge([e.common,e.envmap,e.aomap,e.lightmap,e.emissivemap,e.bumpmap,e.normalmap,e.displacementmap,e.roughnessmap,e.metalnessmap,e.fog,e.lights,{emissive:{value:new f(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:v.meshphysical_vert,fragmentShader:v.meshphysical_frag},points:{uniforms:st.merge([e.points,e.fog]),vertexShader:v.points_vert,fragmentShader:v.points_frag},dashed:{uniforms:st.merge([e.common,e.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:v.linedashed_vert,fragmentShader:v.linedashed_frag},depth:{uniforms:st.merge([e.common,e.displacementmap]),vertexShader:v.depth_vert,fragmentShader:v.depth_frag},normal:{uniforms:st.merge([e.common,e.bumpmap,e.normalmap,e.displacementmap,{opacity:{value:1}}]),vertexShader:v.normal_vert,fragmentShader:v.normal_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:v.cube_vert,fragmentShader:v.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:v.equirect_vert,fragmentShader:v.equirect_frag},distanceRGBA:{uniforms:st.merge([e.common,e.displacementmap,{referencePosition:{value:new n},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:v.distanceRGBA_vert,fragmentShader:v.distanceRGBA_frag},shadow:{uniforms:st.merge([e.lights,e.fog,{color:{value:new f(0)},opacity:{value:1}}]),vertexShader:v.shadow_vert,fragmentShader:v.shadow_frag}};tu.physical={uniforms:st.merge([tu.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:v.meshphysical_vert,fragmentShader:v.meshphysical_frag};Object.assign(nl.prototype,{set:function(n,t){return this.min.copy(n),this.max.copy(t),this},setFromPoints:function(n){var r=this,t,i;for(this.makeEmpty(),t=0,i=n.length;t<i;t++)r.expandByPoint(n[t]);return this},setFromCenterAndSize:function(){var n=new t;return function(t,i){var r=n.copy(i).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.min.copy(n.min),this.max.copy(n.max),this},makeEmpty:function(){return this.min.x=this.min.y=+ Infinity,this.max.x=this.max.y=- Infinity,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(n){var i=n||new t;return this.isEmpty()?i.set(0,0):i.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(n){var i=n||new t;return this.isEmpty()?i.set(0,0):i.subVectors(this.max,this.min)},expandByPoint:function(n){return this.min.min(n),this.max.max(n),this},expandByVector:function(n){return this.min.sub(n),this.max.add(n),this},expandByScalar:function(n){return this.min.addScalar(-n),this.max.addScalar(n),this},containsPoint:function(n){return n.x<this.min.x||n.x>this.max.x||n.y<this.min.y||n.y>this.max.y?!1:!0},containsBox:function(n){return this.min.x<=n.min.x&&n.max.x<=this.max.x&&this.min.y<=n.min.y&&n.max.y<=this.max.y},getParameter:function(n,i){var r=i||new t;return r.set((n.x-this.min.x)/(this.max.x-this.min.x),(n.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(n){return n.max.x<this.min.x||n.min.x>this.max.x||n.max.y<this.min.y||n.min.y>this.max.y?!1:!0},clampPoint:function(n,i){var r=i||new t;return r.copy(n).clamp(this.min,this.max)},distanceToPoint:function(){var n=new t;return function(t){var i=n.copy(t).clamp(this.min,this.max);return i.sub(t).length()}}(),intersect:function(n){return this.min.max(n.min),this.max.min(n.max),this},union:function(n){return this.min.min(n.min),this.max.max(n.max),this},translate:function(n){return this.min.add(n),this.max.add(n),this},equals:function(n){return n.min.equals(this.min)&&n.max.equals(this.max)}});wo.prototype=Object.create(b.prototype);wo.prototype.constructor=wo;rp=0;Object.assign(l.prototype,bt.prototype,{isMaterial:!0,onBeforeCompile:function(){},setValues:function(n){var u=this,i,t,r;if(n!==undefined)for(i in n){if(t=n[i],t===undefined){console.warn("THREE.Material: '"+i+"' parameter is undefined.");continue}if(i==="shading"){console.warn("THREE."+u.type+": .shading has been removed. Use the boolean .flatShading instead.");u.flatShading=t===ov?!0:!1;continue}if(r=u[i],r===undefined){console.warn("THREE."+u.type+": '"+i+"' is not a property of this material.");continue}r&&r.isColor?r.set(t):r&&r.isVector3&&t&&t.isVector3?r.copy(t):u[i]=i==="overdraw"?Number(t):t}},toJSON:function(n){function f(n){var i=[],r,t;for(r in n)t=n[r],delete t.metadata,i.push(t);return i}var u=n===undefined||typeof n=="string",t,i,r;return u&&(n={textures:{},images:{}}),t={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}},t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),this.color&&this.color.isColor&&(t.color=this.color.getHex()),this.roughness!==undefined&&(t.roughness=this.roughness),this.metalness!==undefined&&(t.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(t.emissive=this.emissive.getHex()),this.emissiveIntensity!==1&&(t.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(t.specular=this.specular.getHex()),this.shininess!==undefined&&(t.shininess=this.shininess),this.clearCoat!==undefined&&(t.clearCoat=this.clearCoat),this.clearCoatRoughness!==undefined&&(t.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(t.map=this.map.toJSON(n).uuid),this.alphaMap&&this.alphaMap.isTexture&&(t.alphaMap=this.alphaMap.toJSON(n).uuid),this.lightMap&&this.lightMap.isTexture&&(t.lightMap=this.lightMap.toJSON(n).uuid),this.bumpMap&&this.bumpMap.isTexture&&(t.bumpMap=this.bumpMap.toJSON(n).uuid,t.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(t.normalMap=this.normalMap.toJSON(n).uuid,t.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(t.displacementMap=this.displacementMap.toJSON(n).uuid,t.displacementScale=this.displacementScale,t.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(t.roughnessMap=this.roughnessMap.toJSON(n).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(t.metalnessMap=this.metalnessMap.toJSON(n).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(t.emissiveMap=this.emissiveMap.toJSON(n).uuid),this.specularMap&&this.specularMap.isTexture&&(t.specularMap=this.specularMap.toJSON(n).uuid),this.envMap&&this.envMap.isTexture&&(t.envMap=this.envMap.toJSON(n).uuid,t.reflectivity=this.reflectivity),this.gradientMap&&this.gradientMap.isTexture&&(t.gradientMap=this.gradientMap.toJSON(n).uuid),this.size!==undefined&&(t.size=this.size),this.sizeAttenuation!==undefined&&(t.sizeAttenuation=this.sizeAttenuation),this.blending!==tf&&(t.blending=this.blending),this.flatShading===!0&&(t.flatShading=this.flatShading),this.side!==gu&&(t.side=this.side),this.vertexColors!==ic&&(t.vertexColors=this.vertexColors),this.opacity<1&&(t.opacity=this.opacity),this.transparent===!0&&(t.transparent=this.transparent),t.depthFunc=this.depthFunc,t.depthTest=this.depthTest,t.depthWrite=this.depthWrite,this.rotation!==0&&(t.rotation=this.rotation),this.linewidth!==1&&(t.linewidth=this.linewidth),this.dashSize!==undefined&&(t.dashSize=this.dashSize),this.gapSize!==undefined&&(t.gapSize=this.gapSize),this.scale!==undefined&&(t.scale=this.scale),this.dithering===!0&&(t.dithering=!0),this.alphaTest>0&&(t.alphaTest=this.alphaTest),this.premultipliedAlpha===!0&&(t.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(t.wireframe=this.wireframe),this.wireframeLinewidth>1&&(t.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(t.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(t.wireframeLinejoin=this.wireframeLinejoin),this.morphTargets===!0&&(t.morphTargets=!0),this.skinning===!0&&(t.skinning=!0),this.visible===!1&&(t.visible=!1),JSON.stringify(this.userData)!=="{}"&&(t.userData=this.userData),u&&(i=f(n.textures),r=f(n.images),i.length>0&&(t.textures=i),r.length>0&&(t.images=r)),t},clone:function(){return(new this.constructor).copy(this)},copy:function(n){var i,r,u,t;if(this.name=n.name,this.fog=n.fog,this.lights=n.lights,this.blending=n.blending,this.side=n.side,this.flatShading=n.flatShading,this.vertexColors=n.vertexColors,this.opacity=n.opacity,this.transparent=n.transparent,this.blendSrc=n.blendSrc,this.blendDst=n.blendDst,this.blendEquation=n.blendEquation,this.blendSrcAlpha=n.blendSrcAlpha,this.blendDstAlpha=n.blendDstAlpha,this.blendEquationAlpha=n.blendEquationAlpha,this.depthFunc=n.depthFunc,this.depthTest=n.depthTest,this.depthWrite=n.depthWrite,this.colorWrite=n.colorWrite,this.precision=n.precision,this.polygonOffset=n.polygonOffset,this.polygonOffsetFactor=n.polygonOffsetFactor,this.polygonOffsetUnits=n.polygonOffsetUnits,this.dithering=n.dithering,this.alphaTest=n.alphaTest,this.premultipliedAlpha=n.premultipliedAlpha,this.overdraw=n.overdraw,this.visible=n.visible,this.userData=JSON.parse(JSON.stringify(n.userData)),this.clipShadows=n.clipShadows,this.clipIntersection=n.clipIntersection,i=n.clippingPlanes,r=null,i!==null)for(u=i.length,r=new Array(u),t=0;t!==u;++t)r[t]=i[t].clone();return this.clippingPlanes=r,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});nr.prototype=Object.create(l.prototype);nr.prototype.constructor=nr;nr.prototype.isMeshDepthMaterial=!0;nr.prototype.copy=function(n){return l.prototype.copy.call(this,n),this.depthPacking=n.depthPacking,this.skinning=n.skinning,this.morphTargets=n.morphTargets,this.map=n.map,this.alphaMap=n.alphaMap,this.displacementMap=n.displacementMap,this.displacementScale=n.displacementScale,this.displacementBias=n.displacementBias,this.wireframe=n.wireframe,this.wireframeLinewidth=n.wireframeLinewidth,this};tr.prototype=Object.create(l.prototype);tr.prototype.constructor=tr;tr.prototype.isMeshDistanceMaterial=!0;tr.prototype.copy=function(n){return l.prototype.copy.call(this,n),this.referencePosition.copy(n.referencePosition),this.nearDistance=n.nearDistance,this.farDistance=n.farDistance,this.skinning=n.skinning,this.morphTargets=n.morphTargets,this.map=n.map,this.alphaMap=n.alphaMap,this.displacementMap=n.displacementMap,this.displacementScale=n.displacementScale,this.displacementBias=n.displacementBias,this};Object.assign(vi.prototype,{isBox3:!0,set:function(n,t){return this.min.copy(n),this.max.copy(t),this},setFromArray:function(n){for(var f=+ Infinity,e=+ Infinity,o=+ Infinity,s=- Infinity,h=- Infinity,c=- Infinity,t=0,l=n.length;t<l;t+=3){var i=n[t],r=n[t+1],u=n[t+2];i<f&&(f=i);r<e&&(e=r);u<o&&(o=u);i>s&&(s=i);r>h&&(h=r);u>c&&(c=u)}return this.min.set(f,e,o),this.max.set(s,h,c),this},setFromBufferAttribute:function(n){for(var f=+ Infinity,e=+ Infinity,o=+ Infinity,s=- Infinity,h=- Infinity,c=- Infinity,t=0,l=n.count;t<l;t++){var i=n.getX(t),r=n.getY(t),u=n.getZ(t);i<f&&(f=i);r<e&&(e=r);u<o&&(o=u);i>s&&(s=i);r>h&&(h=r);u>c&&(c=u)}return this.min.set(f,e,o),this.max.set(s,h,c),this},setFromPoints:function(n){var r=this,t,i;for(this.makeEmpty(),t=0,i=n.length;t<i;t++)r.expandByPoint(n[t]);return this},setFromCenterAndSize:function(){var t=new n;return function(n,i){var r=t.copy(i).multiplyScalar(.5);return this.min.copy(n).sub(r),this.max.copy(n).add(r),this}}(),setFromObject:function(n){return this.makeEmpty(),this.expandByObject(n)},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.min.copy(n.min),this.max.copy(n.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=+ Infinity,this.max.x=this.max.y=this.max.z=- Infinity,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(t){var i=t||new n;return this.isEmpty()?i.set(0,0,0):i.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){var i=t||new n;return this.isEmpty()?i.set(0,0,0):i.subVectors(this.max,this.min)},expandByPoint:function(n){return this.min.min(n),this.max.max(n),this},expandByVector:function(n){return this.min.sub(n),this.max.add(n),this},expandByScalar:function(n){return this.min.addScalar(-n),this.max.addScalar(n),this},expandByObject:function(){function f(n){var f=n.geometry,o,e;if(f!==undefined)if(f.isGeometry)for(o=f.vertices,t=0,r=o.length;t<r;t++)i.copy(o[t]),i.applyMatrix4(n.matrixWorld),u.expandByPoint(i);else if(f.isBufferGeometry&&(e=f.attributes.position,e!==undefined))for(t=0,r=e.count;t<r;t++)i.fromBufferAttribute(e,t).applyMatrix4(n.matrixWorld),u.expandByPoint(i)}var u,t,r,i=new n;return function(n){return u=this,n.updateMatrixWorld(!0),n.traverse(f),this}}(),containsPoint:function(n){return n.x<this.min.x||n.x>this.max.x||n.y<this.min.y||n.y>this.max.y||n.z<this.min.z||n.z>this.max.z?!1:!0},containsBox:function(n){return this.min.x<=n.min.x&&n.max.x<=this.max.x&&this.min.y<=n.min.y&&n.max.y<=this.max.y&&this.min.z<=n.min.z&&n.max.z<=this.max.z},getParameter:function(t,i){var r=i||new n;return r.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:function(n){return n.max.x<this.min.x||n.min.x>this.max.x||n.max.y<this.min.y||n.min.y>this.max.y||n.max.z<this.min.z||n.min.z>this.max.z?!1:!0},intersectsSphere:function(){var t=new n;return function(n){return this.clampPoint(n.center,t),t.distanceToSquared(n.center)<=n.radius*n.radius}}(),intersectsPlane:function(n){var t,i;return n.normal.x>0?(t=n.normal.x*this.min.x,i=n.normal.x*this.max.x):(t=n.normal.x*this.max.x,i=n.normal.x*this.min.x),n.normal.y>0?(t+=n.normal.y*this.min.y,i+=n.normal.y*this.max.y):(t+=n.normal.y*this.max.y,i+=n.normal.y*this.min.y),n.normal.z>0?(t+=n.normal.z*this.min.z,i+=n.normal.z*this.max.z):(t+=n.normal.z*this.max.z,i+=n.normal.z*this.min.z),t<=n.constant&&i>=n.constant},clampPoint:function(t,i){var r=i||new n;return r.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new n;return function(n){var i=t.copy(n).clamp(this.min,this.max);return i.sub(n).length()}}(),getBoundingSphere:function(){var t=new n;return function(n){var i=n||new ti;return this.getCenter(i.center),i.radius=this.getSize(t).length()*.5,i}}(),intersect:function(n){return this.min.max(n.min),this.max.min(n.max),this.isEmpty()&&this.makeEmpty(),this},union:function(n){return this.min.min(n.min),this.max.max(n.max),this},applyMatrix4:function(){var t=[new n,new n,new n,new n,new n,new n,new n,new n];return function(n){return this.isEmpty()?this:(t[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(n),t[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(n),t[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(n),t[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(n),t[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(n),t[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(n),t[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(n),t[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(n),this.setFromPoints(t),this)}}(),translate:function(n){return this.min.add(n),this.max.add(n),this},equals:function(n){return n.min.equals(this.min)&&n.max.equals(this.max)}});Object.assign(ti.prototype,{set:function(n,t){return this.center.copy(n),this.radius=t,this},setFromPoints:function(){var n=new vi;return function(t,i){var f=this.center,r,u,e;for(i!==undefined?f.copy(i):n.setFromPoints(t).getCenter(f),r=0,u=0,e=t.length;u<e;u++)r=Math.max(r,f.distanceToSquared(t[u]));return this.radius=Math.sqrt(r),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.center.copy(n.center),this.radius=n.radius,this},empty:function(){return this.radius<=0},containsPoint:function(n){return n.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(n){return n.distanceTo(this.center)-this.radius},intersectsSphere:function(n){var t=this.radius+n.radius;return n.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(n){return n.intersectsSphere(this)},intersectsPlane:function(n){return Math.abs(n.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,i){var u=this.center.distanceToSquared(t),r=i||new n;return r.copy(t),u>this.radius*this.radius&&(r.sub(this.center).normalize(),r.multiplyScalar(this.radius).add(this.center)),r},getBoundingBox:function(n){var t=n||new vi;return t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(n){return this.center.applyMatrix4(n),this.radius=this.radius*n.getMaxScaleOnAxis(),this},translate:function(n){return this.center.add(n),this},equals:function(n){return n.center.equals(this.center)&&n.radius===this.radius}});Object.assign(kt.prototype,{set:function(n,t){return this.normal.copy(n),this.constant=t,this},setComponents:function(n,t,i,r){return this.normal.set(n,t,i),this.constant=r,this},setFromNormalAndCoplanarPoint:function(n,t){return this.normal.copy(n),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(){var t=new n,i=new n;return function(n,r,u){var f=t.subVectors(u,r).cross(i.subVectors(n,r)).normalize();return this.setFromNormalAndCoplanarPoint(f,n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.normal.copy(n.normal),this.constant=n.constant,this},normalize:function(){var n=1/this.normal.length();return this.normal.multiplyScalar(n),this.constant*=n,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(n){return this.normal.dot(n)+this.constant},distanceToSphere:function(n){return this.distanceToPoint(n.center)-n.radius},projectPoint:function(t,i){var r=i||new n;return r.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(){var t=new n;return function(i,r){var f=r||new n,e=i.delta(t),o=this.normal.dot(e),u;return o===0?this.distanceToPoint(i.start)===0?f.copy(i.start):undefined:(u=-(i.start.dot(this.normal)+this.constant)/o,u<0||u>1)?undefined:f.copy(e).multiplyScalar(u).add(i.start)}}(),intersectsLine:function(n){var t=this.distanceToPoint(n.start),i=this.distanceToPoint(n.end);return t<0&&i>0||i<0&&t>0},intersectsBox:function(n){return n.intersectsPlane(this)},intersectsSphere:function(n){return n.intersectsPlane(this)},coplanarPoint:function(t){var i=t||new n;return i.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var t=new n,i=new ot;return function(n,r){var u=r||i.getNormalMatrix(n),f=this.coplanarPoint(t).applyMatrix4(n),e=this.normal.applyMatrix3(u).normalize();return this.constant=-f.dot(e),this}}(),translate:function(n){return this.constant-=n.dot(this.normal),this},equals:function(n){return n.normal.equals(this.normal)&&n.constant===this.constant}});Object.assign(tl.prototype,{set:function(n,t,i,r,u,f){var e=this.planes;return e[0].copy(n),e[1].copy(t),e[2].copy(i),e[3].copy(r),e[4].copy(u),e[5].copy(f),this},clone:function(){return(new this.constructor).copy(this)},copy:function(n){for(var i=this.planes,t=0;t<6;t++)i[t].copy(n.planes[t]);return this},setFromMatrix:function(n){var i=this.planes,t=n.elements,o=t[0],s=t[1],h=t[2],r=t[3],c=t[4],l=t[5],a=t[6],u=t[7],v=t[8],y=t[9],p=t[10],f=t[11],w=t[12],b=t[13],k=t[14],e=t[15];return i[0].setComponents(r-o,u-c,f-v,e-w).normalize(),i[1].setComponents(r+o,u+c,f+v,e+w).normalize(),i[2].setComponents(r+s,u+l,f+y,e+b).normalize(),i[3].setComponents(r-s,u-l,f-y,e-b).normalize(),i[4].setComponents(r-h,u-a,f-p,e-k).normalize(),i[5].setComponents(r+h,u+a,f+p,e+k).normalize(),this},intersectsObject:function(){var n=new ti;return function(t){var i=t.geometry;return i.boundingSphere===null&&i.computeBoundingSphere(),n.copy(i.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(n)}}(),intersectsSprite:function(){var n=new ti;return function(t){return n.center.set(0,0,0),n.radius=.70710678118654757,n.applyMatrix4(t.matrixWorld),this.intersectsSphere(n)}}(),intersectsSphere:function(n){for(var r=this.planes,u=n.center,f=-n.radius,i,t=0;t<6;t++)if(i=r[t].distanceToPoint(u),i<f)return!1;return!0},intersectsBox:function(){var t=new n,i=new n;return function(n){for(var o=this.planes,r,f,e,u=0;u<6;u++)if(r=o[u],t.x=r.normal.x>0?n.min.x:n.max.x,i.x=r.normal.x>0?n.max.x:n.min.x,t.y=r.normal.y>0?n.min.y:n.max.y,i.y=r.normal.y>0?n.max.y:n.min.y,t.z=r.normal.z>0?n.min.z:n.max.z,i.z=r.normal.z>0?n.max.z:n.min.z,f=r.distanceToPoint(t),e=r.distanceToPoint(i),f<0&&e<0)return!1;return!0}}(),containsPoint:function(n){for(var i=this.planes,t=0;t<6;t++)if(i[t].distanceToPoint(n)<0)return!1;return!0}});yi.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];yi.DefaultOrder="XYZ";Object.defineProperties(yi.prototype,{x:{get:function(){return this._x},set:function(n){this._x=n;this.onChangeCallback()}},y:{get:function(){return this._y},set:function(n){this._y=n;this.onChangeCallback()}},z:{get:function(){return this._z},set:function(n){this._z=n;this.onChangeCallback()}},order:{get:function(){return this._order},set:function(n){this._order=n;this.onChangeCallback()}}});Object.assign(yi.prototype,{isEuler:!0,set:function(n,t,i,r){return this._x=n,this._y=t,this._z=i,this._order=r||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(n){return this._x=n._x,this._y=n._y,this._z=n._z,this._order=n._order,this.onChangeCallback(),this},setFromRotationMatrix:function(n,t,i){var u=h.clamp,r=n.elements,f=r[0],s=r[4],c=r[8],l=r[1],e=r[5],a=r[9],v=r[2],y=r[6],o=r[10];return t=t||this._order,t==="XYZ"?(this._y=Math.asin(u(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(-a,o),this._z=Math.atan2(-s,f)):(this._x=Math.atan2(y,e),this._z=0)):t==="YXZ"?(this._x=Math.asin(-u(a,-1,1)),Math.abs(a)<.99999?(this._y=Math.atan2(c,o),this._z=Math.atan2(l,e)):(this._y=Math.atan2(-v,f),this._z=0)):t==="ZXY"?(this._x=Math.asin(u(y,-1,1)),Math.abs(y)<.99999?(this._y=Math.atan2(-v,o),this._z=Math.atan2(-s,e)):(this._y=0,this._z=Math.atan2(l,f))):t==="ZYX"?(this._y=Math.asin(-u(v,-1,1)),Math.abs(v)<.99999?(this._x=Math.atan2(y,o),this._z=Math.atan2(l,f)):(this._x=0,this._z=Math.atan2(-s,e))):t==="YZX"?(this._z=Math.asin(u(l,-1,1)),Math.abs(l)<.99999?(this._x=Math.atan2(-a,e),this._y=Math.atan2(-v,f)):(this._x=0,this._y=Math.atan2(c,o))):t==="XZY"?(this._z=Math.asin(-u(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(y,e),this._y=Math.atan2(c,f)):(this._x=Math.atan2(-a,o),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,i!==!1&&this.onChangeCallback(),this},setFromQuaternion:function(){var n=new o;return function(t,i,r){return n.makeRotationFromQuaternion(t),this.setFromRotationMatrix(n,i,r)}}(),setFromVector3:function(n,t){return this.set(n.x,n.y,n.z,t||this._order)},reorder:function(){var n=new g;return function(t){return n.setFromEuler(this),this.setFromQuaternion(n,t)}}(),equals:function(n){return n._x===this._x&&n._y===this._y&&n._z===this._z&&n._order===this._order},fromArray:function(n){return this._x=n[0],this._y=n[1],this._z=n[2],n[3]!==undefined&&(this._order=n[3]),this.onChangeCallback(),this},toArray:function(n,t){return n===undefined&&(n=[]),t===undefined&&(t=0),n[t]=this._x,n[t+1]=this._y,n[t+2]=this._z,n[t+3]=this._order,n},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new n(this._x,this._y,this._z)},onChange:function(n){return this.onChangeCallback=n,this},onChangeCallback:function(){}});Object.assign(fp.prototype,{set:function(n){this.mask=1<<n|0},enable:function(n){this.mask|=1<<n|0},toggle:function(n){this.mask^=1<<n|0},disable:function(n){this.mask&=~(1<<n|0)},test:function(n){return(this.mask&n.mask)!=0}});ep=0;r.DefaultUp=new n(0,1,0);r.DefaultMatrixAutoUpdate=!0;Object.assign(r.prototype,bt.prototype,{isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(n){this.matrix.multiplyMatrices(n,this.matrix);this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(n){return this.quaternion.premultiply(n),this},setRotationFromAxisAngle:function(n,t){this.quaternion.setFromAxisAngle(n,t)},setRotationFromEuler:function(n){this.quaternion.setFromEuler(n,!0)},setRotationFromMatrix:function(n){this.quaternion.setFromRotationMatrix(n)},setRotationFromQuaternion:function(n){this.quaternion.copy(n)},rotateOnAxis:function(){var n=new g;return function(t,i){return n.setFromAxisAngle(t,i),this.quaternion.multiply(n),this}}(),rotateOnWorldAxis:function(){var n=new g;return function(t,i){return n.setFromAxisAngle(t,i),this.quaternion.premultiply(n),this}}(),rotateX:function(){var t=new n(1,0,0);return function(n){return this.rotateOnAxis(t,n)}}(),rotateY:function(){var t=new n(0,1,0);return function(n){return this.rotateOnAxis(t,n)}}(),rotateZ:function(){var t=new n(0,0,1);return function(n){return this.rotateOnAxis(t,n)}}(),translateOnAxis:function(){var t=new n;return function(n,i){return t.copy(n).applyQuaternion(this.quaternion),this.position.add(t.multiplyScalar(i)),this}}(),translateX:function(){var t=new n(1,0,0);return function(n){return this.translateOnAxis(t,n)}}(),translateY:function(){var t=new n(0,1,0);return function(n){return this.translateOnAxis(t,n)}}(),translateZ:function(){var t=new n(0,0,1);return function(n){return this.translateOnAxis(t,n)}}(),localToWorld:function(n){return n.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var n=new o;return function(t){return t.applyMatrix4(n.getInverse(this.matrixWorld))}}(),lookAt:function(){var i=new o,t=new n;return function(n,r,u){n.isVector3?t.copy(n):t.set(n,r,u);this.isCamera?i.lookAt(this.position,t,this.up):i.lookAt(t,this.position,this.up);this.quaternion.setFromRotationMatrix(i)}}(),add:function(n){var i=arguments,r=this,t;if(arguments.length>1){for(t=0;t<arguments.length;t++)r.add(i[t]);return this}return n===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",n),this):(n&&n.isObject3D?(n.parent!==null&&n.parent.remove(n),n.parent=this,n.dispatchEvent({type:"added"}),this.children.push(n)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",n),this)},remove:function(n){var r=arguments,u=this,t,i;if(arguments.length>1){for(t=0;t<arguments.length;t++)u.remove(r[t]);return this}return i=this.children.indexOf(n),i!==-1&&(n.parent=null,n.dispatchEvent({type:"removed"}),this.children.splice(i,1)),this},getObjectById:function(n){return this.getObjectByProperty("id",n)},getObjectByName:function(n){return this.getObjectByProperty("name",n)},getObjectByProperty:function(n,t){var e=this,i,u,f,r;if(this[n]===t)return this;for(i=0,u=this.children.length;i<u;i++)if(f=e.children[i],r=f.getObjectByProperty(n,t),r!==undefined)return r;return undefined},getWorldPosition:function(t){var i=t||new n;return this.updateMatrixWorld(!0),i.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var t=new n,i=new n;return function(n){var r=n||new g;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(t,r,i),r}}(),getWorldRotation:function(){var n=new g;return function(t){var i=t||new yi;return this.getWorldQuaternion(n),i.setFromQuaternion(n,this.rotation.order,!1)}}(),getWorldScale:function(){var t=new n,i=new g;return function(r){var u=r||new n;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(t,i,u),u}}(),getWorldDirection:function(){var t=new g;return function(i){var r=i||new n;return this.getWorldQuaternion(t),r.set(0,0,1).applyQuaternion(t)}}(),raycast:function(){},traverse:function(n){var i,t,r;for(n(this),i=this.children,t=0,r=i.length;t<r;t++)i[t].traverse(n)},traverseVisible:function(n){var i,t,r;if(this.visible!==!1)for(n(this),i=this.children,t=0,r=i.length;t<r;t++)i[t].traverseVisible(n)},traverseAncestors:function(n){var t=this.parent;t!==null&&(n(t),t.traverseAncestors(n))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(n){var i,t,r;for(this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||n)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,n=!0),i=this.children,t=0,r=i.length;t<r;t++)i[t].updateMatrixWorld(n)},toJSON:function(n){function f(t,i){return t[i.uuid]===undefined&&(t[i.uuid]=i.toJSON(n)),i.uuid}function u(n){var i=[],r,t;for(r in n)t=n[r],delete t.metadata,i.push(t);return i}var o=this,s=n===undefined||typeof n=="string",r={},t,e,h,i;if(s&&(n={geometries:{},materials:{},textures:{},images:{}},r.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"}),t={},t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),this.castShadow===!0&&(t.castShadow=!0),this.receiveShadow===!0&&(t.receiveShadow=!0),this.visible===!1&&(t.visible=!1),JSON.stringify(this.userData)!=="{}"&&(t.userData=this.userData),t.matrix=this.matrix.toArray(),this.geometry!==undefined&&(t.geometry=f(n.geometries,this.geometry)),this.material!==undefined)if(Array.isArray(this.material)){for(e=[],i=0,h=this.material.length;i<h;i++)e.push(f(n.materials,o.material[i]));t.material=e}else t.material=f(n.materials,this.material);if(this.children.length>0)for(t.children=[],i=0;i<this.children.length;i++)t.children.push(o.children[i].toJSON(n).object);if(s){var c=u(n.geometries),l=u(n.materials),a=u(n.textures),v=u(n.images);c.length>0&&(r.geometries=c);l.length>0&&(r.materials=l);a.length>0&&(r.textures=a);v.length>0&&(r.images=v)}return r.object=t,r},clone:function(n){return(new this.constructor).copy(this,n)},copy:function(n,t){var u=this,i,r;if(t===undefined&&(t=!0),this.name=n.name,this.up.copy(n.up),this.position.copy(n.position),this.quaternion.copy(n.quaternion),this.scale.copy(n.scale),this.matrix.copy(n.matrix),this.matrixWorld.copy(n.matrixWorld),this.matrixAutoUpdate=n.matrixAutoUpdate,this.matrixWorldNeedsUpdate=n.matrixWorldNeedsUpdate,this.layers.mask=n.layers.mask,this.visible=n.visible,this.castShadow=n.castShadow,this.receiveShadow=n.receiveShadow,this.frustumCulled=n.frustumCulled,this.renderOrder=n.renderOrder,this.userData=JSON.parse(JSON.stringify(n.userData)),t===!0)for(i=0;i<n.children.length;i++)r=n.children[i],u.add(r.clone());return this}});oi.prototype=Object.assign(Object.create(r.prototype),{constructor:oi,isCamera:!0,copy:function(n,t){return r.prototype.copy.call(this,n,t),this.matrixWorldInverse.copy(n.matrixWorldInverse),this.projectionMatrix.copy(n.projectionMatrix),this},getWorldDirection:function(){var t=new g;return function(i){var r=i||new n;return this.getWorldQuaternion(t),r.set(0,0,-1).applyQuaternion(t)}}(),updateMatrixWorld:function(n){r.prototype.updateMatrixWorld.call(this,n);this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}});sf.prototype=Object.assign(Object.create(oi.prototype),{constructor:sf,isOrthographicCamera:!0,copy:function(n,t){return oi.prototype.copy.call(this,n,t),this.left=n.left,this.right=n.right,this.top=n.top,this.bottom=n.bottom,this.near=n.near,this.far=n.far,this.zoom=n.zoom,this.view=n.view===null?null:Object.assign({},n.view),this},setViewOffset:function(n,t,i,r,u,f){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1});this.view.enabled=!0;this.view.fullWidth=n;this.view.fullHeight=t;this.view.offsetX=i;this.view.offsetY=r;this.view.width=u;this.view.height=f;this.updateProjectionMatrix()},clearViewOffset:function(){this.view!==null&&(this.view.enabled=!1);this.updateProjectionMatrix()},updateProjectionMatrix:function(){var i=(this.right-this.left)/(2*this.zoom),r=(this.top-this.bottom)/(2*this.zoom),u=(this.right+this.left)/2,f=(this.top+this.bottom)/2,n=u-i,e=u+i,t=f+r,o=f-r;if(this.view!==null&&this.view.enabled){var s=this.zoom/(this.view.width/this.view.fullWidth),h=this.zoom/(this.view.height/this.view.fullHeight),c=(this.right-this.left)/this.view.width,l=(this.top-this.bottom)/this.view.height;n+=c*(this.view.offsetX/s);e=n+c*(this.view.width/s);t-=l*(this.view.offsetY/h);o=t-l*(this.view.height/h)}this.projectionMatrix.makeOrthographic(n,e,t,o,this.near,this.far)},toJSON:function(n){var t=r.prototype.toJSON.call(this,n);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}});Object.assign(ir.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(n){var r=this,t,i;for(this.a=n.a,this.b=n.b,this.c=n.c,this.normal.copy(n.normal),this.color.copy(n.color),this.materialIndex=n.materialIndex,t=0,i=n.vertexNormals.length;t<i;t++)r.vertexNormals[t]=n.vertexNormals[t].clone();for(t=0,i=n.vertexColors.length;t<i;t++)r.vertexColors[t]=n.vertexColors[t].clone();return this}});op=0;Object.assign(s.prototype,bt.prototype,{isGeometry:!0,applyMatrix:function(n){for(var f=this,e=(new ot).getNormalMatrix(n),o,r,u,s,t=0,i=this.vertices.length;t<i;t++)o=f.vertices[t],o.applyMatrix4(n);for(t=0,i=this.faces.length;t<i;t++)for(r=f.faces[t],r.normal.applyMatrix3(e).normalize(),u=0,s=r.vertexNormals.length;u<s;u++)r.vertexNormals[u].applyMatrix3(e).normalize();return this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(){var n=new o;return function(t){return n.makeRotationX(t),this.applyMatrix(n),this}}(),rotateY:function(){var n=new o;return function(t){return n.makeRotationY(t),this.applyMatrix(n),this}}(),rotateZ:function(){var n=new o;return function(t){return n.makeRotationZ(t),this.applyMatrix(n),this}}(),translate:function(){var n=new o;return function(t,i,r){return n.makeTranslation(t,i,r),this.applyMatrix(n),this}}(),scale:function(){var n=new o;return function(t,i,r){return n.makeScale(t,i,r),this.applyMatrix(n),this}}(),lookAt:function(){var n=new r;return function(t){n.lookAt(t);n.updateMatrix();this.applyMatrix(n.matrix)}}(),fromBufferGeometry:function(i){function b(n,t,i,r){var u=c!==undefined?[y[n].clone(),y[t].clone(),y[i].clone()]:[],f=l!==undefined?[s.colors[n].clone(),s.colors[t].clone(),s.colors[i].clone()]:[],e=new ir(n,t,i,u,f,r);s.faces.push(e);v!==undefined&&s.faceVertexUvs[0].push([p[n].clone(),p[t].clone(),p[i].clone()]);a!==undefined&&s.faceVertexUvs[1].push([w[n].clone(),w[t].clone(),w[i].clone()])}var s=this,e=i.index!==null?i.index.array:undefined,o=i.attributes,h=o.position.array,c=o.normal!==undefined?o.normal.array:undefined,l=o.color!==undefined?o.color.array:undefined,v=o.uv!==undefined?o.uv.array:undefined,a=o.uv2!==undefined?o.uv2.array:undefined,k,u,nt,r;a!==undefined&&(this.faceVertexUvs[1]=[]);var y=[],p=[],w=[];for(r=0,u=0;r<h.length;r+=3,u+=2)s.vertices.push(new n(h[r],h[r+1],h[r+2])),c!==undefined&&y.push(new n(c[r],c[r+1],c[r+2])),l!==undefined&&s.colors.push(new f(l[r],l[r+1],l[r+2])),v!==undefined&&p.push(new t(v[u],v[u+1])),a!==undefined&&w.push(new t(a[u],a[u+1]));if(k=i.groups,k.length>0)for(r=0;r<k.length;r++){var d=k[r],g=d.start,tt=d.count;for(u=g,nt=g+tt;u<nt;u+=3)e!==undefined?b(e[u],e[u+1],e[u+2],d.materialIndex):b(u,u+1,u+2,d.materialIndex)}else if(e!==undefined)for(r=0;r<e.length;r+=3)b(e[r],e[r+1],e[r+2]);else for(r=0;r<h.length/3;r+=3)b(r,r+1,r+2);return this.computeFaceNormals(),i.boundingBox!==null&&(this.boundingBox=i.boundingBox.clone()),i.boundingSphere!==null&&(this.boundingSphere=i.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var n=this.boundingBox.getCenter().negate();return this.translate(n.x,n.y,n.z),n},normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,i=this.boundingSphere.radius,n=i===0?1:1/i,r=new o;return r.set(n,0,0,-n*t.x,0,n,0,-n*t.y,0,0,n,-n*t.z,0,0,0,1),this.applyMatrix(r),this},computeFaceNormals:function(){for(var t=this,i=new n,f=new n,r=0,e=this.faces.length;r<e;r++){var u=t.faces[r],s=t.vertices[u.a],o=t.vertices[u.b],h=t.vertices[u.c];i.subVectors(h,o);f.subVectors(s,o);i.cross(f);i.normalize();u.normal.copy(i)}},computeVertexNormals:function(t){var o=this,f,c,u,s,i,r,v,l,y,h,a,e;for(t===undefined&&(t=!0),r=new Array(this.vertices.length),f=0,c=this.vertices.length;f<c;f++)r[f]=new n;if(t)for(h=new n,a=new n,u=0,s=this.faces.length;u<s;u++)i=o.faces[u],v=o.vertices[i.a],l=o.vertices[i.b],y=o.vertices[i.c],h.subVectors(y,l),a.subVectors(v,l),h.cross(a),r[i.a].add(h),r[i.b].add(h),r[i.c].add(h);else for(this.computeFaceNormals(),u=0,s=this.faces.length;u<s;u++)i=o.faces[u],r[i.a].add(i.normal),r[i.b].add(i.normal),r[i.c].add(i.normal);for(f=0,c=this.vertices.length;f<c;f++)r[f].normalize();for(u=0,s=this.faces.length;u<s;u++)i=o.faces[u],e=i.vertexNormals,e.length===3?(e[0].copy(r[i.a]),e[1].copy(r[i.b]),e[2].copy(r[i.c])):(e[0]=r[i.a].clone(),e[1]=r[i.b].clone(),e[2]=r[i.c].clone());this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var u=this,i,r,n,t;for(this.computeFaceNormals(),i=0,r=this.faces.length;i<r;i++)n=u.faces[i],t=n.vertexNormals,t.length===3?(t[0].copy(n.normal),t[1].copy(n.normal),t[2].copy(n.normal)):(t[0]=n.normal.clone(),t[1]=n.normal.clone(),t[2]=n.normal.clone());this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var u=this,i,h,t,o,a,v,l,c,e,r=0,f=this.faces.length;r<f;r++)for(t=u.faces[r],t.__originalFaceNormal?t.__originalFaceNormal.copy(t.normal):t.__originalFaceNormal=t.normal.clone(),t.__originalVertexNormals||(t.__originalVertexNormals=[]),i=0,h=t.vertexNormals.length;i<h;i++)t.__originalVertexNormals[i]?t.__originalVertexNormals[i].copy(t.vertexNormals[i]):t.__originalVertexNormals[i]=t.vertexNormals[i].clone();for(o=new s,o.faces=this.faces,i=0,h=this.morphTargets.length;i<h;i++){if(!u.morphNormals[i])for(u.morphNormals[i]={},u.morphNormals[i].faceNormals=[],u.morphNormals[i].vertexNormals=[],a=u.morphNormals[i].faceNormals,v=u.morphNormals[i].vertexNormals,r=0,f=this.faces.length;r<f;r++)c=new n,e={a:new n,b:new n,c:new n},a.push(c),v.push(e);for(l=u.morphNormals[i],o.vertices=u.morphTargets[i].vertices,o.computeFaceNormals(),o.computeVertexNormals(),r=0,f=this.faces.length;r<f;r++)t=u.faces[r],c=l.faceNormals[r],e=l.vertexNormals[r],c.copy(t.normal),e.a.copy(t.vertexNormals[0]),e.b.copy(t.vertexNormals[1]),e.c.copy(t.vertexNormals[2])}for(r=0,f=this.faces.length;r<f;r++)t=u.faces[r],t.normal=t.__originalFaceNormal,t.vertexNormals=t.__originalVertexNormals},computeLineDistances:function(){for(var u=this,i=0,t=this.vertices,n=0,r=t.length;n<r;n++)n>0&&(i+=t[n].distanceTo(t[n-1])),u.lineDistances[n]=i},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new vi);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new ti);this.boundingSphere.setFromPoints(this.vertices)},merge:function(n,t,i){var d,a,r,f,c,y,u,s;if(!(n&&n.isGeometry)){console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",n);return}var h,l=this.vertices.length,it=this.vertices,p=n.vertices,rt=this.faces,w=n.faces,ut=this.faceVertexUvs[0],b=n.faceVertexUvs[0],ft=this.colors,k=n.colors;for(i===undefined&&(i=0),t!==undefined&&(h=(new ot).getNormalMatrix(t)),r=0,f=p.length;r<f;r++)d=p[r],a=d.clone(),t!==undefined&&a.applyMatrix4(t),it.push(a);for(r=0,f=k.length;r<f;r++)ft.push(k[r].clone());for(r=0,f=w.length;r<f;r++){var e=w[r],o,v,g,nt=e.vertexNormals,tt=e.vertexColors;for(o=new ir(e.a+l,e.b+l,e.c+l),o.normal.copy(e.normal),h!==undefined&&o.normal.applyMatrix3(h).normalize(),u=0,s=nt.length;u<s;u++)v=nt[u].clone(),h!==undefined&&v.applyMatrix3(h).normalize(),o.vertexNormals.push(v);for(o.color.copy(e.color),u=0,s=tt.length;u<s;u++)g=tt[u],o.vertexColors.push(g.clone());o.materialIndex=e.materialIndex+i;rt.push(o)}for(r=0,f=b.length;r<f;r++)if(c=b[r],y=[],c!==undefined){for(u=0,s=c.length;u<s;u++)y.push(c[u].clone());ut.push(y)}},mergeMesh:function(n){if(!(n&&n.isMesh)){console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",n);return}n.matrixAutoUpdate&&n.updateMatrix();this.merge(n.geometry,n.matrix)},mergeVertices:function(){for(var r=this,l={},f=[],i=[],e,o,a=Math.pow(10,4),t,v,h,p,c,u,y,w,n=0,s=this.vertices.length;n<s;n++)e=r.vertices[n],o=Math.round(e.x*a)+"_"+Math.round(e.y*a)+"_"+Math.round(e.z*a),l[o]===undefined?(l[o]=n,f.push(r.vertices[n]),i[n]=f.length-1):i[n]=i[l[o]];for(c=[],n=0,s=this.faces.length;n<s;n++)for(t=r.faces[n],t.a=i[t.a],t.b=i[t.b],t.c=i[t.c],v=[t.a,t.b,t.c],u=0;u<3;u++)if(v[u]===v[(u+1)%3]){c.push(n);break}for(n=c.length-1;n>=0;n--)for(y=c[n],r.faces.splice(y,1),h=0,p=this.faceVertexUvs.length;h<p;h++)r.faceVertexUvs[h].splice(y,1);return w=this.vertices.length-f.length,this.vertices=f,w},setFromPoints:function(t){var f=this,i,u,r;for(this.vertices=[],i=0,u=t.length;i<u;i++)r=t[i],f.vertices.push(new n(r.x,r.y,r.z||0));return this},sortFacesByMaterialIndex:function(){function s(n,t){return n.materialIndex-t.materialIndex}for(var r=this.faces,u=r.length,f,e,t,i,o,n=0;n<u;n++)r[n]._id=n;for(r.sort(s),f=this.faceVertexUvs[0],e=this.faceVertexUvs[1],f&&f.length===u&&(t=[]),e&&e.length===u&&(i=[]),n=0;n<u;n++)o=r[n]._id,t&&t.push(f[o]),i&&i.push(e[o]);t&&(this.faceVertexUvs[0]=t);i&&(this.faceVertexUvs[1]=i)},toJSON:function(){function f(n,t,i){return i?n|1<<t:n&~(1<<t)}function k(n){var t=n.x.toString()+n.y.toString()+n.z.toString();return c[t]!==undefined?c[t]:(c[t]=nt.length/3,nt.push(n.x,n.y,n.z),c[t])}function d(n){var t=n.r.toString()+n.g.toString()+n.b.toString();return a[t]!==undefined?a[t]:(a[t]=l.length,l.push(n.getHex()),a[t])}function tt(n){var t=n.x.toString()+n.y.toString();return y[t]!==undefined?y[t]:(y[t]=v.length/2,v.push(n.x,n.y),y[t])}var e=this,i={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}},o,s,g,h,r,p,w,b;if(i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.parameters!==undefined){o=this.parameters;for(s in o)o[s]!==undefined&&(i[s]=o[s]);return i}for(g=[],r=0;r<this.vertices.length;r++)h=e.vertices[r],g.push(h.x,h.y,h.z);var u=[],nt=[],c={},l=[],a={},v=[],y={};for(r=0;r<this.faces.length;r++){var t=e.faces[r],it=e.faceVertexUvs[0][r]!==undefined,rt=t.normal.length()>0,ut=t.vertexNormals.length>0,ft=t.color.r!==1||t.color.g!==1||t.color.b!==1,et=t.vertexColors.length>0,n=0;n=f(n,0,0);n=f(n,1,!0);n=f(n,2,!1);n=f(n,3,it);n=f(n,4,rt);n=f(n,5,ut);n=f(n,6,ft);n=f(n,7,et);u.push(n);u.push(t.a,t.b,t.c);u.push(t.materialIndex);it&&(p=e.faceVertexUvs[0][r],u.push(tt(p[0]),tt(p[1]),tt(p[2])));rt&&u.push(k(t.normal));ut&&(w=t.vertexNormals,u.push(k(w[0]),k(w[1]),k(w[2])));ft&&u.push(d(t.color));et&&(b=t.vertexColors,u.push(d(b[0]),d(b[1]),d(b[2])))}return i.data={},i.data.vertices=g,i.data.normals=nt,l.length>0&&(i.data.colors=l),v.length>0&&(i.data.uvs=[v]),i.data.faces=u,i},clone:function(){return(new s).copy(this)},copy:function(n){var u=this,t,r,i,f,l,rt,v,y,p,w,b,k,ut,e,s,o,h,a,c,d,g,nt,tt,it;for(this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=n.name,v=n.vertices,t=0,r=v.length;t<r;t++)u.vertices.push(v[t].clone());for(y=n.colors,t=0,r=y.length;t<r;t++)u.colors.push(y[t].clone());for(p=n.faces,t=0,r=p.length;t<r;t++)u.faces.push(p[t].clone());for(t=0,r=n.faceVertexUvs.length;t<r;t++)for(w=n.faceVertexUvs[t],u.faceVertexUvs[t]===undefined&&(u.faceVertexUvs[t]=[]),i=0,f=w.length;i<f;i++){for(b=w[i],k=[],l=0,rt=b.length;l<rt;l++)ut=b[l],k.push(ut.clone());u.faceVertexUvs[t].push(k)}for(e=n.morphTargets,t=0,r=e.length;t<r;t++){if(s={},s.name=e[t].name,e[t].vertices!==undefined)for(s.vertices=[],i=0,f=e[t].vertices.length;i<f;i++)s.vertices.push(e[t].vertices[i].clone());if(e[t].normals!==undefined)for(s.normals=[],i=0,f=e[t].normals.length;i<f;i++)s.normals.push(e[t].normals[i].clone());u.morphTargets.push(s)}for(o=n.morphNormals,t=0,r=o.length;t<r;t++){if(h={},o[t].vertexNormals!==undefined)for(h.vertexNormals=[],i=0,f=o[t].vertexNormals.length;i<f;i++)a=o[t].vertexNormals[i],c={},c.a=a.a.clone(),c.b=a.b.clone(),c.c=a.c.clone(),h.vertexNormals.push(c);if(o[t].faceNormals!==undefined)for(h.faceNormals=[],i=0,f=o[t].faceNormals.length;i<f;i++)h.faceNormals.push(o[t].faceNormals[i].clone());u.morphNormals.push(h)}for(d=n.skinWeights,t=0,r=d.length;t<r;t++)u.skinWeights.push(d[t].clone());for(g=n.skinIndices,t=0,r=g.length;t<r;t++)u.skinIndices.push(g[t].clone());for(nt=n.lineDistances,t=0,r=nt.length;t<r;t++)u.lineDistances.push(nt[t]);return tt=n.boundingBox,tt!==null&&(this.boundingBox=tt.clone()),it=n.boundingSphere,it!==null&&(this.boundingSphere=it.clone()),this.elementsNeedUpdate=n.elementsNeedUpdate,this.verticesNeedUpdate=n.verticesNeedUpdate,this.uvsNeedUpdate=n.uvsNeedUpdate,this.normalsNeedUpdate=n.normalsNeedUpdate,this.colorsNeedUpdate=n.colorsNeedUpdate,this.lineDistancesNeedUpdate=n.lineDistancesNeedUpdate,this.groupsNeedUpdate=n.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});Object.defineProperty(c.prototype,"needsUpdate",{set:function(n){n===!0&&this.version++}});Object.assign(c.prototype,{isBufferAttribute:!0,setArray:function(n){if(Array.isArray(n))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=n!==undefined?n.length/this.itemSize:0;this.array=n},setDynamic:function(n){return this.dynamic=n,this},copy:function(n){return this.array=new n.array.constructor(n.array),this.itemSize=n.itemSize,this.count=n.count,this.normalized=n.normalized,this.dynamic=n.dynamic,this},copyAt:function(n,t,i){var f=this,r,u;for(n*=this.itemSize,i*=t.itemSize,r=0,u=this.itemSize;r<u;r++)f.array[n+r]=t.array[i+r];return this},copyArray:function(n){return this.array.set(n),this},copyColorsArray:function(n){for(var r=this.array,u=0,t,i=0,e=n.length;i<e;i++)t=n[i],t===undefined&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),t=new f),r[u++]=t.r,r[u++]=t.g,r[u++]=t.b;return this},copyIndicesArray:function(n){for(var r=this.array,u=0,i,t=0,f=n.length;t<f;t++)i=n[t],r[u++]=i.a,r[u++]=i.b,r[u++]=i.c;return this},copyVector2sArray:function(n){for(var u=this.array,f=0,r,i=0,e=n.length;i<e;i++)r=n[i],r===undefined&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),r=new t),u[f++]=r.x,u[f++]=r.y;return this},copyVector3sArray:function(t){for(var u=this.array,f=0,i,r=0,e=t.length;r<e;r++)i=t[r],i===undefined&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),i=new n),u[f++]=i.x,u[f++]=i.y,u[f++]=i.z;return this},copyVector4sArray:function(n){for(var r=this.array,u=0,t,i=0,f=n.length;i<f;i++)t=n[i],t===undefined&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),t=new p),r[u++]=t.x,r[u++]=t.y,r[u++]=t.z,r[u++]=t.w;return this},set:function(n,t){return t===undefined&&(t=0),this.array.set(n,t),this},getX:function(n){return this.array[n*this.itemSize]},setX:function(n,t){return this.array[n*this.itemSize]=t,this},getY:function(n){return this.array[n*this.itemSize+1]},setY:function(n,t){return this.array[n*this.itemSize+1]=t,this},getZ:function(n){return this.array[n*this.itemSize+2]},setZ:function(n,t){return this.array[n*this.itemSize+2]=t,this},getW:function(n){return this.array[n*this.itemSize+3]},setW:function(n,t){return this.array[n*this.itemSize+3]=t,this},setXY:function(n,t,i){return n*=this.itemSize,this.array[n+0]=t,this.array[n+1]=i,this},setXYZ:function(n,t,i,r){return n*=this.itemSize,this.array[n+0]=t,this.array[n+1]=i,this.array[n+2]=r,this},setXYZW:function(n,t,i,r,u){return n*=this.itemSize,this.array[n+0]=t,this.array[n+1]=i,this.array[n+2]=r,this.array[n+3]=u,this},onUpload:function(n){return this.onUploadCallback=n,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)}});il.prototype=Object.create(c.prototype);il.prototype.constructor=il;rl.prototype=Object.create(c.prototype);rl.prototype.constructor=rl;ul.prototype=Object.create(c.prototype);ul.prototype.constructor=ul;fl.prototype=Object.create(c.prototype);fl.prototype.constructor=fl;hf.prototype=Object.create(c.prototype);hf.prototype.constructor=hf;el.prototype=Object.create(c.prototype);el.prototype.constructor=el;cf.prototype=Object.create(c.prototype);cf.prototype.constructor=cf;i.prototype=Object.create(c.prototype);i.prototype.constructor=i;ol.prototype=Object.create(c.prototype);ol.prototype.constructor=ol;Object.assign(sp.prototype,{computeGroups:function(n){for(var t,r=[],u=undefined,e=n.faces,f,i=0;i<e.length;i++)f=e[i],f.materialIndex!==u&&(u=f.materialIndex,t!==undefined&&(t.count=i*3-t.start,r.push(t)),t={start:i*3,materialIndex:u});t!==undefined&&(t.count=i*3-t.start,r.push(t));this.groups=r},fromGeometry:function(n){var u=this,tt=n.faces,s=n.vertices,o=n.faceVertexUvs,rt=o[0]&&o[0].length>0,ut=o[1]&&o[1].length>0,it=n.morphTargets,g=it.length,l,nt,a,v,i,r,h,w,c,b,f,k,e,d;if(g>0){for(l=[],i=0;i<g;i++)l[i]=[];this.morphTargets.position=l}if(nt=n.morphNormals,a=nt.length,a>0){for(v=[],i=0;i<a;i++)v[i]=[];this.morphTargets.normal=v}var y=n.skinIndices,p=n.skinWeights,ft=y.length===s.length,et=p.length===s.length;for(i=0;i<tt.length;i++){for(r=tt[i],u.vertices.push(s[r.a],s[r.b],s[r.c]),h=r.vertexNormals,h.length===3?u.normals.push(h[0],h[1],h[2]):(w=r.normal,u.normals.push(w,w,w)),c=r.vertexColors,c.length===3?u.colors.push(c[0],c[1],c[2]):(b=r.color,u.colors.push(b,b,b)),rt===!0&&(f=o[0][i],f!==undefined?u.uvs.push(f[0],f[1],f[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",i),u.uvs.push(new t,new t,new t))),ut===!0&&(f=o[1][i],f!==undefined?u.uvs2.push(f[0],f[1],f[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",i),u.uvs2.push(new t,new t,new t))),e=0;e<g;e++)k=it[e].vertices,l[e].push(k[r.a],k[r.b],k[r.c]);for(e=0;e<a;e++)d=nt[e].vertexNormals[i],v[e].push(d.a,d.b,d.c);ft&&u.skinIndices.push(y[r.a],y[r.b],y[r.c]);et&&u.skinWeights.push(p[r.a],p[r.b],p[r.c])}return this.computeGroups(n),this.verticesNeedUpdate=n.verticesNeedUpdate,this.normalsNeedUpdate=n.normalsNeedUpdate,this.colorsNeedUpdate=n.colorsNeedUpdate,this.uvsNeedUpdate=n.uvsNeedUpdate,this.groupsNeedUpdate=n.groupsNeedUpdate,this}});hp=1;Object.assign(u.prototype,bt.prototype,{isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(n){this.index=Array.isArray(n)?new(sl(n)>65535?cf:hf)(n,1):n},addAttribute:function(n,t){if(!(t&&t.isBufferAttribute)&&!(t&&t.isInterleavedBufferAttribute)){console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).");this.addAttribute(n,new c(arguments[1],arguments[2]));return}if(n==="index"){console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.");this.setIndex(t);return}return this.attributes[n]=t,this},getAttribute:function(n){return this.attributes[n]},removeAttribute:function(n){return delete this.attributes[n],this},addGroup:function(n,t,i){this.groups.push({start:n,count:t,materialIndex:i!==undefined?i:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(n,t){this.drawRange.start=n;this.drawRange.count=t},applyMatrix:function(n){var i=this.attributes.position,t,r;return i!==undefined&&(n.applyToBufferAttribute(i),i.needsUpdate=!0),t=this.attributes.normal,t!==undefined&&(r=(new ot).getNormalMatrix(n),r.applyToBufferAttribute(t),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this},rotateX:function(){var n=new o;return function(t){return n.makeRotationX(t),this.applyMatrix(n),this}}(),rotateY:function(){var n=new o;return function(t){return n.makeRotationY(t),this.applyMatrix(n),this}}(),rotateZ:function(){var n=new o;return function(t){return n.makeRotationZ(t),this.applyMatrix(n),this}}(),translate:function(){var n=new o;return function(t,i,r){return n.makeTranslation(t,i,r),this.applyMatrix(n),this}}(),scale:function(){var n=new o;return function(t,i,r){return n.makeScale(t,i,r),this.applyMatrix(n),this}}(),lookAt:function(){var n=new r;return function(t){n.lookAt(t);n.updateMatrix();this.applyMatrix(n.matrix)}}(),center:function(){this.computeBoundingBox();var n=this.boundingBox.getCenter().negate();return this.translate(n.x,n.y,n.z),n},setFromObject:function(n){var t=n.geometry,r,u,f;return n.isPoints||n.isLine?(r=new i(t.vertices.length*3,3),u=new i(t.colors.length*3,3),this.addAttribute("position",r.copyVector3sArray(t.vertices)),this.addAttribute("color",u.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length&&(f=new i(t.lineDistances.length,1),this.addAttribute("lineDistance",f.copyArray(t.lineDistances))),t.boundingSphere!==null&&(this.boundingSphere=t.boundingSphere.clone()),t.boundingBox!==null&&(this.boundingBox=t.boundingBox.clone())):n.isMesh&&t&&t.isGeometry&&this.fromGeometry(t),this},setFromPoints:function(n){for(var u=[],r,t=0,f=n.length;t<f;t++)r=n[t],u.push(r.x,r.y,r.z||0);return this.addAttribute("position",new i(u,3)),this},updateFromObject:function(n){var t=n.geometry,r,i;if(n.isMesh){if(r=t.__directGeometry,t.elementsNeedUpdate===!0&&(r=undefined,t.elementsNeedUpdate=!1),r===undefined)return this.fromGeometry(t);r.verticesNeedUpdate=t.verticesNeedUpdate;r.normalsNeedUpdate=t.normalsNeedUpdate;r.colorsNeedUpdate=t.colorsNeedUpdate;r.uvsNeedUpdate=t.uvsNeedUpdate;r.groupsNeedUpdate=t.groupsNeedUpdate;t.verticesNeedUpdate=!1;t.normalsNeedUpdate=!1;t.colorsNeedUpdate=!1;t.uvsNeedUpdate=!1;t.groupsNeedUpdate=!1;t=r}return t.verticesNeedUpdate===!0&&(i=this.attributes.position,i!==undefined&&(i.copyVector3sArray(t.vertices),i.needsUpdate=!0),t.verticesNeedUpdate=!1),t.normalsNeedUpdate===!0&&(i=this.attributes.normal,i!==undefined&&(i.copyVector3sArray(t.normals),i.needsUpdate=!0),t.normalsNeedUpdate=!1),t.colorsNeedUpdate===!0&&(i=this.attributes.color,i!==undefined&&(i.copyColorsArray(t.colors),i.needsUpdate=!0),t.colorsNeedUpdate=!1),t.uvsNeedUpdate&&(i=this.attributes.uv,i!==undefined&&(i.copyVector2sArray(t.uvs),i.needsUpdate=!0),t.uvsNeedUpdate=!1),t.lineDistancesNeedUpdate&&(i=this.attributes.lineDistance,i!==undefined&&(i.copyArray(t.lineDistances),i.needsUpdate=!0),t.lineDistancesNeedUpdate=!1),t.groupsNeedUpdate&&(t.computeGroups(n.geometry),this.groups=t.groups,t.groupsNeedUpdate=!1),this},fromGeometry:function(n){return n.__directGeometry=(new sp).fromGeometry(n),this.fromDirectGeometry(n.__directGeometry)},fromDirectGeometry:function(n){var k=this,d=new Float32Array(n.vertices.length*3),o,s,h,l,a,v,r,u,f,t,y,e,p,w,b;this.addAttribute("position",new c(d,3).copyVector3sArray(n.vertices));n.normals.length>0&&(o=new Float32Array(n.normals.length*3),this.addAttribute("normal",new c(o,3).copyVector3sArray(n.normals)));n.colors.length>0&&(s=new Float32Array(n.colors.length*3),this.addAttribute("color",new c(s,3).copyColorsArray(n.colors)));n.uvs.length>0&&(h=new Float32Array(n.uvs.length*2),this.addAttribute("uv",new c(h,2).copyVector2sArray(n.uvs)));n.uvs2.length>0&&(l=new Float32Array(n.uvs2.length*2),this.addAttribute("uv2",new c(l,2).copyVector2sArray(n.uvs2)));n.indices.length>0&&(a=sl(n.indices)>65535?Uint32Array:Uint16Array,v=new a(n.indices.length*3),this.setIndex(new c(v,1).copyIndicesArray(n.indices)));this.groups=n.groups;for(r in n.morphTargets){for(u=[],f=n.morphTargets[r],t=0,y=f.length;t<y;t++)e=f[t],p=new i(e.length*3,3),u.push(p.copyVector3sArray(e));k.morphAttributes[r]=u}return n.skinIndices.length>0&&(w=new i(n.skinIndices.length*4,4),this.addAttribute("skinIndex",w.copyVector4sArray(n.skinIndices))),n.skinWeights.length>0&&(b=new i(n.skinWeights.length*4,4),this.addAttribute("skinWeight",b.copyVector4sArray(n.skinWeights))),n.boundingSphere!==null&&(this.boundingSphere=n.boundingSphere.clone()),n.boundingBox!==null&&(this.boundingBox=n.boundingBox.clone()),this},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new vi);var n=this.attributes.position;n!==undefined?this.boundingBox.setFromBufferAttribute(n):this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){var i=new vi,t=new n;return function(){var n,f,u,r,e;if(this.boundingSphere===null&&(this.boundingSphere=new ti),n=this.attributes.position,n){for(f=this.boundingSphere.center,i.setFromBufferAttribute(n),i.getCenter(f),u=0,r=0,e=n.count;r<e;r++)t.x=n.getX(r),t.y=n.getY(r),t.z=n.getZ(r),u=Math.max(u,f.distanceToSquared(t));this.boundingSphere.radius=Math.sqrt(u);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var d=this.index,e=this.attributes,b=this.groups,u,k,a,w,g,t,f;if(e.position){if(u=e.position.array,e.normal===undefined)this.addAttribute("normal",new c(new Float32Array(u.length),3));else for(k=e.normal.array,t=0,f=k.length;t<f;t++)k[t]=0;var r=e.normal.array,s,h,l,v=new n,o=new n,y=new n,i=new n,p=new n;if(d)for(a=d.array,b.length===0&&this.addGroup(0,a.length),w=0,g=b.length;w<g;++w){var nt=b[w],tt=nt.start,it=nt.count;for(t=tt,f=tt+it;t<f;t+=3)s=a[t+0]*3,h=a[t+1]*3,l=a[t+2]*3,v.fromArray(u,s),o.fromArray(u,h),y.fromArray(u,l),i.subVectors(y,o),p.subVectors(v,o),i.cross(p),r[s]+=i.x,r[s+1]+=i.y,r[s+2]+=i.z,r[h]+=i.x,r[h+1]+=i.y,r[h+2]+=i.z,r[l]+=i.x,r[l+1]+=i.y,r[l+2]+=i.z}else for(t=0,f=u.length;t<f;t+=9)v.fromArray(u,t),o.fromArray(u,t+3),y.fromArray(u,t+6),i.subVectors(y,o),p.subVectors(v,o),i.cross(p),r[t]=i.x,r[t+1]=i.y,r[t+2]=i.z,r[t+3]=i.x,r[t+4]=i.y,r[t+5]=i.z,r[t+6]=i.x,r[t+7]=i.y,r[t+8]=i.z;this.normalizeNormals();e.normal.needsUpdate=!0}},merge:function(n,t){var u,i,r,f;if(!(n&&n.isBufferGeometry)){console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",n);return}t===undefined&&(t=0);u=this.attributes;for(i in u)if(n.attributes[i]!==undefined){var s=u[i],h=s.array,e=n.attributes[i],o=e.array,c=e.itemSize;for(r=0,f=c*t;r<o.length;r++,f++)h[f]=o[r]}return this},normalizeNormals:function(){var t=new n;return function(){for(var i=this.attributes.normal,n=0,r=i.count;n<r;n++)t.x=i.getX(n),t.y=i.getY(n),t.z=i.getZ(n),t.normalize(),i.setXYZ(n,t.x,t.y,t.z)}}(),toNonIndexed:function(){var r,t,v,f;if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var e=new u,i=this.index.array,o=this.attributes;for(r in o){var s=o[r],h=s.array,n=s.itemSize,l=new h.constructor(i.length*n),a=0,y=0;for(t=0,v=i.length;t<v;t++)for(a=i[t]*n,f=0;f<n;f++)l[y++]=h[a++];e.addAttribute(r,new c(l,n))}return e},toJSON:function(){var n={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}},u,f,o,t,r,i,s,e;if(n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.parameters!==undefined){u=this.parameters;for(t in u)u[t]!==undefined&&(n[t]=u[t]);return n}n.data={attributes:{}};f=this.index;f!==null&&(i=Array.prototype.slice.call(f.array),n.data.index={type:f.array.constructor.name,array:i});o=this.attributes;for(t in o)r=o[t],i=Array.prototype.slice.call(r.array),n.data.attributes[t]={itemSize:r.itemSize,type:r.array.constructor.name,array:i,normalized:r.normalized};return s=this.groups,s.length>0&&(n.data.groups=JSON.parse(JSON.stringify(s))),e=this.boundingSphere,e!==null&&(n.data.boundingSphere={center:e.center.toArray(),radius:e.radius}),n},clone:function(){return(new u).copy(this)},copy:function(n){var f=this,i,t,r,e,o,y,s,h,c,l,u,a,v;this.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingBox=null;this.boundingSphere=null;this.name=n.name;e=n.index;e!==null&&this.setIndex(e.clone());o=n.attributes;for(i in o)y=o[i],f.addAttribute(i,y.clone());s=n.morphAttributes;for(i in s){for(h=[],c=s[i],t=0,r=c.length;t<r;t++)h.push(c[t].clone());f.morphAttributes[i]=h}for(l=n.groups,t=0,r=l.length;t<r;t++)u=l[t],f.addGroup(u.start,u.count,u.materialIndex);return a=n.boundingBox,a!==null&&(this.boundingBox=a.clone()),v=n.boundingSphere,v!==null&&(this.boundingSphere=v.clone()),this.drawRange.start=n.drawRange.start,this.drawRange.count=n.drawRange.count,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});lf.prototype=Object.create(s.prototype);lf.prototype.constructor=lf;iu.prototype=Object.create(u.prototype);iu.prototype.constructor=iu;bo.prototype=Object.create(s.prototype);bo.prototype.constructor=bo;ru.prototype=Object.create(u.prototype);ru.prototype.constructor=ru;ht.prototype=Object.create(l.prototype);ht.prototype.constructor=ht;ht.prototype.isMeshBasicMaterial=!0;ht.prototype.copy=function(n){return l.prototype.copy.call(this,n),this.color.copy(n.color),this.map=n.map,this.lightMap=n.lightMap,this.lightMapIntensity=n.lightMapIntensity,this.aoMap=n.aoMap,this.aoMapIntensity=n.aoMapIntensity,this.specularMap=n.specularMap,this.alphaMap=n.alphaMap,this.envMap=n.envMap,this.combine=n.combine,this.reflectivity=n.reflectivity,this.refractionRatio=n.refractionRatio,this.wireframe=n.wireframe,this.wireframeLinewidth=n.wireframeLinewidth,this.wireframeLinecap=n.wireframeLinecap,this.wireframeLinejoin=n.wireframeLinejoin,this.skinning=n.skinning,this.morphTargets=n.morphTargets,this};dt.prototype=Object.create(l.prototype);dt.prototype.constructor=dt;dt.prototype.isShaderMaterial=!0;dt.prototype.copy=function(n){return l.prototype.copy.call(this,n),this.fragmentShader=n.fragmentShader,this.vertexShader=n.vertexShader,this.uniforms=st.clone(n.uniforms),this.defines=n.defines,this.wireframe=n.wireframe,this.wireframeLinewidth=n.wireframeLinewidth,this.lights=n.lights,this.clipping=n.clipping,this.skinning=n.skinning,this.morphTargets=n.morphTargets,this.morphNormals=n.morphNormals,this.extensions=n.extensions,this};dt.prototype.toJSON=function(n){var t=l.prototype.toJSON.call(this,n);return t.uniforms=this.uniforms,t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t};Object.assign(uu.prototype,{set:function(n,t){return this.origin.copy(n),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.origin.copy(n.origin),this.direction.copy(n.direction),this},at:function(t,i){var r=i||new n;return r.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(n){return this.direction.copy(n).sub(this.origin).normalize(),this},recast:function(){var t=new n;return function(n){return this.origin.copy(this.at(n,t)),this}}(),closestPointToPoint:function(t,i){var r=i||new n,u;return(r.subVectors(t,this.origin),u=r.dot(this.direction),u<0)?r.copy(this.origin):r.copy(this.direction).multiplyScalar(u).add(this.origin)},distanceToPoint:function(n){return Math.sqrt(this.distanceSqToPoint(n))},distanceSqToPoint:function(){var t=new n;return function(n){var i=t.subVectors(n,this.origin).dot(this.direction);return i<0?this.origin.distanceToSquared(n):(t.copy(this.direction).multiplyScalar(i).add(this.origin),t.distanceToSquared(n))}}(),distanceSqToSegment:function(){var r=new n,t=new n,i=new n;return function(n,u,f,e){var b;r.copy(n).add(u).multiplyScalar(.5);t.copy(u).sub(n).normalize();i.copy(this.origin).sub(r);var h=n.distanceTo(u)*.5,c=-this.direction.dot(t),a=i.dot(this.direction),l=-i.dot(t),y=i.lengthSq(),w=Math.abs(1-c*c),s,o,v,p;return w>0?(s=c*l-a,o=c*a-l,p=h*w,s>=0?o>=-p?o<=p?(b=1/w,s*=b,o*=b,v=s*(s+c*o+2*a)+o*(c*s+o+2*l)+y):(o=h,s=Math.max(0,-(c*o+a)),v=-s*s+o*(o+2*l)+y):(o=-h,s=Math.max(0,-(c*o+a)),v=-s*s+o*(o+2*l)+y):o<=-p?(s=Math.max(0,-(-c*h+a)),o=s>0?-h:Math.min(Math.max(-h,-l),h),v=-s*s+o*(o+2*l)+y):o<=p?(s=0,o=Math.min(Math.max(-h,-l),h),v=o*(o+2*l)+y):(s=Math.max(0,-(c*h+a)),o=s>0?h:Math.min(Math.max(-h,-l),h),v=-s*s+o*(o+2*l)+y)):(o=c>0?-h:h,s=Math.max(0,-(c*o+a)),v=-s*s+o*(o+2*l)+y),f&&f.copy(this.direction).multiplyScalar(s).add(this.origin),e&&e.copy(t).multiplyScalar(o).add(r),v}}(),intersectSphere:function(){var t=new n;return function(n,i){t.subVectors(n.center,this.origin);var r=t.dot(this.direction),f=t.dot(t)-r*r,e=n.radius*n.radius;if(f>e)return null;var o=Math.sqrt(e-f),u=r-o,s=r+o;return u<0&&s<0?null:u<0?this.at(s,i):this.at(u,i)}}(),intersectsSphere:function(n){return this.distanceToPoint(n.center)<=n.radius},distanceToPlane:function(n){var i=n.normal.dot(this.direction),t;return i===0?n.distanceToPoint(this.origin)===0?0:null:(t=-(this.origin.dot(n.normal)+n.constant)/i,t>=0?t:null)},intersectPlane:function(n,t){var i=this.distanceToPlane(n);return i===null?null:this.at(i,t)},intersectsPlane:function(n){var t=n.distanceToPoint(this.origin),i;return t===0?!0:(i=n.normal.dot(this.direction),i*t<0)?!0:!1},intersectBox:function(n,t){var i,r,f,e,o,s,h=1/this.direction.x,c=1/this.direction.y,l=1/this.direction.z,u=this.origin;return(h>=0?(i=(n.min.x-u.x)*h,r=(n.max.x-u.x)*h):(i=(n.max.x-u.x)*h,r=(n.min.x-u.x)*h),c>=0?(f=(n.min.y-u.y)*c,e=(n.max.y-u.y)*c):(f=(n.max.y-u.y)*c,e=(n.min.y-u.y)*c),i>e||f>r)?null:((f>i||i!==i)&&(i=f),(e<r||r!==r)&&(r=e),l>=0?(o=(n.min.z-u.z)*l,s=(n.max.z-u.z)*l):(o=(n.max.z-u.z)*l,s=(n.min.z-u.z)*l),i>s||o>r)?null:((o>i||i!==i)&&(i=o),(s<r||r!==r)&&(r=s),r<0)?null:this.at(i>=0?i:r,t)},intersectsBox:function(){var t=new n;return function(n){return this.intersectBox(n,t)!==null}}(),intersectTriangle:function(){var t=new n,r=new n,i=new n,u=new n;return function(n,f,e,o,s){var h,c,l,a,v;if(r.subVectors(f,n),i.subVectors(e,n),u.crossVectors(r,i),h=this.direction.dot(u),h>0){if(o)return null;c=1}else if(h<0)c=-1,h=-h;else return null;return(t.subVectors(this.origin,n),l=c*this.direction.dot(i.crossVectors(t,i)),l<0)?null:(a=c*this.direction.dot(r.cross(t)),a<0)?null:l+a>h?null:(v=-c*t.dot(u),v<0)?null:this.at(v/h,s)}}(),applyMatrix4:function(n){return this.origin.applyMatrix4(n),this.direction.transformDirection(n),this},equals:function(n){return n.origin.equals(this.origin)&&n.direction.equals(this.direction)}});Object.assign(af.prototype,{set:function(n,t){return this.start.copy(n),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.start.copy(n.start),this.end.copy(n.end),this},getCenter:function(t){var i=t||new n;return i.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){var i=t||new n;return i.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,i){var r=i||new n;return this.delta(r).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(){var i=new n,t=new n;return function(n,r){i.subVectors(n,this.start);t.subVectors(this.end,this.start);var f=t.dot(t),e=t.dot(i),u=e/f;return r&&(u=h.clamp(u,0,1)),u}}(),closestPointToPoint:function(t,i,r){var u=this.closestPointToPointParameter(t,i),f=r||new n;return this.delta(f).multiplyScalar(u).add(this.start)},applyMatrix4:function(n){return this.start.applyMatrix4(n),this.end.applyMatrix4(n),this},equals:function(n){return n.start.equals(this.start)&&n.end.equals(this.end)}});Object.assign(pi,{normal:function(){var t=new n;return function(i,r,u,f){var e=f||new n,o;return(e.subVectors(u,r),t.subVectors(i,r),e.cross(t),o=e.lengthSq(),o>0)?e.multiplyScalar(1/Math.sqrt(o)):e.set(0,0,0)}}(),barycoordFromPoint:function(){var t=new n,i=new n,r=new n;return function(u,f,e,o,s){t.subVectors(o,f);i.subVectors(e,f);r.subVectors(u,f);var c=t.dot(t),h=t.dot(i),l=t.dot(r),a=i.dot(i),v=i.dot(r),y=c*a-h*h,p=s||new n;if(y===0)return p.set(-2,-1,-1);var w=1/y,b=(a*l-h*v)*w,k=(c*v-h*l)*w;return p.set(1-b-k,k,b)}}(),containsPoint:function(){var t=new n;return function(n,i,r,u){var f=pi.barycoordFromPoint(n,i,r,u,t);return f.x>=0&&f.y>=0&&f.x+f.y<=1}}()});Object.assign(pi.prototype,{set:function(n,t,i){return this.a.copy(n),this.b.copy(t),this.c.copy(i),this},setFromPointsAndIndices:function(n,t,i,r){return this.a.copy(n[t]),this.b.copy(n[i]),this.c.copy(n[r]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.a.copy(n.a),this.b.copy(n.b),this.c.copy(n.c),this},area:function(){var t=new n,i=new n;return function(){return t.subVectors(this.c,this.b),i.subVectors(this.a,this.b),t.cross(i).length()*.5}}(),midpoint:function(t){var i=t||new n;return i.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(n){return pi.normal(this.a,this.b,this.c,n)},plane:function(n){var t=n||new kt;return t.setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(n,t){return pi.barycoordFromPoint(n,this.a,this.b,this.c,t)},containsPoint:function(n){return pi.containsPoint(n,this.a,this.b,this.c)},closestPointToPoint:function(){var u=new kt,t=[new af,new af,new af],i=new n,r=new n;return function(f,e){var s=e||new n,c=Infinity,o,h;if(u.setFromCoplanarPoints(this.a,this.b,this.c),u.projectPoint(f,i),this.containsPoint(i)===!0)s.copy(i);else for(t[0].set(this.a,this.b),t[1].set(this.b,this.c),t[2].set(this.c,this.a),o=0;o<t.length;o++)t[o].closestPointToPoint(i,!0,r),h=i.distanceToSquared(r),h<c&&(c=h,s.copy(r));return s}}(),equals:function(n){return n.a.equals(this.a)&&n.b.equals(this.b)&&n.c.equals(this.c)}});tt.prototype=Object.assign(Object.create(r.prototype),{constructor:tt,isMesh:!0,setDrawMode:function(n){this.drawMode=n},copy:function(n){return r.prototype.copy.call(this,n),this.drawMode=n.drawMode,n.morphTargetInfluences!==undefined&&(this.morphTargetInfluences=n.morphTargetInfluences.slice()),n.morphTargetDictionary!==undefined&&(this.morphTargetDictionary=Object.assign({},n.morphTargetDictionary)),this},updateMorphTargets:function(){var i=this,e=this.geometry,n,r,u,o,s,f,t;if(e.isBufferGeometry){if(o=e.morphAttributes,s=Object.keys(o),s.length>0&&(f=o[s[0]],f!==undefined))for(this.morphTargetInfluences=[],this.morphTargetDictionary={},n=0,r=f.length;n<r;n++)u=f[n].name||String(n),i.morphTargetInfluences.push(0),i.morphTargetDictionary[u]=n}else if(t=e.morphTargets,t!==undefined&&t.length>0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},n=0,r=t.length;n<r;n++)u=t[n].name||String(n),i.morphTargetInfluences.push(0),i.morphTargetDictionary[u]=n},raycast:function(){function p(n,t,i,r,u,f,e){return pi.barycoordFromPoint(n,t,i,r,c),u.multiplyScalar(c.x),f.multiplyScalar(c.y),e.multiplyScalar(c.z),u.add(f).add(e),u.clone()}function w(n,t,i,r,u,f,e,o){var h,s;return(h=t.side===ki?r.intersectTriangle(e,f,u,!0,o):r.intersectTriangle(u,f,e,t.side!==nf,o),h===null)?null:(a.copy(o),a.applyMatrix4(n.matrixWorld),s=i.ray.origin.distanceTo(a),s<i.near||s>i.far)?null:{distance:s,point:a.clone(),object:n}}function b(n,t,f,o,c,a,v,y){i.fromBufferAttribute(o,a);r.fromBufferAttribute(o,v);u.fromBufferAttribute(o,y);var b=w(n,n.material,t,f,i,r,u,l);return b&&(c&&(e.fromBufferAttribute(c,a),s.fromBufferAttribute(c,v),h.fromBufferAttribute(c,y),b.uv=p(l,i,r,u,e,s,h)),b.face=new ir(a,v,y,pi.normal(i,r,u)),b.faceIndex=a),b}var y=new o,f=new uu,v=new ti,i=new n,r=new n,u=new n,k=new n,d=new n,g=new n,e=new t,s=new t,h=new t,c=new n,l=new n,a=new n;return function(n,t){var ht=this,o=this.geometry,ct=this.material,ni=this.matrixWorld,c,tt,ui,nt,wt,gt,fi,ot,ei,st,bt,kt;if(ct!==undefined&&(o.boundingSphere===null&&o.computeBoundingSphere(),v.copy(o.boundingSphere),v.applyMatrix4(ni),n.ray.intersectsSphere(v)!==!1)&&(y.getInverse(ni),f.copy(n.ray).applyMatrix4(y),o.boundingBox===null||f.intersectsBox(o.boundingBox)!==!1))if(o.isBufferGeometry){var ft,lt,at,et=o.index,vt=o.attributes.position,ti=o.attributes.uv,a,yt;if(et!==null)for(a=0,yt=et.count;a<yt;a+=3)ft=et.getX(a),lt=et.getX(a+1),at=et.getX(a+2),c=b(ht,n,f,vt,ti,ft,lt,at),c&&(c.faceIndex=Math.floor(a/3),t.push(c));else if(vt!==undefined)for(a=0,yt=vt.count;a<yt;a+=3)ft=a,lt=a+1,at=a+2,c=b(ht,n,f,vt,ti,ft,lt,at),c&&(c.index=ft,t.push(c))}else if(o.isGeometry){var it,rt,ut,oi=Array.isArray(ct),dt=o.vertices,ii=o.faces,pt,ri=o.faceVertexUvs[0];for(ri.length>0&&(pt=ri),tt=0,ui=ii.length;tt<ui;tt++)if(nt=ii[tt],wt=oi?ct[nt.materialIndex]:ct,wt!==undefined){if(it=dt[nt.a],rt=dt[nt.b],ut=dt[nt.c],wt.morphTargets===!0){for(gt=o.morphTargets,fi=ht.morphTargetInfluences,i.set(0,0,0),r.set(0,0,0),u.set(0,0,0),ot=0,ei=gt.length;ot<ei;ot++)(st=fi[ot],st!==0)&&(bt=gt[ot].vertices,i.addScaledVector(k.subVectors(bt[nt.a],it),st),r.addScaledVector(d.subVectors(bt[nt.b],rt),st),u.addScaledVector(g.subVectors(bt[nt.c],ut),st));i.add(it);r.add(rt);u.add(ut);it=i;rt=r;ut=u}c=w(ht,wt,n,f,it,rt,ut,l);c&&(pt&&pt[tt]&&(kt=pt[tt],e.copy(kt[0]),s.copy(kt[1]),h.copy(kt[2]),c.uv=p(l,it,rt,ut,e,s,h)),c.face=nt,c.faceIndex=tt,t.push(c))}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});lp=0;nt.prototype=Object.assign(Object.create(oi.prototype),{constructor:nt,isPerspectiveCamera:!0,copy:function(n,t){return oi.prototype.copy.call(this,n,t),this.fov=n.fov,this.zoom=n.zoom,this.near=n.near,this.far=n.far,this.focus=n.focus,this.aspect=n.aspect,this.view=n.view===null?null:Object.assign({},n.view),this.filmGauge=n.filmGauge,this.filmOffset=n.filmOffset,this},setFocalLength:function(n){var t=.5*this.getFilmHeight()/n;this.fov=h.RAD2DEG*2*Math.atan(t);this.updateProjectionMatrix()},getFocalLength:function(){var n=Math.tan(h.DEG2RAD*.5*this.fov);return.5*this.getFilmHeight()/n},getEffectiveFOV:function(){return h.RAD2DEG*2*Math.atan(Math.tan(h.DEG2RAD*.5*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(n,t,i,r,u,f){this.aspect=n/t;this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1});this.view.enabled=!0;this.view.fullWidth=n;this.view.fullHeight=t;this.view.offsetX=i;this.view.offsetY=r;this.view.width=u;this.view.height=f;this.updateProjectionMatrix()},clearViewOffset:function(){this.view!==null&&(this.view.enabled=!1);this.updateProjectionMatrix()},updateProjectionMatrix:function(){var f=this.near,t=f*Math.tan(h.DEG2RAD*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,u=-.5*r,n=this.view,e,o,s;this.view!==null&&this.view.enabled&&(e=n.fullWidth,o=n.fullHeight,u+=n.offsetX*r/e,t-=n.offsetY*i/o,r*=n.width/e,i*=n.height/o);s=this.filmOffset;s!==0&&(u+=f*s/this.getFilmWidth());this.projectionMatrix.makePerspective(u,u+r,t,t-i,f,this.far)},toJSON:function(n){var t=r.prototype.toJSON.call(this,n);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}});ll.prototype=Object.assign(Object.create(nt.prototype),{constructor:ll,isArrayCamera:!0});yf.prototype.isFogExp2=!0;yf.prototype.clone=function(){return new yf(this.color.getHex(),this.density)};yf.prototype.toJSON=function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}};pf.prototype.isFog=!0;pf.prototype.clone=function(){return new pf(this.color.getHex(),this.near,this.far)};pf.prototype.toJSON=function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}};ko.prototype=Object.assign(Object.create(r.prototype),{constructor:ko,copy:function(n,t){return r.prototype.copy.call(this,n,t),n.background!==null&&(this.background=n.background.clone()),n.fog!==null&&(this.fog=n.fog.clone()),n.overrideMaterial!==null&&(this.overrideMaterial=n.overrideMaterial.clone()),this.autoUpdate=n.autoUpdate,this.matrixAutoUpdate=n.matrixAutoUpdate,this},toJSON:function(n){var t=r.prototype.toJSON.call(this,n);return this.background!==null&&(t.object.background=this.background.toJSON(n)),this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}});pp.prototype=Object.assign(Object.create(r.prototype),{constructor:pp,isLensFlare:!0,copy:function(n){var u=this,t,i;for(r.prototype.copy.call(this,n),this.positionScreen.copy(n.positionScreen),this.customUpdateCallback=n.customUpdateCallback,t=0,i=n.lensFlares.length;t<i;t++)u.lensFlares.push(n.lensFlares[t]);return this},add:function(n,t,i,r,u,e){t===undefined&&(t=-1);i===undefined&&(i=0);e===undefined&&(e=1);u===undefined&&(u=new f(16777215));r===undefined&&(r=tf);i=Math.min(i,Math.max(0,i));this.lensFlares.push({texture:n,size:t,distance:i,x:0,y:0,z:0,scale:1,rotation:0,opacity:e,color:u,blending:r})},updateLensFlares:function(){for(var i=this,r=this.lensFlares.length,n,u=-this.positionScreen.x*2,f=-this.positionScreen.y*2,t=0;t<r;t++)n=i.lensFlares[t],n.x=i.positionScreen.x+u*n.distance,n.y=i.positionScreen.y+f*n.distance,n.wantedRotation=n.x*Math.PI*.25,n.rotation+=(n.wantedRotation-n.rotation)*.25}});rr.prototype=Object.create(l.prototype);rr.prototype.constructor=rr;rr.prototype.isSpriteMaterial=!0;rr.prototype.copy=function(n){return l.prototype.copy.call(this,n),this.color.copy(n.color),this.map=n.map,this.rotation=n.rotation,this};vl.prototype=Object.assign(Object.create(r.prototype),{constructor:vl,isSprite:!0,raycast:function(){var t=new n,i=new n,r=new n;return function(n,u){var e,f;(i.setFromMatrixPosition(this.matrixWorld),n.ray.closestPointToPoint(i,t),r.setFromMatrixScale(this.matrixWorld),e=r.x*r.y/4,i.distanceToSquared(t)>e)||(f=n.ray.origin.distanceTo(t),f<n.near||f>n.far)||u.push({distance:f,point:t.clone(),face:null,object:this})}}(),clone:function(){return new this.constructor(this.material).copy(this)}});go.prototype=Object.assign(Object.create(r.prototype),{constructor:go,copy:function(n){var e=this,i,t,f,u;for(r.prototype.copy.call(this,n,!1),i=n.levels,t=0,f=i.length;t<f;t++)u=i[t],e.addLevel(u.object.clone(),u.distance);return this},addLevel:function(n,t){var r,i;for(t===undefined&&(t=0),t=Math.abs(t),r=this.levels,i=0;i<r.length;i++)if(t<r[i].distance)break;r.splice(i,0,{distance:t,object:n});this.add(n)},getObjectForDistance:function(n){for(var i=this.levels,t=1,r=i.length;t<r;t++)if(n<i[t].distance)break;return i[t-1].object},raycast:function(){var t=new n;return function(n,i){t.setFromMatrixPosition(this.matrixWorld);var r=n.ray.origin.distanceTo(t);this.getObjectForDistance(r).raycast(n,i)}}(),update:function(){var t=new n,i=new n;return function(n){var u=this.levels,e,r,f;if(u.length>1){for(t.setFromMatrixPosition(n.matrixWorld),i.setFromMatrixPosition(this.matrixWorld),e=t.distanceTo(i),u[0].object.visible=!0,r=1,f=u.length;r<f;r++)if(e>=u[r].distance)u[r-1].object.visible=!1,u[r].object.visible=!0;else break;for(;r<f;r++)u[r].object.visible=!1}}}(),toJSON:function(n){var i=r.prototype.toJSON.call(this,n),u,t,e,f;for(i.object.levels=[],u=this.levels,t=0,e=u.length;t<e;t++)f=u[t],i.object.levels.push({object:f.object.uuid,distance:f.distance});return i}});Object.assign(ns.prototype,{calculateInverses:function(){var t=this,n,r,i;for(this.boneInverses=[],n=0,r=this.bones.length;n<r;n++)i=new o,t.bones[n]&&i.getInverse(t.bones[n].matrixWorld),t.boneInverses.push(i)},pose:function(){for(var r=this,n,t=0,i=this.bones.length;t<i;t++)n=r.bones[t],n&&n.matrixWorld.getInverse(r.boneInverses[t]);for(t=0,i=this.bones.length;t<i;t++)n=r.bones[t],n&&(n.parent&&n.parent.isBone?(n.matrix.getInverse(n.parent.matrixWorld),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))},update:function(){var n=new o,t=new o;return function(){for(var r=this.bones,o=this.boneInverses,s=this.boneMatrices,u=this.boneTexture,e,i=0,f=r.length;i<f;i++)e=r[i]?r[i].matrixWorld:t,n.multiplyMatrices(e,o[i]),n.toArray(s,i*16);u!==undefined&&(u.needsUpdate=!0)}}(),clone:function(){return new ns(this.bones,this.boneInverses)}});yl.prototype=Object.assign(Object.create(r.prototype),{constructor:yl,isBone:!0});pl.prototype=Object.assign(Object.create(tt.prototype),{constructor:pl,isSkinnedMesh:!0,initBones:function(){var f=this,i=[],r,n,t,u;if(this.geometry&&this.geometry.bones!==undefined){for(t=0,u=this.geometry.bones.length;t<u;t++)n=f.geometry.bones[t],r=new yl,i.push(r),r.name=n.name,r.position.fromArray(n.pos),r.quaternion.fromArray(n.rotq),n.scl!==undefined&&r.scale.fromArray(n.scl);for(t=0,u=this.geometry.bones.length;t<u;t++)n=f.geometry.bones[t],n.parent!==-1&&n.parent!==null&&i[n.parent]!==undefined?i[n.parent].add(i[t]):f.add(i[t])}return this.updateMatrixWorld(!0),i},bind:function(n,t){this.skeleton=n;t===undefined&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld);this.bindMatrix.copy(t);this.bindMatrixInverse.getInverse(t)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){var f=this,r,n,u,t,i;if(this.geometry&&this.geometry.isGeometry)for(n=0;n<this.geometry.skinWeights.length;n++)u=f.geometry.skinWeights[n],r=1/u.manhattanLength(),r!==Infinity?u.multiplyScalar(r):u.set(1,0,0,0);else if(this.geometry&&this.geometry.isBufferGeometry)for(t=new p,i=this.geometry.attributes.skinWeight,n=0;n<i.count;n++)t.x=i.getX(n),t.y=i.getY(n),t.z=i.getZ(n),t.w=i.getW(n),r=1/t.manhattanLength(),r!==Infinity?t.multiplyScalar(r):t.set(1,0,0,0),i.setXYZW(n,t.x,t.y,t.z,t.w)},updateMatrixWorld:function(n){tt.prototype.updateMatrixWorld.call(this,n);this.bindMode==="attached"?this.bindMatrixInverse.getInverse(this.matrixWorld):this.bindMode==="detached"?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});y.prototype=Object.create(l.prototype);y.prototype.constructor=y;y.prototype.isLineBasicMaterial=!0;y.prototype.copy=function(n){return l.prototype.copy.call(this,n),this.color.copy(n.color),this.linewidth=n.linewidth,this.linecap=n.linecap,this.linejoin=n.linejoin,this};ct.prototype=Object.assign(Object.create(r.prototype),{constructor:ct,isLine:!0,raycast:function(){var r=new o,t=new uu,i=new ti;return function(u,f){var s=this,nt=u.linePrecision,d=nt*nt,c=this.geometry,tt=this.matrixWorld,b,rt,ut,y,k,ft,e,l,o;if(c.boundingSphere===null&&c.computeBoundingSphere(),i.copy(c.boundingSphere),i.applyMatrix4(tt),u.ray.intersectsSphere(i)!==!1){r.getInverse(tt);t.copy(u.ray).applyMatrix4(r);var p=new n,w=new n,a=new n,h=new n,g=this&&this.isLineSegments?2:1;if(c.isBufferGeometry){var it=c.index,et=c.attributes,v=et.position.array;if(it!==null)for(b=it.array,e=0,y=b.length-1;e<y;e+=g)(rt=b[e],ut=b[e+1],p.fromArray(v,rt*3),w.fromArray(v,ut*3),l=t.distanceSqToSegment(p,w,h,a),l>d)||(h.applyMatrix4(s.matrixWorld),o=u.ray.origin.distanceTo(h),o<u.near||o>u.far)||f.push({distance:o,point:a.clone().applyMatrix4(s.matrixWorld),index:e,face:null,faceIndex:null,object:s});else for(e=0,y=v.length/3-1;e<y;e+=g)(p.fromArray(v,3*e),w.fromArray(v,3*e+3),l=t.distanceSqToSegment(p,w,h,a),l>d)||(h.applyMatrix4(s.matrixWorld),o=u.ray.origin.distanceTo(h),o<u.near||o>u.far)||f.push({distance:o,point:a.clone().applyMatrix4(s.matrixWorld),index:e,face:null,faceIndex:null,object:s})}else if(c.isGeometry)for(k=c.vertices,ft=k.length,e=0;e<ft-1;e+=g)(l=t.distanceSqToSegment(k[e],k[e+1],h,a),l>d)||(h.applyMatrix4(s.matrixWorld),o=u.ray.origin.distanceTo(h),o<u.near||o>u.far)||f.push({distance:o,point:a.clone().applyMatrix4(s.matrixWorld),index:e,face:null,faceIndex:null,object:s})}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});w.prototype=Object.assign(Object.create(ct.prototype),{constructor:w,isLineSegments:!0});wl.prototype=Object.assign(Object.create(ct.prototype),{constructor:wl,isLineLoop:!0});ur.prototype=Object.create(l.prototype);ur.prototype.constructor=ur;ur.prototype.isPointsMaterial=!0;ur.prototype.copy=function(n){return l.prototype.copy.call(this,n),this.color.copy(n.color),this.map=n.map,this.size=n.size,this.sizeAttenuation=n.sizeAttenuation,this};bl.prototype=Object.assign(Object.create(r.prototype),{constructor:bl,isPoints:!0,raycast:function(){var r=new o,i=new uu,t=new ti;return function(u,f){function l(n,t){var o=i.distanceSqToPoint(n),r,e;if(o<nt){if(r=i.closestPointToPoint(n),r.applyMatrix4(c),e=u.ray.origin.distanceTo(r),e<u.near||e>u.far)return;f.push({distance:e,distanceToRay:Math.sqrt(o),point:r.clone(),index:t,face:null,object:g})}}var g=this,o=this.geometry,c=this.matrixWorld,w=u.params.Points.threshold,v,d,y,p,e,s;if(o.boundingSphere===null&&o.computeBoundingSphere(),t.copy(o.boundingSphere),t.applyMatrix4(c),t.radius+=w,u.ray.intersectsSphere(t)!==!1){r.getInverse(c);i.copy(u.ray).applyMatrix4(r);var b=w/((this.scale.x+this.scale.y+this.scale.z)/3),nt=b*b,h=new n;if(o.isBufferGeometry){var k=o.index,tt=o.attributes,a=tt.position.array;if(k!==null)for(v=k.array,e=0,d=v.length;e<d;e++)y=v[e],h.fromArray(a,y*3),l(h,y);else for(e=0,s=a.length/3;e<s;e++)h.fromArray(a,e*3),l(h,e)}else for(p=o.vertices,e=0,s=p.length;e<s;e++)l(p[e],e)}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});wf.prototype=Object.assign(Object.create(r.prototype),{constructor:wf});kl.prototype=Object.create(b.prototype);kl.prototype.constructor=kl;bf.prototype=Object.create(b.prototype);bf.prototype.constructor=bf;bf.prototype.isCompressedTexture=!0;ts.prototype=Object.create(b.prototype);ts.prototype.constructor=ts;ts.prototype.isDepthTexture=!0;is.prototype=Object.create(u.prototype);is.prototype.constructor=is;rs.prototype=Object.create(s.prototype);rs.prototype.constructor=rs;kf.prototype=Object.create(u.prototype);kf.prototype.constructor=kf;us.prototype=Object.create(s.prototype);us.prototype.constructor=us;lt.prototype=Object.create(u.prototype);lt.prototype.constructor=lt;fs.prototype=Object.create(s.prototype);fs.prototype.constructor=fs;df.prototype=Object.create(lt.prototype);df.prototype.constructor=df;es.prototype=Object.create(s.prototype);es.prototype.constructor=es;fu.prototype=Object.create(lt.prototype);fu.prototype.constructor=fu;os.prototype=Object.create(s.prototype);os.prototype.constructor=os;gf.prototype=Object.create(lt.prototype);gf.prototype.constructor=gf;ss.prototype=Object.create(s.prototype);ss.prototype.constructor=ss;ne.prototype=Object.create(lt.prototype);ne.prototype.constructor=ne;hs.prototype=Object.create(s.prototype);hs.prototype.constructor=hs;te.prototype=Object.create(u.prototype);te.prototype.constructor=te;cs.prototype=Object.create(s.prototype);cs.prototype.constructor=cs;ie.prototype=Object.create(u.prototype);ie.prototype.constructor=ie;ls.prototype=Object.create(s.prototype);ls.prototype.constructor=ls;re.prototype=Object.create(u.prototype);re.prototype.constructor=re;gt={area:function(n){for(var r=n.length,u=0,i=r-1,t=0;t<r;i=t++)u+=n[i].x*n[t].y-n[t].x*n[i].y;return u*.5},triangulate:function(){function n(n,t,i,r,u,f){var y,e,o,c,l,a,v,s,h,p,w,b,k,d,g,nt,tt,it,rt,ut,ft,et,ot,st;if(e=n[f[t]].x,o=n[f[t]].y,c=n[f[i]].x,l=n[f[i]].y,a=n[f[r]].x,v=n[f[r]].y,(c-e)*(v-o)-(l-o)*(a-e)<=0)return!1;for(p=a-c,w=v-l,b=e-a,k=o-v,d=c-e,g=l-o,y=0;y<u;y++)if((s=n[f[y]].x,h=n[f[y]].y,(s!==e||h!==o)&&(s!==c||h!==l)&&(s!==a||h!==v))&&(nt=s-e,tt=h-o,it=s-c,rt=h-l,ut=s-a,ft=h-v,st=p*rt-w*it,et=d*tt-g*nt,ot=b*ft-k*ut,st>=-Number.EPSILON&&ot>=-Number.EPSILON&&et>=-Number.EPSILON))return!1;return!0}return function(t,i){var s=t.length,f,a,y,p,w,v,h;if(s<3)return null;var c=[],u=[],l=[],e,r,o;if(gt.area(t)>0)for(r=0;r<s;r++)u[r]=r;else for(r=0;r<s;r++)u[r]=s-1-r;for(f=s,a=2*f,r=f-1;f>2;){if(a--<=0)return(console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),i)?l:c;if(e=r,f<=e&&(e=0),r=e+1,f<=r&&(r=0),o=r+1,f<=o&&(o=0),n(t,e,r,o,f,u)){for(y=u[e],p=u[r],w=u[o],c.push([t[y],t[p],t[w]]),l.push([u[e],u[r],u[o]]),v=r,h=r+1;h<f;v++,h++)u[v]=u[h];f--;a=2*f}}return i?l:c}}(),triangulateShape:function(n,t){function a(n){var t=n.length;t>2&&n[t-1].equals(n[0])&&n.pop()}function v(n,t,i){return n.x!==t.x?n.x<t.x?n.x<=i.x&&i.x<=t.x:t.x<=i.x&&i.x<=n.x:n.y<t.y?n.y<=i.y&&i.y<=t.y:t.y<=i.y&&i.y<=n.y}function y(n,t,i,r,u){var b=t.x-n.x,g=t.y-n.y,k=r.x-i.x,d=r.y-i.y,nt=n.x-i.x,tt=n.y-i.y,f=g*k-b*d,e=g*nt-b*tt,o,it,rt,ut,c,p,l,s,a,w,y,h;if(Math.abs(f)>Number.EPSILON){if(f>0){if(e<0||e>f)return[];if(o=d*nt-k*tt,o<0||o>f)return[]}else{if(e>0||e<f)return[];if(o=d*nt-k*tt,o>0||o<f)return[]}return o===0?u&&(e===0||e===f)?[]:[n]:o===f?u&&(e===0||e===f)?[]:[t]:e===0?[i]:e===f?[r]:(it=o/f,[{x:n.x+it*b,y:n.y+it*g}])}return e!==0||d*nt!=k*tt?[]:(rt=b===0&&g===0,ut=k===0&&d===0,rt&&ut)?n.x!==i.x||n.y!==i.y?[]:[n]:rt?v(i,r,n)?[n]:[]:ut?v(n,t,i)?[i]:[]:(b!==0?(n.x<t.x?(c=n,l=n.x,p=t,s=t.x):(c=t,l=t.x,p=n,s=n.x),i.x<r.x?(a=i,y=i.x,w=r,h=r.x):(a=r,y=r.x,w=i,h=i.x)):(n.y<t.y?(c=n,l=n.y,p=t,s=t.y):(c=t,l=t.y,p=n,s=n.y),i.y<r.y?(a=i,y=i.y,w=r,h=r.y):(a=r,y=r.y,w=i,h=i.y)),l<=y?s<y?[]:s===y?u?[]:[a]:s<=h?[a,p]:[a,w]:l>h?[]:l===h?u?[]:[c]:s<=h?[c,p]:[c,w])}function p(n,t,i,r){var e=t.x-n.x,o=t.y-n.y,s=i.x-n.x,h=i.y-n.y,c=r.x-n.x,l=r.y-n.y,a=e*h-o*s,u=e*l-o*c,f;return Math.abs(a)>Number.EPSILON?(f=c*h-l*s,a>0?u>=0&&f>=0:u>=0||f>=0):u>0}function k(n,t){function it(n,t){var c=i.length-1,s=n-1,u,f,h,e,o;return(s<0&&(s=c),u=n+1,u>c&&(u=0),f=p(i[n],i[s],i[u],r[t]),!f)?!1:(h=r.length-1,e=t-1,e<0&&(e=h),o=t+1,o>h&&(o=0),f=p(r[t],r[e],r[o],i[n]),!f)?!1:!0}function rt(n,t){for(var u,f,r=0;r<i.length;r++)if(u=r+1,u%=i.length,f=y(n,t,i[r],i[u],!0),f.length>0)return!0;return!1}function ut(n,i){for(var r,u,o,s,e=0;e<f.length;e++)for(r=t[f[e]],u=0;u<r.length;u++)if(o=u+1,o%=r.length,s=y(n,i,r[u],r[o],!0),s.length>0)return!0;return!1}for(var i=n.concat(),r,f=[],o,e,h,c,l,a,b=[],k,d,g,nt,v,w,s,u=0,tt=t.length;u<tt;u++)f.push(u);for(v=0,w=f.length*2;f.length>0;){if(w--,w<0){console.log('THREE.ShapeUtils: Infinite Loop! Holes left:" + indepHoles.length + ", Probably Hole outside Shape!');break}for(e=v;e<i.length;e++){for(h=i[e],o=-1,u=0;u<f.length;u++)if(l=f[u],a=h.x+":"+h.y+":"+l,b[a]===undefined){for(r=t[l],s=0;s<r.length;s++)if((c=r[s],it(e,s))&&!rt(h,c)&&!ut(h,c)){o=s;f.splice(u,1);k=i.slice(0,e+1);d=i.slice(e);g=r.slice(o);nt=r.slice(0,o+1);i=k.concat(g).concat(nt).concat(d);v=e;break}if(o>=0)break;b[a]=!0}if(o>=0)break}}return i}var i,e,r,o,u,l,s,f,h,w,b,c;for(a(n),t.forEach(a),s={},f=n.concat(),h=0,w=t.length;h<w;h++)Array.prototype.push.apply(f,t[h]);for(i=0,e=f.length;i<e;i++)u=f[i].x+":"+f[i].y,s[u]!==undefined&&console.warn("THREE.ShapeUtils: Duplicate point",u,i),s[u]=i;for(b=k(n,t),c=gt.triangulate(b,!1),i=0,e=c.length;i<e;i++)for(o=c[i],r=0;r<3;r++)u=o[r].x+":"+o[r].y,l=s[u],l!==undefined&&(o[r]=l);return c.concat()},isClockWise:function(n){return gt.area(n)<0}};fr.prototype=Object.create(s.prototype);fr.prototype.constructor=fr;ii.prototype=Object.create(u.prototype);ii.prototype.constructor=ii;ii.prototype.getArrays=function(){var n=this.getAttribute("position"),r=n?Array.prototype.slice.call(n.array):[],t=this.getAttribute("uv"),u=t?Array.prototype.slice.call(t.array):[],i=this.index,f=i?Array.prototype.slice.call(i.array):[];return{position:r,uv:u,index:f}};ii.prototype.addShapeList=function(n,t){var f=this,e=n.length,r,u;for(t.arrays=this.getArrays(),r=0;r<e;r++)u=n[r],f.addShape(u,t);this.setIndex(t.arrays.index);this.addAttribute("position",new i(t.arrays.position,3));this.addAttribute("uv",new i(t.arrays.uv,2))};ii.prototype.addShape=function(r,u){function lt(n,t,i){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(i).add(n)}function yi(n,i,r){var o,s,c,u=n.x-i.x,f=n.y-i.y,e=r.x-n.x,h=r.y-n.y,a=u*u+f*f,d=u*h-f*e,v,l;if(Math.abs(d)>Number.EPSILON){var y=Math.sqrt(a),p=Math.sqrt(e*e+h*h),w=i.x-f/y,b=i.y+u/y,g=r.x-h/p,nt=r.y+e/p,k=((g-w)*h-(nt-b)*e)/(u*h-f*e);if(o=w+u*k-n.x,s=b+f*k-n.y,v=o*o+s*s,v<=2)return new t(o,s);c=Math.sqrt(v/2)}else l=!1,u>Number.EPSILON?e>Number.EPSILON&&(l=!0):u<-Number.EPSILON?e<-Number.EPSILON&&(l=!0):Math.sign(f)===Math.sign(h)&&(l=!0),l?(o=-f,s=u,c=Math.sqrt(a)):(o=u,s=f,c=Math.sqrt(a/2));return new t(o/c,s/c)}function ki(){var i=a.length/3,t,n;if(vt){for(t=0,n=b*t,f=0;f<kt;f++)c=ct[f],ei(c[2]+n,c[1]+n,c[0]+n);for(t=p+et*2,n=b*t,f=0;f<kt;f++)c=ct[f],ei(c[0]+n,c[1]+n,c[2]+n)}else{for(f=0;f<kt;f++)c=ct[f],ei(c[2],c[1],c[0]);for(f=0;f<kt;f++)c=ct[f],ei(c[0]+b*p,c[1]+b*p,c[2]+b*p)}ui.addGroup(i,a.length/3-i,u.material!==undefined?u.material:0)}function di(){var t=a.length/3,n=0;for(pi(w,n),n+=w.length,e=0,v=l.length;e<v;e++)s=l[e],pi(s,n),n+=s.length;ui.addGroup(t,a.length/3-t,u.extrudeMaterial!==undefined?u.extrudeMaterial:1)}function pi(n,t){var u,r,i,e;for(f=n.length;--f>=0;)for(u=f,r=f-1,r<0&&(r=n.length-1),i=0,e=p+et*2,i=0;i<e;i++){var o=b*i,s=b*(i+1),h=t+u+o,c=t+r+o,l=t+r+s,a=t+u+s;gi(h,c,l,a)}}function tt(n,t,i){ht.push(n);ht.push(t);ht.push(i)}function ei(n,t,i){it(n);it(t);it(i);var r=a.length/3,u=ai.generateTopUV(ui,a,r-3,r-2,r-1);rt(u[0]);rt(u[1]);rt(u[2])}function gi(n,t,i,r){it(n);it(t);it(r);it(t);it(i);it(r);var f=a.length/3,u=ai.generateSideWallUV(ui,a,f-6,f-3,f-2,f-1);rt(u[0]);rt(u[1]);rt(u[3]);rt(u[1]);rt(u[2]);rt(u[3])}function it(n){ci.push(a.length/3);a.push(ht[n*3+0]);a.push(ht[n*3+1]);a.push(ht[n*3+2])}function rt(n){li.push(n.x);li.push(n.y)}var oi=u.arrays?u.arrays:this.getArrays(),a=oi.position,ci=oi.index,li=oi.uv,ht=[],si=u.amount!==undefined?u.amount:100,ti=u.bevelThickness!==undefined?u.bevelThickness:6,ii=u.bevelSize!==undefined?u.bevelSize:ti-2,et=u.bevelSegments!==undefined?u.bevelSegments:3,vt=u.bevelEnabled!==undefined?u.bevelEnabled:!0,wi=u.curveSegments!==undefined?u.curveSegments:12,p=u.steps!==undefined?u.steps:1,hi=u.extrudePath,yt,ri=!1,ai=u.UVGenerator!==undefined?u.UVGenerator:fr.WorldUVGenerator,pt,wt,bt,k,ct,w,ut,d,at,ot,o,b,c,kt,dt,fi,ft,ni,st;hi&&(yt=hi.getSpacedPoints(p),ri=!0,vt=!1,pt=u.frames!==undefined?u.frames:hi.computeFrenetFrames(p,!1),wt=new n,bt=new n,k=new n);vt||(et=0,ti=0,ii=0);var s,e,v,ui=this,vi=r.extractPoints(wi),y=vi.shape,l=vi.holes,bi=!gt.isClockWise(y);if(bi)for(y=y.reverse(),e=0,v=l.length;e<v;e++)s=l[e],gt.isClockWise(s)&&(l[e]=s.reverse());for(ct=gt.triangulateShape(y,l),w=y,e=0,v=l.length;e<v;e++)s=l[e],y=y.concat(s);b=y.length;kt=ct.length;dt=[];for(var f=0,h=w.length,g=h-1,nt=f+1;f<h;f++,g++,nt++)g===h&&(g=0),nt===h&&(nt=0),dt[f]=yi(w[f],w[g],w[nt]);for(fi=[],ni=dt.concat(),e=0,v=l.length;e<v;e++){for(s=l[e],ft=[],f=0,h=s.length,g=h-1,nt=f+1;f<h;f++,g++,nt++)g===h&&(g=0),nt===h&&(nt=0),ft[f]=yi(s[f],s[g],s[nt]);fi.push(ft);ni=ni.concat(ft)}for(ut=0;ut<et;ut++){for(at=ut/et,ot=ti*Math.cos(at*Math.PI/2),d=ii*Math.sin(at*Math.PI/2),f=0,h=w.length;f<h;f++)o=lt(w[f],dt[f],d),tt(o.x,o.y,-ot);for(e=0,v=l.length;e<v;e++)for(s=l[e],ft=fi[e],f=0,h=s.length;f<h;f++)o=lt(s[f],ft[f],d),tt(o.x,o.y,-ot)}for(d=ii,f=0;f<b;f++)o=vt?lt(y[f],ni[f],d):y[f],ri?(bt.copy(pt.normals[0]).multiplyScalar(o.x),wt.copy(pt.binormals[0]).multiplyScalar(o.y),k.copy(yt[0]).add(bt).add(wt),tt(k.x,k.y,k.z)):tt(o.x,o.y,0);for(st=1;st<=p;st++)for(f=0;f<b;f++)o=vt?lt(y[f],ni[f],d):y[f],ri?(bt.copy(pt.normals[st]).multiplyScalar(o.x),wt.copy(pt.binormals[st]).multiplyScalar(o.y),k.copy(yt[st]).add(bt).add(wt),tt(k.x,k.y,k.z)):tt(o.x,o.y,si/p*st);for(ut=et-1;ut>=0;ut--){for(at=ut/et,ot=ti*Math.cos(at*Math.PI/2),d=ii*Math.sin(at*Math.PI/2),f=0,h=w.length;f<h;f++)o=lt(w[f],dt[f],d),tt(o.x,o.y,si+ot);for(e=0,v=l.length;e<v;e++)for(s=l[e],ft=fi[e],f=0,h=s.length;f<h;f++)o=lt(s[f],ft[f],d),ri?tt(o.x,o.y+yt[p-1].y,yt[p-1].x+ot):tt(o.x,o.y,si+ot)}ki();di();u.arrays||(this.setIndex(ci),this.addAttribute("position",new i(a,3)),this.addAttribute("uv",new i(u.arrays.uv,2)))};fr.WorldUVGenerator={generateTopUV:function(n,i,r,u,f){var e=i[r*3],o=i[r*3+1],s=i[u*3],h=i[u*3+1],c=i[f*3],l=i[f*3+1];return[new t(e,o),new t(s,h),new t(c,l)]},generateSideWallUV:function(n,i,r,u,f,e){var v=i[r*3],o=i[r*3+1],s=i[r*3+2],y=i[u*3],h=i[u*3+1],c=i[u*3+2],p=i[f*3],w=i[f*3+1],l=i[f*3+2],b=i[e*3],k=i[e*3+1],a=i[e*3+2];return Math.abs(o-h)<.01?[new t(v,1-s),new t(y,1-c),new t(p,1-l),new t(b,1-a)]:[new t(o,1-s),new t(h,1-c),new t(w,1-l),new t(k,1-a)]}};as.prototype=Object.create(s.prototype);as.prototype.constructor=as;ue.prototype=Object.create(ii.prototype);ue.prototype.constructor=ue;vs.prototype=Object.create(s.prototype);vs.prototype.constructor=vs;eu.prototype=Object.create(u.prototype);eu.prototype.constructor=eu;ys.prototype=Object.create(s.prototype);ys.prototype.constructor=ys;fe.prototype=Object.create(u.prototype);fe.prototype.constructor=fe;ps.prototype=Object.create(s.prototype);ps.prototype.constructor=ps;ee.prototype=Object.create(u.prototype);ee.prototype.constructor=ee;oe.prototype=Object.create(s.prototype);oe.prototype.constructor=oe;se.prototype=Object.create(u.prototype);se.prototype.constructor=se;ws.prototype=Object.create(u.prototype);ws.prototype.constructor=ws;ou.prototype=Object.create(s.prototype);ou.prototype.constructor=ou;wi.prototype=Object.create(u.prototype);wi.prototype.constructor=wi;bs.prototype=Object.create(ou.prototype);bs.prototype.constructor=bs;ks.prototype=Object.create(wi.prototype);ks.prototype.constructor=ks;ds.prototype=Object.create(s.prototype);ds.prototype.constructor=ds;he.prototype=Object.create(u.prototype);he.prototype.constructor=he;at=Object.freeze({WireframeGeometry:is,ParametricGeometry:rs,ParametricBufferGeometry:kf,TetrahedronGeometry:fs,TetrahedronBufferGeometry:df,OctahedronGeometry:es,OctahedronBufferGeometry:fu,IcosahedronGeometry:os,IcosahedronBufferGeometry:gf,DodecahedronGeometry:ss,DodecahedronBufferGeometry:ne,PolyhedronGeometry:us,PolyhedronBufferGeometry:lt,TubeGeometry:hs,TubeBufferGeometry:te,TorusKnotGeometry:cs,TorusKnotBufferGeometry:ie,TorusGeometry:ls,TorusBufferGeometry:re,TextGeometry:as,TextBufferGeometry:ue,SphereGeometry:vs,SphereBufferGeometry:eu,RingGeometry:ys,RingBufferGeometry:fe,PlaneGeometry:bo,PlaneBufferGeometry:ru,LatheGeometry:ps,LatheBufferGeometry:ee,ShapeGeometry:oe,ShapeBufferGeometry:se,ExtrudeGeometry:fr,ExtrudeBufferGeometry:ii,EdgesGeometry:ws,ConeGeometry:bs,ConeBufferGeometry:ks,CylinderGeometry:ou,CylinderBufferGeometry:wi,CircleGeometry:ds,CircleBufferGeometry:he,BoxGeometry:lf,BoxBufferGeometry:iu});ce.prototype=Object.create(l.prototype);ce.prototype.constructor=ce;ce.prototype.isShadowMaterial=!0;le.prototype=Object.create(dt.prototype);le.prototype.constructor=le;le.prototype.isRawShaderMaterial=!0;si.prototype=Object.create(l.prototype);si.prototype.constructor=si;si.prototype.isMeshStandardMaterial=!0;si.prototype.copy=function(n){return l.prototype.copy.call(this,n),this.defines={STANDARD:""},this.color.copy(n.color),this.roughness=n.roughness,this.metalness=n.metalness,this.map=n.map,this.lightMap=n.lightMap,this.lightMapIntensity=n.lightMapIntensity,this.aoMap=n.aoMap,this.aoMapIntensity=n.aoMapIntensity,this.emissive.copy(n.emissive),this.emissiveMap=n.emissiveMap,this.emissiveIntensity=n.emissiveIntensity,this.bumpMap=n.bumpMap,this.bumpScale=n.bumpScale,this.normalMap=n.normalMap,this.normalScale.copy(n.normalScale),this.displacementMap=n.displacementMap,this.displacementScale=n.displacementScale,this.displacementBias=n.displacementBias,this.roughnessMap=n.roughnessMap,this.metalnessMap=n.metalnessMap,this.alphaMap=n.alphaMap,this.envMap=n.envMap,this.envMapIntensity=n.envMapIntensity,this.refractionRatio=n.refractionRatio,this.wireframe=n.wireframe,this.wireframeLinewidth=n.wireframeLinewidth,this.wireframeLinecap=n.wireframeLinecap,this.wireframeLinejoin=n.wireframeLinejoin,this.skinning=n.skinning,this.morphTargets=n.morphTargets,this.morphNormals=n.morphNormals,this};su.prototype=Object.create(si.prototype);su.prototype.constructor=su;su.prototype.isMeshPhysicalMaterial=!0;su.prototype.copy=function(n){return si.prototype.copy.call(this,n),this.defines={PHYSICAL:""},this.reflectivity=n.reflectivity,this.clearCoat=n.clearCoat,this.clearCoatRoughness=n.clearCoatRoughness,this};vt.prototype=Object.create(l.prototype);vt.prototype.constructor=vt;vt.prototype.isMeshPhongMaterial=!0;vt.prototype.copy=function(n){return l.prototype.copy.call(this,n),this.color.copy(n.color),this.specular.copy(n.specular),this.shininess=n.shininess,this.map=n.map,this.lightMap=n.lightMap,this.lightMapIntensity=n.lightMapIntensity,this.aoMap=n.aoMap,this.aoMapIntensity=n.aoMapIntensity,this.emissive.copy(n.emissive),this.emissiveMap=n.emissiveMap,this.emissiveIntensity=n.emissiveIntensity,this.bumpMap=n.bumpMap,this.bumpScale=n.bumpScale,this.normalMap=n.normalMap,this.normalScale.copy(n.normalScale),this.displacementMap=n.displacementMap,this.displacementScale=n.displacementScale,this.displacementBias=n.displacementBias,this.specularMap=n.specularMap,this.alphaMap=n.alphaMap,this.envMap=n.envMap,this.combine=n.combine,this.reflectivity=n.reflectivity,this.refractionRatio=n.refractionRatio,this.wireframe=n.wireframe,this.wireframeLinewidth=n.wireframeLinewidth,this.wireframeLinecap=n.wireframeLinecap,this.wireframeLinejoin=n.wireframeLinejoin,this.skinning=n.skinning,this.morphTargets=n.morphTargets,this.morphNormals=n.morphNormals,this};hu.prototype=Object.create(vt.prototype);hu.prototype.constructor=hu;hu.prototype.isMeshToonMaterial=!0;hu.prototype.copy=function(n){return vt.prototype.copy.call(this,n),this.gradientMap=n.gradientMap,this};er.prototype=Object.create(l.prototype);er.prototype.constructor=er;er.prototype.isMeshNormalMaterial=!0;er.prototype.copy=function(n){return l.prototype.copy.call(this,n),this.bumpMap=n.bumpMap,this.bumpScale=n.bumpScale,this.normalMap=n.normalMap,this.normalScale.copy(n.normalScale),this.displacementMap=n.displacementMap,this.displacementScale=n.displacementScale,this.displacementBias=n.displacementBias,this.wireframe=n.wireframe,this.wireframeLinewidth=n.wireframeLinewidth,this.skinning=n.skinning,this.morphTargets=n.morphTargets,this.morphNormals=n.morphNormals,this};cu.prototype=Object.create(l.prototype);cu.prototype.constructor=cu;cu.prototype.isMeshLambertMaterial=!0;cu.prototype.copy=function(n){return l.prototype.copy.call(this,n),this.color.copy(n.color),this.map=n.map,this.lightMap=n.lightMap,this.lightMapIntensity=n.lightMapIntensity,this.aoMap=n.aoMap,this.aoMapIntensity=n.aoMapIntensity,this.emissive.copy(n.emissive),this.emissiveMap=n.emissiveMap,this.emissiveIntensity=n.emissiveIntensity,this.specularMap=n.specularMap,this.alphaMap=n.alphaMap,this.envMap=n.envMap,this.combine=n.combine,this.reflectivity=n.reflectivity,this.refractionRatio=n.refractionRatio,this.wireframe=n.wireframe,this.wireframeLinewidth=n.wireframeLinewidth,this.wireframeLinecap=n.wireframeLinecap,this.wireframeLinejoin=n.wireframeLinejoin,this.skinning=n.skinning,this.morphTargets=n.morphTargets,this.morphNormals=n.morphNormals,this};lu.prototype=Object.create(y.prototype);lu.prototype.constructor=lu;lu.prototype.isLineDashedMaterial=!0;lu.prototype.copy=function(n){return y.prototype.copy.call(this,n),this.scale=n.scale,this.dashSize=n.dashSize,this.gapSize=n.gapSize,this};wp=Object.freeze({ShadowMaterial:ce,SpriteMaterial:rr,RawShaderMaterial:le,ShaderMaterial:dt,PointsMaterial:ur,MeshPhysicalMaterial:su,MeshStandardMaterial:si,MeshPhongMaterial:vt,MeshToonMaterial:hu,MeshNormalMaterial:er,MeshLambertMaterial:cu,MeshDepthMaterial:nr,MeshDistanceMaterial:tr,MeshBasicMaterial:ht,LineDashedMaterial:lu,LineBasicMaterial:y,Material:l});ae={enabled:!1,files:{},add:function(n,t){this.enabled!==!1&&(this.files[n]=t)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};ft=new bp;ri={};Object.assign(ui.prototype,{load:function(n,t,i,r){var y=this,u,c,p,o,s,a,l,h,b,f,v;if(n===undefined&&(n=""),this.path!==undefined&&(n=this.path+n),n=this.manager.resolveURL(n),u=this,c=ae.get(n),c!==undefined)return u.manager.itemStart(n),setTimeout(function(){t&&t(c);u.manager.itemEnd(n)},0),c;if(ri[n]!==undefined){ri[n].push({onLoad:t,onProgress:i,onError:r});return}if(p=/^data:(.*?)(;base64)?,(.*)$/,o=n.match(p),o){var w=o[1],k=!!o[2],e=o[3];e=window.decodeURIComponent(e);k&&(e=window.atob(e));try{a=(this.responseType||"").toLowerCase();switch(a){case"arraybuffer":case"blob":for(l=new Uint8Array(e.length),h=0;h<e.length;h++)l[h]=e.charCodeAt(h);s=a==="blob"?new Blob([l.buffer],{type:w}):l.buffer;break;case"document":b=new DOMParser;s=b.parseFromString(e,w);break;case"json":s=JSON.parse(e);break;default:s=e}window.setTimeout(function(){t&&t(s);u.manager.itemEnd(n)},0)}catch(d){window.setTimeout(function(){r&&r(d);u.manager.itemEnd(n);u.manager.itemError(n)},0)}}else{ri[n]=[];ri[n].push({onLoad:t,onProgress:i,onError:r});f=new XMLHttpRequest;f.open("GET",n,!0);f.addEventListener("load",function(t){var o=t.target.response,e,i,f,r;if(ae.add(n,o),e=ri[n],delete ri[n],this.status===200){for(i=0,f=e.length;i<f;i++)if(r=e[i],r.onLoad)r.onLoad(o);u.manager.itemEnd(n)}else if(this.status===0){for(console.warn("THREE.FileLoader: HTTP Status 0 received."),i=0,f=e.length;i<f;i++)if(r=e[i],r.onLoad)r.onLoad(o);u.manager.itemEnd(n)}else{for(i=0,f=e.length;i<f;i++)if(r=e[i],r.onError)r.onError(t);u.manager.itemEnd(n);u.manager.itemError(n)}},!1);f.addEventListener("progress",function(t){for(var u=ri[n],r,i=0,f=u.length;i<f;i++)if(r=u[i],r.onProgress)r.onProgress(t)},!1);f.addEventListener("error",function(t){var f=ri[n],i,e,r;for(delete ri[n],i=0,e=f.length;i<e;i++)if(r=f[i],r.onError)r.onError(t);u.manager.itemEnd(n);u.manager.itemError(n)},!1);this.responseType!==undefined&&(f.responseType=this.responseType);this.withCredentials!==undefined&&(f.withCredentials=this.withCredentials);f.overrideMimeType&&f.overrideMimeType(this.mimeType!==undefined?this.mimeType:"text/plain");for(v in y.requestHeader)f.setRequestHeader(v,y.requestHeader[v]);f.send(null)}return u.manager.itemStart(n),f},setPath:function(n){return this.path=n,this},setResponseType:function(n){return this.responseType=n,this},setWithCredentials:function(n){return this.withCredentials=n,this},setMimeType:function(n){return this.mimeType=n,this},setRequestHeader:function(n){return this.requestHeader=n,this}});Object.assign(ett.prototype,{load:function(n,t,i,r){function l(o){e.load(n[o],function(n){var i=h._parser(n,!0);f[o]={width:i.width,height:i.height,format:i.format,mipmaps:i.mipmaps};s+=1;s===6&&(i.mipmapCount===1&&(u.minFilter=et),u.format=i.format,u.needsUpdate=!0,t&&t(u))},i,r)}var h=this,f=[],u=new bf,e,s,o,c;if(u.image=f,e=new ui(this.manager),e.setPath(this.path),e.setResponseType("arraybuffer"),Array.isArray(n))for(s=0,o=0,c=n.length;o<c;++o)l(o);else e.load(n,function(n){var i=h._parser(n,!0),o,r,e;if(i.isCubemap)for(o=i.mipmaps.length/i.mipmapCount,r=0;r<o;r++)for(f[r]={mipmaps:[]},e=0;e<i.mipmapCount;e++)f[r].mipmaps.push(i.mipmaps[r*i.mipmapCount+e]),f[r].format=i.format,f[r].width=i.width,f[r].height=i.height;else u.image.width=i.width,u.image.height=i.height,u.mipmaps=i.mipmaps;i.mipmapCount===1&&(u.minFilter=et);u.format=i.format;u.needsUpdate=!0;t&&t(u)},i,r);return u},setPath:function(n){return this.path=n,this}});Object.assign(ott.prototype,{load:function(n,t,i,r){var e=this,u=new gr,f=new ui(this.manager);return f.setResponseType("arraybuffer"),f.load(n,function(n){var i=e._parser(n);i&&(undefined!==i.image?u.image=i.image:undefined!==i.data&&(u.image.width=i.width,u.image.height=i.height,u.image.data=i.data),u.wrapS=undefined!==i.wrapS?i.wrapS:yt,u.wrapT=undefined!==i.wrapT?i.wrapT:yt,u.magFilter=undefined!==i.magFilter?i.magFilter:et,u.minFilter=undefined!==i.minFilter?i.minFilter:so,u.anisotropy=undefined!==i.anisotropy?i.anisotropy:1,undefined!==i.format&&(u.format=i.format),undefined!==i.type&&(u.type=i.type),undefined!==i.mipmaps&&(u.mipmaps=i.mipmaps),1===i.mipmapCount&&(u.minFilter=et),u.needsUpdate=!0,t&&t(u,i))},i,r),u}});Object.assign(gs.prototype,{crossOrigin:"Anonymous",load:function(n,t,i,r){var u,e,f;return(n===undefined&&(n=""),this.path!==undefined&&(n=this.path+n),n=this.manager.resolveURL(n),u=this,e=ae.get(n),e!==undefined)?(u.manager.itemStart(n),setTimeout(function(){t&&t(e);u.manager.itemEnd(n)},0),e):(f=document.createElementNS("http://www.w3.org/1999/xhtml","img"),f.addEventListener("load",function(){ae.add(n,this);t&&t(this);u.manager.itemEnd(n)},!1),f.addEventListener("error",function(t){r&&r(t);u.manager.itemEnd(n);u.manager.itemError(n)},!1),n.substr(0,5)!=="data:"&&this.crossOrigin!==undefined&&(f.crossOrigin=this.crossOrigin),u.manager.itemStart(n),f.src=n,f)},setCrossOrigin:function(n){return this.crossOrigin=n,this},setPath:function(n){return this.path=n,this}});Object.assign(stt.prototype,{crossOrigin:"Anonymous",load:function(n,t,i,r){function s(i){e.load(n[i],function(n){u.images[i]=n;o++;o===6&&(u.needsUpdate=!0,t&&t(u))},undefined,r)}var u=new di,e=new gs(this.manager),o,f;for(e.setCrossOrigin(this.crossOrigin),e.setPath(this.path),o=0,f=0;f<n.length;++f)s(f);return u},setCrossOrigin:function(n){return this.crossOrigin=n,this},setPath:function(n){return this.path=n,this}});Object.assign(dl.prototype,{crossOrigin:"Anonymous",load:function(n,t,i,r){var f=new gs(this.manager),u;return f.setCrossOrigin(this.crossOrigin),f.setPath(this.path),u=new b,u.image=f.load(n,function(){var i=n.search(/\.(jpg|jpeg)$/)>0||n.search(/^data\:image\/jpeg/)===0;u.format=i?uf:ai;u.needsUpdate=!0;t!==undefined&&t(u)},i,r),u},setCrossOrigin:function(n){return this.crossOrigin=n,this},setPath:function(n){return this.path=n,this}});k.prototype=Object.assign(Object.create(r.prototype),{constructor:k,isLight:!0,copy:function(n){return r.prototype.copy.call(this,n),this.color.copy(n.color),this.intensity=n.intensity,this},toJSON:function(n){var t=r.prototype.toJSON.call(this,n);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==undefined&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==undefined&&(t.object.distance=this.distance),this.angle!==undefined&&(t.object.angle=this.angle),this.decay!==undefined&&(t.object.decay=this.decay),this.penumbra!==undefined&&(t.object.penumbra=this.penumbra),this.shadow!==undefined&&(t.object.shadow=this.shadow.toJSON()),t}});gl.prototype=Object.assign(Object.create(k.prototype),{constructor:gl,isHemisphereLight:!0,copy:function(n){return k.prototype.copy.call(this,n),this.groundColor.copy(n.groundColor),this}});Object.assign(au.prototype,{copy:function(n){return this.camera=n.camera.clone(),this.bias=n.bias,this.radius=n.radius,this.mapSize.copy(n.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var n={};return this.bias!==0&&(n.bias=this.bias),this.radius!==1&&(n.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(n.mapSize=this.mapSize.toArray()),n.camera=this.camera.toJSON(!1).object,delete n.camera.matrix,n}});na.prototype=Object.assign(Object.create(au.prototype),{constructor:na,isSpotLightShadow:!0,update:function(n){var t=this.camera,i=h.RAD2DEG*2*n.angle,r=this.mapSize.width/this.mapSize.height,u=n.distance||t.far;(i!==t.fov||r!==t.aspect||u!==t.far)&&(t.fov=i,t.aspect=r,t.far=u,t.updateProjectionMatrix())}});ta.prototype=Object.assign(Object.create(k.prototype),{constructor:ta,isSpotLight:!0,copy:function(n){return k.prototype.copy.call(this,n),this.distance=n.distance,this.angle=n.angle,this.penumbra=n.penumbra,this.decay=n.decay,this.target=n.target.clone(),this.shadow=n.shadow.clone(),this}});nh.prototype=Object.assign(Object.create(k.prototype),{constructor:nh,isPointLight:!0,copy:function(n){return k.prototype.copy.call(this,n),this.distance=n.distance,this.decay=n.decay,this.shadow=n.shadow.clone(),this}});ia.prototype=Object.assign(Object.create(au.prototype),{constructor:ia});ra.prototype=Object.assign(Object.create(k.prototype),{constructor:ra,isDirectionalLight:!0,copy:function(n){return k.prototype.copy.call(this,n),this.target=n.target.clone(),this.shadow=n.shadow.clone(),this}});th.prototype=Object.assign(Object.create(k.prototype),{constructor:th,isAmbientLight:!0});ua.prototype=Object.assign(Object.create(k.prototype),{constructor:ua,isRectAreaLight:!0,copy:function(n){return k.prototype.copy.call(this,n),this.width=n.width,this.height=n.height,this},toJSON:function(n){var t=k.prototype.toJSON.call(this,n);return t.object.width=this.width,t.object.height=this.height,t}});it={arraySlice:function(n,t,i){return it.isTypedArray(n)?new n.constructor(n.subarray(t,i!==undefined?i:n.length)):n.slice(t,i)},convertArray:function(n,t,i){return!n||!i&&n.constructor===t?n:typeof t.BYTES_PER_ELEMENT=="number"?new t(n):Array.prototype.slice.call(n)},isTypedArray:function(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)},getKeyframeOrder:function(n){function u(t,i){return n[t]-n[i]}for(var r=n.length,i=new Array(r),t=0;t!==r;++t)i[t]=t;return i.sort(u),i},sortedArray:function(n,t,i){for(var e=n.length,o=new n.constructor(e),s,r,u=0,f=0;f!==e;++u)for(s=i[u]*t,r=0;r!==t;++r)o[f++]=n[s+r];return o},flattenJSON:function(n,t,i,r){for(var e=1,u=n[0],f;u!==undefined&&u[r]===undefined;)u=n[e++];if(u!==undefined&&(f=u[r],f!==undefined))if(Array.isArray(f)){do f=u[r],f!==undefined&&(t.push(u.time),i.push.apply(i,f)),u=n[e++];while(u!==undefined)}else if(f.toArray!==undefined){do f=u[r],f!==undefined&&(t.push(u.time),f.toArray(i,i.length)),u=n[e++];while(u!==undefined)}else do f=u[r],f!==undefined&&(t.push(u.time),i.push(f)),u=n[e++];while(u!==undefined)}};Object.assign(wt.prototype,{evaluate:function(n){var o=this,u=this.parameterPositions,t=this._cachedIndex,r=u[t],i=u[t-1],f,h,e,s;n:{t:{i:{r:if(!(n<r)){for(e=t+2;;){if(r===undefined){if(n<i)break r;return t=u.length,o._cachedIndex=t,o.afterEnd_(t-1,n,i)}if(t===e)break;if(i=r,r=u[++t],n<r)break t}f=u.length;break i}if(!(n>=i)){for(h=u[1],n<h&&(t=2,i=h),e=t-2;;){if(i===undefined)return o._cachedIndex=0,o.beforeStart_(0,n,r);if(t===e)break;if(r=i,i=u[--t-1],n>=i)break t}f=t;t=0;break i}break n}while(t<f)s=t+f>>>1,n<u[s]?f=s:t=s+1;if(r=u[t],i=u[t-1],i===undefined)return this._cachedIndex=0,this.beforeStart_(0,n,r);if(r===undefined)return t=u.length,this._cachedIndex=t,this.afterEnd_(t-1,i,n)}this._cachedIndex=t;this.intervalChanged_(t,i,r)}return this.interpolate_(t,i,n,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(n){for(var i=this.resultBuffer,u=this.sampleValues,r=this.valueSize,f=n*r,t=0;t!==r;++t)i[t]=u[f+t];return i},interpolate_:function(){throw new Error("call to abstract method");},intervalChanged_:function(){}});Object.assign(wt.prototype,{beforeStart_:wt.prototype.copySampleValue_,afterEnd_:wt.prototype.copySampleValue_});fa.prototype=Object.assign(Object.create(wt.prototype),{constructor:fa,DefaultSettings_:{endingStart:kr,endingEnd:kr},intervalChanged_:function(n,t,i){var r=this.parameterPositions,u=n-2,f=n+1,e=r[u],o=r[f],s,h;if(e===undefined)switch(this.getSettings_().endingStart){case dr:u=n;e=2*t-i;break;case vo:u=r.length-2;e=t+r[u]-r[u+1];break;default:u=n;e=i}if(o===undefined)switch(this.getSettings_().endingEnd){case dr:f=n;o=2*i-t;break;case vo:f=1;o=i+r[1]-r[0];break;default:f=n-1;o=t}s=(i-t)*.5;h=this.valueSize;this._weightPrev=s/(t-e);this._weightNext=s/(o-i);this._offsetPrev=u*h;this._offsetNext=f*h},interpolate_:function(n,t,i,r){for(var a=this.resultBuffer,s=this.sampleValues,l=this.valueSize,v=n*l,y=v-l,p=this._offsetPrev,w=this._offsetNext,f=this._weightPrev,h=this._weightNext,e=(i-t)/(r-t),o=e*e,c=o*e,b=-f*c+2*f*o-f*e,k=(1+f)*c+(-1.5-2*f)*o+(-.5+f)*e+1,d=(-1-h)*c+(1.5+h)*o+.5*e,g=h*c-h*o,u=0;u!==l;++u)a[u]=b*s[p+u]+k*s[y+u]+d*s[v+u]+g*s[w+u];return a}});ih.prototype=Object.assign(Object.create(wt.prototype),{constructor:ih,interpolate_:function(n,t,i,r){for(var e=this.resultBuffer,o=this.sampleValues,f=this.valueSize,s=n*f,c=s-f,h=(i-t)/(r-t),l=1-h,u=0;u!==f;++u)e[u]=o[c+u]*l+o[s+u]*h;return e}});ea.prototype=Object.assign(Object.create(wt.prototype),{constructor:ea,interpolate_:function(n){return this.copySampleValue_(n-1)}});hi={TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:ao,InterpolantFactoryMethodDiscrete:function(n){return new ea(this.times,this.values,this.getValueSize(),n)},InterpolantFactoryMethodLinear:function(n){return new ih(this.times,this.values,this.getValueSize(),n)},InterpolantFactoryMethodSmooth:function(n){return new fa(this.times,this.values,this.getValueSize(),n)},setInterpolation:function(n){var t,i;switch(n){case lo:t=this.InterpolantFactoryMethodDiscrete;break;case ao:t=this.InterpolantFactoryMethodLinear;break;case kc:t=this.InterpolantFactoryMethodSmooth}if(t===undefined){if(i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name,this.createInterpolant===undefined)if(n!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);console.warn("THREE.KeyframeTrackPrototype:",i);return}this.createInterpolant=t},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return lo;case this.InterpolantFactoryMethodLinear:return ao;case this.InterpolantFactoryMethodSmooth:return kc}},getValueSize:function(){return this.values.length/this.times.length},shift:function(n){var i,t,r;if(n!==0)for(i=this.times,t=0,r=i.length;t!==r;++t)i[t]+=n;return this},scale:function(n){var i,t,r;if(n!==1)for(i=this.times,t=0,r=i.length;t!==r;++t)i[t]*=n;return this},trim:function(n,t){for(var u=this.times,f=u.length,r=0,i=f-1,e;r!==f&&u[r]<n;)++r;while(i!==-1&&u[i]>t)--i;return++i,(r!==0||i!==f)&&(r>=i&&(i=Math.max(i,1),r=i-1),e=this.getValueSize(),this.times=it.arraySlice(u,r,i),this.values=it.arraySlice(this.values,r*e,i*e)),this},validate:function(){var f=this,i=!0,o=this.getValueSize(),r,t,n,c,e;o-Math.floor(o)!=0&&(console.error("THREE.KeyframeTrackPrototype: Invalid value size in track.",this),i=!1);var s=this.times,u=this.values,h=s.length;for(h===0&&(console.error("THREE.KeyframeTrackPrototype: Track is empty.",this),i=!1),r=null,n=0;n!==h;n++){if(t=s[n],typeof t=="number"&&isNaN(t)){console.error("THREE.KeyframeTrackPrototype: Time is not a valid number.",f,n,t);i=!1;break}if(r!==null&&r>t){console.error("THREE.KeyframeTrackPrototype: Out of order keys.",f,n,t,r);i=!1;break}r=t}if(u!==undefined&&it.isTypedArray(u))for(n=0,c=u.length;n!==c;++n)if(e=u[n],isNaN(e)){console.error("THREE.KeyframeTrackPrototype: Value is not a valid number.",f,n,e);i=!1;break}return i},optimize:function(){for(var u=this.times,f=this.values,t=this.getValueSize(),v=this.getInterpolation()===kc,i=1,e=u.length-1,a,o,s,n,r=1;r<e;++r){var h=!1,c=u[r],y=u[r+1];if(c!==y&&(r!==1||c!==c[0]))if(v)h=!0;else{var l=r*t,p=l-t,w=l+t;for(n=0;n!==t;++n)if(a=f[l+n],a!==f[p+n]||a!==f[w+n]){h=!0;break}}if(h){if(r!==i)for(u[i]=u[r],o=r*t,s=i*t,n=0;n!==t;++n)f[s+n]=f[o+n];++i}}if(e>0){u[i]=u[e];for(var o=e*t,s=i*t,n=0;n!==t;++n)f[s+n]=f[o+n];++i}return i!==u.length&&(this.times=it.arraySlice(u,0,i),this.values=it.arraySlice(f,0,i*t)),this}};ve.prototype=Object.assign(Object.create(hi),{constructor:ve,ValueTypeName:"vector"});oa.prototype=Object.assign(Object.create(wt.prototype),{constructor:oa,interpolate_:function(n,t,i,r){for(var e=this.resultBuffer,o=this.sampleValues,f=this.valueSize,u=n*f,h=(i-t)/(r-t),s=u+f;u!==s;u+=4)g.slerpFlat(e,0,o,u-f,o,u,h);return e}});rh.prototype=Object.assign(Object.create(hi),{constructor:rh,ValueTypeName:"quaternion",DefaultInterpolation:ao,InterpolantFactoryMethodLinear:function(n){return new oa(this.times,this.values,this.getValueSize(),n)},InterpolantFactoryMethodSmooth:undefined});ye.prototype=Object.assign(Object.create(hi),{constructor:ye,ValueTypeName:"number"});sa.prototype=Object.assign(Object.create(hi),{constructor:sa,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:lo,InterpolantFactoryMethodLinear:undefined,InterpolantFactoryMethodSmooth:undefined});ha.prototype=Object.assign(Object.create(hi),{constructor:ha,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:lo,InterpolantFactoryMethodLinear:undefined,InterpolantFactoryMethodSmooth:undefined});ca.prototype=Object.assign(Object.create(hi),{constructor:ca,ValueTypeName:"color"});vu.prototype=hi;hi.constructor=vu;Object.assign(vu,{parse:function(n){var t,i,r;if(n.type===undefined)throw new Error("track type undefined, can not parse");return t=vu._getTrackTypeForValueTypeName(n.type),n.times===undefined&&(i=[],r=[],it.flattenJSON(n.keys,i,r,"value"),n.times=i,n.values=r),t.parse!==undefined?t.parse(n):new t(n.name,n.times,n.values,n.interpolation)},toJSON:function(n){var r=n.constructor,t,i;return r.toJSON!==undefined?t=r.toJSON(n):(t={name:n.name,times:it.convertArray(n.times,Array),values:it.convertArray(n.values,Array)},i=n.getInterpolation(),i!==n.DefaultInterpolation&&(t.interpolation=i)),t.type=n.ValueTypeName,t},_getTrackTypeForValueTypeName:function(n){switch(n.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ye;case"vector":case"vector2":case"vector3":case"vector4":return ve;case"color":return ca;case"quaternion":return rh;case"bool":case"boolean":return ha;case"string":return sa}throw new Error("Unsupported typeName: "+n);}});Object.assign(ni,{parse:function(n){for(var i=[],r=n.tracks,f=1/(n.fps||1),t=0,u=r.length;t!==u;++t)i.push(vu.parse(r[t]).scale(f));return new ni(n.name,n.duration,i)},toJSON:function(n){for(var i=[],r=n.tracks,f={name:n.name,duration:n.duration,tracks:i},t=0,u=r.length;t!==u;++t)i.push(vu.toJSON(r[t]));return f},CreateFromMorphTargetSequence:function(n,t,i,r){for(var o=t.length,h=[],u,e,s,f=0;f<o;f++)u=[],e=[],u.push((f+o-1)%o,f,(f+1)%o),e.push(0,1,0),s=it.getKeyframeOrder(u),u=it.sortedArray(u,1,s),e=it.sortedArray(e,1,s),r||u[0]!==0||(u.push(o),e.push(e[0])),h.push(new ye(".morphTargetInfluences["+t[f].name+"]",u,e).scale(1/i));return new ni(n,-1,h)},findByName:function(n,t){var r=n,u,i;for(Array.isArray(n)||(u=n,r=u.geometry&&u.geometry.animations||u.animations),i=0;i<r.length;i++)if(r[i].name===t)return r[i];return null},CreateClipsFromMorphTargetSequences:function(n,t,i){for(var u={},s,e,o,h,r,f=0,c=n.length;f<c;f++)s=n[f],e=s.name.match(/^([\w-]*?)([\d]+)$/),e&&e.length>1&&(r=e[1],o=u[r],o||(u[r]=o=[]),o.push(s));h=[];for(r in u)h.push(ni.CreateFromMorphTargetSequence(r,u[r],t,i));return h},parseAnimation:function(n,t){var e,i,o,r,c,l,a,u,v,s;if(!n)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;var h=function(n,t,i,r,u){if(i.length!==0){var f=[],e=[];it.flattenJSON(i,f,e,r);f.length!==0&&u.push(new n(t,f,e))}},f=[],w=n.name||"default",y=n.length||-1,b=n.fps||30,p=n.hierarchy||[];for(e=0;e<p.length;e++)if(i=p[e].keys,i&&i.length!==0)if(i[0].morphTargets){for(o={},r=0;r<i.length;r++)if(i[r].morphTargets)for(u=0;u<i[r].morphTargets.length;u++)o[i[r].morphTargets[u]]=-1;for(c in o){for(l=[],a=[],u=0;u!==i[r].morphTargets.length;++u)v=i[r],l.push(v.time),a.push(v.morphTarget===c?1:0);f.push(new ye(".morphTargetInfluence["+c+"]",l,a))}y=o.length*(b||1)}else s=".bones["+t[e].name+"]",h(ve,s+".position",i,"pos",f),h(rh,s+".quaternion",i,"rot",f),h(ve,s+".scale",i,"scl",f);return f.length===0?null:new ni(w,y,f)}});Object.assign(ni.prototype,{resetDuration:function(){for(var u=this,f=this.tracks,t=0,i,n=0,r=f.length;n!==r;++n)i=u.tracks[n],t=Math.max(t,i.times[i.times.length-1]);this.duration=t},trim:function(){for(var t=this,n=0;n<this.tracks.length;n++)t.tracks[n].trim(0,t.duration);return this},optimize:function(){for(var t=this,n=0;n<this.tracks.length;n++)t.tracks[n].optimize();return this}});Object.assign(la.prototype,{load:function(n,t,i,r){var u=this,f=new ui(u.manager);f.load(n,function(n){t(u.parse(JSON.parse(n)))},i,r)},setTextures:function(n){this.textures=n},parse:function(n){function r(n){return f[n]===undefined&&console.warn("THREE.MaterialLoader: Undefined texture",n),f[n]}var f=this.textures,i=new wp[n.type],u;return n.uuid!==undefined&&(i.uuid=n.uuid),n.name!==undefined&&(i.name=n.name),n.color!==undefined&&i.color.setHex(n.color),n.roughness!==undefined&&(i.roughness=n.roughness),n.metalness!==undefined&&(i.metalness=n.metalness),n.emissive!==undefined&&i.emissive.setHex(n.emissive),n.specular!==undefined&&i.specular.setHex(n.specular),n.shininess!==undefined&&(i.shininess=n.shininess),n.clearCoat!==undefined&&(i.clearCoat=n.clearCoat),n.clearCoatRoughness!==undefined&&(i.clearCoatRoughness=n.clearCoatRoughness),n.uniforms!==undefined&&(i.uniforms=n.uniforms),n.vertexShader!==undefined&&(i.vertexShader=n.vertexShader),n.fragmentShader!==undefined&&(i.fragmentShader=n.fragmentShader),n.vertexColors!==undefined&&(i.vertexColors=n.vertexColors),n.fog!==undefined&&(i.fog=n.fog),n.flatShading!==undefined&&(i.flatShading=n.flatShading),n.blending!==undefined&&(i.blending=n.blending),n.side!==undefined&&(i.side=n.side),n.opacity!==undefined&&(i.opacity=n.opacity),n.transparent!==undefined&&(i.transparent=n.transparent),n.alphaTest!==undefined&&(i.alphaTest=n.alphaTest),n.depthTest!==undefined&&(i.depthTest=n.depthTest),n.depthWrite!==undefined&&(i.depthWrite=n.depthWrite),n.colorWrite!==undefined&&(i.colorWrite=n.colorWrite),n.wireframe!==undefined&&(i.wireframe=n.wireframe),n.wireframeLinewidth!==undefined&&(i.wireframeLinewidth=n.wireframeLinewidth),n.wireframeLinecap!==undefined&&(i.wireframeLinecap=n.wireframeLinecap),n.wireframeLinejoin!==undefined&&(i.wireframeLinejoin=n.wireframeLinejoin),n.rotation!==undefined&&(i.rotation=n.rotation),n.linewidth!==1&&(i.linewidth=n.linewidth),n.dashSize!==undefined&&(i.dashSize=n.dashSize),n.gapSize!==undefined&&(i.gapSize=n.gapSize),n.scale!==undefined&&(i.scale=n.scale),n.skinning!==undefined&&(i.skinning=n.skinning),n.morphTargets!==undefined&&(i.morphTargets=n.morphTargets),n.dithering!==undefined&&(i.dithering=n.dithering),n.visible!==undefined&&(i.visible=n.visible),n.userData!==undefined&&(i.userData=n.userData),n.shading!==undefined&&(i.flatShading=n.shading===1),n.size!==undefined&&(i.size=n.size),n.sizeAttenuation!==undefined&&(i.sizeAttenuation=n.sizeAttenuation),n.map!==undefined&&(i.map=r(n.map)),n.alphaMap!==undefined&&(i.alphaMap=r(n.alphaMap),i.transparent=!0),n.bumpMap!==undefined&&(i.bumpMap=r(n.bumpMap)),n.bumpScale!==undefined&&(i.bumpScale=n.bumpScale),n.normalMap!==undefined&&(i.normalMap=r(n.normalMap)),n.normalScale!==undefined&&(u=n.normalScale,Array.isArray(u)===!1&&(u=[u,u]),i.normalScale=(new t).fromArray(u)),n.displacementMap!==undefined&&(i.displacementMap=r(n.displacementMap)),n.displacementScale!==undefined&&(i.displacementScale=n.displacementScale),n.displacementBias!==undefined&&(i.displacementBias=n.displacementBias),n.roughnessMap!==undefined&&(i.roughnessMap=r(n.roughnessMap)),n.metalnessMap!==undefined&&(i.metalnessMap=r(n.metalnessMap)),n.emissiveMap!==undefined&&(i.emissiveMap=r(n.emissiveMap)),n.emissiveIntensity!==undefined&&(i.emissiveIntensity=n.emissiveIntensity),n.specularMap!==undefined&&(i.specularMap=r(n.specularMap)),n.envMap!==undefined&&(i.envMap=r(n.envMap)),n.reflectivity!==undefined&&(i.reflectivity=n.reflectivity),n.lightMap!==undefined&&(i.lightMap=r(n.lightMap)),n.lightMapIntensity!==undefined&&(i.lightMapIntensity=n.lightMapIntensity),n.aoMap!==undefined&&(i.aoMap=r(n.aoMap)),n.aoMapIntensity!==undefined&&(i.aoMapIntensity=n.aoMapIntensity),n.gradientMap!==undefined&&(i.gradientMap=r(n.gradientMap)),i}});Object.assign(kp.prototype,{load:function(n,t,i,r){var u=this,f=new ui(u.manager);f.load(n,function(n){t(u.parse(JSON.parse(n)))},i,r)},parse:function(t){var i=new u,l=t.data.index,a,v,f,r,o,s,p,h,e,y;l!==undefined&&(r=new aa[l.type](l.array),i.setIndex(new c(r,1)));a=t.data.attributes;for(v in a)f=a[v],r=new aa[f.type](f.array),i.addAttribute(v,new c(r,f.itemSize,f.normalized));if(o=t.data.groups||t.data.drawcalls||t.data.offsets,o!==undefined)for(s=0,p=o.length;s!==p;++s)h=o[s],i.addGroup(h.start,h.count,h.materialIndex);return e=t.data.boundingSphere,e!==undefined&&(y=new n,e.center!==undefined&&y.fromArray(e.center),i.boundingSphere=new ti(y,e.radius)),i}});aa={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:typeof Uint8ClampedArray!="undefined"?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};pe.Handlers={handlers:[],add:function(n,t){this.handlers.push(n,t)},get:function(n){for(var i=this.handlers,u,f,t=0,r=i.length;t<r;t+=2)if(u=i[t],f=i[t+1],u.test(n))return f;return null}};Object.assign(pe.prototype,{crossOrigin:undefined,extractUrlBase:function(n){var t=n.split("/");return t.length===1?"./":(t.pop(),t.join("/")+"/")},initMaterials:function(n,t,i){for(var f=this,u=[],r=0;r<n.length;++r)u[r]=f.createMaterial(n[r],t,i);return u},createMaterial:function(){var r={NoBlending:rc,NormalBlending:tf,AdditiveBlending:hv,SubtractiveBlending:cv,MultiplyBlending:lv,CustomBlending:uc},n=new f,t=new dl,i=new la;return function(u,f,e){function c(n,i,r,u,o){var c=f+n,v=pe.Handlers.get(c),s,l;return v!==null?s=v.load(c):(t.setCrossOrigin(e),s=t.load(c)),i!==undefined&&(s.repeat.fromArray(i),i[0]!==1&&(s.wrapS=li),i[1]!==1&&(s.wrapT=li)),r!==undefined&&s.offset.fromArray(r),u!==undefined&&(u[0]==="repeat"&&(s.wrapS=li),u[0]==="mirror"&&(s.wrapS=wr),u[1]==="repeat"&&(s.wrapT=li),u[1]==="mirror"&&(s.wrapT=wr)),o!==undefined&&(s.anisotropy=o),l=h.generateUUID(),a[l]=s,l}var a={},o={uuid:h.generateUUID(),type:"MeshLambertMaterial"},l,s;for(l in u){s=u[l];switch(l){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":o.name=s;break;case"blending":o.blending=r[s];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",l,"is no longer supported.");break;case"colorDiffuse":o.color=n.fromArray(s).getHex();break;case"colorSpecular":o.specular=n.fromArray(s).getHex();break;case"colorEmissive":o.emissive=n.fromArray(s).getHex();break;case"specularCoef":o.shininess=s;break;case"shading":s.toLowerCase()==="basic"&&(o.type="MeshBasicMaterial");s.toLowerCase()==="phong"&&(o.type="MeshPhongMaterial");s.toLowerCase()==="standard"&&(o.type="MeshStandardMaterial");break;case"mapDiffuse":o.map=c(s,u.mapDiffuseRepeat,u.mapDiffuseOffset,u.mapDiffuseWrap,u.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":o.emissiveMap=c(s,u.mapEmissiveRepeat,u.mapEmissiveOffset,u.mapEmissiveWrap,u.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":o.lightMap=c(s,u.mapLightRepeat,u.mapLightOffset,u.mapLightWrap,u.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":o.aoMap=c(s,u.mapAORepeat,u.mapAOOffset,u.mapAOWrap,u.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":o.bumpMap=c(s,u.mapBumpRepeat,u.mapBumpOffset,u.mapBumpWrap,u.mapBumpAnisotropy);break;case"mapBumpScale":o.bumpScale=s;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":o.normalMap=c(s,u.mapNormalRepeat,u.mapNormalOffset,u.mapNormalWrap,u.mapNormalAnisotropy);break;case"mapNormalFactor":o.normalScale=[s,s];break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":o.specularMap=c(s,u.mapSpecularRepeat,u.mapSpecularOffset,u.mapSpecularWrap,u.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":o.metalnessMap=c(s,u.mapMetalnessRepeat,u.mapMetalnessOffset,u.mapMetalnessWrap,u.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":o.roughnessMap=c(s,u.mapRoughnessRepeat,u.mapRoughnessOffset,u.mapRoughnessWrap,u.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":o.alphaMap=c(s,u.mapAlphaRepeat,u.mapAlphaOffset,u.mapAlphaWrap,u.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":o.side=ki;break;case"doubleSided":o.side=nf;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity");o.opacity=s;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":o[l]=s;break;case"vertexColors":s===!0&&(o.vertexColors=pr);s==="face"&&(o.vertexColors=sv);break;default:console.error("THREE.Loader.createMaterial: Unsupported",l,s)}}return o.type==="MeshBasicMaterial"&&delete o.emissive,o.type!=="MeshPhongMaterial"&&delete o.specular,o.opacity<1&&(o.transparent=!0),i.setTextures(a),i.parse(o)}}()});Object.assign(dp.prototype,{load:function(n,t,i,r){var f=this,e=this.texturePath&&typeof this.texturePath=="string"?this.texturePath:pe.prototype.extractUrlBase(n),u=new ui(this.manager);u.setWithCredentials(this.withCredentials);u.load(n,function(i){var o=JSON.parse(i),s=o.metadata,r,u;if(s!==undefined&&(r=s.type,r!==undefined)){if(r.toLowerCase()==="object"){console.error("THREE.JSONLoader: "+n+" should be loaded with THREE.ObjectLoader instead.");return}if(r.toLowerCase()==="scene"){console.error("THREE.JSONLoader: "+n+" should be loaded with THREE.SceneLoader instead.");return}}u=f.parse(o,e);t(u.geometry,u.materials)},i,r)},setTexturePath:function(n){this.texturePath=n},parse:function(){function i(i,r){function b(n,t){return n&1<<t}var u,v,y,e,ut,p,s,k,nt,w,bt,ct,lt,at,vt,yt,pt,tt,l,c,a,d,it,g,rt,ft,et,o=i.faces,ot=i.vertices,h=i.normals,st=i.colors,wt=i.scale,ht=0;if(i.uvs!==undefined){for(u=0;u<i.uvs.length;u++)i.uvs[u].length&&ht++;for(u=0;u<ht;u++)r.faceVertexUvs[u]=[]}for(e=0,ut=ot.length;e<ut;)tt=new n,tt.x=ot[e++]*wt,tt.y=ot[e++]*wt,tt.z=ot[e++]*wt,r.vertices.push(tt);for(e=0,ut=o.length;e<ut;)if(w=o[e++],bt=b(w,0),ct=b(w,1),lt=b(w,3),at=b(w,4),vt=b(w,5),yt=b(w,6),pt=b(w,7),bt){if(c=new ir,c.a=o[e],c.b=o[e+1],c.c=o[e+3],a=new ir,a.a=o[e+1],a.b=o[e+2],a.c=o[e+3],e+=4,ct&&(nt=o[e++],c.materialIndex=nt,a.materialIndex=nt),y=r.faces.length,lt)for(u=0;u<ht;u++)for(g=i.uvs[u],r.faceVertexUvs[u][y]=[],r.faceVertexUvs[u][y+1]=[],v=0;v<4;v++)k=o[e++],ft=g[k*2],et=g[k*2+1],rt=new t(ft,et),v!==2&&r.faceVertexUvs[u][y].push(rt),v!==0&&r.faceVertexUvs[u][y+1].push(rt);if(at&&(s=o[e++]*3,c.normal.set(h[s++],h[s++],h[s]),a.normal.copy(c.normal)),vt)for(u=0;u<4;u++)s=o[e++]*3,it=new n(h[s++],h[s++],h[s]),u!==2&&c.vertexNormals.push(it),u!==0&&a.vertexNormals.push(it);if(yt&&(p=o[e++],d=st[p],c.color.setHex(d),a.color.setHex(d)),pt)for(u=0;u<4;u++)p=o[e++],d=st[p],u!==2&&c.vertexColors.push(new f(d)),u!==0&&a.vertexColors.push(new f(d));r.faces.push(c);r.faces.push(a)}else{if(l=new ir,l.a=o[e++],l.b=o[e++],l.c=o[e++],ct&&(nt=o[e++],l.materialIndex=nt),y=r.faces.length,lt)for(u=0;u<ht;u++)for(g=i.uvs[u],r.faceVertexUvs[u][y]=[],v=0;v<3;v++)k=o[e++],ft=g[k*2],et=g[k*2+1],rt=new t(ft,et),r.faceVertexUvs[u][y].push(rt);if(at&&(s=o[e++]*3,l.normal.set(h[s++],h[s++],h[s])),vt)for(u=0;u<3;u++)s=o[e++]*3,it=new n(h[s++],h[s++],h[s]),l.vertexNormals.push(it);if(yt&&(p=o[e++],l.color.setHex(st[p])),pt)for(u=0;u<3;u++)p=o[e++],l.vertexColors.push(new f(st[p]));r.faces.push(l)}}function r(n,t){var r=n.influencesPerVertex!==undefined?n.influencesPerVertex:2,i,u;if(n.skinWeights)for(i=0,u=n.skinWeights.length;i<u;i+=r){var f=n.skinWeights[i],e=r>1?n.skinWeights[i+1]:0,o=r>2?n.skinWeights[i+2]:0,s=r>3?n.skinWeights[i+3]:0;t.skinWeights.push(new p(f,e,o,s))}if(n.skinIndices)for(i=0,u=n.skinIndices.length;i<u;i+=r){var h=n.skinIndices[i],c=r>1?n.skinIndices[i+1]:0,l=r>2?n.skinIndices[i+2]:0,a=r>3?n.skinIndices[i+3]:0;t.skinIndices.push(new p(h,c,l,a))}t.bones=n.bones;t.bones&&t.bones.length>0&&(t.skinWeights.length!==t.skinIndices.length||t.skinIndices.length!==t.vertices.length)&&console.warn("When skinning, number of vertices ("+t.vertices.length+"), skinIndices ("+t.skinIndices.length+"), and skinWeights ("+t.skinWeights.length+") should match.")}function u(t,i){var s=t.scale,c,e,u,l,o,h,a,r,f;if(t.morphTargets!==undefined)for(r=0,f=t.morphTargets.length;r<f;r++)for(i.morphTargets[r]={},i.morphTargets[r].name=t.morphTargets[r].name,i.morphTargets[r].vertices=[],c=i.morphTargets[r].vertices,e=t.morphTargets[r].vertices,u=0,l=e.length;u<l;u+=3)o=new n,o.x=e[u]*s,o.y=e[u+1]*s,o.z=e[u+2]*s,c.push(o);if(t.morphColors!==undefined&&t.morphColors.length>0)for(console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.'),h=i.faces,a=t.morphColors[0].colors,r=0,f=h.length;r<f;r++)h[r].color.fromArray(a,r*3)}function e(n,t){var r=[],i=[],u,f,e;for(n.animation!==undefined&&i.push(n.animation),n.animations!==undefined&&(n.animations.length?i=i.concat(n.animations):i.push(n.animations)),u=0;u<i.length;u++)f=ni.parseAnimation(i[u],t.bones),f&&r.push(f);t.morphTargets&&(e=ni.CreateClipsFromMorphTargetSequences(t.morphTargets,10),r=r.concat(e));r.length>0&&(t.animations=r)}return function(n,t){var f,o;return n.data!==undefined&&(n=n.data),n.scale=n.scale!==undefined?1/n.scale:1,f=new s,i(n,f),r(n,f),u(n,f),e(n,f),f.computeFaceNormals(),f.computeBoundingSphere(),n.materials===undefined||n.materials.length===0?{geometry:f}:(o=pe.prototype.initMaterials(n.materials,t,this.crossOrigin),{geometry:f,materials:o})}}()});Object.assign(htt.prototype,{load:function(n,t,i,r){this.texturePath===""&&(this.texturePath=n.substring(0,n.lastIndexOf("/")+1));var u=this,f=new ui(u.manager);f.load(n,function(i){var e=null,f;try{e=JSON.parse(i)}catch(o){r!==undefined&&r(o);console.error("THREE:ObjectLoader: Can't parse "+n+".",o.message);return}if(f=e.metadata,f===undefined||f.type===undefined||f.type.toLowerCase()==="geometry"){console.error("THREE.ObjectLoader: Can't load "+n+". Use THREE.JSONLoader instead.");return}u.parse(e,t)},i,r)},setTexturePath:function(n){this.texturePath=n},setCrossOrigin:function(n){this.crossOrigin=n},parse:function(n,t){var r=this.parseGeometries(n.geometries),u=this.parseImages(n.images,function(){t!==undefined&&t(i)}),f=this.parseTextures(n.textures,u),e=this.parseMaterials(n.materials,f),i=this.parseObject(n.object,r,e);return n.animations&&(i.animations=this.parseAnimations(n.animations)),(n.images===undefined||n.images.length===0)&&t!==undefined&&t(i),i},parseGeometries:function(n){var s=this,u={},f,e,r,o,i,t;if(n!==undefined)for(f=new dp,e=new kp,r=0,o=n.length;r<o;r++){t=n[r];switch(t.type){case"PlaneGeometry":case"PlaneBufferGeometry":i=new at[t.type](t.width,t.height,t.widthSegments,t.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":i=new at[t.type](t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":i=new at[t.type](t.radius,t.segments,t.thetaStart,t.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":i=new at[t.type](t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":i=new at[t.type](t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":i=new at[t.type](t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":i=new at[t.type](t.radius,t.detail);break;case"RingGeometry":case"RingBufferGeometry":i=new at[t.type](t.innerRadius,t.outerRadius,t.thetaSegments,t.phiSegments,t.thetaStart,t.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":i=new at[t.type](t.radius,t.tube,t.radialSegments,t.tubularSegments,t.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":i=new at[t.type](t.radius,t.tube,t.tubularSegments,t.radialSegments,t.p,t.q);break;case"LatheGeometry":case"LatheBufferGeometry":i=new at[t.type](t.points,t.segments,t.phiStart,t.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":i=new at[t.type](t.vertices,t.indices,t.radius,t.details);break;case"BufferGeometry":i=e.parse(t);break;case"Geometry":i=f.parse(t,s.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+t.type+'"');continue}i.uuid=t.uuid;t.name!==undefined&&(i.name=t.name);u[t.uuid]=i}return u},parseMaterials:function(n,t){var e={},r,u,s,i,o,f;if(n!==undefined)for(r=new la,r.setTextures(t),u=0,s=n.length;u<s;u++)if(i=n[u],i.type==="MultiMaterial"){for(o=[],f=0;f<i.materials.length;f++)o.push(r.parse(i.materials[f]));e[i.uuid]=o}else e[i.uuid]=r.parse(i);return e},parseAnimations:function(n){for(var i=[],r,t=0;t<n.length;t++)r=ni.parse(n[t]),i.push(r);return i},parseImages:function(n,t){function c(n){return i.manager.itemStart(n),f.load(n,function(){i.manager.itemEnd(n)},undefined,function(){i.manager.itemEnd(n);i.manager.itemError(n)})}var i=this,e={},o,f,u,s,r,h;if(n!==undefined&&n.length>0)for(o=new bp(t),f=new gs(o),f.setCrossOrigin(this.crossOrigin),u=0,s=n.length;u<s;u++)r=n[u],h=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(r.url)?r.url:i.texturePath+r.url,e[r.uuid]=c(h);return e},parseTextures:function(n,t){function u(n,t){return typeof n=="number"?n:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",n),t[n])}var e={},f,o,i,r;if(n!==undefined)for(f=0,o=n.length;f<o;f++)i=n[f],i.image===undefined&&console.warn('THREE.ObjectLoader: No "image" specified for',i.uuid),t[i.image]===undefined&&console.warn("THREE.ObjectLoader: Undefined image",i.image),r=new b(t[i.image]),r.needsUpdate=!0,r.uuid=i.uuid,i.name!==undefined&&(r.name=i.name),i.mapping!==undefined&&(r.mapping=u(i.mapping,ctt)),i.offset!==undefined&&r.offset.fromArray(i.offset),i.repeat!==undefined&&r.repeat.fromArray(i.repeat),i.center!==undefined&&r.center.fromArray(i.center),i.rotation!==undefined&&(r.rotation=i.rotation),i.wrap!==undefined&&(r.wrapS=u(i.wrap[0],gp),r.wrapT=u(i.wrap[1],gp)),i.minFilter!==undefined&&(r.minFilter=u(i.minFilter,nw)),i.magFilter!==undefined&&(r.magFilter=u(i.magFilter,nw)),i.anisotropy!==undefined&&(r.anisotropy=i.anisotropy),i.flipY!==undefined&&(r.flipY=i.flipY),e[i.uuid]=r;return e},parseObject:function(){var n=new o;return function(t,i,u){function s(n){return i[n]===undefined&&console.warn("THREE.ObjectLoader: Undefined geometry",n),i[n]}function o(n){var r,t,f,i;if(n===undefined)return undefined;if(Array.isArray(n)){for(r=[],t=0,f=n.length;t<f;t++)i=n[t],u[i]===undefined&&console.warn("THREE.ObjectLoader: Undefined material",i),r.push(u[i]);return r}return u[n]===undefined&&console.warn("THREE.ObjectLoader: Undefined material",n),u[n]}var k=this,e,h,a,v,c,y,l,p,b;switch(t.type){case"Scene":e=new ko;t.background!==undefined&&Number.isInteger(t.background)&&(e.background=new f(t.background));t.fog!==undefined&&(t.fog.type==="Fog"?e.fog=new pf(t.fog.color,t.fog.near,t.fog.far):t.fog.type==="FogExp2"&&(e.fog=new yf(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":e=new nt(t.fov,t.aspect,t.near,t.far);t.focus!==undefined&&(e.focus=t.focus);t.zoom!==undefined&&(e.zoom=t.zoom);t.filmGauge!==undefined&&(e.filmGauge=t.filmGauge);t.filmOffset!==undefined&&(e.filmOffset=t.filmOffset);t.view!==undefined&&(e.view=Object.assign({},t.view));break;case"OrthographicCamera":e=new sf(t.left,t.right,t.top,t.bottom,t.near,t.far);break;case"AmbientLight":e=new th(t.color,t.intensity);break;case"DirectionalLight":e=new ra(t.color,t.intensity);break;case"PointLight":e=new nh(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":e=new ua(t.color,t.intensity,t.width,t.height);break;case"SpotLight":e=new ta(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":e=new gl(t.color,t.groundColor,t.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":h=s(t.geometry);a=o(t.material);e=h.bones&&h.bones.length>0?new pl(h,a):new tt(h,a);break;case"LOD":e=new go;break;case"Line":e=new ct(s(t.geometry),o(t.material),t.mode);break;case"LineLoop":e=new wl(s(t.geometry),o(t.material));break;case"LineSegments":e=new w(s(t.geometry),o(t.material));break;case"PointCloud":case"Points":e=new bl(s(t.geometry),o(t.material));break;case"Sprite":e=new vl(o(t.material));break;case"Group":e=new wf;break;default:e=new r}if(e.uuid=t.uuid,t.name!==undefined&&(e.name=t.name),t.matrix!==undefined?(n.fromArray(t.matrix),n.decompose(e.position,e.quaternion,e.scale)):(t.position!==undefined&&e.position.fromArray(t.position),t.rotation!==undefined&&e.rotation.fromArray(t.rotation),t.quaternion!==undefined&&e.quaternion.fromArray(t.quaternion),t.scale!==undefined&&e.scale.fromArray(t.scale)),t.castShadow!==undefined&&(e.castShadow=t.castShadow),t.receiveShadow!==undefined&&(e.receiveShadow=t.receiveShadow),t.shadow&&(t.shadow.bias!==undefined&&(e.shadow.bias=t.shadow.bias),t.shadow.radius!==undefined&&(e.shadow.radius=t.shadow.radius),t.shadow.mapSize!==undefined&&e.shadow.mapSize.fromArray(t.shadow.mapSize),t.shadow.camera!==undefined&&(e.shadow.camera=this.parseObject(t.shadow.camera))),t.visible!==undefined&&(e.visible=t.visible),t.userData!==undefined&&(e.userData=t.userData),t.children!==undefined)for(v=t.children,c=0;c<v.length;c++)e.add(k.parseObject(v[c],i,u));if(t.type==="LOD")for(y=t.levels,l=0;l<y.length;l++)p=y[l],b=e.getObjectByProperty("uuid",p.object),b!==undefined&&e.addLevel(b,p.distance);return e}}()});var ctt={UVMapping:sc,CubeReflectionMapping:hc,CubeRefractionMapping:cc,EquirectangularReflectionMapping:kv,EquirectangularRefractionMapping:lc,SphericalReflectionMapping:dv,CubeUVReflectionMapping:ac,CubeUVRefractionMapping:vc},gp={RepeatWrapping:li,ClampToEdgeWrapping:yt,MirroredRepeatWrapping:wr},nw={NearestFilter:pt,NearestMipMapNearestFilter:yc,NearestMipMapLinearFilter:pc,LinearFilter:et,LinearMipMapNearestFilter:gv,LinearMipMapLinearFilter:so};Object.assign(a.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(n,t){var i=this.getUtoTmapping(n);return this.getPoint(i,t)},getPoints:function(n){var r=this,i,t;for(n===undefined&&(n=5),i=[],t=0;t<=n;t++)i.push(r.getPoint(t/n));return i},getSpacedPoints:function(n){var r=this,i,t;for(n===undefined&&(n=5),i=[],t=0;t<=n;t++)i.push(r.getPointAt(t/n));return i},getLength:function(){var n=this.getLengths();return n[n.length-1]},getLengths:function(n){var e=this;if(n===undefined&&(n=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===n+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t=[],r,u=this.getPoint(0),i,f=0;for(t.push(0),i=1;i<=n;i++)r=e.getPoint(i/n),f+=r.distanceTo(u),t.push(f),u=r;return this.cacheArcLengths=t,t},updateArcLengths:function(){this.needsUpdate=!0;this.getLengths()},getUtoTmapping:function(n,t){var r=this.getLengths(),i=0,e=r.length,o,f,u,s;for(o=t?t:n*r[e-1],f=0,u=e-1;f<=u;)if(i=Math.floor(f+(u-f)/2),s=r[i]-o,s<0)f=i+1;else if(s>0)u=i-1;else{u=i;break}if(i=u,r[i]===o)return i/(e-1);var h=r[i],c=r[i+1],l=c-h,a=(o-h)/l;return(i+a)/(e-1)},getTangent:function(n){var r=.0001,t=n-r,i=n+r;t<0&&(t=0);i>1&&(i=1);var u=this.getPoint(t),f=this.getPoint(i),e=f.clone().sub(u);return e.normalize()},getTangentAt:function(n){var t=this.getUtoTmapping(n);return this.getTangent(t)},computeFrenetFrames:function(t,i){for(var b=this,a=new n,u=[],f=[],e=[],s=new n,v=new o,y,c,r=0;r<=t;r++)y=r/t,u[r]=b.getTangentAt(y),u[r].normalize();f[0]=new n;e[0]=new n;var l=Number.MAX_VALUE,p=Math.abs(u[0].x),w=Math.abs(u[0].y),k=Math.abs(u[0].z);for(p<=l&&(l=p,a.set(1,0,0)),w<=l&&(l=w,a.set(0,1,0)),k<=l&&a.set(0,0,1),s.crossVectors(u[0],a).normalize(),f[0].crossVectors(u[0],s),e[0].crossVectors(u[0],f[0]),r=1;r<=t;r++)f[r]=f[r-1].clone(),e[r]=e[r-1].clone(),s.crossVectors(u[r-1],u[r]),s.length()>Number.EPSILON&&(s.normalize(),c=Math.acos(h.clamp(u[r-1].dot(u[r]),-1,1)),f[r].applyMatrix4(v.makeRotationAxis(s,c))),e[r].crossVectors(u[r],f[r]);if(i===!0)for(c=Math.acos(h.clamp(f[0].dot(f[t]),-1,1)),c/=t,u[0].dot(s.crossVectors(f[0],f[t]))>0&&(c=-c),r=1;r<=t;r++)f[r].applyMatrix4(v.makeRotationAxis(u[r],c*r)),e[r].crossVectors(u[r],f[r]);return{tangents:u,normals:f,binormals:e}},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.arcLengthDivisions=n.arcLengthDivisions,this}});fi.prototype=Object.create(a.prototype);fi.prototype.constructor=fi;fi.prototype.isLineCurve=!0;fi.prototype.getPoint=function(n,i){var r=i||new t;return n===1?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(n).add(this.v1)),r};fi.prototype.getPointAt=function(n,t){return this.getPoint(n,t)};fi.prototype.getTangent=function(){var n=this.v2.clone().sub(this.v1);return n.normalize()};fi.prototype.copy=function(n){return a.prototype.copy.call(this,n),this.v1.copy(n.v1),this.v2.copy(n.v2),this};yu.prototype=Object.assign(Object.create(a.prototype),{constructor:yu,add:function(n){this.curves.push(n)},closePath:function(){var n=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);n.equals(t)||this.curves.push(new fi(t,n))},getPoint:function(n){for(var e=this,r=n*this.getLength(),i=this.getCurveLengths(),t=0;t<i.length;){if(i[t]>=r){var o=i[t]-r,u=e.curves[t],f=u.getLength(),s=f===0?0:1-o/f;return u.getPointAt(s)}t++}return null},getLength:function(){var n=this.getCurveLengths();return n[n.length-1]},updateArcLengths:function(){this.needsUpdate=!0;this.cacheLengths=null;this.getCurveLengths()},getCurveLengths:function(){var u=this,n,i,t,r;if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(n=[],i=0,t=0,r=this.curves.length;t<r;t++)i+=u.curves[t].getLength(),n.push(i);return this.cacheLengths=n,n},getSpacedPoints:function(n){var r=this,t,i;for(n===undefined&&(n=40),t=[],i=0;i<=n;i++)t.push(r.getPoint(i/n));return this.autoClose&&t.push(t[0]),t},getPoints:function(n){var t,e,r,o,u,f;for(n=n||12,t=[],r=0,o=this.curves;r<o.length;r++){var i=o[r],h=i&&i.isEllipseCurve?n*2:i&&i.isLineCurve?1:i&&i.isSplineCurve?n*i.points.length:n,s=i.getPoints(h);for(u=0;u<s.length;u++)(f=s[u],e&&e.equals(f))||(t.push(f),e=f)}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t},copy:function(n){var u=this,t,i,r;for(a.prototype.copy.call(this,n),this.curves=[],t=0,i=n.curves.length;t<i;t++)r=n.curves[t],u.curves.push(r.clone());return this.autoClose=n.autoClose,this}});ci.prototype=Object.create(a.prototype);ci.prototype.constructor=ci;ci.prototype.isEllipseCurve=!0;ci.prototype.getPoint=function(n,i){for(var v=i||new t,u=Math.PI*2,r=this.aEndAngle-this.aStartAngle,o=Math.abs(r)<Number.EPSILON;r<0;)r+=u;while(r>u)r-=u;r<Number.EPSILON&&(r=o?0:u);this.aClockwise!==!0||o||(r=r===u?-u:r-u);var s=this.aStartAngle+n*r,f=this.aX+this.xRadius*Math.cos(s),e=this.aY+this.yRadius*Math.sin(s);if(this.aRotation!==0){var h=Math.cos(this.aRotation),c=Math.sin(this.aRotation),l=f-this.aX,a=e-this.aY;f=l*h-a*c+this.aX;e=l*c+a*h+this.aY}return v.set(f,e)};ci.prototype.copy=function(n){return a.prototype.copy.call(this,n),this.aX=n.aX,this.aY=n.aY,this.xRadius=n.xRadius,this.yRadius=n.yRadius,this.aStartAngle=n.aStartAngle,this.aEndAngle=n.aEndAngle,this.aClockwise=n.aClockwise,this.aRotation=n.aRotation,this};cr.prototype=Object.create(a.prototype);cr.prototype.constructor=cr;cr.prototype.isSplineCurve=!0;cr.prototype.getPoint=function(n,i){var f=i||new t,r=this.points,e=(r.length-1)*n,u=Math.floor(e),o=e-u,s=r[u===0?u:u-1],h=r[u],c=r[u>r.length-2?r.length-1:u+1],l=r[u>r.length-3?r.length-1:u+2];return f.set(tw(o,s.x,h.x,c.x,l.x),tw(o,s.y,h.y,c.y,l.y)),f};cr.prototype.copy=function(n){var u=this,t,i,r;for(a.prototype.copy.call(this,n),this.points=[],t=0,i=n.points.length;t<i;t++)r=n.points[t],u.points.push(r.clone());return this};lr.prototype=Object.create(a.prototype);lr.prototype.constructor=lr;lr.prototype.isCubicBezierCurve=!0;lr.prototype.getPoint=function(n,i){var r=i||new t,u=this.v0,f=this.v1,e=this.v2,o=this.v3;return r.set(hr(n,u.x,f.x,e.x,o.x),hr(n,u.y,f.y,e.y,o.y)),r};lr.prototype.copy=function(n){return a.prototype.copy.call(this,n),this.v0.copy(n.v0),this.v1.copy(n.v1),this.v2.copy(n.v2),this.v3.copy(n.v3),this};ar.prototype=Object.create(a.prototype);ar.prototype.constructor=ar;ar.prototype.isQuadraticBezierCurve=!0;ar.prototype.getPoint=function(n,i){var r=i||new t,u=this.v0,f=this.v1,e=this.v2;return r.set(sr(n,u.x,f.x,e.x),sr(n,u.y,f.y,e.y)),r};ar.prototype.copy=function(n){return a.prototype.copy.call(this,n),this.v0.copy(n.v0),this.v1.copy(n.v1),this.v2.copy(n.v2),this};uh=Object.assign(Object.create(yu.prototype),{setFromPoints:function(n){var r=this,t,i;for(this.moveTo(n[0].x,n[0].y),t=1,i=n.length;t<i;t++)r.lineTo(n[t].x,n[t].y)},moveTo:function(n,t){this.currentPoint.set(n,t)},lineTo:function(n,i){var r=new fi(this.currentPoint.clone(),new t(n,i));this.curves.push(r);this.currentPoint.set(n,i)},quadraticCurveTo:function(n,i,r,u){var f=new ar(this.currentPoint.clone(),new t(n,i),new t(r,u));this.curves.push(f);this.currentPoint.set(r,u)},bezierCurveTo:function(n,i,r,u,f,e){var o=new lr(this.currentPoint.clone(),new t(n,i),new t(r,u),new t(f,e));this.curves.push(o);this.currentPoint.set(f,e)},splineThru:function(n){var t=[this.currentPoint.clone()].concat(n),i=new cr(t);this.curves.push(i);this.currentPoint.copy(n[n.length-1])},arc:function(n,t,i,r,u,f){var e=this.currentPoint.x,o=this.currentPoint.y;this.absarc(n+e,t+o,i,r,u,f)},absarc:function(n,t,i,r,u,f){this.absellipse(n,t,i,i,r,u,f)},ellipse:function(n,t,i,r,u,f,e,o){var s=this.currentPoint.x,h=this.currentPoint.y;this.absellipse(n+s,t+h,i,r,u,f,e,o)},absellipse:function(n,t,i,r,u,f,e,o){var h=new ci(n,t,i,r,u,f,e,o),s,c;this.curves.length>0&&(s=h.getPoint(0),s.equals(this.currentPoint)||this.lineTo(s.x,s.y));this.curves.push(h);c=h.getPoint(1);this.currentPoint.copy(c)},copy:function(n){return yu.prototype.copy.call(this,n),this.currentPoint.copy(n.currentPoint),this}});pu.prototype=uh;uh.constructor=pu;wu.prototype=Object.assign(Object.create(uh),{constructor:wu,getPointsHoles:function(n){for(var u=this,i=[],t=0,r=this.holes.length;t<r;t++)i[t]=u.holes[t].getPoints(n);return i},extractPoints:function(n){return{shape:this.getPoints(n),holes:this.getPointsHoles(n)}},copy:function(n){var u=this,t,i,r;for(pu.prototype.copy.call(this,n),this.holes=[],t=0,i=n.holes.length;t<i;t++)r=n.holes[t],u.holes.push(r.clone());return this}});Object.assign(iw.prototype,{moveTo:function(n,t){this.currentPath=new pu;this.subPaths.push(this.currentPath);this.currentPath.moveTo(n,t)},lineTo:function(n,t){this.currentPath.lineTo(n,t)},quadraticCurveTo:function(n,t,i,r){this.currentPath.quadraticCurveTo(n,t,i,r)},bezierCurveTo:function(n,t,i,r,u,f){this.currentPath.bezierCurveTo(n,t,i,r,u,f)},splineThru:function(n){this.currentPath.splineThru(n)},toShapes:function(n,t){function ut(n){for(var r=[],f,i,t=0,u=n.length;t<u;t++)f=n[t],i=new wu,i.curves=f.curves,r.push(i);return r}function ht(n,t){for(var c=t.length,o=!1,h,e=c-1,u=0;u<c;e=u++){var i=t[e],r=t[u],s=r.x-i.x,f=r.y-i.y;if(Math.abs(f)>Number.EPSILON){if(f<0&&(i=t[u],s=-s,r=t[e],f=-f),n.y<i.y||n.y>r.y)continue;if(n.y===i.y){if(n.x===i.x)return!0}else{if(h=f*(n.x-i.x)-s*(n.y-i.y),h===0)return!0;if(h<0)continue;o=!o}}else{if(n.y!==i.y)continue;if(r.x<=n.x&&n.x<=i.x||i.x<=n.x&&n.x<=r.x)return!0}}return o}var ft=gt.isClockWise,e=this.subPaths,a,s,h,v,c,et,nt,tt,r,y,it,p,k,d,o,rt,u,ot,g,st;if(e.length===0)return[];if(t===!0)return ut(e);if(v=[],e.length===1)return s=e[0],h=new wu,h.curves=s.curves,v.push(h),v;c=!ft(e[0].getPoints());c=n?!c:c;var w=[],i=[],l=[],f=0,b;for(i[f]=undefined,l[f]=[],u=0,et=e.length;u<et;u++)s=e[u],b=s.getPoints(),a=ft(b),a=n?!a:a,a?(!c&&i[f]&&f++,i[f]={s:new wu,p:b},i[f].s.curves=s.curves,c&&f++,l[f]=[]):l[f].push({h:s,p:b[0]});if(!i[0])return ut(e);if(i.length>1){for(nt=!1,tt=[],r=0,y=i.length;r<y;r++)w[r]=[];for(r=0,y=i.length;r<y;r++)for(it=l[r],p=0;p<it.length;p++){for(k=it[p],d=!0,o=0;o<i.length;o++)ht(k.p,i[o].p)&&(r!==o&&tt.push({froms:r,tos:o,hole:p}),d?(d=!1,w[o].push(k)):nt=!0);d&&w[r].push(k)}tt.length>0&&(nt||(l=w))}for(u=0,ot=i.length;u<ot;u++)for(h=i[u].s,v.push(h),rt=l[u],g=0,st=rt.length;g<st;g++)h.holes.push(rt[g].h);return v}});Object.assign(rw.prototype,{isFont:!0,generateShapes:function(n,t,i){function s(n){for(var o=String(n).split(""),s=t/r.resolution,a=(r.boundingBox.yMax-r.boundingBox.yMin+r.underlineThickness)*s,u=0,c=0,l=[],f,e,i=0;i<o.length;i++)f=o[i],f==="\n"?(u=0,c-=a):(e=h(f,s,u,c),u+=e.offsetX,l.push(e.path));return l}function h(n,t,u,f){var l=r.glyphs[n]||r.glyphs["?"],a,b,k,d,v,y,g,nt,p,w,tt,it,h,e,o,rt,ut,s,c;if(l){if(a=new iw,b=[],l.o)for(e=l._cachedOutline||(l._cachedOutline=l.o.split(" ")),o=0,rt=e.length;o<rt;){ut=e[o++];switch(ut){case"m":k=e[o++]*t+u;d=e[o++]*t+f;a.moveTo(k,d);break;case"l":k=e[o++]*t+u;d=e[o++]*t+f;a.lineTo(k,d);break;case"q":if(v=e[o++]*t+u,y=e[o++]*t+f,p=e[o++]*t+u,w=e[o++]*t+f,a.quadraticCurveTo(p,w,v,y),h=b[b.length-1],h)for(g=h.x,nt=h.y,s=1;s<=i;s++)c=s/i,sr(c,g,p,v),sr(c,nt,w,y);break;case"b":if(v=e[o++]*t+u,y=e[o++]*t+f,p=e[o++]*t+u,w=e[o++]*t+f,tt=e[o++]*t+u,it=e[o++]*t+f,a.bezierCurveTo(p,w,tt,it,v,y),h=b[b.length-1],h)for(g=h.x,nt=h.y,s=1;s<=i;s++)c=s/i,hr(c,g,p,tt,v),hr(c,nt,w,it,y)}}return{offsetX:l.ha*t,path:a}}}var u,o;t===undefined&&(t=100);i===undefined&&(i=4);var r=this.data,f=s(n),e=[];for(u=0,o=f.length;u<o;u++)Array.prototype.push.apply(e,f[u].toShapes());return e}});Object.assign(ktt.prototype,{load:function(n,t,i,r){var f=this,u=new ui(this.manager);u.setPath(this.path);u.load(n,function(n){var i,r;try{i=JSON.parse(n)}catch(u){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead.");i=JSON.parse(n.substring(65,n.length-2))}r=f.parse(i);t&&t(r)},i,r)},parse:function(n){return new rw(n)},setPath:function(n){return this.path=n,this}});va={getContext:function(){return fh===undefined&&(fh=new(window.AudioContext||window.webkitAudioContext)),fh},setContext:function(n){fh=n}};Object.assign(uw.prototype,{load:function(n,t,i,r){var u=new ui(this.manager);u.setResponseType("arraybuffer");u.load(n,function(n){var i=va.getContext();i.decodeAudioData(n,function(n){t(n)})},i,r)}});Object.assign(dtt.prototype,{update:function(){var e,r,u,n,t,s,f,i,c=new o,l=new o;return function(o){var b=e!==this||r!==o.focus||u!==o.fov||n!==o.aspect*this.aspect||t!==o.near||s!==o.far||f!==o.zoom||i!==this.eyeSep,y,p,w,a,v;b&&(e=this,r=o.focus,u=o.fov,n=o.aspect*this.aspect,t=o.near,s=o.far,f=o.zoom,y=o.projectionMatrix.clone(),i=this.eyeSep/2,p=i*t/r,w=t*Math.tan(h.DEG2RAD*u*.5)/f,l.elements[12]=-i,c.elements[12]=i,a=-w*n+p,v=w*n+p,y.elements[0]=2*t/(v-a),y.elements[8]=(v+a)/(v-a),this.cameraL.projectionMatrix.copy(y),a=-w*n-p,v=w*n-p,y.elements[0]=2*t/(v-a),y.elements[8]=(v+a)/(v-a),this.cameraR.projectionMatrix.copy(y));this.cameraL.matrixWorld.copy(o.matrixWorld).multiply(l);this.cameraR.matrixWorld.copy(o.matrixWorld).multiply(c)}}()});eh.prototype=Object.create(r.prototype);eh.prototype.constructor=eh;fw.prototype=Object.assign(Object.create(r.prototype),{constructor:fw,getInput:function(){return this.gain},removeFilter:function(){this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null)},getFilter:function(){return this.filter},setFilter:function(n){this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination);this.filter=n;this.gain.connect(this.filter);this.filter.connect(this.context.destination)},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(n){this.gain.gain.value=n},updateMatrixWorld:function(){var t=new n,u=new g,f=new n,i=new n;return function(n){r.prototype.updateMatrixWorld.call(this,n);var e=this.context.listener,o=this.up;this.matrixWorld.decompose(t,u,f);i.set(0,0,-1).applyQuaternion(u);e.positionX?(e.positionX.setValueAtTime(t.x,this.context.currentTime),e.positionY.setValueAtTime(t.y,this.context.currentTime),e.positionZ.setValueAtTime(t.z,this.context.currentTime),e.forwardX.setValueAtTime(i.x,this.context.currentTime),e.forwardY.setValueAtTime(i.y,this.context.currentTime),e.forwardZ.setValueAtTime(i.z,this.context.currentTime),e.upX.setValueAtTime(o.x,this.context.currentTime),e.upY.setValueAtTime(o.y,this.context.currentTime),e.upZ.setValueAtTime(o.z,this.context.currentTime)):(e.setPosition(t.x,t.y,t.z),e.setOrientation(i.x,i.y,i.z,o.x,o.y,o.z))}}()});we.prototype=Object.assign(Object.create(r.prototype),{constructor:we,getOutput:function(){return this.gain},setNodeSource:function(n){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=n,this.connect(),this},setBuffer:function(n){return this.buffer=n,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}var n=this.context.createBufferSource();return n.buffer=this.buffer,n.loop=this.loop,n.onended=this.onEnded.bind(this),n.playbackRate.setValueAtTime(this.playbackRate,this.startTime),this.startTime=this.context.currentTime,n.start(this.startTime,this.offset),this.isPlaying=!0,this.source=n,this.connect()},pause:function(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this.source.stop(),this.offset+=(this.context.currentTime-this.startTime)*this.playbackRate,this.isPlaying=!1),this},stop:function(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.source.stop(),this.offset=0,this.isPlaying=!1,this},connect:function(){var t=this,n,i;if(this.filters.length>0){for(this.source.connect(this.filters[0]),n=1,i=this.filters.length;n<i;n++)t.filters[n-1].connect(t.filters[n]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){var t=this,n,i;if(this.filters.length>0){for(this.source.disconnect(this.filters[0]),n=1,i=this.filters.length;n<i;n++)t.filters[n-1].disconnect(t.filters[n]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(n){return n||(n=[]),this.isPlaying===!0?(this.disconnect(),this.filters=n,this.connect()):this.filters=n,this},getFilter:function(){return this.getFilters()[0]},setFilter:function(n){return this.setFilters(n?[n]:[])},setPlaybackRate:function(n){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=n,this.isPlaying===!0&&this.source.playbackRate.setValueAtTime(this.playbackRate,this.context.currentTime),this},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(n){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=n,this.isPlaying===!0&&(this.source.loop=this.loop),this},getVolume:function(){return this.gain.gain.value},setVolume:function(n){return this.gain.gain.value=n,this}});ew.prototype=Object.assign(Object.create(we.prototype),{constructor:ew,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(n){this.panner.refDistance=n},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(n){this.panner.rolloffFactor=n},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(n){this.panner.distanceModel=n},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(n){this.panner.maxDistance=n},updateMatrixWorld:function(){var t=new n;return function(n){r.prototype.updateMatrixWorld.call(this,n);t.setFromMatrixPosition(this.matrixWorld);this.panner.setPosition(t.x,t.y,t.z)}}()});Object.assign(ow.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var i=0,t=this.getFrequencyData(),n=0;n<t.length;n++)i+=t[n];return i/t.length}});Object.assign(sw.prototype,{accumulate:function(n,t){var f=this.buffer,u=this.valueSize,e=n*u+u,i=this.cumulativeWeight,r,o;if(i===0){for(r=0;r!==u;++r)f[e+r]=f[r];i=t}else i+=t,o=t/i,this._mixBufferRegion(f,e,0,o,u);this.cumulativeWeight=i},apply:function(n){var t=this.valueSize,r=this.buffer,u=n*t+t,f=this.cumulativeWeight,s=this.binding,e,i,o;for(this.cumulativeWeight=0,f<1&&(e=t*3,this._mixBufferRegion(r,u,e,1-f,t)),i=t,o=t+t;i!==o;++i)if(r[i]!==r[i+t]){s.setValue(r,u);break}},saveOriginalState:function(){var f=this.binding,t=this.buffer,i=this.valueSize,r=i*3,n,u;for(f.getValue(t,r),n=i,u=r;n!==u;++n)t[n]=t[r+n%i];this.cumulativeWeight=0},restoreOriginalState:function(){var n=this.valueSize*3;this.binding.setValue(this.buffer,n)},_select:function(n,t,i,r,u){if(r>=.5)for(var f=0;f!==u;++f)n[t+f]=n[i+f]},_slerp:function(n,t,i,r){g.slerpFlat(n,t,n,t,n,i,r)},_lerp:function(n,t,i,r,u){for(var o=1-r,e,f=0;f!==u;++f)e=t+f,n[e]=n[e]*o+n[i+f]*r}});Object.assign(hw.prototype,{getValue:function(n,t){this.bind();var r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==undefined&&i.getValue(n,t)},setValue:function(n,t){for(var r=this._bindings,i=this._targetGroup.nCachedObjects_,u=r.length;i!==u;++i)r[i].setValue(n,t)},bind:function(){for(var t=this._bindings,n=this._targetGroup.nCachedObjects_,i=t.length;n!==i;++n)t[n].bind()},unbind:function(){for(var t=this._bindings,n=this._targetGroup.nCachedObjects_,i=t.length;n!==i;++n)t[n].unbind()}});Object.assign(rt,{Composite:hw,create:function(n,t,i){return n&&n.isAnimationObjectGroup?new rt.Composite(n,t,i):new rt(n,t,i)},sanitizeNodeName:function(n){return n.replace(/\s/g,"_").replace(/[^\w-]/g,"")},parseTrackName:function(){var n=new RegExp("^"+/((?:[\w-]+[\/:])*)/.source+/([\w-\.]+)?/.source+/(?:\.([\w-]+)(?:\[(.+)\])?)?/.source+/\.([\w-]+)(?:\[(.+)\])?/.source+"$"),t=["material","materials","bones"];return function(i){var u=n.exec(i),r,f,e;if(!u)throw new Error("PropertyBinding: Cannot parse trackName: "+i);if(r={nodeName:u[2],objectName:u[3],objectIndex:u[4],propertyName:u[5],propertyIndex:u[6]},f=r.nodeName&&r.nodeName.lastIndexOf("."),f!==undefined&&f!==-1&&(e=r.nodeName.substring(f+1),t.indexOf(e)!==-1&&(r.nodeName=r.nodeName.substring(0,f),r.objectName=e)),r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+i);return r}}(),findNode:function(n,t){var f,i,r,u;return!t||t===""||t==="root"||t==="."||t===-1||t===n.name||t===n.uuid?n:n.skeleton&&(f=function(n){for(var r,i=0;i<n.bones.length;i++)if(r=n.bones[i],r.name===t)return r;return null},i=f(n.skeleton),i)?i:n.children&&(r=function(n){for(var i,f,u=0;u<n.length;u++){if(i=n[u],i.name===t||i.uuid===t)return i;if(f=r(i.children),f)return f}return null},u=r(n.children),u)?u:null}});Object.assign(rt.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(n,t){n[t]=this.node[this.propertyName]},function(n,t){for(var r=this.resolvedProperty,i=0,u=r.length;i!==u;++i)n[t++]=r[i]},function(n,t){n[t]=this.resolvedProperty[this.propertyIndex]},function(n,t){this.resolvedProperty.toArray(n,t)}],SetterByBindingTypeAndVersioning:[[function(n,t){this.targetObject[this.propertyName]=n[t]},function(n,t){this.targetObject[this.propertyName]=n[t];this.targetObject.needsUpdate=!0},function(n,t){this.targetObject[this.propertyName]=n[t];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(n,t){for(var r=this.resolvedProperty,i=0,u=r.length;i!==u;++i)r[i]=n[t++]},function(n,t){for(var r=this.resolvedProperty,i=0,u=r.length;i!==u;++i)r[i]=n[t++];this.targetObject.needsUpdate=!0},function(n,t){for(var r=this.resolvedProperty,i=0,u=r.length;i!==u;++i)r[i]=n[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(n,t){this.resolvedProperty[this.propertyIndex]=n[t]},function(n,t){this.resolvedProperty[this.propertyIndex]=n[t];this.targetObject.needsUpdate=!0},function(n,t){this.resolvedProperty[this.propertyIndex]=n[t];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(n,t){this.resolvedProperty.fromArray(n,t)},function(n,t){this.resolvedProperty.fromArray(n,t);this.targetObject.needsUpdate=!0},function(n,t){this.resolvedProperty.fromArray(n,t);this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(n,t){this.bind();this.getValue(n,t)},setValue:function(n,t){this.bind();this.setValue(n,t)},bind:function(){var n=this.node,r=this.parsedPath,o=r.objectName,s=r.propertyName,u=r.propertyIndex,f,i,c,h,e,t;if(n||(n=rt.findNode(this.rootNode,r.nodeName)||this.rootNode,this.node=n),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!n){console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");return}if(o){f=r.objectIndex;switch(o){case"materials":if(!n.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!n.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}n=n.material.materials;break;case"bones":if(!n.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}for(n=n.skeleton.bones,t=0;t<n.length;t++)if(n[t].name===f){f=t;break}break;default:if(n[o]===undefined){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}n=n[o]}if(f!==undefined){if(n[f]===undefined){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,n);return}n=n[f]}}if(i=n[s],i===undefined){c=r.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+s+" but it wasn't found.",n);return}if(h=this.Versioning.None,n.needsUpdate!==undefined?(h=this.Versioning.NeedsUpdate,this.targetObject=n):n.matrixWorldNeedsUpdate!==undefined&&(h=this.Versioning.MatrixWorldNeedsUpdate,this.targetObject=n),e=this.BindingType.Direct,u!==undefined){if(s==="morphTargetInfluences"){if(!n.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(n.geometry.isBufferGeometry){if(!n.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}for(t=0;t<this.node.geometry.morphAttributes.position.length;t++)if(n.geometry.morphAttributes.position[t].name===u){u=t;break}}else{if(!n.geometry.morphTargets){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);return}for(t=0;t<this.node.geometry.morphTargets.length;t++)if(n.geometry.morphTargets[t].name===u){u=t;break}}}e=this.BindingType.ArrayElement;this.resolvedProperty=i;this.propertyIndex=u}else i.fromArray!==undefined&&i.toArray!==undefined?(e=this.BindingType.HasFromToArray,this.resolvedProperty=i):Array.isArray(i)?(e=this.BindingType.EntireArray,this.resolvedProperty=i):this.propertyName=s;this.getValue=this.GetterByBindingType[e];this.setValue=this.SetterByBindingTypeAndVersioning[e][h]},unbind:function(){this.node=null;this.getValue=this._getValue_unbound;this.setValue=this._setValue_unbound}});Object.assign(rt.prototype,{_getValue_unbound:rt.prototype.getValue,_setValue_unbound:rt.prototype.setValue});Object.assign(gtt.prototype,{isAnimationObjectGroup:!0,add:function(){for(var d=arguments,i=this._objects,g=i.length,h=this.nCachedObjects_,e=this._indicesByUUID,y=this._paths,p=this._parsedPaths,c=this._bindings,w=c.length,r,a,n,f,o=0,b=arguments.length;o!==b;++o){var u=d[o],l=u.uuid,t=e[l],k=undefined;if(t===undefined)for(t=g++,e[l]=t,i.push(u),n=0,f=w;n!==f;++n)c[n].push(new rt(u,y[n],p[n]));else if(t<h)for(k=i[t],r=--h,a=i[r],e[a.uuid]=t,i[t]=a,e[l]=r,i[r]=u,n=0,f=w;n!==f;++n){var s=c[n],nt=s[r],v=s[t];s[t]=nt;v===undefined&&(v=new rt(u,y[n],p[n]));s[r]=v}else i[t]!==k&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=h},remove:function(){for(var y=arguments,f=this._objects,e=this.nCachedObjects_,o=this._indicesByUUID,h=this._bindings,p=h.length,t,s,r,v,i=0,c=arguments.length;i!==c;++i){var l=y[i],a=l.uuid,n=o[a];if(n!==undefined&&n>=e)for(t=e++,s=f[t],o[s.uuid]=n,f[n]=s,o[a]=t,f[t]=l,r=0,v=p;r!==v;++r){var u=h[r],w=u[t],b=u[n];u[n]=w;u[t]=b}}this.nCachedObjects_=e},uncache:function(){for(var b=arguments,t=this._objects,a=t.length,c=this.nCachedObjects_,e=this._indicesByUUID,l=this._bindings,v=l.length,u,f,i,s,n,h=0,y=arguments.length;h!==y;++h){var k=b[h],p=k.uuid,r=e[p];if(r!==undefined)if(delete e[p],r<c){var o=--c,w=t[o],u=--a,f=t[u];for(e[w.uuid]=r,t[r]=w,e[f.uuid]=o,t[o]=f,t.pop(),i=0,s=v;i!==s;++i){var n=l[i],d=n[o],g=n[u];n[r]=d;n[o]=g;n.pop()}}else for(u=--a,f=t[u],e[f.uuid]=r,t[r]=f,t.pop(),i=0,s=v;i!==s;++i)n=l[i],n[r]=n[u],n.pop()}this.nCachedObjects_=c},subscribe_:function(n,t){var o=this._bindingsIndicesByPath,r=o[n],u=this._bindings,i,s,h;if(r!==undefined)return u[r];var c=this._paths,l=this._parsedPaths,f=this._objects,a=f.length,v=this.nCachedObjects_,e=new Array(a);for(r=u.length,o[n]=r,c.push(n),l.push(t),u.push(e),i=v,s=f.length;i!==s;++i)h=f[i],e[i]=new rt(h,n,t);return e},unsubscribe_:function(n){var e=this._bindingsIndicesByPath,t=e[n];if(t!==undefined){var u=this._paths,f=this._parsedPaths,i=this._bindings,r=i.length-1,o=i[r],s=n[r];e[s]=t;i[t]=o;i.pop();f[t]=f[r];f.pop();u[t]=u[r];u.pop()}}});Object.assign(cw.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(n){return this._startTime=n,this},setLoop:function(n,t){return this.loop=n,this.repetitions=t,this},setEffectiveWeight:function(n){return this.weight=n,this._effectiveWeight=this.enabled?n:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(n){return this._scheduleFading(n,0,1)},fadeOut:function(n){return this._scheduleFading(n,1,0)},crossFadeFrom:function(n,t,i){if(n.fadeOut(t),this.fadeIn(t),i){var r=this._clip.duration,u=n._clip.duration,f=u/r,e=r/u;n.warp(1,f,t);this.warp(e,1,t)}return this},crossFadeTo:function(n,t,i){return n.crossFadeFrom(this,t,i)},stopFading:function(){var n=this._weightInterpolant;return n!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(n)),this},setEffectiveTimeScale:function(n){return this.timeScale=n,this._effectiveTimeScale=this.paused?0:n,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(n){return this.timeScale=this._clip.duration/n,this.stopWarping()},syncWith:function(n){return this.time=n.time,this.timeScale=n.timeScale,this.stopWarping()},halt:function(n){return this.warp(this._effectiveTimeScale,0,n)},warp:function(n,t,i){var e=this._mixer,o=e.time,r=this._timeScaleInterpolant,s=this.timeScale,u,f;return r===null&&(r=e._lendControlInterpolant(),this._timeScaleInterpolant=r),u=r.parameterPositions,f=r.sampleValues,u[0]=o,u[1]=o+i,f[0]=n/s,f[1]=t/s,this},stopWarping:function(){var n=this._timeScaleInterpolant;return n!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(n)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(n,t,i,r){var f,e,h,o,s,c,u,l;if(!this.enabled){this._updateWeight(n);return}if(f=this._startTime,f!==null){if(e=(n-f)*i,e<0||i===0)return;this._startTime=null;t=i*e}if(t*=this._updateTimeScale(n),h=this._updateTime(t),o=this._updateWeight(n),o>0)for(s=this._interpolants,c=this._propertyBindings,u=0,l=s.length;u!==l;++u)s[u].evaluate(h),c[u].accumulate(r,o)},_updateWeight:function(n){var t=0,i,r;return this.enabled&&(t=this.weight,i=this._weightInterpolant,i!==null&&(r=i.evaluate(n)[0],t*=r,n>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1)))),this._effectiveWeight=t,t},_updateTimeScale:function(n){var t=0,i,r;return this.paused||(t=this.timeScale,i=this._timeScaleInterpolant,i!==null&&(r=i.evaluate(n)[0],t*=r,n>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t))),this._effectiveTimeScale=t,t},_updateTime:function(n){var t=this.time+n,u,f,e,o;if(n===0)return t;var i=this._clip.duration,s=this.loop,r=this._loopCount;if(s===gk){r===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));n:{if(t>=i)t=i;else if(t<0)t=0;else break n;this.clampWhenFinished?this.paused=!0:this.enabled=!1;this._mixer.dispatchEvent({type:"finished",action:this,direction:n<0?-1:1})}}else if(u=s===td,r===-1&&(n>=0?(r=0,this._setEndings(!0,this.repetitions===0,u)):this._setEndings(this.repetitions===0,!0,u)),(t>=i||t<0)&&(f=Math.floor(t/i),t-=i*f,r+=Math.abs(f),e=this.repetitions-r,e<0?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,t=n>0?i:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:n>0?1:-1})):(e===0?(o=n<0,this._setEndings(o,!o,u)):this._setEndings(!1,!1,u),this._loopCount=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:f}))),u&&(r&1)==1)return this.time=t,i-t;return this.time=t,t},_setEndings:function(n,t,i){var r=this._interpolantSettings;i?(r.endingStart=dr,r.endingEnd=dr):(r.endingStart=n?this.zeroSlopeAtStart?dr:kr:vo,r.endingEnd=t?this.zeroSlopeAtEnd?dr:kr:vo)},_scheduleFading:function(n,t,i){var e=this._mixer,o=e.time,r=this._weightInterpolant,u,f;return r===null&&(r=e._lendControlInterpolant(),this._weightInterpolant=r),u=r.parameterPositions,f=r.sampleValues,u[0]=o,f[0]=t,u[1]=o+n,f[1]=i,this}});Object.assign(nit.prototype,bt.prototype,{_bindAction:function(n,t){var h=this,c=n._localRoot||this._root,l=n._clip.tracks,y=l.length,o=n._propertyBindings,p=n._interpolants,u=c.uuid,a=this._bindingsByRootAndName,f=a[u],r,v;for(f===undefined&&(f={},a[u]=f),r=0;r!==y;++r){var s=l[r],e=s.name,i=f[e];if(i!==undefined)o[r]=i;else{if(i=o[r],i!==undefined){i._cacheIndex===null&&(++i.referenceCount,h._addInactiveBinding(i,u,e));continue}v=t&&t._propertyBindings[r].binding.parsedPath;i=new sw(rt.create(c,e,v),s.ValueTypeName,s.getValueSize());++i.referenceCount;h._addInactiveBinding(i,u,e);o[r]=i}p[r].resultBuffer=i.buffer}},_activateAction:function(n){var o=this,r,t,e,i;if(!this._isActiveAction(n)){if(n._cacheIndex===null){var s=(n._localRoot||this._root).uuid,u=n._clip.uuid,f=this._actionsByClip[u];this._bindAction(n,f&&f.knownActions[0]);this._addInactiveAction(n,u,s)}for(r=n._propertyBindings,t=0,e=r.length;t!==e;++t)i=r[t],i.useCount++==0&&(o._lendBinding(i),i.saveOriginalState());this._lendAction(n)}},_deactivateAction:function(n){var f=this,r,t,u,i;if(this._isActiveAction(n)){for(r=n._propertyBindings,t=0,u=r.length;t!==u;++t)i=r[t],--i.useCount==0&&(i.restoreOriginalState(),f._takeBackBinding(i));this._takeBackAction(n)}},_initMemoryManager:function(){this._actions=[];this._nActiveActions=0;this._actionsByClip={};this._bindings=[];this._nActiveBindings=0;this._bindingsByRootAndName={};this._controlInterpolants=[];this._nActiveControlInterpolants=0;var n=this;this.stats={actions:{get total(){return n._actions.length},get inUse(){return n._nActiveActions}},bindings:{get total(){return n._bindings.length},get inUse(){return n._nActiveBindings}},controlInterpolants:{get total(){return n._controlInterpolants.length},get inUse(){return n._nActiveControlInterpolants}}}},_isActiveAction:function(n){var t=n._cacheIndex;return t!==null&&t<this._nActiveActions},_addInactiveAction:function(n,t,i){var f=this._actions,e=this._actionsByClip,r=e[t],u;r===undefined?(r={knownActions:[n],actionByRoot:{}},n._byClipCacheIndex=0,e[t]=r):(u=r.knownActions,n._byClipCacheIndex=u.length,u.push(n));n._cacheIndex=f.length;f.push(n);r.actionByRoot[i]=n},_removeInactiveAction:function(n){var i=this._actions,r=i[i.length-1],u=n._cacheIndex,c,l;r._cacheIndex=u;i[u]=r;i.pop();n._cacheIndex=null;var f=n._clip.uuid,e=this._actionsByClip,o=e[f],t=o.knownActions,s=t[t.length-1],h=n._byClipCacheIndex;s._byClipCacheIndex=h;t[h]=s;t.pop();n._byClipCacheIndex=null;c=o.actionByRoot;l=(n._localRoot||this._root).uuid;delete c[l];t.length===0&&delete e[f];this._removeInactiveBindingsForAction(n)},_removeInactiveBindingsForAction:function(n){for(var f=this,r=n._propertyBindings,i,t=0,u=r.length;t!==u;++t)i=r[t],--i.referenceCount==0&&f._removeInactiveBinding(i)},_lendAction:function(n){var t=this._actions,r=n._cacheIndex,i=this._nActiveActions++,u=t[i];n._cacheIndex=i;t[i]=n;u._cacheIndex=r;t[r]=u},_takeBackAction:function(n){var t=this._actions,r=n._cacheIndex,i=--this._nActiveActions,u=t[i];n._cacheIndex=i;t[i]=n;u._cacheIndex=r;t[r]=u},_addInactiveBinding:function(n,t,i){var u=this._bindingsByRootAndName,r=u[t],f=this._bindings;r===undefined&&(r={},u[t]=r);r[i]=n;n._cacheIndex=f.length;f.push(n)},_removeInactiveBinding:function(n){var t=this._bindings,i=n.binding,r=i.rootNode.uuid,s=i.path,u=this._bindingsByRootAndName,f=u[r],e=t[t.length-1],o=n._cacheIndex,h;e._cacheIndex=o;t[o]=e;t.pop();delete f[s];n:{for(h in f)break n;delete u[r]}},_lendBinding:function(n){var t=this._bindings,r=n._cacheIndex,i=this._nActiveBindings++,u=t[i];n._cacheIndex=i;t[i]=n;u._cacheIndex=r;t[r]=u},_takeBackBinding:function(n){var t=this._bindings,r=n._cacheIndex,i=--this._nActiveBindings,u=t[i];n._cacheIndex=i;t[i]=n;u._cacheIndex=r;t[r]=u},_lendControlInterpolant:function(){var i=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=i[t];return n===undefined&&(n=new ih(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),n.__cacheIndex=t,i[t]=n),n},_takeBackControlInterpolant:function(n){var t=this._controlInterpolants,r=n.__cacheIndex,i=--this._nActiveControlInterpolants,u=t[i];n.__cacheIndex=i;t[i]=n;u.__cacheIndex=r;t[r]=u},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(n,t){var o=t||this._root,s=o.uuid,i=typeof n=="string"?ni.findByName(o,n):n,h=i!==null?i.uuid:n,u=this._actionsByClip[h],f=null,e,r;if(u!==undefined){if(e=u.actionByRoot[s],e!==undefined)return e;f=u.knownActions[0];i===null&&(i=f._clip)}return i===null?null:(r=new cw(this,i,t),this._bindAction(r,f),this._addInactiveAction(r,h,s),r)},existingAction:function(n,t){var i=t||this._root,f=i.uuid,r=typeof n=="string"?ni.findByName(i,n):n,e=r?r.uuid:n,u=this._actionsByClip[e];return u!==undefined?u.actionByRoot[f]||null:null},stopAllAction:function(){var t=this._actions,i=this._nActiveActions,r=this._bindings,u=this._nActiveBindings,n;for(this._nActiveActions=0,this._nActiveBindings=0,n=0;n!==i;++n)t[n].reset();for(n=0;n!==u;++n)r[n].useCount=0;return this},update:function(n){var r,u,f,t;n*=this.timeScale;var e=this._actions,o=this._nActiveActions,s=this.time+=n,h=Math.sign(n),i=this._accuIndex^=1;for(t=0;t!==o;++t)r=e[t],r._update(s,n,h,i);for(u=this._bindings,f=this._nActiveBindings,t=0;t!==f;++t)u[t].apply(i);return this},getRoot:function(){return this._root},uncacheClip:function(n){var o=this,i=this._actions,s=n.uuid,h=this._actionsByClip,c=h[s],u,r,l,t,f,e;if(c!==undefined){for(u=c.knownActions,r=0,l=u.length;r!==l;++r)t=u[r],o._deactivateAction(t),f=t._cacheIndex,e=i[i.length-1],t._cacheIndex=null,t._byClipCacheIndex=null,e._cacheIndex=f,i[f]=e,i.pop(),o._removeInactiveBindingsForAction(t);delete h[s]}},uncacheRoot:function(n){var r=this,f=n.uuid,e=this._actionsByClip,o,s,t,h,i,c,u;for(o in e)s=e[o].actionByRoot,t=s[f],t!==undefined&&(r._deactivateAction(t),r._removeInactiveAction(t));if(h=this._bindingsByRootAndName,i=h[f],i!==undefined)for(c in i)u=i[c],u.restoreOriginalState(),r._removeInactiveBinding(u)},uncacheAction:function(n,t){var i=this.existingAction(n,t);i!==null&&(this._deactivateAction(i),this._removeInactiveAction(i))}});ya.prototype.clone=function(){return new ya(this.value.clone===undefined?this.value:this.value.clone())};lw.prototype=Object.assign(Object.create(u.prototype),{constructor:lw,isInstancedBufferGeometry:!0,copy:function(n){return u.prototype.copy.call(this,n),this.maxInstancedCount=n.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)}});Object.defineProperties(aw.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}});Object.assign(aw.prototype,{isInterleavedBufferAttribute:!0,setX:function(n,t){return this.data.array[n*this.data.stride+this.offset]=t,this},setY:function(n,t){return this.data.array[n*this.data.stride+this.offset+1]=t,this},setZ:function(n,t){return this.data.array[n*this.data.stride+this.offset+2]=t,this},setW:function(n,t){return this.data.array[n*this.data.stride+this.offset+3]=t,this},getX:function(n){return this.data.array[n*this.data.stride+this.offset]},getY:function(n){return this.data.array[n*this.data.stride+this.offset+1]},getZ:function(n){return this.data.array[n*this.data.stride+this.offset+2]},getW:function(n){return this.data.array[n*this.data.stride+this.offset+3]},setXY:function(n,t,i){return n=n*this.data.stride+this.offset,this.data.array[n+0]=t,this.data.array[n+1]=i,this},setXYZ:function(n,t,i,r){return n=n*this.data.stride+this.offset,this.data.array[n+0]=t,this.data.array[n+1]=i,this.data.array[n+2]=r,this},setXYZW:function(n,t,i,r,u){return n=n*this.data.stride+this.offset,this.data.array[n+0]=t,this.data.array[n+1]=i,this.data.array[n+2]=r,this.data.array[n+3]=u,this}});Object.defineProperty(be.prototype,"needsUpdate",{set:function(n){n===!0&&this.version++}});Object.assign(be.prototype,{isInterleavedBuffer:!0,setArray:function(n){if(Array.isArray(n))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=n!==undefined?n.length/this.stride:0;this.array=n},setDynamic:function(n){return this.dynamic=n,this},copy:function(n){return this.array=new n.array.constructor(n.array),this.count=n.count,this.stride=n.stride,this.dynamic=n.dynamic,this},copyAt:function(n,t,i){var f=this,r,u;for(n*=this.stride,i*=t.stride,r=0,u=this.stride;r<u;r++)f.array[n+r]=t.array[i+r];return this},set:function(n,t){return t===undefined&&(t=0),this.array.set(n,t),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(n){return this.onUploadCallback=n,this}});vw.prototype=Object.assign(Object.create(be.prototype),{constructor:vw,isInstancedInterleavedBuffer:!0,copy:function(n){return be.prototype.copy.call(this,n),this.meshPerAttribute=n.meshPerAttribute,this}});yw.prototype=Object.assign(Object.create(c.prototype),{constructor:yw,isInstancedBufferAttribute:!0,copy:function(n){return c.prototype.copy.call(this,n),this.meshPerAttribute=n.meshPerAttribute,this}});Object.assign(pw.prototype,{linePrecision:1,set:function(n,t){this.ray.set(n,t)},setFromCamera:function(n,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(n.x,n.y,.5).unproject(t).sub(this.ray.origin).normalize()):t&&t.isOrthographicCamera?(this.ray.origin.set(n.x,n.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(n,t){var i=[];return pa(n,this,i,t),i.sort(ww),i},intersectObjects:function(n,t){var f=this,i=[],r,u;if(Array.isArray(n)===!1)return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(r=0,u=n.length;r<u;r++)pa(n[r],f,i,t);return i.sort(ww),i}});Object.assign(tit.prototype,{start:function(){this.startTime=(typeof performance=="undefined"?Date:performance).now();this.oldTime=this.startTime;this.elapsedTime=0;this.running=!0},stop:function(){this.getElapsedTime();this.running=!1;this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var n=0,t;return this.autoStart&&!this.running?(this.start(),0):(this.running&&(t=(typeof performance=="undefined"?Date:performance).now(),n=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=n),n)}});Object.assign(iit.prototype,{set:function(n,t,i){return this.radius=n,this.phi=t,this.theta=i,this},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.radius=n.radius,this.phi=n.phi,this.theta=n.theta,this},makeSafe:function(){var n=1e-6;return this.phi=Math.max(n,Math.min(Math.PI-n,this.phi)),this},setFromVector3:function(n){return this.radius=n.length(),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(n.x,n.z),this.phi=Math.acos(h.clamp(n.y/this.radius,-1,1))),this}});Object.assign(rit.prototype,{set:function(n,t,i){return this.radius=n,this.theta=t,this.y=i,this},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.radius=n.radius,this.theta=n.theta,this.y=n.y,this},setFromVector3:function(n){return this.radius=Math.sqrt(n.x*n.x+n.z*n.z),this.theta=Math.atan2(n.x,n.z),this.y=n.y,this}});oh.prototype=Object.create(r.prototype);oh.prototype.constructor=oh;oh.prototype.isImmediateRenderObject=!0;sh.prototype=Object.create(w.prototype);sh.prototype.constructor=sh;sh.prototype.update=function(){var t=new n,i=new n,r=new ot;return function(){var a=this,k=["a","b","c"],s,p,h,w,b,n,o;this.object.updateMatrixWorld(!0);r.getNormalMatrix(this.object.matrixWorld);var v=this.object.matrixWorld,e=this.geometry.attributes.position,f=this.object.geometry;if(f&&f.isGeometry){var d=f.vertices,y=f.faces,u=0;for(s=0,p=y.length;s<p;s++)for(h=y[s],n=0,o=h.vertexNormals.length;n<o;n++)w=d[h[k[n]]],b=h.vertexNormals[n],t.copy(w).applyMatrix4(v),i.copy(b).applyMatrix3(r).normalize().multiplyScalar(a.size).add(t),e.setXYZ(u,t.x,t.y,t.z),u=u+1,e.setXYZ(u,i.x,i.y,i.z),u=u+1}else if(f&&f.isBufferGeometry){var c=f.attributes.position,l=f.attributes.normal,u=0;for(n=0,o=c.count;n<o;n++)t.set(c.getX(n),c.getY(n),c.getZ(n)).applyMatrix4(v),i.set(l.getX(n),l.getY(n),l.getZ(n)),i.applyMatrix3(r).normalize().multiplyScalar(a.size).add(t),e.setXYZ(u,t.x,t.y,t.z),u=u+1,e.setXYZ(u,i.x,i.y,i.z),u=u+1}e.needsUpdate=!0}}();ke.prototype=Object.create(r.prototype);ke.prototype.constructor=ke;ke.prototype.dispose=function(){this.cone.geometry.dispose();this.cone.material.dispose()};ke.prototype.update=function(){var t=new n,i=new n;return function(){this.light.updateMatrixWorld();var n=this.light.distance?this.light.distance:1e3,r=n*Math.tan(this.light.angle);this.cone.scale.set(r,r,n);t.setFromMatrixPosition(this.light.matrixWorld);i.setFromMatrixPosition(this.light.target.matrixWorld);this.cone.lookAt(i.sub(t));this.color!==undefined?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}();de.prototype=Object.create(w.prototype);de.prototype.constructor=de;de.prototype.updateMatrixWorld=function(){var t=new n,i=new o,u=new o;return function(n){var s=this.bones,h=this.geometry,c=h.getAttribute("position"),e,o,f;for(u.getInverse(this.root.matrixWorld),e=0,o=0;e<s.length;e++)f=s[e],f.parent&&f.parent.isBone&&(i.multiplyMatrices(u,f.matrixWorld),t.setFromMatrixPosition(i),c.setXYZ(o,t.x,t.y,t.z),i.multiplyMatrices(u,f.parent.matrixWorld),t.setFromMatrixPosition(i),c.setXYZ(o+1,t.x,t.y,t.z),o+=2);h.getAttribute("position").needsUpdate=!0;r.prototype.updateMatrixWorld.call(this,n)}}();ge.prototype=Object.create(tt.prototype);ge.prototype.constructor=ge;ge.prototype.dispose=function(){this.geometry.dispose();this.material.dispose()};ge.prototype.update=function(){this.color!==undefined?this.material.color.set(this.color):this.material.color.copy(this.light.color)};no.prototype=Object.create(r.prototype);no.prototype.constructor=no;no.prototype.dispose=function(){this.children[0].geometry.dispose();this.children[0].material.dispose()};no.prototype.update=function(){var t=this.light.width*.5,i=this.light.height*.5,r=this.line.geometry.attributes.position,n=r.array;n[0]=t;n[1]=-i;n[2]=0;n[3]=t;n[4]=i;n[5]=0;n[6]=-t;n[7]=i;n[8]=0;n[9]=-t;n[10]=-i;n[11]=0;n[12]=t;n[13]=-i;n[14]=0;r.needsUpdate=!0;this.color!==undefined?this.line.material.color.set(this.color):this.line.material.color.copy(this.light.color)};to.prototype=Object.create(r.prototype);to.prototype.constructor=to;to.prototype.dispose=function(){this.children[0].geometry.dispose();this.children[0].material.dispose()};to.prototype.update=function(){var r=new n,t=new f,i=new f;return function(){var o=this.children[0],u,n,e,f;if(this.color!==undefined)this.material.color.set(this.color);else{for(u=o.geometry.getAttribute("color"),t.copy(this.light.color),i.copy(this.light.groundColor),n=0,e=u.count;n<e;n++)f=n<e/2?t:i,u.setXYZ(n,f.r,f.g,f.b);u.needsUpdate=!0}o.lookAt(r.setFromMatrixPosition(this.light.matrixWorld).negate())}}();hh.prototype=Object.create(w.prototype);hh.prototype.constructor=hh;wa.prototype=Object.create(w.prototype);wa.prototype.constructor=wa;ch.prototype=Object.create(w.prototype);ch.prototype.constructor=ch;ch.prototype.update=function(){var t=new n,i=new n,r=new ot;return function(){var a=this,f,c,u,l;this.object.updateMatrixWorld(!0);r.getNormalMatrix(this.object.matrixWorld);var v=this.object.matrixWorld,e=this.geometry.attributes.position,s=this.object.geometry,o=s.vertices,h=s.faces,n=0;for(f=0,c=h.length;f<c;f++)u=h[f],l=u.normal,t.copy(o[u.a]).add(o[u.b]).add(o[u.c]).divideScalar(3).applyMatrix4(v),i.copy(l).applyMatrix3(r).normalize().multiplyScalar(a.size).add(t),e.setXYZ(n,t.x,t.y,t.z),n=n+1,e.setXYZ(n,i.x,i.y,i.z),n=n+1;e.needsUpdate=!0}}();io.prototype=Object.create(r.prototype);io.prototype.constructor=io;io.prototype.dispose=function(){this.lightPlane.geometry.dispose();this.lightPlane.material.dispose();this.targetLine.geometry.dispose();this.targetLine.material.dispose()};io.prototype.update=function(){var i=new n,r=new n,t=new n;return function(){i.setFromMatrixPosition(this.light.matrixWorld);r.setFromMatrixPosition(this.light.target.matrixWorld);t.subVectors(r,i);this.lightPlane.lookAt(t);this.color!==undefined?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color));this.targetLine.lookAt(t);this.targetLine.scale.z=t.length()}}();lh.prototype=Object.create(w.prototype);lh.prototype.constructor=lh;lh.prototype.update=function(){function t(n,t,e,o){var s,c,h,l;if(i.set(t,e,o).unproject(f),s=u[n],s!==undefined)for(c=r.getAttribute("position"),h=0,l=s.length;h<l;h++)c.setXYZ(s[h],i.x,i.y,i.z)}var r,u,i=new n,f=new oi;return function(){r=this.geometry;u=this.pointMap;var i=1,n=1;f.projectionMatrix.copy(this.camera.projectionMatrix);t("c",0,0,-1);t("t",0,0,1);t("n1",-i,-n,-1);t("n2",i,-n,-1);t("n3",-i,n,-1);t("n4",i,n,-1);t("f1",-i,-n,1);t("f2",i,-n,1);t("f3",-i,n,1);t("f4",i,n,1);t("u1",i*.7,n*1.1,-1);t("u2",-i*.7,n*1.1,-1);t("u3",0,n*2,-1);t("cf1",-i,0,1);t("cf2",i,0,1);t("cf3",0,-n,1);t("cf4",0,n,1);t("cn1",-i,0,-1);t("cn2",i,0,-1);t("cn3",0,-n,-1);t("cn4",0,n,-1);r.getAttribute("position").needsUpdate=!0}}();ro.prototype=Object.create(w.prototype);ro.prototype.constructor=ro;ro.prototype.update=function(){var n=new vi;return function(t){if(t!==undefined&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==undefined&&n.setFromObject(this.object),!n.isEmpty()){var r=n.min,u=n.max,f=this.geometry.attributes.position,i=f.array;i[0]=u.x;i[1]=u.y;i[2]=u.z;i[3]=r.x;i[4]=u.y;i[5]=u.z;i[6]=r.x;i[7]=r.y;i[8]=u.z;i[9]=u.x;i[10]=r.y;i[11]=u.z;i[12]=u.x;i[13]=u.y;i[14]=r.z;i[15]=r.x;i[16]=u.y;i[17]=r.z;i[18]=r.x;i[19]=r.y;i[20]=r.z;i[21]=u.x;i[22]=r.y;i[23]=r.z;f.needsUpdate=!0;this.geometry.computeBoundingSphere()}}}();ro.prototype.setFromObject=function(n){return this.object=n,this.update(),this};ah.prototype=Object.create(w.prototype);ah.prototype.constructor=ah;ah.prototype.updateMatrixWorld=function(n){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),r.prototype.updateMatrixWorld.call(this,n))};vh.prototype=Object.create(ct.prototype);vh.prototype.constructor=vh;vh.prototype.updateMatrixWorld=function(n){var t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8);this.scale.set(.5*this.size,.5*this.size,t);this.lookAt(this.plane.normal);r.prototype.updateMatrixWorld.call(this,n)};bu.prototype=Object.create(r.prototype);bu.prototype.constructor=bu;bu.prototype.setDirection=function(){var t=new n,i;return function(n){n.y>.99999?this.quaternion.set(0,0,0,1):n.y<-.99999?this.quaternion.set(1,0,0,0):(t.set(n.z,0,-n.x).normalize(),i=Math.acos(n.y),this.quaternion.setFromAxisAngle(t,i))}}();bu.prototype.setLength=function(n,t,i){t===undefined&&(t=.2*n);i===undefined&&(i=.2*t);this.line.scale.set(1,Math.max(0,n-t),1);this.line.updateMatrix();this.cone.scale.set(i,t,i);this.cone.position.y=n;this.cone.updateMatrix()};bu.prototype.setColor=function(n){this.line.material.color.copy(n);this.cone.material.color.copy(n)};ka.prototype=Object.create(w.prototype);ka.prototype.constructor=ka;var ph=new n,ga=new da,nv=new da,tv=new da;bi.prototype=Object.create(a.prototype);bi.prototype.constructor=bi;bi.prototype.isCatmullRomCurve3=!0;bi.prototype.getPoint=function(t,i){var p=i||new n,r=this.points,f=r.length,w=(f-(this.closed?0:1))*t,u=Math.floor(w),l=w-u,e,o,s,h;if(this.closed?u+=u>0?0:(Math.floor(Math.abs(u)/r.length)+1)*r.length:l===0&&u===f-1&&(u=f-2,l=1),this.closed||u>0?e=r[(u-1)%f]:(ph.subVectors(r[0],r[1]).add(r[0]),e=ph),o=r[u%f],s=r[(u+1)%f],this.closed||u+2<f?h=r[(u+2)%f]:(ph.subVectors(r[f-1],r[f-2]).add(r[f-1]),h=ph),this.curveType==="centripetal"||this.curveType==="chordal"){var y=this.curveType==="chordal"?.5:.25,a=Math.pow(e.distanceToSquared(o),y),c=Math.pow(o.distanceToSquared(s),y),v=Math.pow(s.distanceToSquared(h),y);c<.0001&&(c=1);a<.0001&&(a=c);v<.0001&&(v=c);ga.initNonuniformCatmullRom(e.x,o.x,s.x,h.x,a,c,v);nv.initNonuniformCatmullRom(e.y,o.y,s.y,h.y,a,c,v);tv.initNonuniformCatmullRom(e.z,o.z,s.z,h.z,a,c,v)}else this.curveType==="catmullrom"&&(ga.initCatmullRom(e.x,o.x,s.x,h.x,this.tension),nv.initCatmullRom(e.y,o.y,s.y,h.y,this.tension),tv.initCatmullRom(e.z,o.z,s.z,h.z,this.tension));return p.set(ga.calc(l),nv.calc(l),tv.calc(l)),p};bi.prototype.copy=function(n){var u=this,t,i,r;for(a.prototype.copy.call(this,n),this.points=[],t=0,i=n.points.length;t<i;t++)r=n.points[t],u.points.push(r.clone());return this.closed=n.closed,this.curveType=n.curveType,this.tension=n.tension,this};ku.prototype=Object.create(a.prototype);ku.prototype.constructor=ku;ku.prototype.isCubicBezierCurve3=!0;ku.prototype.getPoint=function(t,i){var o=i||new n,r=this.v0,u=this.v1,f=this.v2,e=this.v3;return o.set(hr(t,r.x,u.x,f.x,e.x),hr(t,r.y,u.y,f.y,e.y),hr(t,r.z,u.z,f.z,e.z)),o};ku.prototype.copy=function(n){return a.prototype.copy.call(this,n),this.v0.copy(n.v0),this.v1.copy(n.v1),this.v2.copy(n.v2),this.v3.copy(n.v3),this};du.prototype=Object.create(a.prototype);du.prototype.constructor=du;du.prototype.isQuadraticBezierCurve3=!0;du.prototype.getPoint=function(t,i){var e=i||new n,r=this.v0,u=this.v1,f=this.v2;return e.set(sr(t,r.x,u.x,f.x),sr(t,r.y,u.y,f.y),sr(t,r.z,u.z,f.z)),e};du.prototype.copy=function(n){return a.prototype.copy.call(this,n),this.v0.copy(n.v0),this.v1.copy(n.v1),this.v2.copy(n.v2),this};vr.prototype=Object.create(a.prototype);vr.prototype.constructor=vr;vr.prototype.isLineCurve3=!0;vr.prototype.getPoint=function(t,i){var r=i||new n;return t===1?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(t).add(this.v1)),r};vr.prototype.getPointAt=function(n,t){return this.getPoint(n,t)};vr.prototype.copy=function(n){return a.prototype.copy.call(this,n),this.v1.copy(n.v1),this.v2.copy(n.v2),this};wh.prototype=Object.create(ci.prototype);wh.prototype.constructor=wh;wh.prototype.isArcCurve=!0;a.create=function(n,t){return console.log("THREE.Curve.create() has been deprecated"),n.prototype=Object.create(a.prototype),n.prototype.constructor=n,n.prototype.getPoint=t,n};Object.assign(yu.prototype,{createPointsGeometry:function(n){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getPoints(n);return this.createGeometry(t)},createSpacedPointsGeometry:function(n){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getSpacedPoints(n);return this.createGeometry(t)},createGeometry:function(t){var u,i,f,r;for(console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead."),u=new s,i=0,f=t.length;i<f;i++)r=t[i],u.vertices.push(new n(r.x,r.y,r.z||0));return u}});Object.assign(pu.prototype,{fromPoints:function(n){console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints().");this.setFromPoints(n)}});kw.prototype=Object.create(bi.prototype);Object.assign(kw.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}});hh.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")};de.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")};Object.assign(nl.prototype,{center:function(n){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(n)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(n){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(n)},size:function(n){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(n)}});Object.assign(vi.prototype,{center:function(n){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(n)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(n){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(n)},isIntersectionSphere:function(n){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(n)},size:function(n){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(n)}});af.prototype.center=function(n){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(n)};Object.assign(h,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(n){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),h.floorPowerOfTwo(n)},nextPowerOfTwo:function(n){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),h.ceilPowerOfTwo(n)}});Object.assign(ot.prototype,{flattenToArrayOffset:function(n,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(n,t)},multiplyVector3:function(n){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),n.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBuffer:function(n){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(n)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}});Object.assign(o.prototype,{extractPosition:function(n){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(n)},flattenToArrayOffset:function(n,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(n,t)},getPosition:function(){var t;return function(){return t===undefined&&(t=new n),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),t.setFromMatrixColumn(this,3)}}(),setRotationFromQuaternion:function(n){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(n)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(n){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)},multiplyVector4:function(n){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(n){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");n.transformDirection(this)},crossVector:function(n){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBuffer:function(n){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(n)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(n,t,i,r,u,f){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(n,t,r,i,u,f)}});kt.prototype.isIntersectionLine=function(n){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(n)};g.prototype.multiplyVector3=function(n){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),n.applyQuaternion(this)};Object.assign(uu.prototype,{isIntersectionBox:function(n){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(n)},isIntersectionPlane:function(n){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(n)},isIntersectionSphere:function(n){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(n)}});Object.assign(wu.prototype,{extractAllPoints:function(n){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(n)},extrude:function(n){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new fr(this,n)},makeGeometry:function(n){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new oe(this,n)}});Object.assign(t.prototype,{fromAttribute:function(n,t,i){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(n,t,i)},distanceToManhattan:function(n){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(n)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}});Object.assign(n.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(n){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(n)},getScaleFromMatrix:function(n){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(n)},getColumnFromMatrix:function(n,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,n)},applyProjection:function(n){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(n)},fromAttribute:function(n,t,i){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(n,t,i)},distanceToManhattan:function(n){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(n)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}});Object.assign(p.prototype,{fromAttribute:function(n,t,i){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(n,t,i)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}});s.prototype.computeTangents=function(){console.warn("THREE.Geometry: .computeTangents() has been removed.")};Object.assign(r.prototype,{getChildByName:function(n){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(n)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(n,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,n)}});Object.defineProperties(r.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(n){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order.");this.rotation.order=n}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}});Object.defineProperties(go.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}});Object.defineProperty(ns.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}});Object.defineProperty(a.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(n){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions.");this.arcLengthDivisions=n}});nt.prototype.setLens=function(n,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup.");t!==undefined&&(this.filmGauge=t);this.setFocalLength(n)};Object.defineProperties(k.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(n){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov.");this.shadow.camera.fov=n}},shadowCameraLeft:{set:function(n){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left.");this.shadow.camera.left=n}},shadowCameraRight:{set:function(n){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right.");this.shadow.camera.right=n}},shadowCameraTop:{set:function(n){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top.");this.shadow.camera.top=n}},shadowCameraBottom:{set:function(n){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.");this.shadow.camera.bottom=n}},shadowCameraNear:{set:function(n){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near.");this.shadow.camera.near=n}},shadowCameraFar:{set:function(n){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far.");this.shadow.camera.far=n}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(n){console.warn("THREE.Light: .shadowBias is now .shadow.bias.");this.shadow.bias=n}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(n){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.");this.shadow.mapSize.width=n}},shadowMapHeight:{set:function(n){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.");this.shadow.mapSize.height=n}}});Object.defineProperties(c.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}}});Object.assign(u.prototype,{addIndex:function(n){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().");this.setIndex(n)},addDrawCall:function(n,t,i){i!==undefined&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.");console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup().");this.addGroup(n,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().");this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}});Object.defineProperties(u.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}});Object.defineProperties(ya.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}});Object.defineProperties(l.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new f}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(n){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.");this.flatShading=n===ov}}});Object.defineProperties(vt.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}});Object.defineProperties(dt.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(n){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.");this.extensions.derivatives=n}}});Object.assign(al.prototype,{getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(n){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().");this.setScissorTest(n)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}});Object.defineProperties(al.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(n){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.");this.shadowMap.enabled=n}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(n){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.");this.shadowMap.type=n}},shadowMapCullFace:{get:function(){return this.shadowMap.cullFace},set:function(n){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.");this.shadowMap.cullFace=n}}});Object.defineProperties(up.prototype,{cullFace:{get:function(){return this.renderReverseSided?fv:eo},set:function(n){var t=n!==eo;console.warn("WebGLRenderer: .shadowMap.cullFace is deprecated. Set .shadowMap.renderReverseSided to "+t+".");this.renderReverseSided=t}}});Object.defineProperties(ef.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(n){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.");this.texture.wrapS=n}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(n){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.");this.texture.wrapT=n}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(n){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.");this.texture.magFilter=n}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(n){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.");this.texture.minFilter=n}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(n){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.");this.texture.anisotropy=n}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(n){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset.");this.texture.offset=n}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(n){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat.");this.texture.repeat=n}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(n){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format.");this.texture.format=n}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(n){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type.");this.texture.type=n}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(n){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.");this.texture.generateMipmaps=n}}});we.prototype.load=function(n){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this,i=new uw;return i.load(n,function(n){t.setBuffer(n)}),this};ow.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()};eh.prototype.updateCubeMap=function(n,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(n,t)};var fit=/^[og]\s*(.+)?/,eit=/^mtllib /,oit=/^usemtl /;iv.prototype={constructor:iv,load:function(n,t,i,r){var u=this,f=new ui(u.manager);f.setPath(this.path);f.load(n,function(n){t(u.parse(n))},i,r)},setPath:function(n){this.path=n},setMaterials:function(n){return this.materials=n,this},parse:function(n){var kt=this,t,e,lt,ti,rt,s,g,ut,ft,et,ri,nt,ui,pt,ot,c,k,o,v,f,bt,ct,h,it,a;console.time("OBJLoader");t=new sit;n.indexOf("\r\n")!==-1&&(n=n.replace(/\r\n/g,"\n"));n.indexOf("\\\n")!==-1&&(n=n.replace(/\\\n/g,""));var dt=n.split("\n"),r="",p="",gt=0,b=[],fi=typeof"".trimLeft=="function";for(c=0,k=dt.length;c<k;c++)if((r=dt[c],r=fi?r.trimLeft():r.trim(),gt=r.length,gt!==0)&&(p=r.charAt(0),p!=="#"))if(p==="v"){e=r.split(/\s+/);switch(e[0]){case"v":t.vertices.push(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]));e.length===8&&t.colors.push(parseFloat(e[4]),parseFloat(e[5]),parseFloat(e[6]));break;case"vn":t.normals.push(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]));break;case"vt":t.uvs.push(parseFloat(e[1]),parseFloat(e[2]))}}else if(p==="f"){var ei=r.substr(1).trim(),ni=ei.split(/\s+/),d=[];for(s=0,g=ni.length;s<g;s++)lt=ni[s],lt.length>0&&(ti=lt.split("/"),d.push(ti));for(rt=d[0],s=1,g=d.length-1;s<g;s++)ut=d[s],ft=d[s+1],t.addFace(rt[0],ut[0],ft[0],rt[1],ut[1],ft[1],rt[2],ut[2],ft[2])}else if(p==="l"){var at=r.substring(1).trim().split(" "),yt=[],ii=[];if(r.indexOf("/")===-1)yt=at;else for(et=0,ri=at.length;et<ri;et++)nt=at[et].split("/"),nt[0]!==""&&yt.push(nt[0]),nt[1]!==""&&ii.push(nt[1]);t.addLineGeometry(yt,ii)}else if((b=fit.exec(r))!==null)ui=(" "+b[0].substr(1).trim()).substr(1),t.startObject(ui);else if(oit.test(r))t.object.startMaterial(r.substring(7).trim(),t.materialLibraries);else if(eit.test(r))t.materialLibraries.push(r.substring(7).trim());else if(p==="s")b=r.split(" "),b.length>1?(pt=b[1].trim().toLowerCase(),t.object.smooth=pt!=="0"&&pt!=="off"):t.object.smooth=!0,f=t.object.currentMaterial(),f&&(f.smooth=t.object.smooth);else{if(r==='\0')continue;throw new Error('THREE.OBJLoader: Unexpected line: "'+r+'"');}for(t.finalize(),ot=new wf,ot.materialLibraries=[].concat(t.materialLibraries),c=0,k=t.objects.length;c<k;c++){var wt=t.objects[c],l=wt.geometry,st=wt.materials,ht=l.type==="Line";if(l.vertices.length!==0){for(o=new u,o.addAttribute("position",new i(l.vertices,3)),l.normals.length>0?o.addAttribute("normal",new i(l.normals,3)):o.computeVertexNormals(),l.colors.length>0&&o.addAttribute("color",new i(l.colors,3)),l.uvs.length>0&&o.addAttribute("uv",new i(l.uvs,2)),v=[],h=0,it=st.length;h<it;h++)a=st[h],f=undefined,kt.materials!==null&&(f=kt.materials.create(a.name),!ht||!f||f instanceof y||(bt=new y,bt.copy(f),f=bt)),f||(f=ht?new y:new vt,f.name=a.name),f.flatShading=a.smooth?!1:!0,v.push(f);if(v.length>1){for(h=0,it=st.length;h<it;h++)a=st[h],o.addGroup(a.groupStart,a.groupCount,h);ct=ht?new w(o,v):new tt(o,v)}else ct=ht?new w(o,v[0]):new tt(o,v[0]);ct.name=wt.name;ot.add(ct)}}return console.timeEnd("OBJLoader"),ot}};var hit=16777215,cit=4473924,lit=1140,ait=660,vit=40,yit=[250,180,250],pit=[-100,50,0],wit=1,bit=2e3,kit=[{color:16777215,alpha:.8}],dit=4,bh=2,rv=.5;Object.assign(d.prototype,bt.prototype);d.prototype.setConfig=function(n){this.config=Object.assign(this.config||{animate:!0,antialias:!0,backgroundColor:hit,maxWidth:lit,maxHeight:ait,ambientColor:cit,cameraFOV:vit,cameraPosition:yit,cameraTarget:pit,minDistance:wit,maxDistance:bit,lights:kit,xyPrecision:dit},n)};d.prototype.setRenderer=function(n,t){var i=new al({alpha:!0,antialias:t.antialias});return n.innerHTML="",n.appendChild(i.domElement),this.renderer=i,i};d.prototype.setScene=function(n){var i=new ko,r=new nt(n.cameraFOV,1,n.minDistance,n.maxDistance),u;(u=r.position).set.apply(u,n.cameraPosition);i.add(r);i.add(new th(n.ambientColor));n.lights.forEach(function(n){var t=new nh(n.color,n.alpha||1),r;n.position&&(r=t.position).set.apply(r,n.position);i.add(t)});this.scene=i;this.camera=r;this._mouse=new t;this._raycaster=new pw};d.prototype.setSize=function(n,t){this.width=Math.round(n);this.height=Math.round(t);var r=this.config.antialias?bh:1,i=this.renderer.domElement;this.renderer.setSize(this.width*r,this.height*r);this.renderer.setViewport(0,0,this.renderer.context.drawingBufferWidth,this.renderer.context.drawingBufferHeight);i.style.width=this.width+"px";i.style.height=this.height+"px";i.width=this.width*r;i.height=this.height*r;this.camera.aspect=i.clientWidth/i.clientHeight;this.camera.updateProjectionMatrix();this.needsRender=!0;this.dispatchEvent({type:"resize"});this.config.debug&&(this.config.debug("box:  "+i.clientWidth+"x"+i.clientHeight),this.config.debug("canvas: "+i.width+"x"+i.height),this.config.debug("viewport:  "+this.renderer.context.drawingBufferWidth+"x"+this.renderer.context.drawingBufferHeight))};d.prototype.resetSize=function(){var n=this.renderer.domElement,t=n.parentNode,i;t.removeChild(n);i=t.getBoundingClientRect();t.appendChild(n);this.setSize(i.width,i.height)};d.prototype.render=function(){(n=this.camera).lookAt.apply(n,this.config.cameraTarget);this.renderer.render(this.scene,this.camera);this.needsRender=!1;var n};d.prototype.exportImage=function(){var n=this.renderer.domElement;return this.render(),n&&n.toDataURL("image/png")};d.prototype.animate=function(){this.config.animate&&(this._animationRequest=requestAnimationFrame(this.animate));this.needsRender&&this.render()};d.prototype.kill=function(){this.config.animate=!1;this._animationRequest&&(cancelAnimationFrame(this._animationRequest),this._animationRequest=null)};d.prototype.loadObject=function(n,t){var i=this;return t===void 0&&(t=uit()),new Promise(function(r,u){t.load(n,function(n){i.addObject(n,!0);r(n)},null,function(t){return u((t.statusText||"Scene load error")+"("+n+")")})})};d.prototype.addObject=function(n,t){var i=this,r;t===void 0&&(t=!1);r=this.isVisible;t&&n.traverse(function(n){i.objects.push(n);i.setObjectVisible(n,r)});this.scene.add(n);this.needsRender=!0};d.prototype.removeObject=function(n){this.scene.remove(n);this.needsRender=!0};d.prototype.setObjectVisible=function(n,t){if(n instanceof wf){var i=t?new vt:this._transparentMaterial;n.traverse(function(n){n instanceof tt&&n.material!==i&&(n.material=i,n.geometry.buffersNeedUpdate=!0,n.geometry.uvsNeedUpdate=!0)});this.needsRender=!0}};d.prototype.setVisible=function(n){var r=this,t,i;n||this._transparentMaterial||(t=document.createElement("canvas"),i=64,t.width=i,t.height=i,this._transparentMaterial=new ht({map:new b(t)}));this.objects.forEach(function(t){return r.setObjectVisible(t,n)});this.renderer.setClearColor(this.config.backgroundColor,n);this.isVisible=n;this.needsRender=!0};d.prototype.getIntersectionsAtCanvasPoint=function(n){return this._mouse.x=n.x,this._mouse.y=n.y,this.convertXYCanvasToLocal(this._mouse),this._raycaster.setFromCamera(this._mouse,this.camera),this._raycaster.intersectObjects(this.objects)};d.prototype.convertXYGenericToCanvas=function(n){var i=this.config,r=i.maxWidth/i.maxHeight,t=this.height*r*rv,u=this.width*rv-t;n.x=n.x*t+t+u;n.y*=this.height};d.prototype.convertXYCanvasToGeneric=function(n){var t=this.config.xyPrecision,r=this.config.maxWidth/this.config.maxHeight,i=this.height*r,u=(this.width-i)*rv,f=((n.x-u)/i*bh-1).toFixed(t);n.x=f;n.y=(n.y/this.height).toFixed(t)};d.prototype.convertXYCanvasToLocal=function(n){var t=this.config.xyPrecision;n.x=(n.x/this.width*bh-1).toFixed(t);n.y=(-(n.y/this.height)*bh+1).toFixed(t)};kh.prototype.setConfig=function(n){this.config=Object.assign(this.config||{},n)};kh.prototype.set=function(n,t){var i=this;return n?t?dw(t).then(function(t){var r=n.box.renderer.domElement.parentNode.style;r.backgroundPositionX="50%";r.backgroundRepeat="no-repeat";r.backgroundSize="auto 100%";r.backgroundImage="url('"+t.src+"')";n.box.setVisible(!1);i.config.debug&&i.config.debug("Added background image: "+t.src)}):this.remove(n):Promise.reject(new Error("Widget missing"))};kh.prototype.remove=function(n){return n?(n.box.renderer.domElement.parentNode.style.backgroundImage="none",n.box.setVisible(!0),this.config.debug&&this.config.debug("Removed background image"),Promise.resolve()):Promise.reject(new Error("Widget missing"))};dh.prototype=Object.create(u.prototype);dh.prototype.constructor=dh;gh.prototype.clone=function(){return new gh(this.position.clone(),this.normal.clone())};Array.isArray||(Array.isArray=function(n){return Object.prototype.toString.call(n)==="[object Array]"});var trt=Array.isArray,irt=255,rrt=4,urt=7,gw=[[236,136,227,.8],"#2945c1",8082911,[100,191,229,.8],[218,73,177,.8]];ut.prototype.setConfig=function(n){this.config=Object.assign(this.config||{dotMinSize:rrt,dotMaxSize:urt,dotColorTable:gw},n);this.setColorTable(this.config.dotColorTable)};ut.prototype.setColorTable=function(n){n===void 0&&(n=gw);this.colorTable=n.map(frt)};ut.prototype.randomDotSize=function(){return Math.max(Math.floor(Math.random()*this.config.dotMaxSize),this.config.dotMinSize)};ut.prototype.randomDotColorIndex=function(){return Math.floor(Math.random()*this.colorTable.length)};ut.prototype.colorAtIndex=function(n){return this.colorTable[n]};ut.prototype.addDot=function(n){this.dots.push(n);this.onDotAdded(n)};ut.prototype.countDots=function(n){return n?n.length:this.dots.length};ut.prototype.selectDots=function(n){return n?this.dots.filter(n):this.dots.slice()};ut.prototype.removeDots=function(n){var i=this,r=n||this.selectDots(),t=Date.now();r.forEach(function(n){i.onDotRemoved(n);n[t]=!0});this.dots=this.dots.filter(function(n){return!n[t]})};ut.prototype.removeDot=function(n){var t=Date.now();this.onDotRemoved(n);n[t]=!0;this.dots=this.dots.filter(function(n){return!n[t]})};ut.prototype.onDotRemoved=function(n){return n};ut.prototype.onDotAdded=function(n){return n};var ort="assets/dot.png",srt=4473924,nb=30,hrt=-4;Object.assign(uo.prototype,ut.prototype);uo.prototype.setConfig=function(n){ut.prototype.setConfig.call(this,Object.assign(this.config||{textureURL:ort,dotShininess:nb},n))};uo.prototype.onDotRemoved=function(n){n.widget&&n.obj&&n.widget.removeObject(n.obj);n.obj=null};uo.prototype.paint=function(n,t,i,r){var o,u,s,f,h,c,e;return(i===void 0&&(i=this.randomDotColorIndex()),r===void 0&&(r=this.randomDotSize()),this._mouseHelper||(this._mouseHelper=new tt(new lf(1,1,1),new er),this._mouseHelper.visible=!1,n.scene.add(this._mouseHelper)),o=n.getIntersectionsAtCanvasPoint(t),o.length<1)?Promise.resolve():(u=o[0],s=u.point,this._mouseHelper.position.copy(s),this._intersection.point.copy(s),f=u.face.normal.clone(),f.transformDirection(u.object.matrixWorld),f.multiplyScalar(r),f.add(u.point),this._intersection.normal.copy(u.face.normal),this._mouseHelper.lookAt(f),this._position.copy(this._intersection.point),this._orientation.copy(this._mouseHelper.rotation),h=this.decalMaterial.clone(),h.color.set(this.colorAtIndex(i)),this._size.set(r,r,r),c=new tt(new dh(u.object,this._position,this._orientation,this._size),h),n.addObject(c),e={widget:n,obj:c,x:t.x,y:t.y,colorIndex:i,size:r},n.convertXYCanvasToGeneric(e),this.addDot(e),Promise.resolve(e))};var tb=1e3,art=2e3,nc=10;Object.assign(fo.prototype,bt.prototype);fo.prototype.open=function(n){var t=this;return n===void 0&&(n=this.url),this.close(),this.socket=null,this.ready=new Promise(function(i,r){n||r(new Error("URL is missing"));var u=new WebSocket(n);u.addEventListener("open",function(){t.config.debug&&t.config.debug("WebSocket: "+(t.retries<nc?"reconnected":"connected"));t.socket=u;t.url=n;t.retries=nc;i(u)});u.addEventListener("message",function(n){var i;try{i=JSON.parse(n.data);i.type=i.t}catch(r){t.config.debug&&t.config.debug(r);return}t.dispatchEvent(i)});u.addEventListener("close",function(i){if(!i.isTrusted||i.code===tb){t.close();return}if(window&&navigator&&!navigator.onLine){t.close();t.config.debug&&t.config.debug("WebSocket: Navigator offline, waiting for online to reconnect...");window.addEventListener("online",function(){return t.open(n)},{capture:!1,once:!0,passive:!0});return}if(t.retries-=1,t.retries<1){t.close();t.config.debug&&t.config.debug("WebSocket: Reconnecting failed");return}var r=art*(nc-t.retries);t.config.debug&&t.config.debug("WebSocket: Reconnecting websocket in "+r+" milliseconds...");setTimeout(function(){return t.open(n)},r)});u.addEventListener("error",function(i){if(!t.socket){r(i);return}t.config.debug&&t.config.debug("WebSocket: Error: "+n+" "+i.message,i)})}),this.ready.catch(function(i){return t.config.debug&&t.config.debug("WebSocket: Error: "+n+" "+i,i)})};fo.prototype.close=function(){this.socket&&this.socket.readyState!==WebSocket.CLOSED&&this.socket.readyState!==WebSocket.CLOSING&&this.socket.close(tb,"bye");this.socket=null;this.ready=Promise.resolve(null)};fo.prototype.send=function(n){return this.ready?this.ready.then(function(t){if(!t)return Promise.reject(new Error("WebSocket: Error: Socket does not exist"));var i=Object.assign({t:n.type},n);delete i.type;try{t.send(JSON.stringify(i))}catch(r){return Promise.reject("WebSocket: Error: "+r.message,r)}return Promise.resolve()}):Promise.reject(new Error("WebSocket: Error: Cannot send when not ready"))};uv=.2;tc.prototype.attachToWidget=function(n,t,i,r){r===void 0&&(r=uv);this.x=t;this.y=i;this.h=r;this._onWidgetResize&&n.removeEventListener("resize",this._onWidgetResize);this.setWithin(n);this._onWidgetResize=this.setWithin.bind(this,n);n.addEventListener("resize",this._onWidgetResize);var u=n.renderer.domElement,f=u&&u.parentNode;f&&f.appendChild(this.img)};tc.prototype.detachFromWidget=function(n){this._onWidgetResize&&(n.removeEventListener("resize",this._onWidgetResize),this._onWidgetResize=null);this.img.parentNode!==null&&this.img.parentNode.removeChild(this.img)};tc.prototype.setWithin=function(n){var u=n.renderer.domElement,t=this.img,i,r;t.height=u.clientHeight*this.h;t.width=this.img.naturalWidth/this.img.naturalHeight*t.height;i={x:this.x,y:this.y};n.convertXYGenericToCanvas(i);r=t.style;r.top=i.y+"px";r.left=i.x+"px"};ib=.005;yr.prototype.check=function(){if(this.wait<1)return!0;var n=Date.now();return n<this._next?this._next-n:(this.set(this.wait),0)};yr.prototype.set=function(n){this._next=Date.now()+n;this._wait=n===undefined?this.wait:n;this._onWidgetResize&&!this._timer&&(this._timer=setInterval(this.update.bind(this),500))};yr.prototype.attachToWidget=function(n,t){t===void 0&&(t=ib);this.h=t;this._onWidgetResize&&n.removeEventListener("resize",this._onWidgetResize);this.setWithin(n);this._onWidgetResize=this.setWithin.bind(this,n);n.addEventListener("resize",this._onWidgetResize);var i=n.renderer.domElement,r=i&&i.parentNode;r&&r.appendChild(this.domElement)};yr.prototype.detachFromWidget=function(n){this._onWidgetResize&&(n.removeEventListener("resize",this._onWidgetResize),this._onWidgetResize=null);this.domElement.parentNode!==null&&this.domElement.parentNode.removeChild(this.domElement)};yr.prototype.setWithin=function(n){var r=n.renderer.domElement,t=this.domElement,i=Math.max(Math.round(r.clientHeight*this.h),1)+"px";t.style.height!==i&&(t.style.height=i);this.update()};yr.prototype.update=function(){var n=this._next-Date.now(),t=n>0?Math.min((n/this._wait).toFixed(1),1):0;this.domElement.style.transform="scale("+t+", 1)";n<=0&&(clearInterval(this._timer),this._timer=null)};var drt=200,grt=200,nut=60,tut=5e3,rb=window.pageXOffset!==undefined,ub=(document.compatMode||"")==="CSS1Compat";return Object.assign(ei.prototype,bt.prototype),ei.prototype.setConfig=function(n){var t=this.config;this.config=Object.assign(this.config||{debug:console.log.bind(console),targetSelector:"body",wsServerURL:rut(document.location),onResizeDelay:drt,onTotalDelay:grt,onDotDelay:nut,backgroundURL:null,sceneURL:null,dotURL:null,dotResync:0,dotThrottle:tut},n);this.box&&this.box.setConfig(n);this.painter&&this.painter.setConfig(n);t&&(this.setDotLimiter(this.config),this.setMessenger(this.config),this.setPackshot(this.config))},ei.prototype.setBox=function(n){var r=this,i,t;return this._onWindowResize&&window.removeEventListener("resize",this._onWindowResize),this._onBoxResize&&this.box.removeEventListener("resize",this._onBoxResize),i=document.querySelector&&document.querySelector(n.targetSelector),this.box=i&&git(i,n),this._onBoxResize=this.dispatchEvent.bind(this),this.box.addEventListener("resize",this._onBoxResize),this._onWindowResize=wrt(this.box.resetSize.bind(this.box),n.onResizeDelay),window.addEventListener("resize",this._onWindowResize,{capture:!0,passive:!0}),t=[],this.background=nrt(n),n.backgroundURL&&t.push(this.background.set(this,n.backgroundURL)),n.sceneURL&&t.push(this.box.loadObject(n.sceneURL)),Promise.all(t).then(function(){return r.box})},ei.prototype.setPainter=function(n){this.painter=crt(n);var t=this.box&&this.box.renderer.domElement;return t?(this._onClick||(this._onClick=uut.bind(this),t.addEventListener("click",this._onClick,!1)),this._onMultiClick||(this._onMultiClick=fut.bind(this),t.addEventListener("mousedown",this._onMultiClick,!0)),this.painter.ready):Promise.reject(new Error("Could not initialize painter: box is missing"))},ei.prototype.setDotLimiter=function(n){this.dotLimiter&&(this.dotLimiter.detachFromWidget(this),this.dotLimiter=null);this.dotLimiter=prt({wait:n.dotThrottle});this.dotLimiter.attachToWidget(this.box)},ei.prototype.setMessenger=function(n){var t=this,i,r;return n.wsServerURL?(this.messenger&&this.messenger.close(),i=lrt(null,n),this.messenger=i,this.waitingForSync=!1,i.addEventListener("dot:error",function(n){var i=t._unconfirmedDots.shift(),r;t.painter.removeDot(i);t.config.debug&&t.config.debug("Dot error",n,i);r=n.w||t.config.dotThrottle;t.dotLimiter.set(r);t.dispatchEvent(n)}),i.addEventListener("dot:ok",function(n){var r=t._unconfirmedDots.shift(),i;r.total=n.d;i=n.w||t.config.dotThrottle;t.dotLimiter.set(i);t.dispatchEvent({type:"dot:success",total:n.d,wait:i});t.dotCounter()}),i.addEventListener("dot",function(n){t._lastDot=(t._lastDot||Promise.resolve()).then(function(){return t.ready.then(function(){return t.importDot(n)}).catch(function(n){return t.config.debug&&t.config.debug(n)}),new Promise(function(n){return setTimeout(n,t.config.onDotDelay)})})}),i.addEventListener("bg",function(n){var u=n.d||0,i,r;(t.config.backgroundURL!==n.v&&(i=t.background.set(t,n.v)),r=t.painter.selectDots(function(n){return n.total<=u}),r.length<1&&!i)||(i?i.then(function(){t.painter.removeDots(r)}):t.painter.removeDots(r),t.config.backgroundURL=n.v,t.dispatchEvent({type:"background",value:n.v,total:n.d}))}),i.addEventListener("config",function(n){var u=n.s&&n.s[0],f=n.s&&n.s[1],e=n.c,i=t.painter,r;i.setConfig({dotMinSize:u||i.config.dotMinSize,dotMaxSize:f||i.config.dotMaxSize,dotColorTable:e||i.config.dotColorTable});r=n.w||0;t.dotLimiter.set(r);t.dispatchEvent({type:"reconfigured",wait:r})}),i.addEventListener("total",function(n){t.dotCounter(n.v)}),i.addEventListener("sync",function(){t.waitingForSync=!1;t.dispatchEvent({type:"synchronized"})}),r=krt("config",i),i.open(n.wsServerURL).then(function(n){return r.then(function(){return n})})):Promise.resolve()},ei.prototype.setDotCounter=function(){var n=this;this.dotCounter=yrt(brt(function(t){(n.dispatchEvent({type:"total",value:t}),!n.config.dotResync||!n.painter||n.painter.countDots()<n.config.dotResync)||n.messenger&&n.messenger.ready&&!n.waitingForSync&&(n.config.debug&&n.config.debug("Requesting server for resynchronization"),n.waitingForSync=!0,n.messenger.send({t:"sync",d:t}).catch(function(t){if(n.config.debug)n.config.debug(t);else throw t;}))},this.config.onTotalDelay))},ei.prototype.setPackshot=function(n){var i=this,t;return(this.packshot&&(!n.packshot||n.packshot.url!==this.packshot.url)&&(this.packshot.detachFromWidget(this.box),this.packshot=null),!n.packshot)?Promise.resolve():n.packshot.url?(t=vrt(n.packshot.url),this.packshot=t,t.ready.then(function(){var r=n.packshot,u=r.x,f=r.y,e=r.h;t.attachToWidget(i.box,u,f,e)})):(this.config.debug&&this.config.debug(new Error("Packshot URL is missing")),Promise.resolve())},ei.prototype.importDot=function(n){var t=this;return this.box.convertXYGenericToCanvas(n),this.painter.ready.then(function(){return t.painter.paint(t.box,n,n.c,n.s)}).then(function(i){i&&(i.total=n.d,t._listeners&&t._listeners["dot:imported"]&&t.dispatchEvent({type:"dot:imported",total:n.d,dots:t.painter.countDots()}),n.n===1&&t.dotCounter())}).catch(function(n){return t.config.debug&&t.config.debug(n)})},iut});$(document).ready(function(){$(".hpm-september-form").append('<a class="icon-info" href="https://www.durex.hu/promo/magyaraacutezat/" target="_blank"><span class="glyphicon glyphicon-info-sign"><\/span><\/a>');$(document).on("mouseenter",".icon-info",function(){$(".cdc-tooltip").mouseenter()});setTimeout(function(){$(".sk-hpm-emoji-september-form .cdc-submit").val("Küldés")},1e3)});$(document).ready(function(){setTimeout(function(){var n=$(".no-crop-img img");n.length>0&&$(n).attr("src",function(n,t){return t.split("?")[0]})},2e3)});$(document).ready(function(){if($("body").hasClass("sk-durex-promotion-pages")){var n=$(".cdc-form-thank-you-group");$(".cdc-form-group--submit input").attr("value","Enviar");n.parent().parent().after(n);$("form").ajaxComplete(function(){$(".form > .row > .col-md-12 > .sk-grid-panel").addClass("hidden")})}}),function(){"use strict";var i=window.location.protocol+"//"+window.location.host,t,n;$(".sk-hpm-laponia, .sk-hpm-laponia-form").length>0&&(t=$(".hpm-bottom-content .sk-grid-image__image-holder img"),t&&(n=$(t).attr("src"),n=n.indexOf("?")>-1?n.substr(0,n.indexOf("?")):$(t).attr("src"),$(t).attr("src",n)),$(".sk-segment-footer").prepend($(".sk-container-regulatory")))}();$(document).ready(function(){var n=$("#cdc-form div.checkbox").add($("div.form-group > div")),t=n.children("label"),i=$("input:checkbox"),r=$("label > a");n.find(t).each(function(){$(this).children("input").prependTo($(this).parent(n))});n.find(i).each(function(){name=$(this).attr("name");$(this).attr("id",name);$(this).next("label").attr("for",name)})}),function(){$(".cdc-form-group-advanced-main").hasClass("hidden")&&$(".hpm-title-form").remove();$(".hpm-september-form").append('<a class="icon-info" href="https://www.durex.hu/promo/magyaraacutezat/" target="_blank"><span class="glyphicon glyphicon-info-sign"><\/span><\/a>');$(document).on("mouseenter",".icon-info",function(){$(".cdc-tooltip").mouseenter()});$(document).on("mouseout",".icon-info",function(){$(".cdc-tooltip").mouseout()});var n=$(".hpm-september-form .cdc-form-group");n.hasClass("hidden")&&$(".form-info, .form-information-mobile").css("display","none")}();$(document).ready(function(){setTimeout(function(){var n=$(".no-crop-img img");n.length>0&&$(n).attr("src",function(n,t){return t.split("?")[0]})},2e3)});!function(n,t){function h(n,t){return typeof n===t}function c(){var u,n,f,e,s,l,t,c;for(c in r)if(r.hasOwnProperty(c)){if(u=[],n=r[c],n.name&&(u.push(n.name.toLowerCase()),n.options&&n.options.aliases&&n.options.aliases.length))for(f=0;f<n.options.aliases.length;f++)u.push(n.options.aliases[f].toLowerCase());for(e=h(n.fn,"function")?n.fn():n.fn,s=0;s<u.length;s++)l=u[s],t=l.split("."),1===t.length?i[t[0]]=e:(!i[t[0]]||i[t[0]]instanceof Boolean||(i[t[0]]=new Boolean(i[t[0]])),i[t[0]][t[1]]=e),o.push((e?"":"no-")+t.join("-"))}}function l(n){var t=u.className,r=i._config.classPrefix||"",f;(s&&(t=t.baseVal),i._config.enableJSClass)&&(f=new RegExp("(^|\\s)"+r+"no-js(\\s|$)"),t=t.replace(f,"$1"+r+"js$2"));i._config.enableClasses&&(t+=" "+r+n.join(" "+r),s?u.className.baseVal=t:u.className=t)}var r=[],e={_version:"3.5.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(n,t){var i=this;setTimeout(function(){t(i[n])},0)},addTest:function(n,t,i){r.push({name:n,fn:t,options:i})},addAsyncTest:function(n){r.push({name:null,fn:n})}},i=function(){},f;i.prototype=e;i=new i;var o=[],u=t.documentElement,s="svg"===u.nodeName.toLowerCase();for(i.addTest("localstorage",function(){var n="modernizr";try{return localStorage.setItem(n,n),localStorage.removeItem(n),!0}catch(t){return!1}}),c(),l(o),delete e.addTest,delete e.addAsyncTest,f=0;f<i._q.length;f++)i._q[f]();n.Modernizr=i}(window,document),function(){var n=$(".no-crop-img img");n.length>0&&$(n).attr("src",function(n,t){return t.split("?")[0]})}(),function(){$(" .sk-country-mx img").addClass("no-crop-img")}(),function(n){for(var r=document.querySelectorAll(".no-crop-img"),i,t=0;t<r.length;t++)i=n(r[t]).attr("src"),i=i.indexOf("?")>-1?i.substr(0,i.indexOf("?")):n(r[t]).attr("src"),n(r[t]).attr("src",i)}(this.jQuery),function(){".sk-hpm-emoji-adaptacion"&&$('link[href="/css/CmsPlugins/RB-StarterKit/themes/durexsk/styles-blessed1.css?bundleVirtualPath=%7e%2fcssbundles%2fdurexsk-styles-blessed1.css%2f"]').prop("disabled",!0)}();$(".sk-grid-content").insertBefore($(".clp-page")),function(){"use strict";function s(){var t=parseInt(window.getComputedStyle(i).width,10),n=t*h;r.style.width=t+"px";r.style.height=n+"px";$(window).width()<768?(i.style.height="72vw",r.style.height=n+"px"):(i.style.height="56vw",r.style.height=n-135+"px")}var f=document.createElement("script"),t,n,e,u,o;f.type="text/javascript";f.src="http://www.youtube.com/player_api";document.getElementsByTagName("head")[0].appendChild(f);window.onload=function(){var n;(function(){n=new YT.Player("player",{playerVars:{autoplay:1,controls:0,autohide:1,wmode:"opaque",showinfo:0,loop:1,mute:0,rel:0,playlist:"Gg4oK7y7pys"},videoId:"Gg4oK7y7pys"})})()};$(".sk-durexofachristmascampaign").length>0&&(t=$(".christmas-section .sk-grid-image .sk-grid-image__image"),t.length>0&&(n=$(t).attr("src"),n=n.indexOf("?")>-1?n.substr(0,n.indexOf("?")):$(t).attr("src"),$(t).attr("src",n)));e=$(".sk-container-nav nav");$(".footer-style >.footer-links > a").clone().addClass("sk-segment-link").insertBefore(e);e.parent().find(".sk-segment-link img").removeAttr("style");var i=document.getElementById("embed_container"),r=document.getElementById("video"),h=9/16,u=$("#video").attr("src")+"?autoplay=1&amp;controls=0&amp;autohide=1&amp;wmode=opaque&amp;showinfo=0&amp;loop=1&amp;mute=0&amp;playlist=Gg4oK7y7pys&amp;enablejsapi=1&amp;origin=http%3A%2F%2Fdurexofa-dev-cs.hyperlab.pl&amp;widgetid=1&rel=0";$("#video").attr("src",u);u=$("embed#video").attr("src")+"?&amp;controls=0&amp;autohide=1&amp;wmode=opaque&amp;showinfo=0&amp;loop=1&amp;mute=0&amp;playlist=Gg4oK7y7pys&amp;enablejsapi=1&amp;origin=http%3A%2F%2Fdurexofa-dev-cs.hyperlab.pl&amp;widgetid=1&rel=0";$("embed#video").attr("src",u);i&&(window.addEventListener("resize",s,!1),s());$(document).ready(function(){$(".center").slick({centerMode:!0,centerPadding:"30px",slidesToShow:3,dots:!0,responsive:[{breakpoint:1008,settings:{slidesToShow:1,slidesToScroll:1}},{breakpoint:800,settings:{slidesToShow:1,slidesToScroll:1}}]});$(".center-one").slick({centerMode:!0,centerPadding:"30px",arrows:!0,slidesToShow:1,dots:!0,adaptiveHeight:!0});$(".one-time").slick({centerPadding:"30px",dots:!0,infinite:!0,speed:300,slidesToShow:1,arrows:!0,adaptiveHeight:!0})});$("#MenuButtonOur").click(function(){$(".menuadd").css({display:"block"})});$(document).mouseup(function(n){var t=$(".menuadd");t.has(n.target).length===0&&t.hide()});$(".menuadd").click(function(){$(".menuadd").css({display:"none"})});$(".men").click(function(){$(".menuadd").css({display:"none"})});$(".hanzola").click(function(){$(".menuadd").css({display:"none"})});$(".fess").click(function(){$(".menuadd").css({display:"none"})});$(".chalenge").click(function(){$("html, body").animate({scrollTop:$(".cha").offset().top},1e3);$(".menuadd").css({display:"none"})});$(".influ").click(function(){$("html, body").animate({scrollTop:$(".unidos").offset().top},1e3);$(".menuadd").css({display:"none"})});$(".excusas").click(function(){$("html, body").animate({scrollTop:$(".informate-ets").offset().top},1e3);$(".menuadd").css({display:"none"})});$(".LA").click(function(){$("html, body").animate({scrollTop:$(".rss").offset().top},1e3);$(".menuadd").css({display:"none"})});$("#rb-cookie-accept").click(function(){$("#rb-cookie-container").css({display:"none"})});!function(n,t,i,r,u,f,e){n.fbq||(u=n.fbq=function(){u.callMethod?u.callMethod.apply(u,arguments):u.queue.push(arguments)},n._fbq||(n._fbq=u),u.push=u,u.loaded=!0,u.version="2.0",u.queue=[],f=t.createElement(i),f.async=!0,f.src=r,e=t.getElementsByTagName(i)[0],e.parentNode.insertBefore(f,e))}(window,document,"script","https://connect.facebook.net/en_US/fbevents.js");fbq("init","367160137048986");fbq("track","PageView");window.addEventListener("load",function(){function i(n){var t=document.createElement("div"),i=document.createElement("a"),r=document.querySelector("#CouponPopup"),u;t.classList?t.classList.add("popup-wrapper"):t.className+=" popup-wrapper";i.classList?i.classList.add("popup-close"):i.className+=" popup-close";i.innerHTML="X";t.appendChild(i);n&&(t.classList?t.classList.add("show"):t.className+=" show");r&&(u=r.cloneNode(!0),t.appendChild(u),document.body.appendChild(t),i.addEventListener("click",function(){t.classList?t.classList.remove("show"):t.className=el.className.replace(new RegExp("(^|\\b)"+className.split(" ").join("|")+"(\\b|$)","gi")," ")}))}typeof Promise=="undefined"&&document.write('<script src="//cdn.jsdelivr.net/bluebird/3.5.0/bluebird.min.js"><\/script>');var t=document.querySelector(".sk-durexofafulldots")?"/css/CmsPlugins/RB-StarterKit/themes/durexsk/":"",n=dotPaintWidget({debug:window.location.hash.indexOf("alert")>=0?window.alert.bind(window):console.log.bind(console),animate:!0,targetSelector:"#dotPaintWidget",ambientColor:6710886,backgroundColor:16777215,backgroundURL:t+"assets/rendered-0.png",sceneURL:t+"assets/bedroom.obj",packshot:{url:t+"assets/packshot.png",x:-.14,y:.355,h:.13},maxWidth:3200,maxHeight:660,cameraPosition:[250,180,250],cameraTarget:[-100,30,0],lights:[{color:16777215,alpha:.4,position:[50,200,300]},{color:16777215,alpha:.5,position:[400,400,-100]}],dotURL:t+"assets/dot.png",dotShininess:30,dotThrottle:5e3,dotResync:5});i(!0);n.addEventListener("dot:error",function(n){console.error("Could not add dot:",n.message)});n.addEventListener("dot:success",function(n){console.log("Dot added!");console.log("Next dot available in "+n.wait+" milliseconds")});n.addEventListener("dot:limit",function(n){console.log("Dot could not be added. Please wait "+n.wait+" milliseconds before trying again")});n.addEventListener("reconfigured",function(n){console.log("Updated configuration from the server");console.log("Next dot available in "+n.wait+" milliseconds")});n.addEventListener("total",function(n){console.log("Total dots:",n.value)});n.addEventListener("background",function(n){console.log("New background:",n.value)});n.addEventListener("synchronized",function(){console.log("Synchronized with server")});n.ready.then(function(){console.log("widget is ready")}).catch(function(n){console.error(n)});window.dotPaintWidget=n});$(".hpm-article-lips").insertBefore(".video-container");o=$(".no-crop-img img");o.length>0&&$(o).attr("src",function(n,t){return t.split("?")[0]})}(),function(n){"use strict";typeof define=="function"&&define.amd?define(["jquery"],n):typeof exports!="undefined"?module.exports=n(require("jquery")):n(jQuery)}(function(n){"use strict";var t=window.Slick||{};t=function(){function i(i,r){var u=this,f;u.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:n(i),appendDots:n(i),arrows:!0,asNavFor:null,prevArrow:'<button type="button" data-role="none" class="slick-prev" aria-label="Previous" tabindex="0" role="button">Previous<\/button>',nextArrow:'<button type="button" data-role="none" class="slick-next" aria-label="Next" tabindex="0" role="button">Next<\/button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(t,i){return n('<button type="button" data-role="none" role="button" tabindex="0" />').text(i+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3};u.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1};n.extend(u,u.initials);u.activeBreakpoint=null;u.animType=null;u.animProp=null;u.breakpoints=[];u.breakpointSettings=[];u.cssTransitions=!1;u.focussed=!1;u.interrupted=!1;u.hidden="hidden";u.paused=!0;u.positionProp=null;u.respondTo=null;u.rowCount=1;u.shouldClick=!0;u.$slider=n(i);u.$slidesCache=null;u.transformType=null;u.transitionType=null;u.visibilityChange="visibilitychange";u.windowWidth=0;u.windowTimer=null;f=n(i).data("slick")||{};u.options=n.extend({},u.defaults,r,f);u.currentSlide=u.options.initialSlide;u.originalSettings=u.options;typeof document.mozHidden!="undefined"?(u.hidden="mozHidden",u.visibilityChange="mozvisibilitychange"):typeof document.webkitHidden!="undefined"&&(u.hidden="webkitHidden",u.visibilityChange="webkitvisibilitychange");u.autoPlay=n.proxy(u.autoPlay,u);u.autoPlayClear=n.proxy(u.autoPlayClear,u);u.autoPlayIterator=n.proxy(u.autoPlayIterator,u);u.changeSlide=n.proxy(u.changeSlide,u);u.clickHandler=n.proxy(u.clickHandler,u);u.selectHandler=n.proxy(u.selectHandler,u);u.setPosition=n.proxy(u.setPosition,u);u.swipeHandler=n.proxy(u.swipeHandler,u);u.dragHandler=n.proxy(u.dragHandler,u);u.keyHandler=n.proxy(u.keyHandler,u);u.instanceUid=t++;u.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/;u.registerBreakpoints();u.init(!0)}var t=0;return i}();t.prototype.activateADA=function(){var n=this;n.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})};t.prototype.addSlide=t.prototype.slickAdd=function(t,i,r){var u=this;if(typeof i=="boolean")r=i,i=null;else if(i<0||i>=u.slideCount)return!1;u.unload();typeof i=="number"?i===0&&u.$slides.length===0?n(t).appendTo(u.$slideTrack):r?n(t).insertBefore(u.$slides.eq(i)):n(t).insertAfter(u.$slides.eq(i)):r===!0?n(t).prependTo(u.$slideTrack):n(t).appendTo(u.$slideTrack);u.$slides=u.$slideTrack.children(this.options.slide);u.$slideTrack.children(this.options.slide).detach();u.$slideTrack.append(u.$slides);u.$slides.each(function(t,i){n(i).attr("data-slick-index",t)});u.$slidesCache=u.$slides;u.reinit()};t.prototype.animateHeight=function(){var n=this,t;n.options.slidesToShow===1&&n.options.adaptiveHeight===!0&&n.options.vertical===!1&&(t=n.$slides.eq(n.currentSlide).outerHeight(!0),n.$list.animate({height:t},n.options.speed))};t.prototype.animateSlide=function(t,i){var u={},r=this;r.animateHeight();r.options.rtl===!0&&r.options.vertical===!1&&(t=-t);r.transformsEnabled===!1?r.options.vertical===!1?r.$slideTrack.animate({left:t},r.options.speed,r.options.easing,i):r.$slideTrack.animate({top:t},r.options.speed,r.options.easing,i):r.cssTransitions===!1?(r.options.rtl===!0&&(r.currentLeft=-r.currentLeft),n({animStart:r.currentLeft}).animate({animStart:t},{duration:r.options.speed,easing:r.options.easing,step:function(n){n=Math.ceil(n);r.options.vertical===!1?(u[r.animType]="translate("+n+"px, 0px)",r.$slideTrack.css(u)):(u[r.animType]="translate(0px,"+n+"px)",r.$slideTrack.css(u))},complete:function(){i&&i.call()}})):(r.applyTransition(),t=Math.ceil(t),u[r.animType]=r.options.vertical===!1?"translate3d("+t+"px, 0px, 0px)":"translate3d(0px,"+t+"px, 0px)",r.$slideTrack.css(u),i&&setTimeout(function(){r.disableTransition();i.call()},r.options.speed))};t.prototype.getNavTarget=function(){var i=this,t=i.options.asNavFor;return t&&t!==null&&(t=n(t).not(i.$slider)),t};t.prototype.asNavFor=function(t){var r=this,i=r.getNavTarget();i!==null&&typeof i=="object"&&i.each(function(){var i=n(this).slick("getSlick");i.unslicked||i.slideHandler(t,!0)})};t.prototype.applyTransition=function(n){var t=this,i={};i[t.transitionType]=t.options.fade===!1?t.transformType+" "+t.options.speed+"ms "+t.options.cssEase:"opacity "+t.options.speed+"ms "+t.options.cssEase;t.options.fade===!1?t.$slideTrack.css(i):t.$slides.eq(n).css(i)};t.prototype.autoPlay=function(){var n=this;n.autoPlayClear();n.slideCount>n.options.slidesToShow&&(n.autoPlayTimer=setInterval(n.autoPlayIterator,n.options.autoplaySpeed))};t.prototype.autoPlayClear=function(){var n=this;n.autoPlayTimer&&clearInterval(n.autoPlayTimer)};t.prototype.autoPlayIterator=function(){var n=this,t=n.currentSlide+n.options.slidesToScroll;n.paused||n.interrupted||n.focussed||(n.options.infinite===!1&&(n.direction===1&&n.currentSlide+1===n.slideCount-1?n.direction=0:n.direction===0&&(t=n.currentSlide-n.options.slidesToScroll,n.currentSlide-1==0&&(n.direction=1))),n.slideHandler(t))};t.prototype.buildArrows=function(){var t=this;t.options.arrows===!0&&(t.$prevArrow=n(t.options.prevArrow).addClass("slick-arrow"),t.$nextArrow=n(t.options.nextArrow).addClass("slick-arrow"),t.slideCount>t.options.slidesToShow?(t.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),t.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.prependTo(t.options.appendArrows),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.appendTo(t.options.appendArrows),t.options.infinite!==!0&&t.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):t.$prevArrow.add(t.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))};t.prototype.buildDots=function(){var t=this,i,r;if(t.options.dots===!0&&t.slideCount>t.options.slidesToShow){for(t.$slider.addClass("slick-dotted"),r=n("<ul />").addClass(t.options.dotsClass),i=0;i<=t.getDotCount();i+=1)r.append(n("<li />").append(t.options.customPaging.call(this,t,i)));t.$dots=r.appendTo(t.options.appendDots);t.$dots.find("li").first().addClass("slick-active").attr("aria-hidden","false")}};t.prototype.buildOut=function(){var t=this;t.$slides=t.$slider.children(t.options.slide+":not(.slick-cloned)").addClass("slick-slide");t.slideCount=t.$slides.length;t.$slides.each(function(t,i){n(i).attr("data-slick-index",t).data("originalStyling",n(i).attr("style")||"")});t.$slider.addClass("slick-slider");t.$slideTrack=t.slideCount===0?n('<div class="slick-track"/>').appendTo(t.$slider):t.$slides.wrapAll('<div class="slick-track"/>').parent();t.$list=t.$slideTrack.wrap('<div aria-live="polite" class="slick-list"/>').parent();t.$slideTrack.css("opacity",0);(t.options.centerMode===!0||t.options.swipeToSlide===!0)&&(t.options.slidesToScroll=1);n("img[data-lazy]",t.$slider).not("[src]").addClass("slick-loading");t.setupInfinite();t.buildArrows();t.buildDots();t.updateDots();t.setSlideClasses(typeof t.currentSlide=="number"?t.currentSlide:0);t.options.draggable===!0&&t.$list.addClass("draggable")};t.prototype.buildRows=function(){var n=this,t,i,r,f,c,u,e,o,s,h;if(f=document.createDocumentFragment(),u=n.$slider.children(),n.options.rows>1){for(e=n.options.slidesPerRow*n.options.rows,c=Math.ceil(u.length/e),t=0;t<c;t++){for(o=document.createElement("div"),i=0;i<n.options.rows;i++){for(s=document.createElement("div"),r=0;r<n.options.slidesPerRow;r++)h=t*e+(i*n.options.slidesPerRow+r),u.get(h)&&s.appendChild(u.get(h));o.appendChild(s)}f.appendChild(o)}n.$slider.empty().append(f);n.$slider.children().children().children().css({width:100/n.options.slidesPerRow+"%",display:"inline-block"})}};t.prototype.checkResponsive=function(t,i){var r=this,f,u,e,o=!1,s=r.$slider.width(),h=window.innerWidth||n(window).width();if(r.respondTo==="window"?e=h:r.respondTo==="slider"?e=s:r.respondTo==="min"&&(e=Math.min(h,s)),r.options.responsive&&r.options.responsive.length&&r.options.responsive!==null){u=null;for(f in r.breakpoints)r.breakpoints.hasOwnProperty(f)&&(r.originalSettings.mobileFirst===!1?e<r.breakpoints[f]&&(u=r.breakpoints[f]):e>r.breakpoints[f]&&(u=r.breakpoints[f]));u!==null?r.activeBreakpoint!==null?(u!==r.activeBreakpoint||i)&&(r.activeBreakpoint=u,r.breakpointSettings[u]==="unslick"?r.unslick(u):(r.options=n.extend({},r.originalSettings,r.breakpointSettings[u]),t===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(t)),o=u):(r.activeBreakpoint=u,r.breakpointSettings[u]==="unslick"?r.unslick(u):(r.options=n.extend({},r.originalSettings,r.breakpointSettings[u]),t===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(t)),o=u):r.activeBreakpoint!==null&&(r.activeBreakpoint=null,r.options=r.originalSettings,t===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(t),o=u);t||o===!1||r.$slider.trigger("breakpoint",[r,o])}};t.prototype.changeSlide=function(t,i){var r=this,u=n(t.currentTarget),f,e,o,s;u.is("a")&&t.preventDefault();u.is("li")||(u=u.closest("li"));o=r.slideCount%r.options.slidesToScroll!=0;f=o?0:(r.slideCount-r.currentSlide)%r.options.slidesToScroll;switch(t.data.message){case"previous":e=f===0?r.options.slidesToScroll:r.options.slidesToShow-f;r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide-e,!1,i);break;case"next":e=f===0?r.options.slidesToScroll:f;r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide+e,!1,i);break;case"index":s=t.data.index===0?0:t.data.index||u.index()*r.options.slidesToScroll;r.slideHandler(r.checkNavigable(s),!1,i);u.children().trigger("focus");break;default:return}};t.prototype.checkNavigable=function(n){var u=this,t,i,r;if(t=u.getNavigableIndexes(),i=0,n>t[t.length-1])n=t[t.length-1];else for(r in t){if(n<t[r]){n=i;break}i=t[r]}return n};t.prototype.cleanUpEvents=function(){var t=this;t.options.dots&&t.$dots!==null&&n("li",t.$dots).off("click.slick",t.changeSlide).off("mouseenter.slick",n.proxy(t.interrupt,t,!0)).off("mouseleave.slick",n.proxy(t.interrupt,t,!1));t.$slider.off("focus.slick blur.slick");t.options.arrows===!0&&t.slideCount>t.options.slidesToShow&&(t.$prevArrow&&t.$prevArrow.off("click.slick",t.changeSlide),t.$nextArrow&&t.$nextArrow.off("click.slick",t.changeSlide));t.$list.off("touchstart.slick mousedown.slick",t.swipeHandler);t.$list.off("touchmove.slick mousemove.slick",t.swipeHandler);t.$list.off("touchend.slick mouseup.slick",t.swipeHandler);t.$list.off("touchcancel.slick mouseleave.slick",t.swipeHandler);t.$list.off("click.slick",t.clickHandler);n(document).off(t.visibilityChange,t.visibility);t.cleanUpSlideEvents();t.options.accessibility===!0&&t.$list.off("keydown.slick",t.keyHandler);t.options.focusOnSelect===!0&&n(t.$slideTrack).children().off("click.slick",t.selectHandler);n(window).off("orientationchange.slick.slick-"+t.instanceUid,t.orientationChange);n(window).off("resize.slick.slick-"+t.instanceUid,t.resize);n("[draggable!=true]",t.$slideTrack).off("dragstart",t.preventDefault);n(window).off("load.slick.slick-"+t.instanceUid,t.setPosition);n(document).off("ready.slick.slick-"+t.instanceUid,t.setPosition)};t.prototype.cleanUpSlideEvents=function(){var t=this;t.$list.off("mouseenter.slick",n.proxy(t.interrupt,t,!0));t.$list.off("mouseleave.slick",n.proxy(t.interrupt,t,!1))};t.prototype.cleanUpRows=function(){var n=this,t;n.options.rows>1&&(t=n.$slides.children().children(),t.removeAttr("style"),n.$slider.empty().append(t))};t.prototype.clickHandler=function(n){var t=this;t.shouldClick===!1&&(n.stopImmediatePropagation(),n.stopPropagation(),n.preventDefault())};t.prototype.destroy=function(t){var i=this;i.autoPlayClear();i.touchObject={};i.cleanUpEvents();n(".slick-cloned",i.$slider).detach();i.$dots&&i.$dots.remove();i.$prevArrow&&i.$prevArrow.length&&(i.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),i.htmlExpr.test(i.options.prevArrow)&&i.$prevArrow.remove());i.$nextArrow&&i.$nextArrow.length&&(i.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),i.htmlExpr.test(i.options.nextArrow)&&i.$nextArrow.remove());i.$slides&&(i.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){n(this).attr("style",n(this).data("originalStyling"))}),i.$slideTrack.children(this.options.slide).detach(),i.$slideTrack.detach(),i.$list.detach(),i.$slider.append(i.$slides));i.cleanUpRows();i.$slider.removeClass("slick-slider");i.$slider.removeClass("slick-initialized");i.$slider.removeClass("slick-dotted");i.unslicked=!0;t||i.$slider.trigger("destroy",[i])};t.prototype.disableTransition=function(n){var t=this,i={};i[t.transitionType]="";t.options.fade===!1?t.$slideTrack.css(i):t.$slides.eq(n).css(i)};t.prototype.fadeSlide=function(n,t){var i=this;i.cssTransitions===!1?(i.$slides.eq(n).css({zIndex:i.options.zIndex}),i.$slides.eq(n).animate({opacity:1},i.options.speed,i.options.easing,t)):(i.applyTransition(n),i.$slides.eq(n).css({opacity:1,zIndex:i.options.zIndex}),t&&setTimeout(function(){i.disableTransition(n);t.call()},i.options.speed))};t.prototype.fadeSlideOut=function(n){var t=this;t.cssTransitions===!1?t.$slides.eq(n).animate({opacity:0,zIndex:t.options.zIndex-2},t.options.speed,t.options.easing):(t.applyTransition(n),t.$slides.eq(n).css({opacity:0,zIndex:t.options.zIndex-2}))};t.prototype.filterSlides=t.prototype.slickFilter=function(n){var t=this;n!==null&&(t.$slidesCache=t.$slides,t.unload(),t.$slideTrack.children(this.options.slide).detach(),t.$slidesCache.filter(n).appendTo(t.$slideTrack),t.reinit())};t.prototype.focusHandler=function(){var t=this;t.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick","*:not(.slick-arrow)",function(i){i.stopImmediatePropagation();var r=n(this);setTimeout(function(){t.options.pauseOnFocus&&(t.focussed=r.is(":focus"),t.autoPlay())},0)})};t.prototype.getCurrent=t.prototype.slickCurrentSlide=function(){var n=this;return n.currentSlide};t.prototype.getDotCount=function(){var n=this,i=0,r=0,t=0;if(n.options.infinite===!0)while(i<n.slideCount)++t,i=r+n.options.slidesToScroll,r+=n.options.slidesToScroll<=n.options.slidesToShow?n.options.slidesToScroll:n.options.slidesToShow;else if(n.options.centerMode===!0)t=n.slideCount;else if(n.options.asNavFor)while(i<n.slideCount)++t,i=r+n.options.slidesToScroll,r+=n.options.slidesToScroll<=n.options.slidesToShow?n.options.slidesToScroll:n.options.slidesToShow;else t=1+Math.ceil((n.slideCount-n.options.slidesToShow)/n.options.slidesToScroll);return t-1};t.prototype.getLeft=function(n){var t=this,f,r,u=0,i;return t.slideOffset=0,r=t.$slides.first().outerHeight(!0),t.options.infinite===!0?(t.slideCount>t.options.slidesToShow&&(t.slideOffset=t.slideWidth*t.options.slidesToShow*-1,u=r*t.options.slidesToShow*-1),t.slideCount%t.options.slidesToScroll!=0&&n+t.options.slidesToScroll>t.slideCount&&t.slideCount>t.options.slidesToShow&&(n>t.slideCount?(t.slideOffset=(t.options.slidesToShow-(n-t.slideCount))*t.slideWidth*-1,u=(t.options.slidesToShow-(n-t.slideCount))*r*-1):(t.slideOffset=t.slideCount%t.options.slidesToScroll*t.slideWidth*-1,u=t.slideCount%t.options.slidesToScroll*r*-1))):n+t.options.slidesToShow>t.slideCount&&(t.slideOffset=(n+t.options.slidesToShow-t.slideCount)*t.slideWidth,u=(n+t.options.slidesToShow-t.slideCount)*r),t.slideCount<=t.options.slidesToShow&&(t.slideOffset=0,u=0),t.options.centerMode===!0&&t.options.infinite===!0?t.slideOffset+=t.slideWidth*Math.floor(t.options.slidesToShow/2)-t.slideWidth:t.options.centerMode===!0&&(t.slideOffset=0,t.slideOffset+=t.slideWidth*Math.floor(t.options.slidesToShow/2)),f=t.options.vertical===!1?n*t.slideWidth*-1+t.slideOffset:n*r*-1+u,t.options.variableWidth===!0&&(i=t.slideCount<=t.options.slidesToShow||t.options.infinite===!1?t.$slideTrack.children(".slick-slide").eq(n):t.$slideTrack.children(".slick-slide").eq(n+t.options.slidesToShow),f=t.options.rtl===!0?i[0]?(t.$slideTrack.width()-i[0].offsetLeft-i.width())*-1:0:i[0]?i[0].offsetLeft*-1:0,t.options.centerMode===!0&&(i=t.slideCount<=t.options.slidesToShow||t.options.infinite===!1?t.$slideTrack.children(".slick-slide").eq(n):t.$slideTrack.children(".slick-slide").eq(n+t.options.slidesToShow+1),f=(t.options.rtl===!0?i[0]?(t.$slideTrack.width()-i[0].offsetLeft-i.width())*-1:0:i[0]?i[0].offsetLeft*-1:0)+(t.$list.width()-i.outerWidth())/2)),f};t.prototype.getOption=t.prototype.slickGetOption=function(n){var t=this;return t.options[n]};t.prototype.getNavigableIndexes=function(){var n=this,t=0,i=0,u=[],r;for(n.options.infinite===!1?r=n.slideCount:(t=n.options.slidesToScroll*-1,i=n.options.slidesToScroll*-1,r=n.slideCount*2);t<r;)u.push(t),t=i+n.options.slidesToScroll,i+=n.options.slidesToScroll<=n.options.slidesToShow?n.options.slidesToScroll:n.options.slidesToShow;return u};t.prototype.getSlick=function(){return this};t.prototype.getSlideCount=function(){var t=this,i,r;return r=t.options.centerMode===!0?t.slideWidth*Math.floor(t.options.slidesToShow/2):0,t.options.swipeToSlide===!0?(t.$slideTrack.find(".slick-slide").each(function(u,f){if(f.offsetLeft-r+n(f).outerWidth()/2>t.swipeLeft*-1)return i=f,!1}),Math.abs(n(i).attr("data-slick-index")-t.currentSlide)||1):t.options.slidesToScroll};t.prototype.goTo=t.prototype.slickGoTo=function(n,t){var i=this;i.changeSlide({data:{message:"index",index:parseInt(n)}},t)};t.prototype.init=function(t){var i=this;n(i.$slider).hasClass("slick-initialized")||(n(i.$slider).addClass("slick-initialized"),i.buildRows(),i.buildOut(),i.setProps(),i.startLoad(),i.loadSlider(),i.initializeEvents(),i.updateArrows(),i.updateDots(),i.checkResponsive(!0),i.focusHandler());t&&i.$slider.trigger("init",[i]);i.options.accessibility===!0&&i.initADA();i.options.autoplay&&(i.paused=!1,i.autoPlay())};t.prototype.initADA=function(){var t=this;t.$slides.add(t.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"});t.$slideTrack.attr("role","listbox");t.$slides.not(t.$slideTrack.find(".slick-cloned")).each(function(i){n(this).attr({role:"option","aria-describedby":"slick-slide"+t.instanceUid+i+""})});t.$dots!==null&&t.$dots.attr("role","tablist").find("li").each(function(i){n(this).attr({role:"presentation","aria-selected":"false","aria-controls":"navigation"+t.instanceUid+i+"",id:"slick-slide"+t.instanceUid+i+""})}).first().attr("aria-selected","true").end().find("button").attr("role","button").end().closest("div").attr("role","toolbar");t.activateADA()};t.prototype.initArrowEvents=function(){var n=this;if(n.options.arrows===!0&&n.slideCount>n.options.slidesToShow){n.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},n.changeSlide);n.$nextArrow.off("click.slick").on("click.slick",{message:"next"},n.changeSlide)}};t.prototype.initDotEvents=function(){var t=this;if(t.options.dots===!0&&t.slideCount>t.options.slidesToShow)n("li",t.$dots).on("click.slick",{message:"index"},t.changeSlide);if(t.options.dots===!0&&t.options.pauseOnDotsHover===!0)n("li",t.$dots).on("mouseenter.slick",n.proxy(t.interrupt,t,!0)).on("mouseleave.slick",n.proxy(t.interrupt,t,!1))};t.prototype.initSlideEvents=function(){var t=this;if(t.options.pauseOnHover){t.$list.on("mouseenter.slick",n.proxy(t.interrupt,t,!0));t.$list.on("mouseleave.slick",n.proxy(t.interrupt,t,!1))}};t.prototype.initializeEvents=function(){var t=this;t.initArrowEvents();t.initDotEvents();t.initSlideEvents();t.$list.on("touchstart.slick mousedown.slick",{action:"start"},t.swipeHandler);t.$list.on("touchmove.slick mousemove.slick",{action:"move"},t.swipeHandler);t.$list.on("touchend.slick mouseup.slick",{action:"end"},t.swipeHandler);t.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},t.swipeHandler);t.$list.on("click.slick",t.clickHandler);n(document).on(t.visibilityChange,n.proxy(t.visibility,t));if(t.options.accessibility===!0)t.$list.on("keydown.slick",t.keyHandler);if(t.options.focusOnSelect===!0)n(t.$slideTrack).children().on("click.slick",t.selectHandler);n(window).on("orientationchange.slick.slick-"+t.instanceUid,n.proxy(t.orientationChange,t));n(window).on("resize.slick.slick-"+t.instanceUid,n.proxy(t.resize,t));n("[draggable!=true]",t.$slideTrack).on("dragstart",t.preventDefault);n(window).on("load.slick.slick-"+t.instanceUid,t.setPosition);n(document).on("ready.slick.slick-"+t.instanceUid,t.setPosition)};t.prototype.initUI=function(){var n=this;n.options.arrows===!0&&n.slideCount>n.options.slidesToShow&&(n.$prevArrow.show(),n.$nextArrow.show());n.options.dots===!0&&n.slideCount>n.options.slidesToShow&&n.$dots.show()};t.prototype.keyHandler=function(n){var t=this;n.target.tagName.match("TEXTAREA|INPUT|SELECT")||(n.keyCode===37&&t.options.accessibility===!0?t.changeSlide({data:{message:t.options.rtl===!0?"next":"previous"}}):n.keyCode===39&&t.options.accessibility===!0&&t.changeSlide({data:{message:t.options.rtl===!0?"previous":"next"}}))};t.prototype.lazyLoad=function(){function f(i){n("img[data-lazy]",i).each(function(){var i=n(this),r=n(this).attr("data-lazy"),u=document.createElement("img");u.onload=function(){i.animate({opacity:0},100,function(){i.attr("src",r).animate({opacity:1},200,function(){i.removeAttr("data-lazy").removeClass("slick-loading")});t.$slider.trigger("lazyLoaded",[t,i,r])})};u.onerror=function(){i.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error");t.$slider.trigger("lazyLoadError",[t,i,r])};u.src=r})}var t=this,e,r,i,u;t.options.centerMode===!0?t.options.infinite===!0?(i=t.currentSlide+(t.options.slidesToShow/2+1),u=i+t.options.slidesToShow+2):(i=Math.max(0,t.currentSlide-(t.options.slidesToShow/2+1)),u=2+(t.options.slidesToShow/2+1)+t.currentSlide):(i=t.options.infinite?t.options.slidesToShow+t.currentSlide:t.currentSlide,u=Math.ceil(i+t.options.slidesToShow),t.options.fade===!0&&(i>0&&i--,u<=t.slideCount&&u++));e=t.$slider.find(".slick-slide").slice(i,u);f(e);t.slideCount<=t.options.slidesToShow?(r=t.$slider.find(".slick-slide"),f(r)):t.currentSlide>=t.slideCount-t.options.slidesToShow?(r=t.$slider.find(".slick-cloned").slice(0,t.options.slidesToShow),f(r)):t.currentSlide===0&&(r=t.$slider.find(".slick-cloned").slice(t.options.slidesToShow*-1),f(r))};t.prototype.loadSlider=function(){var n=this;n.setPosition();n.$slideTrack.css({opacity:1});n.$slider.removeClass("slick-loading");n.initUI();n.options.lazyLoad==="progressive"&&n.progressiveLazyLoad()};t.prototype.next=t.prototype.slickNext=function(){var n=this;n.changeSlide({data:{message:"next"}})};t.prototype.orientationChange=function(){var n=this;n.checkResponsive();n.setPosition()};t.prototype.pause=t.prototype.slickPause=function(){var n=this;n.autoPlayClear();n.paused=!0};t.prototype.play=t.prototype.slickPlay=function(){var n=this;n.autoPlay();n.options.autoplay=!0;n.paused=!1;n.focussed=!1;n.interrupted=!1};t.prototype.postSlide=function(n){var t=this;t.unslicked||(t.$slider.trigger("afterChange",[t,n]),t.animating=!1,t.setPosition(),t.swipeLeft=null,t.options.autoplay&&t.autoPlay(),t.options.accessibility===!0&&t.initADA())};t.prototype.prev=t.prototype.slickPrev=function(){var n=this;n.changeSlide({data:{message:"previous"}})};t.prototype.preventDefault=function(n){n.preventDefault()};t.prototype.progressiveLazyLoad=function(t){t=t||1;var i=this,e=n("img[data-lazy]",i.$slider),r,u,f;e.length?(r=e.first(),u=r.attr("data-lazy"),f=document.createElement("img"),f.onload=function(){r.attr("src",u).removeAttr("data-lazy").removeClass("slick-loading");i.options.adaptiveHeight===!0&&i.setPosition();i.$slider.trigger("lazyLoaded",[i,r,u]);i.progressiveLazyLoad()},f.onerror=function(){t<3?setTimeout(function(){i.progressiveLazyLoad(t+1)},500):(r.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),i.$slider.trigger("lazyLoadError",[i,r,u]),i.progressiveLazyLoad())},f.src=u):i.$slider.trigger("allImagesLoaded",[i])};t.prototype.refresh=function(t){var i=this,r,u;u=i.slideCount-i.options.slidesToShow;!i.options.infinite&&i.currentSlide>u&&(i.currentSlide=u);i.slideCount<=i.options.slidesToShow&&(i.currentSlide=0);r=i.currentSlide;i.destroy(!0);n.extend(i,i.initials,{currentSlide:r});i.init();t||i.changeSlide({data:{message:"index",index:r}},!1)};t.prototype.registerBreakpoints=function(){var t=this,u,f,i,r=t.options.responsive||null;if(n.type(r)==="array"&&r.length){t.respondTo=t.options.respondTo||"window";for(u in r)if(i=t.breakpoints.length-1,f=r[u].breakpoint,r.hasOwnProperty(u)){while(i>=0)t.breakpoints[i]&&t.breakpoints[i]===f&&t.breakpoints.splice(i,1),i--;t.breakpoints.push(f);t.breakpointSettings[f]=r[u].settings}t.breakpoints.sort(function(n,i){return t.options.mobileFirst?n-i:i-n})}};t.prototype.reinit=function(){var t=this;if(t.$slides=t.$slideTrack.children(t.options.slide).addClass("slick-slide"),t.slideCount=t.$slides.length,t.currentSlide>=t.slideCount&&t.currentSlide!==0&&(t.currentSlide=t.currentSlide-t.options.slidesToScroll),t.slideCount<=t.options.slidesToShow&&(t.currentSlide=0),t.registerBreakpoints(),t.setProps(),t.setupInfinite(),t.buildArrows(),t.updateArrows(),t.initArrowEvents(),t.buildDots(),t.updateDots(),t.initDotEvents(),t.cleanUpSlideEvents(),t.initSlideEvents(),t.checkResponsive(!1,!0),t.options.focusOnSelect===!0)n(t.$slideTrack).children().on("click.slick",t.selectHandler);t.setSlideClasses(typeof t.currentSlide=="number"?t.currentSlide:0);t.setPosition();t.focusHandler();t.paused=!t.options.autoplay;t.autoPlay();t.$slider.trigger("reInit",[t])};t.prototype.resize=function(){var t=this;n(window).width()!==t.windowWidth&&(clearTimeout(t.windowDelay),t.windowDelay=window.setTimeout(function(){t.windowWidth=n(window).width();t.checkResponsive();t.unslicked||t.setPosition()},50))};t.prototype.removeSlide=t.prototype.slickRemove=function(n,t,i){var r=this;if(typeof n=="boolean"?(t=n,n=t===!0?0:r.slideCount-1):n=t===!0?--n:n,r.slideCount<1||n<0||n>r.slideCount-1)return!1;r.unload();i===!0?r.$slideTrack.children().remove():r.$slideTrack.children(this.options.slide).eq(n).remove();r.$slides=r.$slideTrack.children(this.options.slide);r.$slideTrack.children(this.options.slide).detach();r.$slideTrack.append(r.$slides);r.$slidesCache=r.$slides;r.reinit()};t.prototype.setCSS=function(n){var t=this,i={},r,u;t.options.rtl===!0&&(n=-n);r=t.positionProp=="left"?Math.ceil(n)+"px":"0px";u=t.positionProp=="top"?Math.ceil(n)+"px":"0px";i[t.positionProp]=n;t.transformsEnabled===!1?t.$slideTrack.css(i):(i={},t.cssTransitions===!1?(i[t.animType]="translate("+r+", "+u+")",t.$slideTrack.css(i)):(i[t.animType]="translate3d("+r+", "+u+", 0px)",t.$slideTrack.css(i)))};t.prototype.setDimensions=function(){var n=this,t;n.options.vertical===!1?n.options.centerMode===!0&&n.$list.css({padding:"0px "+n.options.centerPadding}):(n.$list.height(n.$slides.first().outerHeight(!0)*n.options.slidesToShow),n.options.centerMode===!0&&n.$list.css({padding:n.options.centerPadding+" 0px"}));n.listWidth=n.$list.width();n.listHeight=n.$list.height();n.options.vertical===!1&&n.options.variableWidth===!1?(n.slideWidth=Math.ceil(n.listWidth/n.options.slidesToShow),n.$slideTrack.width(Math.ceil(n.slideWidth*n.$slideTrack.children(".slick-slide").length))):n.options.variableWidth===!0?n.$slideTrack.width(5e3*n.slideCount):(n.slideWidth=Math.ceil(n.listWidth),n.$slideTrack.height(Math.ceil(n.$slides.first().outerHeight(!0)*n.$slideTrack.children(".slick-slide").length)));t=n.$slides.first().outerWidth(!0)-n.$slides.first().width();n.options.variableWidth===!1&&n.$slideTrack.children(".slick-slide").width(n.slideWidth-t)};t.prototype.setFade=function(){var t=this,i;t.$slides.each(function(r,u){i=t.slideWidth*r*-1;t.options.rtl===!0?n(u).css({position:"relative",right:i,top:0,zIndex:t.options.zIndex-2,opacity:0}):n(u).css({position:"relative",left:i,top:0,zIndex:t.options.zIndex-2,opacity:0})});t.$slides.eq(t.currentSlide).css({zIndex:t.options.zIndex-1,opacity:1})};t.prototype.setHeight=function(){var n=this,t;n.options.slidesToShow===1&&n.options.adaptiveHeight===!0&&n.options.vertical===!1&&(t=n.$slides.eq(n.currentSlide).outerHeight(!0),n.$list.css("height",t))};t.prototype.setOption=t.prototype.slickSetOption=function(){var t=this,u,f,e,i,o=!1,r;if(n.type(arguments[0])==="object"?(e=arguments[0],o=arguments[1],r="multiple"):n.type(arguments[0])==="string"&&(e=arguments[0],i=arguments[1],o=arguments[2],arguments[0]==="responsive"&&n.type(arguments[1])==="array"?r="responsive":typeof arguments[1]!="undefined"&&(r="single")),r==="single")t.options[e]=i;else if(r==="multiple")n.each(e,function(n,i){t.options[n]=i});else if(r==="responsive")for(f in i)if(n.type(t.options.responsive)!=="array")t.options.responsive=[i[f]];else{for(u=t.options.responsive.length-1;u>=0;)t.options.responsive[u].breakpoint===i[f].breakpoint&&t.options.responsive.splice(u,1),u--;t.options.responsive.push(i[f])}o&&(t.unload(),t.reinit())};t.prototype.setPosition=function(){var n=this;n.setDimensions();n.setHeight();n.options.fade===!1?n.setCSS(n.getLeft(n.currentSlide)):n.setFade();n.$slider.trigger("setPosition",[n])};t.prototype.setProps=function(){var n=this,t=document.body.style;n.positionProp=n.options.vertical===!0?"top":"left";n.positionProp==="top"?n.$slider.addClass("slick-vertical"):n.$slider.removeClass("slick-vertical");(t.WebkitTransition!==undefined||t.MozTransition!==undefined||t.msTransition!==undefined)&&n.options.useCSS===!0&&(n.cssTransitions=!0);n.options.fade&&(typeof n.options.zIndex=="number"?n.options.zIndex<3&&(n.options.zIndex=3):n.options.zIndex=n.defaults.zIndex);t.OTransform!==undefined&&(n.animType="OTransform",n.transformType="-o-transform",n.transitionType="OTransition",t.perspectiveProperty===undefined&&t.webkitPerspective===undefined&&(n.animType=!1));t.MozTransform!==undefined&&(n.animType="MozTransform",n.transformType="-moz-transform",n.transitionType="MozTransition",t.perspectiveProperty===undefined&&t.MozPerspective===undefined&&(n.animType=!1));t.webkitTransform!==undefined&&(n.animType="webkitTransform",n.transformType="-webkit-transform",n.transitionType="webkitTransition",t.perspectiveProperty===undefined&&t.webkitPerspective===undefined&&(n.animType=!1));t.msTransform!==undefined&&(n.animType="msTransform",n.transformType="-ms-transform",n.transitionType="msTransition",t.msTransform===undefined&&(n.animType=!1));t.transform!==undefined&&n.animType!==!1&&(n.animType="transform",n.transformType="transform",n.transitionType="transition");n.transformsEnabled=n.options.useTransform&&n.animType!==null&&n.animType!==!1};t.prototype.setSlideClasses=function(n){var t=this,u,i,r,f;i=t.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true");t.$slides.eq(n).addClass("slick-current");t.options.centerMode===!0?(u=Math.floor(t.options.slidesToShow/2),t.options.infinite===!0&&(n>=u&&n<=t.slideCount-1-u?t.$slides.slice(n-u,n+u+1).addClass("slick-active").attr("aria-hidden","false"):(r=t.options.slidesToShow+n,i.slice(r-u+1,r+u+2).addClass("slick-active").attr("aria-hidden","false")),n===0?i.eq(i.length-1-t.options.slidesToShow).addClass("slick-center"):n===t.slideCount-1&&i.eq(t.options.slidesToShow).addClass("slick-center")),t.$slides.eq(n).addClass("slick-center")):n>=0&&n<=t.slideCount-t.options.slidesToShow?t.$slides.slice(n,n+t.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):i.length<=t.options.slidesToShow?i.addClass("slick-active").attr("aria-hidden","false"):(f=t.slideCount%t.options.slidesToShow,r=t.options.infinite===!0?t.options.slidesToShow+n:n,t.options.slidesToShow==t.options.slidesToScroll&&t.slideCount-n<t.options.slidesToShow?i.slice(r-(t.options.slidesToShow-f),r+f).addClass("slick-active").attr("aria-hidden","false"):i.slice(r,r+t.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"));t.options.lazyLoad==="ondemand"&&t.lazyLoad()};t.prototype.setupInfinite=function(){var t=this,i,r,u;if(t.options.fade===!0&&(t.options.centerMode=!1),t.options.infinite===!0&&t.options.fade===!1&&(r=null,t.slideCount>t.options.slidesToShow)){for(u=t.options.centerMode===!0?t.options.slidesToShow+1:t.options.slidesToShow,i=t.slideCount;i>t.slideCount-u;i-=1)r=i-1,n(t.$slides[r]).clone(!0).attr("id","").attr("data-slick-index",r-t.slideCount).prependTo(t.$slideTrack).addClass("slick-cloned");for(i=0;i<u;i+=1)r=i,n(t.$slides[r]).clone(!0).attr("id","").attr("data-slick-index",r+t.slideCount).appendTo(t.$slideTrack).addClass("slick-cloned");t.$slideTrack.find(".slick-cloned").find("[id]").each(function(){n(this).attr("id","")})}};t.prototype.interrupt=function(n){var t=this;n||t.autoPlay();t.interrupted=n};t.prototype.selectHandler=function(t){var i=this,u=n(t.target).is(".slick-slide")?n(t.target):n(t.target).parents(".slick-slide"),r=parseInt(u.attr("data-slick-index"));if(r||(r=0),i.slideCount<=i.options.slidesToShow){i.setSlideClasses(r);i.asNavFor(r);return}i.slideHandler(r)};t.prototype.slideHandler=function(n,t,i){var u,f,s,o,h=null,r=this,e;if((t=t||!1,r.animating!==!0||r.options.waitForAnimate!==!0)&&(r.options.fade!==!0||r.currentSlide!==n)&&!(r.slideCount<=r.options.slidesToShow)){if(t===!1&&r.asNavFor(n),u=n,h=r.getLeft(u),o=r.getLeft(r.currentSlide),r.currentLeft=r.swipeLeft===null?o:r.swipeLeft,r.options.infinite===!1&&r.options.centerMode===!1&&(n<0||n>r.getDotCount()*r.options.slidesToScroll)){r.options.fade===!1&&(u=r.currentSlide,i!==!0?r.animateSlide(o,function(){r.postSlide(u)}):r.postSlide(u));return}if(r.options.infinite===!1&&r.options.centerMode===!0&&(n<0||n>r.slideCount-r.options.slidesToScroll)){r.options.fade===!1&&(u=r.currentSlide,i!==!0?r.animateSlide(o,function(){r.postSlide(u)}):r.postSlide(u));return}if(r.options.autoplay&&clearInterval(r.autoPlayTimer),f=u<0?r.slideCount%r.options.slidesToScroll!=0?r.slideCount-r.slideCount%r.options.slidesToScroll:r.slideCount+u:u>=r.slideCount?r.slideCount%r.options.slidesToScroll!=0?0:u-r.slideCount:u,r.animating=!0,r.$slider.trigger("beforeChange",[r,r.currentSlide,f]),s=r.currentSlide,r.currentSlide=f,r.setSlideClasses(r.currentSlide),r.options.asNavFor&&(e=r.getNavTarget(),e=e.slick("getSlick"),e.slideCount<=e.options.slidesToShow&&e.setSlideClasses(r.currentSlide)),r.updateDots(),r.updateArrows(),r.options.fade===!0){i!==!0?(r.fadeSlideOut(s),r.fadeSlide(f,function(){r.postSlide(f)})):r.postSlide(f);r.animateHeight();return}i!==!0?r.animateSlide(h,function(){r.postSlide(f)}):r.postSlide(f)}};t.prototype.startLoad=function(){var n=this;n.options.arrows===!0&&n.slideCount>n.options.slidesToShow&&(n.$prevArrow.hide(),n.$nextArrow.hide());n.options.dots===!0&&n.slideCount>n.options.slidesToShow&&n.$dots.hide();n.$slider.addClass("slick-loading")};t.prototype.swipeDirection=function(){var i,r,u,n,t=this;return(i=t.touchObject.startX-t.touchObject.curX,r=t.touchObject.startY-t.touchObject.curY,u=Math.atan2(r,i),n=Math.round(u*180/Math.PI),n<0&&(n=360-Math.abs(n)),n<=45&&n>=0)?t.options.rtl===!1?"left":"right":n<=360&&n>=315?t.options.rtl===!1?"left":"right":n>=135&&n<=225?t.options.rtl===!1?"right":"left":t.options.verticalSwiping===!0?n>=35&&n<=135?"down":"up":"vertical"};t.prototype.swipeEnd=function(){var n=this,i,t;if(n.dragging=!1,n.interrupted=!1,n.shouldClick=n.touchObject.swipeLength>10?!1:!0,n.touchObject.curX===undefined)return!1;if(n.touchObject.edgeHit===!0&&n.$slider.trigger("edge",[n,n.swipeDirection()]),n.touchObject.swipeLength>=n.touchObject.minSwipe){t=n.swipeDirection();switch(t){case"left":case"down":i=n.options.swipeToSlide?n.checkNavigable(n.currentSlide+n.getSlideCount()):n.currentSlide+n.getSlideCount();n.currentDirection=0;break;case"right":case"up":i=n.options.swipeToSlide?n.checkNavigable(n.currentSlide-n.getSlideCount()):n.currentSlide-n.getSlideCount();n.currentDirection=1}t!="vertical"&&(n.slideHandler(i),n.touchObject={},n.$slider.trigger("swipe",[n,t]))}else n.touchObject.startX!==n.touchObject.curX&&(n.slideHandler(n.currentSlide),n.touchObject={})};t.prototype.swipeHandler=function(n){var t=this;if(t.options.swipe!==!1&&(!("ontouchend"in document)||t.options.swipe!==!1)&&(t.options.draggable!==!1||n.type.indexOf("mouse")===-1)){t.touchObject.fingerCount=n.originalEvent&&n.originalEvent.touches!==undefined?n.originalEvent.touches.length:1;t.touchObject.minSwipe=t.listWidth/t.options.touchThreshold;t.options.verticalSwiping===!0&&(t.touchObject.minSwipe=t.listHeight/t.options.touchThreshold);switch(n.data.action){case"start":t.swipeStart(n);break;case"move":t.swipeMove(n);break;case"end":t.swipeEnd(n)}}};t.prototype.swipeMove=function(n){var t=this,f,e,r,u,i;if(i=n.originalEvent!==undefined?n.originalEvent.touches:null,!t.dragging||i&&i.length!==1)return!1;if(f=t.getLeft(t.currentSlide),t.touchObject.curX=i!==undefined?i[0].pageX:n.clientX,t.touchObject.curY=i!==undefined?i[0].pageY:n.clientY,t.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(t.touchObject.curX-t.touchObject.startX,2))),t.options.verticalSwiping===!0&&(t.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(t.touchObject.curY-t.touchObject.startY,2)))),e=t.swipeDirection(),e!=="vertical"){if(n.originalEvent!==undefined&&t.touchObject.swipeLength>4&&n.preventDefault(),u=(t.options.rtl===!1?1:-1)*(t.touchObject.curX>t.touchObject.startX?1:-1),t.options.verticalSwiping===!0&&(u=t.touchObject.curY>t.touchObject.startY?1:-1),r=t.touchObject.swipeLength,t.touchObject.edgeHit=!1,t.options.infinite===!1&&(t.currentSlide===0&&e==="right"||t.currentSlide>=t.getDotCount()&&e==="left")&&(r=t.touchObject.swipeLength*t.options.edgeFriction,t.touchObject.edgeHit=!0),t.swipeLeft=t.options.vertical===!1?f+r*u:f+r*(t.$list.height()/t.listWidth)*u,t.options.verticalSwiping===!0&&(t.swipeLeft=f+r*u),t.options.fade===!0||t.options.touchMove===!1)return!1;if(t.animating===!0)return t.swipeLeft=null,!1;t.setCSS(t.swipeLeft)}};t.prototype.swipeStart=function(n){var t=this,i;if(t.interrupted=!0,t.touchObject.fingerCount!==1||t.slideCount<=t.options.slidesToShow)return t.touchObject={},!1;n.originalEvent!==undefined&&n.originalEvent.touches!==undefined&&(i=n.originalEvent.touches[0]);t.touchObject.startX=t.touchObject.curX=i!==undefined?i.pageX:n.clientX;t.touchObject.startY=t.touchObject.curY=i!==undefined?i.pageY:n.clientY;t.dragging=!0};t.prototype.unfilterSlides=t.prototype.slickUnfilter=function(){var n=this;n.$slidesCache!==null&&(n.unload(),n.$slideTrack.children(this.options.slide).detach(),n.$slidesCache.appendTo(n.$slideTrack),n.reinit())};t.prototype.unload=function(){var t=this;n(".slick-cloned",t.$slider).remove();t.$dots&&t.$dots.remove();t.$prevArrow&&t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.remove();t.$nextArrow&&t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.remove();t.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")};t.prototype.unslick=function(n){var t=this;t.$slider.trigger("unslick",[t,n]);t.destroy()};t.prototype.updateArrows=function(){var n=this,t;t=Math.floor(n.options.slidesToShow/2);n.options.arrows===!0&&n.slideCount>n.options.slidesToShow&&!n.options.infinite&&(n.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),n.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),n.currentSlide===0?(n.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),n.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):n.currentSlide>=n.slideCount-n.options.slidesToShow&&n.options.centerMode===!1?(n.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),n.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):n.currentSlide>=n.slideCount-1&&n.options.centerMode===!0&&(n.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),n.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))};t.prototype.updateDots=function(){var n=this;n.$dots!==null&&(n.$dots.find("li").removeClass("slick-active").attr("aria-hidden","true"),n.$dots.find("li").eq(Math.floor(n.currentSlide/n.options.slidesToScroll)).addClass("slick-active").attr("aria-hidden","false"))};t.prototype.visibility=function(){var n=this;n.options.autoplay&&(n.interrupted=document[n.hidden]?!0:!1)};n.fn.slick=function(){for(var i=this,r=arguments[0],f=Array.prototype.slice.call(arguments,1),e=i.length,u,n=0;n<e;n++)if(typeof r=="object"||typeof r=="undefined"?i[n].slick=new t(i[n],r):u=i[n].slick[r].apply(i[n].slick,f),typeof u!="undefined")return u;return i}}),function(){$(".cdc-form-group-advanced-main").hasClass("hidden")&&$(".hpm-title-form").remove();$(".hpm-receipt-field").append('<a class="icon-info" href="https://intensifyyoursummer.durex.co.uk/receipt-info/" target="_blank"><span class="glyphicon glyphicon-info-sign"><\/span><\/a>');$(document).on("mouseenter",".icon-info",function(){$(".cdc-tooltip").mouseenter()});$(document).on("mouseout",".icon-info",function(){$(".cdc-tooltip").mouseout()});var n=$(".sk-hpm-summer-spain-form-uk .cdc-form-group");n.hasClass("hidden")&&$(".form-info, .form-information-mobile").css("display","none")}(),function(){var n=$(".sk-hpm-emoji-september-form");n.length>0&&$(".cdc-submit").val("Küldés")}(),function(){var n=$("sk-hpm-durex-mundial-form");n.length>0&&$(".sk-language-de .cdc-submit").val("Teilnehmen")}(),function(){var n=$(".sk-hpm-durex-summer-form");n.length>0&&$(".sk-language-de .cdc-submit").val("Teilnehmen")}(),function(){var n=$(".sk-hpm-durex-summer-form");n.length>0&&$(".sk-language-fr .cdc-submit").val("Participer")}(),function(){var n=$(".sk-hpm-summer-spain-form");n.length>0&&$(".cdc-submit").val("ENVIAR")}(),function(n){"use strict";function f(n){n&&(t.select.text(i[n].select),t.mr.text(i[n].mr),t.mrs.text(i[n].mrs),t.miss.text(i[n].miss),t.ms.text(i[n].ms),t.rev.text(i[n].rev),t.dr.text(i[n].dr),t.master.text(i[n].master),r.title.text(i[n].title),r.name.text(i[n].name),r.surname.text(i[n].surname),r.email.text(i[n].email),r.age.text(i[n].age),r.phone.text(i[n].phone),r.address.text(i[n].address),r.zip.text(i[n].zip),t.submit.val(i[n].submit))}function u(t){t&&(f(t),n(".cdc-form-group--submit input").click(function(){n("#cdc-form").valid()&&(n('[class*="lang-'+t+'"]').hide(),n(".hpm-thankyou").css("display","block"))}))}var i={es:{title:"Título *",email:"E-mail *",name:"Nombre *",surname:"Apellidos *",address:"Dirección y ciudad",zip:"CP",age:"Edad",phone:"Teléfono de contacto",select:"-- Por favor selecciona --",miss:"Srta",mrs:"Sra",mr:"Sr",rev:"Rdo",dr:"Dr",master:"Dominar",submit:"Enviar"},de:{title:"Titel *",email:"Email *",name:"Vorname *",surname:"Nachname *",address:"Adresse",zip:"PLZ",age:"Alter",phone:"Telefon taub",select:"-- wählen --",miss:"Fräulein",mrs:"Frau",mr:"Herr",rev:"Rev",dr:"Dr",master:"Meister",submit:"Daten absenden"},fr:{title:"Titre *",email:"Email *",name:"Prénom *",surname:"Nom de famille *",address:"Adresse",zip:"Code postal",age:"âge",phone:"Telefon taub",select:"-- Choisir --",miss:"Manquer",mrs:"Madame",mr:"Monsieur",rev:"Tour",dr:"Dr",master:"Maîtriser",submit:"Envoyer"}},t={title:n("#Title"),email:n("#EmailAddress"),name:n("#GivenNames"),surname:n("#FamilyNames"),address:n("#Phone").parent().next().children().eq(0),zip:n("#Phone").parent().next().children().eq(1),age:n("#BirthDate"),phone:n("#Phone"),select:n('select option:contains("-- Please Select --")'),miss:n('select option:contains("Miss")'),mrs:n('select option:contains("Mrs")'),mr:n('select option:contains("Mr")'),ms:n('select option:contains("Ms")'),rev:n('select option:contains("Rev")'),dr:n('select option:contains("Dr")'),master:n('select option:contains("Master")'),submit:n(".cdc-form-group--submit input")},r={title:t.title.prev(),email:t.email.prev(),name:t.name.prev(),surname:t.surname.prev(),address:t.address.children("label"),zip:t.zip.children("label"),age:t.age.parent().prev(),phone:t.phone.prev()};n(document).ready(function(){if(n('[class*="lang-"]'))if(n('[class*="lang-es"]').length>0)n("#cdc-form")&&(u("es"),t.ms.remove(),t.rev.remove(),t.dr.remove(),t.master.remove());else if(n('[class*="lang-de"]').length>0){if(n("#cdc-form")&&(u("de"),t.miss.remove(),t.ms.remove(),t.rev.remove(),t.dr.remove(),t.master.remove()),n(".hpm-thankyou button"))n(".hpm-thankyou button").off().on("click",function(){window.location.reload()})}else n('[class*="lang-fr"]').length>0&&n("#cdc-form")&&(u("fr"),t.miss.remove(),t.ms.remove(),t.rev.remove(),t.dr.remove(),t.master.remove())})}(jQuery)