/home/bdqbpbxa/demo-subdomains/uniferx.goodface.com.ua/static/js/main.5ff86fab.js
/*! For license information please see main.5ff86fab.js.LICENSE.txt */
(()=>{var __webpack_modules__={756:e=>{"use strict";e.exports=function e(t,i){if(t===i)return!0;if(t&&i&&"object"==typeof t&&"object"==typeof i){if(t.constructor!==i.constructor)return!1;var n,r,a;if(Array.isArray(t)){if((n=t.length)!=i.length)return!1;for(r=n;0!==r--;)if(!e(t[r],i[r]))return!1;return!0}if(t instanceof Map&&i instanceof Map){if(t.size!==i.size)return!1;for(r of t.entries())if(!i.has(r[0]))return!1;for(r of t.entries())if(!e(r[1],i.get(r[0])))return!1;return!0}if(t instanceof Set&&i instanceof Set){if(t.size!==i.size)return!1;for(r of t.entries())if(!i.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(i)){if((n=t.length)!=i.length)return!1;for(r=n;0!==r--;)if(t[r]!==i[r])return!1;return!0}if(t.constructor===RegExp)return t.source===i.source&&t.flags===i.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===i.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===i.toString();if((n=(a=Object.keys(t)).length)!==Object.keys(i).length)return!1;for(r=n;0!==r--;)if(!Object.prototype.hasOwnProperty.call(i,a[r]))return!1;for(r=n;0!==r--;){var s=a[r];if(("_owner"!==s||!t.$$typeof)&&!e(t[s],i[s]))return!1}return!0}return t!==t&&i!==i}},219:(e,t,i)=>{"use strict";var n=i(763),r={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};function l(e){return n.isMemo(e)?s:o[e.$$typeof]||r}o[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o[n.Memo]=s;var c=Object.defineProperty,h=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,f=Object.prototype;e.exports=function e(t,i,n){if("string"!==typeof i){if(f){var r=p(i);r&&r!==f&&e(t,r,n)}var s=h(i);u&&(s=s.concat(u(i)));for(var o=l(t),m=l(i),g=0;g<s.length;++g){var v=s[g];if(!a[v]&&(!n||!n[v])&&(!m||!m[v])&&(!o||!o[v])){var y=d(i,v);try{c(t,v,y)}catch(b){}}}}return t}},983:(e,t)=>{"use strict";var i="function"===typeof Symbol&&Symbol.for,n=i?Symbol.for("react.element"):60103,r=i?Symbol.for("react.portal"):60106,a=i?Symbol.for("react.fragment"):60107,s=i?Symbol.for("react.strict_mode"):60108,o=i?Symbol.for("react.profiler"):60114,l=i?Symbol.for("react.provider"):60109,c=i?Symbol.for("react.context"):60110,h=i?Symbol.for("react.async_mode"):60111,u=i?Symbol.for("react.concurrent_mode"):60111,d=i?Symbol.for("react.forward_ref"):60112,p=i?Symbol.for("react.suspense"):60113,f=i?Symbol.for("react.suspense_list"):60120,m=i?Symbol.for("react.memo"):60115,g=i?Symbol.for("react.lazy"):60116,v=i?Symbol.for("react.block"):60121,y=i?Symbol.for("react.fundamental"):60117,b=i?Symbol.for("react.responder"):60118,x=i?Symbol.for("react.scope"):60119;function w(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case h:case u:case a:case o:case s:case p:return e;default:switch(e=e&&e.$$typeof){case c:case d:case g:case m:case l:return e;default:return t}}case r:return t}}}function _(e){return w(e)===u}t.AsyncMode=h,t.ConcurrentMode=u,t.ContextConsumer=c,t.ContextProvider=l,t.Element=n,t.ForwardRef=d,t.Fragment=a,t.Lazy=g,t.Memo=m,t.Portal=r,t.Profiler=o,t.StrictMode=s,t.Suspense=p,t.isAsyncMode=function(e){return _(e)||w(e)===h},t.isConcurrentMode=_,t.isContextConsumer=function(e){return w(e)===c},t.isContextProvider=function(e){return w(e)===l},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return w(e)===d},t.isFragment=function(e){return w(e)===a},t.isLazy=function(e){return w(e)===g},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===r},t.isProfiler=function(e){return w(e)===o},t.isStrictMode=function(e){return w(e)===s},t.isSuspense=function(e){return w(e)===p},t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===a||e===u||e===o||e===s||e===p||e===f||"object"===typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===l||e.$$typeof===c||e.$$typeof===d||e.$$typeof===y||e.$$typeof===b||e.$$typeof===x||e.$$typeof===v)},t.typeOf=w},763:(e,t,i)=>{"use strict";e.exports=i(983)},302:function(module,exports,__webpack_require__){var factory;"undefined"!==typeof navigator&&(factory=function(){"use strict";var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(e){_useWebWorker=!!e},getWebWorker=function(){return _useWebWorker},setLocationHref=function(e){locationHref=e},getLocationHref=function(){return locationHref};function createTag(e){return document.createElement(e)}function extendPrototype(e,t){var i,n,r=e.length;for(i=0;i<r;i+=1)for(var a in n=e[i].prototype)Object.prototype.hasOwnProperty.call(n,a)&&(t.prototype[a]=n[a])}function getDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)}function createProxyFunction(e){function t(){}return t.prototype=e,t}var audioControllerFactory=function(){function e(e){this.audios=[],this.audioFactory=e,this._volume=1,this._isMuted=!1}return e.prototype={addAudio:function(e){this.audios.push(e)},pause:function(){var e,t=this.audios.length;for(e=0;e<t;e+=1)this.audios[e].pause()},resume:function(){var e,t=this.audios.length;for(e=0;e<t;e+=1)this.audios[e].resume()},setRate:function(e){var t,i=this.audios.length;for(t=0;t<i;t+=1)this.audios[t].setRate(e)},createAudio:function(e){return this.audioFactory?this.audioFactory(e):window.Howl?new window.Howl({src:[e]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(e){this.audioFactory=e},setVolume:function(e){this._volume=e,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var e,t=this.audios.length;for(e=0;e<t;e+=1)this.audios[e].volume(this._volume*(this._isMuted?0:1))}},function(){return new e}}(),createTypedArray=function(){function e(e,t){var i,n=0,r=[];switch(e){case"int16":case"uint8c":i=1;break;default:i=1.1}for(n=0;n<t;n+=1)r.push(i);return r}return"function"===typeof Uint8ClampedArray&&"function"===typeof Float32Array?function(t,i){return"float32"===t?new Float32Array(i):"int16"===t?new Int16Array(i):"uint8c"===t?new Uint8ClampedArray(i):e(t,i)}:e}();function createSizedArray(e){return Array.apply(null,{length:e})}function _typeof$6(e){return _typeof$6="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$6(e)}var subframeEnabled=!0,expressionsPlugin=null,expressionsInterfaces=null,idPrefix$1="",isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),_shouldRoundValues=!1,bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};function ProjectInterface$1(){return{}}!function(){var e,t=["abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","cbrt","expm1","clz32","cos","cosh","exp","floor","fround","hypot","imul","log","log1p","log2","log10","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"],i=t.length;for(e=0;e<i;e+=1)BMMath[t[e]]=Math[t[e]]}(),BMMath.random=Math.random,BMMath.abs=function(e){if("object"===_typeof$6(e)&&e.length){var t,i=createSizedArray(e.length),n=e.length;for(t=0;t<n;t+=1)i[t]=Math.abs(e[t]);return i}return Math.abs(e)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function roundValues(e){_shouldRoundValues=!!e}function bmRnd(e){return _shouldRoundValues?Math.round(e):e}function styleDiv(e){e.style.position="absolute",e.style.top=0,e.style.left=0,e.style.display="block",e.style.transformOrigin="0 0",e.style.webkitTransformOrigin="0 0",e.style.backfaceVisibility="visible",e.style.webkitBackfaceVisibility="visible",e.style.transformStyle="preserve-3d",e.style.webkitTransformStyle="preserve-3d",e.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(e,t,i,n){this.type=e,this.currentTime=t,this.totalTime=i,this.direction=n<0?-1:1}function BMCompleteEvent(e,t){this.type=e,this.direction=t<0?-1:1}function BMCompleteLoopEvent(e,t,i,n){this.type=e,this.currentLoop=i,this.totalLoops=t,this.direction=n<0?-1:1}function BMSegmentStartEvent(e,t,i){this.type=e,this.firstFrame=t,this.totalFrames=i}function BMDestroyEvent(e,t){this.type=e,this.target=t}function BMRenderFrameErrorEvent(e,t){this.type="renderFrameError",this.nativeError=e,this.currentTime=t}function BMConfigErrorEvent(e){this.type="configError",this.nativeError=e}function BMAnimationConfigErrorEvent(e,t){this.type=e,this.nativeError=t}var createElementID=function(){var e=0;return function(){return idPrefix$1+"__lottie_element_"+(e+=1)}}();function HSVtoRGB(e,t,i){var n,r,a,s,o,l,c,h;switch(l=i*(1-t),c=i*(1-(o=6*e-(s=Math.floor(6*e)))*t),h=i*(1-(1-o)*t),s%6){case 0:n=i,r=h,a=l;break;case 1:n=c,r=i,a=l;break;case 2:n=l,r=i,a=h;break;case 3:n=l,r=c,a=i;break;case 4:n=h,r=l,a=i;break;case 5:n=i,r=l,a=c}return[n,r,a]}function RGBtoHSV(e,t,i){var n,r=Math.max(e,t,i),a=Math.min(e,t,i),s=r-a,o=0===r?0:s/r,l=r/255;switch(r){case a:n=0;break;case e:n=t-i+s*(t<i?6:0),n/=6*s;break;case t:n=i-e+2*s,n/=6*s;break;case i:n=e-t+4*s,n/=6*s}return[n,o,l]}function addSaturationToRGB(e,t){var i=RGBtoHSV(255*e[0],255*e[1],255*e[2]);return i[1]+=t,i[1]>1?i[1]=1:i[1]<=0&&(i[1]=0),HSVtoRGB(i[0],i[1],i[2])}function addBrightnessToRGB(e,t){var i=RGBtoHSV(255*e[0],255*e[1],255*e[2]);return i[2]+=t,i[2]>1?i[2]=1:i[2]<0&&(i[2]=0),HSVtoRGB(i[0],i[1],i[2])}function addHueToRGB(e,t){var i=RGBtoHSV(255*e[0],255*e[1],255*e[2]);return i[0]+=t/360,i[0]>1?i[0]-=1:i[0]<0&&(i[0]+=1),HSVtoRGB(i[0],i[1],i[2])}var rgbToHex=function(){var e,t,i=[];for(e=0;e<256;e+=1)t=e.toString(16),i[e]=1===t.length?"0"+t:t;return function(e,t,n){return e<0&&(e=0),t<0&&(t=0),n<0&&(n=0),"#"+i[e]+i[t]+i[n]}}(),setSubframeEnabled=function(e){subframeEnabled=!!e},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(e){expressionsPlugin=e},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(e){expressionsInterfaces=e},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(e){defaultCurveSegments=e},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(e){idPrefix$1=e},getIdPrefix=function(){return idPrefix$1};function createNS(e){return document.createElementNS(svgNS,e)}function _typeof$5(e){return _typeof$5="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$5(e)}var dataManager=function(){var e,t,i=1,n=[],r={onmessage:function(){},postMessage:function(t){e({data:t})}},a={postMessage:function(e){r.onmessage({data:e})}};function s(){t||(t=function(t){if(window.Worker&&window.Blob&&getWebWorker()){var i=new Blob(["var _workerSelf = self; self.onmessage = ",t.toString()],{type:"text/javascript"}),n=URL.createObjectURL(i);return new Worker(n)}return e=t,r}((function(e){if(a.dataManager||(a.dataManager=function(){function e(r,a){var s,o,l,c,u,d,p=r.length;for(o=0;o<p;o+=1)if("ks"in(s=r[o])&&!s.completed){if(s.completed=!0,s.hasMask){var f=s.masksProperties;for(c=f.length,l=0;l<c;l+=1)if(f[l].pt.k.i)n(f[l].pt.k);else for(d=f[l].pt.k.length,u=0;u<d;u+=1)f[l].pt.k[u].s&&n(f[l].pt.k[u].s[0]),f[l].pt.k[u].e&&n(f[l].pt.k[u].e[0])}0===s.ty?(s.layers=t(s.refId,a),e(s.layers,a)):4===s.ty?i(s.shapes):5===s.ty&&h(s)}}function t(e,t){var i=function(e,t){for(var i=0,n=t.length;i<n;){if(t[i].id===e)return t[i];i+=1}return null}(e,t);return i?i.layers.__used?JSON.parse(JSON.stringify(i.layers)):(i.layers.__used=!0,i.layers):null}function i(e){var t,r,a;for(t=e.length-1;t>=0;t-=1)if("sh"===e[t].ty)if(e[t].ks.k.i)n(e[t].ks.k);else for(a=e[t].ks.k.length,r=0;r<a;r+=1)e[t].ks.k[r].s&&n(e[t].ks.k[r].s[0]),e[t].ks.k[r].e&&n(e[t].ks.k[r].e[0]);else"gr"===e[t].ty&&i(e[t].it)}function n(e){var t,i=e.i.length;for(t=0;t<i;t+=1)e.i[t][0]+=e.v[t][0],e.i[t][1]+=e.v[t][1],e.o[t][0]+=e.v[t][0],e.o[t][1]+=e.v[t][1]}function r(e,t){var i=t?t.split("."):[100,100,100];return e[0]>i[0]||!(i[0]>e[0])&&(e[1]>i[1]||!(i[1]>e[1])&&(e[2]>i[2]||!(i[2]>e[2])&&null))}var a=function(){var e=[4,4,14];function t(e){var t=e.t.d;e.t.d={k:[{s:t,t:0}]}}function i(e){var i,n=e.length;for(i=0;i<n;i+=1)5===e[i].ty&&t(e[i])}return function(t){if(r(e,t.v)&&(i(t.layers),t.assets)){var n,a=t.assets.length;for(n=0;n<a;n+=1)t.assets[n].layers&&i(t.assets[n].layers)}}}(),s=function(){var e=[4,7,99];return function(t){if(t.chars&&!r(e,t.v)){var n,a=t.chars.length;for(n=0;n<a;n+=1){var s=t.chars[n];s.data&&s.data.shapes&&(i(s.data.shapes),s.data.ip=0,s.data.op=99999,s.data.st=0,s.data.sr=1,s.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},t.chars[n].t||(s.data.shapes.push({ty:"no"}),s.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}}}}(),o=function(){var e=[5,7,15];function t(e){var t=e.t.p;"number"===typeof t.a&&(t.a={a:0,k:t.a}),"number"===typeof t.p&&(t.p={a:0,k:t.p}),"number"===typeof t.r&&(t.r={a:0,k:t.r})}function i(e){var i,n=e.length;for(i=0;i<n;i+=1)5===e[i].ty&&t(e[i])}return function(t){if(r(e,t.v)&&(i(t.layers),t.assets)){var n,a=t.assets.length;for(n=0;n<a;n+=1)t.assets[n].layers&&i(t.assets[n].layers)}}}(),l=function(){var e=[4,1,9];function t(e){var i,n,r,a=e.length;for(i=0;i<a;i+=1)if("gr"===e[i].ty)t(e[i].it);else if("fl"===e[i].ty||"st"===e[i].ty)if(e[i].c.k&&e[i].c.k[0].i)for(r=e[i].c.k.length,n=0;n<r;n+=1)e[i].c.k[n].s&&(e[i].c.k[n].s[0]/=255,e[i].c.k[n].s[1]/=255,e[i].c.k[n].s[2]/=255,e[i].c.k[n].s[3]/=255),e[i].c.k[n].e&&(e[i].c.k[n].e[0]/=255,e[i].c.k[n].e[1]/=255,e[i].c.k[n].e[2]/=255,e[i].c.k[n].e[3]/=255);else e[i].c.k[0]/=255,e[i].c.k[1]/=255,e[i].c.k[2]/=255,e[i].c.k[3]/=255}function i(e){var i,n=e.length;for(i=0;i<n;i+=1)4===e[i].ty&&t(e[i].shapes)}return function(t){if(r(e,t.v)&&(i(t.layers),t.assets)){var n,a=t.assets.length;for(n=0;n<a;n+=1)t.assets[n].layers&&i(t.assets[n].layers)}}}(),c=function(){var e=[4,4,18];function t(e){var i,n,r;for(i=e.length-1;i>=0;i-=1)if("sh"===e[i].ty)if(e[i].ks.k.i)e[i].ks.k.c=e[i].closed;else for(r=e[i].ks.k.length,n=0;n<r;n+=1)e[i].ks.k[n].s&&(e[i].ks.k[n].s[0].c=e[i].closed),e[i].ks.k[n].e&&(e[i].ks.k[n].e[0].c=e[i].closed);else"gr"===e[i].ty&&t(e[i].it)}function i(e){var i,n,r,a,s,o,l=e.length;for(n=0;n<l;n+=1){if((i=e[n]).hasMask){var c=i.masksProperties;for(a=c.length,r=0;r<a;r+=1)if(c[r].pt.k.i)c[r].pt.k.c=c[r].cl;else for(o=c[r].pt.k.length,s=0;s<o;s+=1)c[r].pt.k[s].s&&(c[r].pt.k[s].s[0].c=c[r].cl),c[r].pt.k[s].e&&(c[r].pt.k[s].e[0].c=c[r].cl)}4===i.ty&&t(i.shapes)}}return function(t){if(r(e,t.v)&&(i(t.layers),t.assets)){var n,a=t.assets.length;for(n=0;n<a;n+=1)t.assets[n].layers&&i(t.assets[n].layers)}}}();function h(e){0===e.t.a.length&&e.t.p}var u={completeData:function(i){i.__complete||(l(i),a(i),s(i),o(i),c(i),e(i.layers,i.assets),function(i,n){if(i){var r=0,a=i.length;for(r=0;r<a;r+=1)1===i[r].t&&(i[r].data.layers=t(i[r].data.refId,n),e(i[r].data.layers,n))}}(i.chars,i.assets),i.__complete=!0)}};return u.checkColors=l,u.checkChars=s,u.checkPathProperties=o,u.checkShapes=c,u.completeLayers=e,u}()),a.assetLoader||(a.assetLoader=function(){function e(e){var t=e.getResponseHeader("content-type");return t&&"json"===e.responseType&&-1!==t.indexOf("json")||e.response&&"object"===_typeof$5(e.response)?e.response:e.response&&"string"===typeof e.response?JSON.parse(e.response):e.responseText?JSON.parse(e.responseText):null}return{load:function(t,i,n,r){var a,s=new XMLHttpRequest;try{s.responseType="json"}catch(o){}s.onreadystatechange=function(){if(4===s.readyState)if(200===s.status)a=e(s),n(a);else try{a=e(s),n(a)}catch(o){r&&r(o)}};try{s.open(["G","E","T"].join(""),t,!0)}catch(l){s.open(["G","E","T"].join(""),i+"/"+t,!0)}s.send()}}}()),"loadAnimation"===e.data.type)a.assetLoader.load(e.data.path,e.data.fullPath,(function(t){a.dataManager.completeData(t),a.postMessage({id:e.data.id,payload:t,status:"success"})}),(function(){a.postMessage({id:e.data.id,status:"error"})}));else if("complete"===e.data.type){var t=e.data.animation;a.dataManager.completeData(t),a.postMessage({id:e.data.id,payload:t,status:"success"})}else"loadData"===e.data.type&&a.assetLoader.load(e.data.path,e.data.fullPath,(function(t){a.postMessage({id:e.data.id,payload:t,status:"success"})}),(function(){a.postMessage({id:e.data.id,status:"error"})}))})),t.onmessage=function(e){var t=e.data,i=t.id,r=n[i];n[i]=null,"success"===t.status?r.onComplete(t.payload):r.onError&&r.onError()})}function o(e,t){var r="processId_"+(i+=1);return n[r]={onComplete:e,onError:t},r}return{loadAnimation:function(e,i,n){s();var r=o(i,n);t.postMessage({type:"loadAnimation",path:e,fullPath:window.location.origin+window.location.pathname,id:r})},loadData:function(e,i,n){s();var r=o(i,n);t.postMessage({type:"loadData",path:e,fullPath:window.location.origin+window.location.pathname,id:r})},completeAnimation:function(e,i,n){s();var r=o(i,n);t.postMessage({type:"complete",animation:e,id:r})}}}(),ImagePreloader=function(){var e=function(){var e=createTag("canvas");e.width=1,e.height=1;var t=e.getContext("2d");return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),e}();function t(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function i(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function n(e,t,i){var n="";if(e.e)n=e.p;else if(t){var r=e.p;-1!==r.indexOf("images/")&&(r=r.split("/")[1]),n=t+r}else n=i,n+=e.u?e.u:"",n+=e.p;return n}function r(e){var t=0,i=setInterval(function(){(e.getBBox().width||t>500)&&(this._imageLoaded(),clearInterval(i)),t+=1}.bind(this),50)}function a(e){var t={assetData:e},i=n(e,this.assetsPath,this.path);return dataManager.loadData(i,function(e){t.img=e,this._footageLoaded()}.bind(this),function(){t.img={},this._footageLoaded()}.bind(this)),t}function s(){this._imageLoaded=t.bind(this),this._footageLoaded=i.bind(this),this.testImageLoaded=r.bind(this),this.createFootageData=a.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return s.prototype={loadAssets:function(e,t){var i;this.imagesLoadedCb=t;var n=e.length;for(i=0;i<n;i+=1)e[i].layers||(e[i].t&&"seq"!==e[i].t?3===e[i].t&&(this.totalFootages+=1,this.images.push(this.createFootageData(e[i]))):(this.totalImages+=1,this.images.push(this._createImageData(e[i]))))},setAssetsPath:function(e){this.assetsPath=e||""},setPath:function(e){this.path=e||""},loadedImages:function(){return this.totalImages===this.loadedAssets},loadedFootages:function(){return this.totalFootages===this.loadedFootagesCount},destroy:function(){this.imagesLoadedCb=null,this.images.length=0},getAsset:function(e){for(var t=0,i=this.images.length;t<i;){if(this.images[t].assetData===e)return this.images[t].img;t+=1}return null},createImgData:function(t){var i=n(t,this.assetsPath,this.path),r=createTag("img");r.crossOrigin="anonymous",r.addEventListener("load",this._imageLoaded,!1),r.addEventListener("error",function(){a.img=e,this._imageLoaded()}.bind(this),!1),r.src=i;var a={img:r,assetData:t};return a},createImageData:function(t){var i=n(t,this.assetsPath,this.path),r=createNS("image");isSafari?this.testImageLoaded(r):r.addEventListener("load",this._imageLoaded,!1),r.addEventListener("error",function(){a.img=e,this._imageLoaded()}.bind(this),!1),r.setAttributeNS("http://www.w3.org/1999/xlink","href",i),this._elementHelper.append?this._elementHelper.append(r):this._elementHelper.appendChild(r);var a={img:r,assetData:t};return a},imageLoaded:t,footageLoaded:i,setCacheType:function(e,t){"svg"===e?(this._elementHelper=t,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}},s}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(e,t){if(this._cbs[e])for(var i=this._cbs[e],n=0;n<i.length;n+=1)i[n](t)},addEventListener:function(e,t){return this._cbs[e]||(this._cbs[e]=[]),this._cbs[e].push(t),function(){this.removeEventListener(e,t)}.bind(this)},removeEventListener:function(e,t){if(t){if(this._cbs[e]){for(var i=0,n=this._cbs[e].length;i<n;)this._cbs[e][i]===t&&(this._cbs[e].splice(i,1),i-=1,n-=1),i+=1;this._cbs[e].length||(this._cbs[e]=null)}}else this._cbs[e]=null}};var markerParser=function(){function e(e){for(var t,i=e.split("\r\n"),n={},r=0,a=0;a<i.length;a+=1)2===(t=i[a].split(":")).length&&(n[t[0]]=t[1].trim(),r+=1);if(0===r)throw new Error;return n}return function(t){for(var i=[],n=0;n<t.length;n+=1){var r=t[n],a={time:r.tm,duration:r.dr};try{a.payload=JSON.parse(t[n].cm)}catch(s){try{a.payload=e(t[n].cm)}catch(o){a.payload={name:t[n].cm}}}i.push(a)}return i}}(),ProjectInterface=function(){function e(e){this.compositions.push(e)}return function(){function t(e){for(var t=0,i=this.compositions.length;t<i;){if(this.compositions[t].data&&this.compositions[t].data.nm===e)return this.compositions[t].prepareFrame&&this.compositions[t].data.xt&&this.compositions[t].prepareFrame(this.currentFrame),this.compositions[t].compInterface;t+=1}return null}return t.compositions=[],t.currentFrame=0,t.registerComposition=e,t}}(),renderers={},registerRenderer=function(e,t){renderers[e]=t};function getRenderer(e){return renderers[e]}function getRegisteredRenderer(){if(renderers.canvas)return"canvas";for(var e in renderers)if(renderers[e])return e;return""}function _typeof$4(e){return _typeof$4="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$4(e)}var AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=getSubframeEnabled(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory(),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new BMEnterFrameEvent("drawnFrame",0,0,0),this.expressionsPlugin=getExpressionsPlugin()};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(e){(e.wrapper||e.container)&&(this.wrapper=e.wrapper||e.container);var t="svg";e.animType?t=e.animType:e.renderer&&(t=e.renderer);var i=getRenderer(t);this.renderer=new i(this,e.rendererSettings),this.imagePreloader.setCacheType(t,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=t,""===e.loop||null===e.loop||void 0===e.loop||!0===e.loop?this.loop=!0:!1===e.loop?this.loop=!1:this.loop=parseInt(e.loop,10),this.autoplay=!("autoplay"in e)||e.autoplay,this.name=e.name?e.name:"",this.autoloadSegments=!Object.prototype.hasOwnProperty.call(e,"autoloadSegments")||e.autoloadSegments,this.assetsPath=e.assetsPath,this.initialSegment=e.initialSegment,e.audioFactory&&this.audioController.setAudioFactory(e.audioFactory),e.animationData?this.setupAnimation(e.animationData):e.path&&(-1!==e.path.lastIndexOf("\\")?this.path=e.path.substr(0,e.path.lastIndexOf("\\")+1):this.path=e.path.substr(0,e.path.lastIndexOf("/")+1),this.fileName=e.path.substr(e.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),dataManager.loadAnimation(e.path,this.configAnimation,this.onSetupError))},AnimationItem.prototype.onSetupError=function(){this.trigger("data_failed")},AnimationItem.prototype.setupAnimation=function(e){dataManager.completeAnimation(e,this.configAnimation)},AnimationItem.prototype.setData=function(e,t){t&&"object"!==_typeof$4(t)&&(t=JSON.parse(t));var i={wrapper:e,animationData:t},n=e.attributes;i.path=n.getNamedItem("data-animation-path")?n.getNamedItem("data-animation-path").value:n.getNamedItem("data-bm-path")?n.getNamedItem("data-bm-path").value:n.getNamedItem("bm-path")?n.getNamedItem("bm-path").value:"",i.animType=n.getNamedItem("data-anim-type")?n.getNamedItem("data-anim-type").value:n.getNamedItem("data-bm-type")?n.getNamedItem("data-bm-type").value:n.getNamedItem("bm-type")?n.getNamedItem("bm-type").value:n.getNamedItem("data-bm-renderer")?n.getNamedItem("data-bm-renderer").value:n.getNamedItem("bm-renderer")?n.getNamedItem("bm-renderer").value:getRegisteredRenderer()||"canvas";var r=n.getNamedItem("data-anim-loop")?n.getNamedItem("data-anim-loop").value:n.getNamedItem("data-bm-loop")?n.getNamedItem("data-bm-loop").value:n.getNamedItem("bm-loop")?n.getNamedItem("bm-loop").value:"";"false"===r?i.loop=!1:"true"===r?i.loop=!0:""!==r&&(i.loop=parseInt(r,10));var a=n.getNamedItem("data-anim-autoplay")?n.getNamedItem("data-anim-autoplay").value:n.getNamedItem("data-bm-autoplay")?n.getNamedItem("data-bm-autoplay").value:!n.getNamedItem("bm-autoplay")||n.getNamedItem("bm-autoplay").value;i.autoplay="false"!==a,i.name=n.getNamedItem("data-name")?n.getNamedItem("data-name").value:n.getNamedItem("data-bm-name")?n.getNamedItem("data-bm-name").value:n.getNamedItem("bm-name")?n.getNamedItem("bm-name").value:"","false"===(n.getNamedItem("data-anim-prerender")?n.getNamedItem("data-anim-prerender").value:n.getNamedItem("data-bm-prerender")?n.getNamedItem("data-bm-prerender").value:n.getNamedItem("bm-prerender")?n.getNamedItem("bm-prerender").value:"")&&(i.prerender=!1),i.path?this.setParams(i):this.trigger("destroy")},AnimationItem.prototype.includeLayers=function(e){e.op>this.animationData.op&&(this.animationData.op=e.op,this.totalFrames=Math.floor(e.op-this.animationData.ip));var t,i,n=this.animationData.layers,r=n.length,a=e.layers,s=a.length;for(i=0;i<s;i+=1)for(t=0;t<r;){if(n[t].id===a[i].id){n[t]=a[i];break}t+=1}if((e.chars||e.fonts)&&(this.renderer.globalData.fontManager.addChars(e.chars),this.renderer.globalData.fontManager.addFonts(e.fonts,this.renderer.globalData.defs)),e.assets)for(r=e.assets.length,t=0;t<r;t+=1)this.animationData.assets.push(e.assets[t]);this.animationData.__complete=!1,dataManager.completeAnimation(this.animationData,this.onSegmentComplete)},AnimationItem.prototype.onSegmentComplete=function(e){this.animationData=e;var t=getExpressionsPlugin();t&&t.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var e=this.animationData.segments;if(!e||0===e.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var t=e.shift();this.timeCompleted=t.time*this.frameRate;var i=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,dataManager.loadData(i,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},AnimationItem.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(e){if(this.renderer)try{this.animationData=e,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(e),e.assets||(e.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(e.assets),this.markers=markerParser(e.markers||[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(t){this.triggerConfigError(t)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){if(!this.isLoaded&&this.renderer.globalData.fontManager.isLoaded&&(this.imagePreloader.loadedImages()||"canvas"!==this.renderer.rendererType)&&this.imagePreloader.loadedFootages()){this.isLoaded=!0;var e=getExpressionsPlugin();e&&e.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play()}},AnimationItem.prototype.resize=function(e,t){var i="number"===typeof e?e:void 0,n="number"===typeof t?t:void 0;this.renderer.updateContainerSize(i,n)},AnimationItem.prototype.setSubframe=function(e){this.isSubframeEnabled=!!e},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded&&this.renderer)try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(e){this.triggerRenderFrameError(e)}},AnimationItem.prototype.play=function(e){e&&this.name!==e||!0===this.isPaused&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(e){e&&this.name!==e||!1===this.isPaused&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(e){e&&this.name!==e||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(e){e&&this.name!==e||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(e){for(var t,i=0;i<this.markers.length;i+=1)if((t=this.markers[i]).payload&&t.payload.name===e)return t;return null},AnimationItem.prototype.goToAndStop=function(e,t,i){if(!i||this.name===i){var n=Number(e);if(isNaN(n)){var r=this.getMarkerData(e);r&&this.goToAndStop(r.time,!0)}else t?this.setCurrentRawFrameValue(e):this.setCurrentRawFrameValue(e*this.frameModifier);this.pause()}},AnimationItem.prototype.goToAndPlay=function(e,t,i){if(!i||this.name===i){var n=Number(e);if(isNaN(n)){var r=this.getMarkerData(e);r&&(r.duration?this.playSegments([r.time,r.time+r.duration],!0):this.goToAndStop(r.time,!0))}else this.goToAndStop(n,t,i);this.play()}},AnimationItem.prototype.advanceTime=function(e){if(!0!==this.isPaused&&!1!==this.isLoaded){var t=this.currentRawFrame+e*this.frameModifier,i=!1;t>=this.totalFrames-1&&this.frameModifier>0?this.loop&&this.playCount!==this.loop?t>=this.totalFrames?(this.playCount+=1,this.checkSegments(t%this.totalFrames)||(this.setCurrentRawFrameValue(t%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(t):this.checkSegments(t>this.totalFrames?t%this.totalFrames:0)||(i=!0,t=this.totalFrames-1):t<0?this.checkSegments(t%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(i=!0,t=0):(this.setCurrentRawFrameValue(this.totalFrames+t%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(t),i&&(this.setCurrentRawFrameValue(t),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(e,t){this.playCount=0,e[1]<e[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=e[0]-e[1],this.timeCompleted=this.totalFrames,this.firstFrame=e[1],this.setCurrentRawFrameValue(this.totalFrames-.001-t)):e[1]>e[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=e[1]-e[0],this.timeCompleted=this.totalFrames,this.firstFrame=e[0],this.setCurrentRawFrameValue(.001+t)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(e,t){var i=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<e?i=e:this.currentRawFrame+this.firstFrame>t&&(i=t-e)),this.firstFrame=e,this.totalFrames=t-e,this.timeCompleted=this.totalFrames,-1!==i&&this.goToAndStop(i,!0)},AnimationItem.prototype.playSegments=function(e,t){if(t&&(this.segments.length=0),"object"===_typeof$4(e[0])){var i,n=e.length;for(i=0;i<n;i+=1)this.segments.push(e[i])}else this.segments.push(e);this.segments.length&&t&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(e){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),e&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(e){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),e),!0)},AnimationItem.prototype.destroy=function(e){e&&this.name!==e||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.expressionsPlugin=null,this.imagePreloader=null,this.projectInterface=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(e){this.currentRawFrame=e,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(e){this.playSpeed=e,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(e){this.playDirection=e<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setLoop=function(e){this.loop=e},AnimationItem.prototype.setVolume=function(e,t){t&&this.name!==t||this.audioController.setVolume(e)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(e){e&&this.name!==e||this.audioController.mute()},AnimationItem.prototype.unmute=function(e){e&&this.name!==e||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(e){var t="";if(e.e)t=e.p;else if(this.assetsPath){var i=e.p;-1!==i.indexOf("images/")&&(i=i.split("/")[1]),t=this.assetsPath+i}else t=this.path,t+=e.u?e.u:"",t+=e.p;return t},AnimationItem.prototype.getAssetData=function(e){for(var t=0,i=this.assets.length;t<i;){if(e===this.assets[t].id)return this.assets[t];t+=1}return null},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(e){return e?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.updateDocumentData=function(e,t,i){try{this.renderer.getElementByPath(e).updateDocumentData(t,i)}catch(n){}},AnimationItem.prototype.trigger=function(e){if(this._cbs&&this._cbs[e])switch(e){case"enterFrame":this.triggerEvent(e,new BMEnterFrameEvent(e,this.currentFrame,this.totalFrames,this.frameModifier));break;case"drawnFrame":this.drawnFrameEvent.currentTime=this.currentFrame,this.drawnFrameEvent.totalTime=this.totalFrames,this.drawnFrameEvent.direction=this.frameModifier,this.triggerEvent(e,this.drawnFrameEvent);break;case"loopComplete":this.triggerEvent(e,new BMCompleteLoopEvent(e,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(e,new BMCompleteEvent(e,this.frameMult));break;case"segmentStart":this.triggerEvent(e,new BMSegmentStartEvent(e,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(e,new BMDestroyEvent(e,this));break;default:this.triggerEvent(e)}"enterFrame"===e&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(e,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===e&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(e,this.loop,this.playCount,this.frameMult)),"complete"===e&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(e,this.frameMult)),"segmentStart"===e&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(e,this.firstFrame,this.totalFrames)),"destroy"===e&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(e,this))},AnimationItem.prototype.triggerRenderFrameError=function(e){var t=new BMRenderFrameErrorEvent(e,this.currentFrame);this.triggerEvent("error",t),this.onError&&this.onError.call(this,t)},AnimationItem.prototype.triggerConfigError=function(e){var t=new BMConfigErrorEvent(e,this.currentFrame);this.triggerEvent("error",t),this.onError&&this.onError.call(this,t)};var animationManager=function(){var e={},t=[],i=0,n=0,r=0,a=!0,s=!1;function o(e){for(var i=0,r=e.target;i<n;)t[i].animation===r&&(t.splice(i,1),i-=1,n-=1,r.isPaused||h()),i+=1}function l(e,i){if(!e)return null;for(var r=0;r<n;){if(t[r].elem===e&&null!==t[r].elem)return t[r].animation;r+=1}var a=new AnimationItem;return u(a,e),a.setData(e,i),a}function c(){r+=1,f()}function h(){r-=1}function u(e,i){e.addEventListener("destroy",o),e.addEventListener("_active",c),e.addEventListener("_idle",h),t.push({elem:i,animation:e}),n+=1}function d(e){var o,l=e-i;for(o=0;o<n;o+=1)t[o].animation.advanceTime(l);i=e,r&&!s?window.requestAnimationFrame(d):a=!0}function p(e){i=e,window.requestAnimationFrame(d)}function f(){!s&&r&&a&&(window.requestAnimationFrame(p),a=!1)}return e.registerAnimation=l,e.loadAnimation=function(e){var t=new AnimationItem;return u(t,null),t.setParams(e),t},e.setSpeed=function(e,i){var r;for(r=0;r<n;r+=1)t[r].animation.setSpeed(e,i)},e.setDirection=function(e,i){var r;for(r=0;r<n;r+=1)t[r].animation.setDirection(e,i)},e.play=function(e){var i;for(i=0;i<n;i+=1)t[i].animation.play(e)},e.pause=function(e){var i;for(i=0;i<n;i+=1)t[i].animation.pause(e)},e.stop=function(e){var i;for(i=0;i<n;i+=1)t[i].animation.stop(e)},e.togglePause=function(e){var i;for(i=0;i<n;i+=1)t[i].animation.togglePause(e)},e.searchAnimations=function(e,t,i){var n,r=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),a=r.length;for(n=0;n<a;n+=1)i&&r[n].setAttribute("data-bm-type",i),l(r[n],e);if(t&&0===a){i||(i="svg");var s=document.getElementsByTagName("body")[0];s.innerText="";var o=createTag("div");o.style.width="100%",o.style.height="100%",o.setAttribute("data-bm-type",i),s.appendChild(o),l(o,e)}},e.resize=function(){var e;for(e=0;e<n;e+=1)t[e].animation.resize()},e.goToAndStop=function(e,i,r){var a;for(a=0;a<n;a+=1)t[a].animation.goToAndStop(e,i,r)},e.destroy=function(e){var i;for(i=n-1;i>=0;i-=1)t[i].animation.destroy(e)},e.freeze=function(){s=!0},e.unfreeze=function(){s=!1,f()},e.setVolume=function(e,i){var r;for(r=0;r<n;r+=1)t[r].animation.setVolume(e,i)},e.mute=function(e){var i;for(i=0;i<n;i+=1)t[i].animation.mute(e)},e.unmute=function(e){var i;for(i=0;i<n;i+=1)t[i].animation.unmute(e)},e.getRegisteredAnimations=function(){var e,i=t.length,n=[];for(e=0;e<i;e+=1)n.push(t[e].animation);return n},e}(),BezierFactory=function(){var e={getBezierEasing:function(e,i,n,r,a){var s=a||("bez_"+e+"_"+i+"_"+n+"_"+r).replace(/\./g,"p");if(t[s])return t[s];var o=new h([e,i,n,r]);return t[s]=o,o}},t={},i=11,n=1/(i-1),r="function"===typeof Float32Array;function a(e,t){return 1-3*t+3*e}function s(e,t){return 3*t-6*e}function o(e){return 3*e}function l(e,t,i){return((a(t,i)*e+s(t,i))*e+o(t))*e}function c(e,t,i){return 3*a(t,i)*e*e+2*s(t,i)*e+o(t)}function h(e){this._p=e,this._mSampleValues=r?new Float32Array(i):new Array(i),this._precomputed=!1,this.get=this.get.bind(this)}return h.prototype={get:function(e){var t=this._p[0],i=this._p[1],n=this._p[2],r=this._p[3];return this._precomputed||this._precompute(),t===i&&n===r?e:0===e?0:1===e?1:l(this._getTForX(e),i,r)},_precompute:function(){var e=this._p[0],t=this._p[1],i=this._p[2],n=this._p[3];this._precomputed=!0,e===t&&i===n||this._calcSampleValues()},_calcSampleValues:function(){for(var e=this._p[0],t=this._p[2],r=0;r<i;++r)this._mSampleValues[r]=l(r*n,e,t)},_getTForX:function(e){for(var t=this._p[0],r=this._p[2],a=this._mSampleValues,s=0,o=1,h=i-1;o!==h&&a[o]<=e;++o)s+=n;var u=s+(e-a[--o])/(a[o+1]-a[o])*n,d=c(u,t,r);return d>=.001?function(e,t,i,n){for(var r=0;r<4;++r){var a=c(t,i,n);if(0===a)return t;t-=(l(t,i,n)-e)/a}return t}(e,u,t,r):0===d?u:function(e,t,i,n,r){var a,s,o=0;do{(a=l(s=t+(i-t)/2,n,r)-e)>0?i=s:t=s}while(Math.abs(a)>1e-7&&++o<10);return s}(e,s,s+n,t,r)}},e}(),pooling={double:function(e){return e.concat(createSizedArray(e.length))}},poolFactory=function(e,t,i){var n=0,r=e,a=createSizedArray(r);return{newElement:function(){return n?a[n-=1]:t()},release:function(e){n===r&&(a=pooling.double(a),r*=2),i&&i(e),a[n]=e,n+=1}}},bezierLengthPool=poolFactory(8,(function(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}})),segmentsLengthPool=poolFactory(8,(function(){return{lengths:[],totalLength:0}}),(function(e){var t,i=e.lengths.length;for(t=0;t<i;t+=1)bezierLengthPool.release(e.lengths[t]);e.lengths.length=0}));function bezFunction(){var e=Math;function t(e,t,i,n,r,a){var s=e*n+t*r+i*a-r*n-a*e-i*t;return s>-.001&&s<.001}var i=function(e,t,i,n){var r,a,s,o,l,c,h=getDefaultCurveSegments(),u=0,d=[],p=[],f=bezierLengthPool.newElement();for(s=i.length,r=0;r<h;r+=1){for(l=r/(h-1),c=0,a=0;a<s;a+=1)o=bmPow(1-l,3)*e[a]+3*bmPow(1-l,2)*l*i[a]+3*(1-l)*bmPow(l,2)*n[a]+bmPow(l,3)*t[a],d[a]=o,null!==p[a]&&(c+=bmPow(d[a]-p[a],2)),p[a]=d[a];c&&(u+=c=bmSqrt(c)),f.percents[r]=l,f.lengths[r]=u}return f.addedLength=u,f};function n(e){this.segmentLength=0,this.points=new Array(e)}function r(e,t){this.partialLength=e,this.point=t}var a=function(){var e={};return function(i,a,s,o){var l=(i[0]+"_"+i[1]+"_"+a[0]+"_"+a[1]+"_"+s[0]+"_"+s[1]+"_"+o[0]+"_"+o[1]).replace(/\./g,"p");if(!e[l]){var c,h,u,d,p,f,m,g=getDefaultCurveSegments(),v=0,y=null;2===i.length&&(i[0]!==a[0]||i[1]!==a[1])&&t(i[0],i[1],a[0],a[1],i[0]+s[0],i[1]+s[1])&&t(i[0],i[1],a[0],a[1],a[0]+o[0],a[1]+o[1])&&(g=2);var b=new n(g);for(u=s.length,c=0;c<g;c+=1){for(m=createSizedArray(u),p=c/(g-1),f=0,h=0;h<u;h+=1)d=bmPow(1-p,3)*i[h]+3*bmPow(1-p,2)*p*(i[h]+s[h])+3*(1-p)*bmPow(p,2)*(a[h]+o[h])+bmPow(p,3)*a[h],m[h]=d,null!==y&&(f+=bmPow(m[h]-y[h],2));v+=f=bmSqrt(f),b.points[c]=new r(f,m),y=m}b.segmentLength=v,e[l]=b}return e[l]}}();function s(e,t){var i=t.percents,n=t.lengths,r=i.length,a=bmFloor((r-1)*e),s=e*t.addedLength,o=0;if(a===r-1||0===a||s===n[a])return i[a];for(var l=n[a]>s?-1:1,c=!0;c;)if(n[a]<=s&&n[a+1]>s?(o=(s-n[a])/(n[a+1]-n[a]),c=!1):a+=l,a<0||a>=r-1){if(a===r-1)return i[a];c=!1}return i[a]+(i[a+1]-i[a])*o}var o=createTypedArray("float32",8);return{getSegmentsLength:function(e){var t,n=segmentsLengthPool.newElement(),r=e.c,a=e.v,s=e.o,o=e.i,l=e._length,c=n.lengths,h=0;for(t=0;t<l-1;t+=1)c[t]=i(a[t],a[t+1],s[t],o[t+1]),h+=c[t].addedLength;return r&&l&&(c[t]=i(a[t],a[0],s[t],o[0]),h+=c[t].addedLength),n.totalLength=h,n},getNewSegment:function(t,i,n,r,a,l,c){a<0?a=0:a>1&&(a=1);var h,u=s(a,c),d=s(l=l>1?1:l,c),p=t.length,f=1-u,m=1-d,g=f*f*f,v=u*f*f*3,y=u*u*f*3,b=u*u*u,x=f*f*m,w=u*f*m+f*u*m+f*f*d,_=u*u*m+f*u*d+u*f*d,S=u*u*d,E=f*m*m,C=u*m*m+f*d*m+f*m*d,A=u*d*m+f*d*d+u*m*d,M=u*d*d,T=m*m*m,P=d*m*m+m*d*m+m*m*d,D=d*d*m+m*d*d+d*m*d,k=d*d*d;for(h=0;h<p;h+=1)o[4*h]=e.round(1e3*(g*t[h]+v*n[h]+y*r[h]+b*i[h]))/1e3,o[4*h+1]=e.round(1e3*(x*t[h]+w*n[h]+_*r[h]+S*i[h]))/1e3,o[4*h+2]=e.round(1e3*(E*t[h]+C*n[h]+A*r[h]+M*i[h]))/1e3,o[4*h+3]=e.round(1e3*(T*t[h]+P*n[h]+D*r[h]+k*i[h]))/1e3;return o},getPointInSegment:function(t,i,n,r,a,o){var l=s(a,o),c=1-l;return[e.round(1e3*(c*c*c*t[0]+(l*c*c+c*l*c+c*c*l)*n[0]+(l*l*c+c*l*l+l*c*l)*r[0]+l*l*l*i[0]))/1e3,e.round(1e3*(c*c*c*t[1]+(l*c*c+c*l*c+c*c*l)*n[1]+(l*l*c+c*l*l+l*c*l)*r[1]+l*l*l*i[1]))/1e3]},buildBezierData:a,pointOnLine2D:t,pointOnLine3D:function(i,n,r,a,s,o,l,c,h){if(0===r&&0===o&&0===h)return t(i,n,a,s,l,c);var u,d=e.sqrt(e.pow(a-i,2)+e.pow(s-n,2)+e.pow(o-r,2)),p=e.sqrt(e.pow(l-i,2)+e.pow(c-n,2)+e.pow(h-r,2)),f=e.sqrt(e.pow(l-a,2)+e.pow(c-s,2)+e.pow(h-o,2));return(u=d>p?d>f?d-p-f:f-p-d:f>p?f-p-d:p-d-f)>-1e-4&&u<1e-4}}}var bez=bezFunction(),initFrame=initialDefaultFrame,mathAbs=Math.abs;function interpolateValue(e,t){var i,n=this.offsetTime;"multidimensional"===this.propType&&(i=createTypedArray("float32",this.pv.length));for(var r,a,s,o,l,c,h,u,d,p=t.lastIndex,f=p,m=this.keyframes.length-1,g=!0;g;){if(r=this.keyframes[f],a=this.keyframes[f+1],f===m-1&&e>=a.t-n){r.h&&(r=a),p=0;break}if(a.t-n>e){p=f;break}f<m-1?f+=1:(p=0,g=!1)}s=this.keyframesMetadata[f]||{};var v,y=a.t-n,b=r.t-n;if(r.to){s.bezierData||(s.bezierData=bez.buildBezierData(r.s,a.s||r.e,r.to,r.ti));var x=s.bezierData;if(e>=y||e<b){var w=e>=y?x.points.length-1:0;for(l=x.points[w].point.length,o=0;o<l;o+=1)i[o]=x.points[w].point[o]}else{s.__fnct?d=s.__fnct:(d=BezierFactory.getBezierEasing(r.o.x,r.o.y,r.i.x,r.i.y,r.n).get,s.__fnct=d),c=d((e-b)/(y-b));var _,S=x.segmentLength*c,E=t.lastFrame<e&&t._lastKeyframeIndex===f?t._lastAddedLength:0;for(u=t.lastFrame<e&&t._lastKeyframeIndex===f?t._lastPoint:0,g=!0,h=x.points.length;g;){if(E+=x.points[u].partialLength,0===S||0===c||u===x.points.length-1){for(l=x.points[u].point.length,o=0;o<l;o+=1)i[o]=x.points[u].point[o];break}if(S>=E&&S<E+x.points[u+1].partialLength){for(_=(S-E)/x.points[u+1].partialLength,l=x.points[u].point.length,o=0;o<l;o+=1)i[o]=x.points[u].point[o]+(x.points[u+1].point[o]-x.points[u].point[o])*_;break}u<h-1?u+=1:g=!1}t._lastPoint=u,t._lastAddedLength=E-x.points[u].partialLength,t._lastKeyframeIndex=f}}else{var C,A,M,T,P;if(m=r.s.length,v=a.s||r.e,this.sh&&1!==r.h)e>=y?(i[0]=v[0],i[1]=v[1],i[2]=v[2]):e<=b?(i[0]=r.s[0],i[1]=r.s[1],i[2]=r.s[2]):quaternionToEuler(i,slerp(createQuaternion(r.s),createQuaternion(v),(e-b)/(y-b)));else for(f=0;f<m;f+=1)1!==r.h&&(e>=y?c=1:e<b?c=0:(r.o.x.constructor===Array?(s.__fnct||(s.__fnct=[]),s.__fnct[f]?d=s.__fnct[f]:(C=void 0===r.o.x[f]?r.o.x[0]:r.o.x[f],A=void 0===r.o.y[f]?r.o.y[0]:r.o.y[f],M=void 0===r.i.x[f]?r.i.x[0]:r.i.x[f],T=void 0===r.i.y[f]?r.i.y[0]:r.i.y[f],d=BezierFactory.getBezierEasing(C,A,M,T).get,s.__fnct[f]=d)):s.__fnct?d=s.__fnct:(C=r.o.x,A=r.o.y,M=r.i.x,T=r.i.y,d=BezierFactory.getBezierEasing(C,A,M,T).get,r.keyframeMetadata=d),c=d((e-b)/(y-b)))),v=a.s||r.e,P=1===r.h?r.s[f]:r.s[f]+(v[f]-r.s[f])*c,"multidimensional"===this.propType?i[f]=P:i=P}return t.lastIndex=p,i}function slerp(e,t,i){var n,r,a,s,o,l=[],c=e[0],h=e[1],u=e[2],d=e[3],p=t[0],f=t[1],m=t[2],g=t[3];return(r=c*p+h*f+u*m+d*g)<0&&(r=-r,p=-p,f=-f,m=-m,g=-g),1-r>1e-6?(n=Math.acos(r),a=Math.sin(n),s=Math.sin((1-i)*n)/a,o=Math.sin(i*n)/a):(s=1-i,o=i),l[0]=s*c+o*p,l[1]=s*h+o*f,l[2]=s*u+o*m,l[3]=s*d+o*g,l}function quaternionToEuler(e,t){var i=t[0],n=t[1],r=t[2],a=t[3],s=Math.atan2(2*n*a-2*i*r,1-2*n*n-2*r*r),o=Math.asin(2*i*n+2*r*a),l=Math.atan2(2*i*a-2*n*r,1-2*i*i-2*r*r);e[0]=s/degToRads,e[1]=o/degToRads,e[2]=l/degToRads}function createQuaternion(e){var t=e[0]*degToRads,i=e[1]*degToRads,n=e[2]*degToRads,r=Math.cos(t/2),a=Math.cos(i/2),s=Math.cos(n/2),o=Math.sin(t/2),l=Math.sin(i/2),c=Math.sin(n/2);return[o*l*s+r*a*c,o*a*s+r*l*c,r*l*s-o*a*c,r*a*s-o*l*c]}function getValueAtCurrentTime(){var e=this.comp.renderedFrame-this.offsetTime,t=this.keyframes[0].t-this.offsetTime,i=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(e===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=i&&e>=i||this._caching.lastFrame<t&&e<t))){this._caching.lastFrame>=e&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var n=this.interpolateValue(e,this._caching);this.pv=n}return this._caching.lastFrame=e,this.pv}function setVValue(e){var t;if("unidimensional"===this.propType)t=e*this.mult,mathAbs(this.v-t)>1e-5&&(this.v=t,this._mdf=!0);else for(var i=0,n=this.v.length;i<n;)t=e[i]*this.mult,mathAbs(this.v[i]-t)>1e-5&&(this.v[i]=t,this._mdf=!0),i+=1}function processEffectsSequence(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var e;this.lock=!0,this._mdf=this._isFirstFrame;var t=this.effectsSequence.length,i=this.kf?this.pv:this.data.k;for(e=0;e<t;e+=1)i=this.effectsSequence[e](i);this.setVValue(i),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function addEffect(e){this.effectsSequence.push(e),this.container.addDynamicProperty(this)}function ValueProperty(e,t,i,n){this.propType="unidimensional",this.mult=i||1,this.data=t,this.v=i?t.k*i:t.k,this.pv=t.k,this._mdf=!1,this.elem=e,this.container=n,this.comp=e.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function MultiDimensionalProperty(e,t,i,n){var r;this.propType="multidimensional",this.mult=i||1,this.data=t,this._mdf=!1,this.elem=e,this.container=n,this.comp=e.comp,this.k=!1,this.kf=!1,this.frameId=-1;var a=t.k.length;for(this.v=createTypedArray("float32",a),this.pv=createTypedArray("float32",a),this.vel=createTypedArray("float32",a),r=0;r<a;r+=1)this.v[r]=t.k[r]*this.mult,this.pv[r]=t.k[r];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function KeyframedValueProperty(e,t,i,n){this.propType="unidimensional",this.keyframes=t.k,this.keyframesMetadata=[],this.offsetTime=e.data.st,this.frameId=-1,this._caching={lastFrame:initFrame,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=t,this.mult=i||1,this.elem=e,this.container=n,this.comp=e.comp,this.v=initFrame,this.pv=initFrame,this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.addEffect=addEffect}function KeyframedMultidimensionalProperty(e,t,i,n){var r;this.propType="multidimensional";var a,s,o,l,c=t.k.length;for(r=0;r<c-1;r+=1)t.k[r].to&&t.k[r].s&&t.k[r+1]&&t.k[r+1].s&&(a=t.k[r].s,s=t.k[r+1].s,o=t.k[r].to,l=t.k[r].ti,(2===a.length&&(a[0]!==s[0]||a[1]!==s[1])&&bez.pointOnLine2D(a[0],a[1],s[0],s[1],a[0]+o[0],a[1]+o[1])&&bez.pointOnLine2D(a[0],a[1],s[0],s[1],s[0]+l[0],s[1]+l[1])||3===a.length&&(a[0]!==s[0]||a[1]!==s[1]||a[2]!==s[2])&&bez.pointOnLine3D(a[0],a[1],a[2],s[0],s[1],s[2],a[0]+o[0],a[1]+o[1],a[2]+o[2])&&bez.pointOnLine3D(a[0],a[1],a[2],s[0],s[1],s[2],s[0]+l[0],s[1]+l[1],s[2]+l[2]))&&(t.k[r].to=null,t.k[r].ti=null),a[0]===s[0]&&a[1]===s[1]&&0===o[0]&&0===o[1]&&0===l[0]&&0===l[1]&&(2===a.length||a[2]===s[2]&&0===o[2]&&0===l[2])&&(t.k[r].to=null,t.k[r].ti=null));this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.data=t,this.keyframes=t.k,this.keyframesMetadata=[],this.offsetTime=e.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=i||1,this.elem=e,this.container=n,this.comp=e.comp,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.frameId=-1;var h=t.k[0].s.length;for(this.v=createTypedArray("float32",h),this.pv=createTypedArray("float32",h),r=0;r<h;r+=1)this.v[r]=initFrame,this.pv[r]=initFrame;this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray("float32",h)},this.addEffect=addEffect}var PropertyFactory={getProp:function(e,t,i,n,r){var a;if(t.sid&&(t=e.globalData.slotManager.getProp(t)),t.k.length)if("number"===typeof t.k[0])a=new MultiDimensionalProperty(e,t,n,r);else switch(i){case 0:a=new KeyframedValueProperty(e,t,n,r);break;case 1:a=new KeyframedMultidimensionalProperty(e,t,n,r)}else a=new ValueProperty(e,t,n,r);return a.effectsSequence.length&&r.addDynamicProperty(a),a}};function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(e){-1===this.dynamicProperties.indexOf(e)&&(this.dynamicProperties.push(e),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){var e;this._mdf=!1;var t=this.dynamicProperties.length;for(e=0;e<t;e+=1)this.dynamicProperties[e].getValue(),this.dynamicProperties[e]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(e){this.container=e,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var pointPool=poolFactory(8,(function(){return createTypedArray("float32",2)}));function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(e,t){this.c=e,this.setLength(t);for(var i=0;i<t;)this.v[i]=pointPool.newElement(),this.o[i]=pointPool.newElement(),this.i[i]=pointPool.newElement(),i+=1},ShapePath.prototype.setLength=function(e){for(;this._maxLength<e;)this.doubleArrayLength();this._length=e},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(e,t,i,n,r){var a;switch(this._length=Math.max(this._length,n+1),this._length>=this._maxLength&&this.doubleArrayLength(),i){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o;break;default:a=[]}(!a[n]||a[n]&&!r)&&(a[n]=pointPool.newElement()),a[n][0]=e,a[n][1]=t},ShapePath.prototype.setTripleAt=function(e,t,i,n,r,a,s,o){this.setXYAt(e,t,"v",s,o),this.setXYAt(i,n,"o",s,o),this.setXYAt(r,a,"i",s,o)},ShapePath.prototype.reverse=function(){var e=new ShapePath;e.setPathData(this.c,this._length);var t=this.v,i=this.o,n=this.i,r=0;this.c&&(e.setTripleAt(t[0][0],t[0][1],n[0][0],n[0][1],i[0][0],i[0][1],0,!1),r=1);var a,s=this._length-1,o=this._length;for(a=r;a<o;a+=1)e.setTripleAt(t[s][0],t[s][1],n[s][0],n[s][1],i[s][0],i[s][1],a,!1),s-=1;return e},ShapePath.prototype.length=function(){return this._length};var shapePool=function(){var e=poolFactory(4,(function(){return new ShapePath}),(function(e){var t,i=e._length;for(t=0;t<i;t+=1)pointPool.release(e.v[t]),pointPool.release(e.i[t]),pointPool.release(e.o[t]),e.v[t]=null,e.i[t]=null,e.o[t]=null;e._length=0,e.c=!1}));return e.clone=function(t){var i,n=e.newElement(),r=void 0===t._length?t.v.length:t._length;for(n.setLength(r),n.c=t.c,i=0;i<r;i+=1)n.setTripleAt(t.v[i][0],t.v[i][1],t.o[i][0],t.o[i][1],t.i[i][0],t.i[i][1],i);return n},e}();function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}ShapeCollection.prototype.addShape=function(e){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=e,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var e;for(e=0;e<this._length;e+=1)shapePool.release(this.shapes[e]);this._length=0};var shapeCollectionPool=function(){var e={newShapeCollection:function(){return t?n[t-=1]:new ShapeCollection},release:function(e){var r,a=e._length;for(r=0;r<a;r+=1)shapePool.release(e.shapes[r]);e._length=0,t===i&&(n=pooling.double(n),i*=2),n[t]=e,t+=1}},t=0,i=4,n=createSizedArray(i);return e}(),ShapePropertyFactory=function(){var e=-999999;function t(e,t,i){var n,r,a,s,o,l,c,h,u,d=i.lastIndex,p=this.keyframes;if(e<p[0].t-this.offsetTime)n=p[0].s[0],a=!0,d=0;else if(e>=p[p.length-1].t-this.offsetTime)n=p[p.length-1].s?p[p.length-1].s[0]:p[p.length-2].e[0],a=!0;else{for(var f,m,g,v=d,y=p.length-1,b=!0;b&&(f=p[v],!((m=p[v+1]).t-this.offsetTime>e));)v<y-1?v+=1:b=!1;if(g=this.keyframesMetadata[v]||{},d=v,!(a=1===f.h)){if(e>=m.t-this.offsetTime)h=1;else if(e<f.t-this.offsetTime)h=0;else{var x;g.__fnct?x=g.__fnct:(x=BezierFactory.getBezierEasing(f.o.x,f.o.y,f.i.x,f.i.y).get,g.__fnct=x),h=x((e-(f.t-this.offsetTime))/(m.t-this.offsetTime-(f.t-this.offsetTime)))}r=m.s?m.s[0]:f.e[0]}n=f.s[0]}for(l=t._length,c=n.i[0].length,i.lastIndex=d,s=0;s<l;s+=1)for(o=0;o<c;o+=1)u=a?n.i[s][o]:n.i[s][o]+(r.i[s][o]-n.i[s][o])*h,t.i[s][o]=u,u=a?n.o[s][o]:n.o[s][o]+(r.o[s][o]-n.o[s][o])*h,t.o[s][o]=u,u=a?n.v[s][o]:n.v[s][o]+(r.v[s][o]-n.v[s][o])*h,t.v[s][o]=u}function i(){var t=this.comp.renderedFrame-this.offsetTime,i=this.keyframes[0].t-this.offsetTime,n=this.keyframes[this.keyframes.length-1].t-this.offsetTime,r=this._caching.lastFrame;return r!==e&&(r<i&&t<i||r>n&&t>n)||(this._caching.lastIndex=r<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}function n(){this.paths=this.localShapeCollection}function r(e){(function(e,t){if(e._length!==t._length||e.c!==t.c)return!1;var i,n=e._length;for(i=0;i<n;i+=1)if(e.v[i][0]!==t.v[i][0]||e.v[i][1]!==t.v[i][1]||e.o[i][0]!==t.o[i][0]||e.o[i][1]!==t.o[i][1]||e.i[i][0]!==t.i[i][0]||e.i[i][1]!==t.i[i][1])return!1;return!0})(this.v,e)||(this.v=shapePool.clone(e),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function a(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var e,t;this.lock=!0,this._mdf=!1,e=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k;var i=this.effectsSequence.length;for(t=0;t<i;t+=1)e=this.effectsSequence[t](e);this.setVValue(e),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function s(e,t,i){this.propType="shape",this.comp=e.comp,this.container=e,this.elem=e,this.data=t,this.k=!1,this.kf=!1,this._mdf=!1;var r=3===i?t.pt.k:t.ks.k;this.v=shapePool.clone(r),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=n,this.effectsSequence=[]}function o(e){this.effectsSequence.push(e),this.container.addDynamicProperty(this)}function l(t,r,a){this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data.st,this.keyframes=3===a?r.pt.k:r.ks.k,this.keyframesMetadata=[],this.k=!0,this.kf=!0;var s=this.keyframes[0].s[0].i.length;this.v=shapePool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,s),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=e,this.reset=n,this._caching={lastFrame:e,lastIndex:0},this.effectsSequence=[i.bind(this)]}s.prototype.interpolateShape=t,s.prototype.getValue=a,s.prototype.setVValue=r,s.prototype.addEffect=o,l.prototype.getValue=a,l.prototype.interpolateShape=t,l.prototype.setVValue=r,l.prototype.addEffect=o;var c=function(){var e=roundCorner;function t(e,t){this.v=shapePool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=t.d,this.elem=e,this.comp=e.comp,this.frameId=-1,this.initDynamicPropertyContainer(e),this.p=PropertyFactory.getProp(e,t.p,1,0,this),this.s=PropertyFactory.getProp(e,t.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return t.prototype={reset:n,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var t=this.p.v[0],i=this.p.v[1],n=this.s.v[0]/2,r=this.s.v[1]/2,a=3!==this.d,s=this.v;s.v[0][0]=t,s.v[0][1]=i-r,s.v[1][0]=a?t+n:t-n,s.v[1][1]=i,s.v[2][0]=t,s.v[2][1]=i+r,s.v[3][0]=a?t-n:t+n,s.v[3][1]=i,s.i[0][0]=a?t-n*e:t+n*e,s.i[0][1]=i-r,s.i[1][0]=a?t+n:t-n,s.i[1][1]=i-r*e,s.i[2][0]=a?t+n*e:t-n*e,s.i[2][1]=i+r,s.i[3][0]=a?t-n:t+n,s.i[3][1]=i+r*e,s.o[0][0]=a?t+n*e:t-n*e,s.o[0][1]=i-r,s.o[1][0]=a?t+n:t-n,s.o[1][1]=i+r*e,s.o[2][0]=a?t-n*e:t+n*e,s.o[2][1]=i+r,s.o[3][0]=a?t-n:t+n,s.o[3][1]=i-r*e}},extendPrototype([DynamicPropertyContainer],t),t}(),h=function(){function e(e,t){this.v=shapePool.newElement(),this.v.setPathData(!0,0),this.elem=e,this.comp=e.comp,this.data=t,this.frameId=-1,this.d=t.d,this.initDynamicPropertyContainer(e),1===t.sy?(this.ir=PropertyFactory.getProp(e,t.ir,0,0,this),this.is=PropertyFactory.getProp(e,t.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(e,t.pt,0,0,this),this.p=PropertyFactory.getProp(e,t.p,1,0,this),this.r=PropertyFactory.getProp(e,t.r,0,degToRads,this),this.or=PropertyFactory.getProp(e,t.or,0,0,this),this.os=PropertyFactory.getProp(e,t.os,0,.01,this),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return e.prototype={reset:n,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var e,t,i,n,r=2*Math.floor(this.pt.v),a=2*Math.PI/r,s=!0,o=this.or.v,l=this.ir.v,c=this.os.v,h=this.is.v,u=2*Math.PI*o/(2*r),d=2*Math.PI*l/(2*r),p=-Math.PI/2;p+=this.r.v;var f=3===this.data.d?-1:1;for(this.v._length=0,e=0;e<r;e+=1){i=s?c:h,n=s?u:d;var m=(t=s?o:l)*Math.cos(p),g=t*Math.sin(p),v=0===m&&0===g?0:g/Math.sqrt(m*m+g*g),y=0===m&&0===g?0:-m/Math.sqrt(m*m+g*g);m+=+this.p.v[0],g+=+this.p.v[1],this.v.setTripleAt(m,g,m-v*n*i*f,g-y*n*i*f,m+v*n*i*f,g+y*n*i*f,e,!0),s=!s,p+=a*f}},convertPolygonToPath:function(){var e,t=Math.floor(this.pt.v),i=2*Math.PI/t,n=this.or.v,r=this.os.v,a=2*Math.PI*n/(4*t),s=.5*-Math.PI,o=3===this.data.d?-1:1;for(s+=this.r.v,this.v._length=0,e=0;e<t;e+=1){var l=n*Math.cos(s),c=n*Math.sin(s),h=0===l&&0===c?0:c/Math.sqrt(l*l+c*c),u=0===l&&0===c?0:-l/Math.sqrt(l*l+c*c);l+=+this.p.v[0],c+=+this.p.v[1],this.v.setTripleAt(l,c,l-h*a*r*o,c-u*a*r*o,l+h*a*r*o,c+u*a*r*o,e,!0),s+=i*o}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],e),e}(),u=function(){function e(e,t){this.v=shapePool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=e,this.comp=e.comp,this.frameId=-1,this.d=t.d,this.initDynamicPropertyContainer(e),this.p=PropertyFactory.getProp(e,t.p,1,0,this),this.s=PropertyFactory.getProp(e,t.s,1,0,this),this.r=PropertyFactory.getProp(e,t.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return e.prototype={convertRectToPath:function(){var e=this.p.v[0],t=this.p.v[1],i=this.s.v[0]/2,n=this.s.v[1]/2,r=bmMin(i,n,this.r.v),a=r*(1-roundCorner);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(e+i,t-n+r,e+i,t-n+r,e+i,t-n+a,0,!0),this.v.setTripleAt(e+i,t+n-r,e+i,t+n-a,e+i,t+n-r,1,!0),0!==r?(this.v.setTripleAt(e+i-r,t+n,e+i-r,t+n,e+i-a,t+n,2,!0),this.v.setTripleAt(e-i+r,t+n,e-i+a,t+n,e-i+r,t+n,3,!0),this.v.setTripleAt(e-i,t+n-r,e-i,t+n-r,e-i,t+n-a,4,!0),this.v.setTripleAt(e-i,t-n+r,e-i,t-n+a,e-i,t-n+r,5,!0),this.v.setTripleAt(e-i+r,t-n,e-i+r,t-n,e-i+a,t-n,6,!0),this.v.setTripleAt(e+i-r,t-n,e+i-a,t-n,e+i-r,t-n,7,!0)):(this.v.setTripleAt(e-i,t+n,e-i+a,t+n,e-i,t+n,2),this.v.setTripleAt(e-i,t-n,e-i,t-n+a,e-i,t-n,3))):(this.v.setTripleAt(e+i,t-n+r,e+i,t-n+a,e+i,t-n+r,0,!0),0!==r?(this.v.setTripleAt(e+i-r,t-n,e+i-r,t-n,e+i-a,t-n,1,!0),this.v.setTripleAt(e-i+r,t-n,e-i+a,t-n,e-i+r,t-n,2,!0),this.v.setTripleAt(e-i,t-n+r,e-i,t-n+r,e-i,t-n+a,3,!0),this.v.setTripleAt(e-i,t+n-r,e-i,t+n-a,e-i,t+n-r,4,!0),this.v.setTripleAt(e-i+r,t+n,e-i+r,t+n,e-i+a,t+n,5,!0),this.v.setTripleAt(e+i-r,t+n,e+i-a,t+n,e+i-r,t+n,6,!0),this.v.setTripleAt(e+i,t+n-r,e+i,t+n-r,e+i,t+n-a,7,!0)):(this.v.setTripleAt(e-i,t-n,e-i+a,t-n,e-i,t-n,1,!0),this.v.setTripleAt(e-i,t+n,e-i,t+n-a,e-i,t+n,2,!0),this.v.setTripleAt(e+i,t+n,e+i-a,t+n,e+i,t+n,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:n},extendPrototype([DynamicPropertyContainer],e),e}(),d={getShapeProp:function(e,t,i){var n;return 3===i||4===i?n=(3===i?t.pt:t.ks).k.length?new l(e,t,i):new s(e,t,i):5===i?n=new u(e,t):6===i?n=new c(e,t):7===i&&(n=new h(e,t)),n.k&&e.addDynamicProperty(n),n},getConstructorFunction:function(){return s},getKeyframedConstructorFunction:function(){return l}};return d}(),Matrix=function(){var e=Math.cos,t=Math.sin,i=Math.tan,n=Math.round;function r(){return this.props[0]=1,this.props[1]=0,this.props[2]=0,this.props[3]=0,this.props[4]=0,this.props[5]=1,this.props[6]=0,this.props[7]=0,this.props[8]=0,this.props[9]=0,this.props[10]=1,this.props[11]=0,this.props[12]=0,this.props[13]=0,this.props[14]=0,this.props[15]=1,this}function a(i){if(0===i)return this;var n=e(i),r=t(i);return this._t(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1)}function s(i){if(0===i)return this;var n=e(i),r=t(i);return this._t(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1)}function o(i){if(0===i)return this;var n=e(i),r=t(i);return this._t(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1)}function l(i){if(0===i)return this;var n=e(i),r=t(i);return this._t(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1)}function c(e,t){return this._t(1,t,e,1,0,0)}function h(e,t){return this.shear(i(e),i(t))}function u(n,r){var a=e(r),s=t(r);return this._t(a,s,0,0,-s,a,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,i(n),1,0,0,0,0,1,0,0,0,0,1)._t(a,-s,0,0,s,a,0,0,0,0,1,0,0,0,0,1)}function d(e,t,i){return i||0===i||(i=1),1===e&&1===t&&1===i?this:this._t(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1)}function p(e,t,i,n,r,a,s,o,l,c,h,u,d,p,f,m){return this.props[0]=e,this.props[1]=t,this.props[2]=i,this.props[3]=n,this.props[4]=r,this.props[5]=a,this.props[6]=s,this.props[7]=o,this.props[8]=l,this.props[9]=c,this.props[10]=h,this.props[11]=u,this.props[12]=d,this.props[13]=p,this.props[14]=f,this.props[15]=m,this}function f(e,t,i){return i=i||0,0!==e||0!==t||0!==i?this._t(1,0,0,0,0,1,0,0,0,0,1,0,e,t,i,1):this}function m(e,t,i,n,r,a,s,o,l,c,h,u,d,p,f,m){var g=this.props;if(1===e&&0===t&&0===i&&0===n&&0===r&&1===a&&0===s&&0===o&&0===l&&0===c&&1===h&&0===u)return g[12]=g[12]*e+g[15]*d,g[13]=g[13]*a+g[15]*p,g[14]=g[14]*h+g[15]*f,g[15]*=m,this._identityCalculated=!1,this;var v=g[0],y=g[1],b=g[2],x=g[3],w=g[4],_=g[5],S=g[6],E=g[7],C=g[8],A=g[9],M=g[10],T=g[11],P=g[12],D=g[13],k=g[14],O=g[15];return g[0]=v*e+y*r+b*l+x*d,g[1]=v*t+y*a+b*c+x*p,g[2]=v*i+y*s+b*h+x*f,g[3]=v*n+y*o+b*u+x*m,g[4]=w*e+_*r+S*l+E*d,g[5]=w*t+_*a+S*c+E*p,g[6]=w*i+_*s+S*h+E*f,g[7]=w*n+_*o+S*u+E*m,g[8]=C*e+A*r+M*l+T*d,g[9]=C*t+A*a+M*c+T*p,g[10]=C*i+A*s+M*h+T*f,g[11]=C*n+A*o+M*u+T*m,g[12]=P*e+D*r+k*l+O*d,g[13]=P*t+D*a+k*c+O*p,g[14]=P*i+D*s+k*h+O*f,g[15]=P*n+D*o+k*u+O*m,this._identityCalculated=!1,this}function g(e){var t=e.props;return this.transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function v(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function y(e){for(var t=0;t<16;){if(e.props[t]!==this.props[t])return!1;t+=1}return!0}function b(e){var t;for(t=0;t<16;t+=1)e.props[t]=this.props[t];return e}function x(e){var t;for(t=0;t<16;t+=1)this.props[t]=e[t]}function w(e,t,i){return{x:e*this.props[0]+t*this.props[4]+i*this.props[8]+this.props[12],y:e*this.props[1]+t*this.props[5]+i*this.props[9]+this.props[13],z:e*this.props[2]+t*this.props[6]+i*this.props[10]+this.props[14]}}function _(e,t,i){return e*this.props[0]+t*this.props[4]+i*this.props[8]+this.props[12]}function S(e,t,i){return e*this.props[1]+t*this.props[5]+i*this.props[9]+this.props[13]}function E(e,t,i){return e*this.props[2]+t*this.props[6]+i*this.props[10]+this.props[14]}function C(){var e=this.props[0]*this.props[5]-this.props[1]*this.props[4],t=this.props[5]/e,i=-this.props[1]/e,n=-this.props[4]/e,r=this.props[0]/e,a=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/e,s=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/e,o=new Matrix;return o.props[0]=t,o.props[1]=i,o.props[4]=n,o.props[5]=r,o.props[12]=a,o.props[13]=s,o}function A(e){return this.getInverseMatrix().applyToPointArray(e[0],e[1],e[2]||0)}function M(e){var t,i=e.length,n=[];for(t=0;t<i;t+=1)n[t]=A(e[t]);return n}function T(e,t,i){var n=createTypedArray("float32",6);if(this.isIdentity())n[0]=e[0],n[1]=e[1],n[2]=t[0],n[3]=t[1],n[4]=i[0],n[5]=i[1];else{var r=this.props[0],a=this.props[1],s=this.props[4],o=this.props[5],l=this.props[12],c=this.props[13];n[0]=e[0]*r+e[1]*s+l,n[1]=e[0]*a+e[1]*o+c,n[2]=t[0]*r+t[1]*s+l,n[3]=t[0]*a+t[1]*o+c,n[4]=i[0]*r+i[1]*s+l,n[5]=i[0]*a+i[1]*o+c}return n}function P(e,t,i){return this.isIdentity()?[e,t,i]:[e*this.props[0]+t*this.props[4]+i*this.props[8]+this.props[12],e*this.props[1]+t*this.props[5]+i*this.props[9]+this.props[13],e*this.props[2]+t*this.props[6]+i*this.props[10]+this.props[14]]}function D(e,t){if(this.isIdentity())return e+","+t;var i=this.props;return Math.round(100*(e*i[0]+t*i[4]+i[12]))/100+","+Math.round(100*(e*i[1]+t*i[5]+i[13]))/100}function k(){for(var e=0,t=this.props,i="matrix3d(";e<16;)i+=n(1e4*t[e])/1e4,i+=15===e?")":",",e+=1;return i}function O(e){return e<1e-6&&e>0||e>-1e-6&&e<0?n(1e4*e)/1e4:e}function I(){var e=this.props;return"matrix("+O(e[0])+","+O(e[1])+","+O(e[4])+","+O(e[5])+","+O(e[12])+","+O(e[13])+")"}return function(){this.reset=r,this.rotate=a,this.rotateX=s,this.rotateY=o,this.rotateZ=l,this.skew=h,this.skewFromAxis=u,this.shear=c,this.scale=d,this.setTransform=p,this.translate=f,this.transform=m,this.multiply=g,this.applyToPoint=w,this.applyToX=_,this.applyToY=S,this.applyToZ=E,this.applyToPointArray=P,this.applyToTriplePoints=T,this.applyToPointStringified=D,this.toCSS=k,this.to2dCSS=I,this.clone=b,this.cloneFromProps=x,this.equals=y,this.inversePoints=M,this.inversePoint=A,this.getInverseMatrix=C,this._t=this.transform,this.isIdentity=v,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();function _typeof$3(e){return _typeof$3="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$3(e)}var lottie={},standalone="__[STANDALONE]__",animationData="__[ANIMATIONDATA]__",renderer="";function setLocation(e){setLocationHref(e)}function searchAnimations(){!0===standalone?animationManager.searchAnimations(animationData,standalone,renderer):animationManager.searchAnimations()}function setSubframeRendering(e){setSubframeEnabled(e)}function setPrefix(e){setIdPrefix(e)}function loadAnimation(e){return!0===standalone&&(e.animationData=JSON.parse(animationData)),animationManager.loadAnimation(e)}function setQuality(e){if("string"===typeof e)switch(e){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10)}else!isNaN(e)&&e>1&&setDefaultCurveSegments(e);getDefaultCurveSegments()>=50?roundValues(!1):roundValues(!0)}function inBrowser(){return"undefined"!==typeof navigator}function installPlugin(e,t){"expressions"===e&&setExpressionsPlugin(t)}function getFactory(e){switch(e){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}function checkReady(){"complete"===document.readyState&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(e){for(var t=queryString.split("&"),i=0;i<t.length;i+=1){var n=t[i].split("=");if(decodeURIComponent(n[0])==e)return decodeURIComponent(n[1])}return null}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocation,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.useWebWorker=setWebWorker,lottie.setIDPrefix=setPrefix,lottie.__getFactory=getFactory,lottie.version="5.12.2";var queryString="";if(standalone){var scripts=document.getElementsByTagName("script"),index=scripts.length-1,myScript=scripts[index]||{src:""};queryString=myScript.src?myScript.src.replace(/^[^\?]+\??/,""):"",renderer=getQueryVariable("renderer")}var readyStateCheckInterval=setInterval(checkReady,100);try{"object"!==_typeof$3(exports)&&__webpack_require__.amdO}catch(err){}var ShapeModifiers=function(){var e={},t={};return e.registerModifier=function(e,i){t[e]||(t[e]=i)},e.getModifier=function(e,i,n){return new t[e](i,n)},e}();function ShapeModifier(){}function TrimModifier(){}function PuckerAndBloatModifier(){}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(e){if(!this.closed){e.sh.container.addDynamicProperty(e.sh);var t={shape:e.sh,data:e,localShapeCollection:shapeCollectionPool.newShapeCollection()};this.shapes.push(t),this.addShapeToModifier(t),this._isAnimated&&e.setAsAnimated()}},ShapeModifier.prototype.init=function(e,t){this.shapes=[],this.elem=e,this.initDynamicPropertyContainer(e),this.initModifierProperties(e,t),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},extendPrototype([DynamicPropertyContainer],ShapeModifier),extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(e,t){this.s=PropertyFactory.getProp(e,t.s,0,.01,this),this.e=PropertyFactory.getProp(e,t.e,0,.01,this),this.o=PropertyFactory.getProp(e,t.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=t.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},TrimModifier.prototype.addShapeToModifier=function(e){e.pathsData=[]},TrimModifier.prototype.calculateShapeEdges=function(e,t,i,n,r){var a=[];t<=1?a.push({s:e,e:t}):e>=1?a.push({s:e-1,e:t-1}):(a.push({s:e,e:1}),a.push({s:0,e:t-1}));var s,o,l=[],c=a.length;for(s=0;s<c;s+=1){var h,u;(o=a[s]).e*r<n||o.s*r>n+i||(h=o.s*r<=n?0:(o.s*r-n)/i,u=o.e*r>=n+i?1:(o.e*r-n)/i,l.push([h,u]))}return l.length||l.push([0,0]),l},TrimModifier.prototype.releasePathsData=function(e){var t,i=e.length;for(t=0;t<i;t+=1)segmentsLengthPool.release(e[t]);return e.length=0,e},TrimModifier.prototype.processShapes=function(e){var t,i,n,r;if(this._mdf||e){var a=this.o.v%360/360;if(a<0&&(a+=1),(t=this.s.v>1?1+a:this.s.v<0?0+a:this.s.v+a)>(i=this.e.v>1?1+a:this.e.v<0?0+a:this.e.v+a)){var s=t;t=i,i=s}t=1e-4*Math.round(1e4*t),i=1e-4*Math.round(1e4*i),this.sValue=t,this.eValue=i}else t=this.sValue,i=this.eValue;var o,l,c,h,u,d=this.shapes.length,p=0;if(i===t)for(r=0;r<d;r+=1)this.shapes[r].localShapeCollection.releaseShapes(),this.shapes[r].shape._mdf=!0,this.shapes[r].shape.paths=this.shapes[r].localShapeCollection,this._mdf&&(this.shapes[r].pathsData.length=0);else if(1===i&&0===t||0===i&&1===t){if(this._mdf)for(r=0;r<d;r+=1)this.shapes[r].pathsData.length=0,this.shapes[r].shape._mdf=!0}else{var f,m,g=[];for(r=0;r<d;r+=1)if((f=this.shapes[r]).shape._mdf||this._mdf||e||2===this.m){if(l=(n=f.shape.paths)._length,u=0,!f.shape._mdf&&f.pathsData.length)u=f.totalShapeLength;else{for(c=this.releasePathsData(f.pathsData),o=0;o<l;o+=1)h=bez.getSegmentsLength(n.shapes[o]),c.push(h),u+=h.totalLength;f.totalShapeLength=u,f.pathsData=c}p+=u,f.shape._mdf=!0}else f.shape.paths=f.localShapeCollection;var v,y=t,b=i,x=0;for(r=d-1;r>=0;r-=1)if((f=this.shapes[r]).shape._mdf){for((m=f.localShapeCollection).releaseShapes(),2===this.m&&d>1?(v=this.calculateShapeEdges(t,i,f.totalShapeLength,x,p),x+=f.totalShapeLength):v=[[y,b]],l=v.length,o=0;o<l;o+=1){y=v[o][0],b=v[o][1],g.length=0,b<=1?g.push({s:f.totalShapeLength*y,e:f.totalShapeLength*b}):y>=1?g.push({s:f.totalShapeLength*(y-1),e:f.totalShapeLength*(b-1)}):(g.push({s:f.totalShapeLength*y,e:f.totalShapeLength}),g.push({s:0,e:f.totalShapeLength*(b-1)}));var w=this.addShapes(f,g[0]);if(g[0].s!==g[0].e){if(g.length>1)if(f.shape.paths.shapes[f.shape.paths._length-1].c){var _=w.pop();this.addPaths(w,m),w=this.addShapes(f,g[1],_)}else this.addPaths(w,m),w=this.addShapes(f,g[1]);this.addPaths(w,m)}}f.shape.paths=m}}},TrimModifier.prototype.addPaths=function(e,t){var i,n=e.length;for(i=0;i<n;i+=1)t.addShape(e[i])},TrimModifier.prototype.addSegment=function(e,t,i,n,r,a,s){r.setXYAt(t[0],t[1],"o",a),r.setXYAt(i[0],i[1],"i",a+1),s&&r.setXYAt(e[0],e[1],"v",a),r.setXYAt(n[0],n[1],"v",a+1)},TrimModifier.prototype.addSegmentFromArray=function(e,t,i,n){t.setXYAt(e[1],e[5],"o",i),t.setXYAt(e[2],e[6],"i",i+1),n&&t.setXYAt(e[0],e[4],"v",i),t.setXYAt(e[3],e[7],"v",i+1)},TrimModifier.prototype.addShapes=function(e,t,i){var n,r,a,s,o,l,c,h,u=e.pathsData,d=e.shape.paths.shapes,p=e.shape.paths._length,f=0,m=[],g=!0;for(i?(o=i._length,h=i._length):(i=shapePool.newElement(),o=0,h=0),m.push(i),n=0;n<p;n+=1){for(l=u[n].lengths,i.c=d[n].c,a=d[n].c?l.length:l.length+1,r=1;r<a;r+=1)if(f+(s=l[r-1]).addedLength<t.s)f+=s.addedLength,i.c=!1;else{if(f>t.e){i.c=!1;break}t.s<=f&&t.e>=f+s.addedLength?(this.addSegment(d[n].v[r-1],d[n].o[r-1],d[n].i[r],d[n].v[r],i,o,g),g=!1):(c=bez.getNewSegment(d[n].v[r-1],d[n].v[r],d[n].o[r-1],d[n].i[r],(t.s-f)/s.addedLength,(t.e-f)/s.addedLength,l[r-1]),this.addSegmentFromArray(c,i,o,g),g=!1,i.c=!1),f+=s.addedLength,o+=1}if(d[n].c&&l.length){if(s=l[r-1],f<=t.e){var v=l[r-1].addedLength;t.s<=f&&t.e>=f+v?(this.addSegment(d[n].v[r-1],d[n].o[r-1],d[n].i[0],d[n].v[0],i,o,g),g=!1):(c=bez.getNewSegment(d[n].v[r-1],d[n].v[0],d[n].o[r-1],d[n].i[0],(t.s-f)/v,(t.e-f)/v,l[r-1]),this.addSegmentFromArray(c,i,o,g),g=!1,i.c=!1)}else i.c=!1;f+=s.addedLength,o+=1}if(i._length&&(i.setXYAt(i.v[h][0],i.v[h][1],"i",h),i.setXYAt(i.v[i._length-1][0],i.v[i._length-1][1],"o",i._length-1)),f>t.e)break;n<p-1&&(i=shapePool.newElement(),g=!0,m.push(i),o=0)}return m},extendPrototype([ShapeModifier],PuckerAndBloatModifier),PuckerAndBloatModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(e,t.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},PuckerAndBloatModifier.prototype.processPath=function(e,t){var i=t/100,n=[0,0],r=e._length,a=0;for(a=0;a<r;a+=1)n[0]+=e.v[a][0],n[1]+=e.v[a][1];n[0]/=r,n[1]/=r;var s,o,l,c,h,u,d=shapePool.newElement();for(d.c=e.c,a=0;a<r;a+=1)s=e.v[a][0]+(n[0]-e.v[a][0])*i,o=e.v[a][1]+(n[1]-e.v[a][1])*i,l=e.o[a][0]+(n[0]-e.o[a][0])*-i,c=e.o[a][1]+(n[1]-e.o[a][1])*-i,h=e.i[a][0]+(n[0]-e.i[a][0])*-i,u=e.i[a][1]+(n[1]-e.i[a][1])*-i,d.setTripleAt(s,o,l,c,h,u,a);return d},PuckerAndBloatModifier.prototype.processShapes=function(e){var t,i,n,r,a,s,o=this.shapes.length,l=this.amount.v;if(0!==l)for(i=0;i<o;i+=1){if(s=(a=this.shapes[i]).localShapeCollection,a.shape._mdf||this._mdf||e)for(s.releaseShapes(),a.shape._mdf=!0,t=a.shape.paths.shapes,r=a.shape.paths._length,n=0;n<r;n+=1)s.addShape(this.processPath(t[n],l));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)};var TransformPropertyFactory=function(){var e=[0,0];function t(e,t,i){if(this.elem=e,this.frameId=-1,this.propType="transform",this.data=t,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(i||e),t.p&&t.p.s?(this.px=PropertyFactory.getProp(e,t.p.x,0,0,this),this.py=PropertyFactory.getProp(e,t.p.y,0,0,this),t.p.z&&(this.pz=PropertyFactory.getProp(e,t.p.z,0,0,this))):this.p=PropertyFactory.getProp(e,t.p||{k:[0,0,0]},1,0,this),t.rx){if(this.rx=PropertyFactory.getProp(e,t.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(e,t.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(e,t.rz,0,degToRads,this),t.or.k[0].ti){var n,r=t.or.k.length;for(n=0;n<r;n+=1)t.or.k[n].to=null,t.or.k[n].ti=null}this.or=PropertyFactory.getProp(e,t.or,1,degToRads,this),this.or.sh=!0}else this.r=PropertyFactory.getProp(e,t.r||{k:0},0,degToRads,this);t.sk&&(this.sk=PropertyFactory.getProp(e,t.sk,0,degToRads,this),this.sa=PropertyFactory.getProp(e,t.sa,0,degToRads,this)),this.a=PropertyFactory.getProp(e,t.a||{k:[0,0,0]},1,0,this),this.s=PropertyFactory.getProp(e,t.s||{k:[100,100,100]},1,.01,this),t.o?this.o=PropertyFactory.getProp(e,t.o,0,.01,e):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}return t.prototype={applyToMatrix:function(e){var t=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||t,this.a&&e.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&e.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&e.skewFromAxis(-this.sk.v,this.sa.v),this.r?e.rotate(-this.r.v):e.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.data.p.s?this.data.p.z?e.translate(this.px.v,this.py.v,-this.pz.v):e.translate(this.px.v,this.py.v,0):e.translate(this.p.v[0],this.p.v[1],-this.p.v[2])},getValue:function(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){var i;if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.autoOriented){var n,r;if(i=this.elem.globalData.frameRate,this.p&&this.p.keyframes&&this.p.getValueAtTime)this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(n=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/i,0),r=this.p.getValueAtTime(this.p.keyframes[0].t/i,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(n=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/i,0),r=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/i,0)):(n=this.p.pv,r=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/i,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){n=[],r=[];var a=this.px,s=this.py;a._caching.lastFrame+a.offsetTime<=a.keyframes[0].t?(n[0]=a.getValueAtTime((a.keyframes[0].t+.01)/i,0),n[1]=s.getValueAtTime((s.keyframes[0].t+.01)/i,0),r[0]=a.getValueAtTime(a.keyframes[0].t/i,0),r[1]=s.getValueAtTime(s.keyframes[0].t/i,0)):a._caching.lastFrame+a.offsetTime>=a.keyframes[a.keyframes.length-1].t?(n[0]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/i,0),n[1]=s.getValueAtTime(s.keyframes[s.keyframes.length-1].t/i,0),r[0]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/i,0),r[1]=s.getValueAtTime((s.keyframes[s.keyframes.length-1].t-.01)/i,0)):(n=[a.pv,s.pv],r[0]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/i,a.offsetTime),r[1]=s.getValueAtTime((s._caching.lastFrame+s.offsetTime-.01)/i,s.offsetTime))}else n=r=e;this.v.rotate(-Math.atan2(n[1]-r[1],n[0]-r[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],t),t.prototype.addDynamicProperty=function(e){this._addDynamicProperty(e),this.elem.addDynamicProperty(e),this._isDirty=!0},t.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(e,i,n){return new t(e,i,n)}}}();function RepeaterModifier(){}function RoundCornersModifier(){}function floatEqual(e,t){return 1e5*Math.abs(e-t)<=Math.min(Math.abs(e),Math.abs(t))}function floatZero(e){return Math.abs(e)<=1e-5}function lerp(e,t,i){return e*(1-i)+t*i}function lerpPoint(e,t,i){return[lerp(e[0],t[0],i),lerp(e[1],t[1],i)]}function quadRoots(e,t,i){if(0===e)return[];var n=t*t-4*e*i;if(n<0)return[];var r=-t/(2*e);if(0===n)return[r];var a=Math.sqrt(n)/(2*e);return[r-a,r+a]}function polynomialCoefficients(e,t,i,n){return[3*t-e-3*i+n,3*e-6*t+3*i,-3*e+3*t,e]}function singlePoint(e){return new PolynomialBezier(e,e,e,e,!1)}function PolynomialBezier(e,t,i,n,r){r&&pointEqual(e,t)&&(t=lerpPoint(e,n,1/3)),r&&pointEqual(i,n)&&(i=lerpPoint(e,n,2/3));var a=polynomialCoefficients(e[0],t[0],i[0],n[0]),s=polynomialCoefficients(e[1],t[1],i[1],n[1]);this.a=[a[0],s[0]],this.b=[a[1],s[1]],this.c=[a[2],s[2]],this.d=[a[3],s[3]],this.points=[e,t,i,n]}function extrema(e,t){var i=e.points[0][t],n=e.points[e.points.length-1][t];if(i>n){var r=n;n=i,i=r}for(var a=quadRoots(3*e.a[t],2*e.b[t],e.c[t]),s=0;s<a.length;s+=1)if(a[s]>0&&a[s]<1){var o=e.point(a[s])[t];o<i?i=o:o>n&&(n=o)}return{min:i,max:n}}function intersectData(e,t,i){var n=e.boundingBox();return{cx:n.cx,cy:n.cy,width:n.width,height:n.height,bez:e,t:(t+i)/2,t1:t,t2:i}}function splitData(e){var t=e.bez.split(.5);return[intersectData(t[0],e.t1,e.t),intersectData(t[1],e.t,e.t2)]}function boxIntersect(e,t){return 2*Math.abs(e.cx-t.cx)<e.width+t.width&&2*Math.abs(e.cy-t.cy)<e.height+t.height}function intersectsImpl(e,t,i,n,r,a){if(boxIntersect(e,t))if(i>=a||e.width<=n&&e.height<=n&&t.width<=n&&t.height<=n)r.push([e.t,t.t]);else{var s=splitData(e),o=splitData(t);intersectsImpl(s[0],o[0],i+1,n,r,a),intersectsImpl(s[0],o[1],i+1,n,r,a),intersectsImpl(s[1],o[0],i+1,n,r,a),intersectsImpl(s[1],o[1],i+1,n,r,a)}}function crossProduct(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function lineIntersection(e,t,i,n){var r=[e[0],e[1],1],a=[t[0],t[1],1],s=[i[0],i[1],1],o=[n[0],n[1],1],l=crossProduct(crossProduct(r,a),crossProduct(s,o));return floatZero(l[2])?null:[l[0]/l[2],l[1]/l[2]]}function polarOffset(e,t,i){return[e[0]+Math.cos(t)*i,e[1]-Math.sin(t)*i]}function pointDistance(e,t){return Math.hypot(e[0]-t[0],e[1]-t[1])}function pointEqual(e,t){return floatEqual(e[0],t[0])&&floatEqual(e[1],t[1])}function ZigZagModifier(){}function setPoint(e,t,i,n,r,a,s){var o=i-Math.PI/2,l=i+Math.PI/2,c=t[0]+Math.cos(i)*n*r,h=t[1]-Math.sin(i)*n*r;e.setTripleAt(c,h,c+Math.cos(o)*a,h-Math.sin(o)*a,c+Math.cos(l)*s,h-Math.sin(l)*s,e.length())}function getPerpendicularVector(e,t){var i=[t[0]-e[0],t[1]-e[1]],n=.5*-Math.PI;return[Math.cos(n)*i[0]-Math.sin(n)*i[1],Math.sin(n)*i[0]+Math.cos(n)*i[1]]}function getProjectingAngle(e,t){var i=0===t?e.length()-1:t-1,n=(t+1)%e.length(),r=getPerpendicularVector(e.v[i],e.v[n]);return Math.atan2(0,1)-Math.atan2(r[1],r[0])}function zigZagCorner(e,t,i,n,r,a,s){var o=getProjectingAngle(t,i),l=t.v[i%t._length],c=t.v[0===i?t._length-1:i-1],h=t.v[(i+1)%t._length],u=2===a?Math.sqrt(Math.pow(l[0]-c[0],2)+Math.pow(l[1]-c[1],2)):0,d=2===a?Math.sqrt(Math.pow(l[0]-h[0],2)+Math.pow(l[1]-h[1],2)):0;setPoint(e,t.v[i%t._length],o,s,n,d/(2*(r+1)),u/(2*(r+1)),a)}function zigZagSegment(e,t,i,n,r,a){for(var s=0;s<n;s+=1){var o=(s+1)/(n+1),l=2===r?Math.sqrt(Math.pow(t.points[3][0]-t.points[0][0],2)+Math.pow(t.points[3][1]-t.points[0][1],2)):0,c=t.normalAngle(o);setPoint(e,t.point(o),c,a,i,l/(2*(n+1)),l/(2*(n+1)),r),a=-a}return a}function linearOffset(e,t,i){var n=Math.atan2(t[0]-e[0],t[1]-e[1]);return[polarOffset(e,n,i),polarOffset(t,n,i)]}function offsetSegment(e,t){var i,n,r,a,s,o,l;i=(l=linearOffset(e.points[0],e.points[1],t))[0],n=l[1],r=(l=linearOffset(e.points[1],e.points[2],t))[0],a=l[1],s=(l=linearOffset(e.points[2],e.points[3],t))[0],o=l[1];var c=lineIntersection(i,n,r,a);null===c&&(c=n);var h=lineIntersection(s,o,r,a);return null===h&&(h=s),new PolynomialBezier(i,c,h,o)}function joinLines(e,t,i,n,r){var a=t.points[3],s=i.points[0];if(3===n)return a;if(pointEqual(a,s))return a;if(2===n){var o=-t.tangentAngle(1),l=-i.tangentAngle(0)+Math.PI,c=lineIntersection(a,polarOffset(a,o+Math.PI/2,100),s,polarOffset(s,o+Math.PI/2,100)),h=c?pointDistance(c,a):pointDistance(a,s)/2,u=polarOffset(a,o,2*h*roundCorner);return e.setXYAt(u[0],u[1],"o",e.length()-1),u=polarOffset(s,l,2*h*roundCorner),e.setTripleAt(s[0],s[1],s[0],s[1],u[0],u[1],e.length()),s}var d=lineIntersection(pointEqual(a,t.points[2])?t.points[0]:t.points[2],a,s,pointEqual(s,i.points[1])?i.points[3]:i.points[1]);return d&&pointDistance(d,a)<r?(e.setTripleAt(d[0],d[1],d[0],d[1],d[0],d[1],e.length()),d):a}function getIntersection(e,t){var i=e.intersections(t);return i.length&&floatEqual(i[0][0],1)&&i.shift(),i.length?i[0]:null}function pruneSegmentIntersection(e,t){var i=e.slice(),n=t.slice(),r=getIntersection(e[e.length-1],t[0]);return r&&(i[e.length-1]=e[e.length-1].split(r[0])[0],n[0]=t[0].split(r[1])[1]),e.length>1&&t.length>1&&(r=getIntersection(e[0],t[t.length-1]))?[[e[0].split(r[0])[0]],[t[t.length-1].split(r[1])[1]]]:[i,n]}function pruneIntersections(e){for(var t,i=1;i<e.length;i+=1)t=pruneSegmentIntersection(e[i-1],e[i]),e[i-1]=t[0],e[i]=t[1];return e.length>1&&(t=pruneSegmentIntersection(e[e.length-1],e[0]),e[e.length-1]=t[0],e[0]=t[1]),e}function offsetSegmentSplit(e,t){var i,n,r,a,s=e.inflectionPoints();if(0===s.length)return[offsetSegment(e,t)];if(1===s.length||floatEqual(s[1],1))return i=(r=e.split(s[0]))[0],n=r[1],[offsetSegment(i,t),offsetSegment(n,t)];i=(r=e.split(s[0]))[0];var o=(s[1]-s[0])/(1-s[0]);return a=(r=r[1].split(o))[0],n=r[1],[offsetSegment(i,t),offsetSegment(a,t),offsetSegment(n,t)]}function OffsetPathModifier(){}function getFontProperties(e){for(var t=e.fStyle?e.fStyle.split(" "):[],i="normal",n="normal",r=t.length,a=0;a<r;a+=1)switch(t[a].toLowerCase()){case"italic":n="italic";break;case"bold":i="700";break;case"black":i="900";break;case"medium":i="500";break;case"regular":case"normal":i="400";break;case"light":case"thin":i="200"}return{style:n,weight:e.fWeight||i}}extendPrototype([ShapeModifier],RepeaterModifier),RepeaterModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.c=PropertyFactory.getProp(e,t.c,0,null,this),this.o=PropertyFactory.getProp(e,t.o,0,null,this),this.tr=TransformPropertyFactory.getTransformProperty(e,t.tr,this),this.so=PropertyFactory.getProp(e,t.tr.so,0,.01,this),this.eo=PropertyFactory.getProp(e,t.tr.eo,0,.01,this),this.data=t,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Matrix,this.rMatrix=new Matrix,this.sMatrix=new Matrix,this.tMatrix=new Matrix,this.matrix=new Matrix},RepeaterModifier.prototype.applyTransforms=function(e,t,i,n,r,a){var s=a?-1:1,o=n.s.v[0]+(1-n.s.v[0])*(1-r),l=n.s.v[1]+(1-n.s.v[1])*(1-r);e.translate(n.p.v[0]*s*r,n.p.v[1]*s*r,n.p.v[2]),t.translate(-n.a.v[0],-n.a.v[1],n.a.v[2]),t.rotate(-n.r.v*s*r),t.translate(n.a.v[0],n.a.v[1],n.a.v[2]),i.translate(-n.a.v[0],-n.a.v[1],n.a.v[2]),i.scale(a?1/o:o,a?1/l:l),i.translate(n.a.v[0],n.a.v[1],n.a.v[2])},RepeaterModifier.prototype.init=function(e,t,i,n){for(this.elem=e,this.arr=t,this.pos=i,this.elemsData=n,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(e),this.initModifierProperties(e,t[i]);i>0;)i-=1,this._elements.unshift(t[i]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(e){var t,i=e.length;for(t=0;t<i;t+=1)e[t]._processed=!1,"gr"===e[t].ty&&this.resetElements(e[t].it)},RepeaterModifier.prototype.cloneElements=function(e){var t=JSON.parse(JSON.stringify(e));return this.resetElements(t),t},RepeaterModifier.prototype.changeGroupRender=function(e,t){var i,n=e.length;for(i=0;i<n;i+=1)e[i]._render=t,"gr"===e[i].ty&&this.changeGroupRender(e[i].it,t)},RepeaterModifier.prototype.processShapes=function(e){var t,i,n,r,a,s=!1;if(this._mdf||e){var o,l=Math.ceil(this.c.v);if(this._groups.length<l){for(;this._groups.length<l;){var c={it:this.cloneElements(this._elements),ty:"gr"};c.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,c),this._groups.splice(0,0,c),this._currentCopies+=1}this.elem.reloadShapes(),s=!0}for(a=0,n=0;n<=this._groups.length-1;n+=1){if(o=a<l,this._groups[n]._render=o,this.changeGroupRender(this._groups[n].it,o),!o){var h=this.elemsData[n].it,u=h[h.length-1];0!==u.transform.op.v?(u.transform.op._mdf=!0,u.transform.op.v=0):u.transform.op._mdf=!1}a+=1}this._currentCopies=l;var d=this.o.v,p=d%1,f=d>0?Math.floor(d):Math.ceil(d),m=this.pMatrix.props,g=this.rMatrix.props,v=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var y,b,x=0;if(d>0){for(;x<f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),x+=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,p,!1),x+=p)}else if(d<0){for(;x>f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),x-=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),x-=p)}for(n=1===this.data.m?0:this._currentCopies-1,r=1===this.data.m?1:-1,a=this._currentCopies;a;){if(b=(i=(t=this.elemsData[n].it)[t.length-1].transform.mProps.v.props).length,t[t.length-1].transform.mProps._mdf=!0,t[t.length-1].transform.op._mdf=!0,t[t.length-1].transform.op.v=1===this._currentCopies?this.so.v:this.so.v+(this.eo.v-this.so.v)*(n/(this._currentCopies-1)),0!==x){for((0!==n&&1===r||n!==this._currentCopies-1&&-1===r)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]),this.matrix.transform(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],v[9],v[10],v[11],v[12],v[13],v[14],v[15]),this.matrix.transform(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]),y=0;y<b;y+=1)i[y]=this.matrix.props[y];this.matrix.reset()}else for(this.matrix.reset(),y=0;y<b;y+=1)i[y]=this.matrix.props[y];x+=1,a-=1,n+=r}}else for(a=this._currentCopies,n=0,r=1;a;)i=(t=this.elemsData[n].it)[t.length-1].transform.mProps.v.props,t[t.length-1].transform.mProps._mdf=!1,t[t.length-1].transform.op._mdf=!1,a-=1,n+=r;return s},RepeaterModifier.prototype.addShape=function(){},extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(e,t.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},RoundCornersModifier.prototype.processPath=function(e,t){var i,n=shapePool.newElement();n.c=e.c;var r,a,s,o,l,c,h,u,d,p,f,m,g=e._length,v=0;for(i=0;i<g;i+=1)r=e.v[i],s=e.o[i],a=e.i[i],r[0]===s[0]&&r[1]===s[1]&&r[0]===a[0]&&r[1]===a[1]?0!==i&&i!==g-1||e.c?(o=0===i?e.v[g-1]:e.v[i-1],c=(l=Math.sqrt(Math.pow(r[0]-o[0],2)+Math.pow(r[1]-o[1],2)))?Math.min(l/2,t)/l:0,h=f=r[0]+(o[0]-r[0])*c,u=m=r[1]-(r[1]-o[1])*c,d=h-(h-r[0])*roundCorner,p=u-(u-r[1])*roundCorner,n.setTripleAt(h,u,d,p,f,m,v),v+=1,o=i===g-1?e.v[0]:e.v[i+1],c=(l=Math.sqrt(Math.pow(r[0]-o[0],2)+Math.pow(r[1]-o[1],2)))?Math.min(l/2,t)/l:0,h=d=r[0]+(o[0]-r[0])*c,u=p=r[1]+(o[1]-r[1])*c,f=h-(h-r[0])*roundCorner,m=u-(u-r[1])*roundCorner,n.setTripleAt(h,u,d,p,f,m,v),v+=1):(n.setTripleAt(r[0],r[1],s[0],s[1],a[0],a[1],v),v+=1):(n.setTripleAt(e.v[i][0],e.v[i][1],e.o[i][0],e.o[i][1],e.i[i][0],e.i[i][1],v),v+=1);return n},RoundCornersModifier.prototype.processShapes=function(e){var t,i,n,r,a,s,o=this.shapes.length,l=this.rd.v;if(0!==l)for(i=0;i<o;i+=1){if(s=(a=this.shapes[i]).localShapeCollection,a.shape._mdf||this._mdf||e)for(s.releaseShapes(),a.shape._mdf=!0,t=a.shape.paths.shapes,r=a.shape.paths._length,n=0;n<r;n+=1)s.addShape(this.processPath(t[n],l));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},PolynomialBezier.prototype.point=function(e){return[((this.a[0]*e+this.b[0])*e+this.c[0])*e+this.d[0],((this.a[1]*e+this.b[1])*e+this.c[1])*e+this.d[1]]},PolynomialBezier.prototype.derivative=function(e){return[(3*e*this.a[0]+2*this.b[0])*e+this.c[0],(3*e*this.a[1]+2*this.b[1])*e+this.c[1]]},PolynomialBezier.prototype.tangentAngle=function(e){var t=this.derivative(e);return Math.atan2(t[1],t[0])},PolynomialBezier.prototype.normalAngle=function(e){var t=this.derivative(e);return Math.atan2(t[0],t[1])},PolynomialBezier.prototype.inflectionPoints=function(){var e=this.a[1]*this.b[0]-this.a[0]*this.b[1];if(floatZero(e))return[];var t=-.5*(this.a[1]*this.c[0]-this.a[0]*this.c[1])/e,i=t*t-1/3*(this.b[1]*this.c[0]-this.b[0]*this.c[1])/e;if(i<0)return[];var n=Math.sqrt(i);return floatZero(n)?n>0&&n<1?[t]:[]:[t-n,t+n].filter((function(e){return e>0&&e<1}))},PolynomialBezier.prototype.split=function(e){if(e<=0)return[singlePoint(this.points[0]),this];if(e>=1)return[this,singlePoint(this.points[this.points.length-1])];var t=lerpPoint(this.points[0],this.points[1],e),i=lerpPoint(this.points[1],this.points[2],e),n=lerpPoint(this.points[2],this.points[3],e),r=lerpPoint(t,i,e),a=lerpPoint(i,n,e),s=lerpPoint(r,a,e);return[new PolynomialBezier(this.points[0],t,r,s,!0),new PolynomialBezier(s,a,n,this.points[3],!0)]},PolynomialBezier.prototype.bounds=function(){return{x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var e=this.bounds();return{left:e.x.min,right:e.x.max,top:e.y.min,bottom:e.y.max,width:e.x.max-e.x.min,height:e.y.max-e.y.min,cx:(e.x.max+e.x.min)/2,cy:(e.y.max+e.y.min)/2}},PolynomialBezier.prototype.intersections=function(e,t,i){void 0===t&&(t=2),void 0===i&&(i=7);var n=[];return intersectsImpl(intersectData(this,0,1),intersectData(e,0,1),0,t,n,i),n},PolynomialBezier.shapeSegment=function(e,t){var i=(t+1)%e.length();return new PolynomialBezier(e.v[t],e.o[t],e.i[i],e.v[i],!0)},PolynomialBezier.shapeSegmentInverted=function(e,t){var i=(t+1)%e.length();return new PolynomialBezier(e.v[i],e.i[i],e.o[t],e.v[t],!0)},extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(e,t.s,0,null,this),this.frequency=PropertyFactory.getProp(e,t.r,0,null,this),this.pointsType=PropertyFactory.getProp(e,t.pt,0,null,this),this._isAnimated=0!==this.amplitude.effectsSequence.length||0!==this.frequency.effectsSequence.length||0!==this.pointsType.effectsSequence.length},ZigZagModifier.prototype.processPath=function(e,t,i,n){var r=e._length,a=shapePool.newElement();if(a.c=e.c,e.c||(r-=1),0===r)return a;var s=-1,o=PolynomialBezier.shapeSegment(e,0);zigZagCorner(a,e,0,t,i,n,s);for(var l=0;l<r;l+=1)s=zigZagSegment(a,o,t,i,n,-s),o=l!==r-1||e.c?PolynomialBezier.shapeSegment(e,(l+1)%r):null,zigZagCorner(a,e,l+1,t,i,n,s);return a},ZigZagModifier.prototype.processShapes=function(e){var t,i,n,r,a,s,o=this.shapes.length,l=this.amplitude.v,c=Math.max(0,Math.round(this.frequency.v)),h=this.pointsType.v;if(0!==l)for(i=0;i<o;i+=1){if(s=(a=this.shapes[i]).localShapeCollection,a.shape._mdf||this._mdf||e)for(s.releaseShapes(),a.shape._mdf=!0,t=a.shape.paths.shapes,r=a.shape.paths._length,n=0;n<r;n+=1)s.addShape(this.processPath(t[n],l,c,h));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},extendPrototype([ShapeModifier],OffsetPathModifier),OffsetPathModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(e,t.a,0,null,this),this.miterLimit=PropertyFactory.getProp(e,t.ml,0,null,this),this.lineJoin=t.lj,this._isAnimated=0!==this.amount.effectsSequence.length},OffsetPathModifier.prototype.processPath=function(e,t,i,n){var r=shapePool.newElement();r.c=e.c;var a,s,o,l=e.length();e.c||(l-=1);var c=[];for(a=0;a<l;a+=1)o=PolynomialBezier.shapeSegment(e,a),c.push(offsetSegmentSplit(o,t));if(!e.c)for(a=l-1;a>=0;a-=1)o=PolynomialBezier.shapeSegmentInverted(e,a),c.push(offsetSegmentSplit(o,t));c=pruneIntersections(c);var h=null,u=null;for(a=0;a<c.length;a+=1){var d=c[a];for(u&&(h=joinLines(r,u,d[0],i,n)),u=d[d.length-1],s=0;s<d.length;s+=1)o=d[s],h&&pointEqual(o.points[0],h)?r.setXYAt(o.points[1][0],o.points[1][1],"o",r.length()-1):r.setTripleAt(o.points[0][0],o.points[0][1],o.points[1][0],o.points[1][1],o.points[0][0],o.points[0][1],r.length()),r.setTripleAt(o.points[3][0],o.points[3][1],o.points[3][0],o.points[3][1],o.points[2][0],o.points[2][1],r.length()),h=o.points[3]}return c.length&&joinLines(r,u,c[0][0],i,n),r},OffsetPathModifier.prototype.processShapes=function(e){var t,i,n,r,a,s,o=this.shapes.length,l=this.amount.v,c=this.miterLimit.v,h=this.lineJoin;if(0!==l)for(i=0;i<o;i+=1){if(s=(a=this.shapes[i]).localShapeCollection,a.shape._mdf||this._mdf||e)for(s.releaseShapes(),a.shape._mdf=!0,t=a.shape.paths.shapes,r=a.shape.paths._length,n=0;n<r;n+=1)s.addShape(this.processPath(t[n],l,h,c));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)};var FontManager=function(){var e={w:0,size:0,shapes:[],data:{shapes:[]}},t=[];t=t.concat([2304,2305,2306,2307,2362,2363,2364,2364,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2387,2388,2389,2390,2391,2402,2403]);var i=127988,n=127462,r=127487,a=["d83cdffb","d83cdffc","d83cdffd","d83cdffe","d83cdfff"];function s(e,t){var i=createTag("span");i.setAttribute("aria-hidden",!0),i.style.fontFamily=t;var n=createTag("span");n.innerText="giItT1WQy@!-/#",i.style.position="absolute",i.style.left="-10000px",i.style.top="-10000px",i.style.fontSize="300px",i.style.fontVariant="normal",i.style.fontStyle="normal",i.style.fontWeight="normal",i.style.letterSpacing="0",i.appendChild(n),document.body.appendChild(i);var r=n.offsetWidth;return n.style.fontFamily=function(e){var t,i=e.split(","),n=i.length,r=[];for(t=0;t<n;t+=1)"sans-serif"!==i[t]&&"monospace"!==i[t]&&r.push(i[t]);return r.join(",")}(e)+", "+t,{node:n,w:r,parent:i}}function o(e,t){var i,n=document.body&&t?"svg":"canvas",r=getFontProperties(e);if("svg"===n){var a=createNS("text");a.style.fontSize="100px",a.setAttribute("font-family",e.fFamily),a.setAttribute("font-style",r.style),a.setAttribute("font-weight",r.weight),a.textContent="1",e.fClass?(a.style.fontFamily="inherit",a.setAttribute("class",e.fClass)):a.style.fontFamily=e.fFamily,t.appendChild(a),i=a}else{var s=new OffscreenCanvas(500,500).getContext("2d");s.font=r.style+" "+r.weight+" 100px "+e.fFamily,i=s}return{measureText:function(e){return"svg"===n?(i.textContent=e,i.getComputedTextLength()):i.measureText(e).width}}}function l(e){var t=0,i=e.charCodeAt(0);if(i>=55296&&i<=56319){var n=e.charCodeAt(1);n>=56320&&n<=57343&&(t=1024*(i-55296)+n-56320+65536)}return t}function c(e){var t=l(e);return t>=n&&t<=r}var h=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};h.isModifier=function(e,t){var i=e.toString(16)+t.toString(16);return-1!==a.indexOf(i)},h.isZeroWidthJoiner=function(e){return 8205===e},h.isFlagEmoji=function(e){return c(e.substr(0,2))&&c(e.substr(2,2))},h.isRegionalCode=c,h.isCombinedCharacter=function(e){return-1!==t.indexOf(e)},h.isRegionalFlag=function(e,t){var n=l(e.substr(t,2));if(n!==i)return!1;var r=0;for(t+=2;r<5;){if((n=l(e.substr(t,2)))<917601||n>917626)return!1;r+=1,t+=2}return 917631===l(e.substr(t,2))},h.isVariationSelector=function(e){return 65039===e},h.BLACK_FLAG_CODE_POINT=i;var u={addChars:function(e){if(e){var t;this.chars||(this.chars=[]);var i,n,r=e.length,a=this.chars.length;for(t=0;t<r;t+=1){for(i=0,n=!1;i<a;)this.chars[i].style===e[t].style&&this.chars[i].fFamily===e[t].fFamily&&this.chars[i].ch===e[t].ch&&(n=!0),i+=1;n||(this.chars.push(e[t]),a+=1)}}},addFonts:function(e,t){if(e){if(this.chars)return this.isLoaded=!0,void(this.fonts=e.list);if(!document.body)return this.isLoaded=!0,e.list.forEach((function(e){e.helper=o(e),e.cache={}})),void(this.fonts=e.list);var i,n=e.list,r=n.length,a=r;for(i=0;i<r;i+=1){var l,c,h=!0;if(n[i].loaded=!1,n[i].monoCase=s(n[i].fFamily,"monospace"),n[i].sansCase=s(n[i].fFamily,"sans-serif"),n[i].fPath){if("p"===n[i].fOrigin||3===n[i].origin){if((l=document.querySelectorAll('style[f-forigin="p"][f-family="'+n[i].fFamily+'"], style[f-origin="3"][f-family="'+n[i].fFamily+'"]')).length>0&&(h=!1),h){var u=createTag("style");u.setAttribute("f-forigin",n[i].fOrigin),u.setAttribute("f-origin",n[i].origin),u.setAttribute("f-family",n[i].fFamily),u.type="text/css",u.innerText="@font-face {font-family: "+n[i].fFamily+"; font-style: normal; src: url('"+n[i].fPath+"');}",t.appendChild(u)}}else if("g"===n[i].fOrigin||1===n[i].origin){for(l=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),c=0;c<l.length;c+=1)-1!==l[c].href.indexOf(n[i].fPath)&&(h=!1);if(h){var d=createTag("link");d.setAttribute("f-forigin",n[i].fOrigin),d.setAttribute("f-origin",n[i].origin),d.type="text/css",d.rel="stylesheet",d.href=n[i].fPath,document.body.appendChild(d)}}else if("t"===n[i].fOrigin||2===n[i].origin){for(l=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),c=0;c<l.length;c+=1)n[i].fPath===l[c].src&&(h=!1);if(h){var p=createTag("link");p.setAttribute("f-forigin",n[i].fOrigin),p.setAttribute("f-origin",n[i].origin),p.setAttribute("rel","stylesheet"),p.setAttribute("href",n[i].fPath),t.appendChild(p)}}}else n[i].loaded=!0,a-=1;n[i].helper=o(n[i],t),n[i].cache={},this.fonts.push(n[i])}0===a?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0},getCharData:function(t,i,n){for(var r=0,a=this.chars.length;r<a;){if(this.chars[r].ch===t&&this.chars[r].style===i&&this.chars[r].fFamily===n)return this.chars[r];r+=1}return("string"===typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",t,i,n)),e},getFontByName:function(e){for(var t=0,i=this.fonts.length;t<i;){if(this.fonts[t].fName===e)return this.fonts[t];t+=1}return this.fonts[0]},measureText:function(e,t,i){var n=this.getFontByName(t),r=e;if(!n.cache[r]){var a=n.helper;if(" "===e){var s=a.measureText("|"+e+"|"),o=a.measureText("||");n.cache[r]=(s-o)/100}else n.cache[r]=a.measureText(e)/100}return n.cache[r]*i},checkLoadedFonts:function(){var e,t,i,n=this.fonts.length,r=n;for(e=0;e<n;e+=1)this.fonts[e].loaded?r-=1:"n"===this.fonts[e].fOrigin||0===this.fonts[e].origin?this.fonts[e].loaded=!0:(t=this.fonts[e].monoCase.node,i=this.fonts[e].monoCase.w,t.offsetWidth!==i?(r-=1,this.fonts[e].loaded=!0):(t=this.fonts[e].sansCase.node,i=this.fonts[e].sansCase.w,t.offsetWidth!==i&&(r-=1,this.fonts[e].loaded=!0)),this.fonts[e].loaded&&(this.fonts[e].sansCase.parent.parentNode.removeChild(this.fonts[e].sansCase.parent),this.fonts[e].monoCase.parent.parentNode.removeChild(this.fonts[e].monoCase.parent)));0!==r&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)},setIsLoaded:function(){this.isLoaded=!0}};return h.prototype=u,h}();function SlotManager(e){this.animationData=e}function slotFactory(e){return new SlotManager(e)}function RenderableElement(){}SlotManager.prototype.getProp=function(e){return this.animationData.slots&&this.animationData.slots[e.sid]?Object.assign(e,this.animationData.slots[e.sid].p):e},RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(e){-1===this.renderableComponents.indexOf(e)&&this.renderableComponents.push(e)},removeRenderableComponent:function(e){-1!==this.renderableComponents.indexOf(e)&&this.renderableComponents.splice(this.renderableComponents.indexOf(e),1)},prepareRenderableFrame:function(e){this.checkLayerLimits(e)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(e){this.data.ip-this.data.st<=e&&this.data.op-this.data.st>e?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var e,t=this.renderableComponents.length;for(e=0;e<t;e+=1)this.renderableComponents[e].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}};var getBlendMode=function(){var e={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"};return function(t){return e[t]||""}}();function SliderEffect(e,t,i){this.p=PropertyFactory.getProp(t,e.v,0,0,i)}function AngleEffect(e,t,i){this.p=PropertyFactory.getProp(t,e.v,0,0,i)}function ColorEffect(e,t,i){this.p=PropertyFactory.getProp(t,e.v,1,0,i)}function PointEffect(e,t,i){this.p=PropertyFactory.getProp(t,e.v,1,0,i)}function LayerIndexEffect(e,t,i){this.p=PropertyFactory.getProp(t,e.v,0,0,i)}function MaskIndexEffect(e,t,i){this.p=PropertyFactory.getProp(t,e.v,0,0,i)}function CheckboxEffect(e,t,i){this.p=PropertyFactory.getProp(t,e.v,0,0,i)}function NoValueEffect(){this.p={}}function EffectsManager(e,t){var i,n=e.ef||[];this.effectElements=[];var r,a=n.length;for(i=0;i<a;i+=1)r=new GroupEffect(n[i],t),this.effectElements.push(r)}function GroupEffect(e,t){this.init(e,t)}function BaseElement(){}function FrameElement(){}function FootageElement(e,t,i){this.initFrame(),this.initRenderable(),this.assetData=t.getAssetData(e.refId),this.footageData=t.imageLoader.getAsset(this.assetData),this.initBaseData(e,t,i)}function AudioElement(e,t,i){this.initFrame(),this.initRenderable(),this.assetData=t.getAssetData(e.refId),this.initBaseData(e,t,i),this._isPlaying=!1,this._canPlay=!1;var n=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(n),this._currentTime=0,this.globalData.audioController.addAudio(this),this._volumeMultiplier=1,this._volume=1,this._previousVolume=null,this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0},this.lv=PropertyFactory.getProp(this,e.au&&e.au.lv?e.au.lv:{k:[100]},1,.01,this)}function BaseRenderer(){}extendPrototype([DynamicPropertyContainer],GroupEffect),GroupEffect.prototype.getValue=GroupEffect.prototype.iterateDynamicProperties,GroupEffect.prototype.init=function(e,t){var i;this.data=e,this.effectElements=[],this.initDynamicPropertyContainer(t);var n,r=this.data.ef.length,a=this.data.ef;for(i=0;i<r;i+=1){switch(n=null,a[i].ty){case 0:n=new SliderEffect(a[i],t,this);break;case 1:n=new AngleEffect(a[i],t,this);break;case 2:n=new ColorEffect(a[i],t,this);break;case 3:n=new PointEffect(a[i],t,this);break;case 4:case 7:n=new CheckboxEffect(a[i],t,this);break;case 10:n=new LayerIndexEffect(a[i],t,this);break;case 11:n=new MaskIndexEffect(a[i],t,this);break;case 5:n=new EffectsManager(a[i],t,this);break;default:n=new NoValueEffect(a[i],t,this)}n&&this.effectElements.push(n)}},BaseElement.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var e=0,t=this.data.masksProperties.length;e<t;){if("n"!==this.data.masksProperties[e].mode&&!1!==this.data.masksProperties[e].cl)return!0;e+=1}return!1},initExpressions:function(){var e=getExpressionInterfaces();if(e){var t=e("layer"),i=e("effects"),n=e("shape"),r=e("text"),a=e("comp");this.layerInterface=t(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var s=i.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(s),0===this.data.ty||this.data.xt?this.compInterface=a(this):4===this.data.ty?(this.layerInterface.shapeInterface=n(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=r(this),this.layerInterface.text=this.layerInterface.textInterface)}},setBlendMode:function(){var e=getBlendMode(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=e},initBaseData:function(e,t,i){this.globalData=t,this.comp=i,this.data=e,this.layerId=createElementID(),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},FrameElement.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(e,t){var i,n=this.dynamicProperties.length;for(i=0;i<n;i+=1)(t||this._isParent&&"transform"===this.dynamicProperties[i].propType)&&(this.dynamicProperties[i].getValue(),this.dynamicProperties[i]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(e){-1===this.dynamicProperties.indexOf(e)&&this.dynamicProperties.push(e)}},FootageElement.prototype.prepareFrame=function(){},extendPrototype([RenderableElement,BaseElement,FrameElement],FootageElement),FootageElement.prototype.getBaseElement=function(){return null},FootageElement.prototype.renderFrame=function(){},FootageElement.prototype.destroy=function(){},FootageElement.prototype.initExpressions=function(){var e=getExpressionInterfaces();if(e){var t=e("footage");this.layerInterface=t(this)}},FootageElement.prototype.getFootageData=function(){return this.footageData},AudioElement.prototype.prepareFrame=function(e){if(this.prepareRenderableFrame(e,!0),this.prepareProperties(e,!0),this.tm._placeholder)this._currentTime=e/this.data.sr;else{var t=this.tm.v;this._currentTime=t}this._volume=this.lv.v[0];var i=this._volume*this._volumeMultiplier;this._previousVolume!==i&&(this._previousVolume=i,this.audio.volume(i))},extendPrototype([RenderableElement,BaseElement,FrameElement],AudioElement),AudioElement.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek())>.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(e){this.audio.rate(e)},AudioElement.prototype.volume=function(e){this._volumeMultiplier=e,this._previousVolume=e*this._volume,this.audio.volume(this._previousVolume)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){},BaseRenderer.prototype.checkLayers=function(e){var t,i,n=this.layers.length;for(this.completeLayers=!0,t=n-1;t>=0;t-=1)this.elements[t]||(i=this.layers[t]).ip-i.st<=e-this.layers[t].st&&i.op-i.st>e-this.layers[t].st&&this.buildItem(t),this.completeLayers=!!this.elements[t]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(e){switch(e.ty){case 2:return this.createImage(e);case 0:return this.createComp(e);case 1:return this.createSolid(e);case 3:default:return this.createNull(e);case 4:return this.createShape(e);case 5:return this.createText(e);case 6:return this.createAudio(e);case 13:return this.createCamera(e);case 15:return this.createFootage(e)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(e){return new AudioElement(e,this.globalData,this)},BaseRenderer.prototype.createFootage=function(e){return new FootageElement(e,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var e,t=this.layers.length;for(e=0;e<t;e+=1)this.buildItem(e);this.checkPendingElements()},BaseRenderer.prototype.includeLayers=function(e){var t;this.completeLayers=!1;var i,n=e.length,r=this.layers.length;for(t=0;t<n;t+=1)for(i=0;i<r;){if(this.layers[i].id===e[t].id){this.layers[i]=e[t];break}i+=1}},BaseRenderer.prototype.setProjectInterface=function(e){this.globalData.projectInterface=e},BaseRenderer.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},BaseRenderer.prototype.buildElementParenting=function(e,t,i){for(var n=this.elements,r=this.layers,a=0,s=r.length;a<s;)r[a].ind==t&&(n[a]&&!0!==n[a]?(i.push(n[a]),n[a].setAsParent(),void 0!==r[a].parent?this.buildElementParenting(e,r[a].parent,i):e.setHierarchy(i)):(this.buildItem(a),this.addPendingElement(e))),a+=1},BaseRenderer.prototype.addPendingElement=function(e){this.pendingElements.push(e)},BaseRenderer.prototype.searchExtraCompositions=function(e){var t,i=e.length;for(t=0;t<i;t+=1)if(e[t].xt){var n=this.createComp(e[t]);n.initExpressions(),this.globalData.projectInterface.registerComposition(n)}},BaseRenderer.prototype.getElementById=function(e){var t,i=this.elements.length;for(t=0;t<i;t+=1)if(this.elements[t].data.ind===e)return this.elements[t];return null},BaseRenderer.prototype.getElementByPath=function(e){var t,i=e.shift();if("number"===typeof i)t=this.elements[i];else{var n,r=this.elements.length;for(n=0;n<r;n+=1)if(this.elements[n].data.nm===i){t=this.elements[n];break}}return 0===e.length?t:t.getElementByPath(e)},BaseRenderer.prototype.setupGlobalData=function(e,t){this.globalData.fontManager=new FontManager,this.globalData.slotManager=slotFactory(e),this.globalData.fontManager.addChars(e.chars),this.globalData.fontManager.addFonts(e.fonts,t),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=e.fr,this.globalData.nm=e.nm,this.globalData.compSize={w:e.w,h:e.h}};var effectTypes={TRANSFORM_EFFECT:"transformEFfect"};function TransformElement(){}function MaskElement(e,t,i){this.data=e,this.element=t,this.globalData=i,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var n,r,a=this.globalData.defs,s=this.masksProperties?this.masksProperties.length:0;this.viewData=createSizedArray(s),this.solidPath="";var o,l,c,h,u,d,p=this.masksProperties,f=0,m=[],g=createElementID(),v="clipPath",y="clip-path";for(n=0;n<s;n+=1)if(("a"!==p[n].mode&&"n"!==p[n].mode||p[n].inv||100!==p[n].o.k||p[n].o.x)&&(v="mask",y="mask"),"s"!==p[n].mode&&"i"!==p[n].mode||0!==f?c=null:((c=createNS("rect")).setAttribute("fill","#ffffff"),c.setAttribute("width",this.element.comp.data.w||0),c.setAttribute("height",this.element.comp.data.h||0),m.push(c)),r=createNS("path"),"n"===p[n].mode)this.viewData[n]={op:PropertyFactory.getProp(this.element,p[n].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,p[n],3),elem:r,lastPath:""},a.appendChild(r);else{var b;if(f+=1,r.setAttribute("fill","s"===p[n].mode?"#000000":"#ffffff"),r.setAttribute("clip-rule","nonzero"),0!==p[n].x.k?(v="mask",y="mask",d=PropertyFactory.getProp(this.element,p[n].x,0,null,this.element),b=createElementID(),(h=createNS("filter")).setAttribute("id",b),(u=createNS("feMorphology")).setAttribute("operator","erode"),u.setAttribute("in","SourceGraphic"),u.setAttribute("radius","0"),h.appendChild(u),a.appendChild(h),r.setAttribute("stroke","s"===p[n].mode?"#000000":"#ffffff")):(u=null,d=null),this.storedData[n]={elem:r,x:d,expan:u,lastPath:"",lastOperator:"",filterId:b,lastRadius:0},"i"===p[n].mode){l=m.length;var x=createNS("g");for(o=0;o<l;o+=1)x.appendChild(m[o]);var w=createNS("mask");w.setAttribute("mask-type","alpha"),w.setAttribute("id",g+"_"+f),w.appendChild(r),a.appendChild(w),x.setAttribute("mask","url("+getLocationHref()+"#"+g+"_"+f+")"),m.length=0,m.push(x)}else m.push(r);p[n].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[n]={elem:r,lastPath:"",op:PropertyFactory.getProp(this.element,p[n].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,p[n],3),invRect:c},this.viewData[n].prop.k||this.drawPath(p[n],this.viewData[n].prop.v,this.viewData[n])}for(this.maskElement=createNS(v),s=m.length,n=0;n<s;n+=1)this.maskElement.appendChild(m[n]);f>0&&(this.maskElement.setAttribute("id",g),this.element.maskedElement.setAttribute(y,"url("+getLocationHref()+"#"+g+")"),a.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}TransformElement.prototype={initTransform:function(){var e=new Matrix;this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_localMatMdf:!1,_opMdf:!1,mat:e,localMat:e,localOpacity:1},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var e,t=this.finalTransform.mat,i=0,n=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;i<n;){if(this.hierarchy[i].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}i+=1}if(this.finalTransform._matMdf)for(e=this.finalTransform.mProp.v.props,t.cloneFromProps(e),i=0;i<n;i+=1)t.multiply(this.hierarchy[i].finalTransform.mProp.v)}this.finalTransform._matMdf&&(this.finalTransform._localMatMdf=this.finalTransform._matMdf),this.finalTransform._opMdf&&(this.finalTransform.localOpacity=this.finalTransform.mProp.o.v)},renderLocalTransform:function(){if(this.localTransforms){var e=0,t=this.localTransforms.length;if(this.finalTransform._localMatMdf=this.finalTransform._matMdf,!this.finalTransform._localMatMdf||!this.finalTransform._opMdf)for(;e<t;)this.localTransforms[e]._mdf&&(this.finalTransform._localMatMdf=!0),this.localTransforms[e]._opMdf&&!this.finalTransform._opMdf&&(this.finalTransform.localOpacity=this.finalTransform.mProp.o.v,this.finalTransform._opMdf=!0),e+=1;if(this.finalTransform._localMatMdf){var i=this.finalTransform.localMat;for(this.localTransforms[0].matrix.clone(i),e=1;e<t;e+=1){var n=this.localTransforms[e].matrix;i.multiply(n)}i.multiply(this.finalTransform.mat)}if(this.finalTransform._opMdf){var r=this.finalTransform.localOpacity;for(e=0;e<t;e+=1)r*=.01*this.localTransforms[e].opacity;this.finalTransform.localOpacity=r}}},searchEffectTransforms:function(){if(this.renderableEffectsManager){var e=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT);if(e.length){this.localTransforms=[],this.finalTransform.localMat=new Matrix;var t=0,i=e.length;for(t=0;t<i;t+=1)this.localTransforms.push(e[t])}}},globalToLocal:function(e){var t=[];t.push(this.finalTransform);for(var i,n=!0,r=this.comp;n;)r.finalTransform?(r.data.hasMask&&t.splice(0,0,r.finalTransform),r=r.comp):n=!1;var a,s=t.length;for(i=0;i<s;i+=1)a=t[i].mat.applyToPointArray(0,0,0),e=[e[0]-a[0],e[1]-a[1],0];return e},mHelper:new Matrix},MaskElement.prototype.getMaskProperty=function(e){return this.viewData[e].prop},MaskElement.prototype.renderFrame=function(e){var t,i=this.element.finalTransform.mat,n=this.masksProperties.length;for(t=0;t<n;t+=1)if((this.viewData[t].prop._mdf||e)&&this.drawPath(this.masksProperties[t],this.viewData[t].prop.v,this.viewData[t]),(this.viewData[t].op._mdf||e)&&this.viewData[t].elem.setAttribute("fill-opacity",this.viewData[t].op.v),"n"!==this.masksProperties[t].mode&&(this.viewData[t].invRect&&(this.element.finalTransform.mProp._mdf||e)&&this.viewData[t].invRect.setAttribute("transform",i.getInverseMatrix().to2dCSS()),this.storedData[t].x&&(this.storedData[t].x._mdf||e))){var r=this.storedData[t].expan;this.storedData[t].x.v<0?("erode"!==this.storedData[t].lastOperator&&(this.storedData[t].lastOperator="erode",this.storedData[t].elem.setAttribute("filter","url("+getLocationHref()+"#"+this.storedData[t].filterId+")")),r.setAttribute("radius",-this.storedData[t].x.v)):("dilate"!==this.storedData[t].lastOperator&&(this.storedData[t].lastOperator="dilate",this.storedData[t].elem.setAttribute("filter",null)),this.storedData[t].elem.setAttribute("stroke-width",2*this.storedData[t].x.v))}},MaskElement.prototype.getMaskelement=function(){return this.maskElement},MaskElement.prototype.createLayerSolidPath=function(){var e="M0,0 ";return e+=" h"+this.globalData.compSize.w,e+=" v"+this.globalData.compSize.h,e+=" h-"+this.globalData.compSize.w,e+=" v-"+this.globalData.compSize.h+" "},MaskElement.prototype.drawPath=function(e,t,i){var n,r,a=" M"+t.v[0][0]+","+t.v[0][1];for(r=t._length,n=1;n<r;n+=1)a+=" C"+t.o[n-1][0]+","+t.o[n-1][1]+" "+t.i[n][0]+","+t.i[n][1]+" "+t.v[n][0]+","+t.v[n][1];if(t.c&&r>1&&(a+=" C"+t.o[n-1][0]+","+t.o[n-1][1]+" "+t.i[0][0]+","+t.i[0][1]+" "+t.v[0][0]+","+t.v[0][1]),i.lastPath!==a){var s="";i.elem&&(t.c&&(s=e.inv?this.solidPath+a:a),i.elem.setAttribute("d",s)),i.lastPath=a}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var filtersFactory=function(){var e={createFilter:function(e,t){var i=createNS("filter");return i.setAttribute("id",e),!0!==t&&(i.setAttribute("filterUnits","objectBoundingBox"),i.setAttribute("x","0%"),i.setAttribute("y","0%"),i.setAttribute("width","100%"),i.setAttribute("height","100%")),i},createAlphaToLuminanceFilter:function(){var e=createNS("feColorMatrix");return e.setAttribute("type","matrix"),e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("values","0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1"),e}};return e}(),featureSupport=function(){var e={maskType:!0,svgLumaHidden:!0,offscreenCanvas:"undefined"!==typeof OffscreenCanvas};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(e.maskType=!1),/firefox/i.test(navigator.userAgent)&&(e.svgLumaHidden=!1),e}(),registeredEffects$1={},idPrefix="filter_result_";function SVGEffects(e){var t,i,n="SourceGraphic",r=e.data.ef?e.data.ef.length:0,a=createElementID(),s=filtersFactory.createFilter(a,!0),o=0;for(this.filters=[],t=0;t<r;t+=1){i=null;var l=e.data.ef[t].ty;registeredEffects$1[l]&&(i=new(0,registeredEffects$1[l].effect)(s,e.effectsManager.effectElements[t],e,idPrefix+o,n),n=idPrefix+o,registeredEffects$1[l].countsAsEffect&&(o+=1)),i&&this.filters.push(i)}o&&(e.globalData.defs.appendChild(s),e.layerElement.setAttribute("filter","url("+getLocationHref()+"#"+a+")")),this.filters.length&&e.addRenderableComponent(this)}function registerEffect$1(e,t,i){registeredEffects$1[e]={effect:t,countsAsEffect:i}}function SVGBaseElement(){}function HierarchyElement(){}function RenderableDOMElement(){}function IImageElement(e,t,i){this.assetData=t.getAssetData(e.refId),this.assetData&&this.assetData.sid&&(this.assetData=t.slotManager.getProp(this.assetData)),this.initElement(e,t,i),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function ProcessedElement(e,t){this.elem=e,this.pos=t}function IShapeElement(){}SVGEffects.prototype.renderFrame=function(e){var t,i=this.filters.length;for(t=0;t<i;t+=1)this.filters[t].renderFrame(e)},SVGEffects.prototype.getEffects=function(e){var t,i=this.filters.length,n=[];for(t=0;t<i;t+=1)this.filters[t].type===e&&n.push(this.filters[t]);return n},SVGBaseElement.prototype={initRendererElement:function(){this.layerElement=createNS("g")},createContainerElements:function(){this.matteElement=createNS("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var e=null;if(this.data.td){this.matteMasks={};var t=createNS("g");t.setAttribute("id",this.layerId),t.appendChild(this.layerElement),e=t,this.globalData.defs.appendChild(t)}else this.data.tt?(this.matteElement.appendChild(this.layerElement),e=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var i=createNS("clipPath"),n=createNS("path");n.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var r=createElementID();if(i.setAttribute("id",r),i.appendChild(n),this.globalData.defs.appendChild(i),this.checkMasks()){var a=createNS("g");a.setAttribute("clip-path","url("+getLocationHref()+"#"+r+")"),a.appendChild(this.layerElement),this.transformedElement=a,e?e.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+getLocationHref()+"#"+r+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._localMatMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.localMat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.localOpacity)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData),this.renderableEffectsManager=new SVGEffects(this),this.searchEffectTransforms()},getMatte:function(e){if(this.matteMasks||(this.matteMasks={}),!this.matteMasks[e]){var t,i,n,r,a=this.layerId+"_"+e;if(1===e||3===e){var s=createNS("mask");s.setAttribute("id",a),s.setAttribute("mask-type",3===e?"luminance":"alpha"),(n=createNS("use")).setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),s.appendChild(n),this.globalData.defs.appendChild(s),featureSupport.maskType||1!==e||(s.setAttribute("mask-type","luminance"),t=createElementID(),i=filtersFactory.createFilter(t),this.globalData.defs.appendChild(i),i.appendChild(filtersFactory.createAlphaToLuminanceFilter()),(r=createNS("g")).appendChild(n),s.appendChild(r),r.setAttribute("filter","url("+getLocationHref()+"#"+t+")"))}else if(2===e){var o=createNS("mask");o.setAttribute("id",a),o.setAttribute("mask-type","alpha");var l=createNS("g");o.appendChild(l),t=createElementID(),i=filtersFactory.createFilter(t);var c=createNS("feComponentTransfer");c.setAttribute("in","SourceGraphic"),i.appendChild(c);var h=createNS("feFuncA");h.setAttribute("type","table"),h.setAttribute("tableValues","1.0 0.0"),c.appendChild(h),this.globalData.defs.appendChild(i);var u=createNS("rect");u.setAttribute("width",this.comp.data.w),u.setAttribute("height",this.comp.data.h),u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("fill","#ffffff"),u.setAttribute("opacity","0"),l.setAttribute("filter","url("+getLocationHref()+"#"+t+")"),l.appendChild(u),(n=createNS("use")).setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),l.appendChild(n),featureSupport.maskType||(o.setAttribute("mask-type","luminance"),i.appendChild(filtersFactory.createAlphaToLuminanceFilter()),r=createNS("g"),l.appendChild(u),r.appendChild(this.layerElement),l.appendChild(r)),this.globalData.defs.appendChild(o)}this.matteMasks[e]=a}return this.matteMasks[e]},setMatte:function(e){this.matteElement&&this.matteElement.setAttribute("mask","url("+getLocationHref()+"#"+e+")")}},HierarchyElement.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(e){this.hierarchy=e},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},extendPrototype([RenderableElement,createProxyFunction({initElement:function(e,t,i){this.initFrame(),this.initBaseData(e,t,i),this.initTransform(e,t,i),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(e){this._mdf=!1,this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],RenderableDOMElement),extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],IImageElement),IImageElement.prototype.createContent=function(){var e=this.globalData.getAssetsPath(this.assetData);this.innerElem=createNS("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this.layerElement.appendChild(this.innerElem)},IImageElement.prototype.sourceRectAtTime=function(){return this.sourceRect},IShapeElement.prototype={addShapeToModifiers:function(e){var t,i=this.shapeModifiers.length;for(t=0;t<i;t+=1)this.shapeModifiers[t].addShape(e)},isShapeInAnimatedModifiers:function(e){for(var t=this.shapeModifiers.length;0<t;)if(this.shapeModifiers[0].isAnimatedWithShape(e))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var e,t=this.shapes.length;for(e=0;e<t;e+=1)this.shapes[e].sh.reset();for(e=(t=this.shapeModifiers.length)-1;e>=0&&!this.shapeModifiers[e].processShapes(this._isFirstFrame);e-=1);}},searchProcessedElement:function(e){for(var t=this.processedElements,i=0,n=t.length;i<n;){if(t[i].elem===e)return t[i].pos;i+=1}return 0},addProcessedElement:function(e,t){for(var i=this.processedElements,n=i.length;n;)if(i[n-=1].elem===e)return void(i[n].pos=t);i.push(new ProcessedElement(e,t))},prepareFrame:function(e){this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange)}};var lineCapEnum={1:"butt",2:"round",3:"square"},lineJoinEnum={1:"miter",2:"round",3:"bevel"};function SVGShapeData(e,t,i){this.caches=[],this.styles=[],this.transformers=e,this.lStr="",this.sh=i,this.lvl=t,this._isAnimated=!!i.k;for(var n=0,r=e.length;n<r;){if(e[n].mProps.dynamicProperties.length){this._isAnimated=!0;break}n+=1}}function SVGStyleData(e,t){this.data=e,this.type=e.ty,this.d="",this.lvl=t,this._mdf=!1,this.closed=!0===e.hd,this.pElem=createNS("path"),this.msElem=null}function DashProperty(e,t,i,n){var r;this.elem=e,this.frameId=-1,this.dataProps=createSizedArray(t.length),this.renderer=i,this.k=!1,this.dashStr="",this.dashArray=createTypedArray("float32",t.length?t.length-1:0),this.dashoffset=createTypedArray("float32",1),this.initDynamicPropertyContainer(n);var a,s=t.length||0;for(r=0;r<s;r+=1)a=PropertyFactory.getProp(e,t[r].v,0,0,this),this.k=a.k||this.k,this.dataProps[r]={n:t[r].n,p:a};this.k||this.getValue(!0),this._isAnimated=this.k}function SVGStrokeStyleData(e,t,i){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(e,t.o,0,.01,this),this.w=PropertyFactory.getProp(e,t.w,0,null,this),this.d=new DashProperty(e,t.d||{},"svg",this),this.c=PropertyFactory.getProp(e,t.c,1,255,this),this.style=i,this._isAnimated=!!this._isAnimated}function SVGFillStyleData(e,t,i){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(e,t.o,0,.01,this),this.c=PropertyFactory.getProp(e,t.c,1,255,this),this.style=i}function SVGNoStyleData(e,t,i){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.style=i}function GradientProperty(e,t,i){this.data=t,this.c=createTypedArray("uint8c",4*t.p);var n=t.k.k[0].s?t.k.k[0].s.length-4*t.p:t.k.k.length-4*t.p;this.o=createTypedArray("float32",n),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=n,this.initDynamicPropertyContainer(i),this.prop=PropertyFactory.getProp(e,t.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}function SVGGradientFillStyleData(e,t,i){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.initGradientData(e,t,i)}function SVGGradientStrokeStyleData(e,t,i){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.w=PropertyFactory.getProp(e,t.w,0,null,this),this.d=new DashProperty(e,t.d||{},"svg",this),this.initGradientData(e,t,i),this._isAnimated=!!this._isAnimated}function ShapeGroupData(){this.it=[],this.prevViewData=[],this.gr=createNS("g")}function SVGTransformData(e,t,i){this.transform={mProps:e,op:t,container:i},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}SVGShapeData.prototype.setAsAnimated=function(){this._isAnimated=!0},SVGStyleData.prototype.reset=function(){this.d="",this._mdf=!1},DashProperty.prototype.getValue=function(e){if((this.elem.globalData.frameId!==this.frameId||e)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||e,this._mdf)){var t=0,i=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),t=0;t<i;t+=1)"o"!==this.dataProps[t].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[t].p.v:this.dashArray[t]=this.dataProps[t].p.v:this.dashoffset[0]=this.dataProps[t].p.v}},extendPrototype([DynamicPropertyContainer],DashProperty),extendPrototype([DynamicPropertyContainer],SVGStrokeStyleData),extendPrototype([DynamicPropertyContainer],SVGFillStyleData),extendPrototype([DynamicPropertyContainer],SVGNoStyleData),GradientProperty.prototype.comparePoints=function(e,t){for(var i=0,n=this.o.length/2;i<n;){if(Math.abs(e[4*i]-e[4*t+2*i])>.01)return!1;i+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!==this.c.length/4)return!1;if(this.data.k.k[0].s)for(var e=0,t=this.data.k.k.length;e<t;){if(!this.comparePoints(this.data.k.k[e].s,this.data.p))return!1;e+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},GradientProperty.prototype.getValue=function(e){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||e){var t,i,n,r=4*this.data.p;for(t=0;t<r;t+=1)i=t%4===0?100:255,n=Math.round(this.prop.v[t]*i),this.c[t]!==n&&(this.c[t]=n,this._cmdf=!e);if(this.o.length)for(r=this.prop.v.length,t=4*this.data.p;t<r;t+=1)i=t%2===0?100:1,n=t%2===0?Math.round(100*this.prop.v[t]):this.prop.v[t],this.o[t-4*this.data.p]!==n&&(this.o[t-4*this.data.p]=n,this._omdf=!e);this._mdf=!e}},extendPrototype([DynamicPropertyContainer],GradientProperty),SVGGradientFillStyleData.prototype.initGradientData=function(e,t,i){this.o=PropertyFactory.getProp(e,t.o,0,.01,this),this.s=PropertyFactory.getProp(e,t.s,1,null,this),this.e=PropertyFactory.getProp(e,t.e,1,null,this),this.h=PropertyFactory.getProp(e,t.h||{k:0},0,.01,this),this.a=PropertyFactory.getProp(e,t.a||{k:0},0,degToRads,this),this.g=new GradientProperty(e,t.g,this),this.style=i,this.stops=[],this.setGradientData(i.pElem,t),this.setGradientOpacity(t,i),this._isAnimated=!!this._isAnimated},SVGGradientFillStyleData.prototype.setGradientData=function(e,t){var i=createElementID(),n=createNS(1===t.t?"linearGradient":"radialGradient");n.setAttribute("id",i),n.setAttribute("spreadMethod","pad"),n.setAttribute("gradientUnits","userSpaceOnUse");var r,a,s,o=[];for(s=4*t.g.p,a=0;a<s;a+=4)r=createNS("stop"),n.appendChild(r),o.push(r);e.setAttribute("gf"===t.ty?"fill":"stroke","url("+getLocationHref()+"#"+i+")"),this.gf=n,this.cst=o},SVGGradientFillStyleData.prototype.setGradientOpacity=function(e,t){if(this.g._hasOpacity&&!this.g._collapsable){var i,n,r,a=createNS("mask"),s=createNS("path");a.appendChild(s);var o=createElementID(),l=createElementID();a.setAttribute("id",l);var c=createNS(1===e.t?"linearGradient":"radialGradient");c.setAttribute("id",o),c.setAttribute("spreadMethod","pad"),c.setAttribute("gradientUnits","userSpaceOnUse"),r=e.g.k.k[0].s?e.g.k.k[0].s.length:e.g.k.k.length;var h=this.stops;for(n=4*e.g.p;n<r;n+=2)(i=createNS("stop")).setAttribute("stop-color","rgb(255,255,255)"),c.appendChild(i),h.push(i);s.setAttribute("gf"===e.ty?"fill":"stroke","url("+getLocationHref()+"#"+o+")"),"gs"===e.ty&&(s.setAttribute("stroke-linecap",lineCapEnum[e.lc||2]),s.setAttribute("stroke-linejoin",lineJoinEnum[e.lj||2]),1===e.lj&&s.setAttribute("stroke-miterlimit",e.ml)),this.of=c,this.ms=a,this.ost=h,this.maskId=l,t.msElem=s}},extendPrototype([DynamicPropertyContainer],SVGGradientFillStyleData),extendPrototype([SVGGradientFillStyleData,DynamicPropertyContainer],SVGGradientStrokeStyleData);var buildShapeString=function(e,t,i,n){if(0===t)return"";var r,a=e.o,s=e.i,o=e.v,l=" M"+n.applyToPointStringified(o[0][0],o[0][1]);for(r=1;r<t;r+=1)l+=" C"+n.applyToPointStringified(a[r-1][0],a[r-1][1])+" "+n.applyToPointStringified(s[r][0],s[r][1])+" "+n.applyToPointStringified(o[r][0],o[r][1]);return i&&t&&(l+=" C"+n.applyToPointStringified(a[r-1][0],a[r-1][1])+" "+n.applyToPointStringified(s[0][0],s[0][1])+" "+n.applyToPointStringified(o[0][0],o[0][1]),l+="z"),l},SVGElementsRenderer=function(){var e=new Matrix,t=new Matrix;function i(e,t,i){(i||t.transform.op._mdf)&&t.transform.container.setAttribute("opacity",t.transform.op.v),(i||t.transform.mProps._mdf)&&t.transform.container.setAttribute("transform",t.transform.mProps.v.to2dCSS())}function n(){}function r(i,n,r){var a,s,o,l,c,h,u,d,p,f,m=n.styles.length,g=n.lvl;for(h=0;h<m;h+=1){if(l=n.sh._mdf||r,n.styles[h].lvl<g){for(d=t.reset(),p=g-n.styles[h].lvl,f=n.transformers.length-1;!l&&p>0;)l=n.transformers[f].mProps._mdf||l,p-=1,f-=1;if(l)for(p=g-n.styles[h].lvl,f=n.transformers.length-1;p>0;)d.multiply(n.transformers[f].mProps.v),p-=1,f-=1}else d=e;if(s=(u=n.sh.paths)._length,l){for(o="",a=0;a<s;a+=1)(c=u.shapes[a])&&c._length&&(o+=buildShapeString(c,c._length,c.c,d));n.caches[h]=o}else o=n.caches[h];n.styles[h].d+=!0===i.hd?"":o,n.styles[h]._mdf=l||n.styles[h]._mdf}}function a(e,t,i){var n=t.style;(t.c._mdf||i)&&n.pElem.setAttribute("fill","rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||i)&&n.pElem.setAttribute("fill-opacity",t.o.v)}function s(e,t,i){o(e,t,i),l(0,t,i)}function o(e,t,i){var n,r,a,s,o,l=t.gf,c=t.g._hasOpacity,h=t.s.v,u=t.e.v;if(t.o._mdf||i){var d="gf"===e.ty?"fill-opacity":"stroke-opacity";t.style.pElem.setAttribute(d,t.o.v)}if(t.s._mdf||i){var p=1===e.t?"x1":"cx",f="x1"===p?"y1":"cy";l.setAttribute(p,h[0]),l.setAttribute(f,h[1]),c&&!t.g._collapsable&&(t.of.setAttribute(p,h[0]),t.of.setAttribute(f,h[1]))}if(t.g._cmdf||i){n=t.cst;var m=t.g.c;for(a=n.length,r=0;r<a;r+=1)(s=n[r]).setAttribute("offset",m[4*r]+"%"),s.setAttribute("stop-color","rgb("+m[4*r+1]+","+m[4*r+2]+","+m[4*r+3]+")")}if(c&&(t.g._omdf||i)){var g=t.g.o;for(a=(n=t.g._collapsable?t.cst:t.ost).length,r=0;r<a;r+=1)s=n[r],t.g._collapsable||s.setAttribute("offset",g[2*r]+"%"),s.setAttribute("stop-opacity",g[2*r+1])}if(1===e.t)(t.e._mdf||i)&&(l.setAttribute("x2",u[0]),l.setAttribute("y2",u[1]),c&&!t.g._collapsable&&(t.of.setAttribute("x2",u[0]),t.of.setAttribute("y2",u[1])));else if((t.s._mdf||t.e._mdf||i)&&(o=Math.sqrt(Math.pow(h[0]-u[0],2)+Math.pow(h[1]-u[1],2)),l.setAttribute("r",o),c&&!t.g._collapsable&&t.of.setAttribute("r",o)),t.e._mdf||t.h._mdf||t.a._mdf||i){o||(o=Math.sqrt(Math.pow(h[0]-u[0],2)+Math.pow(h[1]-u[1],2)));var v=Math.atan2(u[1]-h[1],u[0]-h[0]),y=t.h.v;y>=1?y=.99:y<=-1&&(y=-.99);var b=o*y,x=Math.cos(v+t.a.v)*b+h[0],w=Math.sin(v+t.a.v)*b+h[1];l.setAttribute("fx",x),l.setAttribute("fy",w),c&&!t.g._collapsable&&(t.of.setAttribute("fx",x),t.of.setAttribute("fy",w))}}function l(e,t,i){var n=t.style,r=t.d;r&&(r._mdf||i)&&r.dashStr&&(n.pElem.setAttribute("stroke-dasharray",r.dashStr),n.pElem.setAttribute("stroke-dashoffset",r.dashoffset[0])),t.c&&(t.c._mdf||i)&&n.pElem.setAttribute("stroke","rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||i)&&n.pElem.setAttribute("stroke-opacity",t.o.v),(t.w._mdf||i)&&(n.pElem.setAttribute("stroke-width",t.w.v),n.msElem&&n.msElem.setAttribute("stroke-width",t.w.v))}return{createRenderFunction:function(e){switch(e.ty){case"fl":return a;case"gf":return o;case"gs":return s;case"st":return l;case"sh":case"el":case"rc":case"sr":return r;case"tr":return i;case"no":return n;default:return null}}}}();function SVGShapeElement(e,t,i){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(e,t,i),this.prevViewData=[]}function LetterProps(e,t,i,n,r,a){this.o=e,this.sw=t,this.sc=i,this.fc=n,this.m=r,this.p=a,this._mdf={o:!0,sw:!!t,sc:!!i,fc:!!n,m:!0,p:!0}}function TextProperty(e,t){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,t.d&&t.d.sid&&(t.d=e.globalData.slotManager.getProp(t.d)),this.data=t,this.elem=e,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var e,t,i,n,r=this.shapes.length,a=this.stylesList.length,s=[],o=!1;for(i=0;i<a;i+=1){for(n=this.stylesList[i],o=!1,s.length=0,e=0;e<r;e+=1)-1!==(t=this.shapes[e]).styles.indexOf(n)&&(s.push(t),o=t._isAnimated||o);s.length>1&&o&&this.setShapesAsAnimated(s)}},SVGShapeElement.prototype.setShapesAsAnimated=function(e){var t,i=e.length;for(t=0;t<i;t+=1)e[t].setAsAnimated()},SVGShapeElement.prototype.createStyleElement=function(e,t){var i,n=new SVGStyleData(e,t),r=n.pElem;return"st"===e.ty?i=new SVGStrokeStyleData(this,e,n):"fl"===e.ty?i=new SVGFillStyleData(this,e,n):"gf"===e.ty||"gs"===e.ty?(i=new("gf"===e.ty?SVGGradientFillStyleData:SVGGradientStrokeStyleData)(this,e,n),this.globalData.defs.appendChild(i.gf),i.maskId&&(this.globalData.defs.appendChild(i.ms),this.globalData.defs.appendChild(i.of),r.setAttribute("mask","url("+getLocationHref()+"#"+i.maskId+")"))):"no"===e.ty&&(i=new SVGNoStyleData(this,e,n)),"st"!==e.ty&&"gs"!==e.ty||(r.setAttribute("stroke-linecap",lineCapEnum[e.lc||2]),r.setAttribute("stroke-linejoin",lineJoinEnum[e.lj||2]),r.setAttribute("fill-opacity","0"),1===e.lj&&r.setAttribute("stroke-miterlimit",e.ml)),2===e.r&&r.setAttribute("fill-rule","evenodd"),e.ln&&r.setAttribute("id",e.ln),e.cl&&r.setAttribute("class",e.cl),e.bm&&(r.style["mix-blend-mode"]=getBlendMode(e.bm)),this.stylesList.push(n),this.addToAnimatedContents(e,i),i},SVGShapeElement.prototype.createGroupElement=function(e){var t=new ShapeGroupData;return e.ln&&t.gr.setAttribute("id",e.ln),e.cl&&t.gr.setAttribute("class",e.cl),e.bm&&(t.gr.style["mix-blend-mode"]=getBlendMode(e.bm)),t},SVGShapeElement.prototype.createTransformElement=function(e,t){var i=TransformPropertyFactory.getTransformProperty(this,e,this),n=new SVGTransformData(i,i.o,t);return this.addToAnimatedContents(e,n),n},SVGShapeElement.prototype.createShapeElement=function(e,t,i){var n=4;"rc"===e.ty?n=5:"el"===e.ty?n=6:"sr"===e.ty&&(n=7);var r=new SVGShapeData(t,i,ShapePropertyFactory.getShapeProp(this,e,n,this));return this.shapes.push(r),this.addShapeToModifiers(r),this.addToAnimatedContents(e,r),r},SVGShapeElement.prototype.addToAnimatedContents=function(e,t){for(var i=0,n=this.animatedContents.length;i<n;){if(this.animatedContents[i].element===t)return;i+=1}this.animatedContents.push({fn:SVGElementsRenderer.createRenderFunction(e),element:t,data:e})},SVGShapeElement.prototype.setElementStyles=function(e){var t,i=e.styles,n=this.stylesList.length;for(t=0;t<n;t+=1)this.stylesList[t].closed||i.push(this.stylesList[t])},SVGShapeElement.prototype.reloadShapes=function(){var e;this._isFirstFrame=!0;var t=this.itemsData.length;for(e=0;e<t;e+=1)this.prevViewData[e]=this.itemsData[e];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),t=this.dynamicProperties.length,e=0;e<t;e+=1)this.dynamicProperties[e].getValue();this.renderModifiers()},SVGShapeElement.prototype.searchShapes=function(e,t,i,n,r,a,s){var o,l,c,h,u,d,p=[].concat(a),f=e.length-1,m=[],g=[];for(o=f;o>=0;o-=1){if((d=this.searchProcessedElement(e[o]))?t[o]=i[d-1]:e[o]._render=s,"fl"===e[o].ty||"st"===e[o].ty||"gf"===e[o].ty||"gs"===e[o].ty||"no"===e[o].ty)d?t[o].style.closed=!1:t[o]=this.createStyleElement(e[o],r),e[o]._render&&t[o].style.pElem.parentNode!==n&&n.appendChild(t[o].style.pElem),m.push(t[o].style);else if("gr"===e[o].ty){if(d)for(c=t[o].it.length,l=0;l<c;l+=1)t[o].prevViewData[l]=t[o].it[l];else t[o]=this.createGroupElement(e[o]);this.searchShapes(e[o].it,t[o].it,t[o].prevViewData,t[o].gr,r+1,p,s),e[o]._render&&t[o].gr.parentNode!==n&&n.appendChild(t[o].gr)}else"tr"===e[o].ty?(d||(t[o]=this.createTransformElement(e[o],n)),h=t[o].transform,p.push(h)):"sh"===e[o].ty||"rc"===e[o].ty||"el"===e[o].ty||"sr"===e[o].ty?(d||(t[o]=this.createShapeElement(e[o],p,r)),this.setElementStyles(t[o])):"tm"===e[o].ty||"rd"===e[o].ty||"ms"===e[o].ty||"pb"===e[o].ty||"zz"===e[o].ty||"op"===e[o].ty?(d?(u=t[o]).closed=!1:((u=ShapeModifiers.getModifier(e[o].ty)).init(this,e[o]),t[o]=u,this.shapeModifiers.push(u)),g.push(u)):"rp"===e[o].ty&&(d?(u=t[o]).closed=!0:(u=ShapeModifiers.getModifier(e[o].ty),t[o]=u,u.init(this,e,o,t),this.shapeModifiers.push(u),s=!1),g.push(u));this.addProcessedElement(e[o],o+1)}for(f=m.length,o=0;o<f;o+=1)m[o].closed=!0;for(f=g.length,o=0;o<f;o+=1)g[o].closed=!0},SVGShapeElement.prototype.renderInnerContent=function(){var e;this.renderModifiers();var t=this.stylesList.length;for(e=0;e<t;e+=1)this.stylesList[e].reset();for(this.renderShape(),e=0;e<t;e+=1)(this.stylesList[e]._mdf||this._isFirstFrame)&&(this.stylesList[e].msElem&&(this.stylesList[e].msElem.setAttribute("d",this.stylesList[e].d),this.stylesList[e].d="M0 0"+this.stylesList[e].d),this.stylesList[e].pElem.setAttribute("d",this.stylesList[e].d||"M0 0"))},SVGShapeElement.prototype.renderShape=function(){var e,t,i=this.animatedContents.length;for(e=0;e<i;e+=1)t=this.animatedContents[e],(this._isFirstFrame||t.element._isAnimated)&&!0!==t.data&&t.fn(t.data,t.element,this._isFirstFrame)},SVGShapeElement.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null},LetterProps.prototype.update=function(e,t,i,n,r,a){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1,this._mdf.p=!1;var s=!1;return this.o!==e&&(this.o=e,this._mdf.o=!0,s=!0),this.sw!==t&&(this.sw=t,this._mdf.sw=!0,s=!0),this.sc!==i&&(this.sc=i,this._mdf.sc=!0,s=!0),this.fc!==n&&(this.fc=n,this._mdf.fc=!0,s=!0),this.m!==r&&(this.m=r,this._mdf.m=!0,s=!0),!a.length||this.p[0]===a[0]&&this.p[1]===a[1]&&this.p[4]===a[4]&&this.p[5]===a[5]&&this.p[12]===a[12]&&this.p[13]===a[13]||(this.p=a,this._mdf.p=!0,s=!0),s},TextProperty.prototype.defaultBoxWidth=[0,0],TextProperty.prototype.copyData=function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},TextProperty.prototype.setCurrentData=function(e){e.__complete||this.completeTextData(e),this.currentData=e,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},TextProperty.prototype.searchProperty=function(){return this.searchKeyframes()},TextProperty.prototype.searchKeyframes=function(){return this.kf=this.data.d.k.length>1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(e){this.effectsSequence.push(e),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(e){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||e){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var t=this.currentData,i=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{var n;this.lock=!0,this._mdf=!1;var r=this.effectsSequence.length,a=e||this.data.d.k[this.keysIndex].s;for(n=0;n<r;n+=1)a=i!==this.keysIndex?this.effectsSequence[n](a,a.t):this.effectsSequence[n](this.currentData,a.t);t!==a&&this.setCurrentData(a),this.v=this.currentData,this.pv=this.v,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},TextProperty.prototype.getKeyframeValue=function(){for(var e=this.data.d.k,t=this.elem.comp.renderedFrame,i=0,n=e.length;i<=n-1&&!(i===n-1||e[i+1].t>t);)i+=1;return this.keysIndex!==i&&(this.keysIndex=i),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(e){for(var t,i,n=[],r=0,a=e.length,s=!1,o=!1,l="";r<a;)s=o,o=!1,t=e.charCodeAt(r),l=e.charAt(r),FontManager.isCombinedCharacter(t)?s=!0:t>=55296&&t<=56319?FontManager.isRegionalFlag(e,r)?l=e.substr(r,14):(i=e.charCodeAt(r+1))>=56320&&i<=57343&&(FontManager.isModifier(t,i)?(l=e.substr(r,2),s=!0):l=FontManager.isFlagEmoji(e.substr(r,4))?e.substr(r,4):e.substr(r,2)):t>56319?(i=e.charCodeAt(r+1),FontManager.isVariationSelector(t)&&(s=!0)):FontManager.isZeroWidthJoiner(t)&&(s=!0,o=!0),s?(n[n.length-1]+=l,s=!1):n.push(l),r+=l.length;return n},TextProperty.prototype.completeTextData=function(e){e.__complete=!0;var t,i,n,r,a,s,o,l=this.elem.globalData.fontManager,c=this.data,h=[],u=0,d=c.m.g,p=0,f=0,m=0,g=[],v=0,y=0,b=l.getFontByName(e.f),x=0,w=getFontProperties(b);e.fWeight=w.weight,e.fStyle=w.style,e.finalSize=e.s,e.finalText=this.buildFinalText(e.t),i=e.finalText.length,e.finalLineHeight=e.lh;var _,S=e.tr/1e3*e.finalSize;if(e.sz)for(var E,C,A=!0,M=e.sz[0],T=e.sz[1];A;){E=0,v=0,i=(C=this.buildFinalText(e.t)).length,S=e.tr/1e3*e.finalSize;var P=-1;for(t=0;t<i;t+=1)_=C[t].charCodeAt(0),n=!1," "===C[t]?P=t:13!==_&&3!==_||(v=0,n=!0,E+=e.finalLineHeight||1.2*e.finalSize),l.chars?(o=l.getCharData(C[t],b.fStyle,b.fFamily),x=n?0:o.w*e.finalSize/100):x=l.measureText(C[t],e.f,e.finalSize),v+x>M&&" "!==C[t]?(-1===P?i+=1:t=P,E+=e.finalLineHeight||1.2*e.finalSize,C.splice(t,P===t?1:0,"\r"),P=-1,v=0):(v+=x,v+=S);E+=b.ascent*e.finalSize/100,this.canResize&&e.finalSize>this.minimumFontSize&&T<E?(e.finalSize-=1,e.finalLineHeight=e.finalSize*e.lh/e.s):(e.finalText=C,i=e.finalText.length,A=!1)}v=-S,x=0;var D,k=0;for(t=0;t<i;t+=1)if(n=!1,13===(_=(D=e.finalText[t]).charCodeAt(0))||3===_?(k=0,g.push(v),y=v>y?v:y,v=-2*S,r="",n=!0,m+=1):r=D,l.chars?(o=l.getCharData(D,b.fStyle,l.getFontByName(e.f).fFamily),x=n?0:o.w*e.finalSize/100):x=l.measureText(r,e.f,e.finalSize)," "===D?k+=x+S:(v+=x+S+k,k=0),h.push({l:x,an:x,add:p,n:n,anIndexes:[],val:r,line:m,animatorJustifyOffset:0}),2==d){if(p+=x,""===r||" "===r||t===i-1){for(""!==r&&" "!==r||(p-=x);f<=t;)h[f].an=p,h[f].ind=u,h[f].extra=x,f+=1;u+=1,p=0}}else if(3==d){if(p+=x,""===r||t===i-1){for(""===r&&(p-=x);f<=t;)h[f].an=p,h[f].ind=u,h[f].extra=x,f+=1;p=0,u+=1}}else h[u].ind=u,h[u].extra=0,u+=1;if(e.l=h,y=v>y?v:y,g.push(v),e.sz)e.boxWidth=e.sz[0],e.justifyOffset=0;else switch(e.boxWidth=y,e.j){case 1:e.justifyOffset=-e.boxWidth;break;case 2:e.justifyOffset=-e.boxWidth/2;break;default:e.justifyOffset=0}e.lineWidths=g;var O,I,R,L,B=c.a;s=B.length;var z=[];for(a=0;a<s;a+=1){for((O=B[a]).a.sc&&(e.strokeColorAnim=!0),O.a.sw&&(e.strokeWidthAnim=!0),(O.a.fc||O.a.fh||O.a.fs||O.a.fb)&&(e.fillColorAnim=!0),L=0,R=O.s.b,t=0;t<i;t+=1)(I=h[t]).anIndexes[a]=L,(1==R&&""!==I.val||2==R&&""!==I.val&&" "!==I.val||3==R&&(I.n||" "==I.val||t==i-1)||4==R&&(I.n||t==i-1))&&(1===O.s.rn&&z.push(L),L+=1);c.a[a].s.totalChars=L;var N,F=-1;if(1===O.s.rn)for(t=0;t<i;t+=1)F!=(I=h[t]).anIndexes[a]&&(F=I.anIndexes[a],N=z.splice(Math.floor(Math.random()*z.length),1)[0]),I.anIndexes[a]=N}e.yOffset=e.finalLineHeight||1.2*e.finalSize,e.ls=e.ls||0,e.ascent=b.ascent*e.finalSize/100},TextProperty.prototype.updateDocumentData=function(e,t){t=void 0===t?this.keysIndex:t;var i=this.copyData({},this.data.d.k[t].s);i=this.copyData(i,e),this.data.d.k[t].s=i,this.recalculate(t),this.setCurrentData(i),this.elem.addDynamicProperty(this)},TextProperty.prototype.recalculate=function(e){var t=this.data.d.k[e].s;t.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(t)},TextProperty.prototype.canResizeFont=function(e){this.canResize=e,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},TextProperty.prototype.setMinimumFontSize=function(e){this.minimumFontSize=Math.floor(e)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var TextSelectorProp=function(){var e=Math.max,t=Math.min,i=Math.floor;function n(e,t){this._currentTextLength=-1,this.k=!1,this.data=t,this.elem=e,this.comp=e.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(e),this.s=PropertyFactory.getProp(e,t.s||{k:0},0,0,this),this.e="e"in t?PropertyFactory.getProp(e,t.e,0,0,this):{v:100},this.o=PropertyFactory.getProp(e,t.o||{k:0},0,0,this),this.xe=PropertyFactory.getProp(e,t.xe||{k:0},0,0,this),this.ne=PropertyFactory.getProp(e,t.ne||{k:0},0,0,this),this.sm=PropertyFactory.getProp(e,t.sm||{k:100},0,0,this),this.a=PropertyFactory.getProp(e,t.a,0,.01,this),this.dynamicProperties.length||this.getValue()}return n.prototype={getMult:function(n){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var r=0,a=0,s=1,o=1;this.ne.v>0?r=this.ne.v/100:a=-this.ne.v/100,this.xe.v>0?s=1-this.xe.v/100:o=1+this.xe.v/100;var l=BezierFactory.getBezierEasing(r,a,s,o).get,c=0,h=this.finalS,u=this.finalE,d=this.data.sh;if(2===d)c=l(c=u===h?n>=u?1:0:e(0,t(.5/(u-h)+(n-h)/(u-h),1)));else if(3===d)c=l(c=u===h?n>=u?0:1:1-e(0,t(.5/(u-h)+(n-h)/(u-h),1)));else if(4===d)u===h?c=0:(c=e(0,t(.5/(u-h)+(n-h)/(u-h),1)))<.5?c*=2:c=1-2*(c-.5),c=l(c);else if(5===d){if(u===h)c=0;else{var p=u-h,f=-p/2+(n=t(e(0,n+.5-h),u-h)),m=p/2;c=Math.sqrt(1-f*f/(m*m))}c=l(c)}else 6===d?(u===h?c=0:(n=t(e(0,n+.5-h),u-h),c=(1+Math.cos(Math.PI+2*Math.PI*n/(u-h)))/2),c=l(c)):(n>=i(h)&&(c=e(0,t(n-h<0?t(u,1)-(h-n):u-n,1))),c=l(c));if(100!==this.sm.v){var g=.01*this.sm.v;0===g&&(g=1e-8);var v=.5-.5*g;c<v?c=0:(c=(c-v)/g)>1&&(c=1)}return c*this.a.v},getValue:function(e){this.iterateDynamicProperties(),this._mdf=e||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,e&&2===this.data.r&&(this.e.v=this._currentTextLength);var t=2===this.data.r?1:100/this.data.totalChars,i=this.o.v/t,n=this.s.v/t+i,r=this.e.v/t+i;if(n>r){var a=n;n=r,r=a}this.finalS=n,this.finalE=r}},extendPrototype([DynamicPropertyContainer],n),{getTextSelectorProp:function(e,t,i){return new n(e,t,i)}}}();function TextAnimatorDataProperty(e,t,i){var n={propType:!1},r=PropertyFactory.getProp,a=t.a;this.a={r:a.r?r(e,a.r,0,degToRads,i):n,rx:a.rx?r(e,a.rx,0,degToRads,i):n,ry:a.ry?r(e,a.ry,0,degToRads,i):n,sk:a.sk?r(e,a.sk,0,degToRads,i):n,sa:a.sa?r(e,a.sa,0,degToRads,i):n,s:a.s?r(e,a.s,1,.01,i):n,a:a.a?r(e,a.a,1,0,i):n,o:a.o?r(e,a.o,0,.01,i):n,p:a.p?r(e,a.p,1,0,i):n,sw:a.sw?r(e,a.sw,0,0,i):n,sc:a.sc?r(e,a.sc,1,0,i):n,fc:a.fc?r(e,a.fc,1,0,i):n,fh:a.fh?r(e,a.fh,0,0,i):n,fs:a.fs?r(e,a.fs,0,.01,i):n,fb:a.fb?r(e,a.fb,0,.01,i):n,t:a.t?r(e,a.t,0,0,i):n},this.s=TextSelectorProp.getTextSelectorProp(e,t.s,i),this.s.t=t.s.t}function TextAnimatorProperty(e,t,i){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=e,this._renderType=t,this._elem=i,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(i)}function ITextElement(){}TextAnimatorProperty.prototype.searchProperties=function(){var e,t,i=this._textData.a.length,n=PropertyFactory.getProp;for(e=0;e<i;e+=1)t=this._textData.a[e],this._animatorsData[e]=new TextAnimatorDataProperty(this._elem,t,this);this._textData.p&&"m"in this._textData.p?(this._pathData={a:n(this._elem,this._textData.p.a,0,0,this),f:n(this._elem,this._textData.p.f,0,0,this),l:n(this._elem,this._textData.p.l,0,0,this),r:n(this._elem,this._textData.p.r,0,0,this),p:n(this._elem,this._textData.p.p,0,0,this),m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=n(this._elem,this._textData.m.a,1,0,this)},TextAnimatorProperty.prototype.getMeasures=function(e,t){if(this.lettersChangedFlag=t,this._mdf||this._isFirstFrame||t||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var i,n,r,a,s,o,l,c,h,u,d,p,f,m,g,v,y,b,x,w=this._moreOptions.alignment.v,_=this._animatorsData,S=this._textData,E=this.mHelper,C=this._renderType,A=this.renderedLetters.length,M=e.l;if(this._hasMaskedPath){if(x=this._pathData.m,!this._pathData.n||this._pathData._mdf){var T,P=x.v;for(this._pathData.r.v&&(P=P.reverse()),s={tLength:0,segments:[]},a=P._length-1,v=0,r=0;r<a;r+=1)T=bez.buildBezierData(P.v[r],P.v[r+1],[P.o[r][0]-P.v[r][0],P.o[r][1]-P.v[r][1]],[P.i[r+1][0]-P.v[r+1][0],P.i[r+1][1]-P.v[r+1][1]]),s.tLength+=T.segmentLength,s.segments.push(T),v+=T.segmentLength;r=a,x.v.c&&(T=bez.buildBezierData(P.v[r],P.v[0],[P.o[r][0]-P.v[r][0],P.o[r][1]-P.v[r][1]],[P.i[0][0]-P.v[0][0],P.i[0][1]-P.v[0][1]]),s.tLength+=T.segmentLength,s.segments.push(T),v+=T.segmentLength),this._pathData.pi=s}if(s=this._pathData.pi,o=this._pathData.f.v,d=0,u=1,c=0,h=!0,m=s.segments,o<0&&x.v.c)for(s.tLength<Math.abs(o)&&(o=-Math.abs(o)%s.tLength),u=(f=m[d=m.length-1].points).length-1;o<0;)o+=f[u].partialLength,(u-=1)<0&&(u=(f=m[d-=1].points).length-1);p=(f=m[d].points)[u-1],g=(l=f[u]).partialLength}a=M.length,i=0,n=0;var D,k,O,I,R,L=1.2*e.finalSize*.714,B=!0;O=_.length;var z,N,F,j,V,U,G,H,W,q,X,Y,Q=-1,Z=o,K=d,J=u,$=-1,ee="",te=this.defaultPropsArray;if(2===e.j||1===e.j){var ie=0,ne=0,re=2===e.j?-.5:-1,ae=0,se=!0;for(r=0;r<a;r+=1)if(M[r].n){for(ie&&(ie+=ne);ae<r;)M[ae].animatorJustifyOffset=ie,ae+=1;ie=0,se=!0}else{for(k=0;k<O;k+=1)(D=_[k].a).t.propType&&(se&&2===e.j&&(ne+=D.t.v*re),(R=_[k].s.getMult(M[r].anIndexes[k],S.a[k].s.totalChars)).length?ie+=D.t.v*R[0]*re:ie+=D.t.v*R*re);se=!1}for(ie&&(ie+=ne);ae<r;)M[ae].animatorJustifyOffset=ie,ae+=1}for(r=0;r<a;r+=1){if(E.reset(),j=1,M[r].n)i=0,n+=e.yOffset,n+=B?1:0,o=Z,B=!1,this._hasMaskedPath&&(u=J,p=(f=m[d=K].points)[u-1],g=(l=f[u]).partialLength,c=0),ee="",X="",W="",Y="",te=this.defaultPropsArray;else{if(this._hasMaskedPath){if($!==M[r].line){switch(e.j){case 1:o+=v-e.lineWidths[M[r].line];break;case 2:o+=(v-e.lineWidths[M[r].line])/2}$=M[r].line}Q!==M[r].ind&&(M[Q]&&(o+=M[Q].extra),o+=M[r].an/2,Q=M[r].ind),o+=w[0]*M[r].an*.005;var oe=0;for(k=0;k<O;k+=1)(D=_[k].a).p.propType&&((R=_[k].s.getMult(M[r].anIndexes[k],S.a[k].s.totalChars)).length?oe+=D.p.v[0]*R[0]:oe+=D.p.v[0]*R),D.a.propType&&((R=_[k].s.getMult(M[r].anIndexes[k],S.a[k].s.totalChars)).length?oe+=D.a.v[0]*R[0]:oe+=D.a.v[0]*R);for(h=!0,this._pathData.a.v&&(o=.5*M[0].an+(v-this._pathData.f.v-.5*M[0].an-.5*M[M.length-1].an)*Q/(a-1),o+=this._pathData.f.v);h;)c+g>=o+oe||!f?(y=(o+oe-c)/l.partialLength,N=p.point[0]+(l.point[0]-p.point[0])*y,F=p.point[1]+(l.point[1]-p.point[1])*y,E.translate(-w[0]*M[r].an*.005,-w[1]*L*.01),h=!1):f&&(c+=l.partialLength,(u+=1)>=f.length&&(u=0,m[d+=1]?f=m[d].points:x.v.c?(u=0,f=m[d=0].points):(c-=l.partialLength,f=null)),f&&(p=l,g=(l=f[u]).partialLength));z=M[r].an/2-M[r].add,E.translate(-z,0,0)}else z=M[r].an/2-M[r].add,E.translate(-z,0,0),E.translate(-w[0]*M[r].an*.005,-w[1]*L*.01,0);for(k=0;k<O;k+=1)(D=_[k].a).t.propType&&(R=_[k].s.getMult(M[r].anIndexes[k],S.a[k].s.totalChars),0===i&&0===e.j||(this._hasMaskedPath?R.length?o+=D.t.v*R[0]:o+=D.t.v*R:R.length?i+=D.t.v*R[0]:i+=D.t.v*R));for(e.strokeWidthAnim&&(U=e.sw||0),e.strokeColorAnim&&(V=e.sc?[e.sc[0],e.sc[1],e.sc[2]]:[0,0,0]),e.fillColorAnim&&e.fc&&(G=[e.fc[0],e.fc[1],e.fc[2]]),k=0;k<O;k+=1)(D=_[k].a).a.propType&&((R=_[k].s.getMult(M[r].anIndexes[k],S.a[k].s.totalChars)).length?E.translate(-D.a.v[0]*R[0],-D.a.v[1]*R[1],D.a.v[2]*R[2]):E.translate(-D.a.v[0]*R,-D.a.v[1]*R,D.a.v[2]*R));for(k=0;k<O;k+=1)(D=_[k].a).s.propType&&((R=_[k].s.getMult(M[r].anIndexes[k],S.a[k].s.totalChars)).length?E.scale(1+(D.s.v[0]-1)*R[0],1+(D.s.v[1]-1)*R[1],1):E.scale(1+(D.s.v[0]-1)*R,1+(D.s.v[1]-1)*R,1));for(k=0;k<O;k+=1){if(D=_[k].a,R=_[k].s.getMult(M[r].anIndexes[k],S.a[k].s.totalChars),D.sk.propType&&(R.length?E.skewFromAxis(-D.sk.v*R[0],D.sa.v*R[1]):E.skewFromAxis(-D.sk.v*R,D.sa.v*R)),D.r.propType&&(R.length?E.rotateZ(-D.r.v*R[2]):E.rotateZ(-D.r.v*R)),D.ry.propType&&(R.length?E.rotateY(D.ry.v*R[1]):E.rotateY(D.ry.v*R)),D.rx.propType&&(R.length?E.rotateX(D.rx.v*R[0]):E.rotateX(D.rx.v*R)),D.o.propType&&(R.length?j+=(D.o.v*R[0]-j)*R[0]:j+=(D.o.v*R-j)*R),e.strokeWidthAnim&&D.sw.propType&&(R.length?U+=D.sw.v*R[0]:U+=D.sw.v*R),e.strokeColorAnim&&D.sc.propType)for(H=0;H<3;H+=1)R.length?V[H]+=(D.sc.v[H]-V[H])*R[0]:V[H]+=(D.sc.v[H]-V[H])*R;if(e.fillColorAnim&&e.fc){if(D.fc.propType)for(H=0;H<3;H+=1)R.length?G[H]+=(D.fc.v[H]-G[H])*R[0]:G[H]+=(D.fc.v[H]-G[H])*R;D.fh.propType&&(G=R.length?addHueToRGB(G,D.fh.v*R[0]):addHueToRGB(G,D.fh.v*R)),D.fs.propType&&(G=R.length?addSaturationToRGB(G,D.fs.v*R[0]):addSaturationToRGB(G,D.fs.v*R)),D.fb.propType&&(G=R.length?addBrightnessToRGB(G,D.fb.v*R[0]):addBrightnessToRGB(G,D.fb.v*R))}}for(k=0;k<O;k+=1)(D=_[k].a).p.propType&&(R=_[k].s.getMult(M[r].anIndexes[k],S.a[k].s.totalChars),this._hasMaskedPath?R.length?E.translate(0,D.p.v[1]*R[0],-D.p.v[2]*R[1]):E.translate(0,D.p.v[1]*R,-D.p.v[2]*R):R.length?E.translate(D.p.v[0]*R[0],D.p.v[1]*R[1],-D.p.v[2]*R[2]):E.translate(D.p.v[0]*R,D.p.v[1]*R,-D.p.v[2]*R));if(e.strokeWidthAnim&&(W=U<0?0:U),e.strokeColorAnim&&(q="rgb("+Math.round(255*V[0])+","+Math.round(255*V[1])+","+Math.round(255*V[2])+")"),e.fillColorAnim&&e.fc&&(X="rgb("+Math.round(255*G[0])+","+Math.round(255*G[1])+","+Math.round(255*G[2])+")"),this._hasMaskedPath){if(E.translate(0,-e.ls),E.translate(0,w[1]*L*.01+n,0),this._pathData.p.v){b=(l.point[1]-p.point[1])/(l.point[0]-p.point[0]);var le=180*Math.atan(b)/Math.PI;l.point[0]<p.point[0]&&(le+=180),E.rotate(-le*Math.PI/180)}E.translate(N,F,0),o-=w[0]*M[r].an*.005,M[r+1]&&Q!==M[r+1].ind&&(o+=M[r].an/2,o+=.001*e.tr*e.finalSize)}else{switch(E.translate(i,n,0),e.ps&&E.translate(e.ps[0],e.ps[1]+e.ascent,0),e.j){case 1:E.translate(M[r].animatorJustifyOffset+e.justifyOffset+(e.boxWidth-e.lineWidths[M[r].line]),0,0);break;case 2:E.translate(M[r].animatorJustifyOffset+e.justifyOffset+(e.boxWidth-e.lineWidths[M[r].line])/2,0,0)}E.translate(0,-e.ls),E.translate(z,0,0),E.translate(w[0]*M[r].an*.005,w[1]*L*.01,0),i+=M[r].l+.001*e.tr*e.finalSize}"html"===C?ee=E.toCSS():"svg"===C?ee=E.to2dCSS():te=[E.props[0],E.props[1],E.props[2],E.props[3],E.props[4],E.props[5],E.props[6],E.props[7],E.props[8],E.props[9],E.props[10],E.props[11],E.props[12],E.props[13],E.props[14],E.props[15]],Y=j}A<=r?(I=new LetterProps(Y,W,q,X,ee,te),this.renderedLetters.push(I),A+=1,this.lettersChangedFlag=!0):(I=this.renderedLetters[r],this.lettersChangedFlag=I.update(Y,W,q,X,ee,te)||this.lettersChangedFlag)}}},TextAnimatorProperty.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},TextAnimatorProperty.prototype.mHelper=new Matrix,TextAnimatorProperty.prototype.defaultPropsArray=[],extendPrototype([DynamicPropertyContainer],TextAnimatorProperty),ITextElement.prototype.initElement=function(e,t,i){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(e,t,i),this.textProperty=new TextProperty(this,e.t,this.dynamicProperties),this.textAnimator=new TextAnimatorProperty(e.t,this.renderType,this),this.initTransform(e,t,i),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},ITextElement.prototype.prepareFrame=function(e){this._mdf=!1,this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange)},ITextElement.prototype.createPathShape=function(e,t){var i,n,r=t.length,a="";for(i=0;i<r;i+=1)"sh"===t[i].ty&&(n=t[i].ks.k,a+=buildShapeString(n,n.i.length,!0,e));return a},ITextElement.prototype.updateDocumentData=function(e,t){this.textProperty.updateDocumentData(e,t)},ITextElement.prototype.canResizeFont=function(e){this.textProperty.canResizeFont(e)},ITextElement.prototype.setMinimumFontSize=function(e){this.textProperty.setMinimumFontSize(e)},ITextElement.prototype.applyTextPropertiesToMatrix=function(e,t,i,n,r){switch(e.ps&&t.translate(e.ps[0],e.ps[1]+e.ascent,0),t.translate(0,-e.ls,0),e.j){case 1:t.translate(e.justifyOffset+(e.boxWidth-e.lineWidths[i]),0,0);break;case 2:t.translate(e.justifyOffset+(e.boxWidth-e.lineWidths[i])/2,0,0)}t.translate(n,r,0)},ITextElement.prototype.buildColor=function(e){return"rgb("+Math.round(255*e[0])+","+Math.round(255*e[1])+","+Math.round(255*e[2])+")"},ITextElement.prototype.emptyProp=new LetterProps,ITextElement.prototype.destroy=function(){},ITextElement.prototype.validateText=function(){(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)};var emptyShapeData={shapes:[]};function SVGTextLottieElement(e,t,i){this.textSpans=[],this.renderType="svg",this.initElement(e,t,i)}function ISolidElement(e,t,i){this.initElement(e,t,i)}function NullElement(e,t,i){this.initFrame(),this.initBaseData(e,t,i),this.initFrame(),this.initTransform(e,t,i),this.initHierarchy()}function SVGRendererBase(){}function ICompElement(){}function SVGCompElement(e,t,i){this.layers=e.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(e,t,i),this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0}}function SVGRenderer(e,t){this.animationItem=e,this.layers=null,this.renderedFrame=-1,this.svgElement=createNS("svg");var i="";if(t&&t.title){var n=createNS("title"),r=createElementID();n.setAttribute("id",r),n.textContent=t.title,this.svgElement.appendChild(n),i+=r}if(t&&t.description){var a=createNS("desc"),s=createElementID();a.setAttribute("id",s),a.textContent=t.description,this.svgElement.appendChild(a),i+=" "+s}i&&this.svgElement.setAttribute("aria-labelledby",i);var o=createNS("defs");this.svgElement.appendChild(o);var l=createNS("g");this.svgElement.appendChild(l),this.layerElement=l,this.renderConfig={preserveAspectRatio:t&&t.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:t&&t.contentVisibility||"visible",progressiveLoad:t&&t.progressiveLoad||!1,hideOnTransparent:!(t&&!1===t.hideOnTransparent),viewBoxOnly:t&&t.viewBoxOnly||!1,viewBoxSize:t&&t.viewBoxSize||!1,className:t&&t.className||"",id:t&&t.id||"",focusable:t&&t.focusable,filterSize:{width:t&&t.filterSize&&t.filterSize.width||"100%",height:t&&t.filterSize&&t.filterSize.height||"100%",x:t&&t.filterSize&&t.filterSize.x||"0%",y:t&&t.filterSize&&t.filterSize.y||"0%"},width:t&&t.width,height:t&&t.height,runExpressions:!t||void 0===t.runExpressions||t.runExpressions},this.globalData={_mdf:!1,frameNum:-1,defs:o,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}function ShapeTransformManager(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],SVGTextLottieElement),SVGTextLottieElement.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=createNS("text"))},SVGTextLottieElement.prototype.buildTextContents=function(e){for(var t=0,i=e.length,n=[],r="";t<i;)e[t]===String.fromCharCode(13)||e[t]===String.fromCharCode(3)?(n.push(r),r=""):r+=e[t],t+=1;return n.push(r),n},SVGTextLottieElement.prototype.buildShapeData=function(e,t){if(e.shapes&&e.shapes.length){var i=e.shapes[0];if(i.it){var n=i.it[i.it.length-1];n.s&&(n.s.k[0]=t,n.s.k[1]=t)}}return e},SVGTextLottieElement.prototype.buildNewText=function(){var e,t;this.addDynamicProperty(this);var i=this.textProperty.currentData;this.renderedLetters=createSizedArray(i?i.l.length:0),i.fc?this.layerElement.setAttribute("fill",this.buildColor(i.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),i.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(i.sc)),this.layerElement.setAttribute("stroke-width",i.sw)),this.layerElement.setAttribute("font-size",i.finalSize);var n=this.globalData.fontManager.getFontByName(i.f);if(n.fClass)this.layerElement.setAttribute("class",n.fClass);else{this.layerElement.setAttribute("font-family",n.fFamily);var r=i.fWeight,a=i.fStyle;this.layerElement.setAttribute("font-style",a),this.layerElement.setAttribute("font-weight",r)}this.layerElement.setAttribute("aria-label",i.t);var s,o=i.l||[],l=!!this.globalData.fontManager.chars;t=o.length;var c=this.mHelper,h=this.data.singleShape,u=0,d=0,p=!0,f=.001*i.tr*i.finalSize;if(!h||l||i.sz){var m,g=this.textSpans.length;for(e=0;e<t;e+=1){if(this.textSpans[e]||(this.textSpans[e]={span:null,childSpan:null,glyph:null}),!l||!h||0===e){if(s=g>e?this.textSpans[e].span:createNS(l?"g":"text"),g<=e){if(s.setAttribute("stroke-linecap","butt"),s.setAttribute("stroke-linejoin","round"),s.setAttribute("stroke-miterlimit","4"),this.textSpans[e].span=s,l){var v=createNS("g");s.appendChild(v),this.textSpans[e].childSpan=v}this.textSpans[e].span=s,this.layerElement.appendChild(s)}s.style.display="inherit"}if(c.reset(),h&&(o[e].n&&(u=-f,d+=i.yOffset,d+=p?1:0,p=!1),this.applyTextPropertiesToMatrix(i,c,o[e].line,u,d),u+=o[e].l||0,u+=f),l){var y;if(1===(m=this.globalData.fontManager.getCharData(i.finalText[e],n.fStyle,this.globalData.fontManager.getFontByName(i.f).fFamily)).t)y=new SVGCompElement(m.data,this.globalData,this);else{var b=emptyShapeData;m.data&&m.data.shapes&&(b=this.buildShapeData(m.data,i.finalSize)),y=new SVGShapeElement(b,this.globalData,this)}if(this.textSpans[e].glyph){var x=this.textSpans[e].glyph;this.textSpans[e].childSpan.removeChild(x.layerElement),x.destroy()}this.textSpans[e].glyph=y,y._debug=!0,y.prepareFrame(0),y.renderFrame(),this.textSpans[e].childSpan.appendChild(y.layerElement),1===m.t&&this.textSpans[e].childSpan.setAttribute("transform","scale("+i.finalSize/100+","+i.finalSize/100+")")}else h&&s.setAttribute("transform","translate("+c.props[12]+","+c.props[13]+")"),s.textContent=o[e].val,s.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}h&&s&&s.setAttribute("d","")}else{var w=this.textContainer,_="start";switch(i.j){case 1:_="end";break;case 2:_="middle";break;default:_="start"}w.setAttribute("text-anchor",_),w.setAttribute("letter-spacing",f);var S=this.buildTextContents(i.finalText);for(t=S.length,d=i.ps?i.ps[1]+i.ascent:0,e=0;e<t;e+=1)(s=this.textSpans[e].span||createNS("tspan")).textContent=S[e],s.setAttribute("x",0),s.setAttribute("y",d),s.style.display="inherit",w.appendChild(s),this.textSpans[e]||(this.textSpans[e]={span:null,glyph:null}),this.textSpans[e].span=s,d+=i.finalLineHeight;this.layerElement.appendChild(w)}for(;e<this.textSpans.length;)this.textSpans[e].span.style.display="none",e+=1;this._sizeChanged=!0},SVGTextLottieElement.prototype.sourceRectAtTime=function(){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var e=this.layerElement.getBBox();this.bbox={top:e.y,left:e.x,width:e.width,height:e.height}}return this.bbox},SVGTextLottieElement.prototype.getValue=function(){var e,t,i=this.textSpans.length;for(this.renderedFrame=this.comp.renderedFrame,e=0;e<i;e+=1)(t=this.textSpans[e].glyph)&&(t.prepareFrame(this.comp.renderedFrame-this.data.st),t._mdf&&(this._mdf=!0))},SVGTextLottieElement.prototype.renderInnerContent=function(){if(this.validateText(),(!this.data.singleShape||this._mdf)&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){var e,t;this._sizeChanged=!0;var i,n,r,a=this.textAnimator.renderedLetters,s=this.textProperty.currentData.l;for(t=s.length,e=0;e<t;e+=1)s[e].n||(i=a[e],n=this.textSpans[e].span,(r=this.textSpans[e].glyph)&&r.renderFrame(),i._mdf.m&&n.setAttribute("transform",i.m),i._mdf.o&&n.setAttribute("opacity",i.o),i._mdf.sw&&n.setAttribute("stroke-width",i.sw),i._mdf.sc&&n.setAttribute("stroke",i.sc),i._mdf.fc&&n.setAttribute("fill",i.fc))}},extendPrototype([IImageElement],ISolidElement),ISolidElement.prototype.createContent=function(){var e=createNS("rect");e.setAttribute("width",this.data.sw),e.setAttribute("height",this.data.sh),e.setAttribute("fill",this.data.sc),this.layerElement.appendChild(e)},NullElement.prototype.prepareFrame=function(e){this.prepareProperties(e,!0)},NullElement.prototype.renderFrame=function(){},NullElement.prototype.getBaseElement=function(){return null},NullElement.prototype.destroy=function(){},NullElement.prototype.sourceRectAtTime=function(){},NullElement.prototype.hide=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement],NullElement),extendPrototype([BaseRenderer],SVGRendererBase),SVGRendererBase.prototype.createNull=function(e){return new NullElement(e,this.globalData,this)},SVGRendererBase.prototype.createShape=function(e){return new SVGShapeElement(e,this.globalData,this)},SVGRendererBase.prototype.createText=function(e){return new SVGTextLottieElement(e,this.globalData,this)},SVGRendererBase.prototype.createImage=function(e){return new IImageElement(e,this.globalData,this)},SVGRendererBase.prototype.createSolid=function(e){return new ISolidElement(e,this.globalData,this)},SVGRendererBase.prototype.configAnimation=function(e){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.svgElement.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+e.w+" "+e.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",e.w),this.svgElement.setAttribute("height",e.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)",this.svgElement.style.contentVisibility=this.renderConfig.contentVisibility),this.renderConfig.width&&this.svgElement.setAttribute("width",this.renderConfig.width),this.renderConfig.height&&this.svgElement.setAttribute("height",this.renderConfig.height),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var t=this.globalData.defs;this.setupGlobalData(e,t),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=e;var i=createNS("clipPath"),n=createNS("rect");n.setAttribute("width",e.w),n.setAttribute("height",e.h),n.setAttribute("x",0),n.setAttribute("y",0);var r=createElementID();i.setAttribute("id",r),i.appendChild(n),this.layerElement.setAttribute("clip-path","url("+getLocationHref()+"#"+r+")"),t.appendChild(i),this.layers=e.layers,this.elements=createSizedArray(e.layers.length)},SVGRendererBase.prototype.destroy=function(){var e;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var t=this.layers?this.layers.length:0;for(e=0;e<t;e+=1)this.elements[e]&&this.elements[e].destroy&&this.elements[e].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},SVGRendererBase.prototype.updateContainerSize=function(){},SVGRendererBase.prototype.findIndexByInd=function(e){var t=0,i=this.layers.length;for(t=0;t<i;t+=1)if(this.layers[t].ind===e)return t;return-1},SVGRendererBase.prototype.buildItem=function(e){var t=this.elements;if(!t[e]&&99!==this.layers[e].ty){t[e]=!0;var i=this.createItem(this.layers[e]);if(t[e]=i,getExpressionsPlugin()&&(0===this.layers[e].ty&&this.globalData.projectInterface.registerComposition(i),i.initExpressions()),this.appendElementInPos(i,e),this.layers[e].tt){var n="tp"in this.layers[e]?this.findIndexByInd(this.layers[e].tp):e-1;if(-1===n)return;if(this.elements[n]&&!0!==this.elements[n]){var r=t[n].getMatte(this.layers[e].tt);i.setMatte(r)}else this.buildItem(n),this.addPendingElement(i)}}},SVGRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var e=this.pendingElements.pop();if(e.checkParenting(),e.data.tt)for(var t=0,i=this.elements.length;t<i;){if(this.elements[t]===e){var n="tp"in e.data?this.findIndexByInd(e.data.tp):t-1,r=this.elements[n].getMatte(this.layers[t].tt);e.setMatte(r);break}t+=1}}},SVGRendererBase.prototype.renderFrame=function(e){if(this.renderedFrame!==e&&!this.destroyed){var t;null===e?e=this.renderedFrame:this.renderedFrame=e,this.globalData.frameNum=e,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=e,this.globalData._mdf=!1;var i=this.layers.length;for(this.completeLayers||this.checkLayers(e),t=i-1;t>=0;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].prepareFrame(e-this.layers[t].st);if(this.globalData._mdf)for(t=0;t<i;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()}},SVGRendererBase.prototype.appendElementInPos=function(e,t){var i=e.getBaseElement();if(i){for(var n,r=0;r<t;)this.elements[r]&&!0!==this.elements[r]&&this.elements[r].getBaseElement()&&(n=this.elements[r].getBaseElement()),r+=1;n?this.layerElement.insertBefore(i,n):this.layerElement.appendChild(i)}},SVGRendererBase.prototype.hide=function(){this.layerElement.style.display="none"},SVGRendererBase.prototype.show=function(){this.layerElement.style.display="block"},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement,RenderableDOMElement],ICompElement),ICompElement.prototype.initElement=function(e,t,i){this.initFrame(),this.initBaseData(e,t,i),this.initTransform(e,t,i),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&t.progressiveLoad||this.buildAllItems(),this.hide()},ICompElement.prototype.prepareFrame=function(e){if(this._mdf=!1,this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=e/this.data.sr;else{var t=this.tm.v;t===this.data.op&&(t=this.data.op-1),this.renderedFrame=t}var i,n=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),i=n-1;i>=0;i-=1)(this.completeLayers||this.elements[i])&&(this.elements[i].prepareFrame(this.renderedFrame-this.layers[i].st),this.elements[i]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var e,t=this.layers.length;for(e=0;e<t;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()},ICompElement.prototype.setElements=function(e){this.elements=e},ICompElement.prototype.getElements=function(){return this.elements},ICompElement.prototype.destroyElements=function(){var e,t=this.layers.length;for(e=0;e<t;e+=1)this.elements[e]&&this.elements[e].destroy()},ICompElement.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},extendPrototype([SVGRendererBase,ICompElement,SVGBaseElement],SVGCompElement),SVGCompElement.prototype.createComp=function(e){return new SVGCompElement(e,this.globalData,this)},extendPrototype([SVGRendererBase],SVGRenderer),SVGRenderer.prototype.createComp=function(e){return new SVGCompElement(e,this.globalData,this)},ShapeTransformManager.prototype={addTransformSequence:function(e){var t,i=e.length,n="_";for(t=0;t<i;t+=1)n+=e[t].transform.key+"_";var r=this.sequences[n];return r||(r={transforms:[].concat(e),finalTransform:new Matrix,_mdf:!1},this.sequences[n]=r,this.sequenceList.push(r)),r},processSequence:function(e,t){for(var i=0,n=e.transforms.length,r=t;i<n&&!t;){if(e.transforms[i].transform.mProps._mdf){r=!0;break}i+=1}if(r)for(e.finalTransform.reset(),i=n-1;i>=0;i-=1)e.finalTransform.multiply(e.transforms[i].transform.mProps.v);e._mdf=r},processSequences:function(e){var t,i=this.sequenceList.length;for(t=0;t<i;t+=1)this.processSequence(this.sequenceList[t],e)},getNewKey:function(){return this.transform_key_count+=1,"_"+this.transform_key_count}};var lumaLoader=function(){var e="__lottie_element_luma_buffer",t=null,i=null,n=null;function r(){t||(n=function(){var t=createNS("svg"),i=createNS("filter"),n=createNS("feColorMatrix");return i.setAttribute("id",e),n.setAttribute("type","matrix"),n.setAttribute("color-interpolation-filters","sRGB"),n.setAttribute("values","0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0"),i.appendChild(n),t.appendChild(i),t.setAttribute("id",e+"_svg"),featureSupport.svgLumaHidden&&(t.style.display="none"),t}(),document.body.appendChild(n),t=createTag("canvas"),(i=t.getContext("2d")).filter="url(#"+e+")",i.fillStyle="rgba(0,0,0,0)",i.fillRect(0,0,1,1))}return{load:r,get:function(n){return t||r(),t.width=n.width,t.height=n.height,i.filter="url(#"+e+")",t}}};function createCanvas(e,t){if(featureSupport.offscreenCanvas)return new OffscreenCanvas(e,t);var i=createTag("canvas");return i.width=e,i.height=t,i}var assetLoader={loadLumaCanvas:lumaLoader.load,getLumaCanvas:lumaLoader.get,createCanvas:createCanvas},registeredEffects={};function CVEffects(e){var t,i,n=e.data.ef?e.data.ef.length:0;for(this.filters=[],t=0;t<n;t+=1){i=null;var r=e.data.ef[t].ty;registeredEffects[r]&&(i=new(0,registeredEffects[r].effect)(e.effectsManager.effectElements[t],e)),i&&this.filters.push(i)}this.filters.length&&e.addRenderableComponent(this)}function registerEffect(e,t){registeredEffects[e]={effect:t}}function CVMaskElement(e,t){var i;this.data=e,this.element=t,this.masksProperties=this.data.masksProperties||[],this.viewData=createSizedArray(this.masksProperties.length);var n=this.masksProperties.length,r=!1;for(i=0;i<n;i+=1)"n"!==this.masksProperties[i].mode&&(r=!0),this.viewData[i]=ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[i],3);this.hasMasks=r,r&&this.element.addRenderableComponent(this)}function CVBaseElement(){}CVEffects.prototype.renderFrame=function(e){var t,i=this.filters.length;for(t=0;t<i;t+=1)this.filters[t].renderFrame(e)},CVEffects.prototype.getEffects=function(e){var t,i=this.filters.length,n=[];for(t=0;t<i;t+=1)this.filters[t].type===e&&n.push(this.filters[t]);return n},CVMaskElement.prototype.renderFrame=function(){if(this.hasMasks){var e,t,i,n,r=this.element.finalTransform.mat,a=this.element.canvasContext,s=this.masksProperties.length;for(a.beginPath(),e=0;e<s;e+=1)if("n"!==this.masksProperties[e].mode){var o;this.masksProperties[e].inv&&(a.moveTo(0,0),a.lineTo(this.element.globalData.compSize.w,0),a.lineTo(this.element.globalData.compSize.w,this.element.globalData.compSize.h),a.lineTo(0,this.element.globalData.compSize.h),a.lineTo(0,0)),n=this.viewData[e].v,t=r.applyToPointArray(n.v[0][0],n.v[0][1],0),a.moveTo(t[0],t[1]);var l=n._length;for(o=1;o<l;o+=1)i=r.applyToTriplePoints(n.o[o-1],n.i[o],n.v[o]),a.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5]);i=r.applyToTriplePoints(n.o[o-1],n.i[0],n.v[0]),a.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}this.element.globalData.renderer.save(!0),a.clip()}},CVMaskElement.prototype.getMaskProperty=MaskElement.prototype.getMaskProperty,CVMaskElement.prototype.destroy=function(){this.element=null};var operationsMap={1:"source-in",2:"source-out",3:"source-in",4:"source-out"};function CVShapeData(e,t,i,n){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var r,a=4;"rc"===t.ty?a=5:"el"===t.ty?a=6:"sr"===t.ty&&(a=7),this.sh=ShapePropertyFactory.getShapeProp(e,t,a,e);var s,o=i.length;for(r=0;r<o;r+=1)i[r].closed||(s={transforms:n.addTransformSequence(i[r].transforms),trNodes:[]},this.styledShapes.push(s),i[r].elements.push(s))}function CVShapeElement(e,t,i){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.itemsData=[],this.prevViewData=[],this.shapeModifiers=[],this.processedElements=[],this.transformsManager=new ShapeTransformManager,this.initElement(e,t,i)}function CVTextElement(e,t,i){this.textSpans=[],this.yOffset=0,this.fillColorAnim=!1,this.strokeColorAnim=!1,this.strokeWidthAnim=!1,this.stroke=!1,this.fill=!1,this.justifyOffset=0,this.currentRender=null,this.renderType="canvas",this.values={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",sWidth:0,fValue:""},this.initElement(e,t,i)}function CVImageElement(e,t,i){this.assetData=t.getAssetData(e.refId),this.img=t.imageLoader.getAsset(this.assetData),this.initElement(e,t,i)}function CVSolidElement(e,t,i){this.initElement(e,t,i)}function CanvasRendererBase(){}function CanvasContext(){this.opacity=-1,this.transform=createTypedArray("float32",16),this.fillStyle="",this.strokeStyle="",this.lineWidth="",this.lineCap="",this.lineJoin="",this.miterLimit="",this.id=Math.random()}function CVContextData(){var e;for(this.stack=[],this.cArrPos=0,this.cTr=new Matrix,e=0;e<15;e+=1){var t=new CanvasContext;this.stack[e]=t}this._length=15,this.nativeContext=null,this.transformMat=new Matrix,this.currentOpacity=1,this.currentFillStyle="",this.appliedFillStyle="",this.currentStrokeStyle="",this.appliedStrokeStyle="",this.currentLineWidth="",this.appliedLineWidth="",this.currentLineCap="",this.appliedLineCap="",this.currentLineJoin="",this.appliedLineJoin="",this.appliedMiterLimit="",this.currentMiterLimit=""}function CVCompElement(e,t,i){this.completeLayers=!1,this.layers=e.layers,this.pendingElements=[],this.elements=createSizedArray(this.layers.length),this.initElement(e,t,i),this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0}}function CanvasRenderer(e,t){this.animationItem=e,this.renderConfig={clearCanvas:!t||void 0===t.clearCanvas||t.clearCanvas,context:t&&t.context||null,progressiveLoad:t&&t.progressiveLoad||!1,preserveAspectRatio:t&&t.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:t&&t.contentVisibility||"visible",className:t&&t.className||"",id:t&&t.id||"",runExpressions:!t||void 0===t.runExpressions||t.runExpressions},this.renderConfig.dpr=t&&t.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=t&&t.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas",this.renderConfig.clearCanvas&&(this.ctxTransform=this.contextData.transform.bind(this.contextData),this.ctxOpacity=this.contextData.opacity.bind(this.contextData),this.ctxFillStyle=this.contextData.fillStyle.bind(this.contextData),this.ctxStrokeStyle=this.contextData.strokeStyle.bind(this.contextData),this.ctxLineWidth=this.contextData.lineWidth.bind(this.contextData),this.ctxLineCap=this.contextData.lineCap.bind(this.contextData),this.ctxLineJoin=this.contextData.lineJoin.bind(this.contextData),this.ctxMiterLimit=this.contextData.miterLimit.bind(this.contextData),this.ctxFill=this.contextData.fill.bind(this.contextData),this.ctxFillRect=this.contextData.fillRect.bind(this.contextData),this.ctxStroke=this.contextData.stroke.bind(this.contextData),this.save=this.contextData.save.bind(this.contextData))}function HBaseElement(){}function HSolidElement(e,t,i){this.initElement(e,t,i)}function HShapeElement(e,t,i){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=createNS("g"),this.initElement(e,t,i),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0}}function HTextElement(e,t,i){this.textSpans=[],this.textPaths=[],this.currentBBox={x:999999,y:-999999,h:0,w:0},this.renderType="svg",this.isMasked=!1,this.initElement(e,t,i)}function HCameraElement(e,t,i){this.initFrame(),this.initBaseData(e,t,i),this.initHierarchy();var n=PropertyFactory.getProp;if(this.pe=n(this,e.pe,0,0,this),e.ks.p.s?(this.px=n(this,e.ks.p.x,1,0,this),this.py=n(this,e.ks.p.y,1,0,this),this.pz=n(this,e.ks.p.z,1,0,this)):this.p=n(this,e.ks.p,1,0,this),e.ks.a&&(this.a=n(this,e.ks.a,1,0,this)),e.ks.or.k.length&&e.ks.or.k[0].to){var r,a=e.ks.or.k.length;for(r=0;r<a;r+=1)e.ks.or.k[r].to=null,e.ks.or.k[r].ti=null}this.or=n(this,e.ks.or,1,degToRads,this),this.or.sh=!0,this.rx=n(this,e.ks.rx,0,degToRads,this),this.ry=n(this,e.ks.ry,0,degToRads,this),this.rz=n(this,e.ks.rz,0,degToRads,this),this.mat=new Matrix,this._prevMat=new Matrix,this._isFirstFrame=!0,this.finalTransform={mProp:this}}function HImageElement(e,t,i){this.assetData=t.getAssetData(e.refId),this.initElement(e,t,i)}function HybridRendererBase(e,t){this.animationItem=e,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:t&&t.className||"",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!(t&&!1===t.hideOnTransparent),filterSize:{width:t&&t.filterSize&&t.filterSize.width||"400%",height:t&&t.filterSize&&t.filterSize.height||"400%",x:t&&t.filterSize&&t.filterSize.x||"-100%",y:t&&t.filterSize&&t.filterSize.y||"-100%"}},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}function HCompElement(e,t,i){this.layers=e.layers,this.supports3d=!e.hasMask,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(e,t,i),this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0}}function HybridRenderer(e,t){this.animationItem=e,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:t&&t.className||"",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!(t&&!1===t.hideOnTransparent),filterSize:{width:t&&t.filterSize&&t.filterSize.width||"400%",height:t&&t.filterSize&&t.filterSize.height||"400%",x:t&&t.filterSize&&t.filterSize.x||"-100%",y:t&&t.filterSize&&t.filterSize.y||"-100%"},runExpressions:!t||void 0===t.runExpressions||t.runExpressions},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}CVBaseElement.prototype={createElements:function(){},initRendererElement:function(){},createContainerElements:function(){if(this.data.tt>=1){this.buffers=[];var e=this.globalData.canvasContext,t=assetLoader.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(t);var i=assetLoader.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(i),this.data.tt>=3&&!document._isProxy&&assetLoader.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new CVEffects(this),this.searchEffectTransforms()},createContent:function(){},setBlendMode:function(){var e=this.globalData;if(e.blendMode!==this.data.bm){e.blendMode=this.data.bm;var t=getBlendMode(this.data.bm);e.canvasContext.globalCompositeOperation=t}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT)},hideElement:function(){this.hidden||this.isInRange&&!this.isTransparent||(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},clearCanvas:function(e){e.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)},prepareLayer:function(){if(this.data.tt>=1){var e=this.buffers[0].getContext("2d");this.clearCanvas(e),e.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}},exitLayer:function(){if(this.data.tt>=1){var e=this.buffers[1],t=e.getContext("2d");if(this.clearCanvas(t),t.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform),this.comp.getElementById("tp"in this.data?this.data.tp:this.data.ind-1).renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var i=assetLoader.getLumaCanvas(this.canvasContext.canvas);i.getContext("2d").drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(i,0,0)}this.canvasContext.globalCompositeOperation=operationsMap[this.data.tt],this.canvasContext.drawImage(e,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over"}},renderFrame:function(e){if(!this.hidden&&!this.data.hd&&(1!==this.data.td||e)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var t=0===this.data.ty;this.prepareLayer(),this.globalData.renderer.save(t),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(t),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement,CVShapeData.prototype.setAsAnimated=SVGShapeData.prototype.setAsAnimated,extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement],CVShapeElement),CVShapeElement.prototype.initElement=RenderableDOMElement.prototype.initElement,CVShapeElement.prototype.transformHelper={opacity:1,_opMdf:!1},CVShapeElement.prototype.dashResetter=[],CVShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])},CVShapeElement.prototype.createStyleElement=function(e,t){var i={data:e,type:e.ty,preTransforms:this.transformsManager.addTransformSequence(t),transforms:[],elements:[],closed:!0===e.hd},n={};if("fl"===e.ty||"st"===e.ty?(n.c=PropertyFactory.getProp(this,e.c,1,255,this),n.c.k||(i.co="rgb("+bmFloor(n.c.v[0])+","+bmFloor(n.c.v[1])+","+bmFloor(n.c.v[2])+")")):"gf"!==e.ty&&"gs"!==e.ty||(n.s=PropertyFactory.getProp(this,e.s,1,null,this),n.e=PropertyFactory.getProp(this,e.e,1,null,this),n.h=PropertyFactory.getProp(this,e.h||{k:0},0,.01,this),n.a=PropertyFactory.getProp(this,e.a||{k:0},0,degToRads,this),n.g=new GradientProperty(this,e.g,this)),n.o=PropertyFactory.getProp(this,e.o,0,.01,this),"st"===e.ty||"gs"===e.ty){if(i.lc=lineCapEnum[e.lc||2],i.lj=lineJoinEnum[e.lj||2],1==e.lj&&(i.ml=e.ml),n.w=PropertyFactory.getProp(this,e.w,0,null,this),n.w.k||(i.wi=n.w.v),e.d){var r=new DashProperty(this,e.d,"canvas",this);n.d=r,n.d.k||(i.da=n.d.dashArray,i.do=n.d.dashoffset[0])}}else i.r=2===e.r?"evenodd":"nonzero";return this.stylesList.push(i),n.style=i,n},CVShapeElement.prototype.createGroupElement=function(){return{it:[],prevViewData:[]}},CVShapeElement.prototype.createTransformElement=function(e){return{transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:PropertyFactory.getProp(this,e.o,0,.01,this),mProps:TransformPropertyFactory.getTransformProperty(this,e,this)}}},CVShapeElement.prototype.createShapeElement=function(e){var t=new CVShapeData(this,e,this.stylesList,this.transformsManager);return this.shapes.push(t),this.addShapeToModifiers(t),t},CVShapeElement.prototype.reloadShapes=function(){var e;this._isFirstFrame=!0;var t=this.itemsData.length;for(e=0;e<t;e+=1)this.prevViewData[e]=this.itemsData[e];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]),t=this.dynamicProperties.length,e=0;e<t;e+=1)this.dynamicProperties[e].getValue();this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame)},CVShapeElement.prototype.addTransformToStyleList=function(e){var t,i=this.stylesList.length;for(t=0;t<i;t+=1)this.stylesList[t].closed||this.stylesList[t].transforms.push(e)},CVShapeElement.prototype.removeTransformFromStyleList=function(){var e,t=this.stylesList.length;for(e=0;e<t;e+=1)this.stylesList[e].closed||this.stylesList[e].transforms.pop()},CVShapeElement.prototype.closeStyles=function(e){var t,i=e.length;for(t=0;t<i;t+=1)e[t].closed=!0},CVShapeElement.prototype.searchShapes=function(e,t,i,n,r){var a,s,o,l,c,h,u=e.length-1,d=[],p=[],f=[].concat(r);for(a=u;a>=0;a-=1){if((l=this.searchProcessedElement(e[a]))?t[a]=i[l-1]:e[a]._shouldRender=n,"fl"===e[a].ty||"st"===e[a].ty||"gf"===e[a].ty||"gs"===e[a].ty)l?t[a].style.closed=!1:t[a]=this.createStyleElement(e[a],f),d.push(t[a].style);else if("gr"===e[a].ty){if(l)for(o=t[a].it.length,s=0;s<o;s+=1)t[a].prevViewData[s]=t[a].it[s];else t[a]=this.createGroupElement(e[a]);this.searchShapes(e[a].it,t[a].it,t[a].prevViewData,n,f)}else"tr"===e[a].ty?(l||(h=this.createTransformElement(e[a]),t[a]=h),f.push(t[a]),this.addTransformToStyleList(t[a])):"sh"===e[a].ty||"rc"===e[a].ty||"el"===e[a].ty||"sr"===e[a].ty?l||(t[a]=this.createShapeElement(e[a])):"tm"===e[a].ty||"rd"===e[a].ty||"pb"===e[a].ty||"zz"===e[a].ty||"op"===e[a].ty?(l?(c=t[a]).closed=!1:((c=ShapeModifiers.getModifier(e[a].ty)).init(this,e[a]),t[a]=c,this.shapeModifiers.push(c)),p.push(c)):"rp"===e[a].ty&&(l?(c=t[a]).closed=!0:(c=ShapeModifiers.getModifier(e[a].ty),t[a]=c,c.init(this,e,a,t),this.shapeModifiers.push(c),n=!1),p.push(c));this.addProcessedElement(e[a],a+1)}for(this.removeTransformFromStyleList(),this.closeStyles(d),u=p.length,a=0;a<u;a+=1)p[a].closed=!0},CVShapeElement.prototype.renderInnerContent=function(){this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame),this.renderShape(this.transformHelper,this.shapesData,this.itemsData,!0)},CVShapeElement.prototype.renderShapeTransform=function(e,t){(e._opMdf||t.op._mdf||this._isFirstFrame)&&(t.opacity=e.opacity,t.opacity*=t.op.v,t._opMdf=!0)},CVShapeElement.prototype.drawLayer=function(){var e,t,i,n,r,a,s,o,l,c=this.stylesList.length,h=this.globalData.renderer,u=this.globalData.canvasContext;for(e=0;e<c;e+=1)if(("st"!==(o=(l=this.stylesList[e]).type)&&"gs"!==o||0!==l.wi)&&l.data._shouldRender&&0!==l.coOp&&0!==this.globalData.currentGlobalAlpha){for(h.save(),a=l.elements,"st"===o||"gs"===o?(h.ctxStrokeStyle("st"===o?l.co:l.grd),h.ctxLineWidth(l.wi),h.ctxLineCap(l.lc),h.ctxLineJoin(l.lj),h.ctxMiterLimit(l.ml||0)):h.ctxFillStyle("fl"===o?l.co:l.grd),h.ctxOpacity(l.coOp),"st"!==o&&"gs"!==o&&u.beginPath(),h.ctxTransform(l.preTransforms.finalTransform.props),i=a.length,t=0;t<i;t+=1){for("st"!==o&&"gs"!==o||(u.beginPath(),l.da&&(u.setLineDash(l.da),u.lineDashOffset=l.do)),r=(s=a[t].trNodes).length,n=0;n<r;n+=1)"m"===s[n].t?u.moveTo(s[n].p[0],s[n].p[1]):"c"===s[n].t?u.bezierCurveTo(s[n].pts[0],s[n].pts[1],s[n].pts[2],s[n].pts[3],s[n].pts[4],s[n].pts[5]):u.closePath();"st"!==o&&"gs"!==o||(h.ctxStroke(),l.da&&u.setLineDash(this.dashResetter))}"st"!==o&&"gs"!==o&&this.globalData.renderer.ctxFill(l.r),h.restore()}},CVShapeElement.prototype.renderShape=function(e,t,i,n){var r,a;for(a=e,r=t.length-1;r>=0;r-=1)"tr"===t[r].ty?(a=i[r].transform,this.renderShapeTransform(e,a)):"sh"===t[r].ty||"el"===t[r].ty||"rc"===t[r].ty||"sr"===t[r].ty?this.renderPath(t[r],i[r]):"fl"===t[r].ty?this.renderFill(t[r],i[r],a):"st"===t[r].ty?this.renderStroke(t[r],i[r],a):"gf"===t[r].ty||"gs"===t[r].ty?this.renderGradientFill(t[r],i[r],a):"gr"===t[r].ty?this.renderShape(a,t[r].it,i[r].it):t[r].ty;n&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(e,t){if(this._isFirstFrame||t._mdf||e.transforms._mdf){var i,n,r,a=e.trNodes,s=t.paths,o=s._length;a.length=0;var l=e.transforms.finalTransform;for(r=0;r<o;r+=1){var c=s.shapes[r];if(c&&c.v){for(n=c._length,i=1;i<n;i+=1)1===i&&a.push({t:"m",p:l.applyToPointArray(c.v[0][0],c.v[0][1],0)}),a.push({t:"c",pts:l.applyToTriplePoints(c.o[i-1],c.i[i],c.v[i])});1===n&&a.push({t:"m",p:l.applyToPointArray(c.v[0][0],c.v[0][1],0)}),c.c&&n&&(a.push({t:"c",pts:l.applyToTriplePoints(c.o[i-1],c.i[0],c.v[0])}),a.push({t:"z"}))}}e.trNodes=a}},CVShapeElement.prototype.renderPath=function(e,t){if(!0!==e.hd&&e._shouldRender){var i,n=t.styledShapes.length;for(i=0;i<n;i+=1)this.renderStyledShape(t.styledShapes[i],t.sh)}},CVShapeElement.prototype.renderFill=function(e,t,i){var n=t.style;(t.c._mdf||this._isFirstFrame)&&(n.co="rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||i._opMdf||this._isFirstFrame)&&(n.coOp=t.o.v*i.opacity)},CVShapeElement.prototype.renderGradientFill=function(e,t,i){var n,r=t.style;if(!r.grd||t.g._mdf||t.s._mdf||t.e._mdf||1!==e.t&&(t.h._mdf||t.a._mdf)){var a,s=this.globalData.canvasContext,o=t.s.v,l=t.e.v;if(1===e.t)n=s.createLinearGradient(o[0],o[1],l[0],l[1]);else{var c=Math.sqrt(Math.pow(o[0]-l[0],2)+Math.pow(o[1]-l[1],2)),h=Math.atan2(l[1]-o[1],l[0]-o[0]),u=t.h.v;u>=1?u=.99:u<=-1&&(u=-.99);var d=c*u,p=Math.cos(h+t.a.v)*d+o[0],f=Math.sin(h+t.a.v)*d+o[1];n=s.createRadialGradient(p,f,0,o[0],o[1],c)}var m=e.g.p,g=t.g.c,v=1;for(a=0;a<m;a+=1)t.g._hasOpacity&&t.g._collapsable&&(v=t.g.o[2*a+1]),n.addColorStop(g[4*a]/100,"rgba("+g[4*a+1]+","+g[4*a+2]+","+g[4*a+3]+","+v+")");r.grd=n}r.coOp=t.o.v*i.opacity},CVShapeElement.prototype.renderStroke=function(e,t,i){var n=t.style,r=t.d;r&&(r._mdf||this._isFirstFrame)&&(n.da=r.dashArray,n.do=r.dashoffset[0]),(t.c._mdf||this._isFirstFrame)&&(n.co="rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||i._opMdf||this._isFirstFrame)&&(n.coOp=t.o.v*i.opacity),(t.w._mdf||this._isFirstFrame)&&(n.wi=t.w.v)},CVShapeElement.prototype.destroy=function(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.itemsData.length=0},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement,ITextElement],CVTextElement),CVTextElement.prototype.tHelper=createTag("canvas").getContext("2d"),CVTextElement.prototype.buildNewText=function(){var e=this.textProperty.currentData;this.renderedLetters=createSizedArray(e.l?e.l.length:0);var t=!1;e.fc?(t=!0,this.values.fill=this.buildColor(e.fc)):this.values.fill="rgba(0,0,0,0)",this.fill=t;var i=!1;e.sc&&(i=!0,this.values.stroke=this.buildColor(e.sc),this.values.sWidth=e.sw);var n,r,a,s,o,l,c,h,u,d,p,f,m=this.globalData.fontManager.getFontByName(e.f),g=e.l,v=this.mHelper;this.stroke=i,this.values.fValue=e.finalSize+"px "+this.globalData.fontManager.getFontByName(e.f).fFamily,r=e.finalText.length;var y=this.data.singleShape,b=.001*e.tr*e.finalSize,x=0,w=0,_=!0,S=0;for(n=0;n<r;n+=1){s=(a=this.globalData.fontManager.getCharData(e.finalText[n],m.fStyle,this.globalData.fontManager.getFontByName(e.f).fFamily))&&a.data||{},v.reset(),y&&g[n].n&&(x=-b,w+=e.yOffset,w+=_?1:0,_=!1),u=(c=s.shapes?s.shapes[0].it:[]).length,v.scale(e.finalSize/100,e.finalSize/100),y&&this.applyTextPropertiesToMatrix(e,v,g[n].line,x,w),p=createSizedArray(u-1);var E=0;for(h=0;h<u;h+=1)if("sh"===c[h].ty){for(l=c[h].ks.k.i.length,d=c[h].ks.k,f=[],o=1;o<l;o+=1)1===o&&f.push(v.applyToX(d.v[0][0],d.v[0][1],0),v.applyToY(d.v[0][0],d.v[0][1],0)),f.push(v.applyToX(d.o[o-1][0],d.o[o-1][1],0),v.applyToY(d.o[o-1][0],d.o[o-1][1],0),v.applyToX(d.i[o][0],d.i[o][1],0),v.applyToY(d.i[o][0],d.i[o][1],0),v.applyToX(d.v[o][0],d.v[o][1],0),v.applyToY(d.v[o][0],d.v[o][1],0));f.push(v.applyToX(d.o[o-1][0],d.o[o-1][1],0),v.applyToY(d.o[o-1][0],d.o[o-1][1],0),v.applyToX(d.i[0][0],d.i[0][1],0),v.applyToY(d.i[0][0],d.i[0][1],0),v.applyToX(d.v[0][0],d.v[0][1],0),v.applyToY(d.v[0][0],d.v[0][1],0)),p[E]=f,E+=1}y&&(x+=g[n].l,x+=b),this.textSpans[S]?this.textSpans[S].elem=p:this.textSpans[S]={elem:p},S+=1}},CVTextElement.prototype.renderInnerContent=function(){var e,t,i,n,r,a;this.validateText(),this.canvasContext.font=this.values.fValue,this.globalData.renderer.ctxLineCap("butt"),this.globalData.renderer.ctxLineJoin("miter"),this.globalData.renderer.ctxMiterLimit(4),this.data.singleShape||this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag);var s,o=this.textAnimator.renderedLetters,l=this.textProperty.currentData.l;t=l.length;var c,h,u=null,d=null,p=null,f=this.globalData.renderer;for(e=0;e<t;e+=1)if(!l[e].n){if((s=o[e])&&(f.save(),f.ctxTransform(s.p),f.ctxOpacity(s.o)),this.fill){for(s&&s.fc?u!==s.fc&&(f.ctxFillStyle(s.fc),u=s.fc):u!==this.values.fill&&(u=this.values.fill,f.ctxFillStyle(this.values.fill)),n=(c=this.textSpans[e].elem).length,this.globalData.canvasContext.beginPath(),i=0;i<n;i+=1)for(a=(h=c[i]).length,this.globalData.canvasContext.moveTo(h[0],h[1]),r=2;r<a;r+=6)this.globalData.canvasContext.bezierCurveTo(h[r],h[r+1],h[r+2],h[r+3],h[r+4],h[r+5]);this.globalData.canvasContext.closePath(),f.ctxFill()}if(this.stroke){for(s&&s.sw?p!==s.sw&&(p=s.sw,f.ctxLineWidth(s.sw)):p!==this.values.sWidth&&(p=this.values.sWidth,f.ctxLineWidth(this.values.sWidth)),s&&s.sc?d!==s.sc&&(d=s.sc,f.ctxStrokeStyle(s.sc)):d!==this.values.stroke&&(d=this.values.stroke,f.ctxStrokeStyle(this.values.stroke)),n=(c=this.textSpans[e].elem).length,this.globalData.canvasContext.beginPath(),i=0;i<n;i+=1)for(a=(h=c[i]).length,this.globalData.canvasContext.moveTo(h[0],h[1]),r=2;r<a;r+=6)this.globalData.canvasContext.bezierCurveTo(h[r],h[r+1],h[r+2],h[r+3],h[r+4],h[r+5]);this.globalData.canvasContext.closePath(),f.ctxStroke()}s&&this.globalData.renderer.restore()}},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVImageElement),CVImageElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVImageElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVImageElement.prototype.createContent=function(){if(this.img.width&&(this.assetData.w!==this.img.width||this.assetData.h!==this.img.height)){var e=createTag("canvas");e.width=this.assetData.w,e.height=this.assetData.h;var t,i,n=e.getContext("2d"),r=this.img.width,a=this.img.height,s=r/a,o=this.assetData.w/this.assetData.h,l=this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio;s>o&&"xMidYMid slice"===l||s<o&&"xMidYMid slice"!==l?t=(i=a)*o:i=(t=r)/o,n.drawImage(this.img,(r-t)/2,(a-i)/2,t,i,0,0,this.assetData.w,this.assetData.h),this.img=e}},CVImageElement.prototype.renderInnerContent=function(){this.canvasContext.drawImage(this.img,0,0)},CVImageElement.prototype.destroy=function(){this.img=null},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVSolidElement),CVSolidElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVSolidElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVSolidElement.prototype.renderInnerContent=function(){this.globalData.renderer.ctxFillStyle(this.data.sc),this.globalData.renderer.ctxFillRect(0,0,this.data.sw,this.data.sh)},extendPrototype([BaseRenderer],CanvasRendererBase),CanvasRendererBase.prototype.createShape=function(e){return new CVShapeElement(e,this.globalData,this)},CanvasRendererBase.prototype.createText=function(e){return new CVTextElement(e,this.globalData,this)},CanvasRendererBase.prototype.createImage=function(e){return new CVImageElement(e,this.globalData,this)},CanvasRendererBase.prototype.createSolid=function(e){return new CVSolidElement(e,this.globalData,this)},CanvasRendererBase.prototype.createNull=SVGRenderer.prototype.createNull,CanvasRendererBase.prototype.ctxTransform=function(e){1===e[0]&&0===e[1]&&0===e[4]&&1===e[5]&&0===e[12]&&0===e[13]||this.canvasContext.transform(e[0],e[1],e[4],e[5],e[12],e[13])},CanvasRendererBase.prototype.ctxOpacity=function(e){this.canvasContext.globalAlpha*=e<0?0:e},CanvasRendererBase.prototype.ctxFillStyle=function(e){this.canvasContext.fillStyle=e},CanvasRendererBase.prototype.ctxStrokeStyle=function(e){this.canvasContext.strokeStyle=e},CanvasRendererBase.prototype.ctxLineWidth=function(e){this.canvasContext.lineWidth=e},CanvasRendererBase.prototype.ctxLineCap=function(e){this.canvasContext.lineCap=e},CanvasRendererBase.prototype.ctxLineJoin=function(e){this.canvasContext.lineJoin=e},CanvasRendererBase.prototype.ctxMiterLimit=function(e){this.canvasContext.miterLimit=e},CanvasRendererBase.prototype.ctxFill=function(e){this.canvasContext.fill(e)},CanvasRendererBase.prototype.ctxFillRect=function(e,t,i,n){this.canvasContext.fillRect(e,t,i,n)},CanvasRendererBase.prototype.ctxStroke=function(){this.canvasContext.stroke()},CanvasRendererBase.prototype.reset=function(){this.renderConfig.clearCanvas?this.contextData.reset():this.canvasContext.restore()},CanvasRendererBase.prototype.save=function(){this.canvasContext.save()},CanvasRendererBase.prototype.restore=function(e){this.renderConfig.clearCanvas?(e&&(this.globalData.blendMode="source-over"),this.contextData.restore(e)):this.canvasContext.restore()},CanvasRendererBase.prototype.configAnimation=function(e){if(this.animationItem.wrapper){this.animationItem.container=createTag("canvas");var t=this.animationItem.container.style;t.width="100%",t.height="100%";var i="0px 0px 0px";t.transformOrigin=i,t.mozTransformOrigin=i,t.webkitTransformOrigin=i,t["-webkit-transform"]=i,t.contentVisibility=this.renderConfig.contentVisibility,this.animationItem.wrapper.appendChild(this.animationItem.container),this.canvasContext=this.animationItem.container.getContext("2d"),this.renderConfig.className&&this.animationItem.container.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.animationItem.container.setAttribute("id",this.renderConfig.id)}else this.canvasContext=this.renderConfig.context;this.contextData.setContext(this.canvasContext),this.data=e,this.layers=e.layers,this.transformCanvas={w:e.w,h:e.h,sx:0,sy:0,tx:0,ty:0},this.setupGlobalData(e,document.body),this.globalData.canvasContext=this.canvasContext,this.globalData.renderer=this,this.globalData.isDashed=!1,this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.transformCanvas=this.transformCanvas,this.elements=createSizedArray(e.layers.length),this.updateContainerSize()},CanvasRendererBase.prototype.updateContainerSize=function(e,t){var i,n,r,a;if(this.reset(),e?(i=e,n=t,this.canvasContext.canvas.width=i,this.canvasContext.canvas.height=n):(this.animationItem.wrapper&&this.animationItem.container?(i=this.animationItem.wrapper.offsetWidth,n=this.animationItem.wrapper.offsetHeight):(i=this.canvasContext.canvas.width,n=this.canvasContext.canvas.height),this.canvasContext.canvas.width=i*this.renderConfig.dpr,this.canvasContext.canvas.height=n*this.renderConfig.dpr),-1!==this.renderConfig.preserveAspectRatio.indexOf("meet")||-1!==this.renderConfig.preserveAspectRatio.indexOf("slice")){var s=this.renderConfig.preserveAspectRatio.split(" "),o=s[1]||"meet",l=s[0]||"xMidYMid",c=l.substr(0,4),h=l.substr(4);r=i/n,(a=this.transformCanvas.w/this.transformCanvas.h)>r&&"meet"===o||a<r&&"slice"===o?(this.transformCanvas.sx=i/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=i/(this.transformCanvas.w/this.renderConfig.dpr)):(this.transformCanvas.sx=n/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.sy=n/(this.transformCanvas.h/this.renderConfig.dpr)),this.transformCanvas.tx="xMid"===c&&(a<r&&"meet"===o||a>r&&"slice"===o)?(i-this.transformCanvas.w*(n/this.transformCanvas.h))/2*this.renderConfig.dpr:"xMax"===c&&(a<r&&"meet"===o||a>r&&"slice"===o)?(i-this.transformCanvas.w*(n/this.transformCanvas.h))*this.renderConfig.dpr:0,this.transformCanvas.ty="YMid"===h&&(a>r&&"meet"===o||a<r&&"slice"===o)?(n-this.transformCanvas.h*(i/this.transformCanvas.w))/2*this.renderConfig.dpr:"YMax"===h&&(a>r&&"meet"===o||a<r&&"slice"===o)?(n-this.transformCanvas.h*(i/this.transformCanvas.w))*this.renderConfig.dpr:0}else"none"===this.renderConfig.preserveAspectRatio?(this.transformCanvas.sx=i/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=n/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.tx=0,this.transformCanvas.ty=0):(this.transformCanvas.sx=this.renderConfig.dpr,this.transformCanvas.sy=this.renderConfig.dpr,this.transformCanvas.tx=0,this.transformCanvas.ty=0);this.transformCanvas.props=[this.transformCanvas.sx,0,0,0,0,this.transformCanvas.sy,0,0,0,0,1,0,this.transformCanvas.tx,this.transformCanvas.ty,0,1],this.ctxTransform(this.transformCanvas.props),this.canvasContext.beginPath(),this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h),this.canvasContext.closePath(),this.canvasContext.clip(),this.renderFrame(this.renderedFrame,!0)},CanvasRendererBase.prototype.destroy=function(){var e;for(this.renderConfig.clearCanvas&&this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),e=(this.layers?this.layers.length:0)-1;e>=0;e-=1)this.elements[e]&&this.elements[e].destroy&&this.elements[e].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRendererBase.prototype.renderFrame=function(e,t){if((this.renderedFrame!==e||!0!==this.renderConfig.clearCanvas||t)&&!this.destroyed&&-1!==e){var i;this.renderedFrame=e,this.globalData.frameNum=e-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||t,this.globalData.projectInterface.currentFrame=e;var n=this.layers.length;for(this.completeLayers||this.checkLayers(e),i=n-1;i>=0;i-=1)(this.completeLayers||this.elements[i])&&this.elements[i].prepareFrame(e-this.layers[i].st);if(this.globalData._mdf){for(!0===this.renderConfig.clearCanvas?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),i=n-1;i>=0;i-=1)(this.completeLayers||this.elements[i])&&this.elements[i].renderFrame();!0!==this.renderConfig.clearCanvas&&this.restore()}}},CanvasRendererBase.prototype.buildItem=function(e){var t=this.elements;if(!t[e]&&99!==this.layers[e].ty){var i=this.createItem(this.layers[e],this,this.globalData);t[e]=i,i.initExpressions()}},CanvasRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;)this.pendingElements.pop().checkParenting()},CanvasRendererBase.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRendererBase.prototype.show=function(){this.animationItem.container.style.display="block"},CVContextData.prototype.duplicate=function(){var e=2*this._length,t=0;for(t=this._length;t<e;t+=1)this.stack[t]=new CanvasContext;this._length=e},CVContextData.prototype.reset=function(){this.cArrPos=0,this.cTr.reset(),this.stack[this.cArrPos].opacity=1},CVContextData.prototype.restore=function(e){this.cArrPos-=1;var t,i=this.stack[this.cArrPos],n=i.transform,r=this.cTr.props;for(t=0;t<16;t+=1)r[t]=n[t];if(e){this.nativeContext.restore();var a=this.stack[this.cArrPos+1];this.appliedFillStyle=a.fillStyle,this.appliedStrokeStyle=a.strokeStyle,this.appliedLineWidth=a.lineWidth,this.appliedLineCap=a.lineCap,this.appliedLineJoin=a.lineJoin,this.appliedMiterLimit=a.miterLimit}this.nativeContext.setTransform(n[0],n[1],n[4],n[5],n[12],n[13]),(e||-1!==i.opacity&&this.currentOpacity!==i.opacity)&&(this.nativeContext.globalAlpha=i.opacity,this.currentOpacity=i.opacity),this.currentFillStyle=i.fillStyle,this.currentStrokeStyle=i.strokeStyle,this.currentLineWidth=i.lineWidth,this.currentLineCap=i.lineCap,this.currentLineJoin=i.lineJoin,this.currentMiterLimit=i.miterLimit},CVContextData.prototype.save=function(e){e&&this.nativeContext.save();var t=this.cTr.props;this._length<=this.cArrPos&&this.duplicate();var i,n=this.stack[this.cArrPos];for(i=0;i<16;i+=1)n.transform[i]=t[i];this.cArrPos+=1;var r=this.stack[this.cArrPos];r.opacity=n.opacity,r.fillStyle=n.fillStyle,r.strokeStyle=n.strokeStyle,r.lineWidth=n.lineWidth,r.lineCap=n.lineCap,r.lineJoin=n.lineJoin,r.miterLimit=n.miterLimit},CVContextData.prototype.setOpacity=function(e){this.stack[this.cArrPos].opacity=e},CVContextData.prototype.setContext=function(e){this.nativeContext=e},CVContextData.prototype.fillStyle=function(e){this.stack[this.cArrPos].fillStyle!==e&&(this.currentFillStyle=e,this.stack[this.cArrPos].fillStyle=e)},CVContextData.prototype.strokeStyle=function(e){this.stack[this.cArrPos].strokeStyle!==e&&(this.currentStrokeStyle=e,this.stack[this.cArrPos].strokeStyle=e)},CVContextData.prototype.lineWidth=function(e){this.stack[this.cArrPos].lineWidth!==e&&(this.currentLineWidth=e,this.stack[this.cArrPos].lineWidth=e)},CVContextData.prototype.lineCap=function(e){this.stack[this.cArrPos].lineCap!==e&&(this.currentLineCap=e,this.stack[this.cArrPos].lineCap=e)},CVContextData.prototype.lineJoin=function(e){this.stack[this.cArrPos].lineJoin!==e&&(this.currentLineJoin=e,this.stack[this.cArrPos].lineJoin=e)},CVContextData.prototype.miterLimit=function(e){this.stack[this.cArrPos].miterLimit!==e&&(this.currentMiterLimit=e,this.stack[this.cArrPos].miterLimit=e)},CVContextData.prototype.transform=function(e){this.transformMat.cloneFromProps(e);var t=this.cTr;this.transformMat.multiply(t),t.cloneFromProps(this.transformMat.props);var i=t.props;this.nativeContext.setTransform(i[0],i[1],i[4],i[5],i[12],i[13])},CVContextData.prototype.opacity=function(e){var t=this.stack[this.cArrPos].opacity;t*=e<0?0:e,this.stack[this.cArrPos].opacity!==t&&(this.currentOpacity!==e&&(this.nativeContext.globalAlpha=e,this.currentOpacity=e),this.stack[this.cArrPos].opacity=t)},CVContextData.prototype.fill=function(e){this.appliedFillStyle!==this.currentFillStyle&&(this.appliedFillStyle=this.currentFillStyle,this.nativeContext.fillStyle=this.appliedFillStyle),this.nativeContext.fill(e)},CVContextData.prototype.fillRect=function(e,t,i,n){this.appliedFillStyle!==this.currentFillStyle&&(this.appliedFillStyle=this.currentFillStyle,this.nativeContext.fillStyle=this.appliedFillStyle),this.nativeContext.fillRect(e,t,i,n)},CVContextData.prototype.stroke=function(){this.appliedStrokeStyle!==this.currentStrokeStyle&&(this.appliedStrokeStyle=this.currentStrokeStyle,this.nativeContext.strokeStyle=this.appliedStrokeStyle),this.appliedLineWidth!==this.currentLineWidth&&(this.appliedLineWidth=this.currentLineWidth,this.nativeContext.lineWidth=this.appliedLineWidth),this.appliedLineCap!==this.currentLineCap&&(this.appliedLineCap=this.currentLineCap,this.nativeContext.lineCap=this.appliedLineCap),this.appliedLineJoin!==this.currentLineJoin&&(this.appliedLineJoin=this.currentLineJoin,this.nativeContext.lineJoin=this.appliedLineJoin),this.appliedMiterLimit!==this.currentMiterLimit&&(this.appliedMiterLimit=this.currentMiterLimit,this.nativeContext.miterLimit=this.appliedMiterLimit),this.nativeContext.stroke()},extendPrototype([CanvasRendererBase,ICompElement,CVBaseElement],CVCompElement),CVCompElement.prototype.renderInnerContent=function(){var e,t=this.canvasContext;for(t.beginPath(),t.moveTo(0,0),t.lineTo(this.data.w,0),t.lineTo(this.data.w,this.data.h),t.lineTo(0,this.data.h),t.lineTo(0,0),t.clip(),e=this.layers.length-1;e>=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()},CVCompElement.prototype.destroy=function(){var e;for(e=this.layers.length-1;e>=0;e-=1)this.elements[e]&&this.elements[e].destroy();this.layers=null,this.elements=null},CVCompElement.prototype.createComp=function(e){return new CVCompElement(e,this.globalData,this)},extendPrototype([CanvasRendererBase],CanvasRenderer),CanvasRenderer.prototype.createComp=function(e){return new CVCompElement(e,this.globalData,this)},HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new CVEffects(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0!==this.data.bm&&this.setBlendMode()},renderElement:function(){var e=this.transformedElement?this.transformedElement.style:{};if(this.finalTransform._matMdf){var t=this.finalTransform.mat.toCSS();e.transform=t,e.webkitTransform=t}this.finalTransform._opMdf&&(e.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData)},addEffects:function(){},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=BaseRenderer.prototype.buildElementParenting,extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var e;this.data.hasMask?((e=createNS("rect")).setAttribute("width",this.data.sw),e.setAttribute("height",this.data.sh),e.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):((e=createTag("div")).style.width=this.data.sw+"px",e.style.height=this.data.sh+"px",e.style.backgroundColor=this.data.sc),this.layerElement.appendChild(e)},extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var e;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),e=this.svgElement;else{e=createNS("svg");var t=this.comp.data?this.comp.data:this.globalData.compSize;e.setAttribute("width",t.w),e.setAttribute("height",t.h),e.appendChild(this.shapesContainer),this.layerElement.appendChild(e)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=e},HShapeElement.prototype.getTransformedPoint=function(e,t){var i,n=e.length;for(i=0;i<n;i+=1)t=e[i].mProps.v.applyToPointArray(t[0],t[1],0);return t},HShapeElement.prototype.calculateShapeBoundingBox=function(e,t){var i,n,r,a,s,o=e.sh.v,l=e.transformers,c=o._length;if(!(c<=1)){for(i=0;i<c-1;i+=1)n=this.getTransformedPoint(l,o.v[i]),r=this.getTransformedPoint(l,o.o[i]),a=this.getTransformedPoint(l,o.i[i+1]),s=this.getTransformedPoint(l,o.v[i+1]),this.checkBounds(n,r,a,s,t);o.c&&(n=this.getTransformedPoint(l,o.v[i]),r=this.getTransformedPoint(l,o.o[i]),a=this.getTransformedPoint(l,o.i[0]),s=this.getTransformedPoint(l,o.v[0]),this.checkBounds(n,r,a,s,t))}},HShapeElement.prototype.checkBounds=function(e,t,i,n,r){this.getBoundsOfCurve(e,t,i,n);var a=this.shapeBoundingBox;r.x=bmMin(a.left,r.x),r.xMax=bmMax(a.right,r.xMax),r.y=bmMin(a.top,r.y),r.yMax=bmMax(a.bottom,r.yMax)},HShapeElement.prototype.shapeBoundingBox={left:0,right:0,top:0,bottom:0},HShapeElement.prototype.tempBoundingBox={x:0,xMax:0,y:0,yMax:0,width:0,height:0},HShapeElement.prototype.getBoundsOfCurve=function(e,t,i,n){for(var r,a,s,o,l,c,h,u=[[e[0],n[0]],[e[1],n[1]]],d=0;d<2;++d)a=6*e[d]-12*t[d]+6*i[d],r=-3*e[d]+9*t[d]-9*i[d]+3*n[d],s=3*t[d]-3*e[d],a|=0,s|=0,0===(r|=0)&&0===a||(0===r?(o=-s/a)>0&&o<1&&u[d].push(this.calculateF(o,e,t,i,n,d)):(l=a*a-4*s*r)>=0&&((c=(-a+bmSqrt(l))/(2*r))>0&&c<1&&u[d].push(this.calculateF(c,e,t,i,n,d)),(h=(-a-bmSqrt(l))/(2*r))>0&&h<1&&u[d].push(this.calculateF(h,e,t,i,n,d))));this.shapeBoundingBox.left=bmMin.apply(null,u[0]),this.shapeBoundingBox.top=bmMin.apply(null,u[1]),this.shapeBoundingBox.right=bmMax.apply(null,u[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,u[1])},HShapeElement.prototype.calculateF=function(e,t,i,n,r,a){return bmPow(1-e,3)*t[a]+3*bmPow(1-e,2)*e*i[a]+3*(1-e)*bmPow(e,2)*n[a]+bmPow(e,3)*r[a]},HShapeElement.prototype.calculateBoundingBox=function(e,t){var i,n=e.length;for(i=0;i<n;i+=1)e[i]&&e[i].sh?this.calculateShapeBoundingBox(e[i],t):e[i]&&e[i].it?this.calculateBoundingBox(e[i].it,t):e[i]&&e[i].style&&e[i].w&&this.expandStrokeBoundingBox(e[i].w,t)},HShapeElement.prototype.expandStrokeBoundingBox=function(e,t){var i=0;if(e.keyframes){for(var n=0;n<e.keyframes.length;n+=1){var r=e.keyframes[n].s;r>i&&(i=r)}i*=e.mult}else i=e.v*e.mult;t.x-=i,t.xMax+=i,t.y-=i,t.yMax+=i},HShapeElement.prototype.currentBoxContains=function(e){return this.currentBBox.x<=e.x&&this.currentBBox.y<=e.y&&this.currentBBox.width+this.currentBBox.x>=e.x+e.width&&this.currentBBox.height+this.currentBBox.y>=e.y+e.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var e=this.tempBoundingBox,t=999999;if(e.x=t,e.xMax=-t,e.y=t,e.yMax=-t,this.calculateBoundingBox(this.itemsData,e),e.width=e.xMax<e.x?0:e.xMax-e.x,e.height=e.yMax<e.y?0:e.yMax-e.y,this.currentBoxContains(e))return;var i=!1;if(this.currentBBox.w!==e.width&&(this.currentBBox.w=e.width,this.shapeCont.setAttribute("width",e.width),i=!0),this.currentBBox.h!==e.height&&(this.currentBBox.h=e.height,this.shapeCont.setAttribute("height",e.height),i=!0),i||this.currentBBox.x!==e.x||this.currentBBox.y!==e.y){this.currentBBox.w=e.width,this.currentBBox.h=e.height,this.currentBBox.x=e.x,this.currentBBox.y=e.y,this.shapeCont.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h);var n=this.shapeCont.style,r="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";n.transform=r,n.webkitTransform=r}}},extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],HTextElement),HTextElement.prototype.createContent=function(){if(this.isMasked=this.checkMasks(),this.isMasked){this.renderType="svg",this.compW=this.comp.data.w,this.compH=this.comp.data.h,this.svgElement.setAttribute("width",this.compW),this.svgElement.setAttribute("height",this.compH);var e=createNS("g");this.maskedElement.appendChild(e),this.innerElem=e}else this.renderType="html",this.innerElem=this.layerElement;this.checkParenting()},HTextElement.prototype.buildNewText=function(){var e=this.textProperty.currentData;this.renderedLetters=createSizedArray(e.l?e.l.length:0);var t=this.innerElem.style,i=e.fc?this.buildColor(e.fc):"rgba(0,0,0,0)";t.fill=i,t.color=i,e.sc&&(t.stroke=this.buildColor(e.sc),t.strokeWidth=e.sw+"px");var n,r,a=this.globalData.fontManager.getFontByName(e.f);if(!this.globalData.fontManager.chars)if(t.fontSize=e.finalSize+"px",t.lineHeight=e.finalSize+"px",a.fClass)this.innerElem.className=a.fClass;else{t.fontFamily=a.fFamily;var s=e.fWeight,o=e.fStyle;t.fontStyle=o,t.fontWeight=s}var l,c,h,u=e.l;r=u.length;var d,p=this.mHelper,f="",m=0;for(n=0;n<r;n+=1){if(this.globalData.fontManager.chars?(this.textPaths[m]?l=this.textPaths[m]:((l=createNS("path")).setAttribute("stroke-linecap",lineCapEnum[1]),l.setAttribute("stroke-linejoin",lineJoinEnum[2]),l.setAttribute("stroke-miterlimit","4")),this.isMasked||(this.textSpans[m]?h=(c=this.textSpans[m]).children[0]:((c=createTag("div")).style.lineHeight=0,(h=createNS("svg")).appendChild(l),styleDiv(c)))):this.isMasked?l=this.textPaths[m]?this.textPaths[m]:createNS("text"):this.textSpans[m]?(c=this.textSpans[m],l=this.textPaths[m]):(styleDiv(c=createTag("span")),styleDiv(l=createTag("span")),c.appendChild(l)),this.globalData.fontManager.chars){var g,v=this.globalData.fontManager.getCharData(e.finalText[n],a.fStyle,this.globalData.fontManager.getFontByName(e.f).fFamily);if(g=v?v.data:null,p.reset(),g&&g.shapes&&g.shapes.length&&(d=g.shapes[0].it,p.scale(e.finalSize/100,e.finalSize/100),f=this.createPathShape(p,d),l.setAttribute("d",f)),this.isMasked)this.innerElem.appendChild(l);else{if(this.innerElem.appendChild(c),g&&g.shapes){document.body.appendChild(h);var y=h.getBBox();h.setAttribute("width",y.width+2),h.setAttribute("height",y.height+2),h.setAttribute("viewBox",y.x-1+" "+(y.y-1)+" "+(y.width+2)+" "+(y.height+2));var b=h.style,x="translate("+(y.x-1)+"px,"+(y.y-1)+"px)";b.transform=x,b.webkitTransform=x,u[n].yOffset=y.y-1}else h.setAttribute("width",1),h.setAttribute("height",1);c.appendChild(h)}}else if(l.textContent=u[n].val,l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),this.isMasked)this.innerElem.appendChild(l);else{this.innerElem.appendChild(c);var w=l.style,_="translate3d(0,"+-e.finalSize/1.2+"px,0)";w.transform=_,w.webkitTransform=_}this.isMasked?this.textSpans[m]=l:this.textSpans[m]=c,this.textSpans[m].style.display="block",this.textPaths[m]=l,m+=1}for(;m<this.textSpans.length;)this.textSpans[m].style.display="none",m+=1},HTextElement.prototype.renderInnerContent=function(){var e;if(this.validateText(),this.data.singleShape){if(!this._isFirstFrame&&!this.lettersChangedFlag)return;if(this.isMasked&&this.finalTransform._matMdf){this.svgElement.setAttribute("viewBox",-this.finalTransform.mProp.p.v[0]+" "+-this.finalTransform.mProp.p.v[1]+" "+this.compW+" "+this.compH),e=this.svgElement.style;var t="translate("+-this.finalTransform.mProp.p.v[0]+"px,"+-this.finalTransform.mProp.p.v[1]+"px)";e.transform=t,e.webkitTransform=t}}if(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag){var i,n,r,a,s,o=0,l=this.textAnimator.renderedLetters,c=this.textProperty.currentData.l;for(n=c.length,i=0;i<n;i+=1)c[i].n?o+=1:(a=this.textSpans[i],s=this.textPaths[i],r=l[o],o+=1,r._mdf.m&&(this.isMasked?a.setAttribute("transform",r.m):(a.style.webkitTransform=r.m,a.style.transform=r.m)),a.style.opacity=r.o,r.sw&&r._mdf.sw&&s.setAttribute("stroke-width",r.sw),r.sc&&r._mdf.sc&&s.setAttribute("stroke",r.sc),r.fc&&r._mdf.fc&&(s.setAttribute("fill",r.fc),s.style.color=r.fc));if(this.innerElem.getBBox&&!this.hidden&&(this._isFirstFrame||this._mdf)){var h=this.innerElem.getBBox();if(this.currentBBox.w!==h.width&&(this.currentBBox.w=h.width,this.svgElement.setAttribute("width",h.width)),this.currentBBox.h!==h.height&&(this.currentBBox.h=h.height,this.svgElement.setAttribute("height",h.height)),this.currentBBox.w!==h.width+2||this.currentBBox.h!==h.height+2||this.currentBBox.x!==h.x-1||this.currentBBox.y!==h.y-1){this.currentBBox.w=h.width+2,this.currentBBox.h=h.height+2,this.currentBBox.x=h.x-1,this.currentBBox.y=h.y-1,this.svgElement.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h),e=this.svgElement.style;var u="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";e.transform=u,e.webkitTransform=u}}}},extendPrototype([BaseElement,FrameElement,HierarchyElement],HCameraElement),HCameraElement.prototype.setup=function(){var e,t,i,n,r=this.comp.threeDElements.length;for(e=0;e<r;e+=1)if("3d"===(t=this.comp.threeDElements[e]).type){i=t.perspectiveElem.style,n=t.container.style;var a=this.pe.v+"px",s="0px 0px 0px",o="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";i.perspective=a,i.webkitPerspective=a,n.transformOrigin=s,n.mozTransformOrigin=s,n.webkitTransformOrigin=s,i.transform=o,i.webkitTransform=o}},HCameraElement.prototype.createElements=function(){},HCameraElement.prototype.hide=function(){},HCameraElement.prototype.renderFrame=function(){var e,t,i=this._isFirstFrame;if(this.hierarchy)for(t=this.hierarchy.length,e=0;e<t;e+=1)i=this.hierarchy[e].finalTransform.mProp._mdf||i;if(i||this.pe._mdf||this.p&&this.p._mdf||this.px&&(this.px._mdf||this.py._mdf||this.pz._mdf)||this.rx._mdf||this.ry._mdf||this.rz._mdf||this.or._mdf||this.a&&this.a._mdf){if(this.mat.reset(),this.hierarchy)for(e=t=this.hierarchy.length-1;e>=0;e-=1){var n=this.hierarchy[e].finalTransform.mProp;this.mat.translate(-n.p.v[0],-n.p.v[1],n.p.v[2]),this.mat.rotateX(-n.or.v[0]).rotateY(-n.or.v[1]).rotateZ(n.or.v[2]),this.mat.rotateX(-n.rx.v).rotateY(-n.ry.v).rotateZ(n.rz.v),this.mat.scale(1/n.s.v[0],1/n.s.v[1],1/n.s.v[2]),this.mat.translate(n.a.v[0],n.a.v[1],n.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var r;r=this.p?[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var a=Math.sqrt(Math.pow(r[0],2)+Math.pow(r[1],2)+Math.pow(r[2],2)),s=[r[0]/a,r[1]/a,r[2]/a],o=Math.sqrt(s[2]*s[2]+s[0]*s[0]),l=Math.atan2(s[1],o),c=Math.atan2(s[0],-s[2]);this.mat.rotateY(c).rotateX(-l)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var h=!this._prevMat.equals(this.mat);if((h||this.pe._mdf)&&this.comp.threeDElements){var u,d,p;for(t=this.comp.threeDElements.length,e=0;e<t;e+=1)if("3d"===(u=this.comp.threeDElements[e]).type){if(h){var f=this.mat.toCSS();(p=u.container.style).transform=f,p.webkitTransform=f}this.pe._mdf&&((d=u.perspectiveElem.style).perspective=this.pe.v+"px",d.webkitPerspective=this.pe.v+"px")}this.mat.clone(this._prevMat)}}this._isFirstFrame=!1},HCameraElement.prototype.prepareFrame=function(e){this.prepareProperties(e,!0)},HCameraElement.prototype.destroy=function(){},HCameraElement.prototype.getBaseElement=function(){return null},extendPrototype([BaseElement,TransformElement,HBaseElement,HSolidElement,HierarchyElement,FrameElement,RenderableElement],HImageElement),HImageElement.prototype.createContent=function(){var e=this.globalData.getAssetsPath(this.assetData),t=new Image;this.data.hasMask?(this.imageElem=createNS("image"),this.imageElem.setAttribute("width",this.assetData.w+"px"),this.imageElem.setAttribute("height",this.assetData.h+"px"),this.imageElem.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this.layerElement.appendChild(this.imageElem),this.baseElement.setAttribute("width",this.assetData.w),this.baseElement.setAttribute("height",this.assetData.h)):this.layerElement.appendChild(t),t.crossOrigin="anonymous",t.src=e,this.data.ln&&this.baseElement.setAttribute("id",this.data.ln)},extendPrototype([BaseRenderer],HybridRendererBase),HybridRendererBase.prototype.buildItem=SVGRenderer.prototype.buildItem,HybridRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;)this.pendingElements.pop().checkParenting()},HybridRendererBase.prototype.appendElementInPos=function(e,t){var i=e.getBaseElement();if(i){var n=this.layers[t];if(n.ddd&&this.supports3d)this.addTo3dContainer(i,t);else if(this.threeDElements)this.addTo3dContainer(i,t);else{for(var r,a,s=0;s<t;)this.elements[s]&&!0!==this.elements[s]&&this.elements[s].getBaseElement&&(a=this.elements[s],r=(this.layers[s].ddd?this.getThreeDContainerByPos(s):a.getBaseElement())||r),s+=1;r?n.ddd&&this.supports3d||this.layerElement.insertBefore(i,r):n.ddd&&this.supports3d||this.layerElement.appendChild(i)}}},HybridRendererBase.prototype.createShape=function(e){return this.supports3d?new HShapeElement(e,this.globalData,this):new SVGShapeElement(e,this.globalData,this)},HybridRendererBase.prototype.createText=function(e){return this.supports3d?new HTextElement(e,this.globalData,this):new SVGTextLottieElement(e,this.globalData,this)},HybridRendererBase.prototype.createCamera=function(e){return this.camera=new HCameraElement(e,this.globalData,this),this.camera},HybridRendererBase.prototype.createImage=function(e){return this.supports3d?new HImageElement(e,this.globalData,this):new IImageElement(e,this.globalData,this)},HybridRendererBase.prototype.createSolid=function(e){return this.supports3d?new HSolidElement(e,this.globalData,this):new ISolidElement(e,this.globalData,this)},HybridRendererBase.prototype.createNull=SVGRenderer.prototype.createNull,HybridRendererBase.prototype.getThreeDContainerByPos=function(e){for(var t=0,i=this.threeDElements.length;t<i;){if(this.threeDElements[t].startPos<=e&&this.threeDElements[t].endPos>=e)return this.threeDElements[t].perspectiveElem;t+=1}return null},HybridRendererBase.prototype.createThreeDContainer=function(e,t){var i,n,r=createTag("div");styleDiv(r);var a=createTag("div");if(styleDiv(a),"3d"===t){(i=r.style).width=this.globalData.compSize.w+"px",i.height=this.globalData.compSize.h+"px";var s="50% 50%";i.webkitTransformOrigin=s,i.mozTransformOrigin=s,i.transformOrigin=s;var o="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";(n=a.style).transform=o,n.webkitTransform=o}r.appendChild(a);var l={container:a,perspectiveElem:r,startPos:e,endPos:e,type:t};return this.threeDElements.push(l),l},HybridRendererBase.prototype.build3dContainers=function(){var e,t,i=this.layers.length,n="";for(e=0;e<i;e+=1)this.layers[e].ddd&&3!==this.layers[e].ty?("3d"!==n&&(n="3d",t=this.createThreeDContainer(e,"3d")),t.endPos=Math.max(t.endPos,e)):("2d"!==n&&(n="2d",t=this.createThreeDContainer(e,"2d")),t.endPos=Math.max(t.endPos,e));for(e=(i=this.threeDElements.length)-1;e>=0;e-=1)this.resizerElem.appendChild(this.threeDElements[e].perspectiveElem)},HybridRendererBase.prototype.addTo3dContainer=function(e,t){for(var i=0,n=this.threeDElements.length;i<n;){if(t<=this.threeDElements[i].endPos){for(var r,a=this.threeDElements[i].startPos;a<t;)this.elements[a]&&this.elements[a].getBaseElement&&(r=this.elements[a].getBaseElement()),a+=1;r?this.threeDElements[i].container.insertBefore(e,r):this.threeDElements[i].container.appendChild(e);break}i+=1}},HybridRendererBase.prototype.configAnimation=function(e){var t=createTag("div"),i=this.animationItem.wrapper,n=t.style;n.width=e.w+"px",n.height=e.h+"px",this.resizerElem=t,styleDiv(t),n.transformStyle="flat",n.mozTransformStyle="flat",n.webkitTransformStyle="flat",this.renderConfig.className&&t.setAttribute("class",this.renderConfig.className),i.appendChild(t),n.overflow="hidden";var r=createNS("svg");r.setAttribute("width","1"),r.setAttribute("height","1"),styleDiv(r),this.resizerElem.appendChild(r);var a=createNS("defs");r.appendChild(a),this.data=e,this.setupGlobalData(e,r),this.globalData.defs=a,this.layers=e.layers,this.layerElement=this.resizerElem,this.build3dContainers(),this.updateContainerSize()},HybridRendererBase.prototype.destroy=function(){var e;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.animationItem.container=null,this.globalData.defs=null;var t=this.layers?this.layers.length:0;for(e=0;e<t;e+=1)this.elements[e]&&this.elements[e].destroy&&this.elements[e].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},HybridRendererBase.prototype.updateContainerSize=function(){var e,t,i,n,r=this.animationItem.wrapper.offsetWidth,a=this.animationItem.wrapper.offsetHeight,s=r/a;this.globalData.compSize.w/this.globalData.compSize.h>s?(e=r/this.globalData.compSize.w,t=r/this.globalData.compSize.w,i=0,n=(a-this.globalData.compSize.h*(r/this.globalData.compSize.w))/2):(e=a/this.globalData.compSize.h,t=a/this.globalData.compSize.h,i=(r-this.globalData.compSize.w*(a/this.globalData.compSize.h))/2,n=0);var o=this.resizerElem.style;o.webkitTransform="matrix3d("+e+",0,0,0,0,"+t+",0,0,0,0,1,0,"+i+","+n+",0,1)",o.transform=o.webkitTransform},HybridRendererBase.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRendererBase.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRendererBase.prototype.show=function(){this.resizerElem.style.display="block"},HybridRendererBase.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var e,t=this.globalData.compSize.w,i=this.globalData.compSize.h,n=this.threeDElements.length;for(e=0;e<n;e+=1){var r=this.threeDElements[e].perspectiveElem.style;r.webkitPerspective=Math.sqrt(Math.pow(t,2)+Math.pow(i,2))+"px",r.perspective=r.webkitPerspective}}},HybridRendererBase.prototype.searchExtraCompositions=function(e){var t,i=e.length,n=createTag("div");for(t=0;t<i;t+=1)if(e[t].xt){var r=this.createComp(e[t],n,this.globalData.comp,null);r.initExpressions(),this.globalData.projectInterface.registerComposition(r)}},extendPrototype([HybridRendererBase,ICompElement,HBaseElement],HCompElement),HCompElement.prototype._createBaseContainerElements=HCompElement.prototype.createContainerElements,HCompElement.prototype.createContainerElements=function(){this._createBaseContainerElements(),this.data.hasMask?(this.svgElement.setAttribute("width",this.data.w),this.svgElement.setAttribute("height",this.data.h),this.transformedElement=this.baseElement):this.transformedElement=this.layerElement},HCompElement.prototype.addTo3dContainer=function(e,t){for(var i,n=0;n<t;)this.elements[n]&&this.elements[n].getBaseElement&&(i=this.elements[n].getBaseElement()),n+=1;i?this.layerElement.insertBefore(e,i):this.layerElement.appendChild(e)},HCompElement.prototype.createComp=function(e){return this.supports3d?new HCompElement(e,this.globalData,this):new SVGCompElement(e,this.globalData,this)},extendPrototype([HybridRendererBase],HybridRenderer),HybridRenderer.prototype.createComp=function(e){return this.supports3d?new HCompElement(e,this.globalData,this):new SVGCompElement(e,this.globalData,this)};var CompExpressionInterface=function(e){function t(t){for(var i=0,n=e.layers.length;i<n;){if(e.layers[i].nm===t||e.layers[i].ind===t)return e.elements[i].layerInterface;i+=1}return null}return Object.defineProperty(t,"_name",{value:e.data.nm}),t.layer=t,t.pixelAspect=1,t.height=e.data.h||e.globalData.compSize.h,t.width=e.data.w||e.globalData.compSize.w,t.pixelAspect=1,t.frameDuration=1/e.globalData.frameRate,t.displayStartTime=0,t.numLayers=e.layers.length,t};function _typeof$2(e){return _typeof$2="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$2(e)}function seedRandom(e,t){var i,n=this,r=256,a="random",s=t.pow(r,6),o=t.pow(2,52),l=2*o,c=r-1;function h(e){var t,i=e.length,n=this,a=0,s=n.i=n.j=0,o=n.S=[];for(i||(e=[i++]);a<r;)o[a]=a++;for(a=0;a<r;a++)o[a]=o[s=c&s+e[a%i]+(t=o[a])],o[s]=t;n.g=function(e){for(var t,i=0,a=n.i,s=n.j,o=n.S;e--;)t=o[a=c&a+1],i=i*r+o[c&(o[a]=o[s=c&s+t])+(o[s]=t)];return n.i=a,n.j=s,i}}function u(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function d(e,t){var i,n=[],r=_typeof$2(e);if(t&&"object"==r)for(i in e)try{n.push(d(e[i],t-1))}catch(a){}return n.length?n:"string"==r?e:e+"\0"}function p(e,t){for(var i,n=e+"",r=0;r<n.length;)t[c&r]=c&(i^=19*t[c&r])+n.charCodeAt(r++);return f(t)}function f(e){return String.fromCharCode.apply(0,e)}t["seed"+a]=function(c,m,g){var v=[],y=p(d((m=!0===m?{entropy:!0}:m||{}).entropy?[c,f(e)]:null===c?function(){try{if(i)return f(i.randomBytes(r));var t=new Uint8Array(r);return(n.crypto||n.msCrypto).getRandomValues(t),f(t)}catch(o){var a=n.navigator,s=a&&a.plugins;return[+new Date,n,s,n.screen,f(e)]}}():c,3),v),b=new h(v),x=function(){for(var e=b.g(6),t=s,i=0;e<o;)e=(e+i)*r,t*=r,i=b.g(1);for(;e>=l;)e/=2,t/=2,i>>>=1;return(e+i)/t};return x.int32=function(){return 0|b.g(4)},x.quick=function(){return b.g(4)/4294967296},x.double=x,p(f(b.S),e),(m.pass||g||function(e,i,n,r){return r&&(r.S&&u(r,b),e.state=function(){return u(b,{})}),n?(t[a]=e,i):e})(x,y,"global"in m?m.global:this==t,m.state)},p(t.random(),e)}function initialize$2(e){seedRandom([],e)}var propTypes={SHAPE:"shape"};function _typeof$1(e){return _typeof$1="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$1(e)}var ExpressionManager=function(){var ob={},Math=BMMath,window=null,document=null,XMLHttpRequest=null,fetch=null,frames=null,_lottieGlobal={};function resetFrame(){_lottieGlobal={}}function $bm_isInstanceOfArray(e){return e.constructor===Array||e.constructor===Float32Array}function isNumerable(e,t){return"number"===e||t instanceof Number||"boolean"===e||"string"===e}function $bm_neg(e){var t=_typeof$1(e);if("number"===t||e instanceof Number||"boolean"===t)return-e;if($bm_isInstanceOfArray(e)){var i,n=e.length,r=[];for(i=0;i<n;i+=1)r[i]=-e[i];return r}return e.propType?e.v:-e}initialize$2(BMMath);var easeInBez=BezierFactory.getBezierEasing(.333,0,.833,.833,"easeIn").get,easeOutBez=BezierFactory.getBezierEasing(.167,.167,.667,1,"easeOut").get,easeInOutBez=BezierFactory.getBezierEasing(.33,0,.667,1,"easeInOut").get;function sum(e,t){var i=_typeof$1(e),n=_typeof$1(t);if(isNumerable(i,e)&&isNumerable(n,t)||"string"===i||"string"===n)return e+t;if($bm_isInstanceOfArray(e)&&isNumerable(n,t))return(e=e.slice(0))[0]+=t,e;if(isNumerable(i,e)&&$bm_isInstanceOfArray(t))return(t=t.slice(0))[0]=e+t[0],t;if($bm_isInstanceOfArray(e)&&$bm_isInstanceOfArray(t)){for(var r=0,a=e.length,s=t.length,o=[];r<a||r<s;)("number"===typeof e[r]||e[r]instanceof Number)&&("number"===typeof t[r]||t[r]instanceof Number)?o[r]=e[r]+t[r]:o[r]=void 0===t[r]?e[r]:e[r]||t[r],r+=1;return o}return 0}var add=sum;function sub(e,t){var i=_typeof$1(e),n=_typeof$1(t);if(isNumerable(i,e)&&isNumerable(n,t))return"string"===i&&(e=parseInt(e,10)),"string"===n&&(t=parseInt(t,10)),e-t;if($bm_isInstanceOfArray(e)&&isNumerable(n,t))return(e=e.slice(0))[0]-=t,e;if(isNumerable(i,e)&&$bm_isInstanceOfArray(t))return(t=t.slice(0))[0]=e-t[0],t;if($bm_isInstanceOfArray(e)&&$bm_isInstanceOfArray(t)){for(var r=0,a=e.length,s=t.length,o=[];r<a||r<s;)("number"===typeof e[r]||e[r]instanceof Number)&&("number"===typeof t[r]||t[r]instanceof Number)?o[r]=e[r]-t[r]:o[r]=void 0===t[r]?e[r]:e[r]||t[r],r+=1;return o}return 0}function mul(e,t){var i,n,r,a=_typeof$1(e),s=_typeof$1(t);if(isNumerable(a,e)&&isNumerable(s,t))return e*t;if($bm_isInstanceOfArray(e)&&isNumerable(s,t)){for(r=e.length,i=createTypedArray("float32",r),n=0;n<r;n+=1)i[n]=e[n]*t;return i}if(isNumerable(a,e)&&$bm_isInstanceOfArray(t)){for(r=t.length,i=createTypedArray("float32",r),n=0;n<r;n+=1)i[n]=e*t[n];return i}return 0}function div(e,t){var i,n,r,a=_typeof$1(e),s=_typeof$1(t);if(isNumerable(a,e)&&isNumerable(s,t))return e/t;if($bm_isInstanceOfArray(e)&&isNumerable(s,t)){for(r=e.length,i=createTypedArray("float32",r),n=0;n<r;n+=1)i[n]=e[n]/t;return i}if(isNumerable(a,e)&&$bm_isInstanceOfArray(t)){for(r=t.length,i=createTypedArray("float32",r),n=0;n<r;n+=1)i[n]=e/t[n];return i}return 0}function mod(e,t){return"string"===typeof e&&(e=parseInt(e,10)),"string"===typeof t&&(t=parseInt(t,10)),e%t}var $bm_sum=sum,$bm_sub=sub,$bm_mul=mul,$bm_div=div,$bm_mod=mod;function clamp(e,t,i){if(t>i){var n=i;i=t,t=n}return Math.min(Math.max(e,t),i)}function radiansToDegrees(e){return e/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(e){return e*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(e,t){if("number"===typeof e||e instanceof Number)return t=t||0,Math.abs(e-t);var i;t||(t=helperLengthArray);var n=Math.min(e.length,t.length),r=0;for(i=0;i<n;i+=1)r+=Math.pow(t[i]-e[i],2);return Math.sqrt(r)}function normalize(e){return div(e,length(e))}function rgbToHsl(e){var t,i,n=e[0],r=e[1],a=e[2],s=Math.max(n,r,a),o=Math.min(n,r,a),l=(s+o)/2;if(s===o)t=0,i=0;else{var c=s-o;switch(i=l>.5?c/(2-s-o):c/(s+o),s){case n:t=(r-a)/c+(r<a?6:0);break;case r:t=(a-n)/c+2;break;case a:t=(n-r)/c+4}t/=6}return[t,i,l,e[3]]}function hue2rgb(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}function hslToRgb(e){var t,i,n,r=e[0],a=e[1],s=e[2];if(0===a)t=s,n=s,i=s;else{var o=s<.5?s*(1+a):s+a-s*a,l=2*s-o;t=hue2rgb(l,o,r+1/3),i=hue2rgb(l,o,r),n=hue2rgb(l,o,r-1/3)}return[t,i,n,e[3]]}function linear(e,t,i,n,r){if(void 0!==n&&void 0!==r||(n=t,r=i,t=0,i=1),i<t){var a=i;i=t,t=a}if(e<=t)return n;if(e>=i)return r;var s,o=i===t?0:(e-t)/(i-t);if(!n.length)return n+(r-n)*o;var l=n.length,c=createTypedArray("float32",l);for(s=0;s<l;s+=1)c[s]=n[s]+(r[s]-n[s])*o;return c}function random(e,t){if(void 0===t&&(void 0===e?(e=0,t=1):(t=e,e=void 0)),t.length){var i,n=t.length;e||(e=createTypedArray("float32",n));var r=createTypedArray("float32",n),a=BMMath.random();for(i=0;i<n;i+=1)r[i]=e[i]+a*(t[i]-e[i]);return r}return void 0===e&&(e=0),e+BMMath.random()*(t-e)}function createPath(e,t,i,n){var r,a=e.length,s=shapePool.newElement();s.setPathData(!!n,a);var o,l,c=[0,0];for(r=0;r<a;r+=1)o=t&&t[r]?t[r]:c,l=i&&i[r]?i[r]:c,s.setTripleAt(e[r][0],e[r][1],l[0]+e[r][0],l[1]+e[r][1],o[0]+e[r][0],o[1]+e[r][1],r,!0);return s}function initiateExpression(elem,data,property){function noOp(e){return e}if(!elem.globalData.renderConfig.runExpressions)return noOp;var val=data.x,needsVelocity=/velocity(?![\w\d])/.test(val),_needsRandom=-1!==val.indexOf("random"),elemType=elem.data.ty,transform,$bm_transform,content,effect,thisProperty=property;thisProperty.valueAtTime=thisProperty.getValueAtTime,Object.defineProperty(thisProperty,"value",{get:function(){return thisProperty.v}}),elem.comp.frameDuration=1/elem.comp.globalData.frameRate,elem.comp.displayStartTime=0;var inPoint=elem.data.ip/elem.comp.globalData.frameRate,outPoint=elem.data.op/elem.comp.globalData.frameRate,width=elem.data.sw?elem.data.sw:0,height=elem.data.sh?elem.data.sh:0,name=elem.data.nm,loopIn,loop_in,loopOut,loop_out,smooth,toWorld,fromWorld,fromComp,toComp,fromCompToSurface,position,rotation,anchorPoint,scale,thisLayer,thisComp,mask,valueAtTime,velocityAtTime,scoped_bm_rt,expression_function=eval("[function _expression_function(){"+val+";scoped_bm_rt=$bm_rt}]")[0],numKeys=property.kf?data.k.length:0,active=!this.data||!0!==this.data.hd,wiggle=function(e,t){var i,n,r=this.pv.length?this.pv.length:1,a=createTypedArray("float32",r),s=Math.floor(5*time);for(i=0,n=0;i<s;){for(n=0;n<r;n+=1)a[n]+=-t+2*t*BMMath.random();i+=1}var o=5*time,l=o-Math.floor(o),c=createTypedArray("float32",r);if(r>1){for(n=0;n<r;n+=1)c[n]=this.pv[n]+a[n]+(-t+2*t*BMMath.random())*l;return c}return this.pv+a[0]+(-t+2*t*BMMath.random())*l}.bind(this);function loopInDuration(e,t){return loopIn(e,t,!0)}function loopOutDuration(e,t){return loopOut(e,t,!0)}thisProperty.loopIn&&(loopIn=thisProperty.loopIn.bind(thisProperty),loop_in=loopIn),thisProperty.loopOut&&(loopOut=thisProperty.loopOut.bind(thisProperty),loop_out=loopOut),thisProperty.smooth&&(smooth=thisProperty.smooth.bind(thisProperty)),this.getValueAtTime&&(valueAtTime=this.getValueAtTime.bind(this)),this.getVelocityAtTime&&(velocityAtTime=this.getVelocityAtTime.bind(this));var comp=elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface),time,velocity,value,text,textIndex,textTotal,selectorValue;function lookAt(e,t){var i=[t[0]-e[0],t[1]-e[1],t[2]-e[2]],n=Math.atan2(i[0],Math.sqrt(i[1]*i[1]+i[2]*i[2]))/degToRads;return[-Math.atan2(i[1],i[2])/degToRads,n,0]}function easeOut(e,t,i,n,r){return applyEase(easeOutBez,e,t,i,n,r)}function easeIn(e,t,i,n,r){return applyEase(easeInBez,e,t,i,n,r)}function ease(e,t,i,n,r){return applyEase(easeInOutBez,e,t,i,n,r)}function applyEase(e,t,i,n,r,a){void 0===r?(r=i,a=n):t=(t-i)/(n-i),t>1?t=1:t<0&&(t=0);var s=e(t);if($bm_isInstanceOfArray(r)){var o,l=r.length,c=createTypedArray("float32",l);for(o=0;o<l;o+=1)c[o]=(a[o]-r[o])*s+r[o];return c}return(a-r)*s+r}function nearestKey(e){var t,i,n,r=data.k.length;if(data.k.length&&"number"!==typeof data.k[0])if(i=-1,(e*=elem.comp.globalData.frameRate)<data.k[0].t)i=1,n=data.k[0].t;else{for(t=0;t<r-1;t+=1){if(e===data.k[t].t){i=t+1,n=data.k[t].t;break}if(e>data.k[t].t&&e<data.k[t+1].t){e-data.k[t].t>data.k[t+1].t-e?(i=t+2,n=data.k[t+1].t):(i=t+1,n=data.k[t].t);break}}-1===i&&(i=t+1,n=data.k[t].t)}else i=0,n=0;var a={};return a.index=i,a.time=n/elem.comp.globalData.frameRate,a}function key(e){var t,i,n;if(!data.k.length||"number"===typeof data.k[0])throw new Error("The property has no keyframe at index "+e);e-=1,t={time:data.k[e].t/elem.comp.globalData.frameRate,value:[]};var r=Object.prototype.hasOwnProperty.call(data.k[e],"s")?data.k[e].s:data.k[e-1].e;for(n=r.length,i=0;i<n;i+=1)t[i]=r[i],t.value[i]=r[i];return t}function framesToTime(e,t){return t||(t=elem.comp.globalData.frameRate),e/t}function timeToFrames(e,t){return e||0===e||(e=time),t||(t=elem.comp.globalData.frameRate),e*t}function seedRandom(e){BMMath.seedrandom(randSeed+e)}function sourceRectAtTime(){return elem.sourceRectAtTime()}function substring(e,t){return"string"===typeof value?void 0===t?value.substring(e):value.substring(e,t):""}function substr(e,t){return"string"===typeof value?void 0===t?value.substr(e):value.substr(e,t):""}function posterizeTime(e){time=0===e?0:Math.floor(time*e)/e,value=valueAtTime(time)}var index=elem.data.ind,hasParent=!(!elem.hierarchy||!elem.hierarchy.length),parent,randSeed=Math.floor(1e6*Math.random()),globalData=elem.globalData;function executeExpression(e){return value=e,this.frameExpressionId===elem.globalData.frameId&&"textSelector"!==this.propType?value:("textSelector"===this.propType&&(textIndex=this.textIndex,textTotal=this.textTotal,selectorValue=this.selectorValue),thisLayer||(text=elem.layerInterface.text,thisLayer=elem.layerInterface,thisComp=elem.comp.compInterface,toWorld=thisLayer.toWorld.bind(thisLayer),fromWorld=thisLayer.fromWorld.bind(thisLayer),fromComp=thisLayer.fromComp.bind(thisLayer),toComp=thisLayer.toComp.bind(thisLayer),mask=thisLayer.mask?thisLayer.mask.bind(thisLayer):null,fromCompToSurface=fromComp),transform||(transform=elem.layerInterface("ADBE Transform Group"),$bm_transform=transform,transform&&(anchorPoint=transform.anchorPoint)),4!==elemType||content||(content=thisLayer("ADBE Root Vectors Group")),effect||(effect=thisLayer(4)),(hasParent=!(!elem.hierarchy||!elem.hierarchy.length))&&!parent&&(parent=elem.hierarchy[0].layerInterface),time=this.comp.renderedFrame/this.comp.globalData.frameRate,_needsRandom&&seedRandom(randSeed+time),needsVelocity&&(velocity=velocityAtTime(time)),expression_function(),this.frameExpressionId=elem.globalData.frameId,scoped_bm_rt=scoped_bm_rt.propType===propTypes.SHAPE?scoped_bm_rt.v:scoped_bm_rt)}return executeExpression.__preventDeadCodeRemoval=[$bm_transform,anchorPoint,time,velocity,inPoint,outPoint,width,height,name,loop_in,loop_out,smooth,toComp,fromCompToSurface,toWorld,fromWorld,mask,position,rotation,scale,thisComp,numKeys,active,wiggle,loopInDuration,loopOutDuration,comp,lookAt,easeOut,easeIn,ease,nearestKey,key,text,textIndex,textTotal,selectorValue,framesToTime,timeToFrames,sourceRectAtTime,substring,substr,posterizeTime,index,globalData],executeExpression}return ob.initiateExpression=initiateExpression,ob.__preventDeadCodeRemoval=[window,document,XMLHttpRequest,fetch,frames,$bm_neg,add,$bm_sum,$bm_sub,$bm_mul,$bm_div,$bm_mod,clamp,radians_to_degrees,degreesToRadians,degrees_to_radians,normalize,rgbToHsl,hslToRgb,linear,random,createPath,_lottieGlobal],ob.resetFrame=resetFrame,ob}(),Expressions=function(){var e={initExpressions:function(e){var t=0,i=[];e.renderer.compInterface=CompExpressionInterface(e.renderer),e.renderer.globalData.projectInterface.registerComposition(e.renderer),e.renderer.globalData.pushExpression=function(){t+=1},e.renderer.globalData.popExpression=function(){0===(t-=1)&&function(){var e,t=i.length;for(e=0;e<t;e+=1)i[e].release();i.length=0}()},e.renderer.globalData.registerExpressionProperty=function(e){-1===i.indexOf(e)&&i.push(e)}}};return e.resetFrame=ExpressionManager.resetFrame,e}(),MaskManagerInterface=function(){function e(e,t){this._mask=e,this._data=t}return Object.defineProperty(e.prototype,"maskPath",{get:function(){return this._mask.prop.k&&this._mask.prop.getValue(),this._mask.prop}}),Object.defineProperty(e.prototype,"maskOpacity",{get:function(){return this._mask.op.k&&this._mask.op.getValue(),100*this._mask.op.v}}),function(t){var i,n=createSizedArray(t.viewData.length),r=t.viewData.length;for(i=0;i<r;i+=1)n[i]=new e(t.viewData[i],t.masksProperties[i]);return function(e){for(i=0;i<r;){if(t.masksProperties[i].nm===e)return n[i];i+=1}return null}}}(),ExpressionPropertyInterface=function(){var e={pv:0,v:0,mult:1},t={pv:[0,0,0],v:[0,0,0],mult:1};function i(e,t,i){Object.defineProperty(e,"velocity",{get:function(){return t.getVelocityAtTime(t.comp.currentFrame)}}),e.numKeys=t.keyframes?t.keyframes.length:0,e.key=function(n){if(!e.numKeys)return 0;var r="";r="s"in t.keyframes[n-1]?t.keyframes[n-1].s:"e"in t.keyframes[n-2]?t.keyframes[n-2].e:t.keyframes[n-2].s;var a="unidimensional"===i?new Number(r):Object.assign({},r);return a.time=t.keyframes[n-1].t/t.elem.comp.globalData.frameRate,a.value="unidimensional"===i?r[0]:r,a},e.valueAtTime=t.getValueAtTime,e.speedAtTime=t.getSpeedAtTime,e.velocityAtTime=t.getVelocityAtTime,e.propertyGroup=t.propertyGroup}function n(){return e}return function(r){return r?"unidimensional"===r.propType?function(t){t&&"pv"in t||(t=e);var n=1/t.mult,r=t.pv*n,a=new Number(r);return a.value=r,i(a,t,"unidimensional"),function(){return t.k&&t.getValue(),r=t.v*n,a.value!==r&&((a=new Number(r)).value=r,i(a,t,"unidimensional")),a}}(r):function(e){e&&"pv"in e||(e=t);var n=1/e.mult,r=e.data&&e.data.l||e.pv.length,a=createTypedArray("float32",r),s=createTypedArray("float32",r);return a.value=s,i(a,e,"multidimensional"),function(){e.k&&e.getValue();for(var t=0;t<r;t+=1)s[t]=e.v[t]*n,a[t]=s[t];return a}}(r):n}}(),TransformExpressionInterface=function(e){function t(e){switch(e){case"scale":case"Scale":case"ADBE Scale":case 6:return t.scale;case"rotation":case"Rotation":case"ADBE Rotation":case"ADBE Rotate Z":case 10:return t.rotation;case"ADBE Rotate X":return t.xRotation;case"ADBE Rotate Y":return t.yRotation;case"position":case"Position":case"ADBE Position":case 2:return t.position;case"ADBE Position_0":return t.xPosition;case"ADBE Position_1":return t.yPosition;case"ADBE Position_2":return t.zPosition;case"anchorPoint":case"AnchorPoint":case"Anchor Point":case"ADBE AnchorPoint":case 1:return t.anchorPoint;case"opacity":case"Opacity":case 11:return t.opacity;default:return null}}var i,n,r,a;return Object.defineProperty(t,"rotation",{get:ExpressionPropertyInterface(e.r||e.rz)}),Object.defineProperty(t,"zRotation",{get:ExpressionPropertyInterface(e.rz||e.r)}),Object.defineProperty(t,"xRotation",{get:ExpressionPropertyInterface(e.rx)}),Object.defineProperty(t,"yRotation",{get:ExpressionPropertyInterface(e.ry)}),Object.defineProperty(t,"scale",{get:ExpressionPropertyInterface(e.s)}),e.p?a=ExpressionPropertyInterface(e.p):(i=ExpressionPropertyInterface(e.px),n=ExpressionPropertyInterface(e.py),e.pz&&(r=ExpressionPropertyInterface(e.pz))),Object.defineProperty(t,"position",{get:function(){return e.p?a():[i(),n(),r?r():0]}}),Object.defineProperty(t,"xPosition",{get:ExpressionPropertyInterface(e.px)}),Object.defineProperty(t,"yPosition",{get:ExpressionPropertyInterface(e.py)}),Object.defineProperty(t,"zPosition",{get:ExpressionPropertyInterface(e.pz)}),Object.defineProperty(t,"anchorPoint",{get:ExpressionPropertyInterface(e.a)}),Object.defineProperty(t,"opacity",{get:ExpressionPropertyInterface(e.o)}),Object.defineProperty(t,"skew",{get:ExpressionPropertyInterface(e.sk)}),Object.defineProperty(t,"skewAxis",{get:ExpressionPropertyInterface(e.sa)}),Object.defineProperty(t,"orientation",{get:ExpressionPropertyInterface(e.or)}),t},LayerExpressionInterface=function(){function e(e){var t=new Matrix;return void 0!==e?this._elem.finalTransform.mProp.getValueAtTime(e).clone(t):this._elem.finalTransform.mProp.applyToMatrix(t),t}function t(e,t){var i=this.getMatrix(t);return i.props[12]=0,i.props[13]=0,i.props[14]=0,this.applyPoint(i,e)}function i(e,t){var i=this.getMatrix(t);return this.applyPoint(i,e)}function n(e,t){var i=this.getMatrix(t);return i.props[12]=0,i.props[13]=0,i.props[14]=0,this.invertPoint(i,e)}function r(e,t){var i=this.getMatrix(t);return this.invertPoint(i,e)}function a(e,t){if(this._elem.hierarchy&&this._elem.hierarchy.length){var i,n=this._elem.hierarchy.length;for(i=0;i<n;i+=1)this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(e)}return e.applyToPointArray(t[0],t[1],t[2]||0)}function s(e,t){if(this._elem.hierarchy&&this._elem.hierarchy.length){var i,n=this._elem.hierarchy.length;for(i=0;i<n;i+=1)this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(e)}return e.inversePoint(t)}function o(e){var t=new Matrix;if(t.reset(),this._elem.finalTransform.mProp.applyToMatrix(t),this._elem.hierarchy&&this._elem.hierarchy.length){var i,n=this._elem.hierarchy.length;for(i=0;i<n;i+=1)this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(t);return t.inversePoint(e)}return t.inversePoint(e)}function l(){return[1,1,1,1]}return function(c){var h;function u(e){switch(e){case"ADBE Root Vectors Group":case"Contents":case 2:return u.shapeInterface;case 1:case 6:case"Transform":case"transform":case"ADBE Transform Group":return h;case 4:case"ADBE Effect Parade":case"effects":case"Effects":return u.effect;case"ADBE Text Properties":return u.textInterface;default:return null}}u.getMatrix=e,u.invertPoint=s,u.applyPoint=a,u.toWorld=i,u.toWorldVec=t,u.fromWorld=r,u.fromWorldVec=n,u.toComp=i,u.fromComp=o,u.sampleImage=l,u.sourceRectAtTime=c.sourceRectAtTime.bind(c),u._elem=c;var d=getDescriptor(h=TransformExpressionInterface(c.finalTransform.mProp),"anchorPoint");return Object.defineProperties(u,{hasParent:{get:function(){return c.hierarchy.length}},parent:{get:function(){return c.hierarchy[0].layerInterface}},rotation:getDescriptor(h,"rotation"),scale:getDescriptor(h,"scale"),position:getDescriptor(h,"position"),opacity:getDescriptor(h,"opacity"),anchorPoint:d,anchor_point:d,transform:{get:function(){return h}},active:{get:function(){return c.isInRange}}}),u.startTime=c.data.st,u.index=c.data.ind,u.source=c.data.refId,u.height=0===c.data.ty?c.data.h:100,u.width=0===c.data.ty?c.data.w:100,u.inPoint=c.data.ip/c.comp.globalData.frameRate,u.outPoint=c.data.op/c.comp.globalData.frameRate,u._name=c.data.nm,u.registerMaskInterface=function(e){u.mask=new MaskManagerInterface(e,c)},u.registerEffectsInterface=function(e){u.effect=e},u}}(),propertyGroupFactory=function(e,t){return function(i){return(i=void 0===i?1:i)<=0?e:t(i-1)}},PropertyInterface=function(e,t){var i={_name:e};return function(e){return(e=void 0===e?1:e)<=0?i:t(e-1)}},EffectsExpressionInterface=function(){function e(i,n,r,a){function s(e){for(var t=i.ef,n=0,r=t.length;n<r;){if(e===t[n].nm||e===t[n].mn||e===t[n].ix)return 5===t[n].ty?c[n]:c[n]();n+=1}throw new Error}var o,l=propertyGroupFactory(s,r),c=[],h=i.ef.length;for(o=0;o<h;o+=1)5===i.ef[o].ty?c.push(e(i.ef[o],n.effectElements[o],n.effectElements[o].propertyGroup,a)):c.push(t(n.effectElements[o],i.ef[o].ty,a,l));return"ADBE Color Control"===i.mn&&Object.defineProperty(s,"color",{get:function(){return c[0]()}}),Object.defineProperties(s,{numProperties:{get:function(){return i.np}},_name:{value:i.nm},propertyGroup:{value:l}}),s.enabled=0!==i.en,s.active=s.enabled,s}function t(e,t,i,n){var r=ExpressionPropertyInterface(e.p);return e.p.setGroupProperty&&e.p.setGroupProperty(PropertyInterface("",n)),function(){return 10===t?i.comp.compInterface(e.p.v):r()}}return{createEffectsInterface:function(t,i){if(t.effectsManager){var n,r=[],a=t.data.ef,s=t.effectsManager.effectElements.length;for(n=0;n<s;n+=1)r.push(e(a[n],t.effectsManager.effectElements[n],i,t));var o=t.data.ef||[],l=function(e){for(n=0,s=o.length;n<s;){if(e===o[n].nm||e===o[n].mn||e===o[n].ix)return r[n];n+=1}return null};return Object.defineProperty(l,"numProperties",{get:function(){return o.length}}),l}return null}}}(),ShapePathInterface=function(e,t,i){var n=t.sh;function r(e){return"Shape"===e||"shape"===e||"Path"===e||"path"===e||"ADBE Vector Shape"===e||2===e?r.path:null}var a=propertyGroupFactory(r,i);return n.setGroupProperty(PropertyInterface("Path",a)),Object.defineProperties(r,{path:{get:function(){return n.k&&n.getValue(),n}},shape:{get:function(){return n.k&&n.getValue(),n}},_name:{value:e.nm},ix:{value:e.ix},propertyIndex:{value:e.ix},mn:{value:e.mn},propertyGroup:{value:i}}),r},ShapeExpressionInterface=function(){function e(e,s,d){var p,f=[],m=e?e.length:0;for(p=0;p<m;p+=1)"gr"===e[p].ty?f.push(t(e[p],s[p],d)):"fl"===e[p].ty?f.push(i(e[p],s[p],d)):"st"===e[p].ty?f.push(r(e[p],s[p],d)):"tm"===e[p].ty?f.push(a(e[p],s[p],d)):"tr"===e[p].ty||("el"===e[p].ty?f.push(o(e[p],s[p],d)):"sr"===e[p].ty?f.push(l(e[p],s[p],d)):"sh"===e[p].ty?f.push(ShapePathInterface(e[p],s[p],d)):"rc"===e[p].ty?f.push(c(e[p],s[p],d)):"rd"===e[p].ty?f.push(h(e[p],s[p],d)):"rp"===e[p].ty?f.push(u(e[p],s[p],d)):"gf"===e[p].ty?f.push(n(e[p],s[p],d)):f.push((e[p],s[p],function(){return null})));return f}function t(t,i,n){var r=function(e){switch(e){case"ADBE Vectors Group":case"Contents":case 2:return r.content;default:return r.transform}};r.propertyGroup=propertyGroupFactory(r,n);var a=function(t,i,n){var r,a=function(e){for(var t=0,i=r.length;t<i;){if(r[t]._name===e||r[t].mn===e||r[t].propertyIndex===e||r[t].ix===e||r[t].ind===e)return r[t];t+=1}return"number"===typeof e?r[e-1]:null};a.propertyGroup=propertyGroupFactory(a,n),r=e(t.it,i.it,a.propertyGroup),a.numProperties=r.length;var o=s(t.it[t.it.length-1],i.it[i.it.length-1],a.propertyGroup);return a.transform=o,a.propertyIndex=t.cix,a._name=t.nm,a}(t,i,r.propertyGroup),o=s(t.it[t.it.length-1],i.it[i.it.length-1],r.propertyGroup);return r.content=a,r.transform=o,Object.defineProperty(r,"_name",{get:function(){return t.nm}}),r.numProperties=t.np,r.propertyIndex=t.ix,r.nm=t.nm,r.mn=t.mn,r}function i(e,t,i){function n(e){return"Color"===e||"color"===e?n.color:"Opacity"===e||"opacity"===e?n.opacity:null}return Object.defineProperties(n,{color:{get:ExpressionPropertyInterface(t.c)},opacity:{get:ExpressionPropertyInterface(t.o)},_name:{value:e.nm},mn:{value:e.mn}}),t.c.setGroupProperty(PropertyInterface("Color",i)),t.o.setGroupProperty(PropertyInterface("Opacity",i)),n}function n(e,t,i){function n(e){return"Start Point"===e||"start point"===e?n.startPoint:"End Point"===e||"end point"===e?n.endPoint:"Opacity"===e||"opacity"===e?n.opacity:null}return Object.defineProperties(n,{startPoint:{get:ExpressionPropertyInterface(t.s)},endPoint:{get:ExpressionPropertyInterface(t.e)},opacity:{get:ExpressionPropertyInterface(t.o)},type:{get:function(){return"a"}},_name:{value:e.nm},mn:{value:e.mn}}),t.s.setGroupProperty(PropertyInterface("Start Point",i)),t.e.setGroupProperty(PropertyInterface("End Point",i)),t.o.setGroupProperty(PropertyInterface("Opacity",i)),n}function r(e,t,i){var n,r=propertyGroupFactory(c,i),a=propertyGroupFactory(l,r);function s(i){Object.defineProperty(l,e.d[i].nm,{get:ExpressionPropertyInterface(t.d.dataProps[i].p)})}var o=e.d?e.d.length:0,l={};for(n=0;n<o;n+=1)s(n),t.d.dataProps[n].p.setGroupProperty(a);function c(e){return"Color"===e||"color"===e?c.color:"Opacity"===e||"opacity"===e?c.opacity:"Stroke Width"===e||"stroke width"===e?c.strokeWidth:null}return Object.defineProperties(c,{color:{get:ExpressionPropertyInterface(t.c)},opacity:{get:ExpressionPropertyInterface(t.o)},strokeWidth:{get:ExpressionPropertyInterface(t.w)},dash:{get:function(){return l}},_name:{value:e.nm},mn:{value:e.mn}}),t.c.setGroupProperty(PropertyInterface("Color",r)),t.o.setGroupProperty(PropertyInterface("Opacity",r)),t.w.setGroupProperty(PropertyInterface("Stroke Width",r)),c}function a(e,t,i){function n(t){return t===e.e.ix||"End"===t||"end"===t?n.end:t===e.s.ix?n.start:t===e.o.ix?n.offset:null}var r=propertyGroupFactory(n,i);return n.propertyIndex=e.ix,t.s.setGroupProperty(PropertyInterface("Start",r)),t.e.setGroupProperty(PropertyInterface("End",r)),t.o.setGroupProperty(PropertyInterface("Offset",r)),n.propertyIndex=e.ix,n.propertyGroup=i,Object.defineProperties(n,{start:{get:ExpressionPropertyInterface(t.s)},end:{get:ExpressionPropertyInterface(t.e)},offset:{get:ExpressionPropertyInterface(t.o)},_name:{value:e.nm}}),n.mn=e.mn,n}function s(e,t,i){function n(t){return e.a.ix===t||"Anchor Point"===t?n.anchorPoint:e.o.ix===t||"Opacity"===t?n.opacity:e.p.ix===t||"Position"===t?n.position:e.r.ix===t||"Rotation"===t||"ADBE Vector Rotation"===t?n.rotation:e.s.ix===t||"Scale"===t?n.scale:e.sk&&e.sk.ix===t||"Skew"===t?n.skew:e.sa&&e.sa.ix===t||"Skew Axis"===t?n.skewAxis:null}var r=propertyGroupFactory(n,i);return t.transform.mProps.o.setGroupProperty(PropertyInterface("Opacity",r)),t.transform.mProps.p.setGroupProperty(PropertyInterface("Position",r)),t.transform.mProps.a.setGroupProperty(PropertyInterface("Anchor Point",r)),t.transform.mProps.s.setGroupProperty(PropertyInterface("Scale",r)),t.transform.mProps.r.setGroupProperty(PropertyInterface("Rotation",r)),t.transform.mProps.sk&&(t.transform.mProps.sk.setGroupProperty(PropertyInterface("Skew",r)),t.transform.mProps.sa.setGroupProperty(PropertyInterface("Skew Angle",r))),t.transform.op.setGroupProperty(PropertyInterface("Opacity",r)),Object.defineProperties(n,{opacity:{get:ExpressionPropertyInterface(t.transform.mProps.o)},position:{get:ExpressionPropertyInterface(t.transform.mProps.p)},anchorPoint:{get:ExpressionPropertyInterface(t.transform.mProps.a)},scale:{get:ExpressionPropertyInterface(t.transform.mProps.s)},rotation:{get:ExpressionPropertyInterface(t.transform.mProps.r)},skew:{get:ExpressionPropertyInterface(t.transform.mProps.sk)},skewAxis:{get:ExpressionPropertyInterface(t.transform.mProps.sa)},_name:{value:e.nm}}),n.ty="tr",n.mn=e.mn,n.propertyGroup=i,n}function o(e,t,i){function n(t){return e.p.ix===t?n.position:e.s.ix===t?n.size:null}var r=propertyGroupFactory(n,i);n.propertyIndex=e.ix;var a="tm"===t.sh.ty?t.sh.prop:t.sh;return a.s.setGroupProperty(PropertyInterface("Size",r)),a.p.setGroupProperty(PropertyInterface("Position",r)),Object.defineProperties(n,{size:{get:ExpressionPropertyInterface(a.s)},position:{get:ExpressionPropertyInterface(a.p)},_name:{value:e.nm}}),n.mn=e.mn,n}function l(e,t,i){function n(t){return e.p.ix===t?n.position:e.r.ix===t?n.rotation:e.pt.ix===t?n.points:e.or.ix===t||"ADBE Vector Star Outer Radius"===t?n.outerRadius:e.os.ix===t?n.outerRoundness:!e.ir||e.ir.ix!==t&&"ADBE Vector Star Inner Radius"!==t?e.is&&e.is.ix===t?n.innerRoundness:null:n.innerRadius}var r=propertyGroupFactory(n,i),a="tm"===t.sh.ty?t.sh.prop:t.sh;return n.propertyIndex=e.ix,a.or.setGroupProperty(PropertyInterface("Outer Radius",r)),a.os.setGroupProperty(PropertyInterface("Outer Roundness",r)),a.pt.setGroupProperty(PropertyInterface("Points",r)),a.p.setGroupProperty(PropertyInterface("Position",r)),a.r.setGroupProperty(PropertyInterface("Rotation",r)),e.ir&&(a.ir.setGroupProperty(PropertyInterface("Inner Radius",r)),a.is.setGroupProperty(PropertyInterface("Inner Roundness",r))),Object.defineProperties(n,{position:{get:ExpressionPropertyInterface(a.p)},rotation:{get:ExpressionPropertyInterface(a.r)},points:{get:ExpressionPropertyInterface(a.pt)},outerRadius:{get:ExpressionPropertyInterface(a.or)},outerRoundness:{get:ExpressionPropertyInterface(a.os)},innerRadius:{get:ExpressionPropertyInterface(a.ir)},innerRoundness:{get:ExpressionPropertyInterface(a.is)},_name:{value:e.nm}}),n.mn=e.mn,n}function c(e,t,i){function n(t){return e.p.ix===t?n.position:e.r.ix===t?n.roundness:e.s.ix===t||"Size"===t||"ADBE Vector Rect Size"===t?n.size:null}var r=propertyGroupFactory(n,i),a="tm"===t.sh.ty?t.sh.prop:t.sh;return n.propertyIndex=e.ix,a.p.setGroupProperty(PropertyInterface("Position",r)),a.s.setGroupProperty(PropertyInterface("Size",r)),a.r.setGroupProperty(PropertyInterface("Rotation",r)),Object.defineProperties(n,{position:{get:ExpressionPropertyInterface(a.p)},roundness:{get:ExpressionPropertyInterface(a.r)},size:{get:ExpressionPropertyInterface(a.s)},_name:{value:e.nm}}),n.mn=e.mn,n}function h(e,t,i){function n(t){return e.r.ix===t||"Round Corners 1"===t?n.radius:null}var r=propertyGroupFactory(n,i),a=t;return n.propertyIndex=e.ix,a.rd.setGroupProperty(PropertyInterface("Radius",r)),Object.defineProperties(n,{radius:{get:ExpressionPropertyInterface(a.rd)},_name:{value:e.nm}}),n.mn=e.mn,n}function u(e,t,i){function n(t){return e.c.ix===t||"Copies"===t?n.copies:e.o.ix===t||"Offset"===t?n.offset:null}var r=propertyGroupFactory(n,i),a=t;return n.propertyIndex=e.ix,a.c.setGroupProperty(PropertyInterface("Copies",r)),a.o.setGroupProperty(PropertyInterface("Offset",r)),Object.defineProperties(n,{copies:{get:ExpressionPropertyInterface(a.c)},offset:{get:ExpressionPropertyInterface(a.o)},_name:{value:e.nm}}),n.mn=e.mn,n}return function(t,i,n){var r;function a(e){if("number"===typeof e)return 0===(e=void 0===e?1:e)?n:r[e-1];for(var t=0,i=r.length;t<i;){if(r[t]._name===e)return r[t];t+=1}return null}return a.propertyGroup=propertyGroupFactory(a,(function(){return n})),r=e(t,i,a.propertyGroup),a.numProperties=r.length,a._name="Contents",a}}(),TextExpressionInterface=function(e){var t;function i(e){return"ADBE Text Document"===e?i.sourceText:null}return Object.defineProperty(i,"sourceText",{get:function(){e.textProperty.getValue();var i=e.textProperty.currentData.t;return t&&i===t.value||((t=new String(i)).value=i||new String(i),Object.defineProperty(t,"style",{get:function(){return{fillColor:e.textProperty.currentData.fc}}})),t}}),i};function _typeof(e){return _typeof="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}var FootageInterface=function(){var e=function(e){function t(e){return"Outline"===e?t.outlineInterface():null}return t._name="Outline",t.outlineInterface=function(e){var t="",i=e.getFootageData();function n(e){if(i[e])return t=e,"object"===_typeof(i=i[e])?n:i;var r=e.indexOf(t);if(-1!==r){var a=parseInt(e.substr(r+t.length),10);return"object"===_typeof(i=i[a])?n:i}return""}return function(){return t="",i=e.getFootageData(),n}}(e),t};return function(t){function i(e){return"Data"===e?i.dataInterface:null}return i._name="Data",i.dataInterface=e(t),i}}(),interfaces={layer:LayerExpressionInterface,effects:EffectsExpressionInterface,comp:CompExpressionInterface,shape:ShapeExpressionInterface,text:TextExpressionInterface,footage:FootageInterface};function getInterface(e){return interfaces[e]||null}var expressionHelpers={searchExpressions:function(e,t,i){t.x&&(i.k=!0,i.x=!0,i.initiateExpression=ExpressionManager.initiateExpression,i.effectsSequence.push(i.initiateExpression(e,t,i).bind(i)))},getSpeedAtTime:function(e){var t=this.getValueAtTime(e),i=this.getValueAtTime(e+-.01),n=0;if(t.length){var r;for(r=0;r<t.length;r+=1)n+=Math.pow(i[r]-t[r],2);n=100*Math.sqrt(n)}else n=0;return n},getVelocityAtTime:function(e){if(void 0!==this.vel)return this.vel;var t,i,n=-.001,r=this.getValueAtTime(e),a=this.getValueAtTime(e+n);if(r.length)for(t=createTypedArray("float32",r.length),i=0;i<r.length;i+=1)t[i]=(a[i]-r[i])/n;else t=(a-r)/n;return t},getValueAtTime:function(e){return e*=this.elem.globalData.frameRate,(e-=this.offsetTime)!==this._cachingAtTime.lastFrame&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastFrame<e?this._cachingAtTime.lastIndex:0,this._cachingAtTime.value=this.interpolateValue(e,this._cachingAtTime),this._cachingAtTime.lastFrame=e),this._cachingAtTime.value},getStaticValueAtTime:function(){return this.pv},setGroupProperty:function(e){this.propertyGroup=e}};function addPropertyDecorator(){function e(e,t,i){if(!this.k||!this.keyframes)return this.pv;e=e?e.toLowerCase():"";var n,r,a,s,o,l=this.comp.renderedFrame,c=this.keyframes,h=c[c.length-1].t;if(l<=h)return this.pv;if(i?r=h-(n=t?Math.abs(h-this.elem.comp.globalData.frameRate*t):Math.max(0,h-this.elem.data.ip)):((!t||t>c.length-1)&&(t=c.length-1),n=h-(r=c[c.length-1-t].t)),"pingpong"===e){if(Math.floor((l-r)/n)%2!==0)return this.getValueAtTime((n-(l-r)%n+r)/this.comp.globalData.frameRate,0)}else{if("offset"===e){var u=this.getValueAtTime(r/this.comp.globalData.frameRate,0),d=this.getValueAtTime(h/this.comp.globalData.frameRate,0),p=this.getValueAtTime(((l-r)%n+r)/this.comp.globalData.frameRate,0),f=Math.floor((l-r)/n);if(this.pv.length){for(s=(o=new Array(u.length)).length,a=0;a<s;a+=1)o[a]=(d[a]-u[a])*f+p[a];return o}return(d-u)*f+p}if("continue"===e){var m=this.getValueAtTime(h/this.comp.globalData.frameRate,0),g=this.getValueAtTime((h-.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(s=(o=new Array(m.length)).length,a=0;a<s;a+=1)o[a]=m[a]+(m[a]-g[a])*((l-h)/this.comp.globalData.frameRate)/5e-4;return o}return m+(l-h)/.001*(m-g)}}return this.getValueAtTime(((l-r)%n+r)/this.comp.globalData.frameRate,0)}function t(e,t,i){if(!this.k)return this.pv;e=e?e.toLowerCase():"";var n,r,a,s,o,l=this.comp.renderedFrame,c=this.keyframes,h=c[0].t;if(l>=h)return this.pv;if(i?r=h+(n=t?Math.abs(this.elem.comp.globalData.frameRate*t):Math.max(0,this.elem.data.op-h)):((!t||t>c.length-1)&&(t=c.length-1),n=(r=c[t].t)-h),"pingpong"===e){if(Math.floor((h-l)/n)%2===0)return this.getValueAtTime(((h-l)%n+h)/this.comp.globalData.frameRate,0)}else{if("offset"===e){var u=this.getValueAtTime(h/this.comp.globalData.frameRate,0),d=this.getValueAtTime(r/this.comp.globalData.frameRate,0),p=this.getValueAtTime((n-(h-l)%n+h)/this.comp.globalData.frameRate,0),f=Math.floor((h-l)/n)+1;if(this.pv.length){for(s=(o=new Array(u.length)).length,a=0;a<s;a+=1)o[a]=p[a]-(d[a]-u[a])*f;return o}return p-(d-u)*f}if("continue"===e){var m=this.getValueAtTime(h/this.comp.globalData.frameRate,0),g=this.getValueAtTime((h+.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(s=(o=new Array(m.length)).length,a=0;a<s;a+=1)o[a]=m[a]+(m[a]-g[a])*(h-l)/.001;return o}return m+(m-g)*(h-l)/.001}}return this.getValueAtTime((n-((h-l)%n+h))/this.comp.globalData.frameRate,0)}function i(e,t){if(!this.k)return this.pv;if(e=.5*(e||.4),(t=Math.floor(t||5))<=1)return this.pv;var i,n,r=this.comp.renderedFrame/this.comp.globalData.frameRate,a=r-e,s=t>1?(r+e-a)/(t-1):1,o=0,l=0;for(i=this.pv.length?createTypedArray("float32",this.pv.length):0;o<t;){if(n=this.getValueAtTime(a+o*s),this.pv.length)for(l=0;l<this.pv.length;l+=1)i[l]+=n[l];else i+=n;o+=1}if(this.pv.length)for(l=0;l<this.pv.length;l+=1)i[l]/=t;else i/=t;return i}function n(e){this._transformCachingAtTime||(this._transformCachingAtTime={v:new Matrix});var t=this._transformCachingAtTime.v;if(t.cloneFromProps(this.pre.props),this.appliedTransformations<1){var i=this.a.getValueAtTime(e);t.translate(-i[0]*this.a.mult,-i[1]*this.a.mult,i[2]*this.a.mult)}if(this.appliedTransformations<2){var n=this.s.getValueAtTime(e);t.scale(n[0]*this.s.mult,n[1]*this.s.mult,n[2]*this.s.mult)}if(this.sk&&this.appliedTransformations<3){var r=this.sk.getValueAtTime(e),a=this.sa.getValueAtTime(e);t.skewFromAxis(-r*this.sk.mult,a*this.sa.mult)}if(this.r&&this.appliedTransformations<4){var s=this.r.getValueAtTime(e);t.rotate(-s*this.r.mult)}else if(!this.r&&this.appliedTransformations<4){var o=this.rz.getValueAtTime(e),l=this.ry.getValueAtTime(e),c=this.rx.getValueAtTime(e),h=this.or.getValueAtTime(e);t.rotateZ(-o*this.rz.mult).rotateY(l*this.ry.mult).rotateX(c*this.rx.mult).rotateZ(-h[2]*this.or.mult).rotateY(h[1]*this.or.mult).rotateX(h[0]*this.or.mult)}if(this.data.p&&this.data.p.s){var u=this.px.getValueAtTime(e),d=this.py.getValueAtTime(e);if(this.data.p.z){var p=this.pz.getValueAtTime(e);t.translate(u*this.px.mult,d*this.py.mult,-p*this.pz.mult)}else t.translate(u*this.px.mult,d*this.py.mult,0)}else{var f=this.p.getValueAtTime(e);t.translate(f[0]*this.p.mult,f[1]*this.p.mult,-f[2]*this.p.mult)}return t}function r(){return this.v.clone(new Matrix)}var a=TransformPropertyFactory.getTransformProperty;TransformPropertyFactory.getTransformProperty=function(e,t,i){var s=a(e,t,i);return s.dynamicProperties.length?s.getValueAtTime=n.bind(s):s.getValueAtTime=r.bind(s),s.setGroupProperty=expressionHelpers.setGroupProperty,s};var s=PropertyFactory.getProp;PropertyFactory.getProp=function(n,r,a,o,l){var c=s(n,r,a,o,l);c.kf?c.getValueAtTime=expressionHelpers.getValueAtTime.bind(c):c.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(c),c.setGroupProperty=expressionHelpers.setGroupProperty,c.loopOut=e,c.loopIn=t,c.smooth=i,c.getVelocityAtTime=expressionHelpers.getVelocityAtTime.bind(c),c.getSpeedAtTime=expressionHelpers.getSpeedAtTime.bind(c),c.numKeys=1===r.a?r.k.length:0,c.propertyIndex=r.ix;var h=0;return 0!==a&&(h=createTypedArray("float32",1===r.a?r.k[0].s.length:r.k.length)),c._cachingAtTime={lastFrame:initialDefaultFrame,lastIndex:0,value:h},expressionHelpers.searchExpressions(n,r,c),c.k&&l.addDynamicProperty(c),c};var o=ShapePropertyFactory.getConstructorFunction(),l=ShapePropertyFactory.getKeyframedConstructorFunction();function c(){}c.prototype={vertices:function(e,t){this.k&&this.getValue();var i,n=this.v;void 0!==t&&(n=this.getValueAtTime(t,0));var r=n._length,a=n[e],s=n.v,o=createSizedArray(r);for(i=0;i<r;i+=1)o[i]="i"===e||"o"===e?[a[i][0]-s[i][0],a[i][1]-s[i][1]]:[a[i][0],a[i][1]];return o},points:function(e){return this.vertices("v",e)},inTangents:function(e){return this.vertices("i",e)},outTangents:function(e){return this.vertices("o",e)},isClosed:function(){return this.v.c},pointOnPath:function(e,t){var i=this.v;void 0!==t&&(i=this.getValueAtTime(t,0)),this._segmentsLength||(this._segmentsLength=bez.getSegmentsLength(i));for(var n,r=this._segmentsLength,a=r.lengths,s=r.totalLength*e,o=0,l=a.length,c=0;o<l;){if(c+a[o].addedLength>s){var h=o,u=i.c&&o===l-1?0:o+1,d=(s-c)/a[o].addedLength;n=bez.getPointInSegment(i.v[h],i.v[u],i.o[h],i.i[u],d,a[o]);break}c+=a[o].addedLength,o+=1}return n||(n=i.c?[i.v[0][0],i.v[0][1]]:[i.v[i._length-1][0],i.v[i._length-1][1]]),n},vectorOnPath:function(e,t,i){1==e?e=this.v.c:0==e&&(e=.999);var n=this.pointOnPath(e,t),r=this.pointOnPath(e+.001,t),a=r[0]-n[0],s=r[1]-n[1],o=Math.sqrt(Math.pow(a,2)+Math.pow(s,2));return 0===o?[0,0]:"tangent"===i?[a/o,s/o]:[-s/o,a/o]},tangentOnPath:function(e,t){return this.vectorOnPath(e,t,"tangent")},normalOnPath:function(e,t){return this.vectorOnPath(e,t,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([c],o),extendPrototype([c],l),l.prototype.getValueAtTime=function(e){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shapePool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),e*=this.elem.globalData.frameRate,(e-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime<e?this._caching.lastIndex:0,this._cachingAtTime.lastTime=e,this.interpolateShape(e,this._cachingAtTime.shapeValue,this._cachingAtTime)),this._cachingAtTime.shapeValue},l.prototype.initiateExpression=ExpressionManager.initiateExpression;var h=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(e,t,i,n,r){var a=h(e,t,i,n,r);return a.propertyIndex=t.ix,a.lock=!1,3===i?expressionHelpers.searchExpressions(e,t.pt,a):4===i&&expressionHelpers.searchExpressions(e,t.ks,a),a.k&&e.addDynamicProperty(a),a}}function initialize$1(){addPropertyDecorator()}function addDecorator(){TextProperty.prototype.getExpressionValue=function(e,t){var i=this.calculateExpression(t);if(e.t!==i){var n={};return this.copyData(n,e),n.t=i.toString(),n.__complete=!1,n}return e},TextProperty.prototype.searchProperty=function(){var e=this.searchKeyframes(),t=this.searchExpressions();return this.kf=e||t,this.kf},TextProperty.prototype.searchExpressions=function(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}}function initialize(){addDecorator()}function SVGComposableEffect(){}SVGComposableEffect.prototype={createMergeNode:function(e,t){var i,n,r=createNS("feMerge");for(r.setAttribute("result",e),n=0;n<t.length;n+=1)(i=createNS("feMergeNode")).setAttribute("in",t[n]),r.appendChild(i),r.appendChild(i);return r}};var linearFilterValue="0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0";function SVGTintFilter(e,t,i,n,r){this.filterManager=t;var a=createNS("feColorMatrix");a.setAttribute("type","matrix"),a.setAttribute("color-interpolation-filters","linearRGB"),a.setAttribute("values",linearFilterValue+" 1 0"),this.linearFilter=a,a.setAttribute("result",n+"_tint_1"),e.appendChild(a),(a=createNS("feColorMatrix")).setAttribute("type","matrix"),a.setAttribute("color-interpolation-filters","sRGB"),a.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),a.setAttribute("result",n+"_tint_2"),e.appendChild(a),this.matrixFilter=a;var s=this.createMergeNode(n,[r,n+"_tint_1",n+"_tint_2"]);e.appendChild(s)}function SVGFillFilter(e,t,i,n){this.filterManager=t;var r=createNS("feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),r.setAttribute("result",n),e.appendChild(r),this.matrixFilter=r}function SVGStrokeEffect(e,t,i){this.initialized=!1,this.filterManager=t,this.elem=i,this.paths=[]}function SVGTritoneFilter(e,t,i,n){this.filterManager=t;var r=createNS("feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","linearRGB"),r.setAttribute("values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"),e.appendChild(r);var a=createNS("feComponentTransfer");a.setAttribute("color-interpolation-filters","sRGB"),a.setAttribute("result",n),this.matrixFilter=a;var s=createNS("feFuncR");s.setAttribute("type","table"),a.appendChild(s),this.feFuncR=s;var o=createNS("feFuncG");o.setAttribute("type","table"),a.appendChild(o),this.feFuncG=o;var l=createNS("feFuncB");l.setAttribute("type","table"),a.appendChild(l),this.feFuncB=l,e.appendChild(a)}function SVGProLevelsFilter(e,t,i,n){this.filterManager=t;var r=this.filterManager.effectElements,a=createNS("feComponentTransfer");(r[10].p.k||0!==r[10].p.v||r[11].p.k||1!==r[11].p.v||r[12].p.k||1!==r[12].p.v||r[13].p.k||0!==r[13].p.v||r[14].p.k||1!==r[14].p.v)&&(this.feFuncR=this.createFeFunc("feFuncR",a)),(r[17].p.k||0!==r[17].p.v||r[18].p.k||1!==r[18].p.v||r[19].p.k||1!==r[19].p.v||r[20].p.k||0!==r[20].p.v||r[21].p.k||1!==r[21].p.v)&&(this.feFuncG=this.createFeFunc("feFuncG",a)),(r[24].p.k||0!==r[24].p.v||r[25].p.k||1!==r[25].p.v||r[26].p.k||1!==r[26].p.v||r[27].p.k||0!==r[27].p.v||r[28].p.k||1!==r[28].p.v)&&(this.feFuncB=this.createFeFunc("feFuncB",a)),(r[31].p.k||0!==r[31].p.v||r[32].p.k||1!==r[32].p.v||r[33].p.k||1!==r[33].p.v||r[34].p.k||0!==r[34].p.v||r[35].p.k||1!==r[35].p.v)&&(this.feFuncA=this.createFeFunc("feFuncA",a)),(this.feFuncR||this.feFuncG||this.feFuncB||this.feFuncA)&&(a.setAttribute("color-interpolation-filters","sRGB"),e.appendChild(a)),(r[3].p.k||0!==r[3].p.v||r[4].p.k||1!==r[4].p.v||r[5].p.k||1!==r[5].p.v||r[6].p.k||0!==r[6].p.v||r[7].p.k||1!==r[7].p.v)&&((a=createNS("feComponentTransfer")).setAttribute("color-interpolation-filters","sRGB"),a.setAttribute("result",n),e.appendChild(a),this.feFuncRComposed=this.createFeFunc("feFuncR",a),this.feFuncGComposed=this.createFeFunc("feFuncG",a),this.feFuncBComposed=this.createFeFunc("feFuncB",a))}function SVGDropShadowEffect(e,t,i,n,r){var a=t.container.globalData.renderConfig.filterSize,s=t.data.fs||a;e.setAttribute("x",s.x||a.x),e.setAttribute("y",s.y||a.y),e.setAttribute("width",s.width||a.width),e.setAttribute("height",s.height||a.height),this.filterManager=t;var o=createNS("feGaussianBlur");o.setAttribute("in","SourceAlpha"),o.setAttribute("result",n+"_drop_shadow_1"),o.setAttribute("stdDeviation","0"),this.feGaussianBlur=o,e.appendChild(o);var l=createNS("feOffset");l.setAttribute("dx","25"),l.setAttribute("dy","0"),l.setAttribute("in",n+"_drop_shadow_1"),l.setAttribute("result",n+"_drop_shadow_2"),this.feOffset=l,e.appendChild(l);var c=createNS("feFlood");c.setAttribute("flood-color","#00ff00"),c.setAttribute("flood-opacity","1"),c.setAttribute("result",n+"_drop_shadow_3"),this.feFlood=c,e.appendChild(c);var h=createNS("feComposite");h.setAttribute("in",n+"_drop_shadow_3"),h.setAttribute("in2",n+"_drop_shadow_2"),h.setAttribute("operator","in"),h.setAttribute("result",n+"_drop_shadow_4"),e.appendChild(h);var u=this.createMergeNode(n,[n+"_drop_shadow_4",r]);e.appendChild(u)}extendPrototype([SVGComposableEffect],SVGTintFilter),SVGTintFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t=this.filterManager.effectElements[0].p.v,i=this.filterManager.effectElements[1].p.v,n=this.filterManager.effectElements[2].p.v/100;this.linearFilter.setAttribute("values",linearFilterValue+" "+n+" 0"),this.matrixFilter.setAttribute("values",i[0]-t[0]+" 0 0 0 "+t[0]+" "+(i[1]-t[1])+" 0 0 0 "+t[1]+" "+(i[2]-t[2])+" 0 0 0 "+t[2]+" 0 0 0 1 0")}},SVGFillFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t=this.filterManager.effectElements[2].p.v,i=this.filterManager.effectElements[6].p.v;this.matrixFilter.setAttribute("values","0 0 0 0 "+t[0]+" 0 0 0 0 "+t[1]+" 0 0 0 0 "+t[2]+" 0 0 0 "+i+" 0")}},SVGStrokeEffect.prototype.initialize=function(){var e,t,i,n,r=this.elem.layerElement.children||this.elem.layerElement.childNodes;for(1===this.filterManager.effectElements[1].p.v?(n=this.elem.maskManager.masksProperties.length,i=0):n=1+(i=this.filterManager.effectElements[0].p.v-1),(t=createNS("g")).setAttribute("fill","none"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-dashoffset",1);i<n;i+=1)e=createNS("path"),t.appendChild(e),this.paths.push({p:e,m:i});if(3===this.filterManager.effectElements[10].p.v){var a=createNS("mask"),s=createElementID();a.setAttribute("id",s),a.setAttribute("mask-type","alpha"),a.appendChild(t),this.elem.globalData.defs.appendChild(a);var o=createNS("g");for(o.setAttribute("mask","url("+getLocationHref()+"#"+s+")");r[0];)o.appendChild(r[0]);this.elem.layerElement.appendChild(o),this.masker=a,t.setAttribute("stroke","#fff")}else if(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v){if(2===this.filterManager.effectElements[10].p.v)for(r=this.elem.layerElement.children||this.elem.layerElement.childNodes;r.length;)this.elem.layerElement.removeChild(r[0]);this.elem.layerElement.appendChild(t),this.elem.layerElement.removeAttribute("mask"),t.setAttribute("stroke","#fff")}this.initialized=!0,this.pathMasker=t},SVGStrokeEffect.prototype.renderFrame=function(e){var t;this.initialized||this.initialize();var i,n,r=this.paths.length;for(t=0;t<r;t+=1)if(-1!==this.paths[t].m&&(i=this.elem.maskManager.viewData[this.paths[t].m],n=this.paths[t].p,(e||this.filterManager._mdf||i.prop._mdf)&&n.setAttribute("d",i.lastPath),e||this.filterManager.effectElements[9].p._mdf||this.filterManager.effectElements[4].p._mdf||this.filterManager.effectElements[7].p._mdf||this.filterManager.effectElements[8].p._mdf||i.prop._mdf)){var a;if(0!==this.filterManager.effectElements[7].p.v||100!==this.filterManager.effectElements[8].p.v){var s=.01*Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v),o=.01*Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v),l=n.getTotalLength();a="0 0 0 "+l*s+" ";var c,h=l*(o-s),u=1+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01,d=Math.floor(h/u);for(c=0;c<d;c+=1)a+="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01+" ";a+="0 "+10*l+" 0 0"}else a="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01;n.setAttribute("stroke-dasharray",a)}if((e||this.filterManager.effectElements[4].p._mdf)&&this.pathMasker.setAttribute("stroke-width",2*this.filterManager.effectElements[4].p.v),(e||this.filterManager.effectElements[6].p._mdf)&&this.pathMasker.setAttribute("opacity",this.filterManager.effectElements[6].p.v),(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v)&&(e||this.filterManager.effectElements[3].p._mdf)){var p=this.filterManager.effectElements[3].p.v;this.pathMasker.setAttribute("stroke","rgb("+bmFloor(255*p[0])+","+bmFloor(255*p[1])+","+bmFloor(255*p[2])+")")}},SVGTritoneFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t=this.filterManager.effectElements[0].p.v,i=this.filterManager.effectElements[1].p.v,n=this.filterManager.effectElements[2].p.v,r=n[0]+" "+i[0]+" "+t[0],a=n[1]+" "+i[1]+" "+t[1],s=n[2]+" "+i[2]+" "+t[2];this.feFuncR.setAttribute("tableValues",r),this.feFuncG.setAttribute("tableValues",a),this.feFuncB.setAttribute("tableValues",s)}},SVGProLevelsFilter.prototype.createFeFunc=function(e,t){var i=createNS(e);return i.setAttribute("type","table"),t.appendChild(i),i},SVGProLevelsFilter.prototype.getTableValue=function(e,t,i,n,r){for(var a,s,o=0,l=Math.min(e,t),c=Math.max(e,t),h=Array.call(null,{length:256}),u=0,d=r-n,p=t-e;o<=256;)s=(a=o/256)<=l?p<0?r:n:a>=c?p<0?n:r:n+d*Math.pow((a-e)/p,1/i),h[u]=s,u+=1,o+=256/255;return h.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t,i=this.filterManager.effectElements;this.feFuncRComposed&&(e||i[3].p._mdf||i[4].p._mdf||i[5].p._mdf||i[6].p._mdf||i[7].p._mdf)&&(t=this.getTableValue(i[3].p.v,i[4].p.v,i[5].p.v,i[6].p.v,i[7].p.v),this.feFuncRComposed.setAttribute("tableValues",t),this.feFuncGComposed.setAttribute("tableValues",t),this.feFuncBComposed.setAttribute("tableValues",t)),this.feFuncR&&(e||i[10].p._mdf||i[11].p._mdf||i[12].p._mdf||i[13].p._mdf||i[14].p._mdf)&&(t=this.getTableValue(i[10].p.v,i[11].p.v,i[12].p.v,i[13].p.v,i[14].p.v),this.feFuncR.setAttribute("tableValues",t)),this.feFuncG&&(e||i[17].p._mdf||i[18].p._mdf||i[19].p._mdf||i[20].p._mdf||i[21].p._mdf)&&(t=this.getTableValue(i[17].p.v,i[18].p.v,i[19].p.v,i[20].p.v,i[21].p.v),this.feFuncG.setAttribute("tableValues",t)),this.feFuncB&&(e||i[24].p._mdf||i[25].p._mdf||i[26].p._mdf||i[27].p._mdf||i[28].p._mdf)&&(t=this.getTableValue(i[24].p.v,i[25].p.v,i[26].p.v,i[27].p.v,i[28].p.v),this.feFuncB.setAttribute("tableValues",t)),this.feFuncA&&(e||i[31].p._mdf||i[32].p._mdf||i[33].p._mdf||i[34].p._mdf||i[35].p._mdf)&&(t=this.getTableValue(i[31].p.v,i[32].p.v,i[33].p.v,i[34].p.v,i[35].p.v),this.feFuncA.setAttribute("tableValues",t))}},extendPrototype([SVGComposableEffect],SVGDropShadowEffect),SVGDropShadowEffect.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){if((e||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),e||this.filterManager.effectElements[0].p._mdf){var t=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(255*t[0]),Math.round(255*t[1]),Math.round(255*t[2])))}if((e||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),e||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var i=this.filterManager.effectElements[3].p.v,n=(this.filterManager.effectElements[2].p.v-90)*degToRads,r=i*Math.cos(n),a=i*Math.sin(n);this.feOffset.setAttribute("dx",r),this.feOffset.setAttribute("dy",a)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(e,t,i){this.initialized=!1,this.filterManager=t,this.filterElem=e,this.elem=i,i.matteElement=createNS("g"),i.matteElement.appendChild(i.layerElement),i.matteElement.appendChild(i.transformedElement),i.baseElement=i.matteElement}function SVGGaussianBlurEffect(e,t,i,n){e.setAttribute("x","-100%"),e.setAttribute("y","-100%"),e.setAttribute("width","300%"),e.setAttribute("height","300%"),this.filterManager=t;var r=createNS("feGaussianBlur");r.setAttribute("result",n),e.appendChild(r),this.feGaussianBlur=r}function TransformEffect(){}function SVGTransformEffect(e,t){this.init(t)}function CVTransformEffect(e){this.init(e)}return SVGMatte3Effect.prototype.findSymbol=function(e){for(var t=0,i=_svgMatteSymbols.length;t<i;){if(_svgMatteSymbols[t]===e)return _svgMatteSymbols[t];t+=1}return null},SVGMatte3Effect.prototype.replaceInParent=function(e,t){var i=e.layerElement.parentNode;if(i){for(var n,r=i.children,a=0,s=r.length;a<s&&r[a]!==e.layerElement;)a+=1;a<=s-2&&(n=r[a+1]);var o=createNS("use");o.setAttribute("href","#"+t),n?i.insertBefore(o,n):i.appendChild(o)}},SVGMatte3Effect.prototype.setElementAsMask=function(e,t){if(!this.findSymbol(t)){var i=createElementID(),n=createNS("mask");n.setAttribute("id",t.layerId),n.setAttribute("mask-type","alpha"),_svgMatteSymbols.push(t);var r=e.globalData.defs;r.appendChild(n);var a=createNS("symbol");a.setAttribute("id",i),this.replaceInParent(t,i),a.appendChild(t.layerElement),r.appendChild(a);var s=createNS("use");s.setAttribute("href","#"+i),n.appendChild(s),t.data.hd=!1,t.show()}e.setMatte(t.layerId)},SVGMatte3Effect.prototype.initialize=function(){for(var e=this.filterManager.effectElements[0].p.v,t=this.elem.comp.elements,i=0,n=t.length;i<n;)t[i]&&t[i].data.ind===e&&this.setElementAsMask(this.elem,t[i]),i+=1;this.initialized=!0},SVGMatte3Effect.prototype.renderFrame=function(){this.initialized||this.initialize()},SVGGaussianBlurEffect.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t=.3*this.filterManager.effectElements[0].p.v,i=this.filterManager.effectElements[1].p.v,n=3==i?0:t,r=2==i?0:t;this.feGaussianBlur.setAttribute("stdDeviation",n+" "+r);var a=1==this.filterManager.effectElements[2].p.v?"wrap":"duplicate";this.feGaussianBlur.setAttribute("edgeMode",a)}},TransformEffect.prototype.init=function(e){this.effectsManager=e,this.type=effectTypes.TRANSFORM_EFFECT,this.matrix=new Matrix,this.opacity=-1,this._mdf=!1,this._opMdf=!1},TransformEffect.prototype.renderFrame=function(e){if(this._opMdf=!1,this._mdf=!1,e||this.effectsManager._mdf){var t=this.effectsManager.effectElements,i=t[0].p.v,n=t[1].p.v,r=1===t[2].p.v,a=t[3].p.v,s=r?a:t[4].p.v,o=t[5].p.v,l=t[6].p.v,c=t[7].p.v;this.matrix.reset(),this.matrix.translate(-i[0],-i[1],i[2]),this.matrix.scale(.01*s,.01*a,1),this.matrix.rotate(-c*degToRads),this.matrix.skewFromAxis(-o*degToRads,(l+90)*degToRads),this.matrix.translate(n[0],n[1],0),this._mdf=!0,this.opacity!==t[8].p.v&&(this.opacity=t[8].p.v,this._opMdf=!0)}},extendPrototype([TransformEffect],SVGTransformEffect),extendPrototype([TransformEffect],CVTransformEffect),registerRenderer("canvas",CanvasRenderer),registerRenderer("html",HybridRenderer),registerRenderer("svg",SVGRenderer),ShapeModifiers.registerModifier("tm",TrimModifier),ShapeModifiers.registerModifier("pb",PuckerAndBloatModifier),ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeModifiers.registerModifier("rd",RoundCornersModifier),ShapeModifiers.registerModifier("zz",ZigZagModifier),ShapeModifiers.registerModifier("op",OffsetPathModifier),setExpressionsPlugin(Expressions),setExpressionInterfaces(getInterface),initialize$1(),initialize(),registerEffect$1(20,SVGTintFilter,!0),registerEffect$1(21,SVGFillFilter,!0),registerEffect$1(22,SVGStrokeEffect,!1),registerEffect$1(23,SVGTritoneFilter,!0),registerEffect$1(24,SVGProLevelsFilter,!0),registerEffect$1(25,SVGDropShadowEffect,!0),registerEffect$1(28,SVGMatte3Effect,!1),registerEffect$1(29,SVGGaussianBlurEffect,!0),registerEffect$1(35,SVGTransformEffect,!1),registerEffect(35,CVTransformEffect),lottie},module.exports=factory())},730:(e,t,i)=>{"use strict";var n=i(43),r=i(853);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,o={};function l(e,t){c(e,t),c(e+"Capture",t)}function c(e,t){for(o[e]=t,e=0;e<t.length;e++)s.add(t[e])}var h=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),u=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},f={};function m(e,t,i,n,r,a,s){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=r,this.mustUseProperty=i,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=s}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){g[e]=new m(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];g[t]=new m(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){g[e]=new m(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){g[e]=new m(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){g[e]=new m(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){g[e]=new m(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){g[e]=new m(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){g[e]=new m(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){g[e]=new m(e,5,!1,e.toLowerCase(),null,!1,!1)}));var v=/[\-:]([a-z])/g;function y(e){return e[1].toUpperCase()}function b(e,t,i,n){var r=g.hasOwnProperty(t)?g[t]:null;(null!==r?0!==r.type:n||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,i,n){if(null===t||"undefined"===typeof t||function(e,t,i,n){if(null!==i&&0===i.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!n&&(null!==i?!i.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,i,n))return!0;if(n)return!1;if(null!==i)switch(i.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,i,r,n)&&(i=null),n||null===r?function(e){return!!u.call(f,e)||!u.call(p,e)&&(d.test(e)?f[e]=!0:(p[e]=!0,!1))}(t)&&(null===i?e.removeAttribute(t):e.setAttribute(t,""+i)):r.mustUseProperty?e[r.propertyName]=null===i?3!==r.type&&"":i:(t=r.attributeName,n=r.attributeNamespace,null===i?e.removeAttribute(t):(i=3===(r=r.type)||4===r&&!0===i?"":""+i,n?e.setAttributeNS(n,t,i):e.setAttribute(t,i))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(v,y);g[t]=new m(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(v,y);g[t]=new m(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(v,y);g[t]=new m(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!1,!1)})),g.xlinkHref=new m("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!0,!0)}));var x=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for("react.element"),_=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),A=Symbol.for("react.provider"),M=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),O=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var I=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var R=Symbol.iterator;function L(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=R&&e[R]||e["@@iterator"])?e:null}var B,z=Object.assign;function N(e){if(void 0===B)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);B=t&&t[1]||""}return"\n"+B+e}var F=!1;function j(e,t){if(!e||F)return"";F=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var n=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){n=c}e.call(t.prototype)}else{try{throw Error()}catch(c){n=c}e()}}catch(c){if(c&&n&&"string"===typeof c.stack){for(var r=c.stack.split("\n"),a=n.stack.split("\n"),s=r.length-1,o=a.length-1;1<=s&&0<=o&&r[s]!==a[o];)o--;for(;1<=s&&0<=o;s--,o--)if(r[s]!==a[o]){if(1!==s||1!==o)do{if(s--,0>--o||r[s]!==a[o]){var l="\n"+r[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=s&&0<=o);break}}}finally{F=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?N(e):""}function V(e){switch(e.tag){case 5:return N(e.type);case 16:return N("Lazy");case 13:return N("Suspense");case 19:return N("SuspenseList");case 0:case 2:case 15:return e=j(e.type,!1);case 11:return e=j(e.type.render,!1);case 1:return e=j(e.type,!0);default:return""}}function U(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case S:return"Fragment";case _:return"Portal";case C:return"Profiler";case E:return"StrictMode";case P:return"Suspense";case D:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case M:return(e.displayName||"Context")+".Consumer";case A:return(e._context.displayName||"Context")+".Provider";case T:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case k:return null!==(t=e.displayName||null)?t:U(e.type)||"Memo";case O:t=e._payload,e=e._init;try{return U(e(t))}catch(i){}}return null}function G(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return U(t);case 8:return t===E?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof t)return t.displayName||t.name||null;if("string"===typeof t)return t}return null}function H(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function W(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function q(e){e._valueTracker||(e._valueTracker=function(e){var t=W(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof i&&"function"===typeof i.get&&"function"===typeof i.set){var r=i.get,a=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(e){n=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(e){n=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function X(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),n="";return e&&(n=W(e)?e.checked?"true":"false":e.value),(e=n)!==i&&(t.setValue(e),!0)}function Y(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Q(e,t){var i=t.checked;return z({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=i?i:e._wrapperState.initialChecked})}function Z(e,t){var i=null==t.defaultValue?"":t.defaultValue,n=null!=t.checked?t.checked:t.defaultChecked;i=H(null!=t.value?t.value:i),e._wrapperState={initialChecked:n,initialValue:i,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function K(e,t){null!=(t=t.checked)&&b(e,"checked",t,!1)}function J(e,t){K(e,t);var i=H(t.value),n=t.type;if(null!=i)"number"===n?(0===i&&""===e.value||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if("submit"===n||"reset"===n)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,i):t.hasOwnProperty("defaultValue")&&ee(e,t.type,H(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function $(e,t,i){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!("submit"!==n&&"reset"!==n||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,i||t===e.value||(e.value=t),e.defaultValue=t}""!==(i=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==i&&(e.name=i)}function ee(e,t,i){"number"===t&&Y(e.ownerDocument)===e||(null==i?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var te=Array.isArray;function ie(e,t,i,n){if(e=e.options,t){t={};for(var r=0;r<i.length;r++)t["$"+i[r]]=!0;for(i=0;i<e.length;i++)r=t.hasOwnProperty("$"+e[i].value),e[i].selected!==r&&(e[i].selected=r),r&&n&&(e[i].defaultSelected=!0)}else{for(i=""+H(i),t=null,r=0;r<e.length;r++){if(e[r].value===i)return e[r].selected=!0,void(n&&(e[r].defaultSelected=!0));null!==t||e[r].disabled||(t=e[r])}null!==t&&(t.selected=!0)}}function ne(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(a(91));return z({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function re(e,t){var i=t.value;if(null==i){if(i=t.children,t=t.defaultValue,null!=i){if(null!=t)throw Error(a(92));if(te(i)){if(1<i.length)throw Error(a(93));i=i[0]}t=i}null==t&&(t=""),i=t}e._wrapperState={initialValue:H(i)}}function ae(e,t){var i=H(t.value),n=H(t.defaultValue);null!=i&&((i=""+i)!==e.value&&(e.value=i),null==t.defaultValue&&e.defaultValue!==i&&(e.defaultValue=i)),null!=n&&(e.defaultValue=""+n)}function se(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function oe(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function le(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?oe(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ce,he,ue=(he=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ce=ce||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,i,n){MSApp.execUnsafeLocalFunction((function(){return he(e,t)}))}:he);function de(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&3===i.nodeType)return void(i.nodeValue=t)}e.textContent=t}var pe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},fe=["Webkit","ms","Moz","O"];function me(e,t,i){return null==t||"boolean"===typeof t||""===t?"":i||"number"!==typeof t||0===t||pe.hasOwnProperty(e)&&pe[e]?(""+t).trim():t+"px"}function ge(e,t){for(var i in e=e.style,t)if(t.hasOwnProperty(i)){var n=0===i.indexOf("--"),r=me(i,t[i],n);"float"===i&&(i="cssFloat"),n?e.setProperty(i,r):e[i]=r}}Object.keys(pe).forEach((function(e){fe.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),pe[t]=pe[e]}))}));var ve=z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ye(e,t){if(t){if(ve[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(a(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(a(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(a(62))}}function be(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var xe=null;function we(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var _e=null,Se=null,Ee=null;function Ce(e){if(e=br(e)){if("function"!==typeof _e)throw Error(a(280));var t=e.stateNode;t&&(t=wr(t),_e(e.stateNode,e.type,t))}}function Ae(e){Se?Ee?Ee.push(e):Ee=[e]:Se=e}function Me(){if(Se){var e=Se,t=Ee;if(Ee=Se=null,Ce(e),t)for(e=0;e<t.length;e++)Ce(t[e])}}function Te(e,t){return e(t)}function Pe(){}var De=!1;function ke(e,t,i){if(De)return e(t,i);De=!0;try{return Te(e,t,i)}finally{De=!1,(null!==Se||null!==Ee)&&(Pe(),Me())}}function Oe(e,t){var i=e.stateNode;if(null===i)return null;var n=wr(i);if(null===n)return null;i=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(n=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!n;break e;default:e=!1}if(e)return null;if(i&&"function"!==typeof i)throw Error(a(231,t,typeof i));return i}var Ie=!1;if(h)try{var Re={};Object.defineProperty(Re,"passive",{get:function(){Ie=!0}}),window.addEventListener("test",Re,Re),window.removeEventListener("test",Re,Re)}catch(he){Ie=!1}function Le(e,t,i,n,r,a,s,o,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(i,c)}catch(h){this.onError(h)}}var Be=!1,ze=null,Ne=!1,Fe=null,je={onError:function(e){Be=!0,ze=e}};function Ve(e,t,i,n,r,a,s,o,l){Be=!1,ze=null,Le.apply(je,arguments)}function Ue(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(4098&(t=e).flags)&&(i=t.return),e=t.return}while(e)}return 3===t.tag?i:null}function Ge(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function He(e){if(Ue(e)!==e)throw Error(a(188))}function We(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=Ue(e)))throw Error(a(188));return t!==e?null:e}for(var i=e,n=t;;){var r=i.return;if(null===r)break;var s=r.alternate;if(null===s){if(null!==(n=r.return)){i=n;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===i)return He(r),e;if(s===n)return He(r),t;s=s.sibling}throw Error(a(188))}if(i.return!==n.return)i=r,n=s;else{for(var o=!1,l=r.child;l;){if(l===i){o=!0,i=r,n=s;break}if(l===n){o=!0,n=r,i=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===i){o=!0,i=s,n=r;break}if(l===n){o=!0,n=s,i=r;break}l=l.sibling}if(!o)throw Error(a(189))}}if(i.alternate!==n)throw Error(a(190))}if(3!==i.tag)throw Error(a(188));return i.stateNode.current===i?e:t}(e))?qe(e):null}function qe(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=qe(e);if(null!==t)return t;e=e.sibling}return null}var Xe=r.unstable_scheduleCallback,Ye=r.unstable_cancelCallback,Qe=r.unstable_shouldYield,Ze=r.unstable_requestPaint,Ke=r.unstable_now,Je=r.unstable_getCurrentPriorityLevel,$e=r.unstable_ImmediatePriority,et=r.unstable_UserBlockingPriority,tt=r.unstable_NormalPriority,it=r.unstable_LowPriority,nt=r.unstable_IdlePriority,rt=null,at=null;var st=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(ot(e)/lt|0)|0},ot=Math.log,lt=Math.LN2;var ct=64,ht=4194304;function ut(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function dt(e,t){var i=e.pendingLanes;if(0===i)return 0;var n=0,r=e.suspendedLanes,a=e.pingedLanes,s=268435455&i;if(0!==s){var o=s&~r;0!==o?n=ut(o):0!==(a&=s)&&(n=ut(a))}else 0!==(s=i&~r)?n=ut(s):0!==a&&(n=ut(a));if(0===n)return 0;if(0!==t&&t!==n&&0===(t&r)&&((r=n&-n)>=(a=t&-t)||16===r&&0!==(4194240&a)))return t;if(0!==(4&n)&&(n|=16&i),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=n;0<t;)r=1<<(i=31-st(t)),n|=e[i],t&=~r;return n}function pt(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function ft(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function mt(){var e=ct;return 0===(4194240&(ct<<=1))&&(ct=64),e}function gt(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function vt(e,t,i){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-st(t)]=i}function yt(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var n=31-st(i),r=1<<n;r&t|e[n]&t&&(e[n]|=t),i&=~r}}var bt=0;function xt(e){return 1<(e&=-e)?4<e?0!==(268435455&e)?16:536870912:4:1}var wt,_t,St,Et,Ct,At=!1,Mt=[],Tt=null,Pt=null,Dt=null,kt=new Map,Ot=new Map,It=[],Rt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Lt(e,t){switch(e){case"focusin":case"focusout":Tt=null;break;case"dragenter":case"dragleave":Pt=null;break;case"mouseover":case"mouseout":Dt=null;break;case"pointerover":case"pointerout":kt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ot.delete(t.pointerId)}}function Bt(e,t,i,n,r,a){return null===e||e.nativeEvent!==a?(e={blockedOn:t,domEventName:i,eventSystemFlags:n,nativeEvent:a,targetContainers:[r]},null!==t&&(null!==(t=br(t))&&_t(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,null!==r&&-1===t.indexOf(r)&&t.push(r),e)}function zt(e){var t=yr(e.target);if(null!==t){var i=Ue(t);if(null!==i)if(13===(t=i.tag)){if(null!==(t=Ge(i)))return e.blockedOn=t,void Ct(e.priority,(function(){St(i)}))}else if(3===t&&i.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===i.tag?i.stateNode.containerInfo:null)}e.blockedOn=null}function Nt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var i=Qt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==i)return null!==(t=br(i))&&_t(t),e.blockedOn=i,!1;var n=new(i=e.nativeEvent).constructor(i.type,i);xe=n,i.target.dispatchEvent(n),xe=null,t.shift()}return!0}function Ft(e,t,i){Nt(e)&&i.delete(t)}function jt(){At=!1,null!==Tt&&Nt(Tt)&&(Tt=null),null!==Pt&&Nt(Pt)&&(Pt=null),null!==Dt&&Nt(Dt)&&(Dt=null),kt.forEach(Ft),Ot.forEach(Ft)}function Vt(e,t){e.blockedOn===t&&(e.blockedOn=null,At||(At=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,jt)))}function Ut(e){function t(t){return Vt(t,e)}if(0<Mt.length){Vt(Mt[0],e);for(var i=1;i<Mt.length;i++){var n=Mt[i];n.blockedOn===e&&(n.blockedOn=null)}}for(null!==Tt&&Vt(Tt,e),null!==Pt&&Vt(Pt,e),null!==Dt&&Vt(Dt,e),kt.forEach(t),Ot.forEach(t),i=0;i<It.length;i++)(n=It[i]).blockedOn===e&&(n.blockedOn=null);for(;0<It.length&&null===(i=It[0]).blockedOn;)zt(i),null===i.blockedOn&&It.shift()}var Gt=x.ReactCurrentBatchConfig,Ht=!0;function Wt(e,t,i,n){var r=bt,a=Gt.transition;Gt.transition=null;try{bt=1,Xt(e,t,i,n)}finally{bt=r,Gt.transition=a}}function qt(e,t,i,n){var r=bt,a=Gt.transition;Gt.transition=null;try{bt=4,Xt(e,t,i,n)}finally{bt=r,Gt.transition=a}}function Xt(e,t,i,n){if(Ht){var r=Qt(e,t,i,n);if(null===r)Hn(e,t,n,Yt,i),Lt(e,n);else if(function(e,t,i,n,r){switch(t){case"focusin":return Tt=Bt(Tt,e,t,i,n,r),!0;case"dragenter":return Pt=Bt(Pt,e,t,i,n,r),!0;case"mouseover":return Dt=Bt(Dt,e,t,i,n,r),!0;case"pointerover":var a=r.pointerId;return kt.set(a,Bt(kt.get(a)||null,e,t,i,n,r)),!0;case"gotpointercapture":return a=r.pointerId,Ot.set(a,Bt(Ot.get(a)||null,e,t,i,n,r)),!0}return!1}(r,e,t,i,n))n.stopPropagation();else if(Lt(e,n),4&t&&-1<Rt.indexOf(e)){for(;null!==r;){var a=br(r);if(null!==a&&wt(a),null===(a=Qt(e,t,i,n))&&Hn(e,t,n,Yt,i),a===r)break;r=a}null!==r&&n.stopPropagation()}else Hn(e,t,n,null,i)}}var Yt=null;function Qt(e,t,i,n){if(Yt=null,null!==(e=yr(e=we(n))))if(null===(t=Ue(e)))e=null;else if(13===(i=t.tag)){if(null!==(e=Ge(t)))return e;e=null}else if(3===i){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Yt=e,null}function Zt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Je()){case $e:return 1;case et:return 4;case tt:case it:return 16;case nt:return 536870912;default:return 16}default:return 16}}var Kt=null,Jt=null,$t=null;function ei(){if($t)return $t;var e,t,i=Jt,n=i.length,r="value"in Kt?Kt.value:Kt.textContent,a=r.length;for(e=0;e<n&&i[e]===r[e];e++);var s=n-e;for(t=1;t<=s&&i[n-t]===r[a-t];t++);return $t=r.slice(e,1<t?1-t:void 0)}function ti(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function ii(){return!0}function ni(){return!1}function ri(e){function t(t,i,n,r,a){for(var s in this._reactName=t,this._targetInst=n,this.type=i,this.nativeEvent=r,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(s)&&(t=e[s],this[s]=t?t(r):r[s]);return this.isDefaultPrevented=(null!=r.defaultPrevented?r.defaultPrevented:!1===r.returnValue)?ii:ni,this.isPropagationStopped=ni,this}return z(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=ii)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=ii)},persist:function(){},isPersistent:ii}),t}var ai,si,oi,li={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ci=ri(li),hi=z({},li,{view:0,detail:0}),ui=ri(hi),di=z({},hi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ei,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==oi&&(oi&&"mousemove"===e.type?(ai=e.screenX-oi.screenX,si=e.screenY-oi.screenY):si=ai=0,oi=e),ai)},movementY:function(e){return"movementY"in e?e.movementY:si}}),pi=ri(di),fi=ri(z({},di,{dataTransfer:0})),mi=ri(z({},hi,{relatedTarget:0})),gi=ri(z({},li,{animationName:0,elapsedTime:0,pseudoElement:0})),vi=z({},li,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),yi=ri(vi),bi=ri(z({},li,{data:0})),xi={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wi={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},_i={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Si(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=_i[e])&&!!t[e]}function Ei(){return Si}var Ci=z({},hi,{key:function(e){if(e.key){var t=xi[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=ti(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?wi[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ei,charCode:function(e){return"keypress"===e.type?ti(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?ti(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Ai=ri(Ci),Mi=ri(z({},di,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Ti=ri(z({},hi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ei})),Pi=ri(z({},li,{propertyName:0,elapsedTime:0,pseudoElement:0})),Di=z({},di,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ki=ri(Di),Oi=[9,13,27,32],Ii=h&&"CompositionEvent"in window,Ri=null;h&&"documentMode"in document&&(Ri=document.documentMode);var Li=h&&"TextEvent"in window&&!Ri,Bi=h&&(!Ii||Ri&&8<Ri&&11>=Ri),zi=String.fromCharCode(32),Ni=!1;function Fi(e,t){switch(e){case"keyup":return-1!==Oi.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ji(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Vi=!1;var Ui={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Gi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Ui[e.type]:"textarea"===t}function Hi(e,t,i,n){Ae(n),0<(t=qn(t,"onChange")).length&&(i=new ci("onChange","change",null,i,n),e.push({event:i,listeners:t}))}var Wi=null,qi=null;function Xi(e){Nn(e,0)}function Yi(e){if(X(xr(e)))return e}function Qi(e,t){if("change"===e)return t}var Zi=!1;if(h){var Ki;if(h){var Ji="oninput"in document;if(!Ji){var $i=document.createElement("div");$i.setAttribute("oninput","return;"),Ji="function"===typeof $i.oninput}Ki=Ji}else Ki=!1;Zi=Ki&&(!document.documentMode||9<document.documentMode)}function en(){Wi&&(Wi.detachEvent("onpropertychange",tn),qi=Wi=null)}function tn(e){if("value"===e.propertyName&&Yi(qi)){var t=[];Hi(t,qi,e,we(e)),ke(Xi,t)}}function nn(e,t,i){"focusin"===e?(en(),qi=i,(Wi=t).attachEvent("onpropertychange",tn)):"focusout"===e&&en()}function rn(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Yi(qi)}function an(e,t){if("click"===e)return Yi(t)}function sn(e,t){if("input"===e||"change"===e)return Yi(t)}var on="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t};function ln(e,t){if(on(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var i=Object.keys(e),n=Object.keys(t);if(i.length!==n.length)return!1;for(n=0;n<i.length;n++){var r=i[n];if(!u.call(t,r)||!on(e[r],t[r]))return!1}return!0}function cn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function hn(e,t){var i,n=cn(e);for(e=0;n;){if(3===n.nodeType){if(i=e+n.textContent.length,e<=t&&i>=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=cn(n)}}function un(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?un(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function dn(){for(var e=window,t=Y();t instanceof e.HTMLIFrameElement;){try{var i="string"===typeof t.contentWindow.location.href}catch(n){i=!1}if(!i)break;t=Y((e=t.contentWindow).document)}return t}function pn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function fn(e){var t=dn(),i=e.focusedElem,n=e.selectionRange;if(t!==i&&i&&i.ownerDocument&&un(i.ownerDocument.documentElement,i)){if(null!==n&&pn(i))if(t=n.start,void 0===(e=n.end)&&(e=t),"selectionStart"in i)i.selectionStart=t,i.selectionEnd=Math.min(e,i.value.length);else if((e=(t=i.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var r=i.textContent.length,a=Math.min(n.start,r);n=void 0===n.end?a:Math.min(n.end,r),!e.extend&&a>n&&(r=n,n=a,a=r),r=hn(i,a);var s=hn(i,n);r&&s&&(1!==e.rangeCount||e.anchorNode!==r.node||e.anchorOffset!==r.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&((t=t.createRange()).setStart(r.node,r.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}for(t=[],e=i;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"===typeof i.focus&&i.focus(),i=0;i<t.length;i++)(e=t[i]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var mn=h&&"documentMode"in document&&11>=document.documentMode,gn=null,vn=null,yn=null,bn=!1;function xn(e,t,i){var n=i.window===i?i.document:9===i.nodeType?i:i.ownerDocument;bn||null==gn||gn!==Y(n)||("selectionStart"in(n=gn)&&pn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},yn&&ln(yn,n)||(yn=n,0<(n=qn(vn,"onSelect")).length&&(t=new ci("onSelect","select",null,t,i),e.push({event:t,listeners:n}),t.target=gn)))}function wn(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var _n={animationend:wn("Animation","AnimationEnd"),animationiteration:wn("Animation","AnimationIteration"),animationstart:wn("Animation","AnimationStart"),transitionend:wn("Transition","TransitionEnd")},Sn={},En={};function Cn(e){if(Sn[e])return Sn[e];if(!_n[e])return e;var t,i=_n[e];for(t in i)if(i.hasOwnProperty(t)&&t in En)return Sn[e]=i[t];return e}h&&(En=document.createElement("div").style,"AnimationEvent"in window||(delete _n.animationend.animation,delete _n.animationiteration.animation,delete _n.animationstart.animation),"TransitionEvent"in window||delete _n.transitionend.transition);var An=Cn("animationend"),Mn=Cn("animationiteration"),Tn=Cn("animationstart"),Pn=Cn("transitionend"),Dn=new Map,kn="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function On(e,t){Dn.set(e,t),l(t,[e])}for(var In=0;In<kn.length;In++){var Rn=kn[In];On(Rn.toLowerCase(),"on"+(Rn[0].toUpperCase()+Rn.slice(1)))}On(An,"onAnimationEnd"),On(Mn,"onAnimationIteration"),On(Tn,"onAnimationStart"),On("dblclick","onDoubleClick"),On("focusin","onFocus"),On("focusout","onBlur"),On(Pn,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ln="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Bn=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ln));function zn(e,t,i){var n=e.type||"unknown-event";e.currentTarget=i,function(e,t,i,n,r,s,o,l,c){if(Ve.apply(this,arguments),Be){if(!Be)throw Error(a(198));var h=ze;Be=!1,ze=null,Ne||(Ne=!0,Fe=h)}}(n,t,void 0,e),e.currentTarget=null}function Nn(e,t){t=0!==(4&t);for(var i=0;i<e.length;i++){var n=e[i],r=n.event;n=n.listeners;e:{var a=void 0;if(t)for(var s=n.length-1;0<=s;s--){var o=n[s],l=o.instance,c=o.currentTarget;if(o=o.listener,l!==a&&r.isPropagationStopped())break e;zn(r,o,c),a=l}else for(s=0;s<n.length;s++){if(l=(o=n[s]).instance,c=o.currentTarget,o=o.listener,l!==a&&r.isPropagationStopped())break e;zn(r,o,c),a=l}}}if(Ne)throw e=Fe,Ne=!1,Fe=null,e}function Fn(e,t){var i=t[mr];void 0===i&&(i=t[mr]=new Set);var n=e+"__bubble";i.has(n)||(Gn(t,e,2,!1),i.add(n))}function jn(e,t,i){var n=0;t&&(n|=4),Gn(i,e,n,t)}var Vn="_reactListening"+Math.random().toString(36).slice(2);function Un(e){if(!e[Vn]){e[Vn]=!0,s.forEach((function(t){"selectionchange"!==t&&(Bn.has(t)||jn(t,!1,e),jn(t,!0,e))}));var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Vn]||(t[Vn]=!0,jn("selectionchange",!1,t))}}function Gn(e,t,i,n){switch(Zt(t)){case 1:var r=Wt;break;case 4:r=qt;break;default:r=Xt}i=r.bind(null,t,i,e),r=void 0,!Ie||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(r=!0),n?void 0!==r?e.addEventListener(t,i,{capture:!0,passive:r}):e.addEventListener(t,i,!0):void 0!==r?e.addEventListener(t,i,{passive:r}):e.addEventListener(t,i,!1)}function Hn(e,t,i,n,r){var a=n;if(0===(1&t)&&0===(2&t)&&null!==n)e:for(;;){if(null===n)return;var s=n.tag;if(3===s||4===s){var o=n.stateNode.containerInfo;if(o===r||8===o.nodeType&&o.parentNode===r)break;if(4===s)for(s=n.return;null!==s;){var l=s.tag;if((3===l||4===l)&&((l=s.stateNode.containerInfo)===r||8===l.nodeType&&l.parentNode===r))return;s=s.return}for(;null!==o;){if(null===(s=yr(o)))return;if(5===(l=s.tag)||6===l){n=a=s;continue e}o=o.parentNode}}n=n.return}ke((function(){var n=a,r=we(i),s=[];e:{var o=Dn.get(e);if(void 0!==o){var l=ci,c=e;switch(e){case"keypress":if(0===ti(i))break e;case"keydown":case"keyup":l=Ai;break;case"focusin":c="focus",l=mi;break;case"focusout":c="blur",l=mi;break;case"beforeblur":case"afterblur":l=mi;break;case"click":if(2===i.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=pi;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=fi;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Ti;break;case An:case Mn:case Tn:l=gi;break;case Pn:l=Pi;break;case"scroll":l=ui;break;case"wheel":l=ki;break;case"copy":case"cut":case"paste":l=yi;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=Mi}var h=0!==(4&t),u=!h&&"scroll"===e,d=h?null!==o?o+"Capture":null:o;h=[];for(var p,f=n;null!==f;){var m=(p=f).stateNode;if(5===p.tag&&null!==m&&(p=m,null!==d&&(null!=(m=Oe(f,d))&&h.push(Wn(f,m,p)))),u)break;f=f.return}0<h.length&&(o=new l(o,c,null,i,r),s.push({event:o,listeners:h}))}}if(0===(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(o="mouseover"===e||"pointerover"===e)||i===xe||!(c=i.relatedTarget||i.fromElement)||!yr(c)&&!c[fr])&&(l||o)&&(o=r.window===r?r:(o=r.ownerDocument)?o.defaultView||o.parentWindow:window,l?(l=n,null!==(c=(c=i.relatedTarget||i.toElement)?yr(c):null)&&(c!==(u=Ue(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(l=null,c=n),l!==c)){if(h=pi,m="onMouseLeave",d="onMouseEnter",f="mouse","pointerout"!==e&&"pointerover"!==e||(h=Mi,m="onPointerLeave",d="onPointerEnter",f="pointer"),u=null==l?o:xr(l),p=null==c?o:xr(c),(o=new h(m,f+"leave",l,i,r)).target=u,o.relatedTarget=p,m=null,yr(r)===n&&((h=new h(d,f+"enter",c,i,r)).target=p,h.relatedTarget=u,m=h),u=m,l&&c)e:{for(d=c,f=0,p=h=l;p;p=Xn(p))f++;for(p=0,m=d;m;m=Xn(m))p++;for(;0<f-p;)h=Xn(h),f--;for(;0<p-f;)d=Xn(d),p--;for(;f--;){if(h===d||null!==d&&h===d.alternate)break e;h=Xn(h),d=Xn(d)}h=null}else h=null;null!==l&&Yn(s,o,l,h,!1),null!==c&&null!==u&&Yn(s,u,c,h,!0)}if("select"===(l=(o=n?xr(n):window).nodeName&&o.nodeName.toLowerCase())||"input"===l&&"file"===o.type)var g=Qi;else if(Gi(o))if(Zi)g=sn;else{g=rn;var v=nn}else(l=o.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===o.type||"radio"===o.type)&&(g=an);switch(g&&(g=g(e,n))?Hi(s,g,i,r):(v&&v(e,o,n),"focusout"===e&&(v=o._wrapperState)&&v.controlled&&"number"===o.type&&ee(o,"number",o.value)),v=n?xr(n):window,e){case"focusin":(Gi(v)||"true"===v.contentEditable)&&(gn=v,vn=n,yn=null);break;case"focusout":yn=vn=gn=null;break;case"mousedown":bn=!0;break;case"contextmenu":case"mouseup":case"dragend":bn=!1,xn(s,i,r);break;case"selectionchange":if(mn)break;case"keydown":case"keyup":xn(s,i,r)}var y;if(Ii)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else Vi?Fi(e,i)&&(b="onCompositionEnd"):"keydown"===e&&229===i.keyCode&&(b="onCompositionStart");b&&(Bi&&"ko"!==i.locale&&(Vi||"onCompositionStart"!==b?"onCompositionEnd"===b&&Vi&&(y=ei()):(Jt="value"in(Kt=r)?Kt.value:Kt.textContent,Vi=!0)),0<(v=qn(n,b)).length&&(b=new bi(b,e,null,i,r),s.push({event:b,listeners:v}),y?b.data=y:null!==(y=ji(i))&&(b.data=y))),(y=Li?function(e,t){switch(e){case"compositionend":return ji(t);case"keypress":return 32!==t.which?null:(Ni=!0,zi);case"textInput":return(e=t.data)===zi&&Ni?null:e;default:return null}}(e,i):function(e,t){if(Vi)return"compositionend"===e||!Ii&&Fi(e,t)?(e=ei(),$t=Jt=Kt=null,Vi=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Bi&&"ko"!==t.locale?null:t.data}}(e,i))&&(0<(n=qn(n,"onBeforeInput")).length&&(r=new bi("onBeforeInput","beforeinput",null,i,r),s.push({event:r,listeners:n}),r.data=y))}Nn(s,t)}))}function Wn(e,t,i){return{instance:e,listener:t,currentTarget:i}}function qn(e,t){for(var i=t+"Capture",n=[];null!==e;){var r=e,a=r.stateNode;5===r.tag&&null!==a&&(r=a,null!=(a=Oe(e,i))&&n.unshift(Wn(e,a,r)),null!=(a=Oe(e,t))&&n.push(Wn(e,a,r))),e=e.return}return n}function Xn(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Yn(e,t,i,n,r){for(var a=t._reactName,s=[];null!==i&&i!==n;){var o=i,l=o.alternate,c=o.stateNode;if(null!==l&&l===n)break;5===o.tag&&null!==c&&(o=c,r?null!=(l=Oe(i,a))&&s.unshift(Wn(i,l,o)):r||null!=(l=Oe(i,a))&&s.push(Wn(i,l,o))),i=i.return}0!==s.length&&e.push({event:t,listeners:s})}var Qn=/\r\n?/g,Zn=/\u0000|\uFFFD/g;function Kn(e){return("string"===typeof e?e:""+e).replace(Qn,"\n").replace(Zn,"")}function Jn(e,t,i){if(t=Kn(t),Kn(e)!==t&&i)throw Error(a(425))}function $n(){}var er=null,tr=null;function ir(e,t){return"textarea"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var nr="function"===typeof setTimeout?setTimeout:void 0,rr="function"===typeof clearTimeout?clearTimeout:void 0,ar="function"===typeof Promise?Promise:void 0,sr="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof ar?function(e){return ar.resolve(null).then(e).catch(or)}:nr;function or(e){setTimeout((function(){throw e}))}function lr(e,t){var i=t,n=0;do{var r=i.nextSibling;if(e.removeChild(i),r&&8===r.nodeType)if("/$"===(i=r.data)){if(0===n)return e.removeChild(r),void Ut(t);n--}else"$"!==i&&"$?"!==i&&"$!"!==i||n++;i=r}while(i);Ut(t)}function cr(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function hr(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var i=e.data;if("$"===i||"$!"===i||"$?"===i){if(0===t)return e;t--}else"/$"===i&&t++}e=e.previousSibling}return null}var ur=Math.random().toString(36).slice(2),dr="__reactFiber$"+ur,pr="__reactProps$"+ur,fr="__reactContainer$"+ur,mr="__reactEvents$"+ur,gr="__reactListeners$"+ur,vr="__reactHandles$"+ur;function yr(e){var t=e[dr];if(t)return t;for(var i=e.parentNode;i;){if(t=i[fr]||i[dr]){if(i=t.alternate,null!==t.child||null!==i&&null!==i.child)for(e=hr(e);null!==e;){if(i=e[dr])return i;e=hr(e)}return t}i=(e=i).parentNode}return null}function br(e){return!(e=e[dr]||e[fr])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function xr(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(a(33))}function wr(e){return e[pr]||null}var _r=[],Sr=-1;function Er(e){return{current:e}}function Cr(e){0>Sr||(e.current=_r[Sr],_r[Sr]=null,Sr--)}function Ar(e,t){Sr++,_r[Sr]=e.current,e.current=t}var Mr={},Tr=Er(Mr),Pr=Er(!1),Dr=Mr;function kr(e,t){var i=e.type.contextTypes;if(!i)return Mr;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var r,a={};for(r in i)a[r]=t[r];return n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Or(e){return null!==(e=e.childContextTypes)&&void 0!==e}function Ir(){Cr(Pr),Cr(Tr)}function Rr(e,t,i){if(Tr.current!==Mr)throw Error(a(168));Ar(Tr,t),Ar(Pr,i)}function Lr(e,t,i){var n=e.stateNode;if(t=t.childContextTypes,"function"!==typeof n.getChildContext)return i;for(var r in n=n.getChildContext())if(!(r in t))throw Error(a(108,G(e)||"Unknown",r));return z({},i,n)}function Br(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Mr,Dr=Tr.current,Ar(Tr,e),Ar(Pr,Pr.current),!0}function zr(e,t,i){var n=e.stateNode;if(!n)throw Error(a(169));i?(e=Lr(e,t,Dr),n.__reactInternalMemoizedMergedChildContext=e,Cr(Pr),Cr(Tr),Ar(Tr,e)):Cr(Pr),Ar(Pr,i)}var Nr=null,Fr=!1,jr=!1;function Vr(e){null===Nr?Nr=[e]:Nr.push(e)}function Ur(){if(!jr&&null!==Nr){jr=!0;var e=0,t=bt;try{var i=Nr;for(bt=1;e<i.length;e++){var n=i[e];do{n=n(!0)}while(null!==n)}Nr=null,Fr=!1}catch(r){throw null!==Nr&&(Nr=Nr.slice(e+1)),Xe($e,Ur),r}finally{bt=t,jr=!1}}return null}var Gr=[],Hr=0,Wr=null,qr=0,Xr=[],Yr=0,Qr=null,Zr=1,Kr="";function Jr(e,t){Gr[Hr++]=qr,Gr[Hr++]=Wr,Wr=e,qr=t}function $r(e,t,i){Xr[Yr++]=Zr,Xr[Yr++]=Kr,Xr[Yr++]=Qr,Qr=e;var n=Zr;e=Kr;var r=32-st(n)-1;n&=~(1<<r),i+=1;var a=32-st(t)+r;if(30<a){var s=r-r%5;a=(n&(1<<s)-1).toString(32),n>>=s,r-=s,Zr=1<<32-st(t)+r|i<<r|n,Kr=a+e}else Zr=1<<a|i<<r|n,Kr=e}function ea(e){null!==e.return&&(Jr(e,1),$r(e,1,0))}function ta(e){for(;e===Wr;)Wr=Gr[--Hr],Gr[Hr]=null,qr=Gr[--Hr],Gr[Hr]=null;for(;e===Qr;)Qr=Xr[--Yr],Xr[Yr]=null,Kr=Xr[--Yr],Xr[Yr]=null,Zr=Xr[--Yr],Xr[Yr]=null}var ia=null,na=null,ra=!1,aa=null;function sa(e,t){var i=Oc(5,null,null,0);i.elementType="DELETED",i.stateNode=t,i.return=e,null===(t=e.deletions)?(e.deletions=[i],e.flags|=16):t.push(i)}function oa(e,t){switch(e.tag){case 5:var i=e.type;return null!==(t=1!==t.nodeType||i.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,ia=e,na=cr(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,ia=e,na=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(i=null!==Qr?{id:Zr,overflow:Kr}:null,e.memoizedState={dehydrated:t,treeContext:i,retryLane:1073741824},(i=Oc(18,null,null,0)).stateNode=t,i.return=e,e.child=i,ia=e,na=null,!0);default:return!1}}function la(e){return 0!==(1&e.mode)&&0===(128&e.flags)}function ca(e){if(ra){var t=na;if(t){var i=t;if(!oa(e,t)){if(la(e))throw Error(a(418));t=cr(i.nextSibling);var n=ia;t&&oa(e,t)?sa(n,i):(e.flags=-4097&e.flags|2,ra=!1,ia=e)}}else{if(la(e))throw Error(a(418));e.flags=-4097&e.flags|2,ra=!1,ia=e}}}function ha(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;ia=e}function ua(e){if(e!==ia)return!1;if(!ra)return ha(e),ra=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!ir(e.type,e.memoizedProps)),t&&(t=na)){if(la(e))throw da(),Error(a(418));for(;t;)sa(e,t),t=cr(t.nextSibling)}if(ha(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var i=e.data;if("/$"===i){if(0===t){na=cr(e.nextSibling);break e}t--}else"$"!==i&&"$!"!==i&&"$?"!==i||t++}e=e.nextSibling}na=null}}else na=ia?cr(e.stateNode.nextSibling):null;return!0}function da(){for(var e=na;e;)e=cr(e.nextSibling)}function pa(){na=ia=null,ra=!1}function fa(e){null===aa?aa=[e]:aa.push(e)}var ma=x.ReactCurrentBatchConfig;function ga(e,t){if(e&&e.defaultProps){for(var i in t=z({},t),e=e.defaultProps)void 0===t[i]&&(t[i]=e[i]);return t}return t}var va=Er(null),ya=null,ba=null,xa=null;function wa(){xa=ba=ya=null}function _a(e){var t=va.current;Cr(va),e._currentValue=t}function Sa(e,t,i){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==n&&(n.childLanes|=t)):null!==n&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===i)break;e=e.return}}function Ea(e,t){ya=e,xa=ba=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(xo=!0),e.firstContext=null)}function Ca(e){var t=e._currentValue;if(xa!==e)if(e={context:e,memoizedValue:t,next:null},null===ba){if(null===ya)throw Error(a(308));ba=e,ya.dependencies={lanes:0,firstContext:e}}else ba=ba.next=e;return t}var Aa=null;function Ma(e){null===Aa?Aa=[e]:Aa.push(e)}function Ta(e,t,i,n){var r=t.interleaved;return null===r?(i.next=i,Ma(t)):(i.next=r.next,r.next=i),t.interleaved=i,Pa(e,n)}function Pa(e,t){e.lanes|=t;var i=e.alternate;for(null!==i&&(i.lanes|=t),i=e,e=e.return;null!==e;)e.childLanes|=t,null!==(i=e.alternate)&&(i.childLanes|=t),i=e,e=e.return;return 3===i.tag?i.stateNode:null}var Da=!1;function ka(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Oa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ia(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ra(e,t,i){var n=e.updateQueue;if(null===n)return null;if(n=n.shared,0!==(2&Pl)){var r=n.pending;return null===r?t.next=t:(t.next=r.next,r.next=t),n.pending=t,Pa(e,i)}return null===(r=n.interleaved)?(t.next=t,Ma(n)):(t.next=r.next,r.next=t),n.interleaved=t,Pa(e,i)}function La(e,t,i){if(null!==(t=t.updateQueue)&&(t=t.shared,0!==(4194240&i))){var n=t.lanes;i|=n&=e.pendingLanes,t.lanes=i,yt(e,i)}}function Ba(e,t){var i=e.updateQueue,n=e.alternate;if(null!==n&&i===(n=n.updateQueue)){var r=null,a=null;if(null!==(i=i.firstBaseUpdate)){do{var s={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};null===a?r=a=s:a=a.next=s,i=i.next}while(null!==i);null===a?r=a=t:a=a.next=t}else r=a=t;return i={baseState:n.baseState,firstBaseUpdate:r,lastBaseUpdate:a,shared:n.shared,effects:n.effects},void(e.updateQueue=i)}null===(e=i.lastBaseUpdate)?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}function za(e,t,i,n){var r=e.updateQueue;Da=!1;var a=r.firstBaseUpdate,s=r.lastBaseUpdate,o=r.shared.pending;if(null!==o){r.shared.pending=null;var l=o,c=l.next;l.next=null,null===s?a=c:s.next=c,s=l;var h=e.alternate;null!==h&&((o=(h=h.updateQueue).lastBaseUpdate)!==s&&(null===o?h.firstBaseUpdate=c:o.next=c,h.lastBaseUpdate=l))}if(null!==a){var u=r.baseState;for(s=0,h=c=l=null,o=a;;){var d=o.lane,p=o.eventTime;if((n&d)===d){null!==h&&(h=h.next={eventTime:p,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var f=e,m=o;switch(d=t,p=i,m.tag){case 1:if("function"===typeof(f=m.payload)){u=f.call(p,u,d);break e}u=f;break e;case 3:f.flags=-65537&f.flags|128;case 0:if(null===(d="function"===typeof(f=m.payload)?f.call(p,u,d):f)||void 0===d)break e;u=z({},u,d);break e;case 2:Da=!0}}null!==o.callback&&0!==o.lane&&(e.flags|=64,null===(d=r.effects)?r.effects=[o]:d.push(o))}else p={eventTime:p,lane:d,tag:o.tag,payload:o.payload,callback:o.callback,next:null},null===h?(c=h=p,l=u):h=h.next=p,s|=d;if(null===(o=o.next)){if(null===(o=r.shared.pending))break;o=(d=o).next,d.next=null,r.lastBaseUpdate=d,r.shared.pending=null}}if(null===h&&(l=u),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=h,null!==(t=r.shared.interleaved)){r=t;do{s|=r.lane,r=r.next}while(r!==t)}else null===a&&(r.shared.lanes=0);zl|=s,e.lanes=s,e.memoizedState=u}}function Na(e,t,i){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var n=e[t],r=n.callback;if(null!==r){if(n.callback=null,n=i,"function"!==typeof r)throw Error(a(191,r));r.call(n)}}}var Fa=(new n.Component).refs;function ja(e,t,i,n){i=null===(i=i(n,t=e.memoizedState))||void 0===i?t:z({},t,i),e.memoizedState=i,0===e.lanes&&(e.updateQueue.baseState=i)}var Va={isMounted:function(e){return!!(e=e._reactInternals)&&Ue(e)===e},enqueueSetState:function(e,t,i){e=e._reactInternals;var n=tc(),r=ic(e),a=Ia(n,r);a.payload=t,void 0!==i&&null!==i&&(a.callback=i),null!==(t=Ra(e,a,r))&&(nc(t,e,r,n),La(t,e,r))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var n=tc(),r=ic(e),a=Ia(n,r);a.tag=1,a.payload=t,void 0!==i&&null!==i&&(a.callback=i),null!==(t=Ra(e,a,r))&&(nc(t,e,r,n),La(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=tc(),n=ic(e),r=Ia(i,n);r.tag=2,void 0!==t&&null!==t&&(r.callback=t),null!==(t=Ra(e,r,n))&&(nc(t,e,n,i),La(t,e,n))}};function Ua(e,t,i,n,r,a,s){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(n,a,s):!t.prototype||!t.prototype.isPureReactComponent||(!ln(i,n)||!ln(r,a))}function Ga(e,t,i){var n=!1,r=Mr,a=t.contextType;return"object"===typeof a&&null!==a?a=Ca(a):(r=Or(t)?Dr:Tr.current,a=(n=null!==(n=t.contextTypes)&&void 0!==n)?kr(e,r):Mr),t=new t(i,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=Va,e.stateNode=t,t._reactInternals=e,n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=a),t}function Ha(e,t,i,n){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(i,n),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(i,n),t.state!==e&&Va.enqueueReplaceState(t,t.state,null)}function Wa(e,t,i,n){var r=e.stateNode;r.props=i,r.state=e.memoizedState,r.refs=Fa,ka(e);var a=t.contextType;"object"===typeof a&&null!==a?r.context=Ca(a):(a=Or(t)?Dr:Tr.current,r.context=kr(e,a)),r.state=e.memoizedState,"function"===typeof(a=t.getDerivedStateFromProps)&&(ja(e,t,a,i),r.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof r.getSnapshotBeforeUpdate||"function"!==typeof r.UNSAFE_componentWillMount&&"function"!==typeof r.componentWillMount||(t=r.state,"function"===typeof r.componentWillMount&&r.componentWillMount(),"function"===typeof r.UNSAFE_componentWillMount&&r.UNSAFE_componentWillMount(),t!==r.state&&Va.enqueueReplaceState(r,r.state,null),za(e,i,r,n),r.state=e.memoizedState),"function"===typeof r.componentDidMount&&(e.flags|=4194308)}function qa(e,t,i){if(null!==(e=i.ref)&&"function"!==typeof e&&"object"!==typeof e){if(i._owner){if(i=i._owner){if(1!==i.tag)throw Error(a(309));var n=i.stateNode}if(!n)throw Error(a(147,e));var r=n,s=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===s?t.ref:(t=function(e){var t=r.refs;t===Fa&&(t=r.refs={}),null===e?delete t[s]:t[s]=e},t._stringRef=s,t)}if("string"!==typeof e)throw Error(a(284));if(!i._owner)throw Error(a(290,e))}return e}function Xa(e,t){throw e=Object.prototype.toString.call(t),Error(a(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Ya(e){return(0,e._init)(e._payload)}function Qa(e){function t(t,i){if(e){var n=t.deletions;null===n?(t.deletions=[i],t.flags|=16):n.push(i)}}function i(i,n){if(!e)return null;for(;null!==n;)t(i,n),n=n.sibling;return null}function n(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function r(e,t){return(e=Rc(e,t)).index=0,e.sibling=null,e}function s(t,i,n){return t.index=n,e?null!==(n=t.alternate)?(n=n.index)<i?(t.flags|=2,i):n:(t.flags|=2,i):(t.flags|=1048576,i)}function o(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,i,n){return null===t||6!==t.tag?((t=Nc(i,e.mode,n)).return=e,t):((t=r(t,i)).return=e,t)}function c(e,t,i,n){var a=i.type;return a===S?u(e,t,i.props.children,n,i.key):null!==t&&(t.elementType===a||"object"===typeof a&&null!==a&&a.$$typeof===O&&Ya(a)===t.type)?((n=r(t,i.props)).ref=qa(e,t,i),n.return=e,n):((n=Lc(i.type,i.key,i.props,null,e.mode,n)).ref=qa(e,t,i),n.return=e,n)}function h(e,t,i,n){return null===t||4!==t.tag||t.stateNode.containerInfo!==i.containerInfo||t.stateNode.implementation!==i.implementation?((t=Fc(i,e.mode,n)).return=e,t):((t=r(t,i.children||[])).return=e,t)}function u(e,t,i,n,a){return null===t||7!==t.tag?((t=Bc(i,e.mode,n,a)).return=e,t):((t=r(t,i)).return=e,t)}function d(e,t,i){if("string"===typeof t&&""!==t||"number"===typeof t)return(t=Nc(""+t,e.mode,i)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case w:return(i=Lc(t.type,t.key,t.props,null,e.mode,i)).ref=qa(e,null,t),i.return=e,i;case _:return(t=Fc(t,e.mode,i)).return=e,t;case O:return d(e,(0,t._init)(t._payload),i)}if(te(t)||L(t))return(t=Bc(t,e.mode,i,null)).return=e,t;Xa(e,t)}return null}function p(e,t,i,n){var r=null!==t?t.key:null;if("string"===typeof i&&""!==i||"number"===typeof i)return null!==r?null:l(e,t,""+i,n);if("object"===typeof i&&null!==i){switch(i.$$typeof){case w:return i.key===r?c(e,t,i,n):null;case _:return i.key===r?h(e,t,i,n):null;case O:return p(e,t,(r=i._init)(i._payload),n)}if(te(i)||L(i))return null!==r?null:u(e,t,i,n,null);Xa(e,i)}return null}function f(e,t,i,n,r){if("string"===typeof n&&""!==n||"number"===typeof n)return l(t,e=e.get(i)||null,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case w:return c(t,e=e.get(null===n.key?i:n.key)||null,n,r);case _:return h(t,e=e.get(null===n.key?i:n.key)||null,n,r);case O:return f(e,t,i,(0,n._init)(n._payload),r)}if(te(n)||L(n))return u(t,e=e.get(i)||null,n,r,null);Xa(t,n)}return null}function m(r,a,o,l){for(var c=null,h=null,u=a,m=a=0,g=null;null!==u&&m<o.length;m++){u.index>m?(g=u,u=null):g=u.sibling;var v=p(r,u,o[m],l);if(null===v){null===u&&(u=g);break}e&&u&&null===v.alternate&&t(r,u),a=s(v,a,m),null===h?c=v:h.sibling=v,h=v,u=g}if(m===o.length)return i(r,u),ra&&Jr(r,m),c;if(null===u){for(;m<o.length;m++)null!==(u=d(r,o[m],l))&&(a=s(u,a,m),null===h?c=u:h.sibling=u,h=u);return ra&&Jr(r,m),c}for(u=n(r,u);m<o.length;m++)null!==(g=f(u,r,m,o[m],l))&&(e&&null!==g.alternate&&u.delete(null===g.key?m:g.key),a=s(g,a,m),null===h?c=g:h.sibling=g,h=g);return e&&u.forEach((function(e){return t(r,e)})),ra&&Jr(r,m),c}function g(r,o,l,c){var h=L(l);if("function"!==typeof h)throw Error(a(150));if(null==(l=h.call(l)))throw Error(a(151));for(var u=h=null,m=o,g=o=0,v=null,y=l.next();null!==m&&!y.done;g++,y=l.next()){m.index>g?(v=m,m=null):v=m.sibling;var b=p(r,m,y.value,c);if(null===b){null===m&&(m=v);break}e&&m&&null===b.alternate&&t(r,m),o=s(b,o,g),null===u?h=b:u.sibling=b,u=b,m=v}if(y.done)return i(r,m),ra&&Jr(r,g),h;if(null===m){for(;!y.done;g++,y=l.next())null!==(y=d(r,y.value,c))&&(o=s(y,o,g),null===u?h=y:u.sibling=y,u=y);return ra&&Jr(r,g),h}for(m=n(r,m);!y.done;g++,y=l.next())null!==(y=f(m,r,g,y.value,c))&&(e&&null!==y.alternate&&m.delete(null===y.key?g:y.key),o=s(y,o,g),null===u?h=y:u.sibling=y,u=y);return e&&m.forEach((function(e){return t(r,e)})),ra&&Jr(r,g),h}return function e(n,a,s,l){if("object"===typeof s&&null!==s&&s.type===S&&null===s.key&&(s=s.props.children),"object"===typeof s&&null!==s){switch(s.$$typeof){case w:e:{for(var c=s.key,h=a;null!==h;){if(h.key===c){if((c=s.type)===S){if(7===h.tag){i(n,h.sibling),(a=r(h,s.props.children)).return=n,n=a;break e}}else if(h.elementType===c||"object"===typeof c&&null!==c&&c.$$typeof===O&&Ya(c)===h.type){i(n,h.sibling),(a=r(h,s.props)).ref=qa(n,h,s),a.return=n,n=a;break e}i(n,h);break}t(n,h),h=h.sibling}s.type===S?((a=Bc(s.props.children,n.mode,l,s.key)).return=n,n=a):((l=Lc(s.type,s.key,s.props,null,n.mode,l)).ref=qa(n,a,s),l.return=n,n=l)}return o(n);case _:e:{for(h=s.key;null!==a;){if(a.key===h){if(4===a.tag&&a.stateNode.containerInfo===s.containerInfo&&a.stateNode.implementation===s.implementation){i(n,a.sibling),(a=r(a,s.children||[])).return=n,n=a;break e}i(n,a);break}t(n,a),a=a.sibling}(a=Fc(s,n.mode,l)).return=n,n=a}return o(n);case O:return e(n,a,(h=s._init)(s._payload),l)}if(te(s))return m(n,a,s,l);if(L(s))return g(n,a,s,l);Xa(n,s)}return"string"===typeof s&&""!==s||"number"===typeof s?(s=""+s,null!==a&&6===a.tag?(i(n,a.sibling),(a=r(a,s)).return=n,n=a):(i(n,a),(a=Nc(s,n.mode,l)).return=n,n=a),o(n)):i(n,a)}}var Za=Qa(!0),Ka=Qa(!1),Ja={},$a=Er(Ja),es=Er(Ja),ts=Er(Ja);function is(e){if(e===Ja)throw Error(a(174));return e}function ns(e,t){switch(Ar(ts,t),Ar(es,e),Ar($a,Ja),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:le(null,"");break;default:t=le(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Cr($a),Ar($a,t)}function rs(){Cr($a),Cr(es),Cr(ts)}function as(e){is(ts.current);var t=is($a.current),i=le(t,e.type);t!==i&&(Ar(es,e),Ar($a,i))}function ss(e){es.current===e&&(Cr($a),Cr(es))}var os=Er(0);function ls(e){for(var t=e;null!==t;){if(13===t.tag){var i=t.memoizedState;if(null!==i&&(null===(i=i.dehydrated)||"$?"===i.data||"$!"===i.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var cs=[];function hs(){for(var e=0;e<cs.length;e++)cs[e]._workInProgressVersionPrimary=null;cs.length=0}var us=x.ReactCurrentDispatcher,ds=x.ReactCurrentBatchConfig,ps=0,fs=null,ms=null,gs=null,vs=!1,ys=!1,bs=0,xs=0;function ws(){throw Error(a(321))}function _s(e,t){if(null===t)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!on(e[i],t[i]))return!1;return!0}function Ss(e,t,i,n,r,s){if(ps=s,fs=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,us.current=null===e||null===e.memoizedState?so:oo,e=i(n,r),ys){s=0;do{if(ys=!1,bs=0,25<=s)throw Error(a(301));s+=1,gs=ms=null,t.updateQueue=null,us.current=lo,e=i(n,r)}while(ys)}if(us.current=ao,t=null!==ms&&null!==ms.next,ps=0,gs=ms=fs=null,vs=!1,t)throw Error(a(300));return e}function Es(){var e=0!==bs;return bs=0,e}function Cs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===gs?fs.memoizedState=gs=e:gs=gs.next=e,gs}function As(){if(null===ms){var e=fs.alternate;e=null!==e?e.memoizedState:null}else e=ms.next;var t=null===gs?fs.memoizedState:gs.next;if(null!==t)gs=t,ms=e;else{if(null===e)throw Error(a(310));e={memoizedState:(ms=e).memoizedState,baseState:ms.baseState,baseQueue:ms.baseQueue,queue:ms.queue,next:null},null===gs?fs.memoizedState=gs=e:gs=gs.next=e}return gs}function Ms(e,t){return"function"===typeof t?t(e):t}function Ts(e){var t=As(),i=t.queue;if(null===i)throw Error(a(311));i.lastRenderedReducer=e;var n=ms,r=n.baseQueue,s=i.pending;if(null!==s){if(null!==r){var o=r.next;r.next=s.next,s.next=o}n.baseQueue=r=s,i.pending=null}if(null!==r){s=r.next,n=n.baseState;var l=o=null,c=null,h=s;do{var u=h.lane;if((ps&u)===u)null!==c&&(c=c.next={lane:0,action:h.action,hasEagerState:h.hasEagerState,eagerState:h.eagerState,next:null}),n=h.hasEagerState?h.eagerState:e(n,h.action);else{var d={lane:u,action:h.action,hasEagerState:h.hasEagerState,eagerState:h.eagerState,next:null};null===c?(l=c=d,o=n):c=c.next=d,fs.lanes|=u,zl|=u}h=h.next}while(null!==h&&h!==s);null===c?o=n:c.next=l,on(n,t.memoizedState)||(xo=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=c,i.lastRenderedState=n}if(null!==(e=i.interleaved)){r=e;do{s=r.lane,fs.lanes|=s,zl|=s,r=r.next}while(r!==e)}else null===r&&(i.lanes=0);return[t.memoizedState,i.dispatch]}function Ps(e){var t=As(),i=t.queue;if(null===i)throw Error(a(311));i.lastRenderedReducer=e;var n=i.dispatch,r=i.pending,s=t.memoizedState;if(null!==r){i.pending=null;var o=r=r.next;do{s=e(s,o.action),o=o.next}while(o!==r);on(s,t.memoizedState)||(xo=!0),t.memoizedState=s,null===t.baseQueue&&(t.baseState=s),i.lastRenderedState=s}return[s,n]}function Ds(){}function ks(e,t){var i=fs,n=As(),r=t(),s=!on(n.memoizedState,r);if(s&&(n.memoizedState=r,xo=!0),n=n.queue,Gs(Rs.bind(null,i,n,e),[e]),n.getSnapshot!==t||s||null!==gs&&1&gs.memoizedState.tag){if(i.flags|=2048,Ns(9,Is.bind(null,i,n,r,t),void 0,null),null===Dl)throw Error(a(349));0!==(30&ps)||Os(i,t,r)}return r}function Os(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},null===(t=fs.updateQueue)?(t={lastEffect:null,stores:null},fs.updateQueue=t,t.stores=[e]):null===(i=t.stores)?t.stores=[e]:i.push(e)}function Is(e,t,i,n){t.value=i,t.getSnapshot=n,Ls(t)&&Bs(e)}function Rs(e,t,i){return i((function(){Ls(t)&&Bs(e)}))}function Ls(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!on(e,i)}catch(n){return!0}}function Bs(e){var t=Pa(e,1);null!==t&&nc(t,e,1,-1)}function zs(e){var t=Cs();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ms,lastRenderedState:e},t.queue=e,e=e.dispatch=to.bind(null,fs,e),[t.memoizedState,e]}function Ns(e,t,i,n){return e={tag:e,create:t,destroy:i,deps:n,next:null},null===(t=fs.updateQueue)?(t={lastEffect:null,stores:null},fs.updateQueue=t,t.lastEffect=e.next=e):null===(i=t.lastEffect)?t.lastEffect=e.next=e:(n=i.next,i.next=e,e.next=n,t.lastEffect=e),e}function Fs(){return As().memoizedState}function js(e,t,i,n){var r=Cs();fs.flags|=e,r.memoizedState=Ns(1|t,i,void 0,void 0===n?null:n)}function Vs(e,t,i,n){var r=As();n=void 0===n?null:n;var a=void 0;if(null!==ms){var s=ms.memoizedState;if(a=s.destroy,null!==n&&_s(n,s.deps))return void(r.memoizedState=Ns(t,i,a,n))}fs.flags|=e,r.memoizedState=Ns(1|t,i,a,n)}function Us(e,t){return js(8390656,8,e,t)}function Gs(e,t){return Vs(2048,8,e,t)}function Hs(e,t){return Vs(4,2,e,t)}function Ws(e,t){return Vs(4,4,e,t)}function qs(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Xs(e,t,i){return i=null!==i&&void 0!==i?i.concat([e]):null,Vs(4,4,qs.bind(null,t,e),i)}function Ys(){}function Qs(e,t){var i=As();t=void 0===t?null:t;var n=i.memoizedState;return null!==n&&null!==t&&_s(t,n[1])?n[0]:(i.memoizedState=[e,t],e)}function Zs(e,t){var i=As();t=void 0===t?null:t;var n=i.memoizedState;return null!==n&&null!==t&&_s(t,n[1])?n[0]:(e=e(),i.memoizedState=[e,t],e)}function Ks(e,t,i){return 0===(21&ps)?(e.baseState&&(e.baseState=!1,xo=!0),e.memoizedState=i):(on(i,t)||(i=mt(),fs.lanes|=i,zl|=i,e.baseState=!0),t)}function Js(e,t){var i=bt;bt=0!==i&&4>i?i:4,e(!0);var n=ds.transition;ds.transition={};try{e(!1),t()}finally{bt=i,ds.transition=n}}function $s(){return As().memoizedState}function eo(e,t,i){var n=ic(e);if(i={lane:n,action:i,hasEagerState:!1,eagerState:null,next:null},io(e))no(t,i);else if(null!==(i=Ta(e,t,i,n))){nc(i,e,n,tc()),ro(i,t,n)}}function to(e,t,i){var n=ic(e),r={lane:n,action:i,hasEagerState:!1,eagerState:null,next:null};if(io(e))no(t,r);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var s=t.lastRenderedState,o=a(s,i);if(r.hasEagerState=!0,r.eagerState=o,on(o,s)){var l=t.interleaved;return null===l?(r.next=r,Ma(t)):(r.next=l.next,l.next=r),void(t.interleaved=r)}}catch(c){}null!==(i=Ta(e,t,r,n))&&(nc(i,e,n,r=tc()),ro(i,t,n))}}function io(e){var t=e.alternate;return e===fs||null!==t&&t===fs}function no(e,t){ys=vs=!0;var i=e.pending;null===i?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function ro(e,t,i){if(0!==(4194240&i)){var n=t.lanes;i|=n&=e.pendingLanes,t.lanes=i,yt(e,i)}}var ao={readContext:Ca,useCallback:ws,useContext:ws,useEffect:ws,useImperativeHandle:ws,useInsertionEffect:ws,useLayoutEffect:ws,useMemo:ws,useReducer:ws,useRef:ws,useState:ws,useDebugValue:ws,useDeferredValue:ws,useTransition:ws,useMutableSource:ws,useSyncExternalStore:ws,useId:ws,unstable_isNewReconciler:!1},so={readContext:Ca,useCallback:function(e,t){return Cs().memoizedState=[e,void 0===t?null:t],e},useContext:Ca,useEffect:Us,useImperativeHandle:function(e,t,i){return i=null!==i&&void 0!==i?i.concat([e]):null,js(4194308,4,qs.bind(null,t,e),i)},useLayoutEffect:function(e,t){return js(4194308,4,e,t)},useInsertionEffect:function(e,t){return js(4,2,e,t)},useMemo:function(e,t){var i=Cs();return t=void 0===t?null:t,e=e(),i.memoizedState=[e,t],e},useReducer:function(e,t,i){var n=Cs();return t=void 0!==i?i(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=eo.bind(null,fs,e),[n.memoizedState,e]},useRef:function(e){return e={current:e},Cs().memoizedState=e},useState:zs,useDebugValue:Ys,useDeferredValue:function(e){return Cs().memoizedState=e},useTransition:function(){var e=zs(!1),t=e[0];return e=Js.bind(null,e[1]),Cs().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,i){var n=fs,r=Cs();if(ra){if(void 0===i)throw Error(a(407));i=i()}else{if(i=t(),null===Dl)throw Error(a(349));0!==(30&ps)||Os(n,t,i)}r.memoizedState=i;var s={value:i,getSnapshot:t};return r.queue=s,Us(Rs.bind(null,n,s,e),[e]),n.flags|=2048,Ns(9,Is.bind(null,n,s,i,t),void 0,null),i},useId:function(){var e=Cs(),t=Dl.identifierPrefix;if(ra){var i=Kr;t=":"+t+"R"+(i=(Zr&~(1<<32-st(Zr)-1)).toString(32)+i),0<(i=bs++)&&(t+="H"+i.toString(32)),t+=":"}else t=":"+t+"r"+(i=xs++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},oo={readContext:Ca,useCallback:Qs,useContext:Ca,useEffect:Gs,useImperativeHandle:Xs,useInsertionEffect:Hs,useLayoutEffect:Ws,useMemo:Zs,useReducer:Ts,useRef:Fs,useState:function(){return Ts(Ms)},useDebugValue:Ys,useDeferredValue:function(e){return Ks(As(),ms.memoizedState,e)},useTransition:function(){return[Ts(Ms)[0],As().memoizedState]},useMutableSource:Ds,useSyncExternalStore:ks,useId:$s,unstable_isNewReconciler:!1},lo={readContext:Ca,useCallback:Qs,useContext:Ca,useEffect:Gs,useImperativeHandle:Xs,useInsertionEffect:Hs,useLayoutEffect:Ws,useMemo:Zs,useReducer:Ps,useRef:Fs,useState:function(){return Ps(Ms)},useDebugValue:Ys,useDeferredValue:function(e){var t=As();return null===ms?t.memoizedState=e:Ks(t,ms.memoizedState,e)},useTransition:function(){return[Ps(Ms)[0],As().memoizedState]},useMutableSource:Ds,useSyncExternalStore:ks,useId:$s,unstable_isNewReconciler:!1};function co(e,t){try{var i="",n=t;do{i+=V(n),n=n.return}while(n);var r=i}catch(a){r="\nError generating stack: "+a.message+"\n"+a.stack}return{value:e,source:t,stack:r,digest:null}}function ho(e,t,i){return{value:e,source:null,stack:null!=i?i:null,digest:null!=t?t:null}}function uo(e,t){try{console.error(t.value)}catch(i){setTimeout((function(){throw i}))}}var po="function"===typeof WeakMap?WeakMap:Map;function fo(e,t,i){(i=Ia(-1,i)).tag=3,i.payload={element:null};var n=t.value;return i.callback=function(){Wl||(Wl=!0,ql=n),uo(0,t)},i}function mo(e,t,i){(i=Ia(-1,i)).tag=3;var n=e.type.getDerivedStateFromError;if("function"===typeof n){var r=t.value;i.payload=function(){return n(r)},i.callback=function(){uo(0,t)}}var a=e.stateNode;return null!==a&&"function"===typeof a.componentDidCatch&&(i.callback=function(){uo(0,t),"function"!==typeof n&&(null===Xl?Xl=new Set([this]):Xl.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),i}function go(e,t,i){var n=e.pingCache;if(null===n){n=e.pingCache=new po;var r=new Set;n.set(t,r)}else void 0===(r=n.get(t))&&(r=new Set,n.set(t,r));r.has(i)||(r.add(i),e=Ac.bind(null,e,t,i),t.then(e,e))}function vo(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function yo(e,t,i,n,r){return 0===(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,i.flags|=131072,i.flags&=-52805,1===i.tag&&(null===i.alternate?i.tag=17:((t=Ia(-1,1)).tag=2,Ra(i,t,1))),i.lanes|=1),e):(e.flags|=65536,e.lanes=r,e)}var bo=x.ReactCurrentOwner,xo=!1;function wo(e,t,i,n){t.child=null===e?Ka(t,null,i,n):Za(t,e.child,i,n)}function _o(e,t,i,n,r){i=i.render;var a=t.ref;return Ea(t,r),n=Ss(e,t,i,n,a,r),i=Es(),null===e||xo?(ra&&i&&ea(t),t.flags|=1,wo(e,t,n,r),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Wo(e,t,r))}function So(e,t,i,n,r){if(null===e){var a=i.type;return"function"!==typeof a||Ic(a)||void 0!==a.defaultProps||null!==i.compare||void 0!==i.defaultProps?((e=Lc(i.type,null,n,t,t.mode,r)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Eo(e,t,a,n,r))}if(a=e.child,0===(e.lanes&r)){var s=a.memoizedProps;if((i=null!==(i=i.compare)?i:ln)(s,n)&&e.ref===t.ref)return Wo(e,t,r)}return t.flags|=1,(e=Rc(a,n)).ref=t.ref,e.return=t,t.child=e}function Eo(e,t,i,n,r){if(null!==e){var a=e.memoizedProps;if(ln(a,n)&&e.ref===t.ref){if(xo=!1,t.pendingProps=n=a,0===(e.lanes&r))return t.lanes=e.lanes,Wo(e,t,r);0!==(131072&e.flags)&&(xo=!0)}}return Mo(e,t,i,n,r)}function Co(e,t,i){var n=t.pendingProps,r=n.children,a=null!==e?e.memoizedState:null;if("hidden"===n.mode)if(0===(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ar(Rl,Il),Il|=i;else{if(0===(1073741824&i))return e=null!==a?a.baseLanes|i:i,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ar(Rl,Il),Il|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=null!==a?a.baseLanes:i,Ar(Rl,Il),Il|=n}else null!==a?(n=a.baseLanes|i,t.memoizedState=null):n=i,Ar(Rl,Il),Il|=n;return wo(e,t,r,i),t.child}function Ao(e,t){var i=t.ref;(null===e&&null!==i||null!==e&&e.ref!==i)&&(t.flags|=512,t.flags|=2097152)}function Mo(e,t,i,n,r){var a=Or(i)?Dr:Tr.current;return a=kr(t,a),Ea(t,r),i=Ss(e,t,i,n,a,r),n=Es(),null===e||xo?(ra&&n&&ea(t),t.flags|=1,wo(e,t,i,r),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Wo(e,t,r))}function To(e,t,i,n,r){if(Or(i)){var a=!0;Br(t)}else a=!1;if(Ea(t,r),null===t.stateNode)Ho(e,t),Ga(t,i,n),Wa(t,i,n,r),n=!0;else if(null===e){var s=t.stateNode,o=t.memoizedProps;s.props=o;var l=s.context,c=i.contextType;"object"===typeof c&&null!==c?c=Ca(c):c=kr(t,c=Or(i)?Dr:Tr.current);var h=i.getDerivedStateFromProps,u="function"===typeof h||"function"===typeof s.getSnapshotBeforeUpdate;u||"function"!==typeof s.UNSAFE_componentWillReceiveProps&&"function"!==typeof s.componentWillReceiveProps||(o!==n||l!==c)&&Ha(t,s,n,c),Da=!1;var d=t.memoizedState;s.state=d,za(t,n,s,r),l=t.memoizedState,o!==n||d!==l||Pr.current||Da?("function"===typeof h&&(ja(t,i,h,n),l=t.memoizedState),(o=Da||Ua(t,i,o,n,d,l,c))?(u||"function"!==typeof s.UNSAFE_componentWillMount&&"function"!==typeof s.componentWillMount||("function"===typeof s.componentWillMount&&s.componentWillMount(),"function"===typeof s.UNSAFE_componentWillMount&&s.UNSAFE_componentWillMount()),"function"===typeof s.componentDidMount&&(t.flags|=4194308)):("function"===typeof s.componentDidMount&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=l),s.props=n,s.state=l,s.context=c,n=o):("function"===typeof s.componentDidMount&&(t.flags|=4194308),n=!1)}else{s=t.stateNode,Oa(e,t),o=t.memoizedProps,c=t.type===t.elementType?o:ga(t.type,o),s.props=c,u=t.pendingProps,d=s.context,"object"===typeof(l=i.contextType)&&null!==l?l=Ca(l):l=kr(t,l=Or(i)?Dr:Tr.current);var p=i.getDerivedStateFromProps;(h="function"===typeof p||"function"===typeof s.getSnapshotBeforeUpdate)||"function"!==typeof s.UNSAFE_componentWillReceiveProps&&"function"!==typeof s.componentWillReceiveProps||(o!==u||d!==l)&&Ha(t,s,n,l),Da=!1,d=t.memoizedState,s.state=d,za(t,n,s,r);var f=t.memoizedState;o!==u||d!==f||Pr.current||Da?("function"===typeof p&&(ja(t,i,p,n),f=t.memoizedState),(c=Da||Ua(t,i,c,n,d,f,l)||!1)?(h||"function"!==typeof s.UNSAFE_componentWillUpdate&&"function"!==typeof s.componentWillUpdate||("function"===typeof s.componentWillUpdate&&s.componentWillUpdate(n,f,l),"function"===typeof s.UNSAFE_componentWillUpdate&&s.UNSAFE_componentWillUpdate(n,f,l)),"function"===typeof s.componentDidUpdate&&(t.flags|=4),"function"===typeof s.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!==typeof s.componentDidUpdate||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!==typeof s.getSnapshotBeforeUpdate||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=f),s.props=n,s.state=f,s.context=l,n=c):("function"!==typeof s.componentDidUpdate||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!==typeof s.getSnapshotBeforeUpdate||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),n=!1)}return Po(e,t,i,n,a,r)}function Po(e,t,i,n,r,a){Ao(e,t);var s=0!==(128&t.flags);if(!n&&!s)return r&&zr(t,i,!1),Wo(e,t,a);n=t.stateNode,bo.current=t;var o=s&&"function"!==typeof i.getDerivedStateFromError?null:n.render();return t.flags|=1,null!==e&&s?(t.child=Za(t,e.child,null,a),t.child=Za(t,null,o,a)):wo(e,t,o,a),t.memoizedState=n.state,r&&zr(t,i,!0),t.child}function Do(e){var t=e.stateNode;t.pendingContext?Rr(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Rr(0,t.context,!1),ns(e,t.containerInfo)}function ko(e,t,i,n,r){return pa(),fa(r),t.flags|=256,wo(e,t,i,n),t.child}var Oo,Io,Ro,Lo,Bo={dehydrated:null,treeContext:null,retryLane:0};function zo(e){return{baseLanes:e,cachePool:null,transitions:null}}function No(e,t,i){var n,r=t.pendingProps,s=os.current,o=!1,l=0!==(128&t.flags);if((n=l)||(n=(null===e||null!==e.memoizedState)&&0!==(2&s)),n?(o=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(s|=1),Ar(os,1&s),null===e)return ca(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0===(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(l=r.children,e=r.fallback,o?(r=t.mode,o=t.child,l={mode:"hidden",children:l},0===(1&r)&&null!==o?(o.childLanes=0,o.pendingProps=l):o=zc(l,r,0,null),e=Bc(e,r,i,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=zo(i),t.memoizedState=Bo,e):Fo(t,l));if(null!==(s=e.memoizedState)&&null!==(n=s.dehydrated))return function(e,t,i,n,r,s,o){if(i)return 256&t.flags?(t.flags&=-257,jo(e,t,o,n=ho(Error(a(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(s=n.fallback,r=t.mode,n=zc({mode:"visible",children:n.children},r,0,null),(s=Bc(s,r,o,null)).flags|=2,n.return=t,s.return=t,n.sibling=s,t.child=n,0!==(1&t.mode)&&Za(t,e.child,null,o),t.child.memoizedState=zo(o),t.memoizedState=Bo,s);if(0===(1&t.mode))return jo(e,t,o,null);if("$!"===r.data){if(n=r.nextSibling&&r.nextSibling.dataset)var l=n.dgst;return n=l,jo(e,t,o,n=ho(s=Error(a(419)),n,void 0))}if(l=0!==(o&e.childLanes),xo||l){if(null!==(n=Dl)){switch(o&-o){case 4:r=2;break;case 16:r=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:r=32;break;case 536870912:r=268435456;break;default:r=0}0!==(r=0!==(r&(n.suspendedLanes|o))?0:r)&&r!==s.retryLane&&(s.retryLane=r,Pa(e,r),nc(n,e,r,-1))}return gc(),jo(e,t,o,n=ho(Error(a(421))))}return"$?"===r.data?(t.flags|=128,t.child=e.child,t=Tc.bind(null,e),r._reactRetry=t,null):(e=s.treeContext,na=cr(r.nextSibling),ia=t,ra=!0,aa=null,null!==e&&(Xr[Yr++]=Zr,Xr[Yr++]=Kr,Xr[Yr++]=Qr,Zr=e.id,Kr=e.overflow,Qr=t),t=Fo(t,n.children),t.flags|=4096,t)}(e,t,l,r,n,s,i);if(o){o=r.fallback,l=t.mode,n=(s=e.child).sibling;var c={mode:"hidden",children:r.children};return 0===(1&l)&&t.child!==s?((r=t.child).childLanes=0,r.pendingProps=c,t.deletions=null):(r=Rc(s,c)).subtreeFlags=14680064&s.subtreeFlags,null!==n?o=Rc(n,o):(o=Bc(o,l,i,null)).flags|=2,o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,l=null===(l=e.child.memoizedState)?zo(i):{baseLanes:l.baseLanes|i,cachePool:null,transitions:l.transitions},o.memoizedState=l,o.childLanes=e.childLanes&~i,t.memoizedState=Bo,r}return e=(o=e.child).sibling,r=Rc(o,{mode:"visible",children:r.children}),0===(1&t.mode)&&(r.lanes=i),r.return=t,r.sibling=null,null!==e&&(null===(i=t.deletions)?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=r,t.memoizedState=null,r}function Fo(e,t){return(t=zc({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function jo(e,t,i,n){return null!==n&&fa(n),Za(t,e.child,null,i),(e=Fo(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Vo(e,t,i){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),Sa(e.return,t,i)}function Uo(e,t,i,n,r){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:i,tailMode:r}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=i,a.tailMode=r)}function Go(e,t,i){var n=t.pendingProps,r=n.revealOrder,a=n.tail;if(wo(e,t,n.children,i),0!==(2&(n=os.current)))n=1&n|2,t.flags|=128;else{if(null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Vo(e,i,t);else if(19===e.tag)Vo(e,i,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Ar(os,n),0===(1&t.mode))t.memoizedState=null;else switch(r){case"forwards":for(i=t.child,r=null;null!==i;)null!==(e=i.alternate)&&null===ls(e)&&(r=i),i=i.sibling;null===(i=r)?(r=t.child,t.child=null):(r=i.sibling,i.sibling=null),Uo(t,!1,r,i,a);break;case"backwards":for(i=null,r=t.child,t.child=null;null!==r;){if(null!==(e=r.alternate)&&null===ls(e)){t.child=r;break}e=r.sibling,r.sibling=i,i=r,r=e}Uo(t,!0,i,null,a);break;case"together":Uo(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ho(e,t){0===(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Wo(e,t,i){if(null!==e&&(t.dependencies=e.dependencies),zl|=t.lanes,0===(i&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(i=Rc(e=t.child,e.pendingProps),t.child=i,i.return=t;null!==e.sibling;)e=e.sibling,(i=i.sibling=Rc(e,e.pendingProps)).return=t;i.sibling=null}return t.child}function qo(e,t){if(!ra)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;null!==t;)null!==t.alternate&&(i=t),t=t.sibling;null===i?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var n=null;null!==i;)null!==i.alternate&&(n=i),i=i.sibling;null===n?t||null===e.tail?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Xo(e){var t=null!==e.alternate&&e.alternate.child===e.child,i=0,n=0;if(t)for(var r=e.child;null!==r;)i|=r.lanes|r.childLanes,n|=14680064&r.subtreeFlags,n|=14680064&r.flags,r.return=e,r=r.sibling;else for(r=e.child;null!==r;)i|=r.lanes|r.childLanes,n|=r.subtreeFlags,n|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=n,e.childLanes=i,t}function Yo(e,t,i){var n=t.pendingProps;switch(ta(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xo(t),null;case 1:case 17:return Or(t.type)&&Ir(),Xo(t),null;case 3:return n=t.stateNode,rs(),Cr(Pr),Cr(Tr),hs(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(ua(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,null!==aa&&(oc(aa),aa=null))),Io(e,t),Xo(t),null;case 5:ss(t);var r=is(ts.current);if(i=t.type,null!==e&&null!=t.stateNode)Ro(e,t,i,n,r),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(null===t.stateNode)throw Error(a(166));return Xo(t),null}if(e=is($a.current),ua(t)){n=t.stateNode,i=t.type;var s=t.memoizedProps;switch(n[dr]=t,n[pr]=s,e=0!==(1&t.mode),i){case"dialog":Fn("cancel",n),Fn("close",n);break;case"iframe":case"object":case"embed":Fn("load",n);break;case"video":case"audio":for(r=0;r<Ln.length;r++)Fn(Ln[r],n);break;case"source":Fn("error",n);break;case"img":case"image":case"link":Fn("error",n),Fn("load",n);break;case"details":Fn("toggle",n);break;case"input":Z(n,s),Fn("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!s.multiple},Fn("invalid",n);break;case"textarea":re(n,s),Fn("invalid",n)}for(var l in ye(i,s),r=null,s)if(s.hasOwnProperty(l)){var c=s[l];"children"===l?"string"===typeof c?n.textContent!==c&&(!0!==s.suppressHydrationWarning&&Jn(n.textContent,c,e),r=["children",c]):"number"===typeof c&&n.textContent!==""+c&&(!0!==s.suppressHydrationWarning&&Jn(n.textContent,c,e),r=["children",""+c]):o.hasOwnProperty(l)&&null!=c&&"onScroll"===l&&Fn("scroll",n)}switch(i){case"input":q(n),$(n,s,!0);break;case"textarea":q(n),se(n);break;case"select":case"option":break;default:"function"===typeof s.onClick&&(n.onclick=$n)}n=r,t.updateQueue=n,null!==n&&(t.flags|=4)}else{l=9===r.nodeType?r:r.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=oe(i)),"http://www.w3.org/1999/xhtml"===e?"script"===i?((e=l.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"===typeof n.is?e=l.createElement(i,{is:n.is}):(e=l.createElement(i),"select"===i&&(l=e,n.multiple?l.multiple=!0:n.size&&(l.size=n.size))):e=l.createElementNS(e,i),e[dr]=t,e[pr]=n,Oo(e,t,!1,!1),t.stateNode=e;e:{switch(l=be(i,n),i){case"dialog":Fn("cancel",e),Fn("close",e),r=n;break;case"iframe":case"object":case"embed":Fn("load",e),r=n;break;case"video":case"audio":for(r=0;r<Ln.length;r++)Fn(Ln[r],e);r=n;break;case"source":Fn("error",e),r=n;break;case"img":case"image":case"link":Fn("error",e),Fn("load",e),r=n;break;case"details":Fn("toggle",e),r=n;break;case"input":Z(e,n),r=Q(e,n),Fn("invalid",e);break;case"option":default:r=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},r=z({},n,{value:void 0}),Fn("invalid",e);break;case"textarea":re(e,n),r=ne(e,n),Fn("invalid",e)}for(s in ye(i,r),c=r)if(c.hasOwnProperty(s)){var h=c[s];"style"===s?ge(e,h):"dangerouslySetInnerHTML"===s?null!=(h=h?h.__html:void 0)&&ue(e,h):"children"===s?"string"===typeof h?("textarea"!==i||""!==h)&&de(e,h):"number"===typeof h&&de(e,""+h):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(o.hasOwnProperty(s)?null!=h&&"onScroll"===s&&Fn("scroll",e):null!=h&&b(e,s,h,l))}switch(i){case"input":q(e),$(e,n,!1);break;case"textarea":q(e),se(e);break;case"option":null!=n.value&&e.setAttribute("value",""+H(n.value));break;case"select":e.multiple=!!n.multiple,null!=(s=n.value)?ie(e,!!n.multiple,s,!1):null!=n.defaultValue&&ie(e,!!n.multiple,n.defaultValue,!0);break;default:"function"===typeof r.onClick&&(e.onclick=$n)}switch(i){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Xo(t),null;case 6:if(e&&null!=t.stateNode)Lo(e,t,e.memoizedProps,n);else{if("string"!==typeof n&&null===t.stateNode)throw Error(a(166));if(i=is(ts.current),is($a.current),ua(t)){if(n=t.stateNode,i=t.memoizedProps,n[dr]=t,(s=n.nodeValue!==i)&&null!==(e=ia))switch(e.tag){case 3:Jn(n.nodeValue,i,0!==(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Jn(n.nodeValue,i,0!==(1&e.mode))}s&&(t.flags|=4)}else(n=(9===i.nodeType?i:i.ownerDocument).createTextNode(n))[dr]=t,t.stateNode=n}return Xo(t),null;case 13:if(Cr(os),n=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(ra&&null!==na&&0!==(1&t.mode)&&0===(128&t.flags))da(),pa(),t.flags|=98560,s=!1;else if(s=ua(t),null!==n&&null!==n.dehydrated){if(null===e){if(!s)throw Error(a(318));if(!(s=null!==(s=t.memoizedState)?s.dehydrated:null))throw Error(a(317));s[dr]=t}else pa(),0===(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Xo(t),s=!1}else null!==aa&&(oc(aa),aa=null),s=!0;if(!s)return 65536&t.flags?t:null}return 0!==(128&t.flags)?(t.lanes=i,t):((n=null!==n)!==(null!==e&&null!==e.memoizedState)&&n&&(t.child.flags|=8192,0!==(1&t.mode)&&(null===e||0!==(1&os.current)?0===Ll&&(Ll=3):gc())),null!==t.updateQueue&&(t.flags|=4),Xo(t),null);case 4:return rs(),Io(e,t),null===e&&Un(t.stateNode.containerInfo),Xo(t),null;case 10:return _a(t.type._context),Xo(t),null;case 19:if(Cr(os),null===(s=t.memoizedState))return Xo(t),null;if(n=0!==(128&t.flags),null===(l=s.rendering))if(n)qo(s,!1);else{if(0!==Ll||null!==e&&0!==(128&e.flags))for(e=t.child;null!==e;){if(null!==(l=ls(e))){for(t.flags|=128,qo(s,!1),null!==(n=l.updateQueue)&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=i,i=t.child;null!==i;)e=n,(s=i).flags&=14680066,null===(l=s.alternate)?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=l.childLanes,s.lanes=l.lanes,s.child=l.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=l.memoizedProps,s.memoizedState=l.memoizedState,s.updateQueue=l.updateQueue,s.type=l.type,e=l.dependencies,s.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),i=i.sibling;return Ar(os,1&os.current|2),t.child}e=e.sibling}null!==s.tail&&Ke()>Gl&&(t.flags|=128,n=!0,qo(s,!1),t.lanes=4194304)}else{if(!n)if(null!==(e=ls(l))){if(t.flags|=128,n=!0,null!==(i=e.updateQueue)&&(t.updateQueue=i,t.flags|=4),qo(s,!0),null===s.tail&&"hidden"===s.tailMode&&!l.alternate&&!ra)return Xo(t),null}else 2*Ke()-s.renderingStartTime>Gl&&1073741824!==i&&(t.flags|=128,n=!0,qo(s,!1),t.lanes=4194304);s.isBackwards?(l.sibling=t.child,t.child=l):(null!==(i=s.last)?i.sibling=l:t.child=l,s.last=l)}return null!==s.tail?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Ke(),t.sibling=null,i=os.current,Ar(os,n?1&i|2:1&i),t):(Xo(t),null);case 22:case 23:return dc(),n=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==n&&(t.flags|=8192),n&&0!==(1&t.mode)?0!==(1073741824&Il)&&(Xo(t),6&t.subtreeFlags&&(t.flags|=8192)):Xo(t),null;case 24:case 25:return null}throw Error(a(156,t.tag))}function Qo(e,t){switch(ta(t),t.tag){case 1:return Or(t.type)&&Ir(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return rs(),Cr(Pr),Cr(Tr),hs(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 5:return ss(t),null;case 13:if(Cr(os),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(a(340));pa()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Cr(os),null;case 4:return rs(),null;case 10:return _a(t.type._context),null;case 22:case 23:return dc(),null;default:return null}}Oo=function(e,t){for(var i=t.child;null!==i;){if(5===i.tag||6===i.tag)e.appendChild(i.stateNode);else if(4!==i.tag&&null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},Io=function(){},Ro=function(e,t,i,n){var r=e.memoizedProps;if(r!==n){e=t.stateNode,is($a.current);var a,s=null;switch(i){case"input":r=Q(e,r),n=Q(e,n),s=[];break;case"select":r=z({},r,{value:void 0}),n=z({},n,{value:void 0}),s=[];break;case"textarea":r=ne(e,r),n=ne(e,n),s=[];break;default:"function"!==typeof r.onClick&&"function"===typeof n.onClick&&(e.onclick=$n)}for(h in ye(i,n),i=null,r)if(!n.hasOwnProperty(h)&&r.hasOwnProperty(h)&&null!=r[h])if("style"===h){var l=r[h];for(a in l)l.hasOwnProperty(a)&&(i||(i={}),i[a]="")}else"dangerouslySetInnerHTML"!==h&&"children"!==h&&"suppressContentEditableWarning"!==h&&"suppressHydrationWarning"!==h&&"autoFocus"!==h&&(o.hasOwnProperty(h)?s||(s=[]):(s=s||[]).push(h,null));for(h in n){var c=n[h];if(l=null!=r?r[h]:void 0,n.hasOwnProperty(h)&&c!==l&&(null!=c||null!=l))if("style"===h)if(l){for(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(i||(i={}),i[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(i||(i={}),i[a]=c[a])}else i||(s||(s=[]),s.push(h,i)),i=c;else"dangerouslySetInnerHTML"===h?(c=c?c.__html:void 0,l=l?l.__html:void 0,null!=c&&l!==c&&(s=s||[]).push(h,c)):"children"===h?"string"!==typeof c&&"number"!==typeof c||(s=s||[]).push(h,""+c):"suppressContentEditableWarning"!==h&&"suppressHydrationWarning"!==h&&(o.hasOwnProperty(h)?(null!=c&&"onScroll"===h&&Fn("scroll",e),s||l===c||(s=[])):(s=s||[]).push(h,c))}i&&(s=s||[]).push("style",i);var h=s;(t.updateQueue=h)&&(t.flags|=4)}},Lo=function(e,t,i,n){i!==n&&(t.flags|=4)};var Zo=!1,Ko=!1,Jo="function"===typeof WeakSet?WeakSet:Set,$o=null;function el(e,t){var i=e.ref;if(null!==i)if("function"===typeof i)try{i(null)}catch(n){Cc(e,t,n)}else i.current=null}function tl(e,t,i){try{i()}catch(n){Cc(e,t,n)}}var il=!1;function nl(e,t,i){var n=t.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var r=n=n.next;do{if((r.tag&e)===e){var a=r.destroy;r.destroy=void 0,void 0!==a&&tl(t,i,a)}r=r.next}while(r!==n)}}function rl(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var i=t=t.next;do{if((i.tag&e)===e){var n=i.create;i.destroy=n()}i=i.next}while(i!==t)}}function al(e){var t=e.ref;if(null!==t){var i=e.stateNode;e.tag,e=i,"function"===typeof t?t(e):t.current=e}}function sl(e){var t=e.alternate;null!==t&&(e.alternate=null,sl(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[dr],delete t[pr],delete t[mr],delete t[gr],delete t[vr])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ol(e){return 5===e.tag||3===e.tag||4===e.tag}function ll(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||ol(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function cl(e,t,i){var n=e.tag;if(5===n||6===n)e=e.stateNode,t?8===i.nodeType?i.parentNode.insertBefore(e,t):i.insertBefore(e,t):(8===i.nodeType?(t=i.parentNode).insertBefore(e,i):(t=i).appendChild(e),null!==(i=i._reactRootContainer)&&void 0!==i||null!==t.onclick||(t.onclick=$n));else if(4!==n&&null!==(e=e.child))for(cl(e,t,i),e=e.sibling;null!==e;)cl(e,t,i),e=e.sibling}function hl(e,t,i){var n=e.tag;if(5===n||6===n)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(4!==n&&null!==(e=e.child))for(hl(e,t,i),e=e.sibling;null!==e;)hl(e,t,i),e=e.sibling}var ul=null,dl=!1;function pl(e,t,i){for(i=i.child;null!==i;)fl(e,t,i),i=i.sibling}function fl(e,t,i){if(at&&"function"===typeof at.onCommitFiberUnmount)try{at.onCommitFiberUnmount(rt,i)}catch(o){}switch(i.tag){case 5:Ko||el(i,t);case 6:var n=ul,r=dl;ul=null,pl(e,t,i),dl=r,null!==(ul=n)&&(dl?(e=ul,i=i.stateNode,8===e.nodeType?e.parentNode.removeChild(i):e.removeChild(i)):ul.removeChild(i.stateNode));break;case 18:null!==ul&&(dl?(e=ul,i=i.stateNode,8===e.nodeType?lr(e.parentNode,i):1===e.nodeType&&lr(e,i),Ut(e)):lr(ul,i.stateNode));break;case 4:n=ul,r=dl,ul=i.stateNode.containerInfo,dl=!0,pl(e,t,i),ul=n,dl=r;break;case 0:case 11:case 14:case 15:if(!Ko&&(null!==(n=i.updateQueue)&&null!==(n=n.lastEffect))){r=n=n.next;do{var a=r,s=a.destroy;a=a.tag,void 0!==s&&(0!==(2&a)||0!==(4&a))&&tl(i,t,s),r=r.next}while(r!==n)}pl(e,t,i);break;case 1:if(!Ko&&(el(i,t),"function"===typeof(n=i.stateNode).componentWillUnmount))try{n.props=i.memoizedProps,n.state=i.memoizedState,n.componentWillUnmount()}catch(o){Cc(i,t,o)}pl(e,t,i);break;case 21:pl(e,t,i);break;case 22:1&i.mode?(Ko=(n=Ko)||null!==i.memoizedState,pl(e,t,i),Ko=n):pl(e,t,i);break;default:pl(e,t,i)}}function ml(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var i=e.stateNode;null===i&&(i=e.stateNode=new Jo),t.forEach((function(t){var n=Pc.bind(null,e,t);i.has(t)||(i.add(t),t.then(n,n))}))}}function gl(e,t){var i=t.deletions;if(null!==i)for(var n=0;n<i.length;n++){var r=i[n];try{var s=e,o=t,l=o;e:for(;null!==l;){switch(l.tag){case 5:ul=l.stateNode,dl=!1;break e;case 3:case 4:ul=l.stateNode.containerInfo,dl=!0;break e}l=l.return}if(null===ul)throw Error(a(160));fl(s,o,r),ul=null,dl=!1;var c=r.alternate;null!==c&&(c.return=null),r.return=null}catch(h){Cc(r,t,h)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)vl(t,e),t=t.sibling}function vl(e,t){var i=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(gl(t,e),yl(e),4&n){try{nl(3,e,e.return),rl(3,e)}catch(g){Cc(e,e.return,g)}try{nl(5,e,e.return)}catch(g){Cc(e,e.return,g)}}break;case 1:gl(t,e),yl(e),512&n&&null!==i&&el(i,i.return);break;case 5:if(gl(t,e),yl(e),512&n&&null!==i&&el(i,i.return),32&e.flags){var r=e.stateNode;try{de(r,"")}catch(g){Cc(e,e.return,g)}}if(4&n&&null!=(r=e.stateNode)){var s=e.memoizedProps,o=null!==i?i.memoizedProps:s,l=e.type,c=e.updateQueue;if(e.updateQueue=null,null!==c)try{"input"===l&&"radio"===s.type&&null!=s.name&&K(r,s),be(l,o);var h=be(l,s);for(o=0;o<c.length;o+=2){var u=c[o],d=c[o+1];"style"===u?ge(r,d):"dangerouslySetInnerHTML"===u?ue(r,d):"children"===u?de(r,d):b(r,u,d,h)}switch(l){case"input":J(r,s);break;case"textarea":ae(r,s);break;case"select":var p=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!s.multiple;var f=s.value;null!=f?ie(r,!!s.multiple,f,!1):p!==!!s.multiple&&(null!=s.defaultValue?ie(r,!!s.multiple,s.defaultValue,!0):ie(r,!!s.multiple,s.multiple?[]:"",!1))}r[pr]=s}catch(g){Cc(e,e.return,g)}}break;case 6:if(gl(t,e),yl(e),4&n){if(null===e.stateNode)throw Error(a(162));r=e.stateNode,s=e.memoizedProps;try{r.nodeValue=s}catch(g){Cc(e,e.return,g)}}break;case 3:if(gl(t,e),yl(e),4&n&&null!==i&&i.memoizedState.isDehydrated)try{Ut(t.containerInfo)}catch(g){Cc(e,e.return,g)}break;case 4:default:gl(t,e),yl(e);break;case 13:gl(t,e),yl(e),8192&(r=e.child).flags&&(s=null!==r.memoizedState,r.stateNode.isHidden=s,!s||null!==r.alternate&&null!==r.alternate.memoizedState||(Ul=Ke())),4&n&&ml(e);break;case 22:if(u=null!==i&&null!==i.memoizedState,1&e.mode?(Ko=(h=Ko)||u,gl(t,e),Ko=h):gl(t,e),yl(e),8192&n){if(h=null!==e.memoizedState,(e.stateNode.isHidden=h)&&!u&&0!==(1&e.mode))for($o=e,u=e.child;null!==u;){for(d=$o=u;null!==$o;){switch(f=(p=$o).child,p.tag){case 0:case 11:case 14:case 15:nl(4,p,p.return);break;case 1:el(p,p.return);var m=p.stateNode;if("function"===typeof m.componentWillUnmount){n=p,i=p.return;try{t=n,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){Cc(n,i,g)}}break;case 5:el(p,p.return);break;case 22:if(null!==p.memoizedState){_l(d);continue}}null!==f?(f.return=p,$o=f):_l(d)}u=u.sibling}e:for(u=null,d=e;;){if(5===d.tag){if(null===u){u=d;try{r=d.stateNode,h?"function"===typeof(s=r.style).setProperty?s.setProperty("display","none","important"):s.display="none":(l=d.stateNode,o=void 0!==(c=d.memoizedProps.style)&&null!==c&&c.hasOwnProperty("display")?c.display:null,l.style.display=me("display",o))}catch(g){Cc(e,e.return,g)}}}else if(6===d.tag){if(null===u)try{d.stateNode.nodeValue=h?"":d.memoizedProps}catch(g){Cc(e,e.return,g)}}else if((22!==d.tag&&23!==d.tag||null===d.memoizedState||d===e)&&null!==d.child){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;null===d.sibling;){if(null===d.return||d.return===e)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:gl(t,e),yl(e),4&n&&ml(e);case 21:}}function yl(e){var t=e.flags;if(2&t){try{e:{for(var i=e.return;null!==i;){if(ol(i)){var n=i;break e}i=i.return}throw Error(a(160))}switch(n.tag){case 5:var r=n.stateNode;32&n.flags&&(de(r,""),n.flags&=-33),hl(e,ll(e),r);break;case 3:case 4:var s=n.stateNode.containerInfo;cl(e,ll(e),s);break;default:throw Error(a(161))}}catch(o){Cc(e,e.return,o)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function bl(e,t,i){$o=e,xl(e,t,i)}function xl(e,t,i){for(var n=0!==(1&e.mode);null!==$o;){var r=$o,a=r.child;if(22===r.tag&&n){var s=null!==r.memoizedState||Zo;if(!s){var o=r.alternate,l=null!==o&&null!==o.memoizedState||Ko;o=Zo;var c=Ko;if(Zo=s,(Ko=l)&&!c)for($o=r;null!==$o;)l=(s=$o).child,22===s.tag&&null!==s.memoizedState?Sl(r):null!==l?(l.return=s,$o=l):Sl(r);for(;null!==a;)$o=a,xl(a,t,i),a=a.sibling;$o=r,Zo=o,Ko=c}wl(e)}else 0!==(8772&r.subtreeFlags)&&null!==a?(a.return=r,$o=a):wl(e)}}function wl(e){for(;null!==$o;){var t=$o;if(0!==(8772&t.flags)){var i=t.alternate;try{if(0!==(8772&t.flags))switch(t.tag){case 0:case 11:case 15:Ko||rl(5,t);break;case 1:var n=t.stateNode;if(4&t.flags&&!Ko)if(null===i)n.componentDidMount();else{var r=t.elementType===t.type?i.memoizedProps:ga(t.type,i.memoizedProps);n.componentDidUpdate(r,i.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;null!==s&&Na(t,s,n);break;case 3:var o=t.updateQueue;if(null!==o){if(i=null,null!==t.child)switch(t.child.tag){case 5:case 1:i=t.child.stateNode}Na(t,o,i)}break;case 5:var l=t.stateNode;if(null===i&&4&t.flags){i=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&i.focus();break;case"img":c.src&&(i.src=c.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var h=t.alternate;if(null!==h){var u=h.memoizedState;if(null!==u){var d=u.dehydrated;null!==d&&Ut(d)}}}break;default:throw Error(a(163))}Ko||512&t.flags&&al(t)}catch(p){Cc(t,t.return,p)}}if(t===e){$o=null;break}if(null!==(i=t.sibling)){i.return=t.return,$o=i;break}$o=t.return}}function _l(e){for(;null!==$o;){var t=$o;if(t===e){$o=null;break}var i=t.sibling;if(null!==i){i.return=t.return,$o=i;break}$o=t.return}}function Sl(e){for(;null!==$o;){var t=$o;try{switch(t.tag){case 0:case 11:case 15:var i=t.return;try{rl(4,t)}catch(l){Cc(t,i,l)}break;case 1:var n=t.stateNode;if("function"===typeof n.componentDidMount){var r=t.return;try{n.componentDidMount()}catch(l){Cc(t,r,l)}}var a=t.return;try{al(t)}catch(l){Cc(t,a,l)}break;case 5:var s=t.return;try{al(t)}catch(l){Cc(t,s,l)}}}catch(l){Cc(t,t.return,l)}if(t===e){$o=null;break}var o=t.sibling;if(null!==o){o.return=t.return,$o=o;break}$o=t.return}}var El,Cl=Math.ceil,Al=x.ReactCurrentDispatcher,Ml=x.ReactCurrentOwner,Tl=x.ReactCurrentBatchConfig,Pl=0,Dl=null,kl=null,Ol=0,Il=0,Rl=Er(0),Ll=0,Bl=null,zl=0,Nl=0,Fl=0,jl=null,Vl=null,Ul=0,Gl=1/0,Hl=null,Wl=!1,ql=null,Xl=null,Yl=!1,Ql=null,Zl=0,Kl=0,Jl=null,$l=-1,ec=0;function tc(){return 0!==(6&Pl)?Ke():-1!==$l?$l:$l=Ke()}function ic(e){return 0===(1&e.mode)?1:0!==(2&Pl)&&0!==Ol?Ol&-Ol:null!==ma.transition?(0===ec&&(ec=mt()),ec):0!==(e=bt)?e:e=void 0===(e=window.event)?16:Zt(e.type)}function nc(e,t,i,n){if(50<Kl)throw Kl=0,Jl=null,Error(a(185));vt(e,i,n),0!==(2&Pl)&&e===Dl||(e===Dl&&(0===(2&Pl)&&(Nl|=i),4===Ll&&lc(e,Ol)),rc(e,n),1===i&&0===Pl&&0===(1&t.mode)&&(Gl=Ke()+500,Fr&&Ur()))}function rc(e,t){var i=e.callbackNode;!function(e,t){for(var i=e.suspendedLanes,n=e.pingedLanes,r=e.expirationTimes,a=e.pendingLanes;0<a;){var s=31-st(a),o=1<<s,l=r[s];-1===l?0!==(o&i)&&0===(o&n)||(r[s]=pt(o,t)):l<=t&&(e.expiredLanes|=o),a&=~o}}(e,t);var n=dt(e,e===Dl?Ol:0);if(0===n)null!==i&&Ye(i),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(null!=i&&Ye(i),1===t)0===e.tag?function(e){Fr=!0,Vr(e)}(cc.bind(null,e)):Vr(cc.bind(null,e)),sr((function(){0===(6&Pl)&&Ur()})),i=null;else{switch(xt(n)){case 1:i=$e;break;case 4:i=et;break;case 16:default:i=tt;break;case 536870912:i=nt}i=Dc(i,ac.bind(null,e))}e.callbackPriority=t,e.callbackNode=i}}function ac(e,t){if($l=-1,ec=0,0!==(6&Pl))throw Error(a(327));var i=e.callbackNode;if(Sc()&&e.callbackNode!==i)return null;var n=dt(e,e===Dl?Ol:0);if(0===n)return null;if(0!==(30&n)||0!==(n&e.expiredLanes)||t)t=vc(e,n);else{t=n;var r=Pl;Pl|=2;var s=mc();for(Dl===e&&Ol===t||(Hl=null,Gl=Ke()+500,pc(e,t));;)try{bc();break}catch(l){fc(e,l)}wa(),Al.current=s,Pl=r,null!==kl?t=0:(Dl=null,Ol=0,t=Ll)}if(0!==t){if(2===t&&(0!==(r=ft(e))&&(n=r,t=sc(e,r))),1===t)throw i=Bl,pc(e,0),lc(e,n),rc(e,Ke()),i;if(6===t)lc(e,n);else{if(r=e.current.alternate,0===(30&n)&&!function(e){for(var t=e;;){if(16384&t.flags){var i=t.updateQueue;if(null!==i&&null!==(i=i.stores))for(var n=0;n<i.length;n++){var r=i[n],a=r.getSnapshot;r=r.value;try{if(!on(a(),r))return!1}catch(o){return!1}}}if(i=t.child,16384&t.subtreeFlags&&null!==i)i.return=t,t=i;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(r)&&(2===(t=vc(e,n))&&(0!==(s=ft(e))&&(n=s,t=sc(e,s))),1===t))throw i=Bl,pc(e,0),lc(e,n),rc(e,Ke()),i;switch(e.finishedWork=r,e.finishedLanes=n,t){case 0:case 1:throw Error(a(345));case 2:case 5:_c(e,Vl,Hl);break;case 3:if(lc(e,n),(130023424&n)===n&&10<(t=Ul+500-Ke())){if(0!==dt(e,0))break;if(((r=e.suspendedLanes)&n)!==n){tc(),e.pingedLanes|=e.suspendedLanes&r;break}e.timeoutHandle=nr(_c.bind(null,e,Vl,Hl),t);break}_c(e,Vl,Hl);break;case 4:if(lc(e,n),(4194240&n)===n)break;for(t=e.eventTimes,r=-1;0<n;){var o=31-st(n);s=1<<o,(o=t[o])>r&&(r=o),n&=~s}if(n=r,10<(n=(120>(n=Ke()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Cl(n/1960))-n)){e.timeoutHandle=nr(_c.bind(null,e,Vl,Hl),n);break}_c(e,Vl,Hl);break;default:throw Error(a(329))}}}return rc(e,Ke()),e.callbackNode===i?ac.bind(null,e):null}function sc(e,t){var i=jl;return e.current.memoizedState.isDehydrated&&(pc(e,t).flags|=256),2!==(e=vc(e,t))&&(t=Vl,Vl=i,null!==t&&oc(t)),e}function oc(e){null===Vl?Vl=e:Vl.push.apply(Vl,e)}function lc(e,t){for(t&=~Fl,t&=~Nl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var i=31-st(t),n=1<<i;e[i]=-1,t&=~n}}function cc(e){if(0!==(6&Pl))throw Error(a(327));Sc();var t=dt(e,0);if(0===(1&t))return rc(e,Ke()),null;var i=vc(e,t);if(0!==e.tag&&2===i){var n=ft(e);0!==n&&(t=n,i=sc(e,n))}if(1===i)throw i=Bl,pc(e,0),lc(e,t),rc(e,Ke()),i;if(6===i)throw Error(a(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,_c(e,Vl,Hl),rc(e,Ke()),null}function hc(e,t){var i=Pl;Pl|=1;try{return e(t)}finally{0===(Pl=i)&&(Gl=Ke()+500,Fr&&Ur())}}function uc(e){null!==Ql&&0===Ql.tag&&0===(6&Pl)&&Sc();var t=Pl;Pl|=1;var i=Tl.transition,n=bt;try{if(Tl.transition=null,bt=1,e)return e()}finally{bt=n,Tl.transition=i,0===(6&(Pl=t))&&Ur()}}function dc(){Il=Rl.current,Cr(Rl)}function pc(e,t){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(-1!==i&&(e.timeoutHandle=-1,rr(i)),null!==kl)for(i=kl.return;null!==i;){var n=i;switch(ta(n),n.tag){case 1:null!==(n=n.type.childContextTypes)&&void 0!==n&&Ir();break;case 3:rs(),Cr(Pr),Cr(Tr),hs();break;case 5:ss(n);break;case 4:rs();break;case 13:case 19:Cr(os);break;case 10:_a(n.type._context);break;case 22:case 23:dc()}i=i.return}if(Dl=e,kl=e=Rc(e.current,null),Ol=Il=t,Ll=0,Bl=null,Fl=Nl=zl=0,Vl=jl=null,null!==Aa){for(t=0;t<Aa.length;t++)if(null!==(n=(i=Aa[t]).interleaved)){i.interleaved=null;var r=n.next,a=i.pending;if(null!==a){var s=a.next;a.next=r,n.next=s}i.pending=n}Aa=null}return e}function fc(e,t){for(;;){var i=kl;try{if(wa(),us.current=ao,vs){for(var n=fs.memoizedState;null!==n;){var r=n.queue;null!==r&&(r.pending=null),n=n.next}vs=!1}if(ps=0,gs=ms=fs=null,ys=!1,bs=0,Ml.current=null,null===i||null===i.return){Ll=1,Bl=t,kl=null;break}e:{var s=e,o=i.return,l=i,c=t;if(t=Ol,l.flags|=32768,null!==c&&"object"===typeof c&&"function"===typeof c.then){var h=c,u=l,d=u.tag;if(0===(1&u.mode)&&(0===d||11===d||15===d)){var p=u.alternate;p?(u.updateQueue=p.updateQueue,u.memoizedState=p.memoizedState,u.lanes=p.lanes):(u.updateQueue=null,u.memoizedState=null)}var f=vo(o);if(null!==f){f.flags&=-257,yo(f,o,l,0,t),1&f.mode&&go(s,h,t),c=h;var m=(t=f).updateQueue;if(null===m){var g=new Set;g.add(c),t.updateQueue=g}else m.add(c);break e}if(0===(1&t)){go(s,h,t),gc();break e}c=Error(a(426))}else if(ra&&1&l.mode){var v=vo(o);if(null!==v){0===(65536&v.flags)&&(v.flags|=256),yo(v,o,l,0,t),fa(co(c,l));break e}}s=c=co(c,l),4!==Ll&&(Ll=2),null===jl?jl=[s]:jl.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t,Ba(s,fo(0,c,t));break e;case 1:l=c;var y=s.type,b=s.stateNode;if(0===(128&s.flags)&&("function"===typeof y.getDerivedStateFromError||null!==b&&"function"===typeof b.componentDidCatch&&(null===Xl||!Xl.has(b)))){s.flags|=65536,t&=-t,s.lanes|=t,Ba(s,mo(s,l,t));break e}}s=s.return}while(null!==s)}wc(i)}catch(x){t=x,kl===i&&null!==i&&(kl=i=i.return);continue}break}}function mc(){var e=Al.current;return Al.current=ao,null===e?ao:e}function gc(){0!==Ll&&3!==Ll&&2!==Ll||(Ll=4),null===Dl||0===(268435455&zl)&&0===(268435455&Nl)||lc(Dl,Ol)}function vc(e,t){var i=Pl;Pl|=2;var n=mc();for(Dl===e&&Ol===t||(Hl=null,pc(e,t));;)try{yc();break}catch(r){fc(e,r)}if(wa(),Pl=i,Al.current=n,null!==kl)throw Error(a(261));return Dl=null,Ol=0,Ll}function yc(){for(;null!==kl;)xc(kl)}function bc(){for(;null!==kl&&!Qe();)xc(kl)}function xc(e){var t=El(e.alternate,e,Il);e.memoizedProps=e.pendingProps,null===t?wc(e):kl=t,Ml.current=null}function wc(e){var t=e;do{var i=t.alternate;if(e=t.return,0===(32768&t.flags)){if(null!==(i=Yo(i,t,Il)))return void(kl=i)}else{if(null!==(i=Qo(i,t)))return i.flags&=32767,void(kl=i);if(null===e)return Ll=6,void(kl=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}if(null!==(t=t.sibling))return void(kl=t);kl=t=e}while(null!==t);0===Ll&&(Ll=5)}function _c(e,t,i){var n=bt,r=Tl.transition;try{Tl.transition=null,bt=1,function(e,t,i,n){do{Sc()}while(null!==Ql);if(0!==(6&Pl))throw Error(a(327));i=e.finishedWork;var r=e.finishedLanes;if(null===i)return null;if(e.finishedWork=null,e.finishedLanes=0,i===e.current)throw Error(a(177));e.callbackNode=null,e.callbackPriority=0;var s=i.lanes|i.childLanes;if(function(e,t){var i=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<i;){var r=31-st(i),a=1<<r;t[r]=0,n[r]=-1,e[r]=-1,i&=~a}}(e,s),e===Dl&&(kl=Dl=null,Ol=0),0===(2064&i.subtreeFlags)&&0===(2064&i.flags)||Yl||(Yl=!0,Dc(tt,(function(){return Sc(),null}))),s=0!==(15990&i.flags),0!==(15990&i.subtreeFlags)||s){s=Tl.transition,Tl.transition=null;var o=bt;bt=1;var l=Pl;Pl|=4,Ml.current=null,function(e,t){if(er=Ht,pn(e=dn())){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{var n=(i=(i=e.ownerDocument)&&i.defaultView||window).getSelection&&i.getSelection();if(n&&0!==n.rangeCount){i=n.anchorNode;var r=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{i.nodeType,s.nodeType}catch(w){i=null;break e}var o=0,l=-1,c=-1,h=0,u=0,d=e,p=null;t:for(;;){for(var f;d!==i||0!==r&&3!==d.nodeType||(l=o+r),d!==s||0!==n&&3!==d.nodeType||(c=o+n),3===d.nodeType&&(o+=d.nodeValue.length),null!==(f=d.firstChild);)p=d,d=f;for(;;){if(d===e)break t;if(p===i&&++h===r&&(l=o),p===s&&++u===n&&(c=o),null!==(f=d.nextSibling))break;p=(d=p).parentNode}d=f}i=-1===l||-1===c?null:{start:l,end:c}}else i=null}i=i||{start:0,end:0}}else i=null;for(tr={focusedElem:e,selectionRange:i},Ht=!1,$o=t;null!==$o;)if(e=(t=$o).child,0!==(1028&t.subtreeFlags)&&null!==e)e.return=t,$o=e;else for(;null!==$o;){t=$o;try{var m=t.alternate;if(0!==(1024&t.flags))switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==m){var g=m.memoizedProps,v=m.memoizedState,y=t.stateNode,b=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:ga(t.type,g),v);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var x=t.stateNode.containerInfo;1===x.nodeType?x.textContent="":9===x.nodeType&&x.documentElement&&x.removeChild(x.documentElement);break;default:throw Error(a(163))}}catch(w){Cc(t,t.return,w)}if(null!==(e=t.sibling)){e.return=t.return,$o=e;break}$o=t.return}m=il,il=!1}(e,i),vl(i,e),fn(tr),Ht=!!er,tr=er=null,e.current=i,bl(i,e,r),Ze(),Pl=l,bt=o,Tl.transition=s}else e.current=i;if(Yl&&(Yl=!1,Ql=e,Zl=r),s=e.pendingLanes,0===s&&(Xl=null),function(e){if(at&&"function"===typeof at.onCommitFiberRoot)try{at.onCommitFiberRoot(rt,e,void 0,128===(128&e.current.flags))}catch(t){}}(i.stateNode),rc(e,Ke()),null!==t)for(n=e.onRecoverableError,i=0;i<t.length;i++)r=t[i],n(r.value,{componentStack:r.stack,digest:r.digest});if(Wl)throw Wl=!1,e=ql,ql=null,e;0!==(1&Zl)&&0!==e.tag&&Sc(),s=e.pendingLanes,0!==(1&s)?e===Jl?Kl++:(Kl=0,Jl=e):Kl=0,Ur()}(e,t,i,n)}finally{Tl.transition=r,bt=n}return null}function Sc(){if(null!==Ql){var e=xt(Zl),t=Tl.transition,i=bt;try{if(Tl.transition=null,bt=16>e?16:e,null===Ql)var n=!1;else{if(e=Ql,Ql=null,Zl=0,0!==(6&Pl))throw Error(a(331));var r=Pl;for(Pl|=4,$o=e.current;null!==$o;){var s=$o,o=s.child;if(0!==(16&$o.flags)){var l=s.deletions;if(null!==l){for(var c=0;c<l.length;c++){var h=l[c];for($o=h;null!==$o;){var u=$o;switch(u.tag){case 0:case 11:case 15:nl(8,u,s)}var d=u.child;if(null!==d)d.return=u,$o=d;else for(;null!==$o;){var p=(u=$o).sibling,f=u.return;if(sl(u),u===h){$o=null;break}if(null!==p){p.return=f,$o=p;break}$o=f}}}var m=s.alternate;if(null!==m){var g=m.child;if(null!==g){m.child=null;do{var v=g.sibling;g.sibling=null,g=v}while(null!==g)}}$o=s}}if(0!==(2064&s.subtreeFlags)&&null!==o)o.return=s,$o=o;else e:for(;null!==$o;){if(0!==(2048&(s=$o).flags))switch(s.tag){case 0:case 11:case 15:nl(9,s,s.return)}var y=s.sibling;if(null!==y){y.return=s.return,$o=y;break e}$o=s.return}}var b=e.current;for($o=b;null!==$o;){var x=(o=$o).child;if(0!==(2064&o.subtreeFlags)&&null!==x)x.return=o,$o=x;else e:for(o=b;null!==$o;){if(0!==(2048&(l=$o).flags))try{switch(l.tag){case 0:case 11:case 15:rl(9,l)}}catch(_){Cc(l,l.return,_)}if(l===o){$o=null;break e}var w=l.sibling;if(null!==w){w.return=l.return,$o=w;break e}$o=l.return}}if(Pl=r,Ur(),at&&"function"===typeof at.onPostCommitFiberRoot)try{at.onPostCommitFiberRoot(rt,e)}catch(_){}n=!0}return n}finally{bt=i,Tl.transition=t}}return!1}function Ec(e,t,i){e=Ra(e,t=fo(0,t=co(i,t),1),1),t=tc(),null!==e&&(vt(e,1,t),rc(e,t))}function Cc(e,t,i){if(3===e.tag)Ec(e,e,i);else for(;null!==t;){if(3===t.tag){Ec(t,e,i);break}if(1===t.tag){var n=t.stateNode;if("function"===typeof t.type.getDerivedStateFromError||"function"===typeof n.componentDidCatch&&(null===Xl||!Xl.has(n))){t=Ra(t,e=mo(t,e=co(i,e),1),1),e=tc(),null!==t&&(vt(t,1,e),rc(t,e));break}}t=t.return}}function Ac(e,t,i){var n=e.pingCache;null!==n&&n.delete(t),t=tc(),e.pingedLanes|=e.suspendedLanes&i,Dl===e&&(Ol&i)===i&&(4===Ll||3===Ll&&(130023424&Ol)===Ol&&500>Ke()-Ul?pc(e,0):Fl|=i),rc(e,t)}function Mc(e,t){0===t&&(0===(1&e.mode)?t=1:(t=ht,0===(130023424&(ht<<=1))&&(ht=4194304)));var i=tc();null!==(e=Pa(e,t))&&(vt(e,t,i),rc(e,i))}function Tc(e){var t=e.memoizedState,i=0;null!==t&&(i=t.retryLane),Mc(e,i)}function Pc(e,t){var i=0;switch(e.tag){case 13:var n=e.stateNode,r=e.memoizedState;null!==r&&(i=r.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(a(314))}null!==n&&n.delete(t),Mc(e,i)}function Dc(e,t){return Xe(e,t)}function kc(e,t,i,n){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Oc(e,t,i,n){return new kc(e,t,i,n)}function Ic(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Rc(e,t){var i=e.alternate;return null===i?((i=Oc(e.tag,t,e.key,e.mode)).elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=14680064&e.flags,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i}function Lc(e,t,i,n,r,s){var o=2;if(n=e,"function"===typeof e)Ic(e)&&(o=1);else if("string"===typeof e)o=5;else e:switch(e){case S:return Bc(i.children,r,s,t);case E:o=8,r|=8;break;case C:return(e=Oc(12,i,t,2|r)).elementType=C,e.lanes=s,e;case P:return(e=Oc(13,i,t,r)).elementType=P,e.lanes=s,e;case D:return(e=Oc(19,i,t,r)).elementType=D,e.lanes=s,e;case I:return zc(i,r,s,t);default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case A:o=10;break e;case M:o=9;break e;case T:o=11;break e;case k:o=14;break e;case O:o=16,n=null;break e}throw Error(a(130,null==e?e:typeof e,""))}return(t=Oc(o,i,t,r)).elementType=e,t.type=n,t.lanes=s,t}function Bc(e,t,i,n){return(e=Oc(7,e,n,t)).lanes=i,e}function zc(e,t,i,n){return(e=Oc(22,e,n,t)).elementType=I,e.lanes=i,e.stateNode={isHidden:!1},e}function Nc(e,t,i){return(e=Oc(6,e,null,t)).lanes=i,e}function Fc(e,t,i){return(t=Oc(4,null!==e.children?e.children:[],e.key,t)).lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function jc(e,t,i,n,r){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gt(0),this.expirationTimes=gt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gt(0),this.identifierPrefix=n,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function Vc(e,t,i,n,r,a,s,o,l){return e=new jc(e,t,i,o,l),1===t?(t=1,!0===a&&(t|=8)):t=0,a=Oc(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},ka(a),e}function Uc(e){if(!e)return Mr;e:{if(Ue(e=e._reactInternals)!==e||1!==e.tag)throw Error(a(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Or(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(a(171))}if(1===e.tag){var i=e.type;if(Or(i))return Lr(e,i,t)}return t}function Gc(e,t,i,n,r,a,s,o,l){return(e=Vc(i,n,!0,e,0,a,0,o,l)).context=Uc(null),i=e.current,(a=Ia(n=tc(),r=ic(i))).callback=void 0!==t&&null!==t?t:null,Ra(i,a,r),e.current.lanes=r,vt(e,r,n),rc(e,n),e}function Hc(e,t,i,n){var r=t.current,a=tc(),s=ic(r);return i=Uc(i),null===t.context?t.context=i:t.pendingContext=i,(t=Ia(a,s)).payload={element:e},null!==(n=void 0===n?null:n)&&(t.callback=n),null!==(e=Ra(r,t,s))&&(nc(e,r,s,a),La(e,r,s)),s}function Wc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function qc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var i=e.retryLane;e.retryLane=0!==i&&i<t?i:t}}function Xc(e,t){qc(e,t),(e=e.alternate)&&qc(e,t)}El=function(e,t,i){if(null!==e)if(e.memoizedProps!==t.pendingProps||Pr.current)xo=!0;else{if(0===(e.lanes&i)&&0===(128&t.flags))return xo=!1,function(e,t,i){switch(t.tag){case 3:Do(t),pa();break;case 5:as(t);break;case 1:Or(t.type)&&Br(t);break;case 4:ns(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,r=t.memoizedProps.value;Ar(va,n._currentValue),n._currentValue=r;break;case 13:if(null!==(n=t.memoizedState))return null!==n.dehydrated?(Ar(os,1&os.current),t.flags|=128,null):0!==(i&t.child.childLanes)?No(e,t,i):(Ar(os,1&os.current),null!==(e=Wo(e,t,i))?e.sibling:null);Ar(os,1&os.current);break;case 19:if(n=0!==(i&t.childLanes),0!==(128&e.flags)){if(n)return Go(e,t,i);t.flags|=128}if(null!==(r=t.memoizedState)&&(r.rendering=null,r.tail=null,r.lastEffect=null),Ar(os,os.current),n)break;return null;case 22:case 23:return t.lanes=0,Co(e,t,i)}return Wo(e,t,i)}(e,t,i);xo=0!==(131072&e.flags)}else xo=!1,ra&&0!==(1048576&t.flags)&&$r(t,qr,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Ho(e,t),e=t.pendingProps;var r=kr(t,Tr.current);Ea(t,i),r=Ss(null,t,n,e,r,i);var s=Es();return t.flags|=1,"object"===typeof r&&null!==r&&"function"===typeof r.render&&void 0===r.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Or(n)?(s=!0,Br(t)):s=!1,t.memoizedState=null!==r.state&&void 0!==r.state?r.state:null,ka(t),r.updater=Va,t.stateNode=r,r._reactInternals=t,Wa(t,n,e,i),t=Po(null,t,n,!0,s,i)):(t.tag=0,ra&&s&&ea(t),wo(null,t,r,i),t=t.child),t;case 16:n=t.elementType;e:{switch(Ho(e,t),e=t.pendingProps,n=(r=n._init)(n._payload),t.type=n,r=t.tag=function(e){if("function"===typeof e)return Ic(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===T)return 11;if(e===k)return 14}return 2}(n),e=ga(n,e),r){case 0:t=Mo(null,t,n,e,i);break e;case 1:t=To(null,t,n,e,i);break e;case 11:t=_o(null,t,n,e,i);break e;case 14:t=So(null,t,n,ga(n.type,e),i);break e}throw Error(a(306,n,""))}return t;case 0:return n=t.type,r=t.pendingProps,Mo(e,t,n,r=t.elementType===n?r:ga(n,r),i);case 1:return n=t.type,r=t.pendingProps,To(e,t,n,r=t.elementType===n?r:ga(n,r),i);case 3:e:{if(Do(t),null===e)throw Error(a(387));n=t.pendingProps,r=(s=t.memoizedState).element,Oa(e,t),za(t,n,null,i);var o=t.memoizedState;if(n=o.element,s.isDehydrated){if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,256&t.flags){t=ko(e,t,n,i,r=co(Error(a(423)),t));break e}if(n!==r){t=ko(e,t,n,i,r=co(Error(a(424)),t));break e}for(na=cr(t.stateNode.containerInfo.firstChild),ia=t,ra=!0,aa=null,i=Ka(t,null,n,i),t.child=i;i;)i.flags=-3&i.flags|4096,i=i.sibling}else{if(pa(),n===r){t=Wo(e,t,i);break e}wo(e,t,n,i)}t=t.child}return t;case 5:return as(t),null===e&&ca(t),n=t.type,r=t.pendingProps,s=null!==e?e.memoizedProps:null,o=r.children,ir(n,r)?o=null:null!==s&&ir(n,s)&&(t.flags|=32),Ao(e,t),wo(e,t,o,i),t.child;case 6:return null===e&&ca(t),null;case 13:return No(e,t,i);case 4:return ns(t,t.stateNode.containerInfo),n=t.pendingProps,null===e?t.child=Za(t,null,n,i):wo(e,t,n,i),t.child;case 11:return n=t.type,r=t.pendingProps,_o(e,t,n,r=t.elementType===n?r:ga(n,r),i);case 7:return wo(e,t,t.pendingProps,i),t.child;case 8:case 12:return wo(e,t,t.pendingProps.children,i),t.child;case 10:e:{if(n=t.type._context,r=t.pendingProps,s=t.memoizedProps,o=r.value,Ar(va,n._currentValue),n._currentValue=o,null!==s)if(on(s.value,o)){if(s.children===r.children&&!Pr.current){t=Wo(e,t,i);break e}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var l=s.dependencies;if(null!==l){o=s.child;for(var c=l.firstContext;null!==c;){if(c.context===n){if(1===s.tag){(c=Ia(-1,i&-i)).tag=2;var h=s.updateQueue;if(null!==h){var u=(h=h.shared).pending;null===u?c.next=c:(c.next=u.next,u.next=c),h.pending=c}}s.lanes|=i,null!==(c=s.alternate)&&(c.lanes|=i),Sa(s.return,i,t),l.lanes|=i;break}c=c.next}}else if(10===s.tag)o=s.type===t.type?null:s.child;else if(18===s.tag){if(null===(o=s.return))throw Error(a(341));o.lanes|=i,null!==(l=o.alternate)&&(l.lanes|=i),Sa(o,i,t),o=s.sibling}else o=s.child;if(null!==o)o.return=s;else for(o=s;null!==o;){if(o===t){o=null;break}if(null!==(s=o.sibling)){s.return=o.return,o=s;break}o=o.return}s=o}wo(e,t,r.children,i),t=t.child}return t;case 9:return r=t.type,n=t.pendingProps.children,Ea(t,i),n=n(r=Ca(r)),t.flags|=1,wo(e,t,n,i),t.child;case 14:return r=ga(n=t.type,t.pendingProps),So(e,t,n,r=ga(n.type,r),i);case 15:return Eo(e,t,t.type,t.pendingProps,i);case 17:return n=t.type,r=t.pendingProps,r=t.elementType===n?r:ga(n,r),Ho(e,t),t.tag=1,Or(n)?(e=!0,Br(t)):e=!1,Ea(t,i),Ga(t,n,r),Wa(t,n,r,i),Po(null,t,n,!0,e,i);case 19:return Go(e,t,i);case 22:return Co(e,t,i)}throw Error(a(156,t.tag))};var Yc="function"===typeof reportError?reportError:function(e){console.error(e)};function Qc(e){this._internalRoot=e}function Zc(e){this._internalRoot=e}function Kc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Jc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function $c(){}function eh(e,t,i,n,r){var a=i._reactRootContainer;if(a){var s=a;if("function"===typeof r){var o=r;r=function(){var e=Wc(s);o.call(e)}}Hc(t,s,e,r)}else s=function(e,t,i,n,r){if(r){if("function"===typeof n){var a=n;n=function(){var e=Wc(s);a.call(e)}}var s=Gc(t,n,e,0,null,!1,0,"",$c);return e._reactRootContainer=s,e[fr]=s.current,Un(8===e.nodeType?e.parentNode:e),uc(),s}for(;r=e.lastChild;)e.removeChild(r);if("function"===typeof n){var o=n;n=function(){var e=Wc(l);o.call(e)}}var l=Vc(e,0,!1,null,0,!1,0,"",$c);return e._reactRootContainer=l,e[fr]=l.current,Un(8===e.nodeType?e.parentNode:e),uc((function(){Hc(t,l,i,n)})),l}(i,t,e,r,n);return Wc(s)}Zc.prototype.render=Qc.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(a(409));Hc(e,t,null,null)},Zc.prototype.unmount=Qc.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;uc((function(){Hc(null,e,null,null)})),t[fr]=null}},Zc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Et();e={blockedOn:null,target:e,priority:t};for(var i=0;i<It.length&&0!==t&&t<It[i].priority;i++);It.splice(i,0,e),0===i&&zt(e)}},wt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var i=ut(t.pendingLanes);0!==i&&(yt(t,1|i),rc(t,Ke()),0===(6&Pl)&&(Gl=Ke()+500,Ur()))}break;case 13:uc((function(){var t=Pa(e,1);if(null!==t){var i=tc();nc(t,e,1,i)}})),Xc(e,1)}},_t=function(e){if(13===e.tag){var t=Pa(e,134217728);if(null!==t)nc(t,e,134217728,tc());Xc(e,134217728)}},St=function(e){if(13===e.tag){var t=ic(e),i=Pa(e,t);if(null!==i)nc(i,e,t,tc());Xc(e,t)}},Et=function(){return bt},Ct=function(e,t){var i=bt;try{return bt=e,t()}finally{bt=i}},_e=function(e,t,i){switch(t){case"input":if(J(e,i),t=i.name,"radio"===i.type&&null!=t){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<i.length;t++){var n=i[t];if(n!==e&&n.form===e.form){var r=wr(n);if(!r)throw Error(a(90));X(n),J(n,r)}}}break;case"textarea":ae(e,i);break;case"select":null!=(t=i.value)&&ie(e,!!i.multiple,t,!1)}},Te=hc,Pe=uc;var th={usingClientEntryPoint:!1,Events:[br,xr,wr,Ae,Me,hc]},ih={findFiberByHostInstance:yr,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},nh={bundleType:ih.bundleType,version:ih.version,rendererPackageName:ih.rendererPackageName,rendererConfig:ih.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:x.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=We(e))?null:e.stateNode},findFiberByHostInstance:ih.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var rh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rh.isDisabled&&rh.supportsFiber)try{rt=rh.inject(nh),at=rh}catch(he){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=th,t.createPortal=function(e,t){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Kc(t))throw Error(a(200));return function(e,t,i){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:_,key:null==n?null:""+n,children:e,containerInfo:t,implementation:i}}(e,t,null,i)},t.createRoot=function(e,t){if(!Kc(e))throw Error(a(299));var i=!1,n="",r=Yc;return null!==t&&void 0!==t&&(!0===t.unstable_strictMode&&(i=!0),void 0!==t.identifierPrefix&&(n=t.identifierPrefix),void 0!==t.onRecoverableError&&(r=t.onRecoverableError)),t=Vc(e,1,!1,null,0,i,0,n,r),e[fr]=t.current,Un(8===e.nodeType?e.parentNode:e),new Qc(t)},t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(a(188));throw e=Object.keys(e).join(","),Error(a(268,e))}return e=null===(e=We(t))?null:e.stateNode},t.flushSync=function(e){return uc(e)},t.hydrate=function(e,t,i){if(!Jc(t))throw Error(a(200));return eh(null,e,t,!0,i)},t.hydrateRoot=function(e,t,i){if(!Kc(e))throw Error(a(405));var n=null!=i&&i.hydratedSources||null,r=!1,s="",o=Yc;if(null!==i&&void 0!==i&&(!0===i.unstable_strictMode&&(r=!0),void 0!==i.identifierPrefix&&(s=i.identifierPrefix),void 0!==i.onRecoverableError&&(o=i.onRecoverableError)),t=Gc(t,null,e,1,null!=i?i:null,r,0,s,o),e[fr]=t.current,Un(e),n)for(e=0;e<n.length;e++)r=(r=(i=n[e])._getVersion)(i._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[i,r]:t.mutableSourceEagerHydrationData.push(i,r);return new Zc(t)},t.render=function(e,t,i){if(!Jc(t))throw Error(a(200));return eh(null,e,t,!1,i)},t.unmountComponentAtNode=function(e){if(!Jc(e))throw Error(a(40));return!!e._reactRootContainer&&(uc((function(){eh(null,null,e,!1,(function(){e._reactRootContainer=null,e[fr]=null}))})),!0)},t.unstable_batchedUpdates=hc,t.unstable_renderSubtreeIntoContainer=function(e,t,i,n){if(!Jc(i))throw Error(a(200));if(null==e||void 0===e._reactInternals)throw Error(a(38));return eh(e,t,i,!1,n)},t.version="18.2.0-next-9e3b772b8-20220608"},391:(e,t,i)=>{"use strict";var n=i(950);t.createRoot=n.createRoot,t.hydrateRoot=n.hydrateRoot},950:(e,t,i)=>{"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=i(730)},681:function(e,t,i){var n;"undefined"!=typeof self&&self,n=function(e){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=3)}([function(t,i){t.exports=e},function(e,t,i){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function o(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,r=l(e);if(t){var a=l(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,i)}}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Background=t.Parallax=void 0;var h=c(i(0)),u=function(e){a(i,e);var t=o(i);function i(){return r(this,i),t.apply(this,arguments)}return i}(h.default.Component);t.Parallax=u;var d=function(e){a(i,e);var t=o(i);function i(){return r(this,i),t.apply(this,arguments)}return i}(h.default.Component);t.Background=d},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canUseDOM=t.getNodeHeight=t.isScrolledIntoView=t.getWindowHeight=void 0,t.getWindowHeight=function(e){if(!e)return 0;var t=window,i=document,n=i.documentElement,r=i.getElementsByTagName("body")[0];return t.innerHeight||n.clientHeight||r.clientHeight},t.isScrolledIntoView=function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;if(!n)return!1;var r=e.getBoundingClientRect().top-i,a=e.getBoundingClientRect().bottom+i;return r<=t.getWindowHeight(n)&&a>=0},t.getNodeHeight=function(e,i){return e?i&&"clientHeight"in i?i.clientHeight:t.getWindowHeight(e):0},t.canUseDOM=function(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}},function(e,t,i){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Background=t.Parallax=void 0;var r=n(i(4));t.Parallax=r.default;var a=n(i(7));t.Background=a.default},function(e,t,i){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,r=o(e);if(t){var a=o(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,i)}}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var c=l(i(0)),h=i(1),u=i(5),d=i(2),p=l(i(6)),f={position:"absolute",left:"50%",WebkitTransform:"translate3d(-50%, 0, 0)",transform:"translate3d(-50%, 0, 0)",WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",MozBackfaceVisibility:"hidden",MsBackfaceVisibility:"hidden"},m=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(i,e);var t=s(i);function i(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(n=t.call(this,e)).onWindowResize=function(){n.parentHeight=d.getNodeHeight(n.canUseDOM,n.parent),n.updatePosition()},n.onWindowLoad=function(){n.updatePosition()},n.onScroll=function(){if(n.canUseDOM){var e=Date.now();e-n.timestamp>=10&&d.isScrolledIntoView(n.node,100,n.canUseDOM)&&(window.requestAnimationFrame(n.updatePosition),n.timestamp=e)}},n.onContentMount=function(e){n.content=e},n.updatePosition=function(){if(n.content){var e=!1;n.contentHeight=n.content.getBoundingClientRect().height,n.contentWidth=n.node.getBoundingClientRect().width,n.img&&n.img.naturalWidth/n.img.naturalHeight<n.contentWidth/n.getImageHeight()&&(e=!0);var t=u.getRelativePosition(n.node,n.canUseDOM),i=!!n.img,r=n.bg&&n.state.splitChildren.bgChildren.length>0;i&&n.setImagePosition(t,e),r&&n.setBackgroundPosition(t),i||r||n.setState({percentage:t})}},n.state={bgImage:e.bgImage,bgImageSrcSet:e.bgImageSrcSet,bgImageSizes:e.bgImageSizes,imgStyle:f,bgStyle:Object.assign(Object.assign({},f),e.bgStyle),percentage:0,splitChildren:u.getSplitChildren(e)},n.canUseDOM=d.canUseDOM(),n.node=null,n.content=null,n.bgImageLoaded=!1,n.bgImageRef=void 0,n.parent=e.parent,n.parentHeight=d.getNodeHeight(n.canUseDOM,n.parent),n.timestamp=Date.now(),n.isDynamicBlur=u.getHasDynamicBlur(e.blur),n}return function(e,t,i){t&&r(e.prototype,t),i&&r(e,i)}(i,[{key:"componentDidMount",value:function(){var e=this.props.parent,t=this.state,i=t.bgImage,n=t.bgImageSrcSet,r=t.bgImageSizes;this.parent=e||document,this.addListeners(),i?this.loadImage(i,n,r):this.updatePosition()}},{key:"componentDidUpdate",value:function(e){var t=this.props,i=t.parent,n=t.bgImage,r=t.bgImageSrcSet,a=t.bgImageSizes,s=this.state.bgImage;e.parent!==i&&(this.removeListeners(this.parent),this.parent=i,i&&this.addListeners()),this.parentHeight=d.getNodeHeight(this.canUseDOM,this.parent),s!==n&&this.loadImage(n,r,a)}},{key:"componentWillUnmount",value:function(){this.removeListeners(this.parent),this.releaseImage()}},{key:"setBackgroundPosition",value:function(e){var t=this.props,i=t.disabled,n=t.strength,r=Object.assign({},this.state.bgStyle);if(!i){var a="translate3d(-50%, ".concat((n<0?n:0)-n*e,"px, 0)");r.WebkitTransform=a,r.transform=a}this.setState({bgStyle:r,percentage:e})}},{key:"setImagePosition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.props,n=i.disabled,r=i.strength,a=i.blur,s=t?"auto":"".concat(this.getImageHeight(),"px"),o=t?"".concat(this.contentWidth,"px"):"auto",l=Object.assign(Object.assign({},this.state.imgStyle),{height:s,width:o});if(!n){var c="translate3d(-50%, ".concat((r<0?r:0)-r*e,"px, 0)"),h="none";a&&(h="blur(".concat(u.getBlurValue(this.isDynamicBlur,a,e),"px)")),l.WebkitTransform=c,l.transform=c,l.WebkitFilter=h,l.filter=h}this.setState({imgStyle:l,percentage:e})}},{key:"getImageHeight",value:function(){var e=this.props.strength,t=(e<0?2.5:1)*Math.abs(e);return Math.floor(this.contentHeight+t)}},{key:"loadImage",value:function(e,t,i){var n=this;this.releaseImage(),this.bgImageRef=new Image,this.bgImageRef.onload=function(r){n.setState({bgImage:e,bgImageSrcSet:t,bgImageSizes:i},(function(){return n.updatePosition()})),n.props.onLoad&&n.props.onLoad(r)},this.bgImageRef.onerror=this.bgImageRef.onload,this.bgImageRef.src=e,this.bgImageRef.srcset=t||"",this.bgImageRef.sizes=i||""}},{key:"releaseImage",value:function(){this.bgImageRef&&(this.bgImageRef.onload=null,this.bgImageRef.onerror=null,delete this.bgImageRef)}},{key:"addListeners",value:function(){this.canUseDOM&&this.parent&&(this.parent.addEventListener("scroll",this.onScroll,!1),window.addEventListener("resize",this.onWindowResize,!1),window.addEventListener("load",this.onWindowLoad,!1))}},{key:"removeListeners",value:function(e){this.canUseDOM&&(e&&e.removeEventListener("scroll",this.onScroll,!1),window.removeEventListener("resize",this.onWindowResize,!1),window.removeEventListener("load",this.onWindowLoad,!1))}},{key:"render",value:function(){var e=this,t=this.props,i=t.className,n=t.style,r=t.bgClassName,a=t.contentClassName,s=t.bgImageAlt,o=t.renderLayer,l=t.bgImageStyle,h=t.lazy,u=this.state,d=u.bgImage,f=u.bgImageSrcSet,m=u.bgImageSizes,g=u.percentage,v=u.imgStyle,y=u.bgStyle,b=u.splitChildren;return c.default.createElement("div",{className:"react-parallax ".concat(i),style:Object.assign({position:"relative",overflow:"hidden"},n),ref:function(t){e.node=t}},d?c.default.createElement("img",{className:r,src:d,srcSet:f,sizes:m,ref:function(t){e.img=t},alt:s,style:Object.assign(Object.assign({},v),l),loading:h?"lazy":"eager"}):null,o?o(-(g-1)):null,b.bgChildren.length>0?c.default.createElement("div",{className:"react-parallax-background-children",ref:function(t){e.bg=t},style:y},b.bgChildren):null,c.default.createElement(p.default,{onMount:this.onContentMount,className:a},b.children))}}],[{key:"getDerivedStateFromProps",value:function(e){return{splitChildren:u.getSplitChildren(e)}}}]),i}(h.Parallax);m.defaultProps={bgClassName:"react-parallax-bgimage",bgImageAlt:"",className:"",contentClassName:"",disabled:!1,strength:100},t.default=m},function(e,t,i){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.setBlur=t.getBlurValue=t.getHasDynamicBlur=t.getSplitChildren=t.getRelativePosition=t.getPercentage=void 0;var r=i(0),a=i(2);t.getPercentage=function(e,t,i){return(i-e)/(t-e)||0},t.getRelativePosition=function(e,i){if(!i)return 0;var n=e.getBoundingClientRect(),r=n.top,s=n.height,o=a.getNodeHeight(i),l=s>o?s:o,c=Math.round(r>l?l:r);return t.getPercentage(0,l,c)},t.getSplitChildren=function(e){var t=[],i=r.Children.toArray(e.children);return i.forEach((function(e,n){var r=e;r.type&&r.type.isParallaxBackground&&(t=t.concat(i.splice(n,1)))})),{bgChildren:t,children:i}},t.getHasDynamicBlur=function(e){return"object"===n(e)&&void 0!==e.min&&void 0!==e.max},t.getBlurValue=function(e,t,i){return e?t.min+(1-i)*t.max:t},t.setBlur=function(e,t){e.style.webkitFilter="blur(".concat(t,"px)"),e.style.filter="blur(".concat(t,"px)")}},function(e,t,i){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=n(i(0));t.default=function(e){var t=e.children,i=e.onMount,n=e.className;return r.default.createElement("div",{ref:function(e){return i(e)},className:n||"react-parallax-content",style:{position:"relative"}},t)}},function(e,t,i){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,r=o(e);if(t){var a=o(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,i)}}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var c=l(i(0)),h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(i,e);var t=s(i);function i(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),t.apply(this,arguments)}return function(e,t,i){t&&r(e.prototype,t),i&&r(e,i)}(i,[{key:"render",value:function(){var e=this.props,t=e.className,i=e.children;return c.default.createElement("div",{className:"react-parallax-background ".concat(t)},i)}}]),i}(i(1).Background);h.defaultProps={className:""},h.isParallaxBackground=!0,t.default=h}])},e.exports=n(i(43))},358:(e,t)=>{"use strict";var i,n=Symbol.for("react.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),h=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen");function v(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case a:case o:case s:case d:case p:return e;default:switch(e=e&&e.$$typeof){case h:case c:case u:case m:case f:case l:return e;default:return t}}case r:return t}}}i=Symbol.for("react.module.reference")},706:(e,t,i)=>{"use strict";i(358)},153:(e,t,i)=>{"use strict";var n=i(43),r=Symbol.for("react.element"),a=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,o=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,i){var n,a={},c=null,h=null;for(n in void 0!==i&&(c=""+i),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(h=t.ref),t)s.call(t,n)&&!l.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===a[n]&&(a[n]=t[n]);return{$$typeof:r,type:e,key:c,ref:h,props:a,_owner:o.current}}t.Fragment=a,t.jsx=c,t.jsxs=c},202:(e,t)=>{"use strict";var i=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.iterator;var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,g={};function v(e,t,i){this.props=e,this.context=t,this.refs=g,this.updater=i||f}function y(){}function b(e,t,i){this.props=e,this.context=t,this.refs=g,this.updater=i||f}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=v.prototype;var x=b.prototype=new y;x.constructor=b,m(x,v.prototype),x.isPureReactComponent=!0;var w=Array.isArray,_=Object.prototype.hasOwnProperty,S={current:null},E={key:!0,ref:!0,__self:!0,__source:!0};function C(e,t,n){var r,a={},s=null,o=null;if(null!=t)for(r in void 0!==t.ref&&(o=t.ref),void 0!==t.key&&(s=""+t.key),t)_.call(t,r)&&!E.hasOwnProperty(r)&&(a[r]=t[r]);var l=arguments.length-2;if(1===l)a.children=n;else if(1<l){for(var c=Array(l),h=0;h<l;h++)c[h]=arguments[h+2];a.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps)void 0===a[r]&&(a[r]=l[r]);return{$$typeof:i,type:e,key:s,ref:o,props:a,_owner:S.current}}function A(e){return"object"===typeof e&&null!==e&&e.$$typeof===i}var M=/\/+/g;function T(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function P(e,t,r,a,s){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var l=!1;if(null===e)l=!0;else switch(o){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case i:case n:l=!0}}if(l)return s=s(l=e),e=""===a?"."+T(l,0):a,w(s)?(r="",null!=e&&(r=e.replace(M,"$&/")+"/"),P(s,t,r,"",(function(e){return e}))):null!=s&&(A(s)&&(s=function(e,t){return{$$typeof:i,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(s,r+(!s.key||l&&l.key===s.key?"":(""+s.key).replace(M,"$&/")+"/")+e)),t.push(s)),1;if(l=0,a=""===a?".":a+":",w(e))for(var c=0;c<e.length;c++){var h=a+T(o=e[c],c);l+=P(o,t,r,h,s)}else if(h=function(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=p&&e[p]||e["@@iterator"])?e:null}(e),"function"===typeof h)for(e=h.call(e),c=0;!(o=e.next()).done;)l+=P(o=o.value,t,r,h=a+T(o,c++),s);else if("object"===o)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function D(e,t,i){if(null==e)return e;var n=[],r=0;return P(e,n,"","",(function(e){return t.call(i,e,r++)})),n}function k(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var O={current:null},I={transition:null},R={ReactCurrentDispatcher:O,ReactCurrentBatchConfig:I,ReactCurrentOwner:S};t.Children={map:D,forEach:function(e,t,i){D(e,(function(){t.apply(this,arguments)}),i)},count:function(e){var t=0;return D(e,(function(){t++})),t},toArray:function(e){return D(e,(function(e){return e}))||[]},only:function(e){if(!A(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=v,t.Fragment=r,t.Profiler=s,t.PureComponent=b,t.StrictMode=a,t.Suspense=h,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=R,t.cloneElement=function(e,t,n){if(null===e||void 0===e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=m({},e.props),a=e.key,s=e.ref,o=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,o=S.current),void 0!==t.key&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)_.call(t,c)&&!E.hasOwnProperty(c)&&(r[c]=void 0===t[c]&&void 0!==l?l[c]:t[c])}var c=arguments.length-2;if(1===c)r.children=n;else if(1<c){l=Array(c);for(var h=0;h<c;h++)l[h]=arguments[h+2];r.children=l}return{$$typeof:i,type:e.type,key:a,ref:s,props:r,_owner:o}},t.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:o,_context:e},e.Consumer=e},t.createElement=C,t.createFactory=function(e){var t=C.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=A,t.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:k}},t.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=I.transition;I.transition={};try{e()}finally{I.transition=t}},t.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},t.useCallback=function(e,t){return O.current.useCallback(e,t)},t.useContext=function(e){return O.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return O.current.useDeferredValue(e)},t.useEffect=function(e,t){return O.current.useEffect(e,t)},t.useId=function(){return O.current.useId()},t.useImperativeHandle=function(e,t,i){return O.current.useImperativeHandle(e,t,i)},t.useInsertionEffect=function(e,t){return O.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return O.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return O.current.useMemo(e,t)},t.useReducer=function(e,t,i){return O.current.useReducer(e,t,i)},t.useRef=function(e){return O.current.useRef(e)},t.useState=function(e){return O.current.useState(e)},t.useSyncExternalStore=function(e,t,i){return O.current.useSyncExternalStore(e,t,i)},t.useTransition=function(){return O.current.useTransition()},t.version="18.2.0"},43:(e,t,i)=>{"use strict";e.exports=i(202)},579:(e,t,i)=>{"use strict";e.exports=i(153)},128:(e,t,i)=>{"use strict";e.exports=i(413)()},413:e=>{"use strict";function t(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}e.exports=function(e){return(e=e||{}).circles?function(e){var i=[],n=[];return e.proto?function e(a){if("object"!==typeof a||null===a)return a;if(a instanceof Date)return new Date(a);if(Array.isArray(a))return r(a,e);if(a instanceof Map)return new Map(r(Array.from(a),e));if(a instanceof Set)return new Set(r(Array.from(a),e));var s={};for(var o in i.push(a),n.push(s),a){var l=a[o];if("object"!==typeof l||null===l)s[o]=l;else if(l instanceof Date)s[o]=new Date(l);else if(l instanceof Map)s[o]=new Map(r(Array.from(l),e));else if(l instanceof Set)s[o]=new Set(r(Array.from(l),e));else if(ArrayBuffer.isView(l))s[o]=t(l);else{var c=i.indexOf(l);s[o]=-1!==c?n[c]:e(l)}}return i.pop(),n.pop(),s}:function e(a){if("object"!==typeof a||null===a)return a;if(a instanceof Date)return new Date(a);if(Array.isArray(a))return r(a,e);if(a instanceof Map)return new Map(r(Array.from(a),e));if(a instanceof Set)return new Set(r(Array.from(a),e));var s={};for(var o in i.push(a),n.push(s),a)if(!1!==Object.hasOwnProperty.call(a,o)){var l=a[o];if("object"!==typeof l||null===l)s[o]=l;else if(l instanceof Date)s[o]=new Date(l);else if(l instanceof Map)s[o]=new Map(r(Array.from(l),e));else if(l instanceof Set)s[o]=new Set(r(Array.from(l),e));else if(ArrayBuffer.isView(l))s[o]=t(l);else{var c=i.indexOf(l);s[o]=-1!==c?n[c]:e(l)}}return i.pop(),n.pop(),s};function r(e,r){for(var a=Object.keys(e),s=new Array(a.length),o=0;o<a.length;o++){var l=a[o],c=e[l];if("object"!==typeof c||null===c)s[l]=c;else if(c instanceof Date)s[l]=new Date(c);else if(ArrayBuffer.isView(c))s[l]=t(c);else{var h=i.indexOf(c);s[l]=-1!==h?n[h]:r(c)}}return s}}(e):e.proto?function e(n){if("object"!==typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return i(n,e);if(n instanceof Map)return new Map(i(Array.from(n),e));if(n instanceof Set)return new Set(i(Array.from(n),e));var r={};for(var a in n){var s=n[a];"object"!==typeof s||null===s?r[a]=s:s instanceof Date?r[a]=new Date(s):s instanceof Map?r[a]=new Map(i(Array.from(s),e)):s instanceof Set?r[a]=new Set(i(Array.from(s),e)):ArrayBuffer.isView(s)?r[a]=t(s):r[a]=e(s)}return r}:function e(n){if("object"!==typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return i(n,e);if(n instanceof Map)return new Map(i(Array.from(n),e));if(n instanceof Set)return new Set(i(Array.from(n),e));var r={};for(var a in n)if(!1!==Object.hasOwnProperty.call(n,a)){var s=n[a];"object"!==typeof s||null===s?r[a]=s:s instanceof Date?r[a]=new Date(s):s instanceof Map?r[a]=new Map(i(Array.from(s),e)):s instanceof Set?r[a]=new Set(i(Array.from(s),e)):ArrayBuffer.isView(s)?r[a]=t(s):r[a]=e(s)}return r};function i(e,i){for(var n=Object.keys(e),r=new Array(n.length),a=0;a<n.length;a++){var s=n[a],o=e[s];"object"!==typeof o||null===o?r[s]=o:o instanceof Date?r[s]=new Date(o):ArrayBuffer.isView(o)?r[s]=t(o):r[s]=i(o)}return r}}},234:(e,t)=>{"use strict";function i(e,t){var i=e.length;e.push(t);e:for(;0<i;){var n=i-1>>>1,r=e[n];if(!(0<a(r,t)))break e;e[n]=t,e[i]=r,i=n}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],i=e.pop();if(i!==t){e[0]=i;e:for(var n=0,r=e.length,s=r>>>1;n<s;){var o=2*(n+1)-1,l=e[o],c=o+1,h=e[c];if(0>a(l,i))c<r&&0>a(h,l)?(e[n]=h,e[c]=i,n=c):(e[n]=l,e[o]=i,n=o);else{if(!(c<r&&0>a(h,i)))break e;e[n]=h,e[c]=i,n=c}}}return t}function a(e,t){var i=e.sortIndex-t.sortIndex;return 0!==i?i:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var c=[],h=[],u=1,d=null,p=3,f=!1,m=!1,g=!1,v="function"===typeof setTimeout?setTimeout:null,y="function"===typeof clearTimeout?clearTimeout:null,b="undefined"!==typeof setImmediate?setImmediate:null;function x(e){for(var t=n(h);null!==t;){if(null===t.callback)r(h);else{if(!(t.startTime<=e))break;r(h),t.sortIndex=t.expirationTime,i(c,t)}t=n(h)}}function w(e){if(g=!1,x(e),!m)if(null!==n(c))m=!0,I(_);else{var t=n(h);null!==t&&R(w,t.startTime-e)}}function _(e,i){m=!1,g&&(g=!1,y(A),A=-1),f=!0;var a=p;try{for(x(i),d=n(c);null!==d&&(!(d.expirationTime>i)||e&&!P());){var s=d.callback;if("function"===typeof s){d.callback=null,p=d.priorityLevel;var o=s(d.expirationTime<=i);i=t.unstable_now(),"function"===typeof o?d.callback=o:d===n(c)&&r(c),x(i)}else r(c);d=n(c)}if(null!==d)var l=!0;else{var u=n(h);null!==u&&R(w,u.startTime-i),l=!1}return l}finally{d=null,p=a,f=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,E=!1,C=null,A=-1,M=5,T=-1;function P(){return!(t.unstable_now()-T<M)}function D(){if(null!==C){var e=t.unstable_now();T=e;var i=!0;try{i=C(!0,e)}finally{i?S():(E=!1,C=null)}}else E=!1}if("function"===typeof b)S=function(){b(D)};else if("undefined"!==typeof MessageChannel){var k=new MessageChannel,O=k.port2;k.port1.onmessage=D,S=function(){O.postMessage(null)}}else S=function(){v(D,0)};function I(e){C=e,E||(E=!0,S())}function R(e,i){A=v((function(){e(t.unstable_now())}),i)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){m||f||(m=!0,I(_))},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var i=p;p=t;try{return e()}finally{p=i}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var i=p;p=e;try{return t()}finally{p=i}},t.unstable_scheduleCallback=function(e,r,a){var s=t.unstable_now();switch("object"===typeof a&&null!==a?a="number"===typeof(a=a.delay)&&0<a?s+a:s:a=s,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return e={id:u++,callback:r,priorityLevel:e,startTime:a,expirationTime:o=a+o,sortIndex:-1},a>s?(e.sortIndex=a,i(h,e),null===n(c)&&e===n(h)&&(g?(y(A),A=-1):g=!0,R(w,a-s))):(e.sortIndex=o,i(c,e),m||f||(m=!0,I(_))),e},t.unstable_shouldYield=P,t.unstable_wrapCallback=function(e){var t=p;return function(){var i=p;p=t;try{return e.apply(this,arguments)}finally{p=i}}}},853:(e,t,i)=>{"use strict";e.exports=i(234)},956:(e,t,i)=>{"use strict";var n=i(43);var r="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},a=n.useState,s=n.useEffect,o=n.useLayoutEffect,l=n.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!r(e,i)}catch(n){return!0}}var h="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?function(e,t){return t()}:function(e,t){var i=t(),n=a({inst:{value:i,getSnapshot:t}}),r=n[0].inst,h=n[1];return o((function(){r.value=i,r.getSnapshot=t,c(r)&&h({inst:r})}),[e,i,t]),s((function(){return c(r)&&h({inst:r}),e((function(){c(r)&&h({inst:r})}))}),[e]),l(i),i};t.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:h},39:(e,t,i)=>{"use strict";var n=i(43),r=i(461);var a="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},s=r.useSyncExternalStore,o=n.useRef,l=n.useEffect,c=n.useMemo,h=n.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,i,n,r){var u=o(null);if(null===u.current){var d={hasValue:!1,value:null};u.current=d}else d=u.current;u=c((function(){function e(e){if(!l){if(l=!0,s=e,e=n(e),void 0!==r&&d.hasValue){var t=d.value;if(r(t,e))return o=t}return o=e}if(t=o,a(s,e))return t;var i=n(e);return void 0!==r&&r(t,i)?t:(s=e,o=i)}var s,o,l=!1,c=void 0===i?null:i;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,i,n,r]);var p=s(e,u[0],u[1]);return l((function(){d.hasValue=!0,d.value=p}),[p]),h(p),p}},461:(e,t,i)=>{"use strict";e.exports=i(956)},443:(e,t,i)=>{"use strict";e.exports=i(39)}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var i=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(i.exports,i,i.exports,__webpack_require__),i.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.amdO={},__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;__webpack_require__.t=function(i,n){if(1&n&&(i=this(i)),8&n)return i;if("object"===typeof i&&i){if(4&n&&i.__esModule)return i;if(16&n&&"function"===typeof i.then)return i}var r=Object.create(null);__webpack_require__.r(r);var a={};e=e||[null,t({}),t([]),t(t)];for(var s=2&n&&i;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((e=>a[e]=()=>i[e]));return a.default=()=>i,__webpack_require__.d(r,a),r}})(),__webpack_require__.d=(e,t)=>{for(var i in t)__webpack_require__.o(t,i)&&!__webpack_require__.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},__webpack_require__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce(((t,i)=>(__webpack_require__.f[i](e,t),t)),[])),__webpack_require__.u=e=>"static/js/"+e+"."+{160:"57d2cae1",208:"9d423ed6",293:"3fd45101",516:"3e7a0bc5",917:"609a5b12",946:"b278a346"}[e]+".chunk.js",__webpack_require__.miniCssF=e=>{},__webpack_require__.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="uniferx_frontend:";__webpack_require__.l=(i,n,r,a)=>{if(e[i])e[i].push(n);else{var s,o;if(void 0!==r)for(var l=document.getElementsByTagName("script"),c=0;c<l.length;c++){var h=l[c];if(h.getAttribute("src")==i||h.getAttribute("data-webpack")==t+r){s=h;break}}s||(o=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,__webpack_require__.nc&&s.setAttribute("nonce",__webpack_require__.nc),s.setAttribute("data-webpack",t+r),s.src=i),e[i]=[n];var u=(t,n)=>{s.onerror=s.onload=null,clearTimeout(d);var r=e[i];if(delete e[i],s.parentNode&&s.parentNode.removeChild(s),r&&r.forEach((e=>e(n))),t)return t(n)},d=setTimeout(u.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=u.bind(null,s.onerror),s.onload=u.bind(null,s.onload),o&&document.head.appendChild(s)}}})(),__webpack_require__.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.p="/",(()=>{var e={792:0};__webpack_require__.f.j=(t,i)=>{var n=__webpack_require__.o(e,t)?e[t]:void 0;if(0!==n)if(n)i.push(n[2]);else{var r=new Promise(((i,r)=>n=e[t]=[i,r]));i.push(n[2]=r);var a=__webpack_require__.p+__webpack_require__.u(t),s=new Error;__webpack_require__.l(a,(i=>{if(__webpack_require__.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var r=i&&("load"===i.type?"missing":i.type),a=i&&i.target&&i.target.src;s.message="Loading chunk "+t+" failed.\n("+r+": "+a+")",s.name="ChunkLoadError",s.type=r,s.request=a,n[1](s)}}),"chunk-"+t,t)}};var t=(t,i)=>{var n,r,a=i[0],s=i[1],o=i[2],l=0;if(a.some((t=>0!==e[t]))){for(n in s)__webpack_require__.o(s,n)&&(__webpack_require__.m[n]=s[n]);if(o)o(__webpack_require__)}for(t&&t(i);l<a.length;l++)r=a[l],__webpack_require__.o(e,r)&&e[r]&&e[r][0](),e[r]=0},i=self.webpackChunkuniferx_frontend=self.webpackChunkuniferx_frontend||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var __webpack_exports__={};(()=>{"use strict";var e={};__webpack_require__.r(e),__webpack_require__.d(e,{hasBrowserEnv:()=>ni,hasStandardBrowserEnv:()=>ri,hasStandardBrowserWebWorkerEnv:()=>si});var t=__webpack_require__(43),i=__webpack_require__.t(t,2),n=__webpack_require__(391);function r(e){for(var t=arguments.length,i=Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];throw Error("[Immer] minified error nr: "+e+(i.length?" "+i.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function a(e){return!!e&&!!e[Y]}function s(e){var t;return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var i=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return i===Object||"function"==typeof i&&Function.toString.call(i)===Q}(e)||Array.isArray(e)||!!e[X]||!!(null===(t=e.constructor)||void 0===t?void 0:t[X])||p(e)||f(e))}function o(e,t,i){void 0===i&&(i=!1),0===l(e)?(i?Object.keys:Z)(e).forEach((function(n){i&&"symbol"==typeof n||t(n,e[n],e)})):e.forEach((function(i,n){return t(n,i,e)}))}function l(e){var t=e[Y];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:p(e)?2:f(e)?3:0}function c(e,t){return 2===l(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function h(e,t){return 2===l(e)?e.get(t):e[t]}function u(e,t,i){var n=l(e);2===n?e.set(t,i):3===n?e.add(i):e[t]=i}function d(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function p(e){return G&&e instanceof Map}function f(e){return H&&e instanceof Set}function m(e){return e.o||e.t}function g(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=K(e);delete t[Y];for(var i=Z(t),n=0;n<i.length;n++){var r=i[n],a=t[r];!1===a.writable&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[r]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[r]})}return Object.create(Object.getPrototypeOf(e),t)}function v(e,t){return void 0===t&&(t=!1),b(e)||a(e)||!s(e)||(l(e)>1&&(e.set=e.add=e.clear=e.delete=y),Object.freeze(e),t&&o(e,(function(e,t){return v(t,!0)}),!0)),e}function y(){r(2)}function b(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function x(e){var t=J[e];return t||r(18,e),t}function w(e,t){J[e]||(J[e]=t)}function _(){return V}function S(e,t){t&&(x("Patches"),e.u=[],e.s=[],e.v=t)}function E(e){C(e),e.p.forEach(M),e.p=null}function C(e){e===V&&(V=e.l)}function A(e){return V={p:[],l:V,h:e,m:!0,_:0}}function M(e){var t=e[Y];0===t.i||1===t.i?t.j():t.g=!0}function T(e,t){t._=t.p.length;var i=t.p[0],n=void 0!==e&&e!==i;return t.h.O||x("ES5").S(t,e,n),n?(i[Y].P&&(E(t),r(4)),s(e)&&(e=P(t,e),t.l||k(t,e)),t.u&&x("Patches").M(i[Y].t,e,t.u,t.s)):e=P(t,i,[]),E(t),t.u&&t.v(t.u,t.s),e!==q?e:void 0}function P(e,t,i){if(b(t))return t;var n=t[Y];if(!n)return o(t,(function(r,a){return D(e,n,t,r,a,i)}),!0),t;if(n.A!==e)return t;if(!n.P)return k(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var r=4===n.i||5===n.i?n.o=g(n.k):n.o,a=r,s=!1;3===n.i&&(a=new Set(r),r.clear(),s=!0),o(a,(function(t,a){return D(e,n,r,t,a,i,s)})),k(e,r,!1),i&&e.u&&x("Patches").N(n,i,e.u,e.s)}return n.o}function D(e,t,i,n,r,o,l){if(a(r)){var h=P(e,r,o&&t&&3!==t.i&&!c(t.R,n)?o.concat(n):void 0);if(u(i,n,h),!a(h))return;e.m=!1}else l&&i.add(r);if(s(r)&&!b(r)){if(!e.h.D&&e._<1)return;P(e,r),t&&t.A.l||k(e,r)}}function k(e,t,i){void 0===i&&(i=!1),!e.l&&e.h.D&&e.m&&v(t,i)}function O(e,t){var i=e[Y];return(i?m(i):e)[t]}function I(e,t){if(t in e)for(var i=Object.getPrototypeOf(e);i;){var n=Object.getOwnPropertyDescriptor(i,t);if(n)return n;i=Object.getPrototypeOf(i)}}function R(e){e.P||(e.P=!0,e.l&&R(e.l))}function L(e){e.o||(e.o=g(e.t))}function B(e,t,i){var n=p(t)?x("MapSet").F(t,i):f(t)?x("MapSet").T(t,i):e.O?function(e,t){var i=Array.isArray(e),n={i:i?1:0,A:t?t.A:_(),P:!1,I:!1,R:{},l:t,t:e,k:null,o:null,j:null,C:!1},r=n,a=$;i&&(r=[n],a=ee);var s=Proxy.revocable(r,a),o=s.revoke,l=s.proxy;return n.k=l,n.j=o,l}(t,i):x("ES5").J(t,i);return(i?i.A:_()).p.push(n),n}function z(e){return a(e)||r(22,e),function e(t){if(!s(t))return t;var i,n=t[Y],r=l(t);if(n){if(!n.P&&(n.i<4||!x("ES5").K(n)))return n.t;n.I=!0,i=N(t,r),n.I=!1}else i=N(t,r);return o(i,(function(t,r){n&&h(n.t,t)===r||u(i,t,e(r))})),3===r?new Set(i):i}(e)}function N(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return g(e)}function F(){function e(e,t){var i=r[e];return i?i.enumerable=t:r[e]=i={configurable:!0,enumerable:t,get:function(){var t=this[Y];return $.get(t,e)},set:function(t){var i=this[Y];$.set(i,e,t)}},i}function t(e){for(var t=e.length-1;t>=0;t--){var r=e[t][Y];if(!r.P)switch(r.i){case 5:n(r)&&R(r);break;case 4:i(r)&&R(r)}}}function i(e){for(var t=e.t,i=e.k,n=Z(i),r=n.length-1;r>=0;r--){var a=n[r];if(a!==Y){var s=t[a];if(void 0===s&&!c(t,a))return!0;var o=i[a],l=o&&o[Y];if(l?l.t!==s:!d(o,s))return!0}}var h=!!t[Y];return n.length!==Z(t).length+(h?0:1)}function n(e){var t=e.k;if(t.length!==e.t.length)return!0;var i=Object.getOwnPropertyDescriptor(t,t.length-1);if(i&&!i.get)return!0;for(var n=0;n<t.length;n++)if(!t.hasOwnProperty(n))return!0;return!1}var r={};w("ES5",{J:function(t,i){var n=Array.isArray(t),r=function(t,i){if(t){for(var n=Array(i.length),r=0;r<i.length;r++)Object.defineProperty(n,""+r,e(r,!0));return n}var a=K(i);delete a[Y];for(var s=Z(a),o=0;o<s.length;o++){var l=s[o];a[l]=e(l,t||!!a[l].enumerable)}return Object.create(Object.getPrototypeOf(i),a)}(n,t),a={i:n?5:4,A:i?i.A:_(),P:!1,I:!1,R:{},l:i,t:t,k:r,o:null,g:!1,C:!1};return Object.defineProperty(r,Y,{value:a,writable:!0}),r},S:function(e,i,r){r?a(i)&&i[Y].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var i=t[Y];if(i){var r=i.t,a=i.k,s=i.R,l=i.i;if(4===l)o(a,(function(t){t!==Y&&(void 0!==r[t]||c(r,t)?s[t]||e(a[t]):(s[t]=!0,R(i)))})),o(r,(function(e){void 0!==a[e]||c(a,e)||(s[e]=!1,R(i))}));else if(5===l){if(n(i)&&(R(i),s.length=!0),a.length<r.length)for(var h=a.length;h<r.length;h++)s[h]=!1;else for(var u=r.length;u<a.length;u++)s[u]=!0;for(var d=Math.min(a.length,r.length),p=0;p<d;p++)a.hasOwnProperty(p)||(s[p]=!0),void 0===s[p]&&e(a[p])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?i(e):n(e)}})}var j,V,U="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),G="undefined"!=typeof Map,H="undefined"!=typeof Set,W="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,q=U?Symbol.for("immer-nothing"):((j={})["immer-nothing"]=!0,j),X=U?Symbol.for("immer-draftable"):"__$immer_draftable",Y=U?Symbol.for("immer-state"):"__$immer_state",Q=("undefined"!=typeof Symbol&&Symbol.iterator,""+Object.prototype.constructor),Z="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,K=Object.getOwnPropertyDescriptors||function(e){var t={};return Z(e).forEach((function(i){t[i]=Object.getOwnPropertyDescriptor(e,i)})),t},J={},$={get:function(e,t){if(t===Y)return e;var i=m(e);if(!c(i,t))return function(e,t,i){var n,r=I(t,i);return r?"value"in r?r.value:null===(n=r.get)||void 0===n?void 0:n.call(e.k):void 0}(e,i,t);var n=i[t];return e.I||!s(n)?n:n===O(e.t,t)?(L(e),e.o[t]=B(e.A.h,n,e)):n},has:function(e,t){return t in m(e)},ownKeys:function(e){return Reflect.ownKeys(m(e))},set:function(e,t,i){var n=I(m(e),t);if(null==n?void 0:n.set)return n.set.call(e.k,i),!0;if(!e.P){var r=O(m(e),t),a=null==r?void 0:r[Y];if(a&&a.t===i)return e.o[t]=i,e.R[t]=!1,!0;if(d(i,r)&&(void 0!==i||c(e.t,t)))return!0;L(e),R(e)}return e.o[t]===i&&(void 0!==i||t in e.o)||Number.isNaN(i)&&Number.isNaN(e.o[t])||(e.o[t]=i,e.R[t]=!0),!0},deleteProperty:function(e,t){return void 0!==O(e.t,t)||t in e.t?(e.R[t]=!1,L(e),R(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var i=m(e),n=Reflect.getOwnPropertyDescriptor(i,t);return n?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:n.enumerable,value:i[t]}:n},defineProperty:function(){r(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){r(12)}},ee={};o($,(function(e,t){ee[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),ee.deleteProperty=function(e,t){return ee.set.call(this,e,t,void 0)},ee.set=function(e,t,i){return $.set.call(this,e[0],t,i,e[0])};var te=function(){function e(e){var t=this;this.O=W,this.D=!0,this.produce=function(e,i,n){if("function"==typeof e&&"function"!=typeof i){var a=i;i=e;var o=t;return function(e){var t=this;void 0===e&&(e=a);for(var n=arguments.length,r=Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return o.produce(e,(function(e){var n;return(n=i).call.apply(n,[t,e].concat(r))}))}}var l;if("function"!=typeof i&&r(6),void 0!==n&&"function"!=typeof n&&r(7),s(e)){var c=A(t),h=B(t,e,void 0),u=!0;try{l=i(h),u=!1}finally{u?E(c):C(c)}return"undefined"!=typeof Promise&&l instanceof Promise?l.then((function(e){return S(c,n),T(e,c)}),(function(e){throw E(c),e})):(S(c,n),T(l,c))}if(!e||"object"!=typeof e){if(void 0===(l=i(e))&&(l=e),l===q&&(l=void 0),t.D&&v(l,!0),n){var d=[],p=[];x("Patches").M(e,l,d,p),n(d,p)}return l}r(21,e)},this.produceWithPatches=function(e,i){if("function"==typeof e)return function(i){for(var n=arguments.length,r=Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return t.produceWithPatches(i,(function(t){return e.apply(void 0,[t].concat(r))}))};var n,r,a=t.produce(e,i,(function(e,t){n=e,r=t}));return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(e){return[e,n,r]})):[a,n,r]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){s(e)||r(8),a(e)&&(e=z(e));var t=A(this),i=B(this,e,void 0);return i[Y].C=!0,C(t),i},t.finishDraft=function(e,t){var i=(e&&e[Y]).A;return S(i,t),T(void 0,i)},t.setAutoFreeze=function(e){this.D=e},t.setUseProxies=function(e){e&&!W&&r(20),this.O=e},t.applyPatches=function(e,t){var i;for(i=t.length-1;i>=0;i--){var n=t[i];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}i>-1&&(t=t.slice(i+1));var r=x("Patches").$;return a(e)?r(e,t):this.produce(e,(function(e){return r(e,t)}))},e}(),ie=new te,ne=ie.produce;ie.produceWithPatches.bind(ie),ie.setAutoFreeze.bind(ie),ie.setUseProxies.bind(ie),ie.applyPatches.bind(ie),ie.createDraft.bind(ie),ie.finishDraft.bind(ie);const re=ne;function ae(e){return ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ae(e)}function se(e){var t=function(e,t){if("object"!=ae(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=ae(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ae(t)?t:String(t)}function oe(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function le(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(i),!0).forEach((function(t){var n,r,a;n=e,r=t,a=i[t],(r=se(r))in n?Object.defineProperty(n,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[r]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):oe(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function ce(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var he="function"===typeof Symbol&&Symbol.observable||"@@observable",ue=function(){return Math.random().toString(36).substring(7).split("").join(".")},de={INIT:"@@redux/INIT"+ue(),REPLACE:"@@redux/REPLACE"+ue(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ue()}};function pe(e){if("object"!==typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function fe(e,t,i){var n;if("function"===typeof t&&"function"===typeof i||"function"===typeof i&&"function"===typeof arguments[3])throw new Error(ce(0));if("function"===typeof t&&"undefined"===typeof i&&(i=t,t=void 0),"undefined"!==typeof i){if("function"!==typeof i)throw new Error(ce(1));return i(fe)(e,t)}if("function"!==typeof e)throw new Error(ce(2));var r=e,a=t,s=[],o=s,l=!1;function c(){o===s&&(o=s.slice())}function h(){if(l)throw new Error(ce(3));return a}function u(e){if("function"!==typeof e)throw new Error(ce(4));if(l)throw new Error(ce(5));var t=!0;return c(),o.push(e),function(){if(t){if(l)throw new Error(ce(6));t=!1,c();var i=o.indexOf(e);o.splice(i,1),s=null}}}function d(e){if(!pe(e))throw new Error(ce(7));if("undefined"===typeof e.type)throw new Error(ce(8));if(l)throw new Error(ce(9));try{l=!0,a=r(a,e)}finally{l=!1}for(var t=s=o,i=0;i<t.length;i++){(0,t[i])()}return e}return d({type:de.INIT}),(n={dispatch:d,subscribe:u,getState:h,replaceReducer:function(e){if("function"!==typeof e)throw new Error(ce(10));r=e,d({type:de.REPLACE})}})[he]=function(){var e,t=u;return(e={subscribe:function(e){if("object"!==typeof e||null===e)throw new Error(ce(11));function i(){e.next&&e.next(h())}return i(),{unsubscribe:t(i)}}})[he]=function(){return this},e},n}function me(e){for(var t=Object.keys(e),i={},n=0;n<t.length;n++){var r=t[n];0,"function"===typeof e[r]&&(i[r]=e[r])}var a,s=Object.keys(i);try{!function(e){Object.keys(e).forEach((function(t){var i=e[t];if("undefined"===typeof i(void 0,{type:de.INIT}))throw new Error(ce(12));if("undefined"===typeof i(void 0,{type:de.PROBE_UNKNOWN_ACTION()}))throw new Error(ce(13))}))}(i)}catch(o){a=o}return function(e,t){if(void 0===e&&(e={}),a)throw a;for(var n=!1,r={},o=0;o<s.length;o++){var l=s[o],c=i[l],h=e[l],u=c(h,t);if("undefined"===typeof u){t&&t.type;throw new Error(ce(14))}r[l]=u,n=n||u!==h}return(n=n||s.length!==Object.keys(e).length)?r:e}}function ge(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}function ve(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return function(e){return function(){var i=e.apply(void 0,arguments),n=function(){throw new Error(ce(15))},r={getState:i.getState,dispatch:function(){return n.apply(void 0,arguments)}},a=t.map((function(e){return e(r)}));return n=ge.apply(void 0,a)(i.dispatch),le(le({},i),{},{dispatch:n})}}}function ye(e){return function(t){var i=t.dispatch,n=t.getState;return function(t){return function(r){return"function"===typeof r?r(i,n,e):t(r)}}}}var be=ye();be.withExtraArgument=ye;const xe=be;var we=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!==typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),_e=function(e,t){var i,n,r,a,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(a){return function(o){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&a[0]?n.return:a[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;switch(n=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){s.label=a[1];break}if(6===a[0]&&s.label<r[1]){s.label=r[1],r=a;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(a);break}r[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(o){a=[6,o],n=0}finally{i=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,o])}}},Se=function(e,t){for(var i=0,n=t.length,r=e.length;i<n;i++,r++)e[r]=t[i];return e},Ee=Object.defineProperty,Ce=Object.defineProperties,Ae=Object.getOwnPropertyDescriptors,Me=Object.getOwnPropertySymbols,Te=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable,De=function(e,t,i){return t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i},ke=function(e,t){for(var i in t||(t={}))Te.call(t,i)&&De(e,i,t[i]);if(Me)for(var n=0,r=Me(t);n<r.length;n++){i=r[n];Pe.call(t,i)&&De(e,i,t[i])}return e},Oe=function(e,t){return Ce(e,Ae(t))},Ie=function(e,t,i){return new Promise((function(n,r){var a=function(e){try{o(i.next(e))}catch(t){r(t)}},s=function(e){try{o(i.throw(e))}catch(t){r(t)}},o=function(e){return e.done?n(e.value):Promise.resolve(e.value).then(a,s)};o((i=i.apply(e,t)).next())}))},Re="undefined"!==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"===typeof arguments[0]?ge:ge.apply(null,arguments)};"undefined"!==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function Le(e){if("object"!==typeof e||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var i=t;null!==Object.getPrototypeOf(i);)i=Object.getPrototypeOf(i);return t===i}function Be(e,t){function i(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];if(t){var r=t.apply(void 0,i);if(!r)throw new Error("prepareAction did not return an object");return ke(ke({type:e,payload:r.payload},"meta"in r&&{meta:r.meta}),"error"in r&&{error:r.error})}return{type:e,payload:i[0]}}return i.toString=function(){return""+e},i.type=e,i.match=function(t){return t.type===e},i}var ze=function(e){function t(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];var r=e.apply(this,i)||this;return Object.setPrototypeOf(r,t.prototype),r}return we(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,Se([void 0],e[0].concat(this)))):new(t.bind.apply(t,Se([void 0],e.concat(this))))},t}(Array),Ne=function(e){function t(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];var r=e.apply(this,i)||this;return Object.setPrototypeOf(r,t.prototype),r}return we(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,Se([void 0],e[0].concat(this)))):new(t.bind.apply(t,Se([void 0],e.concat(this))))},t}(Array);function Fe(e){return s(e)?re(e,(function(){})):e}function je(){return function(e){return function(e){void 0===e&&(e={});var t=e.thunk,i=void 0===t||t,n=(e.immutableCheck,e.serializableCheck,e.actionCreatorCheck,new ze);i&&(!function(e){return"boolean"===typeof e}(i)?n.push(xe.withExtraArgument(i.extraArgument)):n.push(xe));0;return n}(e)}}function Ve(e){var t,i={},n=[],r={addCase:function(e,t){var n="string"===typeof e?e:e.type;if(!n)throw new Error("`builder.addCase` cannot be called with an empty action type");if(n in i)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return i[n]=t,r},addMatcher:function(e,t){return n.push({matcher:e,reducer:t}),r},addDefaultCase:function(e){return t=e,r}};return e(r),[i,n,t]}function Ue(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");var i,n="function"==typeof e.initialState?e.initialState:Fe(e.initialState),r=e.reducers||{},o=Object.keys(r),l={},c={},h={};function u(){var t="function"===typeof e.extraReducers?Ve(e.extraReducers):[e.extraReducers],i=t[0],r=void 0===i?{}:i,o=t[1],l=void 0===o?[]:o,h=t[2],u=void 0===h?void 0:h,d=ke(ke({},r),c);return function(e,t,i,n){void 0===i&&(i=[]);var r,o="function"===typeof t?Ve(t):[t,i,n],l=o[0],c=o[1],h=o[2];if(function(e){return"function"===typeof e}(e))r=function(){return Fe(e())};else{var u=Fe(e);r=function(){return u}}function d(e,t){void 0===e&&(e=r());var i=Se([l[t.type]],c.filter((function(e){return(0,e.matcher)(t)})).map((function(e){return e.reducer})));return 0===i.filter((function(e){return!!e})).length&&(i=[h]),i.reduce((function(e,i){if(i){var n;if(a(e))return void 0===(n=i(e,t))?e:n;if(s(e))return re(e,(function(e){return i(e,t)}));if(void 0===(n=i(e,t))){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return n}return e}),e)}return d.getInitialState=r,d}(n,(function(e){for(var t in d)e.addCase(t,d[t]);for(var i=0,n=l;i<n.length;i++){var r=n[i];e.addMatcher(r.matcher,r.reducer)}u&&e.addDefaultCase(u)}))}return o.forEach((function(e){var i,n,a=r[e],s=t+"/"+e;"reducer"in a?(i=a.reducer,n=a.prepare):i=a,l[e]=i,c[s]=i,h[e]=n?Be(s,n):Be(s)})),{name:t,reducer:function(e,t){return i||(i=u()),i(e,t)},actions:h,caseReducers:l,getInitialState:function(){return i||(i=u()),i.getInitialState()}}}var Ge=function(e){void 0===e&&(e=21);for(var t="",i=e;i--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},He=["name","message","stack","code"],We=function(e,t){this.payload=e,this.meta=t},qe=function(e,t){this.payload=e,this.meta=t},Xe=function(e){if("object"===typeof e&&null!==e){for(var t={},i=0,n=He;i<n.length;i++){var r=n[i];"string"===typeof e[r]&&(t[r]=e[r])}return t}return{message:String(e)}},Ye=function(){function e(e,t,i){var n=Be(e+"/fulfilled",(function(e,t,i,n){return{payload:e,meta:Oe(ke({},n||{}),{arg:i,requestId:t,requestStatus:"fulfilled"})}})),r=Be(e+"/pending",(function(e,t,i){return{payload:void 0,meta:Oe(ke({},i||{}),{arg:t,requestId:e,requestStatus:"pending"})}})),a=Be(e+"/rejected",(function(e,t,n,r,a){return{payload:r,error:(i&&i.serializeError||Xe)(e||"Rejected"),meta:Oe(ke({},a||{}),{arg:n,requestId:t,rejectedWithValue:!!r,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)})}})),s="undefined"!==typeof AbortController?AbortController:function(){function e(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return e.prototype.abort=function(){0},e}();return Object.assign((function(e){return function(o,l,c){var h,u=(null==i?void 0:i.idGenerator)?i.idGenerator(e):Ge(),d=new s;function p(e){h=e,d.abort()}var f=function(){return Ie(this,null,(function(){var s,f,m,g,v,y;return _e(this,(function(b){switch(b.label){case 0:return b.trys.push([0,4,,5]),g=null==(s=null==i?void 0:i.condition)?void 0:s.call(i,e,{getState:l,extra:c}),null===(x=g)||"object"!==typeof x||"function"!==typeof x.then?[3,2]:[4,g];case 1:g=b.sent(),b.label=2;case 2:if(!1===g||d.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return!0,v=new Promise((function(e,t){return d.signal.addEventListener("abort",(function(){return t({name:"AbortError",message:h||"Aborted"})}))})),o(r(u,e,null==(f=null==i?void 0:i.getPendingMeta)?void 0:f.call(i,{requestId:u,arg:e},{getState:l,extra:c}))),[4,Promise.race([v,Promise.resolve(t(e,{dispatch:o,getState:l,extra:c,requestId:u,signal:d.signal,abort:p,rejectWithValue:function(e,t){return new We(e,t)},fulfillWithValue:function(e,t){return new qe(e,t)}})).then((function(t){if(t instanceof We)throw t;return t instanceof qe?n(t.payload,u,e,t.meta):n(t,u,e)}))])];case 3:return m=b.sent(),[3,5];case 4:return y=b.sent(),m=y instanceof We?a(null,u,e,y.payload,y.meta):a(y,u,e),[3,5];case 5:return i&&!i.dispatchConditionRejection&&a.match(m)&&m.meta.condition||o(m),[2,m]}var x}))}))}();return Object.assign(f,{abort:p,requestId:u,arg:e,unwrap:function(){return f.then(Qe)}})}}),{pending:r,rejected:a,fulfilled:n,typePrefix:e})}return e.withTypes=function(){return e},e}();function Qe(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}Object.assign;var Ze="listenerMiddleware";Be(Ze+"/add"),Be(Ze+"/removeAll"),Be(Ze+"/remove");"function"===typeof queueMicrotask&&queueMicrotask.bind("undefined"!==typeof window?window:"undefined"!==typeof __webpack_require__.g?__webpack_require__.g:globalThis);var Ke,Je=function(e){return function(t){setTimeout(t,e)}};"undefined"!==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:Je(10);F();var $e="NOT_FOUND";var et=function(e,t){return e===t};function tt(e,t){var i="object"===typeof t?t:{equalityCheck:t},n=i.equalityCheck,r=void 0===n?et:n,a=i.maxSize,s=void 0===a?1:a,o=i.resultEqualityCheck,l=function(e){return function(t,i){if(null===t||null===i||t.length!==i.length)return!1;for(var n=t.length,r=0;r<n;r++)if(!e(t[r],i[r]))return!1;return!0}}(r),c=1===s?function(e){var t;return{get:function(i){return t&&e(t.key,i)?t.value:$e},put:function(e,i){t={key:e,value:i}},getEntries:function(){return t?[t]:[]},clear:function(){t=void 0}}}(l):function(e,t){var i=[];function n(e){var n=i.findIndex((function(i){return t(e,i.key)}));if(n>-1){var r=i[n];return n>0&&(i.splice(n,1),i.unshift(r)),r.value}return $e}return{get:n,put:function(t,r){n(t)===$e&&(i.unshift({key:t,value:r}),i.length>e&&i.pop())},getEntries:function(){return i},clear:function(){i=[]}}}(s,l);function h(){var t=c.get(arguments);if(t===$e){if(t=e.apply(null,arguments),o){var i=c.getEntries().find((function(e){return o(e.value,t)}));i&&(t=i.value)}c.put(arguments,t)}return t}return h.clearCache=function(){return c.clear()},h}function it(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a,s=0,o={memoizeOptions:void 0},l=n.pop();if("object"===typeof l&&(o=l,l=n.pop()),"function"!==typeof l)throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof l+"]");var c=o.memoizeOptions,h=void 0===c?i:c,u=Array.isArray(h)?h:[h],d=function(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"===typeof e}))){var i=t.map((function(e){return"function"===typeof e?"function "+(e.name||"unnamed")+"()":typeof e})).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+i+"]")}return t}(n),p=e.apply(void 0,[function(){return s++,l.apply(null,arguments)}].concat(u)),f=e((function(){for(var e=[],t=d.length,i=0;i<t;i++)e.push(d[i].apply(null,arguments));return a=p.apply(null,e)}));return Object.assign(f,{resultFunc:l,memoizedResultFunc:p,dependencies:d,lastResult:function(){return a},recomputations:function(){return s},resetRecomputations:function(){return s=0}}),f}}var nt=it(tt);function rt(e,t){return function(){return e.apply(t,arguments)}}const{toString:at}=Object.prototype,{getPrototypeOf:st}=Object,ot=(lt=Object.create(null),e=>{const t=at.call(e);return lt[t]||(lt[t]=t.slice(8,-1).toLowerCase())});var lt;const ct=e=>(e=e.toLowerCase(),t=>ot(t)===e),ht=e=>t=>typeof t===e,{isArray:ut}=Array,dt=ht("undefined");const pt=ct("ArrayBuffer");const ft=ht("string"),mt=ht("function"),gt=ht("number"),vt=e=>null!==e&&"object"===typeof e,yt=e=>{if("object"!==ot(e))return!1;const t=st(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},bt=ct("Date"),xt=ct("File"),wt=ct("Blob"),_t=ct("FileList"),St=ct("URLSearchParams");function Et(e,t){let i,n,{allOwnKeys:r=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),ut(e))for(i=0,n=e.length;i<n;i++)t.call(null,e[i],i,e);else{const n=r?Object.getOwnPropertyNames(e):Object.keys(e),a=n.length;let s;for(i=0;i<a;i++)s=n[i],t.call(null,e[s],s,e)}}function Ct(e,t){t=t.toLowerCase();const i=Object.keys(e);let n,r=i.length;for(;r-- >0;)if(n=i[r],t===n.toLowerCase())return n;return null}const At="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:"undefined"!==typeof window?window:global,Mt=e=>!dt(e)&&e!==At;const Tt=(Pt="undefined"!==typeof Uint8Array&&st(Uint8Array),e=>Pt&&e instanceof Pt);var Pt;const Dt=ct("HTMLFormElement"),kt=(e=>{let{hasOwnProperty:t}=e;return(e,i)=>t.call(e,i)})(Object.prototype),Ot=ct("RegExp"),It=(e,t)=>{const i=Object.getOwnPropertyDescriptors(e),n={};Et(i,((i,r)=>{let a;!1!==(a=t(i,r,e))&&(n[r]=a||i)})),Object.defineProperties(e,n)},Rt="abcdefghijklmnopqrstuvwxyz",Lt="0123456789",Bt={DIGIT:Lt,ALPHA:Rt,ALPHA_DIGIT:Rt+Rt.toUpperCase()+Lt};const zt=ct("AsyncFunction"),Nt={isArray:ut,isArrayBuffer:pt,isBuffer:function(e){return null!==e&&!dt(e)&&null!==e.constructor&&!dt(e.constructor)&&mt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"===typeof FormData&&e instanceof FormData||mt(e.append)&&("formdata"===(t=ot(e))||"object"===t&&mt(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&pt(e.buffer),t},isString:ft,isNumber:gt,isBoolean:e=>!0===e||!1===e,isObject:vt,isPlainObject:yt,isUndefined:dt,isDate:bt,isFile:xt,isBlob:wt,isRegExp:Ot,isFunction:mt,isStream:e=>vt(e)&&mt(e.pipe),isURLSearchParams:St,isTypedArray:Tt,isFileList:_t,forEach:Et,merge:function e(){const{caseless:t}=Mt(this)&&this||{},i={},n=(n,r)=>{const a=t&&Ct(i,r)||r;yt(i[a])&&yt(n)?i[a]=e(i[a],n):yt(n)?i[a]=e({},n):ut(n)?i[a]=n.slice():i[a]=n};for(let r=0,a=arguments.length;r<a;r++)arguments[r]&&Et(arguments[r],n);return i},extend:function(e,t,i){let{allOwnKeys:n}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Et(t,((t,n)=>{i&&mt(t)?e[n]=rt(t,i):e[n]=t}),{allOwnKeys:n}),e},trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,i,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),i&&Object.assign(e.prototype,i)},toFlatObject:(e,t,i,n)=>{let r,a,s;const o={};if(t=t||{},null==e)return t;do{for(r=Object.getOwnPropertyNames(e),a=r.length;a-- >0;)s=r[a],n&&!n(s,e,t)||o[s]||(t[s]=e[s],o[s]=!0);e=!1!==i&&st(e)}while(e&&(!i||i(e,t))&&e!==Object.prototype);return t},kindOf:ot,kindOfTest:ct,endsWith:(e,t,i)=>{e=String(e),(void 0===i||i>e.length)&&(i=e.length),i-=t.length;const n=e.indexOf(t,i);return-1!==n&&n===i},toArray:e=>{if(!e)return null;if(ut(e))return e;let t=e.length;if(!gt(t))return null;const i=new Array(t);for(;t-- >0;)i[t]=e[t];return i},forEachEntry:(e,t)=>{const i=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=i.next())&&!n.done;){const i=n.value;t.call(e,i[0],i[1])}},matchAll:(e,t)=>{let i;const n=[];for(;null!==(i=e.exec(t));)n.push(i);return n},isHTMLForm:Dt,hasOwnProperty:kt,hasOwnProp:kt,reduceDescriptors:It,freezeMethods:e=>{It(e,((t,i)=>{if(mt(e)&&-1!==["arguments","caller","callee"].indexOf(i))return!1;const n=e[i];mt(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")}))}))},toObjectSet:(e,t)=>{const i={},n=e=>{e.forEach((e=>{i[e]=!0}))};return ut(e)?n(e):n(String(e).split(t)),i},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,i){return t.toUpperCase()+i})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:Ct,global:At,isContextDefined:Mt,ALPHABET:Bt,generateString:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Bt.ALPHA_DIGIT,i="";const{length:n}=t;for(;e--;)i+=t[Math.random()*n|0];return i},isSpecCompliantForm:function(e){return!!(e&&mt(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),i=(e,n)=>{if(vt(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const r=ut(e)?[]:{};return Et(e,((e,t)=>{const a=i(e,n+1);!dt(a)&&(r[t]=a)})),t[n]=void 0,r}}return e};return i(e,0)},isAsyncFn:zt,isThenable:e=>e&&(vt(e)||mt(e))&&mt(e.then)&&mt(e.catch)};function Ft(e,t,i,n,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),i&&(this.config=i),n&&(this.request=n),r&&(this.response=r)}Nt.inherits(Ft,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Nt.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const jt=Ft.prototype,Vt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Vt[e]={value:e}})),Object.defineProperties(Ft,Vt),Object.defineProperty(jt,"isAxiosError",{value:!0}),Ft.from=(e,t,i,n,r,a)=>{const s=Object.create(jt);return Nt.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),Ft.call(s,e.message,t,i,n,r),s.cause=e,s.name=e.name,a&&Object.assign(s,a),s};const Ut=Ft;function Gt(e){return Nt.isPlainObject(e)||Nt.isArray(e)}function Ht(e){return Nt.endsWith(e,"[]")?e.slice(0,-2):e}function Wt(e,t,i){return e?e.concat(t).map((function(e,t){return e=Ht(e),!i&&t?"["+e+"]":e})).join(i?".":""):t}const qt=Nt.toFlatObject(Nt,{},null,(function(e){return/^is[A-Z]/.test(e)}));const Xt=function(e,t,i){if(!Nt.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(i=Nt.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Nt.isUndefined(t[e])}))).metaTokens,r=i.visitor||c,a=i.dots,s=i.indexes,o=(i.Blob||"undefined"!==typeof Blob&&Blob)&&Nt.isSpecCompliantForm(t);if(!Nt.isFunction(r))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(Nt.isDate(e))return e.toISOString();if(!o&&Nt.isBlob(e))throw new Ut("Blob is not supported. Use a Buffer instead.");return Nt.isArrayBuffer(e)||Nt.isTypedArray(e)?o&&"function"===typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,i,r){let o=e;if(e&&!r&&"object"===typeof e)if(Nt.endsWith(i,"{}"))i=n?i:i.slice(0,-2),e=JSON.stringify(e);else if(Nt.isArray(e)&&function(e){return Nt.isArray(e)&&!e.some(Gt)}(e)||(Nt.isFileList(e)||Nt.endsWith(i,"[]"))&&(o=Nt.toArray(e)))return i=Ht(i),o.forEach((function(e,n){!Nt.isUndefined(e)&&null!==e&&t.append(!0===s?Wt([i],n,a):null===s?i:i+"[]",l(e))})),!1;return!!Gt(e)||(t.append(Wt(r,i,a),l(e)),!1)}const h=[],u=Object.assign(qt,{defaultVisitor:c,convertValue:l,isVisitable:Gt});if(!Nt.isObject(e))throw new TypeError("data must be an object");return function e(i,n){if(!Nt.isUndefined(i)){if(-1!==h.indexOf(i))throw Error("Circular reference detected in "+n.join("."));h.push(i),Nt.forEach(i,(function(i,a){!0===(!(Nt.isUndefined(i)||null===i)&&r.call(t,i,Nt.isString(a)?a.trim():a,n,u))&&e(i,n?n.concat(a):[a])})),h.pop()}}(e),t};function Yt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Qt(e,t){this._pairs=[],e&&Xt(e,this,t)}const Zt=Qt.prototype;Zt.append=function(e,t){this._pairs.push([e,t])},Zt.toString=function(e){const t=e?function(t){return e.call(this,t,Yt)}:Yt;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Kt=Qt;function Jt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function $t(e,t,i){if(!t)return e;const n=i&&i.encode||Jt,r=i&&i.serialize;let a;if(a=r?r(t,i):Nt.isURLSearchParams(t)?t.toString():new Kt(t,i).toString(n),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}const ei=class{constructor(){this.handlers=[]}use(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Nt.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ti={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ii={isBrowser:!0,classes:{URLSearchParams:"undefined"!==typeof URLSearchParams?URLSearchParams:Kt,FormData:"undefined"!==typeof FormData?FormData:null,Blob:"undefined"!==typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ni="undefined"!==typeof window&&"undefined"!==typeof document,ri=(ai="undefined"!==typeof navigator&&navigator.product,ni&&["ReactNative","NativeScript","NS"].indexOf(ai)<0);var ai;const si="undefined"!==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"===typeof self.importScripts,oi={...e,...ii};const li=function(e){function t(e,i,n,r){let a=e[r++];if("__proto__"===a)return!0;const s=Number.isFinite(+a),o=r>=e.length;if(a=!a&&Nt.isArray(n)?n.length:a,o)return Nt.hasOwnProp(n,a)?n[a]=[n[a],i]:n[a]=i,!s;n[a]&&Nt.isObject(n[a])||(n[a]=[]);return t(e,i,n[a],r)&&Nt.isArray(n[a])&&(n[a]=function(e){const t={},i=Object.keys(e);let n;const r=i.length;let a;for(n=0;n<r;n++)a=i[n],t[a]=e[a];return t}(n[a])),!s}if(Nt.isFormData(e)&&Nt.isFunction(e.entries)){const i={};return Nt.forEachEntry(e,((e,n)=>{t(function(e){return Nt.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,i,0)})),i}return null};const ci={transitional:ti,adapter:["xhr","http"],transformRequest:[function(e,t){const i=t.getContentType()||"",n=i.indexOf("application/json")>-1,r=Nt.isObject(e);r&&Nt.isHTMLForm(e)&&(e=new FormData(e));if(Nt.isFormData(e))return n?JSON.stringify(li(e)):e;if(Nt.isArrayBuffer(e)||Nt.isBuffer(e)||Nt.isStream(e)||Nt.isFile(e)||Nt.isBlob(e))return e;if(Nt.isArrayBufferView(e))return e.buffer;if(Nt.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(r){if(i.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Xt(e,new oi.classes.URLSearchParams,Object.assign({visitor:function(e,t,i,n){return oi.isNode&&Nt.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=Nt.isFileList(e))||i.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Xt(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return r||n?(t.setContentType("application/json",!1),function(e,t,i){if(Nt.isString(e))try{return(t||JSON.parse)(e),Nt.trim(e)}catch(n){if("SyntaxError"!==n.name)throw n}return(i||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ci.transitional,i=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&Nt.isString(e)&&(i&&!this.responseType||n)){const i=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(r){if(i){if("SyntaxError"===r.name)throw Ut.from(r,Ut.ERR_BAD_RESPONSE,this,null,this.response);throw r}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:oi.classes.FormData,Blob:oi.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Nt.forEach(["delete","get","head","post","put","patch"],(e=>{ci.headers[e]={}}));const hi=ci,ui=Nt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),di=Symbol("internals");function pi(e){return e&&String(e).trim().toLowerCase()}function fi(e){return!1===e||null==e?e:Nt.isArray(e)?e.map(fi):String(e)}function mi(e,t,i,n,r){return Nt.isFunction(n)?n.call(this,t,i):(r&&(t=i),Nt.isString(t)?Nt.isString(n)?-1!==t.indexOf(n):Nt.isRegExp(n)?n.test(t):void 0:void 0)}class gi{constructor(e){e&&this.set(e)}set(e,t,i){const n=this;function r(e,t,i){const r=pi(t);if(!r)throw new Error("header name must be a non-empty string");const a=Nt.findKey(n,r);(!a||void 0===n[a]||!0===i||void 0===i&&!1!==n[a])&&(n[a||t]=fi(e))}const a=(e,t)=>Nt.forEach(e,((e,i)=>r(e,i,t)));return Nt.isPlainObject(e)||e instanceof this.constructor?a(e,t):Nt.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?a((e=>{const t={};let i,n,r;return e&&e.split("\n").forEach((function(e){r=e.indexOf(":"),i=e.substring(0,r).trim().toLowerCase(),n=e.substring(r+1).trim(),!i||t[i]&&ui[i]||("set-cookie"===i?t[i]?t[i].push(n):t[i]=[n]:t[i]=t[i]?t[i]+", "+n:n)})),t})(e),t):null!=e&&r(t,e,i),this}get(e,t){if(e=pi(e)){const i=Nt.findKey(this,e);if(i){const e=this[i];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=i.exec(e);)t[n[1]]=n[2];return t}(e);if(Nt.isFunction(t))return t.call(this,e,i);if(Nt.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=pi(e)){const i=Nt.findKey(this,e);return!(!i||void 0===this[i]||t&&!mi(0,this[i],i,t))}return!1}delete(e,t){const i=this;let n=!1;function r(e){if(e=pi(e)){const r=Nt.findKey(i,e);!r||t&&!mi(0,i[r],r,t)||(delete i[r],n=!0)}}return Nt.isArray(e)?e.forEach(r):r(e),n}clear(e){const t=Object.keys(this);let i=t.length,n=!1;for(;i--;){const r=t[i];e&&!mi(0,this[r],r,e,!0)||(delete this[r],n=!0)}return n}normalize(e){const t=this,i={};return Nt.forEach(this,((n,r)=>{const a=Nt.findKey(i,r);if(a)return t[a]=fi(n),void delete t[r];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,i)=>t.toUpperCase()+i))}(r):String(r).trim();s!==r&&delete t[r],t[s]=fi(n),i[s]=!0})),this}concat(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.constructor.concat(this,...t)}toJSON(e){const t=Object.create(null);return Nt.forEach(this,((i,n)=>{null!=i&&!1!==i&&(t[n]=e&&Nt.isArray(i)?i.join(", "):i)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((e=>{let[t,i]=e;return t+": "+i})).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e){const t=new this(e);for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return n.forEach((e=>t.set(e))),t}static accessor(e){const t=(this[di]=this[di]={accessors:{}}).accessors,i=this.prototype;function n(e){const n=pi(e);t[n]||(!function(e,t){const i=Nt.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+i,{value:function(e,i,r){return this[n].call(this,t,e,i,r)},configurable:!0})}))}(i,e),t[n]=!0)}return Nt.isArray(e)?e.forEach(n):n(e),this}}gi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Nt.reduceDescriptors(gi.prototype,((e,t)=>{let{value:i}=e,n=t[0].toUpperCase()+t.slice(1);return{get:()=>i,set(e){this[n]=e}}})),Nt.freezeMethods(gi);const vi=gi;function yi(e,t){const i=this||hi,n=t||i,r=vi.from(n.headers);let a=n.data;return Nt.forEach(e,(function(e){a=e.call(i,a,r.normalize(),t?t.status:void 0)})),r.normalize(),a}function bi(e){return!(!e||!e.__CANCEL__)}function xi(e,t,i){Ut.call(this,null==e?"canceled":e,Ut.ERR_CANCELED,t,i),this.name="CanceledError"}Nt.inherits(xi,Ut,{__CANCEL__:!0});const wi=xi;const _i=oi.hasStandardBrowserEnv?{write(e,t,i,n,r,a){const s=[e+"="+encodeURIComponent(t)];Nt.isNumber(i)&&s.push("expires="+new Date(i).toGMTString()),Nt.isString(n)&&s.push("path="+n),Nt.isString(r)&&s.push("domain="+r),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Si(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Ei=oi.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let i;function n(i){let n=i;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return i=n(window.location.href),function(e){const t=Nt.isString(e)?n(e):e;return t.protocol===i.protocol&&t.host===i.host}}():function(){return!0};const Ci=function(e,t){e=e||10;const i=new Array(e),n=new Array(e);let r,a=0,s=0;return t=void 0!==t?t:1e3,function(o){const l=Date.now(),c=n[s];r||(r=l),i[a]=o,n[a]=l;let h=s,u=0;for(;h!==a;)u+=i[h++],h%=e;if(a=(a+1)%e,a===s&&(s=(s+1)%e),l-r<t)return;const d=c&&l-c;return d?Math.round(1e3*u/d):void 0}};function Ai(e,t){let i=0;const n=Ci(50,250);return r=>{const a=r.loaded,s=r.lengthComputable?r.total:void 0,o=a-i,l=n(o);i=a;const c={loaded:a,total:s,progress:s?a/s:void 0,bytes:o,rate:l||void 0,estimated:l&&s&&a<=s?(s-a)/l:void 0,event:r};c[t?"download":"upload"]=!0,e(c)}}const Mi={http:null,xhr:"undefined"!==typeof XMLHttpRequest&&function(e){return new Promise((function(t,i){let n=e.data;const r=vi.from(e.headers).normalize();let a,s,{responseType:o,withXSRFToken:l}=e;function c(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}if(Nt.isFormData(n))if(oi.hasStandardBrowserEnv||oi.hasStandardBrowserWebWorkerEnv)r.setContentType(!1);else if(!1!==(s=r.getContentType())){const[e,...t]=s?s.split(";").map((e=>e.trim())).filter(Boolean):[];r.setContentType([e||"multipart/form-data",...t].join("; "))}let h=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",i=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";r.set("Authorization","Basic "+btoa(t+":"+i))}const u=Si(e.baseURL,e.url);function d(){if(!h)return;const n=vi.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());!function(e,t,i){const n=i.config.validateStatus;i.status&&n&&!n(i.status)?t(new Ut("Request failed with status code "+i.status,[Ut.ERR_BAD_REQUEST,Ut.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i)):e(i)}((function(e){t(e),c()}),(function(e){i(e),c()}),{data:o&&"text"!==o&&"json"!==o?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:e,request:h}),h=null}if(h.open(e.method.toUpperCase(),$t(u,e.params,e.paramsSerializer),!0),h.timeout=e.timeout,"onloadend"in h?h.onloadend=d:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(d)},h.onabort=function(){h&&(i(new Ut("Request aborted",Ut.ECONNABORTED,e,h)),h=null)},h.onerror=function(){i(new Ut("Network Error",Ut.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||ti;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),i(new Ut(t,n.clarifyTimeoutError?Ut.ETIMEDOUT:Ut.ECONNABORTED,e,h)),h=null},oi.hasStandardBrowserEnv&&(l&&Nt.isFunction(l)&&(l=l(e)),l||!1!==l&&Ei(u))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&_i.read(e.xsrfCookieName);t&&r.set(e.xsrfHeaderName,t)}void 0===n&&r.setContentType(null),"setRequestHeader"in h&&Nt.forEach(r.toJSON(),(function(e,t){h.setRequestHeader(t,e)})),Nt.isUndefined(e.withCredentials)||(h.withCredentials=!!e.withCredentials),o&&"json"!==o&&(h.responseType=e.responseType),"function"===typeof e.onDownloadProgress&&h.addEventListener("progress",Ai(e.onDownloadProgress,!0)),"function"===typeof e.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",Ai(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{h&&(i(!t||t.type?new wi(null,e,h):t),h.abort(),h=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const p=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);p&&-1===oi.protocols.indexOf(p)?i(new Ut("Unsupported protocol "+p+":",Ut.ERR_BAD_REQUEST,e)):h.send(n||null)}))}};Nt.forEach(Mi,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(i){}Object.defineProperty(e,"adapterName",{value:t})}}));const Ti=e=>"- ".concat(e),Pi=e=>Nt.isFunction(e)||null===e||!1===e,Di=e=>{e=Nt.isArray(e)?e:[e];const{length:t}=e;let i,n;const r={};for(let a=0;a<t;a++){let t;if(i=e[a],n=i,!Pi(i)&&(n=Mi[(t=String(i)).toLowerCase()],void 0===n))throw new Ut("Unknown adapter '".concat(t,"'"));if(n)break;r[t||"#"+a]=n}if(!n){const e=Object.entries(r).map((e=>{let[t,i]=e;return"adapter ".concat(t," ")+(!1===i?"is not supported by the environment":"is not available in the build")}));let i=t?e.length>1?"since :\n"+e.map(Ti).join("\n"):" "+Ti(e[0]):"as no adapter specified";throw new Ut("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return n};function ki(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new wi(null,e)}function Oi(e){ki(e),e.headers=vi.from(e.headers),e.data=yi.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Di(e.adapter||hi.adapter)(e).then((function(t){return ki(e),t.data=yi.call(e,e.transformResponse,t),t.headers=vi.from(t.headers),t}),(function(t){return bi(t)||(ki(e),t&&t.response&&(t.response.data=yi.call(e,e.transformResponse,t.response),t.response.headers=vi.from(t.response.headers))),Promise.reject(t)}))}const Ii=e=>e instanceof vi?e.toJSON():e;function Ri(e,t){t=t||{};const i={};function n(e,t,i){return Nt.isPlainObject(e)&&Nt.isPlainObject(t)?Nt.merge.call({caseless:i},e,t):Nt.isPlainObject(t)?Nt.merge({},t):Nt.isArray(t)?t.slice():t}function r(e,t,i){return Nt.isUndefined(t)?Nt.isUndefined(e)?void 0:n(void 0,e,i):n(e,t,i)}function a(e,t){if(!Nt.isUndefined(t))return n(void 0,t)}function s(e,t){return Nt.isUndefined(t)?Nt.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function o(i,r,a){return a in t?n(i,r):a in e?n(void 0,i):void 0}const l={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:o,headers:(e,t)=>r(Ii(e),Ii(t),!0)};return Nt.forEach(Object.keys(Object.assign({},e,t)),(function(n){const a=l[n]||r,s=a(e[n],t[n],n);Nt.isUndefined(s)&&a!==o||(i[n]=s)})),i}const Li="1.6.7",Bi={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Bi[e]=function(i){return typeof i===e||"a"+(t<1?"n ":" ")+e}}));const zi={};Bi.transitional=function(e,t,i){function n(e,t){return"[Axios v1.6.7] Transitional option '"+e+"'"+t+(i?". "+i:"")}return(i,r,a)=>{if(!1===e)throw new Ut(n(r," has been removed"+(t?" in "+t:"")),Ut.ERR_DEPRECATED);return t&&!zi[r]&&(zi[r]=!0,console.warn(n(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(i,r,a)}};const Ni={assertOptions:function(e,t,i){if("object"!==typeof e)throw new Ut("options must be an object",Ut.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let r=n.length;for(;r-- >0;){const a=n[r],s=t[a];if(s){const t=e[a],i=void 0===t||s(t,a,e);if(!0!==i)throw new Ut("option "+a+" must be "+i,Ut.ERR_BAD_OPTION_VALUE)}else if(!0!==i)throw new Ut("Unknown option "+a,Ut.ERR_BAD_OPTION)}},validators:Bi},Fi=Ni.validators;class ji{constructor(e){this.defaults=e,this.interceptors={request:new ei,response:new ei}}async request(e,t){try{return await this._request(e,t)}catch(i){if(i instanceof Error){let e;Error.captureStackTrace?Error.captureStackTrace(e={}):e=new Error;const t=e.stack?e.stack.replace(/^.+\n/,""):"";i.stack?t&&!String(i.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(i.stack+="\n"+t):i.stack=t}throw i}}_request(e,t){"string"===typeof e?(t=t||{}).url=e:t=e||{},t=Ri(this.defaults,t);const{transitional:i,paramsSerializer:n,headers:r}=t;void 0!==i&&Ni.assertOptions(i,{silentJSONParsing:Fi.transitional(Fi.boolean),forcedJSONParsing:Fi.transitional(Fi.boolean),clarifyTimeoutError:Fi.transitional(Fi.boolean)},!1),null!=n&&(Nt.isFunction(n)?t.paramsSerializer={serialize:n}:Ni.assertOptions(n,{encode:Fi.function,serialize:Fi.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=r&&Nt.merge(r.common,r[t.method]);r&&Nt.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete r[e]})),t.headers=vi.concat(a,r);const s=[];let o=!0;this.interceptors.request.forEach((function(e){"function"===typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const l=[];let c;this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)}));let h,u=0;if(!o){const e=[Oi.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,l),h=e.length,c=Promise.resolve(t);u<h;)c=c.then(e[u++],e[u++]);return c}h=s.length;let d=t;for(u=0;u<h;){const e=s[u++],t=s[u++];try{d=e(d)}catch(p){t.call(this,p);break}}try{c=Oi.call(this,d)}catch(p){return Promise.reject(p)}for(u=0,h=l.length;u<h;)c=c.then(l[u++],l[u++]);return c}getUri(e){return $t(Si((e=Ri(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}Nt.forEach(["delete","get","head","options"],(function(e){ji.prototype[e]=function(t,i){return this.request(Ri(i||{},{method:e,url:t,data:(i||{}).data}))}})),Nt.forEach(["post","put","patch"],(function(e){function t(t){return function(i,n,r){return this.request(Ri(r||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:i,data:n}))}}ji.prototype[e]=t(),ji.prototype[e+"Form"]=t(!0)}));const Vi=ji;class Ui{constructor(e){if("function"!==typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const i=this;this.promise.then((e=>{if(!i._listeners)return;let t=i._listeners.length;for(;t-- >0;)i._listeners[t](e);i._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{i.subscribe(e),t=e})).then(e);return n.cancel=function(){i.unsubscribe(t)},n},e((function(e,n,r){i.reason||(i.reason=new wi(e,n,r),t(i.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;const t=new Ui((function(t){e=t}));return{token:t,cancel:e}}}const Gi=Ui;const Hi={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Hi).forEach((e=>{let[t,i]=e;Hi[i]=t}));const Wi=Hi;const qi=function e(t){const i=new Vi(t),n=rt(Vi.prototype.request,i);return Nt.extend(n,Vi.prototype,i,{allOwnKeys:!0}),Nt.extend(n,i,null,{allOwnKeys:!0}),n.create=function(i){return e(Ri(t,i))},n}(hi);qi.Axios=Vi,qi.CanceledError=wi,qi.CancelToken=Gi,qi.isCancel=bi,qi.VERSION=Li,qi.toFormData=Xt,qi.AxiosError=Ut,qi.Cancel=qi.CanceledError,qi.all=function(e){return Promise.all(e)},qi.spread=function(e){return function(t){return e.apply(null,t)}},qi.isAxiosError=function(e){return Nt.isObject(e)&&!0===e.isAxiosError},qi.mergeConfig=Ri,qi.AxiosHeaders=vi,qi.formToJSON=e=>li(Nt.isHTMLForm(e)?new FormData(e):e),qi.getAdapter=Di,qi.HttpStatusCode=Wi,qi.default=qi;const Xi=qi,Yi=JSON.parse('{"Bd":{"ES":"/pages/resources","EL":"/vacancies/","HO":"/pages/career","Ud":"/pages/resources/crop-nutrition-programs","cQ":"/pages/resources/trail-results","UR":"/pages/resources/information-materials","ZE":"/pages/products","sk":"/products/","TB":"/pages/homepage","M3":"/pages/contacts","D_":"/pages/terms-conditions","zu":"/pages/legal-info","hs":"/pages/blog","vg":"/posts/","zG":"/pages/about","wT":"/pages/general-translation"},"FR":"/vacancies","m$":"/products","Qc":"/countries","ZO":"/languages","DQ":"/employees","Ki":"/crops","WO":"/posts","$P":"/search","rZ":"/catalogs","B1":"/subscribe","Zd":"/form"}'),Qi="nutrition",Zi="trials",Ki=8,Ji=9,$i=4,en=6,tn="https://api-uniferx.goodface.com.ua/api",nn=(e,t,i)=>Ye(e,(async(e,i)=>{let{getState:n}=i;const{languageState:r}=n(),a=await t({language:r.language.code,country:r.country.code,...e}).catch((e=>{throw e}));return a.data}),{condition:i}),rn=nn("fetchResources",(e=>Xi.get("".concat(tn+Yi.Bd.ES),{params:e})),((e,t)=>{let{getState:i}=t;const{data:n}=i().resourcesState.resources;return!n})),an=Ue({name:"resourcesSlice",initialState:{resources:{}},reducers:{},extraReducers:e=>{e.addCase(rn.fulfilled,((e,t)=>{e.resources=t.payload}))}}),sn=nt([e=>e.resourcesState.resources],(e=>e.data||{})),on=nt([e=>e.resourcesState.resources],(e=>"success"!==(null===e||void 0===e?void 0:e.status))),ln=an.reducer,cn=nn("fetchProducts",(e=>Xi.get("".concat(tn+Yi.Bd.ZE),{params:e})),((e,t)=>{let{getState:i}=t;const{data:n}=i().productsState.products;return!n})),hn=nn("fetchProduct",(e=>{const{slug:t,language:i,country:n}=e;return Xi.get("".concat(tn+Yi.Bd.sk+t),{params:{language:i,country:n}})})),un=nn("fetchMainProducts",(e=>{const{language:t,country:i,page:n=1,limit:r=10}=e;return Xi.get("".concat(tn+Yi.m$),{params:{language:t,country:i,page:n,limit:r}})})),dn=nn("fetchRelatedProducts",(e=>{const{slug:t,language:i,country:n,page:r=1,limit:a=Ki}=e;return Xi.get("".concat(tn+Yi.Bd.sk+t+"/related"),{params:{language:i,country:n,page:r,limit:a}})})),pn=Ue({name:"productsSlice",initialState:{products:{},mainProducts:{},productContent:{},relatedProducts:{data:[],next:!1}},reducers:{},extraReducers:e=>{e.addCase(un.fulfilled,((e,t)=>{e.mainProducts=t.payload})).addCase(cn.fulfilled,((e,t)=>{e.products=t.payload})).addCase(dn.fulfilled,((e,t)=>{const{payload:i,meta:n}=t;e.relatedProducts.next=i.data.next,1===n.arg.page?e.relatedProducts.data=i.data.data:e.relatedProducts.data.push(...i.data.data)})).addCase(hn.pending,(e=>{e.productContent={},e.relatedProducts={data:[],next:!1}})).addCase(hn.fulfilled,((e,t)=>{e.productContent=t.payload}))}}),fn=nt([e=>e.productsState.products],(e=>e.data||{})),mn=nt([e=>e.productsState.products],(e=>"success"!==(null===e||void 0===e?void 0:e.status))),gn=nt([e=>e.productsState.productContent],(e=>e.data||{})),vn=nt([e=>e.productsState.productContent],(e=>"success"!==(null===e||void 0===e?void 0:e.status))),yn=nt([e=>e.productsState.mainProducts],(e=>e.data||[])),bn=nt([yn],(e=>(null===e||void 0===e?void 0:e.map((e=>({value:e.slug,name:e.preview_title}))))||[])),xn=nt([e=>e.productsState.relatedProducts],(e=>e||{})),wn=pn.reducer,_n=e=>{const{slug:t,product:i,language:n,country:r,trials_country:a,type:s,page:o=1,limit:l=Ki,all:c}=e;return Xi.get("".concat(tn+Yi.Ki),{params:{language:n,country:r,product:i,trials_country:a,type:s,page:o,slug:t,limit:l,all:c}})},Sn=nn("fetchTrialResults",(e=>Xi.get("".concat(tn+Yi.Bd.cQ),{params:e})),((e,t)=>{let{getState:i}=t;const{data:n}=i().trialResultsState.trialResults;return!n})),En=nn("fetchTrialResultsFlyers",(e=>{const{slug:t,language:i,country:n,page:r=1,limit:a=en,product:s,trials_country:o}=e;return Xi.get("".concat(tn+Yi.Ki+"/"+t+"/flyers"),{params:{language:i,country:n,page:r,limit:a,product:s,trials_country:o}})})),Cn=nn("fetchTrialResultsForProductForCurrentCountry",_n),An=nn("fetchTrialResultsForProductForOthers",_n),Mn=nn("fetchTrialResultsPageList",_n),Tn=nn("fetchDetailTrialResults",(e=>{const{slug:t,language:i,country:n,type:r=Zi}=e;return Xi.get("".concat(tn+Yi.Ki+"/"+t),{params:{language:i,country:n,type:r}})})),Pn=Ue({name:"trialResultsSlice",initialState:{trialResults:{},trialResultsDetails:{},trialResultsFlyers:{flyers:[],next:!1},trialResultsPageList:{},allCropTrialForFilter:{data:[]},trialResultsForProductForCurrentCountry:{data:[],next:!1},trialResultsForProductForOthers:{data:[],next:!1},currentProductFilter:null,currentCountryFilter:null},reducers:{setCurrentProductFilter:(e,t)=>{e.currentProductFilter=t.payload},setCurrentCountryFilter:(e,t)=>{e.currentCountryFilter=t.payload}},extraReducers:e=>{e.addCase(Sn.fulfilled,((e,t)=>{e.trialResults=t.payload})).addCase(Tn.pending,((e,t)=>{e.trialResultsDetails={}})).addCase(Tn.fulfilled,((e,t)=>{e.trialResultsDetails=t.payload})).addCase(Mn.fulfilled,((e,t)=>{e.trialResultsPageList=t.payload,e.allCropTrialForFilter.data.length||(e.allCropTrialForFilter=t.payload)})).addCase(En.fulfilled,((e,t)=>{const{payload:i,meta:n}=t;e.trialResultsFlyers.next=i.next,1===n.arg.page?e.trialResultsFlyers.flyers=i.data:e.trialResultsFlyers.flyers.push(...i.data)})).addCase(Cn.fulfilled,((e,t)=>{const{payload:i,meta:n}=t;e.trialResultsForProductForCurrentCountry.next=i.next,1===n.arg.page?e.trialResultsForProductForCurrentCountry.data=i.data:e.trialResultsForProductForCurrentCountry.data.push(...i.data)})).addCase(An.fulfilled,((e,t)=>{const{payload:i,meta:n}=t;e.trialResultsForProductForOthers.next=i.next,1===n.arg.page?e.trialResultsForProductForOthers.data=i.data:e.trialResultsForProductForOthers.data.push(...i.data)}))}}),Dn=nt([e=>e.trialResultsState.trialResults],(e=>e.data||{})),kn=nt([e=>e.trialResultsState.trialResults],(e=>"success"!==(null===e||void 0===e?void 0:e.status))),On=nt([e=>e.trialResultsState.trialResultsFlyers],(e=>e||{})),In=nt([e=>e.trialResultsState.trialResultsForProductForCurrentCountry],(e=>e||{})),Rn=nt([e=>e.trialResultsState.trialResultsForProductForOthers],(e=>e||{})),Ln=nt([e=>e.trialResultsState.trialResultsPageList],(e=>e.data||[])),Bn=nt([e=>e.trialResultsState.trialResultsDetails],(e=>e.data||{})),zn=nt([e=>e.trialResultsState.trialResultsDetails],(e=>"success"!==(null===e||void 0===e?void 0:e.status))),Nn=nt([e=>e.trialResultsState.allCropTrialForFilter],(e=>e.data||[])),Fn=(nt([Nn],(e=>e.map((e=>({value:e.slug,name:e.title}))))),nt([e=>e.trialResultsState.currentProductFilter],(e=>e||null))),jn=nt([e=>e.trialResultsState.currentCountryFilter],(e=>e||null)),{setCurrentProductFilter:Vn,setCurrentCountryFilter:Un}=Pn.actions,Gn=Pn.reducer,Hn=nn("fetchCareer",(e=>Xi.get("".concat(tn+Yi.Bd.HO),{params:e})),((e,t)=>{let{getState:i}=t;const{data:n}=i().careerState.career;return!n})),Wn=nn("fetchVacancies",(e=>{const{language:t,country:i,page:n=1,limit:r=$i}=e;return Xi.get("".concat(tn+Yi.FR),{params:{language:t,country:i,page:n,limit:r}})})),qn=nn("fetchVacancy",(e=>{const{slug:t,language:i,country:n}=e;return Xi.get("".concat(tn+Yi.Bd.EL+t),{params:{language:i,country:n}})})),Xn=Ue({name:"careerSlice",initialState:{career:{},vacanciesList:{data:[],next:!1},vacancyContent:{},vacanciesListIsLoading:!1},reducers:{},extraReducers:e=>{e.addCase(Wn.pending,((e,t)=>{e.vacanciesListIsLoading=!0})),e.addCase(Wn.fulfilled,((e,t)=>{const{payload:i,meta:n}=t;e.vacanciesList.next=i.next,1===n.arg.page?e.vacanciesList.data=i.data:e.vacanciesList.data.push(...i.data),e.vacanciesListIsLoading=!1})).addCase(Hn.fulfilled,((e,t)=>{e.career=t.payload})).addCase(qn.pending,((e,t)=>{e.vacancyContent={}})).addCase(qn.fulfilled,((e,t)=>{e.vacancyContent=t.payload}))}}),Yn=nt([e=>e.careerState.career],(e=>e.data||{})),Qn=nt([e=>e.careerState.career,e=>e.careerState.vacanciesListIsLoading],((e,t)=>"success"!==(null===e||void 0===e?void 0:e.status)&&t)),Zn=nt([e=>e.careerState.vacanciesList],(e=>e||{})),Kn=nt([e=>e.careerState.vacancyContent],(e=>e.data||{})),Jn=nt([e=>e.careerState.vacancyContent],(e=>"success"!==(null===e||void 0===e?void 0:e.status))),$n=Xn.reducer,er=nn("fetchHomepage",(e=>Xi.get("".concat(tn+Yi.Bd.TB),{params:e}))),tr=Ue({name:"homepageSlice",initialState:{homepage:{},homepageIsLoading:!1},reducers:{},extraReducers:e=>{e.addCase(er.pending,(e=>{e.homepageIsLoading=!0})),e.addCase(er.fulfilled,((e,t)=>{e.homepageIsLoading=!1,e.homepage=t.payload}))}}),ir=nt([e=>e.homepageState.homepage],(e=>e.data||{})),nr=nt([e=>e.homepageState.homepageIsLoading],(e=>e)),rr=tr.reducer,ar=Ye("fetchLanguages",(async()=>(await Xi.get("".concat(tn+Yi.ZO))).data),{condition:(e,t)=>{let{getState:i}=t;const{languages:n}=i().languageState;if(n.length)return!1}}),sr=Ye("fetchCountries",(async()=>(await Xi.get("".concat(tn+Yi.Qc))).data),{condition:(e,t)=>{let{getState:i}=t;const{countries:n}=i().languageState;if(n.length)return!1}}),or="language",lr="country",cr=Ue({name:"languageSlice",initialState:{language:{},country:{},languages:[],languagesIsLoading:!0,countriesIsLoading:!0,countries:[]},reducers:{changeLanguage:(e,t)=>{e.language=t.payload,localStorage.setItem(or,JSON.stringify(t.payload))},changeCountry:(e,t)=>{e.country=t.payload,localStorage.setItem(lr,JSON.stringify(t.payload))}},extraReducers:e=>{e.addCase(ar.fulfilled,((e,t)=>{e.languages=t.payload.data,localStorage.getItem(or)?e.language=JSON.parse(localStorage.getItem(or)):(localStorage.setItem(or,JSON.stringify(t.payload.data[0])),e.language=t.payload.data[0]),e.languagesIsLoading=!1})),e.addCase(sr.fulfilled,((e,t)=>{const i=t.payload.data.map((t=>{var i;const n=JSON.parse(t.name).text[null===(i=e.language)||void 0===i?void 0:i.code];return{...t,name:n}}));e.countries=i,localStorage.getItem(lr)?e.country=JSON.parse(localStorage.getItem(lr)):(localStorage.setItem(lr,JSON.stringify(i[0])),e.country=i[0]),e.countriesIsLoading=!1}))}}),hr=nt([e=>e.languageState],(e=>e||{})),ur=nt([e=>e.languageState],(e=>e.languagesIsLoading||e.countriesIsLoading)),dr=nt([e=>e.languageState],(e=>e.country)),pr=nt([e=>e.languageState],(e=>e.language)),fr=nt([dr,pr],((e,t)=>({country:e,language:t}))),mr=nt([e=>e.languageState.countries],(e=>e.map((e=>({name:e.name,value:e.code}))))),{changeLanguage:gr,changeCountry:vr}=cr.actions,yr=cr.reducer,br=e=>{const{language:t,country:i,page:n=1,limit:r=Ji,tag:a}=e;return Xi.get("".concat(tn+Yi.WO),{params:{language:t,country:i,page:n,limit:r,tag:a}})},xr=nn("fetchPost",(e=>{const{slug:t,language:i,country:n}=e;return Xi.get("".concat(tn+Yi.Bd.vg+t),{params:{language:i,country:n}})})),wr=nn("fetchBlog",(e=>Xi.get("".concat(tn+Yi.Bd.hs),{params:e})),((e,t)=>{let{getState:i}=t;const{data:n}=i().blogState.blog;return!n})),_r=nn("fetchLatestPostsForHomepage",br),Sr=nn("fetchPostsForNews",br),Er=nn("fetchPostsSlider",br,((e,t)=>{let{getState:i}=t;const{data:n}=i().blogState.articleSliderPosts;return!n.length})),Cr=Ue({name:"blogSlice",initialState:{blog:{},latestPostHomepage:{},latestPostHomepageIsloading:!1,newsPagePosts:{data:[],next:!1},postContent:{},articleSliderPosts:{data:[],next:!1}},reducers:{},extraReducers:e=>{e.addCase(_r.pending,(e=>{e.latestPostHomepageIsloading=!0})).addCase(_r.fulfilled,((e,t)=>{e.latestPostHomepage=t.payload,e.latestPostHomepageIsloading=!1})).addCase(Sr.fulfilled,((e,t)=>{const{payload:i,meta:n}=t;e.newsPagePosts.next=i.next,1===n.arg.page?e.newsPagePosts.data=i.data:e.newsPagePosts.data.push(...i.data)})).addCase(wr.fulfilled,((e,t)=>{e.blog=t.payload})).addCase(xr.pending,((e,t)=>{e.postContent={}})).addCase(xr.fulfilled,((e,t)=>{e.postContent=t.payload})).addCase(Er.fulfilled,((e,t)=>{e.articleSliderPosts=t.payload}))}}),Ar=nt([e=>e.blogState.blog],(e=>e.data||{})),Mr=nt([e=>e.blogState.latestPostHomepage],(e=>e.data||[])),Tr=nt([e=>e.blogState.latestPostHomepageIsloading],(e=>e)),Pr=nt([e=>e.blogState.newsPagePosts],(e=>e)),Dr=nt([e=>e.blogState.postContent],(e=>(null===e||void 0===e?void 0:e.data)||{})),kr=nt([e=>e.blogState.postContent],(e=>"success"!==(null===e||void 0===e?void 0:e.status))),Or=nt([e=>e.blogState.articleSliderPosts],(e=>e.data||[])),Ir=nt([e=>e.blogState.blog],(e=>"success"!==(null===e||void 0===e?void 0:e.status))),Rr=Cr.reducer,Lr=nn("fetchCropNutrition",(e=>Xi.get("".concat(tn+Yi.Bd.Ud),{params:e})),((e,t)=>{let{getState:i}=t;const{data:n}=i().cropNutritionState.cropNutritionPage;return!n})),Br=nn("fetchCropNutritionDetail",(e=>{const{slug:t,language:i,country:n,type:r,product:a}=e;return Xi.get("".concat(tn+Yi.Ki+"/"+t),{params:{language:i,country:n,type:r,slug:t,product:a}})})),zr=nn("fetchCropNutritionForProduct",_n),Nr=nn("fetchCropNutritionPageCrops",_n),Fr=Ue({name:"cropNutritionSlice",initialState:{cropNutritionPage:{},cropNutritionPageCrops:{},cropNutritionPageCropsIsLoading:!1,cropNutritionDetail:{},cropNutritionForProduct:{},allCropNutritionForFilter:{data:[]},currentProductFilter:null},reducers:{setCurrentProductFilter:(e,t)=>{e.currentProductFilter=t.payload}},extraReducers:e=>{e.addCase(Lr.fulfilled,((e,t)=>{e.cropNutritionPage=t.payload})).addCase(Nr.pending,((e,t)=>{e.cropNutritionPageCropsIsLoading=!0})).addCase(Nr.fulfilled,((e,t)=>{e.cropNutritionPageCrops=t.payload,e.cropNutritionPageCropsIsLoading=!1,e.allCropNutritionForFilter.data.length||(e.allCropNutritionForFilter=t.payload)})).addCase(Br.pending,((e,t)=>{e.cropNutritionDetail={}})).addCase(Br.fulfilled,((e,t)=>{e.cropNutritionDetail=t.payload})).addCase(zr.fulfilled,((e,t)=>{const{payload:i,meta:n}=t;e.cropNutritionForProduct.next=i.next,1===n.arg.page?e.cropNutritionForProduct.data=i.data:e.cropNutritionForProduct.data.push(...i.data)}))}}),jr=nt([e=>e.cropNutritionState.cropNutritionPage],(e=>e.data||{})),Vr=nt([e=>e.cropNutritionState.cropNutritionPage,e=>e.cropNutritionState.cropNutritionPageCropsIsLoading],((e,t)=>"success"!==e.status&&t)),Ur=nt([e=>e.cropNutritionState.cropNutritionPageCrops],(e=>e.data||[])),Gr=nt([e=>e.cropNutritionState.allCropNutritionForFilter],(e=>e.data||[])),Hr=(nt([Gr],(e=>e.map((e=>({value:e.slug,name:e.title}))))),nt([e=>e.cropNutritionState.cropNutritionDetail],(e=>e.data||{}))),Wr=nt([e=>e.cropNutritionState.cropNutritionDetail],(e=>"success"!==(null===e||void 0===e?void 0:e.status))),qr=nt([e=>e.cropNutritionState.cropNutritionForProduct],(e=>e||{})),Xr=nt([e=>e.cropNutritionState.currentProductFilter],(e=>e||null)),{setCurrentProductFilter:Yr}=Fr.actions,Qr=Fr.reducer,Zr=nn("fetchInformationMaterials",(e=>Xi.get("".concat(tn+Yi.Bd.UR),{params:e})),((e,t)=>{let{getState:i}=t;const{data:n}=i().informationMaterialsState.informationMaterials;return!n})),Kr=nn("fetchInformationMaterialsFlyers",(e=>{const{id:t,language:i,country:n,page:r=1,limit:a=en}=e;return Xi.get("".concat(tn+Yi.Bd.UR+"/"+t+"/flyers"),{params:{language:i,country:n,page:r,limit:a}})})),Jr=nn("fetchFilteredInformationMaterials",(e=>Xi.get("".concat(tn+Yi.rZ),{params:e}))),$r=Ue({name:"InformationMaterialsSlice",initialState:{informationMaterials:{},informationMaterialFlyers:{},informationMaterialFlyersIsLoading:!1},reducers:{},extraReducers:e=>{e.addCase(Jr.fulfilled,((e,t)=>{e.informationMaterials.data.catalogs=t.payload.data})).addCase(Zr.fulfilled,((e,t)=>{e.informationMaterials=t.payload;const i=t.payload.data.catalogs.filter((e=>e.has_flyers)).reduce(((e,t)=>({...e,[t.id]:{flyers:[],next:!1}})),{});e.informationMaterialFlyers=i})).addCase(Kr.pending,((e,t)=>{e.informationMaterialFlyersIsLoading=!0})).addCase(Kr.fulfilled,((e,t)=>{const{payload:i,meta:n}=t;1===n.arg.page?e.informationMaterialFlyers[n.arg.id]={flyers:i.data,page:n.arg.page,next:i.next}:e.informationMaterialFlyers[n.arg.id]={flyers:[...e.informationMaterialFlyers[n.arg.id].flyers,...i.data],page:n.arg.page,next:i.next},e.informationMaterialFlyersIsLoading=!1}))}}),ea=nt([e=>e.informationMaterialsState.informationMaterials],(e=>e.data||{})),ta=nt([e=>e.informationMaterialsState.informationMaterials],(e=>"success"!==(null===e||void 0===e?void 0:e.status))),ia=nt([e=>e.informationMaterialsState.informationMaterialFlyersIsLoading],(e=>e)),na=nt([e=>e.informationMaterialsState.informationMaterialFlyers],(e=>e||{})),ra=$r.reducer,aa=nn("fetchLegalInfo",(e=>Xi.get("".concat(tn+Yi.Bd.zu),{params:e})),((e,t)=>{let{getState:i}=t;const{data:n}=i().additionalPagesState.lagalInfo;return!n})),sa=nn("fetchTermsConditions",(e=>Xi.get("".concat(tn+Yi.Bd.D_),{params:e})),((e,t)=>{let{getState:i}=t;const{data:n}=i().additionalPagesState.termsConditions;return!n})),oa=Ue({name:"additionalPagesSlice",initialState:{lagalInfo:{},termsConditions:{}},reducers:{},extraReducers:e=>{e.addCase(aa.fulfilled,((e,t)=>{e.lagalInfo=t.payload})),e.addCase(sa.fulfilled,((e,t)=>{e.termsConditions=t.payload}))}}),la=nt([e=>e.additionalPagesState.lagalInfo],(e=>e.data||{})),ca=nt([e=>e.additionalPagesState.termsConditions],(e=>e.data||{})),ha=nt([e=>e.additionalPagesState.lagalInfo],(e=>"success"!==e.status)),ua=nt([e=>e.additionalPagesState.termsConditions],(e=>"success"!==e.status)),da=oa.reducer,pa=nn("fetchContacts",(e=>Xi.get("".concat(tn+Yi.Bd.M3),{params:e})),((e,t)=>{let{getState:i}=t;const{data:n}=i().contactsPagesState.contacts;return!n})),fa=Ue({name:"contactsSlice",initialState:{contacts:{}},reducers:{},extraReducers:e=>{e.addCase(pa.fulfilled,((e,t)=>{e.contacts=t.payload}))}}),ma=nt([e=>e.contactsPagesState.contacts],(e=>e.data||{})),ga=nt([e=>e.contactsPagesState.contacts],(e=>"success"!==e.status)),va=fa.reducer,ya=10,ba=nn("fetchAboutUs",(e=>Xi.get("".concat(tn+Yi.Bd.zG),{params:e})),((e,t)=>{let{getState:i}=t;const{data:n}=i().aboutUsState.about;return!n})),xa=nn("fetchEmployees",(e=>{const{page:t,limit:i=ya,language:n,country:r}=e;return Xi.get("".concat(tn+Yi.DQ),{params:{page:t,limit:i,language:n,country:r}})})),wa=Ue({name:"aboutUsSlice",initialState:{about:{},employees:{data:[],next:!1},employeesIsLoading:!1},reducers:{},extraReducers:e=>{e.addCase(ba.fulfilled,((e,t)=>{e.about=t.payload})),e.addCase(xa.pending,((e,t)=>{e.employeesIsLoading=!0})),e.addCase(xa.fulfilled,((e,t)=>{const{payload:i,meta:n}=t;e.employees.next=i.next,1===n.arg.page?e.employees.data=i.data:e.employees.data.push(...i.data),e.employeesIsLoading=!1}))}}),_a=nt([e=>e.aboutUsState.about],(e=>e.data||{})),Sa=nt([e=>e.aboutUsState.employees],(e=>e)),Ea=nt([e=>e.aboutUsState.employeesIsLoading],(e=>e)),Ca=nt([e=>e.aboutUsState.about],(e=>"success"!==(null===e||void 0===e?void 0:e.status))),Aa=wa.reducer,Ma=nn("fetchTranslations",(e=>Xi.get("".concat(tn+Yi.Bd.wT),{params:e}))),Ta=Ue({name:"transltionsSlice",initialState:{data:{},translationsIsLoading:!1},reducers:{},extraReducers:e=>{e.addCase(Ma.pending,(e=>{e.translationsIsLoading=!0})),e.addCase(Ma.fulfilled,((e,t)=>{e.data=t.payload,e.translationsIsLoading=!1}))}}),Pa=nt([e=>e.translationsState.data],(e=>e.data||{})),Da=nt([e=>e.translationsState.translationsIsLoading],(e=>e)),ka=nt([e=>e.translationsState.data],(e=>{const{blog_type_Article:t,blog_type_Event:i,blog_type_News:n,blog_type_Promo:r,blog_type_Research:a}=null===e||void 0===e?void 0:e.data;return{Article:t,Event:i,News:n,Promo:r,Research:a}})),Oa=Ta.reducer,Ia=nn("fetchSearch",(e=>{const{search:t,language:i,country:n}=e;return Xi.get("".concat(tn+Yi.$P),{params:{language:i,country:n,search:t}})})),Ra={data:{products:[],cropsNutrition:[],cropsTrials:[],posts:[],catalogs:[],vacancies:[],flyers:[]}},La=Ue({name:"searchSlice",initialState:{searchData:Ra,isSearchEnd:!0},reducers:{resetSearch:e=>{e.searchData=Ra}},extraReducers:e=>{e.addCase(Ia.pending,(e=>{e.isSearchEnd=!1})).addCase(Ia.fulfilled,((e,t)=>{e.isSearchEnd=!0,e.searchData=t.payload}))}}),Ba=nt([e=>e.searchState.searchData],(e=>e.data||{})),za=nt([e=>e.searchState.isSearchEnd],(e=>e)),{resetSearch:Na}=La.actions,Fa=La.reducer,ja=function(e){var t,i;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;window.scrollTo({top:(null===(t=document)||void 0===t||null===(i=t.querySelector(".".concat(e)))||void 0===i?void 0:i.getBoundingClientRect().top)+window.scrollY-n,behavior:"smooth"})},Va=async(e,t)=>{const{error:i}=await e;"Request failed with status code 404"===(null===i||void 0===i?void 0:i.message)&&t("/404")},Ua=Ue({name:"uislice",initialState:{isNavigationItemHover:!1,isCookieAgree:(e=>{let t=e+"=",i=decodeURIComponent(document.cookie).split(";");for(let n=0;n<i.length;n++){let e=i[n];for(;" "==e.charAt(0);)e=e.substring(1);if(0==e.indexOf(t))return e.substring(t.length,e.length)}return""})("cookieIsAgree")||!1,lastLocation:{pathname:null,state:{}}},reducers:{setLastLocation:(e,t)=>{e.lastLocation=t.payload},setNavigationItemHover:(e,t)=>{e.isNavigationItemHover=t.payload},setAgreeCookie:e=>{document.cookie="cookieIsAgree=true",e.isCookieAgree=!0}}}),Ga=nt([e=>e.ui],(e=>e.isNavigationItemHover)),Ha=nt([e=>e.ui],(e=>e.isCookieAgree)),Wa=nt([e=>e.ui],(e=>e.lastLocation)),{setNavigationItemHover:qa,setAgreeCookie:Xa,setLastLocation:Ya}=Ua.actions,Qa=function(e){var t,i=je(),n=e||{},r=n.reducer,a=void 0===r?void 0:r,s=n.middleware,o=void 0===s?i():s,l=n.devTools,c=void 0===l||l,h=n.preloadedState,u=void 0===h?void 0:h,d=n.enhancers,p=void 0===d?void 0:d;if("function"===typeof a)t=a;else{if(!Le(a))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=me(a)}var f=o;"function"===typeof f&&(f=f(i));var m=ve.apply(void 0,f),g=ge;c&&(g=Re(ke({trace:!1},"object"===typeof c&&c)));var v=new Ne(m),y=v;return Array.isArray(p)?y=Se([m],p):"function"===typeof p&&(y=p(v)),fe(t,u,g.apply(void 0,y))}({reducer:{blogState:Rr,careerState:$n,homepageState:rr,languageState:yr,productsState:wn,resourcesState:ln,trialResultsState:Gn,cropNutritionState:Qr,informationMaterialsState:ra,additionalPagesState:da,contactsPagesState:va,aboutUsState:Aa,translationsState:Oa,searchState:Fa,ui:Ua.reducer}});var Za=__webpack_require__(461),Ka=__webpack_require__(443),Ja=__webpack_require__(950),$a=__webpack_require__.t(Ja,2);let es=function(e){e()};const ts=()=>es,is=Symbol.for("react-redux-context"),ns="undefined"!==typeof globalThis?globalThis:{};function rs(){var e;if(!t.createContext)return{};const i=null!=(e=ns[is])?e:ns[is]=new Map;let n=i.get(t.createContext);return n||(n=t.createContext(null),i.set(t.createContext,n)),n}const as=rs();function ss(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:as;return function(){return(0,t.useContext)(e)}}const os=ss();let ls=()=>{throw new Error("uSES not initialized!")};const cs=(e,t)=>e===t;function hs(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:as;const i=e===as?os:ss(e);return function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{equalityFn:r=cs,stabilityCheck:a,noopCheck:s}="function"===typeof n?{equalityFn:n}:n;const{store:o,subscription:l,getServerState:c,stabilityCheck:h,noopCheck:u}=i(),d=((0,t.useRef)(!0),(0,t.useCallback)({[e.name]:t=>e(t)}[e.name],[e,h,a])),p=ls(l.addNestedSub,o.getState,c||o.getState,d,r);return(0,t.useDebugValue)(p),p}}const us=hs();__webpack_require__(219),__webpack_require__(706);const ds={notify(){},get:()=>[]};function ps(e,t){let i,n=ds,r=0,a=!1;function s(){c.onStateChange&&c.onStateChange()}function o(){r++,i||(i=t?t.addNestedSub(s):e.subscribe(s),n=function(){const e=ts();let t=null,i=null;return{clear(){t=null,i=null},notify(){e((()=>{let e=t;for(;e;)e.callback(),e=e.next}))},get(){let e=[],i=t;for(;i;)e.push(i),i=i.next;return e},subscribe(e){let n=!0,r=i={callback:e,next:null,prev:i};return r.prev?r.prev.next=r:t=r,function(){n&&null!==t&&(n=!1,r.next?r.next.prev=r.prev:i=r.prev,r.prev?r.prev.next=r.next:t=r.next)}}}}())}function l(){r--,i&&0===r&&(i(),i=void 0,n.clear(),n=ds)}const c={addNestedSub:function(e){o();const t=n.subscribe(e);let i=!1;return()=>{i||(i=!0,t(),l())}},notifyNestedSubs:function(){n.notify()},handleChangeWrapper:s,isSubscribed:function(){return a},trySubscribe:function(){a||(a=!0,o())},tryUnsubscribe:function(){a&&(a=!1,l())},getListeners:()=>n};return c}const fs=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement)?t.useLayoutEffect:t.useEffect;let ms=null;const gs=function(e){let{store:i,context:n,children:r,serverState:a,stabilityCheck:s="once",noopCheck:o="once"}=e;const l=t.useMemo((()=>{const e=ps(i);return{store:i,subscription:e,getServerState:a?()=>a:void 0,stabilityCheck:s,noopCheck:o}}),[i,a,s,o]),c=t.useMemo((()=>i.getState()),[i]);fs((()=>{const{subscription:e}=l;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),c!==i.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}}),[l,c]);const h=n||as;return t.createElement(h.Provider,{value:l},r)};function vs(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:as;const t=e===as?os:ss(e);return function(){const{store:e}=t();return e}}const ys=vs();function bs(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:as;const t=e===as?ys:vs(e);return function(){return t().dispatch}}const xs=bs();var ws,_s;function Ss(){return Ss=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},Ss.apply(this,arguments)}(e=>{ls=e})(Ka.useSyncExternalStoreWithSelector),(e=>{ms=e})(Za.useSyncExternalStore),ws=Ja.unstable_batchedUpdates,es=ws,function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(_s||(_s={}));const Es="popstate";function Cs(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}function As(e,t){if(!e){"undefined"!==typeof console&&console.warn(t);try{throw new Error(t)}catch(i){}}}function Ms(e,t){return{usr:e.state,key:e.key,idx:t}}function Ts(e,t,i,n){return void 0===i&&(i=null),Ss({pathname:"string"===typeof e?e:e.pathname,search:"",hash:""},"string"===typeof t?Ds(t):t,{state:i,key:t&&t.key||n||Math.random().toString(36).substr(2,8)})}function Ps(e){let{pathname:t="/",search:i="",hash:n=""}=e;return i&&"?"!==i&&(t+="?"===i.charAt(0)?i:"?"+i),n&&"#"!==n&&(t+="#"===n.charAt(0)?n:"#"+n),t}function Ds(e){let t={};if(e){let i=e.indexOf("#");i>=0&&(t.hash=e.substr(i),e=e.substr(0,i));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function ks(e,t,i,n){void 0===n&&(n={});let{window:r=document.defaultView,v5Compat:a=!1}=n,s=r.history,o=_s.Pop,l=null,c=h();function h(){return(s.state||{idx:null}).idx}function u(){o=_s.Pop;let e=h(),t=null==e?null:e-c;c=e,l&&l({action:o,location:p.location,delta:t})}function d(e){let t="null"!==r.location.origin?r.location.origin:r.location.href,i="string"===typeof e?e:Ps(e);return i=i.replace(/ $/,"%20"),Cs(t,"No window.location.(origin|href) available to create URL for href: "+i),new URL(i,t)}null==c&&(c=0,s.replaceState(Ss({},s.state,{idx:c}),""));let p={get action(){return o},get location(){return e(r,s)},listen(e){if(l)throw new Error("A history only accepts one active listener");return r.addEventListener(Es,u),l=e,()=>{r.removeEventListener(Es,u),l=null}},createHref:e=>t(r,e),createURL:d,encodeLocation(e){let t=d(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){o=_s.Push;let n=Ts(p.location,e,t);i&&i(n,e),c=h()+1;let u=Ms(n,c),d=p.createHref(n);try{s.pushState(u,"",d)}catch(f){if(f instanceof DOMException&&"DataCloneError"===f.name)throw f;r.location.assign(d)}a&&l&&l({action:o,location:p.location,delta:1})},replace:function(e,t){o=_s.Replace;let n=Ts(p.location,e,t);i&&i(n,e),c=h();let r=Ms(n,c),u=p.createHref(n);s.replaceState(r,"",u),a&&l&&l({action:o,location:p.location,delta:0})},go:e=>s.go(e)};return p}var Os;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(Os||(Os={}));new Set(["lazy","caseSensitive","path","id","index","children"]);function Is(e,t,i){void 0===i&&(i="/");let n=Xs(("string"===typeof t?Ds(t):t).pathname||"/",i);if(null==n)return null;let r=Rs(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let i=e.length===t.length&&e.slice(0,-1).every(((e,i)=>e===t[i]));return i?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(r);let a=null;for(let s=0;null==a&&s<r.length;++s){let e=qs(n);a=Hs(r[s],e)}return a}function Rs(e,t,i,n){void 0===t&&(t=[]),void 0===i&&(i=[]),void 0===n&&(n="");let r=(e,r,a)=>{let s={relativePath:void 0===a?e.path||"":a,caseSensitive:!0===e.caseSensitive,childrenIndex:r,route:e};s.relativePath.startsWith("/")&&(Cs(s.relativePath.startsWith(n),'Absolute route path "'+s.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),s.relativePath=s.relativePath.slice(n.length));let o=Js([n,s.relativePath]),l=i.concat(s);e.children&&e.children.length>0&&(Cs(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+o+'".'),Rs(e.children,t,l,o)),(null!=e.path||e.index)&&t.push({path:o,score:Gs(o,e.index),routesMeta:l})};return e.forEach(((e,t)=>{var i;if(""!==e.path&&null!=(i=e.path)&&i.includes("?"))for(let n of Ls(e.path))r(e,t,n);else r(e,t)})),t}function Ls(e){let t=e.split("/");if(0===t.length)return[];let[i,...n]=t,r=i.endsWith("?"),a=i.replace(/\?$/,"");if(0===n.length)return r?[a,""]:[a];let s=Ls(n.join("/")),o=[];return o.push(...s.map((e=>""===e?a:[a,e].join("/")))),r&&o.push(...s),o.map((t=>e.startsWith("/")&&""===t?"/":t))}const Bs=/^:[\w-]+$/,zs=3,Ns=2,Fs=1,js=10,Vs=-2,Us=e=>"*"===e;function Gs(e,t){let i=e.split("/"),n=i.length;return i.some(Us)&&(n+=Vs),t&&(n+=Ns),i.filter((e=>!Us(e))).reduce(((e,t)=>e+(Bs.test(t)?zs:""===t?Fs:js)),n)}function Hs(e,t){let{routesMeta:i}=e,n={},r="/",a=[];for(let s=0;s<i.length;++s){let e=i[s],o=s===i.length-1,l="/"===r?t:t.slice(r.length)||"/",c=Ws({path:e.relativePath,caseSensitive:e.caseSensitive,end:o},l);if(!c)return null;Object.assign(n,c.params);let h=e.route;a.push({params:n,pathname:Js([r,c.pathname]),pathnameBase:$s(Js([r,c.pathnameBase])),route:h}),"/"!==c.pathnameBase&&(r=Js([r,c.pathnameBase]))}return a}function Ws(e,t){"string"===typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[i,n]=function(e,t,i){void 0===t&&(t=!1);void 0===i&&(i=!0);As("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let n=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,i)=>(n.push({paramName:t,isOptional:null!=i}),i?"/?([^\\/]+)?":"/([^\\/]+)")));e.endsWith("*")?(n.push({paramName:"*"}),r+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?r+="\\/*$":""!==e&&"/"!==e&&(r+="(?:(?=\\/|$))");let a=new RegExp(r,t?void 0:"i");return[a,n]}(e.path,e.caseSensitive,e.end),r=t.match(i);if(!r)return null;let a=r[0],s=a.replace(/(.)\/+$/,"$1"),o=r.slice(1);return{params:n.reduce(((e,t,i)=>{let{paramName:n,isOptional:r}=t;if("*"===n){let e=o[i]||"";s=a.slice(0,a.length-e.length).replace(/(.)\/+$/,"$1")}const l=o[i];return e[n]=r&&!l?void 0:(l||"").replace(/%2F/g,"/"),e}),{}),pathname:a,pathnameBase:s,pattern:e}}function qs(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return As(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function Xs(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let i=t.endsWith("/")?t.length-1:t.length,n=e.charAt(i);return n&&"/"!==n?null:e.slice(i)||"/"}function Ys(e,t,i,n){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(n)+"].  Please separate it out to the `to."+i+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function Qs(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function Zs(e,t){let i=Qs(e);return t?i.map(((t,i)=>i===e.length-1?t.pathname:t.pathnameBase)):i.map((e=>e.pathnameBase))}function Ks(e,t,i,n){let r;void 0===n&&(n=!1),"string"===typeof e?r=Ds(e):(r=Ss({},e),Cs(!r.pathname||!r.pathname.includes("?"),Ys("?","pathname","search",r)),Cs(!r.pathname||!r.pathname.includes("#"),Ys("#","pathname","hash",r)),Cs(!r.search||!r.search.includes("#"),Ys("#","search","hash",r)));let a,s=""===e||""===r.pathname,o=s?"/":r.pathname;if(null==o)a=i;else{let e=t.length-1;if(!n&&o.startsWith("..")){let t=o.split("/");for(;".."===t[0];)t.shift(),e-=1;r.pathname=t.join("/")}a=e>=0?t[e]:"/"}let l=function(e,t){void 0===t&&(t="/");let{pathname:i,search:n="",hash:r=""}="string"===typeof e?Ds(e):e,a=i?i.startsWith("/")?i:function(e,t){let i=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?i.length>1&&i.pop():"."!==e&&i.push(e)})),i.length>1?i.join("/"):"/"}(i,t):t;return{pathname:a,search:eo(n),hash:to(r)}}(r,a),c=o&&"/"!==o&&o.endsWith("/"),h=(s||"."===o)&&i.endsWith("/");return l.pathname.endsWith("/")||!c&&!h||(l.pathname+="/"),l}const Js=e=>e.join("/").replace(/\/\/+/g,"/"),$s=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),eo=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",to=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;function io(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}const no=["post","put","patch","delete"],ro=(new Set(no),["get",...no]);new Set(ro),new Set([301,302,303,307,308]),new Set([307,308]);Symbol("deferred");function ao(){return ao=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},ao.apply(this,arguments)}const so=t.createContext(null);const oo=t.createContext(null);const lo=t.createContext(null);const co=t.createContext(null);const ho=t.createContext({outlet:null,matches:[],isDataRoute:!1});const uo=t.createContext(null);function po(){return null!=t.useContext(co)}function fo(){return po()||Cs(!1),t.useContext(co).location}function mo(e){t.useContext(lo).static||t.useLayoutEffect(e)}function go(){let{isDataRoute:e}=t.useContext(ho);return e?function(){let{router:e}=To(Ao.UseNavigateStable),i=Do(Mo.UseNavigateStable),n=t.useRef(!1);mo((()=>{n.current=!0}));let r=t.useCallback((function(t,r){void 0===r&&(r={}),n.current&&("number"===typeof t?e.navigate(t):e.navigate(t,ao({fromRouteId:i},r)))}),[e,i]);return r}():function(){po()||Cs(!1);let e=t.useContext(so),{basename:i,future:n,navigator:r}=t.useContext(lo),{matches:a}=t.useContext(ho),{pathname:s}=fo(),o=JSON.stringify(Zs(a,n.v7_relativeSplatPath)),l=t.useRef(!1);mo((()=>{l.current=!0}));let c=t.useCallback((function(t,n){if(void 0===n&&(n={}),!l.current)return;if("number"===typeof t)return void r.go(t);let a=Ks(t,JSON.parse(o),s,"path"===n.relative);null==e&&"/"!==i&&(a.pathname="/"===a.pathname?i:Js([i,a.pathname])),(n.replace?r.replace:r.push)(a,n.state,n)}),[i,r,o,s,e]);return c}()}const vo=t.createContext(null);function yo(){let{matches:e}=t.useContext(ho),i=e[e.length-1];return i?i.params:{}}function bo(e,i){let{relative:n}=void 0===i?{}:i,{future:r}=t.useContext(lo),{matches:a}=t.useContext(ho),{pathname:s}=fo(),o=JSON.stringify(Zs(a,r.v7_relativeSplatPath));return t.useMemo((()=>Ks(e,JSON.parse(o),s,"path"===n)),[e,o,s,n])}function xo(e,i,n,r){po()||Cs(!1);let{navigator:a}=t.useContext(lo),{matches:s}=t.useContext(ho),o=s[s.length-1],l=o?o.params:{},c=(o&&o.pathname,o?o.pathnameBase:"/");o&&o.route;let h,u=fo();if(i){var d;let e="string"===typeof i?Ds(i):i;"/"===c||(null==(d=e.pathname)?void 0:d.startsWith(c))||Cs(!1),h=e}else h=u;let p=h.pathname||"/",f=p;if("/"!==c){let e=c.replace(/^\//,"").split("/");f="/"+p.replace(/^\//,"").split("/").slice(e.length).join("/")}let m=Is(e,{pathname:f});let g=Co(m&&m.map((e=>Object.assign({},e,{params:Object.assign({},l,e.params),pathname:Js([c,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?c:Js([c,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),s,n,r);return i&&g?t.createElement(co.Provider,{value:{location:ao({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:_s.Pop}},g):g}function wo(){let e=function(){var e;let i=t.useContext(uo),n=Po(Mo.UseRouteError),r=Do(Mo.UseRouteError);if(void 0!==i)return i;return null==(e=n.errors)?void 0:e[r]}(),i=io(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r};return t.createElement(t.Fragment,null,t.createElement("h2",null,"Unexpected Application Error!"),t.createElement("h3",{style:{fontStyle:"italic"}},i),n?t.createElement("pre",{style:a},n):null,null)}const _o=t.createElement(wo,null);class So extends t.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?t.createElement(ho.Provider,{value:this.props.routeContext},t.createElement(uo.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Eo(e){let{routeContext:i,match:n,children:r}=e,a=t.useContext(so);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),t.createElement(ho.Provider,{value:i},r)}function Co(e,i,n,r){var a;if(void 0===i&&(i=[]),void 0===n&&(n=null),void 0===r&&(r=null),null==e){var s;if(null==(s=n)||!s.errors)return null;e=n.matches}let o=e,l=null==(a=n)?void 0:a.errors;if(null!=l){let e=o.findIndex((e=>e.route.id&&(null==l?void 0:l[e.route.id])));e>=0||Cs(!1),o=o.slice(0,Math.min(o.length,e+1))}let c=!1,h=-1;if(n&&r&&r.v7_partialHydration)for(let t=0;t<o.length;t++){let e=o[t];if((e.route.HydrateFallback||e.route.hydrateFallbackElement)&&(h=t),e.route.id){let{loaderData:t,errors:i}=n,r=e.route.loader&&void 0===t[e.route.id]&&(!i||void 0===i[e.route.id]);if(e.route.lazy||r){c=!0,o=h>=0?o.slice(0,h+1):[o[0]];break}}}return o.reduceRight(((e,r,a)=>{let s,u=!1,d=null,p=null;var f;n&&(s=l&&r.route.id?l[r.route.id]:void 0,d=r.route.errorElement||_o,c&&(h<0&&0===a?(f="route-fallback",!1||ko[f]||(ko[f]=!0),u=!0,p=null):h===a&&(u=!0,p=r.route.hydrateFallbackElement||null)));let m=i.concat(o.slice(0,a+1)),g=()=>{let i;return i=s?d:u?p:r.route.Component?t.createElement(r.route.Component,null):r.route.element?r.route.element:e,t.createElement(Eo,{match:r,routeContext:{outlet:e,matches:m,isDataRoute:null!=n},children:i})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===a)?t.createElement(So,{location:n.location,revalidation:n.revalidation,component:d,error:s,children:g(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):g()}),null)}var Ao=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Ao||{}),Mo=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Mo||{});function To(e){let i=t.useContext(so);return i||Cs(!1),i}function Po(e){let i=t.useContext(oo);return i||Cs(!1),i}function Do(e){let i=function(e){let i=t.useContext(ho);return i||Cs(!1),i}(),n=i.matches[i.matches.length-1];return n.route.id||Cs(!1),n.route.id}const ko={};i.startTransition;function Oo(e){return function(e){let i=t.useContext(ho).outlet;return i?t.createElement(vo.Provider,{value:e},i):i}(e.context)}function Io(e){Cs(!1)}function Ro(e){let{basename:i="/",children:n=null,location:r,navigationType:a=_s.Pop,navigator:s,static:o=!1,future:l}=e;po()&&Cs(!1);let c=i.replace(/^\/*/,"/"),h=t.useMemo((()=>({basename:c,navigator:s,static:o,future:ao({v7_relativeSplatPath:!1},l)})),[c,l,s,o]);"string"===typeof r&&(r=Ds(r));let{pathname:u="/",search:d="",hash:p="",state:f=null,key:m="default"}=r,g=t.useMemo((()=>{let e=Xs(u,c);return null==e?null:{location:{pathname:e,search:d,hash:p,state:f,key:m},navigationType:a}}),[c,u,d,p,f,m,a]);return null==g?null:t.createElement(lo.Provider,{value:h},t.createElement(co.Provider,{children:n,value:g}))}function Lo(e){let{children:t,location:i}=e;return xo(Bo(t),i)}new Promise((()=>{}));t.Component;function Bo(e,i){void 0===i&&(i=[]);let n=[];return t.Children.forEach(e,((e,r)=>{if(!t.isValidElement(e))return;let a=[...i,r];if(e.type===t.Fragment)return void n.push.apply(n,Bo(e.props.children,a));e.type!==Io&&Cs(!1),e.props.index&&e.props.children&&Cs(!1);let s={id:e.props.id||a.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(s.children=Bo(e.props.children,a)),n.push(s)})),n}function zo(){return zo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},zo.apply(this,arguments)}function No(e,t){if(null==e)return{};var i,n,r={},a=Object.keys(e);for(n=0;n<a.length;n++)i=a[n],t.indexOf(i)>=0||(r[i]=e[i]);return r}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const Fo=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"];try{window.__reactRouterVersion="6"}catch(vne){}new Map;const jo=i.startTransition;$a.flushSync,i.useId;function Vo(e){let{basename:i,children:n,future:r,window:a}=e,s=t.useRef();var o;null==s.current&&(s.current=(void 0===(o={window:a,v5Compat:!0})&&(o={}),ks((function(e,t){let{pathname:i,search:n,hash:r}=e.location;return Ts("",{pathname:i,search:n,hash:r},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"===typeof t?t:Ps(t)}),null,o)));let l=s.current,[c,h]=t.useState({action:l.action,location:l.location}),{v7_startTransition:u}=r||{},d=t.useCallback((e=>{u&&jo?jo((()=>h(e))):h(e)}),[h,u]);return t.useLayoutEffect((()=>l.listen(d)),[l,d]),t.createElement(Ro,{basename:i,children:n,location:c.location,navigationType:c.action,navigator:l,future:r})}const Uo="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement,Go=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ho=t.forwardRef((function(e,i){let n,{onClick:r,relative:a,reloadDocument:s,replace:o,state:l,target:c,to:h,preventScrollReset:u,unstable_viewTransition:d}=e,p=No(e,Fo),{basename:f}=t.useContext(lo),m=!1;if("string"===typeof h&&Go.test(h)&&(n=h,Uo))try{let e=new URL(window.location.href),t=h.startsWith("//")?new URL(e.protocol+h):new URL(h),i=Xs(t.pathname,f);t.origin===e.origin&&null!=i?h=i+t.search+t.hash:m=!0}catch(vne){}let g=function(e,i){let{relative:n}=void 0===i?{}:i;po()||Cs(!1);let{basename:r,navigator:a}=t.useContext(lo),{hash:s,pathname:o,search:l}=bo(e,{relative:n}),c=o;return"/"!==r&&(c="/"===o?r:Js([r,o])),a.createHref({pathname:c,search:l,hash:s})}(h,{relative:a}),v=function(e,i){let{target:n,replace:r,state:a,preventScrollReset:s,relative:o,unstable_viewTransition:l}=void 0===i?{}:i,c=go(),h=fo(),u=bo(e,{relative:o});return t.useCallback((t=>{if(function(e,t){return 0===e.button&&(!t||"_self"===t)&&!function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)}(t,n)){t.preventDefault();let i=void 0!==r?r:Ps(h)===Ps(u);c(e,{replace:i,state:a,preventScrollReset:s,relative:o,unstable_viewTransition:l})}}),[h,c,u,r,a,n,e,s,o,l])}(h,{replace:o,state:l,target:c,preventScrollReset:u,relative:a,unstable_viewTransition:d});return t.createElement("a",zo({},p,{href:n||g,onClick:m||s?r:function(e){r&&r(e),e.defaultPrevented||v(e)},ref:i,target:c}))}));var Wo,qo;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Wo||(Wo={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(qo||(qo={}));const Xo={base:"/",products:"/products",aboutProduct:"/about-product",relatedProduct:"/related-product",resources:"/resources",cropNutritionPrograms:"/resources/crop-nutrition-programs",trialResults:"/resources/trial-results",informationMaterials:"/resources/information-materials",news:"/blog",article:"/article",career:"/career",detailJob:"/detail-job",uiKit:"/ui-kit",aboutUs:"/about-us",termsAndConditions:"/terms-and-conditions",legalInfo:"/legal-info",contacts:"/contacts"};var Yo;function Qo(){return Qo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},Qo.apply(this,arguments)}function Zo(e,i){let{title:n,titleId:r,...a}=e;return t.createElement("svg",Qo({width:125,height:64,viewBox:"0 0 125 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:i,"aria-labelledby":r},a),n?t.createElement("title",{id:r},n):null,Yo||(Yo=t.createElement("path",{d:"M8 0C3.58172 0 0 3.58172 0 8V64C0 59.5817 3.58172 56 8 56H75.8831C78.4667 56 80.8912 54.7523 82.3929 52.6499L117.607 3.35009C119.109 1.24773 121.533 0 124.117 0H8Z",fill:"white"})))}const Ko=t.forwardRef(Zo);__webpack_require__.p;var Jo=__webpack_require__(681),$o=__webpack_require__(579);const el=e=>{let{data:t,index:i}=e;const{preview_title:n,preview_text:r,preview_link_text:a,preview_image:s,preview_new_image:o,slug:l,logo:c,preview_description:h,preview_button_text:u}=t,d=String(i+1).padStart(2,"0"),p=r||h,f=a||u;return(0,$o.jsxs)(Ho,{to:l,className:"product-card ".concat(i%2!==0?"product-card--reverse":""),children:[(0,$o.jsxs)("div",{className:"product-card__image","data-index":"\u2022 "+d,children:[(0,$o.jsx)(Ko,{}),(0,$o.jsx)(Jo.Parallax,{bgImage:s||o,className:"product-card__image-bg",strength:50,bgImageStyle:{height:"calc(100% + ".concat(50,"px)"),objectFit:"cover"}}),c&&(0,$o.jsx)("div",{className:"product-card__image-logo",children:(0,$o.jsx)("img",{src:c,alt:"product-logo"})})]}),(0,$o.jsxs)("div",{className:"product-card__content",children:[(0,$o.jsx)("h3",{children:n}),(0,$o.jsx)("p",{className:"body1",children:p}),(0,$o.jsxs)("button",{className:"button learn-more-arrow has-children",children:[(0,$o.jsx)("div",{}),(0,$o.jsx)("span",{children:f})]})]})]})},tl=e=>{let{data:t=[]}=e;return(0,$o.jsx)("section",{className:"container",children:(0,$o.jsx)("div",{className:"inner-container type-2",children:(0,$o.jsx)("div",{className:"product-card-container",children:t.map(((e,t)=>(0,$o.jsx)(el,{index:t,data:e},t)))})})})};const il=__webpack_require__.p+"static/media/home.f5243e8a09fbdd40b794c9e28a6386c8.svg",nl=e=>{let{to:t,children:i,className:n=""}=e;return(0,$o.jsx)(Ho,{to:t,className:n,children:i})},rl=()=>{const e=fo().pathname.split("/").filter((e=>""!==e)),{menu_products_text:t,menu_resources_text:i,menu_contacts_text:n,menu_about_text:r,menu_news_text:a,menu_career_text:s,menu_crop_nutrition_text:o,menu_trial_results_text:l,menu_information_materials_text:c,footer_terms_conditions_text:h,footer_legal_info_text:u}=us(Pa),d={[Xo.products]:t,[Xo.resources]:i,"/crop-nutrition-programs":o,"/trial-results":l,"/information-materials":c,[Xo.news]:a,[Xo.career]:s,[Xo.aboutUs]:r,[Xo.termsAndConditions]:h,[Xo.legalInfo]:u,[Xo.contacts]:n},p=us(gn).title,f=us(Hr).title,m=us(Bn).title,g="products"===e[0]&&!!e[1],v="resources"===e[0]&&"crop-nutrition-programs"===e[1]&&!!e[2],y="resources"===e[0]&&"trial-results"===e[1]&&!!e[2],b=t=>g&&e[1]===t?p:v&&e[2]===t?f:y&&e[2]===t?m:d["/".concat(t)];return(0,$o.jsxs)("div",{className:"breadcrumbs",children:[(0,$o.jsx)(nl,{to:"/",children:(0,$o.jsx)("img",{src:il,alt:"home"})}),(0,$o.jsx)("div",{className:"breadcrumbs-dot"}),e.map(((t,i)=>(0,$o.jsxs)("span",{className:"breadcrumbs-span",children:[(0,$o.jsx)(nl,{to:"/".concat(e.slice(0,i+1).join("/")),className:"body3",children:b(t)}),i<e.length-1&&(0,$o.jsx)("div",{className:"breadcrumbs-dot margin-left"})]},t)))]})},al=e=>{let{type:t="",href:i="",children:n="",className:r="",onClick:a}=e;return(0,$o.jsxs)(Ho,{to:i,className:"button ".concat(t," ").concat(r," ").concat(n&&"has-children"),onClick:a,children:[(0,$o.jsx)("div",{}),(0,$o.jsx)("span",{children:n})]})},sl=e=>{let{title:t="",image:i,buttonText:n,buttonType:r="learn-more",children:a,withCrumbs:s=!0,onClickButton:o,to:l}=e;return(0,$o.jsxs)("section",{className:"container",children:[(0,$o.jsxs)("div",{className:"primary-section-wrapper",children:[(0,$o.jsxs)("div",{className:"primary-section",children:[(0,$o.jsxs)("div",{className:"left-side",children:[s&&(0,$o.jsx)(rl,{}),t?(0,$o.jsx)("h2",{className:"banner-title",children:t}):(0,$o.jsx)("div",{className:"left-side__content banner-title",children:a})]}),(0,$o.jsxs)("div",{className:"button-wrapper",children:[(0,$o.jsx)(al,{type:r,onClick:o,href:l,children:n}),(0,$o.jsx)("div",{className:"smooth-corner1"}),(0,$o.jsx)("div",{className:"smooth-corner2"})]})]}),(0,$o.jsx)("div",{className:"banner-bg",children:(0,$o.jsx)(Jo.Parallax,{bgImage:i,bgImageAlt:t,strength:100,bgImageStyle:{height:"calc(100% + ".concat(100,"px)"),objectFit:"cover"}})})]}),r.includes("find")&&(0,$o.jsx)(al,{type:"find-mobile",className:"banner-bottom",onClick:o,href:l,children:n}),r.includes("banner")&&(0,$o.jsx)(al,{className:"banner-bottom",onClick:o,href:l,children:n})]})},ol=e=>{let{children:t,size:i="big",textColor:n="black",className:r=""}=e;return(0,$o.jsx)("div",{className:"gradient-text gradient-text--".concat(i," gradient-text--").concat(n," ").concat(r),children:t})},ll=e=>{let{children:t}=e;return(0,$o.jsx)("div",{className:"label-button body3",children:(0,$o.jsxs)("span",{children:[(0,$o.jsx)("div",{}),t]})})};function cl(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hl(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var ul,dl,pl,fl,ml,gl,vl,yl,bl,xl,wl,_l={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Sl={duration:.5,overwrite:!1,delay:0},El=1e8,Cl=1e-8,Al=2*Math.PI,Ml=Al/4,Tl=0,Pl=Math.sqrt,Dl=Math.cos,kl=Math.sin,Ol=function(e){return"string"===typeof e},Il=function(e){return"function"===typeof e},Rl=function(e){return"number"===typeof e},Ll=function(e){return"undefined"===typeof e},Bl=function(e){return"object"===typeof e},zl=function(e){return!1!==e},Nl=function(){return"undefined"!==typeof window},Fl=function(e){return Il(e)||Ol(e)},jl="function"===typeof ArrayBuffer&&ArrayBuffer.isView||function(){},Vl=Array.isArray,Ul=/(?:-?\.?\d|\.)+/gi,Gl=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Hl=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Wl=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,ql=/[+-]=-?[.\d]+/,Xl=/[^,'"\[\]\s]+/gi,Yl=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Ql={},Zl={},Kl=function(e){return(Zl=Ac(e,Ql))&&Au},Jl=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},$l=function(e,t){return!t&&console.warn(e)},ec=function(e,t){return e&&(Ql[e]=t)&&Zl&&(Zl[e]=t)||Ql},tc=function(){return 0},ic={suppressEvents:!0,isStart:!0,kill:!1},nc={suppressEvents:!0,kill:!1},rc={suppressEvents:!0},ac={},sc=[],oc={},lc={},cc={},hc=30,uc=[],dc="",pc=function(e){var t,i,n=e[0];if(Bl(n)||Il(n)||(e=[e]),!(t=(n._gsap||{}).harness)){for(i=uc.length;i--&&!uc[i].targetTest(n););t=uc[i]}for(i=e.length;i--;)e[i]&&(e[i]._gsap||(e[i]._gsap=new jh(e[i],t)))||e.splice(i,1);return e},fc=function(e){return e._gsap||pc(nh(e))[0]._gsap},mc=function(e,t,i){return(i=e[t])&&Il(i)?e[t]():Ll(i)&&e.getAttribute&&e.getAttribute(t)||i},gc=function(e,t){return(e=e.split(",")).forEach(t)||e},vc=function(e){return Math.round(1e5*e)/1e5||0},yc=function(e){return Math.round(1e7*e)/1e7||0},bc=function(e,t){var i=t.charAt(0),n=parseFloat(t.substr(2));return e=parseFloat(e),"+"===i?e+n:"-"===i?e-n:"*"===i?e*n:e/n},xc=function(e,t){for(var i=t.length,n=0;e.indexOf(t[n])<0&&++n<i;);return n<i},wc=function(){var e,t,i=sc.length,n=sc.slice(0);for(oc={},sc.length=0,e=0;e<i;e++)(t=n[e])&&t._lazy&&(t.render(t._lazy[0],t._lazy[1],!0)._lazy=0)},_c=function(e,t,i,n){sc.length&&!dl&&wc(),e.render(t,i,n||dl&&t<0&&(e._initted||e._startAt)),sc.length&&!dl&&wc()},Sc=function(e){var t=parseFloat(e);return(t||0===t)&&(e+"").match(Xl).length<2?t:Ol(e)?e.trim():e},Ec=function(e){return e},Cc=function(e,t){for(var i in t)i in e||(e[i]=t[i]);return e},Ac=function(e,t){for(var i in t)e[i]=t[i];return e},Mc=function e(t,i){for(var n in i)"__proto__"!==n&&"constructor"!==n&&"prototype"!==n&&(t[n]=Bl(i[n])?e(t[n]||(t[n]={}),i[n]):i[n]);return t},Tc=function(e,t){var i,n={};for(i in e)i in t||(n[i]=e[i]);return n},Pc=function(e){var t,i=e.parent||fl,n=e.keyframes?(t=Vl(e.keyframes),function(e,i){for(var n in i)n in e||"duration"===n&&t||"ease"===n||(e[n]=i[n])}):Cc;if(zl(e.inherit))for(;i;)n(e,i.vars.defaults),i=i.parent||i._dp;return e},Dc=function(e,t,i,n,r){void 0===i&&(i="_first"),void 0===n&&(n="_last");var a,s=e[n];if(r)for(a=t[r];s&&s[r]>a;)s=s._prev;return s?(t._next=s._next,s._next=t):(t._next=e[i],e[i]=t),t._next?t._next._prev=t:e[n]=t,t._prev=s,t.parent=t._dp=e,t},kc=function(e,t,i,n){void 0===i&&(i="_first"),void 0===n&&(n="_last");var r=t._prev,a=t._next;r?r._next=a:e[i]===t&&(e[i]=a),a?a._prev=r:e[n]===t&&(e[n]=r),t._next=t._prev=t.parent=null},Oc=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},Ic=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var i=e;i;)i._dirty=1,i=i.parent;return e},Rc=function(e,t,i,n){return e._startAt&&(dl?e._startAt.revert(nc):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,n))},Lc=function e(t){return!t||t._ts&&e(t.parent)},Bc=function(e){return e._repeat?zc(e._tTime,e=e.duration()+e._rDelay)*e:0},zc=function(e,t){var i=Math.floor(e/=t);return e&&i===e?i-1:i},Nc=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},Fc=function(e){return e._end=yc(e._start+(e._tDur/Math.abs(e._ts||e._rts||Cl)||0))},jc=function(e,t){var i=e._dp;return i&&i.smoothChildTiming&&e._ts&&(e._start=yc(i._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),Fc(e),i._dirty||Ic(i,e)),e},Vc=function(e,t){var i;if((t._time||!t._dur&&t._initted||t._start<e._time&&(t._dur||!t.add))&&(i=Nc(e.rawTime(),t),(!t._dur||$c(0,t.totalDuration(),i)-t._tTime>Cl)&&t.render(i,!0)),Ic(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(i=e;i._dp;)i.rawTime()>=0&&i.totalTime(i._tTime),i=i._dp;e._zTime=-1e-8}},Uc=function(e,t,i,n){return t.parent&&Oc(t),t._start=yc((Rl(i)?i:i||e!==fl?Zc(e,i,t):e._time)+t._delay),t._end=yc(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),Dc(e,t,"_first","_last",e._sort?"_start":0),qc(t)||(e._recent=t),n||Vc(e,t),e._ts<0&&jc(e,e._tTime),e},Gc=function(e,t){return(Ql.ScrollTrigger||Jl("scrollTrigger",t))&&Ql.ScrollTrigger.create(t,e)},Hc=function(e,t,i,n,r){return Yh(e,t,r),e._initted?!i&&e._pt&&!dl&&(e._dur&&!1!==e.vars.lazy||!e._dur&&e.vars.lazy)&&bl!==Mh.frame?(sc.push(e),e._lazy=[r,n],1):void 0:1},Wc=function e(t){var i=t.parent;return i&&i._ts&&i._initted&&!i._lock&&(i.rawTime()<0||e(i))},qc=function(e){var t=e.data;return"isFromStart"===t||"isStart"===t},Xc=function(e,t,i,n){var r=e._repeat,a=yc(t)||0,s=e._tTime/e._tDur;return s&&!n&&(e._time*=a/e._dur),e._dur=a,e._tDur=r?r<0?1e10:yc(a*(r+1)+e._rDelay*r):a,s>0&&!n&&jc(e,e._tTime=e._tDur*s),e.parent&&Fc(e),i||Ic(e.parent,e),e},Yc=function(e){return e instanceof Uh?Ic(e):Xc(e,e._dur)},Qc={_start:0,endTime:tc,totalDuration:tc},Zc=function e(t,i,n){var r,a,s,o=t.labels,l=t._recent||Qc,c=t.duration()>=El?l.endTime(!1):t._dur;return Ol(i)&&(isNaN(i)||i in o)?(a=i.charAt(0),s="%"===i.substr(-1),r=i.indexOf("="),"<"===a||">"===a?(r>=0&&(i=i.replace(/=/,"")),("<"===a?l._start:l.endTime(l._repeat>=0))+(parseFloat(i.substr(1))||0)*(s?(r<0?l:n).totalDuration()/100:1)):r<0?(i in o||(o[i]=c),o[i]):(a=parseFloat(i.charAt(r-1)+i.substr(r+1)),s&&n&&(a=a/100*(Vl(n)?n[0]:n).totalDuration()),r>1?e(t,i.substr(0,r-1),n)+a:c+a)):null==i?c:+i},Kc=function(e,t,i){var n,r,a=Rl(t[1]),s=(a?2:1)+(e<2?0:1),o=t[s];if(a&&(o.duration=t[1]),o.parent=i,e){for(n=o,r=i;r&&!("immediateRender"in n);)n=r.vars.defaults||{},r=zl(r.vars.inherit)&&r.parent;o.immediateRender=zl(n.immediateRender),e<2?o.runBackwards=1:o.startAt=t[s-1]}return new $h(t[0],o,t[s+1])},Jc=function(e,t){return e||0===e?t(e):t},$c=function(e,t,i){return i<e?e:i>t?t:i},eh=function(e,t){return Ol(e)&&(t=Yl.exec(e))?t[1]:""},th=[].slice,ih=function(e,t){return e&&Bl(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&Bl(e[0]))&&!e.nodeType&&e!==ml},nh=function(e,t,i){return pl&&!t&&pl.selector?pl.selector(e):!Ol(e)||i||!gl&&Th()?Vl(e)?function(e,t,i){return void 0===i&&(i=[]),e.forEach((function(e){var n;return Ol(e)&&!t||ih(e,1)?(n=i).push.apply(n,nh(e)):i.push(e)}))||i}(e,i):ih(e)?th.call(e,0):e?[e]:[]:th.call((t||vl).querySelectorAll(e),0)},rh=function(e){return e=nh(e)[0]||$l("Invalid scope")||{},function(t){var i=e.current||e.nativeElement||e;return nh(t,i.querySelectorAll?i:i===e?$l("Invalid scope")||vl.createElement("div"):e)}},ah=function(e){return e.sort((function(){return.5-Math.random()}))},sh=function(e){if(Il(e))return e;var t=Bl(e)?e:{each:e},i=Lh(t.ease),n=t.from||0,r=parseFloat(t.base)||0,a={},s=n>0&&n<1,o=isNaN(n)||s,l=t.axis,c=n,h=n;return Ol(n)?c=h={center:.5,edges:.5,end:1}[n]||0:!s&&o&&(c=n[0],h=n[1]),function(e,s,u){var d,p,f,m,g,v,y,b,x,w=(u||t).length,_=a[w];if(!_){if(!(x="auto"===t.grid?0:(t.grid||[1,El])[1])){for(y=-El;y<(y=u[x++].getBoundingClientRect().left)&&x<w;);x<w&&x--}for(_=a[w]=[],d=o?Math.min(x,w)*c-.5:n%x,p=x===El?0:o?w*h/x-.5:n/x|0,y=0,b=El,v=0;v<w;v++)f=v%x-d,m=p-(v/x|0),_[v]=g=l?Math.abs("y"===l?m:f):Pl(f*f+m*m),g>y&&(y=g),g<b&&(b=g);"random"===n&&ah(_),_.max=y-b,_.min=b,_.v=w=(parseFloat(t.amount)||parseFloat(t.each)*(x>w?w-1:l?"y"===l?w/x:x:Math.max(x,w/x))||0)*("edges"===n?-1:1),_.b=w<0?r-w:r,_.u=eh(t.amount||t.each)||0,i=i&&w<0?Ih(i):i}return w=(_[e]-_.min)/_.max||0,yc(_.b+(i?i(w):w)*_.v)+_.u}},oh=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(i){var n=yc(Math.round(parseFloat(i)/e)*e*t);return(n-n%1)/t+(Rl(i)?0:eh(i))}},lh=function(e,t){var i,n,r=Vl(e);return!r&&Bl(e)&&(i=r=e.radius||El,e.values?(e=nh(e.values),(n=!Rl(e[0]))&&(i*=i)):e=oh(e.increment)),Jc(t,r?Il(e)?function(t){return n=e(t),Math.abs(n-t)<=i?n:t}:function(t){for(var r,a,s=parseFloat(n?t.x:t),o=parseFloat(n?t.y:0),l=El,c=0,h=e.length;h--;)(r=n?(r=e[h].x-s)*r+(a=e[h].y-o)*a:Math.abs(e[h]-s))<l&&(l=r,c=h);return c=!i||l<=i?e[c]:t,n||c===t||Rl(t)?c:c+eh(t)}:oh(e))},ch=function(e,t,i,n){return Jc(Vl(e)?!t:!0===i?!!(i=0):!n,(function(){return Vl(e)?e[~~(Math.random()*e.length)]:(i=i||1e-5)&&(n=i<1?Math.pow(10,(i+"").length-2):1)&&Math.floor(Math.round((e-i/2+Math.random()*(t-e+.99*i))/i)*i*n)/n}))},hh=function(e,t,i){return Jc(i,(function(i){return e[~~t(i)]}))},uh=function(e){for(var t,i,n,r,a=0,s="";~(t=e.indexOf("random(",a));)n=e.indexOf(")",t),r="["===e.charAt(t+7),i=e.substr(t+7,n-t-7).match(r?Xl:Ul),s+=e.substr(a,t-a)+ch(r?i:+i[0],r?0:+i[1],+i[2]||1e-5),a=n+1;return s+e.substr(a,e.length-a)},dh=function(e,t,i,n,r){var a=t-e,s=n-i;return Jc(r,(function(t){return i+((t-e)/a*s||0)}))},ph=function(e,t,i){var n,r,a,s=e.labels,o=El;for(n in s)(r=s[n]-t)<0===!!i&&r&&o>(r=Math.abs(r))&&(a=n,o=r);return a},fh=function(e,t,i){var n,r,a,s=e.vars,o=s[t],l=pl,c=e._ctx;if(o)return n=s[t+"Params"],r=s.callbackScope||e,i&&sc.length&&wc(),c&&(pl=c),a=n?o.apply(r,n):o.call(r),pl=l,a},mh=function(e){return Oc(e),e.scrollTrigger&&e.scrollTrigger.kill(!!dl),e.progress()<1&&fh(e,"onInterrupt"),e},gh=[],vh=function(e){if(e)if(e=!e.name&&e.default||e,Nl()||e.headless){var t=e.name,i=Il(e),n=t&&!i&&e.init?function(){this._props=[]}:e,r={init:tc,render:lu,add:qh,kill:hu,modifier:cu,rawVars:0},a={targetTest:0,get:0,getSetter:ru,aliases:{},register:0};if(Th(),e!==n){if(lc[t])return;Cc(n,Cc(Tc(e,r),a)),Ac(n.prototype,Ac(r,Tc(e,a))),lc[n.prop=t]=n,e.targetTest&&(uc.push(n),ac[t]=1),t=("css"===t?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}ec(t,n),e.register&&e.register(Au,n,pu)}else gh.push(e)},yh=255,bh={aqua:[0,yh,yh],lime:[0,yh,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,yh],navy:[0,0,128],white:[yh,yh,yh],olive:[128,128,0],yellow:[yh,yh,0],orange:[yh,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[yh,0,0],pink:[yh,192,203],cyan:[0,yh,yh],transparent:[yh,yh,yh,0]},xh=function(e,t,i){return(6*(e+=e<0?1:e>1?-1:0)<1?t+(i-t)*e*6:e<.5?i:3*e<2?t+(i-t)*(2/3-e)*6:t)*yh+.5|0},wh=function(e,t,i){var n,r,a,s,o,l,c,h,u,d,p=e?Rl(e)?[e>>16,e>>8&yh,e&yh]:0:bh.black;if(!p){if(","===e.substr(-1)&&(e=e.substr(0,e.length-1)),bh[e])p=bh[e];else if("#"===e.charAt(0)){if(e.length<6&&(n=e.charAt(1),r=e.charAt(2),a=e.charAt(3),e="#"+n+n+r+r+a+a+(5===e.length?e.charAt(4)+e.charAt(4):"")),9===e.length)return[(p=parseInt(e.substr(1,6),16))>>16,p>>8&yh,p&yh,parseInt(e.substr(7),16)/255];p=[(e=parseInt(e.substr(1),16))>>16,e>>8&yh,e&yh]}else if("hsl"===e.substr(0,3))if(p=d=e.match(Ul),t){if(~e.indexOf("="))return p=e.match(Gl),i&&p.length<4&&(p[3]=1),p}else s=+p[0]%360/360,o=+p[1]/100,n=2*(l=+p[2]/100)-(r=l<=.5?l*(o+1):l+o-l*o),p.length>3&&(p[3]*=1),p[0]=xh(s+1/3,n,r),p[1]=xh(s,n,r),p[2]=xh(s-1/3,n,r);else p=e.match(Ul)||bh.transparent;p=p.map(Number)}return t&&!d&&(n=p[0]/yh,r=p[1]/yh,a=p[2]/yh,l=((c=Math.max(n,r,a))+(h=Math.min(n,r,a)))/2,c===h?s=o=0:(u=c-h,o=l>.5?u/(2-c-h):u/(c+h),s=c===n?(r-a)/u+(r<a?6:0):c===r?(a-n)/u+2:(n-r)/u+4,s*=60),p[0]=~~(s+.5),p[1]=~~(100*o+.5),p[2]=~~(100*l+.5)),i&&p.length<4&&(p[3]=1),p},_h=function(e){var t=[],i=[],n=-1;return e.split(Eh).forEach((function(e){var r=e.match(Hl)||[];t.push.apply(t,r),i.push(n+=r.length+1)})),t.c=i,t},Sh=function(e,t,i){var n,r,a,s,o="",l=(e+o).match(Eh),c=t?"hsla(":"rgba(",h=0;if(!l)return e;if(l=l.map((function(e){return(e=wh(e,t,1))&&c+(t?e[0]+","+e[1]+"%,"+e[2]+"%,"+e[3]:e.join(","))+")"})),i&&(a=_h(e),(n=i.c).join(o)!==a.c.join(o)))for(s=(r=e.replace(Eh,"1").split(Hl)).length-1;h<s;h++)o+=r[h]+(~n.indexOf(h)?l.shift()||c+"0,0,0,0)":(a.length?a:l.length?l:i).shift());if(!r)for(s=(r=e.split(Eh)).length-1;h<s;h++)o+=r[h]+l[h];return o+r[s]},Eh=function(){var e,t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b";for(e in bh)t+="|"+e+"\\b";return new RegExp(t+")","gi")}(),Ch=/hsl[a]?\(/,Ah=function(e){var t,i=e.join(" ");if(Eh.lastIndex=0,Eh.test(i))return t=Ch.test(i),e[1]=Sh(e[1],t),e[0]=Sh(e[0],t,_h(e[1])),!0},Mh=function(){var e,t,i,n,r,a,s=Date.now,o=500,l=33,c=s(),h=c,u=1e3/240,d=u,p=[],f=function i(f){var m,g,v,y,b=s()-h,x=!0===f;if((b>o||b<0)&&(c+=b-l),((m=(v=(h+=b)-c)-d)>0||x)&&(y=++n.frame,r=v-1e3*n.time,n.time=v/=1e3,d+=m+(m>=u?4:u-m),g=1),x||(e=t(i)),g)for(a=0;a<p.length;a++)p[a](v,r,y,f)};return n={time:0,frame:0,tick:function(){f(!0)},deltaRatio:function(e){return r/(1e3/(e||60))},wake:function(){yl&&(!gl&&Nl()&&(ml=gl=window,vl=ml.document||{},Ql.gsap=Au,(ml.gsapVersions||(ml.gsapVersions=[])).push(Au.version),Kl(Zl||ml.GreenSockGlobals||!ml.gsap&&ml||{}),gh.forEach(vh)),i="undefined"!==typeof requestAnimationFrame&&requestAnimationFrame,e&&n.sleep(),t=i||function(e){return setTimeout(e,d-1e3*n.time+1|0)},wl=1,f(2))},sleep:function(){(i?cancelAnimationFrame:clearTimeout)(e),wl=0,t=tc},lagSmoothing:function(e,t){o=e||1/0,l=Math.min(t||33,o)},fps:function(e){u=1e3/(e||240),d=1e3*n.time+u},add:function(e,t,i){var r=t?function(t,i,a,s){e(t,i,a,s),n.remove(r)}:e;return n.remove(e),p[i?"unshift":"push"](r),Th(),r},remove:function(e,t){~(t=p.indexOf(e))&&p.splice(t,1)&&a>=t&&a--},_listeners:p},n}(),Th=function(){return!wl&&Mh.wake()},Ph={},Dh=/^[\d.\-M][\d.\-,\s]/,kh=/["']/g,Oh=function(e){for(var t,i,n,r={},a=e.substr(1,e.length-3).split(":"),s=a[0],o=1,l=a.length;o<l;o++)i=a[o],t=o!==l-1?i.lastIndexOf(","):i.length,n=i.substr(0,t),r[s]=isNaN(n)?n.replace(kh,"").trim():+n,s=i.substr(t+1).trim();return r},Ih=function(e){return function(t){return 1-e(1-t)}},Rh=function e(t,i){for(var n,r=t._first;r;)r instanceof Uh?e(r,i):!r.vars.yoyoEase||r._yoyo&&r._repeat||r._yoyo===i||(r.timeline?e(r.timeline,i):(n=r._ease,r._ease=r._yEase,r._yEase=n,r._yoyo=i)),r=r._next},Lh=function(e,t){return e&&(Il(e)?e:Ph[e]||function(e){var t=(e+"").split("("),i=Ph[t[0]];return i&&t.length>1&&i.config?i.config.apply(null,~e.indexOf("{")?[Oh(t[1])]:function(e){var t=e.indexOf("(")+1,i=e.indexOf(")"),n=e.indexOf("(",t);return e.substring(t,~n&&n<i?e.indexOf(")",i+1):i)}(e).split(",").map(Sc)):Ph._CE&&Dh.test(e)?Ph._CE("",e):i}(e))||t},Bh=function(e,t,i,n){void 0===i&&(i=function(e){return 1-t(1-e)}),void 0===n&&(n=function(e){return e<.5?t(2*e)/2:1-t(2*(1-e))/2});var r,a={easeIn:t,easeOut:i,easeInOut:n};return gc(e,(function(e){for(var t in Ph[e]=Ql[e]=a,Ph[r=e.toLowerCase()]=i,a)Ph[r+("easeIn"===t?".in":"easeOut"===t?".out":".inOut")]=Ph[e+"."+t]=a[t]})),a},zh=function(e){return function(t){return t<.5?(1-e(1-2*t))/2:.5+e(2*(t-.5))/2}},Nh=function e(t,i,n){var r=i>=1?i:1,a=(n||(t?.3:.45))/(i<1?i:1),s=a/Al*(Math.asin(1/r)||0),o=function(e){return 1===e?1:r*Math.pow(2,-10*e)*kl((e-s)*a)+1},l="out"===t?o:"in"===t?function(e){return 1-o(1-e)}:zh(o);return a=Al/a,l.config=function(i,n){return e(t,i,n)},l},Fh=function e(t,i){void 0===i&&(i=1.70158);var n=function(e){return e?--e*e*((i+1)*e+i)+1:0},r="out"===t?n:"in"===t?function(e){return 1-n(1-e)}:zh(n);return r.config=function(i){return e(t,i)},r};gc("Linear,Quad,Cubic,Quart,Quint,Strong",(function(e,t){var i=t<5?t+1:t;Bh(e+",Power"+(i-1),t?function(e){return Math.pow(e,i)}:function(e){return e},(function(e){return 1-Math.pow(1-e,i)}),(function(e){return e<.5?Math.pow(2*e,i)/2:1-Math.pow(2*(1-e),i)/2}))})),Ph.Linear.easeNone=Ph.none=Ph.Linear.easeIn,Bh("Elastic",Nh("in"),Nh("out"),Nh()),function(e,t){var i=1/t,n=function(n){return n<i?e*n*n:n<.7272727272727273?e*Math.pow(n-1.5/t,2)+.75:n<.9090909090909092?e*(n-=2.25/t)*n+.9375:e*Math.pow(n-2.625/t,2)+.984375};Bh("Bounce",(function(e){return 1-n(1-e)}),n)}(7.5625,2.75),Bh("Expo",(function(e){return e?Math.pow(2,10*(e-1)):0})),Bh("Circ",(function(e){return-(Pl(1-e*e)-1)})),Bh("Sine",(function(e){return 1===e?1:1-Dl(e*Ml)})),Bh("Back",Fh("in"),Fh("out"),Fh()),Ph.SteppedEase=Ph.steps=Ql.SteppedEase={config:function(e,t){void 0===e&&(e=1);var i=1/e,n=e+(t?0:1),r=t?1:0;return function(e){return((n*$c(0,.99999999,e)|0)+r)*i}}},Sl.ease=Ph["quad.out"],gc("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",(function(e){return dc+=e+","+e+"Params,"}));var jh=function(e,t){this.id=Tl++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:mc,this.set=t?t.getSetter:ru},Vh=function(){function e(e){this.vars=e,this._delay=+e.delay||0,(this._repeat=e.repeat===1/0?-2:e.repeat||0)&&(this._rDelay=e.repeatDelay||0,this._yoyo=!!e.yoyo||!!e.yoyoEase),this._ts=1,Xc(this,+e.duration,1,1),this.data=e.data,pl&&(this._ctx=pl,pl.data.push(this)),wl||Mh.wake()}var t=e.prototype;return t.delay=function(e){return e||0===e?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+e-this._delay),this._delay=e,this):this._delay},t.duration=function(e){return arguments.length?this.totalDuration(this._repeat>0?e+(e+this._rDelay)*this._repeat:e):this.totalDuration()&&this._dur},t.totalDuration=function(e){return arguments.length?(this._dirty=0,Xc(this,this._repeat<0?e:(e-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(e,t){if(Th(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(jc(this,e),!i._dp||i.parent||Vc(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&e<this._tDur||this._ts<0&&e>0||!this._tDur&&!e)&&Uc(this._dp,this,this._start-this._delay)}return(this._tTime!==e||!this._dur&&!t||this._initted&&Math.abs(this._zTime)===Cl||!e&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=e),_c(this,e,t)),this},t.time=function(e,t){return arguments.length?this.totalTime(Math.min(this.totalDuration(),e+Bc(this))%(this._dur+this._rDelay)||(e?this._dur:0),t):this._time},t.totalProgress=function(e,t){return arguments.length?this.totalTime(this.totalDuration()*e,t):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},t.progress=function(e,t){return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?e:1-e)+Bc(this),t):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(e,t){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(e-1)*i,t):this._repeat?zc(this._tTime,i)+1:1},t.timeScale=function(e,t){if(!arguments.length)return-1e-8===this._rts?0:this._rts;if(this._rts===e)return this;var i=this.parent&&this._ts?Nc(this.parent._time,this):this._tTime;return this._rts=+e||0,this._ts=this._ps||-1e-8===e?0:this._rts,this.totalTime($c(-Math.abs(this._delay),this._tDur,i),!1!==t),Fc(this),function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e}(this)},t.paused=function(e){return arguments.length?(this._ps!==e&&(this._ps=e,e?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Th(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&Math.abs(this._zTime)!==Cl&&(this._tTime-=Cl)))),this):this._ps},t.startTime=function(e){if(arguments.length){this._start=e;var t=this.parent||this._dp;return t&&(t._sort||!this.parent)&&Uc(t,this,e-this._delay),this}return this._start},t.endTime=function(e){return this._start+(zl(e)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(e){var t=this.parent||this._dp;return t?e&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Nc(t.rawTime(e),this):this._tTime:this._tTime},t.revert=function(e){void 0===e&&(e=rc);var t=dl;return dl=e,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(e),this.totalTime(-.01,e.suppressEvents)),"nested"!==this.data&&!1!==e.kill&&this.kill(),dl=t,this},t.globalTime=function(e){for(var t=this,i=arguments.length?e:t.rawTime();t;)i=t._start+i/(Math.abs(t._ts)||1),t=t._dp;return!this.parent&&this._sat?this._sat.globalTime(e):i},t.repeat=function(e){return arguments.length?(this._repeat=e===1/0?-2:e,Yc(this)):-2===this._repeat?1/0:this._repeat},t.repeatDelay=function(e){if(arguments.length){var t=this._time;return this._rDelay=e,Yc(this),t?this.time(t):this}return this._rDelay},t.yoyo=function(e){return arguments.length?(this._yoyo=e,this):this._yoyo},t.seek=function(e,t){return this.totalTime(Zc(this,e),zl(t))},t.restart=function(e,t){return this.play().totalTime(e?-this._delay:0,zl(t))},t.play=function(e,t){return null!=e&&this.seek(e,t),this.reversed(!1).paused(!1)},t.reverse=function(e,t){return null!=e&&this.seek(e||this.totalDuration(),t),this.reversed(!0).paused(!1)},t.pause=function(e,t){return null!=e&&this.seek(e,t),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(e){return arguments.length?(!!e!==this.reversed()&&this.timeScale(-this._rts||(e?-1e-8:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-1e-8,this},t.isActive=function(){var e,t=this.parent||this._dp,i=this._start;return!(t&&!(this._ts&&this._initted&&t.isActive()&&(e=t.rawTime(!0))>=i&&e<this.endTime(!0)-Cl))},t.eventCallback=function(e,t,i){var n=this.vars;return arguments.length>1?(t?(n[e]=t,i&&(n[e+"Params"]=i),"onUpdate"===e&&(this._onUpdate=t)):delete n[e],this):n[e]},t.then=function(e){var t=this;return new Promise((function(i){var n=Il(e)?e:Ec,r=function(){var e=t.then;t.then=null,Il(n)&&(n=n(t))&&(n.then||n===t)&&(t.then=e),i(n),t.then=e};t._initted&&1===t.totalProgress()&&t._ts>=0||!t._tTime&&t._ts<0?r():t._prom=r}))},t.kill=function(){mh(this)},e}();Cc(Vh.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-1e-8,_prom:0,_ps:!1,_rts:1});var Uh=function(e){function t(t,i){var n;return void 0===t&&(t={}),(n=e.call(this,t)||this).labels={},n.smoothChildTiming=!!t.smoothChildTiming,n.autoRemoveChildren=!!t.autoRemoveChildren,n._sort=zl(t.sortChildren),fl&&Uc(t.parent||fl,cl(n),i),t.reversed&&n.reverse(),t.paused&&n.paused(!0),t.scrollTrigger&&Gc(cl(n),t.scrollTrigger),n}hl(t,e);var i=t.prototype;return i.to=function(e,t,i){return Kc(0,arguments,this),this},i.from=function(e,t,i){return Kc(1,arguments,this),this},i.fromTo=function(e,t,i,n){return Kc(2,arguments,this),this},i.set=function(e,t,i){return t.duration=0,t.parent=this,Pc(t).repeatDelay||(t.repeat=0),t.immediateRender=!!t.immediateRender,new $h(e,t,Zc(this,i),1),this},i.call=function(e,t,i){return Uc(this,$h.delayedCall(0,e,t),i)},i.staggerTo=function(e,t,i,n,r,a,s){return i.duration=t,i.stagger=i.stagger||n,i.onComplete=a,i.onCompleteParams=s,i.parent=this,new $h(e,i,Zc(this,r)),this},i.staggerFrom=function(e,t,i,n,r,a,s){return i.runBackwards=1,Pc(i).immediateRender=zl(i.immediateRender),this.staggerTo(e,t,i,n,r,a,s)},i.staggerFromTo=function(e,t,i,n,r,a,s,o){return n.startAt=i,Pc(n).immediateRender=zl(n.immediateRender),this.staggerTo(e,t,n,r,a,s,o)},i.render=function(e,t,i){var n,r,a,s,o,l,c,h,u,d,p,f,m=this._time,g=this._dirty?this.totalDuration():this._tDur,v=this._dur,y=e<=0?0:yc(e),b=this._zTime<0!==e<0&&(this._initted||!v);if(this!==fl&&y>g&&e>=0&&(y=g),y!==this._tTime||i||b){if(m!==this._time&&v&&(y+=this._time-m,e+=this._time-m),n=y,u=this._start,l=!(h=this._ts),b&&(v||(m=this._zTime),(e||!t)&&(this._zTime=e)),this._repeat){if(p=this._yoyo,o=v+this._rDelay,this._repeat<-1&&e<0)return this.totalTime(100*o+e,t,i);if(n=yc(y%o),y===g?(s=this._repeat,n=v):((s=~~(y/o))&&s===y/o&&(n=v,s--),n>v&&(n=v)),d=zc(this._tTime,o),!m&&this._tTime&&d!==s&&this._tTime-d*o-this._dur<=0&&(d=s),p&&1&s&&(n=v-n,f=1),s!==d&&!this._lock){var x=p&&1&d,w=x===(p&&1&s);if(s<d&&(x=!x),m=x?0:y%v?v:y,this._lock=1,this.render(m||(f?0:yc(s*o)),t,!v)._lock=0,this._tTime=y,!t&&this.parent&&fh(this,"onRepeat"),this.vars.repeatRefresh&&!f&&(this.invalidate()._lock=1),m&&m!==this._time||l!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(v=this._dur,g=this._tDur,w&&(this._lock=2,m=x?v:-1e-4,this.render(m,!0),this.vars.repeatRefresh&&!f&&this.invalidate()),this._lock=0,!this._ts&&!l)return this;Rh(this,f)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(c=function(e,t,i){var n;if(i>t)for(n=e._first;n&&n._start<=i;){if("isPause"===n.data&&n._start>t)return n;n=n._next}else for(n=e._last;n&&n._start>=i;){if("isPause"===n.data&&n._start<t)return n;n=n._prev}}(this,yc(m),yc(n)),c&&(y-=n-(n=c._start))),this._tTime=y,this._time=n,this._act=!h,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=e,m=0),!m&&n&&!t&&!s&&(fh(this,"onStart"),this._tTime!==y))return this;if(n>=m&&e>=0)for(r=this._first;r;){if(a=r._next,(r._act||n>=r._start)&&r._ts&&c!==r){if(r.parent!==this)return this.render(e,t,i);if(r.render(r._ts>0?(n-r._start)*r._ts:(r._dirty?r.totalDuration():r._tDur)+(n-r._start)*r._ts,t,i),n!==this._time||!this._ts&&!l){c=0,a&&(y+=this._zTime=-1e-8);break}}r=a}else{r=this._last;for(var _=e<0?e:n;r;){if(a=r._prev,(r._act||_<=r._end)&&r._ts&&c!==r){if(r.parent!==this)return this.render(e,t,i);if(r.render(r._ts>0?(_-r._start)*r._ts:(r._dirty?r.totalDuration():r._tDur)+(_-r._start)*r._ts,t,i||dl&&(r._initted||r._startAt)),n!==this._time||!this._ts&&!l){c=0,a&&(y+=this._zTime=_?-1e-8:Cl);break}}r=a}}if(c&&!t&&(this.pause(),c.render(n>=m?0:-1e-8)._zTime=n>=m?1:-1,this._ts))return this._start=u,Fc(this),this.render(e,t,i);this._onUpdate&&!t&&fh(this,"onUpdate",!0),(y===g&&this._tTime>=this.totalDuration()||!y&&m)&&(u!==this._start&&Math.abs(h)===Math.abs(this._ts)||this._lock||((e||!v)&&(y===g&&this._ts>0||!y&&this._ts<0)&&Oc(this,1),t||e<0&&!m||!y&&!m&&g||(fh(this,y===g&&e>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(y<g&&this.timeScale()>0)&&this._prom())))}return this},i.add=function(e,t){var i=this;if(Rl(t)||(t=Zc(this,t,e)),!(e instanceof Vh)){if(Vl(e))return e.forEach((function(e){return i.add(e,t)})),this;if(Ol(e))return this.addLabel(e,t);if(!Il(e))return this;e=$h.delayedCall(0,e)}return this!==e?Uc(this,e,t):this},i.getChildren=function(e,t,i,n){void 0===e&&(e=!0),void 0===t&&(t=!0),void 0===i&&(i=!0),void 0===n&&(n=-El);for(var r=[],a=this._first;a;)a._start>=n&&(a instanceof $h?t&&r.push(a):(i&&r.push(a),e&&r.push.apply(r,a.getChildren(!0,t,i)))),a=a._next;return r},i.getById=function(e){for(var t=this.getChildren(1,1,1),i=t.length;i--;)if(t[i].vars.id===e)return t[i]},i.remove=function(e){return Ol(e)?this.removeLabel(e):Il(e)?this.killTweensOf(e):(kc(this,e),e===this._recent&&(this._recent=this._last),Ic(this))},i.totalTime=function(t,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=yc(Mh.time-(this._ts>0?t/this._ts:(this.totalDuration()-t)/-this._ts))),e.prototype.totalTime.call(this,t,i),this._forcing=0,this):this._tTime},i.addLabel=function(e,t){return this.labels[e]=Zc(this,t),this},i.removeLabel=function(e){return delete this.labels[e],this},i.addPause=function(e,t,i){var n=$h.delayedCall(0,t||tc,i);return n.data="isPause",this._hasPause=1,Uc(this,n,Zc(this,e))},i.removePause=function(e){var t=this._first;for(e=Zc(this,e);t;)t._start===e&&"isPause"===t.data&&Oc(t),t=t._next},i.killTweensOf=function(e,t,i){for(var n=this.getTweensOf(e,i),r=n.length;r--;)Gh!==n[r]&&n[r].kill(e,t);return this},i.getTweensOf=function(e,t){for(var i,n=[],r=nh(e),a=this._first,s=Rl(t);a;)a instanceof $h?xc(a._targets,r)&&(s?(!Gh||a._initted&&a._ts)&&a.globalTime(0)<=t&&a.globalTime(a.totalDuration())>t:!t||a.isActive())&&n.push(a):(i=a.getTweensOf(r,t)).length&&n.push.apply(n,i),a=a._next;return n},i.tweenTo=function(e,t){t=t||{};var i,n=this,r=Zc(n,e),a=t,s=a.startAt,o=a.onStart,l=a.onStartParams,c=a.immediateRender,h=$h.to(n,Cc({ease:t.ease||"none",lazy:!1,immediateRender:!1,time:r,overwrite:"auto",duration:t.duration||Math.abs((r-(s&&"time"in s?s.time:n._time))/n.timeScale())||Cl,onStart:function(){if(n.pause(),!i){var e=t.duration||Math.abs((r-(s&&"time"in s?s.time:n._time))/n.timeScale());h._dur!==e&&Xc(h,e,0,1).render(h._time,!0,!0),i=1}o&&o.apply(h,l||[])}},t));return c?h.render(0):h},i.tweenFromTo=function(e,t,i){return this.tweenTo(t,Cc({startAt:{time:Zc(this,e)}},i))},i.recent=function(){return this._recent},i.nextLabel=function(e){return void 0===e&&(e=this._time),ph(this,Zc(this,e))},i.previousLabel=function(e){return void 0===e&&(e=this._time),ph(this,Zc(this,e),1)},i.currentLabel=function(e){return arguments.length?this.seek(e,!0):this.previousLabel(this._time+Cl)},i.shiftChildren=function(e,t,i){void 0===i&&(i=0);for(var n,r=this._first,a=this.labels;r;)r._start>=i&&(r._start+=e,r._end+=e),r=r._next;if(t)for(n in a)a[n]>=i&&(a[n]+=e);return Ic(this)},i.invalidate=function(t){var i=this._first;for(this._lock=0;i;)i.invalidate(t),i=i._next;return e.prototype.invalidate.call(this,t)},i.clear=function(e){void 0===e&&(e=!0);for(var t,i=this._first;i;)t=i._next,this.remove(i),i=t;return this._dp&&(this._time=this._tTime=this._pTime=0),e&&(this.labels={}),Ic(this)},i.totalDuration=function(e){var t,i,n,r=0,a=this,s=a._last,o=El;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-e:e));if(a._dirty){for(n=a.parent;s;)t=s._prev,s._dirty&&s.totalDuration(),(i=s._start)>o&&a._sort&&s._ts&&!a._lock?(a._lock=1,Uc(a,s,i-s._delay,1)._lock=0):o=i,i<0&&s._ts&&(r-=i,(!n&&!a._dp||n&&n.smoothChildTiming)&&(a._start+=i/a._ts,a._time-=i,a._tTime-=i),a.shiftChildren(-i,!1,-Infinity),o=0),s._end>r&&s._ts&&(r=s._end),s=t;Xc(a,a===fl&&a._time>r?a._time:r,1,1),a._dirty=0}return a._tDur},t.updateRoot=function(e){if(fl._ts&&(_c(fl,Nc(e,fl)),bl=Mh.frame),Mh.frame>=hc){hc+=_l.autoSleep||120;var t=fl._first;if((!t||!t._ts)&&_l.autoSleep&&Mh._listeners.length<2){for(;t&&!t._ts;)t=t._next;t||Mh.sleep()}}},t}(Vh);Cc(Uh.prototype,{_lock:0,_hasPause:0,_forcing:0});var Gh,Hh,Wh=function(e,t,i,n,r,a,s){var o,l,c,h,u,d,p,f,m=new pu(this._pt,e,t,0,1,ou,null,r),g=0,v=0;for(m.b=i,m.e=n,i+="",(p=~(n+="").indexOf("random("))&&(n=uh(n)),a&&(a(f=[i,n],e,t),i=f[0],n=f[1]),l=i.match(Wl)||[];o=Wl.exec(n);)h=o[0],u=n.substring(g,o.index),c?c=(c+1)%5:"rgba("===u.substr(-5)&&(c=1),h!==l[v++]&&(d=parseFloat(l[v-1])||0,m._pt={_next:m._pt,p:u||1===v?u:",",s:d,c:"="===h.charAt(1)?bc(d,h)-d:parseFloat(h)-d,m:c&&c<4?Math.round:0},g=Wl.lastIndex);return m.c=g<n.length?n.substring(g,n.length):"",m.fp=s,(ql.test(n)||p)&&(m.e=0),this._pt=m,m},qh=function(e,t,i,n,r,a,s,o,l,c){Il(n)&&(n=n(r||0,e,a));var h,u=e[t],d="get"!==i?i:Il(u)?l?e[t.indexOf("set")||!Il(e["get"+t.substr(3)])?t:"get"+t.substr(3)](l):e[t]():u,p=Il(u)?l?iu:tu:eu;if(Ol(n)&&(~n.indexOf("random(")&&(n=uh(n)),"="===n.charAt(1)&&((h=bc(d,n)+(eh(d)||0))||0===h)&&(n=h)),!c||d!==n||Hh)return isNaN(d*n)||""===n?(!u&&!(t in e)&&Jl(t,n),Wh.call(this,e,t,d,n,p,o||_l.stringFilter,l)):(h=new pu(this._pt,e,t,+d||0,n-(d||0),"boolean"===typeof u?su:au,0,p),l&&(h.fp=l),s&&h.modifier(s,this,e),this._pt=h)},Xh=function(e,t,i,n,r,a){var s,o,l,c;if(lc[e]&&!1!==(s=new lc[e]).init(r,s.rawVars?t[e]:function(e,t,i,n,r){if(Il(e)&&(e=Zh(e,r,t,i,n)),!Bl(e)||e.style&&e.nodeType||Vl(e)||jl(e))return Ol(e)?Zh(e,r,t,i,n):e;var a,s={};for(a in e)s[a]=Zh(e[a],r,t,i,n);return s}(t[e],n,r,a,i),i,n,a)&&(i._pt=o=new pu(i._pt,r,e,0,1,s.render,s,0,s.priority),i!==xl))for(l=i._ptLookup[i._targets.indexOf(r)],c=s._props.length;c--;)l[s._props[c]]=o;return s},Yh=function e(t,i,n){var r,a,s,o,l,c,h,u,d,p,f,m,g,v=t.vars,y=v.ease,b=v.startAt,x=v.immediateRender,w=v.lazy,_=v.onUpdate,S=v.runBackwards,E=v.yoyoEase,C=v.keyframes,A=v.autoRevert,M=t._dur,T=t._startAt,P=t._targets,D=t.parent,k=D&&"nested"===D.data?D.vars.targets:P,O="auto"===t._overwrite&&!ul,I=t.timeline;if(I&&(!C||!y)&&(y="none"),t._ease=Lh(y,Sl.ease),t._yEase=E?Ih(Lh(!0===E?y:E,Sl.ease)):0,E&&t._yoyo&&!t._repeat&&(E=t._yEase,t._yEase=t._ease,t._ease=E),t._from=!I&&!!v.runBackwards,!I||C&&!v.stagger){if(m=(u=P[0]?fc(P[0]).harness:0)&&v[u.prop],r=Tc(v,ac),T&&(T._zTime<0&&T.progress(1),i<0&&S&&x&&!A?T.render(-1,!0):T.revert(S&&M?nc:ic),T._lazy=0),b){if(Oc(t._startAt=$h.set(P,Cc({data:"isStart",overwrite:!1,parent:D,immediateRender:!0,lazy:!T&&zl(w),startAt:null,delay:0,onUpdate:_&&function(){return fh(t,"onUpdate")},stagger:0},b))),t._startAt._dp=0,t._startAt._sat=t,i<0&&(dl||!x&&!A)&&t._startAt.revert(nc),x&&M&&i<=0&&n<=0)return void(i&&(t._zTime=i))}else if(S&&M&&!T)if(i&&(x=!1),s=Cc({overwrite:!1,data:"isFromStart",lazy:x&&!T&&zl(w),immediateRender:x,stagger:0,parent:D},r),m&&(s[u.prop]=m),Oc(t._startAt=$h.set(P,s)),t._startAt._dp=0,t._startAt._sat=t,i<0&&(dl?t._startAt.revert(nc):t._startAt.render(-1,!0)),t._zTime=i,x){if(!i)return}else e(t._startAt,Cl,Cl);for(t._pt=t._ptCache=0,w=M&&zl(w)||w&&!M,a=0;a<P.length;a++){if(h=(l=P[a])._gsap||pc(P)[a]._gsap,t._ptLookup[a]=p={},oc[h.id]&&sc.length&&wc(),f=k===P?a:k.indexOf(l),u&&!1!==(d=new u).init(l,m||r,t,f,k)&&(t._pt=o=new pu(t._pt,l,d.name,0,1,d.render,d,0,d.priority),d._props.forEach((function(e){p[e]=o})),d.priority&&(c=1)),!u||m)for(s in r)lc[s]&&(d=Xh(s,r,t,f,l,k))?d.priority&&(c=1):p[s]=o=qh.call(t,l,s,"get",r[s],f,k,0,v.stringFilter);t._op&&t._op[a]&&t.kill(l,t._op[a]),O&&t._pt&&(Gh=t,fl.killTweensOf(l,p,t.globalTime(i)),g=!t.parent,Gh=0),t._pt&&w&&(oc[h.id]=1)}c&&du(t),t._onInit&&t._onInit(t)}t._onUpdate=_,t._initted=(!t._op||t._pt)&&!g,C&&i<=0&&I.render(El,!0,!0)},Qh=function(e,t,i,n){var r,a,s=t.ease||n||"power1.inOut";if(Vl(t))a=i[e]||(i[e]=[]),t.forEach((function(e,i){return a.push({t:i/(t.length-1)*100,v:e,e:s})}));else for(r in t)a=i[r]||(i[r]=[]),"ease"===r||a.push({t:parseFloat(e),v:t[r],e:s})},Zh=function(e,t,i,n,r){return Il(e)?e.call(t,i,n,r):Ol(e)&&~e.indexOf("random(")?uh(e):e},Kh=dc+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",Jh={};gc(Kh+",id,stagger,delay,duration,paused,scrollTrigger",(function(e){return Jh[e]=1}));var $h=function(e){function t(t,i,n,r){var a;"number"===typeof i&&(n.duration=i,i=n,n=null);var s,o,l,c,h,u,d,p,f=(a=e.call(this,r?i:Pc(i))||this).vars,m=f.duration,g=f.delay,v=f.immediateRender,y=f.stagger,b=f.overwrite,x=f.keyframes,w=f.defaults,_=f.scrollTrigger,S=f.yoyoEase,E=i.parent||fl,C=(Vl(t)||jl(t)?Rl(t[0]):"length"in i)?[t]:nh(t);if(a._targets=C.length?pc(C):$l("GSAP target "+t+" not found. https://gsap.com",!_l.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=b,x||y||Fl(m)||Fl(g)){if(i=a.vars,(s=a.timeline=new Uh({data:"nested",defaults:w||{},targets:E&&"nested"===E.data?E.vars.targets:C})).kill(),s.parent=s._dp=cl(a),s._start=0,y||Fl(m)||Fl(g)){if(c=C.length,d=y&&sh(y),Bl(y))for(h in y)~Kh.indexOf(h)&&(p||(p={}),p[h]=y[h]);for(o=0;o<c;o++)(l=Tc(i,Jh)).stagger=0,S&&(l.yoyoEase=S),p&&Ac(l,p),u=C[o],l.duration=+Zh(m,cl(a),o,u,C),l.delay=(+Zh(g,cl(a),o,u,C)||0)-a._delay,!y&&1===c&&l.delay&&(a._delay=g=l.delay,a._start+=g,l.delay=0),s.to(u,l,d?d(o,u,C):0),s._ease=Ph.none;s.duration()?m=g=0:a.timeline=0}else if(x){Pc(Cc(s.vars.defaults,{ease:"none"})),s._ease=Lh(x.ease||i.ease||"none");var A,M,T,P=0;if(Vl(x))x.forEach((function(e){return s.to(C,e,">")})),s.duration();else{for(h in l={},x)"ease"===h||"easeEach"===h||Qh(h,x[h],l,x.easeEach);for(h in l)for(A=l[h].sort((function(e,t){return e.t-t.t})),P=0,o=0;o<A.length;o++)(T={ease:(M=A[o]).e,duration:(M.t-(o?A[o-1].t:0))/100*m})[h]=M.v,s.to(C,T,P),P+=T.duration;s.duration()<m&&s.to({},{duration:m-s.duration()})}}m||a.duration(m=s.duration())}else a.timeline=0;return!0!==b||ul||(Gh=cl(a),fl.killTweensOf(C),Gh=0),Uc(E,cl(a),n),i.reversed&&a.reverse(),i.paused&&a.paused(!0),(v||!m&&!x&&a._start===yc(E._time)&&zl(v)&&Lc(cl(a))&&"nested"!==E.data)&&(a._tTime=-1e-8,a.render(Math.max(0,-g)||0)),_&&Gc(cl(a),_),a}hl(t,e);var i=t.prototype;return i.render=function(e,t,i){var n,r,a,s,o,l,c,h,u,d=this._time,p=this._tDur,f=this._dur,m=e<0,g=e>p-Cl&&!m?p:e<Cl?0:e;if(f){if(g!==this._tTime||!e||i||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==m){if(n=g,h=this.timeline,this._repeat){if(s=f+this._rDelay,this._repeat<-1&&m)return this.totalTime(100*s+e,t,i);if(n=yc(g%s),g===p?(a=this._repeat,n=f):((a=~~(g/s))&&a===yc(g/s)&&(n=f,a--),n>f&&(n=f)),(l=this._yoyo&&1&a)&&(u=this._yEase,n=f-n),o=zc(this._tTime,s),n===d&&!i&&this._initted&&a===o)return this._tTime=g,this;a!==o&&(h&&this._yEase&&Rh(h,l),this.vars.repeatRefresh&&!l&&!this._lock&&this._time!==s&&this._initted&&(this._lock=i=1,this.render(yc(s*a),!0).invalidate()._lock=0))}if(!this._initted){if(Hc(this,m?e:n,i,t,g))return this._tTime=0,this;if(d!==this._time&&(!i||!this.vars.repeatRefresh||a===o))return this;if(f!==this._dur)return this.render(e,t,i)}if(this._tTime=g,this._time=n,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=c=(u||this._ease)(n/f),this._from&&(this.ratio=c=1-c),n&&!d&&!t&&!a&&(fh(this,"onStart"),this._tTime!==g))return this;for(r=this._pt;r;)r.r(c,r.d),r=r._next;h&&h.render(e<0?e:h._dur*h._ease(n/this._dur),t,i)||this._startAt&&(this._zTime=e),this._onUpdate&&!t&&(m&&Rc(this,e,0,i),fh(this,"onUpdate")),this._repeat&&a!==o&&this.vars.onRepeat&&!t&&this.parent&&fh(this,"onRepeat"),g!==this._tDur&&g||this._tTime!==g||(m&&!this._onUpdate&&Rc(this,e,0,!0),(e||!f)&&(g===this._tDur&&this._ts>0||!g&&this._ts<0)&&Oc(this,1),t||m&&!d||!(g||d||l)||(fh(this,g===p?"onComplete":"onReverseComplete",!0),this._prom&&!(g<p&&this.timeScale()>0)&&this._prom()))}}else!function(e,t,i,n){var r,a,s,o=e.ratio,l=t<0||!t&&(!e._start&&Wc(e)&&(e._initted||!qc(e))||(e._ts<0||e._dp._ts<0)&&!qc(e))?0:1,c=e._rDelay,h=0;if(c&&e._repeat&&(h=$c(0,e._tDur,t),a=zc(h,c),e._yoyo&&1&a&&(l=1-l),a!==zc(e._tTime,c)&&(o=1-l,e.vars.repeatRefresh&&e._initted&&e.invalidate())),l!==o||dl||n||e._zTime===Cl||!t&&e._zTime){if(!e._initted&&Hc(e,t,n,i,h))return;for(s=e._zTime,e._zTime=t||(i?Cl:0),i||(i=t&&!s),e.ratio=l,e._from&&(l=1-l),e._time=0,e._tTime=h,r=e._pt;r;)r.r(l,r.d),r=r._next;t<0&&Rc(e,t,0,!0),e._onUpdate&&!i&&fh(e,"onUpdate"),h&&e._repeat&&!i&&e.parent&&fh(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===l&&(l&&Oc(e,1),i||dl||(fh(e,l?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)}(this,e,t,i);return this},i.targets=function(){return this._targets},i.invalidate=function(t){return(!t||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(t),e.prototype.invalidate.call(this,t)},i.resetTo=function(e,t,i,n,r){wl||Mh.wake(),this._ts||this.play();var a=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return this._initted||Yh(this,a),function(e,t,i,n,r,a,s,o){var l,c,h,u,d=(e._pt&&e._ptCache||(e._ptCache={}))[t];if(!d)for(d=e._ptCache[t]=[],h=e._ptLookup,u=e._targets.length;u--;){if((l=h[u][t])&&l.d&&l.d._pt)for(l=l.d._pt;l&&l.p!==t&&l.fp!==t;)l=l._next;if(!l)return Hh=1,e.vars[t]="+=0",Yh(e,s),Hh=0,o?$l(t+" not eligible for reset"):1;d.push(l)}for(u=d.length;u--;)(l=(c=d[u])._pt||c).s=!n&&0!==n||r?l.s+(n||0)+a*l.c:n,l.c=i-l.s,c.e&&(c.e=vc(i)+eh(c.e)),c.b&&(c.b=l.s+eh(c.b))}(this,e,t,i,n,this._ease(a/this._dur),a,r)?this.resetTo(e,t,i,n,1):(jc(this,0),this.parent||Dc(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},i.kill=function(e,t){if(void 0===t&&(t="all"),!e&&(!t||"all"===t))return this._lazy=this._pt=0,this.parent?mh(this):this;if(this.timeline){var i=this.timeline.totalDuration();return this.timeline.killTweensOf(e,t,Gh&&!0!==Gh.vars.overwrite)._first||mh(this),this.parent&&i!==this.timeline.totalDuration()&&Xc(this,this._dur*this.timeline._tDur/i,0,1),this}var n,r,a,s,o,l,c,h=this._targets,u=e?nh(e):h,d=this._ptLookup,p=this._pt;if((!t||"all"===t)&&function(e,t){for(var i=e.length,n=i===t.length;n&&i--&&e[i]===t[i];);return i<0}(h,u))return"all"===t&&(this._pt=0),mh(this);for(n=this._op=this._op||[],"all"!==t&&(Ol(t)&&(o={},gc(t,(function(e){return o[e]=1})),t=o),t=function(e,t){var i,n,r,a,s=e[0]?fc(e[0]).harness:0,o=s&&s.aliases;if(!o)return t;for(n in i=Ac({},t),o)if(n in i)for(r=(a=o[n].split(",")).length;r--;)i[a[r]]=i[n];return i}(h,t)),c=h.length;c--;)if(~u.indexOf(h[c]))for(o in r=d[c],"all"===t?(n[c]=t,s=r,a={}):(a=n[c]=n[c]||{},s=t),s)(l=r&&r[o])&&("kill"in l.d&&!0!==l.d.kill(o)||kc(this,l,"_pt"),delete r[o]),"all"!==a&&(a[o]=1);return this._initted&&!this._pt&&p&&mh(this),this},t.to=function(e,i){return new t(e,i,arguments[2])},t.from=function(e,t){return Kc(1,arguments)},t.delayedCall=function(e,i,n,r){return new t(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:e,onComplete:i,onReverseComplete:i,onCompleteParams:n,onReverseCompleteParams:n,callbackScope:r})},t.fromTo=function(e,t,i){return Kc(2,arguments)},t.set=function(e,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new t(e,i)},t.killTweensOf=function(e,t,i){return fl.killTweensOf(e,t,i)},t}(Vh);Cc($h.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),gc("staggerTo,staggerFrom,staggerFromTo",(function(e){$h[e]=function(){var t=new Uh,i=th.call(arguments,0);return i.splice("staggerFromTo"===e?5:4,0,0),t[e].apply(t,i)}}));var eu=function(e,t,i){return e[t]=i},tu=function(e,t,i){return e[t](i)},iu=function(e,t,i,n){return e[t](n.fp,i)},nu=function(e,t,i){return e.setAttribute(t,i)},ru=function(e,t){return Il(e[t])?tu:Ll(e[t])&&e.setAttribute?nu:eu},au=function(e,t){return t.set(t.t,t.p,Math.round(1e6*(t.s+t.c*e))/1e6,t)},su=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},ou=function(e,t){var i=t._pt,n="";if(!e&&t.b)n=t.b;else if(1===e&&t.e)n=t.e;else{for(;i;)n=i.p+(i.m?i.m(i.s+i.c*e):Math.round(1e4*(i.s+i.c*e))/1e4)+n,i=i._next;n+=t.c}t.set(t.t,t.p,n,t)},lu=function(e,t){for(var i=t._pt;i;)i.r(e,i.d),i=i._next},cu=function(e,t,i,n){for(var r,a=this._pt;a;)r=a._next,a.p===n&&a.modifier(e,t,i),a=r},hu=function(e){for(var t,i,n=this._pt;n;)i=n._next,n.p===e&&!n.op||n.op===e?kc(this,n,"_pt"):n.dep||(t=1),n=i;return!t},uu=function(e,t,i,n){n.mSet(e,t,n.m.call(n.tween,i,n.mt),n)},du=function(e){for(var t,i,n,r,a=e._pt;a;){for(t=a._next,i=n;i&&i.pr>a.pr;)i=i._next;(a._prev=i?i._prev:r)?a._prev._next=a:n=a,(a._next=i)?i._prev=a:r=a,a=t}e._pt=n},pu=function(){function e(e,t,i,n,r,a,s,o,l){this.t=t,this.s=n,this.c=r,this.p=i,this.r=a||au,this.d=s||this,this.set=o||eu,this.pr=l||0,this._next=e,e&&(e._prev=this)}return e.prototype.modifier=function(e,t,i){this.mSet=this.mSet||this.set,this.set=uu,this.m=e,this.mt=i,this.tween=t},e}();gc(dc+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",(function(e){return ac[e]=1})),Ql.TweenMax=Ql.TweenLite=$h,Ql.TimelineLite=Ql.TimelineMax=Uh,fl=new Uh({sortChildren:!1,defaults:Sl,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),_l.stringFilter=Ah;var fu=[],mu={},gu=[],vu=0,yu=0,bu=function(e){return(mu[e]||gu).map((function(e){return e()}))},xu=function(){var e=Date.now(),t=[];e-vu>2&&(bu("matchMediaInit"),fu.forEach((function(e){var i,n,r,a,s=e.queries,o=e.conditions;for(n in s)(i=ml.matchMedia(s[n]).matches)&&(r=1),i!==o[n]&&(o[n]=i,a=1);a&&(e.revert(),r&&t.push(e))})),bu("matchMediaRevert"),t.forEach((function(e){return e.onMatch(e,(function(t){return e.add(null,t)}))})),vu=e,bu("matchMedia"))},wu=function(){function e(e,t){this.selector=t&&rh(t),this.data=[],this._r=[],this.isReverted=!1,this.id=yu++,e&&this.add(e)}var t=e.prototype;return t.add=function(e,t,i){Il(e)&&(i=t,t=e,e=Il);var n=this,r=function(){var e,r=pl,a=n.selector;return r&&r!==n&&r.data.push(n),i&&(n.selector=rh(i)),pl=n,e=t.apply(n,arguments),Il(e)&&n._r.push(e),pl=r,n.selector=a,n.isReverted=!1,e};return n.last=r,e===Il?r(n,(function(e){return n.add(null,e)})):e?n[e]=r:r},t.ignore=function(e){var t=pl;pl=null,e(this),pl=t},t.getTweens=function(){var t=[];return this.data.forEach((function(i){return i instanceof e?t.push.apply(t,i.getTweens()):i instanceof $h&&!(i.parent&&"nested"===i.parent.data)&&t.push(i)})),t},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(e,t){var i=this;if(e?function(){for(var t,n=i.getTweens(),r=i.data.length;r--;)"isFlip"===(t=i.data[r]).data&&(t.revert(),t.getChildren(!0,!0,!1).forEach((function(e){return n.splice(n.indexOf(e),1)})));for(n.map((function(e){return{g:e._dur||e._delay||e._sat&&!e._sat.vars.immediateRender?e.globalTime(0):-1/0,t:e}})).sort((function(e,t){return t.g-e.g||-1/0})).forEach((function(t){return t.t.revert(e)})),r=i.data.length;r--;)(t=i.data[r])instanceof Uh?"nested"!==t.data&&(t.scrollTrigger&&t.scrollTrigger.revert(),t.kill()):!(t instanceof $h)&&t.revert&&t.revert(e);i._r.forEach((function(t){return t(e,i)})),i.isReverted=!0}():this.data.forEach((function(e){return e.kill&&e.kill()})),this.clear(),t)for(var n=fu.length;n--;)fu[n].id===this.id&&fu.splice(n,1)},t.revert=function(e){this.kill(e||{})},e}(),_u=function(){function e(e){this.contexts=[],this.scope=e,pl&&pl.data.push(this)}var t=e.prototype;return t.add=function(e,t,i){Bl(e)||(e={matches:e});var n,r,a,s=new wu(0,i||this.scope),o=s.conditions={};for(r in pl&&!s.selector&&(s.selector=pl.selector),this.contexts.push(s),t=s.add("onMatch",t),s.queries=e,e)"all"===r?a=1:(n=ml.matchMedia(e[r]))&&(fu.indexOf(s)<0&&fu.push(s),(o[r]=n.matches)&&(a=1),n.addListener?n.addListener(xu):n.addEventListener("change",xu));return a&&t(s,(function(e){return s.add(null,e)})),this},t.revert=function(e){this.kill(e||{})},t.kill=function(e){this.contexts.forEach((function(t){return t.kill(e,!0)}))},e}(),Su={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];t.forEach((function(e){return vh(e)}))},timeline:function(e){return new Uh(e)},getTweensOf:function(e,t){return fl.getTweensOf(e,t)},getProperty:function(e,t,i,n){Ol(e)&&(e=nh(e)[0]);var r=fc(e||{}).get,a=i?Ec:Sc;return"native"===i&&(i=""),e?t?a((lc[t]&&lc[t].get||r)(e,t,i,n)):function(t,i,n){return a((lc[t]&&lc[t].get||r)(e,t,i,n))}:e},quickSetter:function(e,t,i){if((e=nh(e)).length>1){var n=e.map((function(e){return Au.quickSetter(e,t,i)})),r=n.length;return function(e){for(var t=r;t--;)n[t](e)}}e=e[0]||{};var a=lc[t],s=fc(e),o=s.harness&&(s.harness.aliases||{})[t]||t,l=a?function(t){var n=new a;xl._pt=0,n.init(e,i?t+i:t,xl,0,[e]),n.render(1,n),xl._pt&&lu(1,xl)}:s.set(e,o);return a?l:function(t){return l(e,o,i?t+i:t,s,1)}},quickTo:function(e,t,i){var n,r=Au.to(e,Ac(((n={})[t]="+=0.1",n.paused=!0,n),i||{})),a=function(e,i,n){return r.resetTo(t,e,i,n)};return a.tween=r,a},isTweening:function(e){return fl.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=Lh(e.ease,Sl.ease)),Mc(Sl,e||{})},config:function(e){return Mc(_l,e||{})},registerEffect:function(e){var t=e.name,i=e.effect,n=e.plugins,r=e.defaults,a=e.extendTimeline;(n||"").split(",").forEach((function(e){return e&&!lc[e]&&!Ql[e]&&$l(t+" effect requires "+e+" plugin.")})),cc[t]=function(e,t,n){return i(nh(e),Cc(t||{},r),n)},a&&(Uh.prototype[t]=function(e,i,n){return this.add(cc[t](e,Bl(i)?i:(n=i)&&{},this),n)})},registerEase:function(e,t){Ph[e]=Lh(t)},parseEase:function(e,t){return arguments.length?Lh(e,t):Ph},getById:function(e){return fl.getById(e)},exportRoot:function(e,t){void 0===e&&(e={});var i,n,r=new Uh(e);for(r.smoothChildTiming=zl(e.smoothChildTiming),fl.remove(r),r._dp=0,r._time=r._tTime=fl._time,i=fl._first;i;)n=i._next,!t&&!i._dur&&i instanceof $h&&i.vars.onComplete===i._targets[0]||Uc(r,i,i._start-i._delay),i=n;return Uc(fl,r,0),r},context:function(e,t){return e?new wu(e,t):pl},matchMedia:function(e){return new _u(e)},matchMediaRefresh:function(){return fu.forEach((function(e){var t,i,n=e.conditions;for(i in n)n[i]&&(n[i]=!1,t=1);t&&e.revert()}))||xu()},addEventListener:function(e,t){var i=mu[e]||(mu[e]=[]);~i.indexOf(t)||i.push(t)},removeEventListener:function(e,t){var i=mu[e],n=i&&i.indexOf(t);n>=0&&i.splice(n,1)},utils:{wrap:function e(t,i,n){var r=i-t;return Vl(t)?hh(t,e(0,t.length),i):Jc(n,(function(e){return(r+(e-t)%r)%r+t}))},wrapYoyo:function e(t,i,n){var r=i-t,a=2*r;return Vl(t)?hh(t,e(0,t.length-1),i):Jc(n,(function(e){return t+((e=(a+(e-t)%a)%a||0)>r?a-e:e)}))},distribute:sh,random:ch,snap:lh,normalize:function(e,t,i){return dh(e,t,0,1,i)},getUnit:eh,clamp:function(e,t,i){return Jc(i,(function(i){return $c(e,t,i)}))},splitColor:wh,toArray:nh,selector:rh,mapRange:dh,pipe:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return function(e){return t.reduce((function(e,t){return t(e)}),e)}},unitize:function(e,t){return function(i){return e(parseFloat(i))+(t||eh(i))}},interpolate:function e(t,i,n,r){var a=isNaN(t+i)?0:function(e){return(1-e)*t+e*i};if(!a){var s,o,l,c,h,u=Ol(t),d={};if(!0===n&&(r=1)&&(n=null),u)t={p:t},i={p:i};else if(Vl(t)&&!Vl(i)){for(l=[],c=t.length,h=c-2,o=1;o<c;o++)l.push(e(t[o-1],t[o]));c--,a=function(e){e*=c;var t=Math.min(h,~~e);return l[t](e-t)},n=i}else r||(t=Ac(Vl(t)?[]:{},t));if(!l){for(s in i)qh.call(d,t,s,"get",i[s]);a=function(e){return lu(e,d)||(u?t.p:t)}}}return Jc(n,a)},shuffle:ah},install:Kl,effects:cc,ticker:Mh,updateRoot:Uh.updateRoot,plugins:lc,globalTimeline:fl,core:{PropTween:pu,globals:ec,Tween:$h,Timeline:Uh,Animation:Vh,getCache:fc,_removeLinkedListItem:kc,reverting:function(){return dl},context:function(e){return e&&pl&&(pl.data.push(e),e._ctx=pl),pl},suppressOverwrites:function(e){return ul=e}}};gc("to,from,fromTo,delayedCall,set,killTweensOf",(function(e){return Su[e]=$h[e]})),Mh.add(Uh.updateRoot),xl=Su.to({},{duration:0});var Eu=function(e,t){for(var i=e._pt;i&&i.p!==t&&i.op!==t&&i.fp!==t;)i=i._next;return i},Cu=function(e,t){return{name:e,rawVars:1,init:function(e,i,n){n._onInit=function(e){var n,r;if(Ol(i)&&(n={},gc(i,(function(e){return n[e]=1})),i=n),t){for(r in n={},i)n[r]=t(i[r]);i=n}!function(e,t){var i,n,r,a=e._targets;for(i in t)for(n=a.length;n--;)(r=e._ptLookup[n][i])&&(r=r.d)&&(r._pt&&(r=Eu(r,i)),r&&r.modifier&&r.modifier(t[i],e,a[n],i))}(e,i)}}}},Au=Su.registerPlugin({name:"attr",init:function(e,t,i,n,r){var a,s,o;for(a in this.tween=i,t)o=e.getAttribute(a)||"",(s=this.add(e,"setAttribute",(o||0)+"",t[a],n,r,0,0,a)).op=a,s.b=o,this._props.push(a)},render:function(e,t){for(var i=t._pt;i;)dl?i.set(i.t,i.p,i.b,i):i.r(e,i.d),i=i._next}},{name:"endArray",init:function(e,t){for(var i=t.length;i--;)this.add(e,i,e[i]||0,t[i],0,0,0,0,0,1)}},Cu("roundProps",oh),Cu("modifiers"),Cu("snap",lh))||Su;$h.version=Uh.version=Au.version="3.12.5",yl=1,Nl()&&Th();Ph.Power0,Ph.Power1,Ph.Power2,Ph.Power3,Ph.Power4,Ph.Linear,Ph.Quad,Ph.Cubic,Ph.Quart,Ph.Quint,Ph.Strong,Ph.Elastic,Ph.Back,Ph.SteppedEase,Ph.Bounce,Ph.Sine,Ph.Expo,Ph.Circ;var Mu,Tu,Pu,Du,ku,Ou,Iu,Ru,Lu={},Bu=180/Math.PI,zu=Math.PI/180,Nu=Math.atan2,Fu=/([A-Z])/g,ju=/(left|right|width|margin|padding|x)/i,Vu=/[\s,\(]\S/,Uu={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Gu=function(e,t){return t.set(t.t,t.p,Math.round(1e4*(t.s+t.c*e))/1e4+t.u,t)},Hu=function(e,t){return t.set(t.t,t.p,1===e?t.e:Math.round(1e4*(t.s+t.c*e))/1e4+t.u,t)},Wu=function(e,t){return t.set(t.t,t.p,e?Math.round(1e4*(t.s+t.c*e))/1e4+t.u:t.b,t)},qu=function(e,t){var i=t.s+t.c*e;t.set(t.t,t.p,~~(i+(i<0?-.5:.5))+t.u,t)},Xu=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},Yu=function(e,t){return t.set(t.t,t.p,1!==e?t.b:t.e,t)},Qu=function(e,t,i){return e.style[t]=i},Zu=function(e,t,i){return e.style.setProperty(t,i)},Ku=function(e,t,i){return e._gsap[t]=i},Ju=function(e,t,i){return e._gsap.scaleX=e._gsap.scaleY=i},$u=function(e,t,i,n,r){var a=e._gsap;a.scaleX=a.scaleY=i,a.renderTransform(r,a)},ed=function(e,t,i,n,r){var a=e._gsap;a[t]=i,a.renderTransform(r,a)},td="transform",id=td+"Origin",nd=function e(t,i){var n=this,r=this.target,a=r.style,s=r._gsap;if(t in Lu&&a){if(this.tfm=this.tfm||{},"transform"===t)return Uu.transform.split(",").forEach((function(t){return e.call(n,t,i)}));if(~(t=Uu[t]||t).indexOf(",")?t.split(",").forEach((function(e){return n.tfm[e]=wd(r,e)})):this.tfm[t]=s.x?s[t]:wd(r,t),t===id&&(this.tfm.zOrigin=s.zOrigin),this.props.indexOf(td)>=0)return;s.svg&&(this.svgo=r.getAttribute("data-svg-origin"),this.props.push(id,i,"")),t=td}(a||i)&&this.props.push(t,i,a[t])},rd=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},ad=function(){var e,t,i=this.props,n=this.target,r=n.style,a=n._gsap;for(e=0;e<i.length;e+=3)i[e+1]?n[i[e]]=i[e+2]:i[e+2]?r[i[e]]=i[e+2]:r.removeProperty("--"===i[e].substr(0,2)?i[e]:i[e].replace(Fu,"-$1").toLowerCase());if(this.tfm){for(t in this.tfm)a[t]=this.tfm[t];a.svg&&(a.renderTransform(),n.setAttribute("data-svg-origin",this.svgo||"")),(e=Iu())&&e.isStart||r[td]||(rd(r),a.zOrigin&&r[id]&&(r[id]+=" "+a.zOrigin+"px",a.zOrigin=0,a.renderTransform()),a.uncache=1)}},sd=function(e,t){var i={target:e,props:[],revert:ad,save:nd};return e._gsap||Au.core.getCache(e),t&&t.split(",").forEach((function(e){return i.save(e)})),i},od=function(e,t){var i=Tu.createElementNS?Tu.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):Tu.createElement(e);return i&&i.style?i:Tu.createElement(e)},ld=function e(t,i,n){var r=getComputedStyle(t);return r[i]||r.getPropertyValue(i.replace(Fu,"-$1").toLowerCase())||r.getPropertyValue(i)||!n&&e(t,hd(i)||i,1)||""},cd="O,Moz,ms,Ms,Webkit".split(","),hd=function(e,t,i){var n=(t||ku).style,r=5;if(e in n&&!i)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);r--&&!(cd[r]+e in n););return r<0?null:(3===r?"ms":r>=0?cd[r]:"")+e},ud=function(){"undefined"!==typeof window&&window.document&&(Mu=window,Tu=Mu.document,Pu=Tu.documentElement,ku=od("div")||{style:{}},od("div"),td=hd(td),id=td+"Origin",ku.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Ru=!!hd("perspective"),Iu=Au.core.reverting,Du=1)},dd=function e(t){var i,n=od("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),r=this.parentNode,a=this.nextSibling,s=this.style.cssText;if(Pu.appendChild(n),n.appendChild(this),this.style.display="block",t)try{i=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=e}catch(vne){}else this._gsapBBox&&(i=this._gsapBBox());return r&&(a?r.insertBefore(this,a):r.appendChild(this)),Pu.removeChild(n),this.style.cssText=s,i},pd=function(e,t){for(var i=t.length;i--;)if(e.hasAttribute(t[i]))return e.getAttribute(t[i])},fd=function(e){var t;try{t=e.getBBox()}catch(i){t=dd.call(e,!0)}return t&&(t.width||t.height)||e.getBBox===dd||(t=dd.call(e,!0)),!t||t.width||t.x||t.y?t:{x:+pd(e,["x","cx","x1"])||0,y:+pd(e,["y","cy","y1"])||0,width:0,height:0}},md=function(e){return!(!e.getCTM||e.parentNode&&!e.ownerSVGElement||!fd(e))},gd=function(e,t){if(t){var i,n=e.style;t in Lu&&t!==id&&(t=td),n.removeProperty?("ms"!==(i=t.substr(0,2))&&"webkit"!==t.substr(0,6)||(t="-"+t),n.removeProperty("--"===i?t:t.replace(Fu,"-$1").toLowerCase())):n.removeAttribute(t)}},vd=function(e,t,i,n,r,a){var s=new pu(e._pt,t,i,0,1,a?Yu:Xu);return e._pt=s,s.b=n,s.e=r,e._props.push(i),s},yd={deg:1,rad:1,turn:1},bd={grid:1,flex:1},xd=function e(t,i,n,r){var a,s,o,l,c=parseFloat(n)||0,h=(n+"").trim().substr((c+"").length)||"px",u=ku.style,d=ju.test(i),p="svg"===t.tagName.toLowerCase(),f=(p?"client":"offset")+(d?"Width":"Height"),m=100,g="px"===r,v="%"===r;if(r===h||!c||yd[r]||yd[h])return c;if("px"!==h&&!g&&(c=e(t,i,n,"px")),l=t.getCTM&&md(t),(v||"%"===h)&&(Lu[i]||~i.indexOf("adius")))return a=l?t.getBBox()[d?"width":"height"]:t[f],vc(v?c/a*m:c/100*a);if(u[d?"width":"height"]=m+(g?h:r),s=~i.indexOf("adius")||"em"===r&&t.appendChild&&!p?t:t.parentNode,l&&(s=(t.ownerSVGElement||{}).parentNode),s&&s!==Tu&&s.appendChild||(s=Tu.body),(o=s._gsap)&&v&&o.width&&d&&o.time===Mh.time&&!o.uncache)return vc(c/o.width*m);if(!v||"height"!==i&&"width"!==i)(v||"%"===h)&&!bd[ld(s,"display")]&&(u.position=ld(t,"position")),s===t&&(u.position="static"),s.appendChild(ku),a=ku[f],s.removeChild(ku),u.position="absolute";else{var y=t.style[i];t.style[i]=m+r,a=t[f],y?t.style[i]=y:gd(t,i)}return d&&v&&((o=fc(s)).time=Mh.time,o.width=s[f]),vc(g?a*c/m:a&&c?m/a*c:0)},wd=function(e,t,i,n){var r;return Du||ud(),t in Uu&&"transform"!==t&&~(t=Uu[t]).indexOf(",")&&(t=t.split(",")[0]),Lu[t]&&"transform"!==t?(r=Id(e,n),r="transformOrigin"!==t?r[t]:r.svg?r.origin:Rd(ld(e,id))+" "+r.zOrigin+"px"):(!(r=e.style[t])||"auto"===r||n||~(r+"").indexOf("calc("))&&(r=Ad[t]&&Ad[t](e,t,i)||ld(e,t)||mc(e,t)||("opacity"===t?1:0)),i&&!~(r+"").trim().indexOf(" ")?xd(e,t,r,i)+i:r},_d=function(e,t,i,n){if(!i||"none"===i){var r=hd(t,e,1),a=r&&ld(e,r,1);a&&a!==i?(t=r,i=a):"borderColor"===t&&(i=ld(e,"borderTopColor"))}var s,o,l,c,h,u,d,p,f,m,g,v=new pu(this._pt,e.style,t,0,1,ou),y=0,b=0;if(v.b=i,v.e=n,i+="","auto"===(n+="")&&(u=e.style[t],e.style[t]=n,n=ld(e,t)||n,u?e.style[t]=u:gd(e,t)),Ah(s=[i,n]),n=s[1],l=(i=s[0]).match(Hl)||[],(n.match(Hl)||[]).length){for(;o=Hl.exec(n);)d=o[0],f=n.substring(y,o.index),h?h=(h+1)%5:"rgba("!==f.substr(-5)&&"hsla("!==f.substr(-5)||(h=1),d!==(u=l[b++]||"")&&(c=parseFloat(u)||0,g=u.substr((c+"").length),"="===d.charAt(1)&&(d=bc(c,d)+g),p=parseFloat(d),m=d.substr((p+"").length),y=Hl.lastIndex-m.length,m||(m=m||_l.units[t]||g,y===n.length&&(n+=m,v.e+=m)),g!==m&&(c=xd(e,t,u,m)||0),v._pt={_next:v._pt,p:f||1===b?f:",",s:c,c:p-c,m:h&&h<4||"zIndex"===t?Math.round:0});v.c=y<n.length?n.substring(y,n.length):""}else v.r="display"===t&&"none"===n?Yu:Xu;return ql.test(n)&&(v.e=0),this._pt=v,v},Sd={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},Ed=function(e){var t=e.split(" "),i=t[0],n=t[1]||"50%";return"top"!==i&&"bottom"!==i&&"left"!==n&&"right"!==n||(e=i,i=n,n=e),t[0]=Sd[i]||i,t[1]=Sd[n]||n,t.join(" ")},Cd=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var i,n,r,a=t.t,s=a.style,o=t.u,l=a._gsap;if("all"===o||!0===o)s.cssText="",n=1;else for(r=(o=o.split(",")).length;--r>-1;)i=o[r],Lu[i]&&(n=1,i="transformOrigin"===i?id:td),gd(a,i);n&&(gd(a,td),l&&(l.svg&&a.removeAttribute("transform"),Id(a,1),l.uncache=1,rd(s)))}},Ad={clearProps:function(e,t,i,n,r){if("isFromStart"!==r.data){var a=e._pt=new pu(e._pt,t,i,0,0,Cd);return a.u=n,a.pr=-10,a.tween=r,e._props.push(i),1}}},Md=[1,0,0,1,0,0],Td={},Pd=function(e){return"matrix(1, 0, 0, 1, 0, 0)"===e||"none"===e||!e},Dd=function(e){var t=ld(e,td);return Pd(t)?Md:t.substr(7).match(Gl).map(vc)},kd=function(e,t){var i,n,r,a,s=e._gsap||fc(e),o=e.style,l=Dd(e);return s.svg&&e.getAttribute("transform")?"1,0,0,1,0,0"===(l=[(r=e.transform.baseVal.consolidate().matrix).a,r.b,r.c,r.d,r.e,r.f]).join(",")?Md:l:(l!==Md||e.offsetParent||e===Pu||s.svg||(r=o.display,o.display="block",(i=e.parentNode)&&e.offsetParent||(a=1,n=e.nextElementSibling,Pu.appendChild(e)),l=Dd(e),r?o.display=r:gd(e,"display"),a&&(n?i.insertBefore(e,n):i?i.appendChild(e):Pu.removeChild(e))),t&&l.length>6?[l[0],l[1],l[4],l[5],l[12],l[13]]:l)},Od=function(e,t,i,n,r,a){var s,o,l,c=e._gsap,h=r||kd(e,!0),u=c.xOrigin||0,d=c.yOrigin||0,p=c.xOffset||0,f=c.yOffset||0,m=h[0],g=h[1],v=h[2],y=h[3],b=h[4],x=h[5],w=t.split(" "),_=parseFloat(w[0])||0,S=parseFloat(w[1])||0;i?h!==Md&&(o=m*y-g*v)&&(l=_*(-g/o)+S*(m/o)-(m*x-g*b)/o,_=_*(y/o)+S*(-v/o)+(v*x-y*b)/o,S=l):(_=(s=fd(e)).x+(~w[0].indexOf("%")?_/100*s.width:_),S=s.y+(~(w[1]||w[0]).indexOf("%")?S/100*s.height:S)),n||!1!==n&&c.smooth?(b=_-u,x=S-d,c.xOffset=p+(b*m+x*v)-b,c.yOffset=f+(b*g+x*y)-x):c.xOffset=c.yOffset=0,c.xOrigin=_,c.yOrigin=S,c.smooth=!!n,c.origin=t,c.originIsAbsolute=!!i,e.style[id]="0px 0px",a&&(vd(a,c,"xOrigin",u,_),vd(a,c,"yOrigin",d,S),vd(a,c,"xOffset",p,c.xOffset),vd(a,c,"yOffset",f,c.yOffset)),e.setAttribute("data-svg-origin",_+" "+S)},Id=function(e,t){var i=e._gsap||new jh(e);if("x"in i&&!t&&!i.uncache)return i;var n,r,a,s,o,l,c,h,u,d,p,f,m,g,v,y,b,x,w,_,S,E,C,A,M,T,P,D,k,O,I,R,L=e.style,B=i.scaleX<0,z="px",N="deg",F=getComputedStyle(e),j=ld(e,id)||"0";return n=r=a=l=c=h=u=d=p=0,s=o=1,i.svg=!(!e.getCTM||!md(e)),F.translate&&("none"===F.translate&&"none"===F.scale&&"none"===F.rotate||(L[td]=("none"!==F.translate?"translate3d("+(F.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+("none"!==F.rotate?"rotate("+F.rotate+") ":"")+("none"!==F.scale?"scale("+F.scale.split(" ").join(",")+") ":"")+("none"!==F[td]?F[td]:"")),L.scale=L.rotate=L.translate="none"),g=kd(e,i.svg),i.svg&&(i.uncache?(M=e.getBBox(),j=i.xOrigin-M.x+"px "+(i.yOrigin-M.y)+"px",A=""):A=!t&&e.getAttribute("data-svg-origin"),Od(e,A||j,!!A||i.originIsAbsolute,!1!==i.smooth,g)),f=i.xOrigin||0,m=i.yOrigin||0,g!==Md&&(x=g[0],w=g[1],_=g[2],S=g[3],n=E=g[4],r=C=g[5],6===g.length?(s=Math.sqrt(x*x+w*w),o=Math.sqrt(S*S+_*_),l=x||w?Nu(w,x)*Bu:0,(u=_||S?Nu(_,S)*Bu+l:0)&&(o*=Math.abs(Math.cos(u*zu))),i.svg&&(n-=f-(f*x+m*_),r-=m-(f*w+m*S))):(R=g[6],O=g[7],P=g[8],D=g[9],k=g[10],I=g[11],n=g[12],r=g[13],a=g[14],c=(v=Nu(R,k))*Bu,v&&(A=E*(y=Math.cos(-v))+P*(b=Math.sin(-v)),M=C*y+D*b,T=R*y+k*b,P=E*-b+P*y,D=C*-b+D*y,k=R*-b+k*y,I=O*-b+I*y,E=A,C=M,R=T),h=(v=Nu(-_,k))*Bu,v&&(y=Math.cos(-v),I=S*(b=Math.sin(-v))+I*y,x=A=x*y-P*b,w=M=w*y-D*b,_=T=_*y-k*b),l=(v=Nu(w,x))*Bu,v&&(A=x*(y=Math.cos(v))+w*(b=Math.sin(v)),M=E*y+C*b,w=w*y-x*b,C=C*y-E*b,x=A,E=M),c&&Math.abs(c)+Math.abs(l)>359.9&&(c=l=0,h=180-h),s=vc(Math.sqrt(x*x+w*w+_*_)),o=vc(Math.sqrt(C*C+R*R)),v=Nu(E,C),u=Math.abs(v)>2e-4?v*Bu:0,p=I?1/(I<0?-I:I):0),i.svg&&(A=e.getAttribute("transform"),i.forceCSS=e.setAttribute("transform","")||!Pd(ld(e,td)),A&&e.setAttribute("transform",A))),Math.abs(u)>90&&Math.abs(u)<270&&(B?(s*=-1,u+=l<=0?180:-180,l+=l<=0?180:-180):(o*=-1,u+=u<=0?180:-180)),t=t||i.uncache,i.x=n-((i.xPercent=n&&(!t&&i.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-n)?-50:0)))?e.offsetWidth*i.xPercent/100:0)+z,i.y=r-((i.yPercent=r&&(!t&&i.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-r)?-50:0)))?e.offsetHeight*i.yPercent/100:0)+z,i.z=a+z,i.scaleX=vc(s),i.scaleY=vc(o),i.rotation=vc(l)+N,i.rotationX=vc(c)+N,i.rotationY=vc(h)+N,i.skewX=u+N,i.skewY=d+N,i.transformPerspective=p+z,(i.zOrigin=parseFloat(j.split(" ")[2])||!t&&i.zOrigin||0)&&(L[id]=Rd(j)),i.xOffset=i.yOffset=0,i.force3D=_l.force3D,i.renderTransform=i.svg?Vd:Ru?jd:Bd,i.uncache=0,i},Rd=function(e){return(e=e.split(" "))[0]+" "+e[1]},Ld=function(e,t,i){var n=eh(t);return vc(parseFloat(t)+parseFloat(xd(e,"x",i+"px",n)))+n},Bd=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,jd(e,t)},zd="0deg",Nd="0px",Fd=") ",jd=function(e,t){var i=t||this,n=i.xPercent,r=i.yPercent,a=i.x,s=i.y,o=i.z,l=i.rotation,c=i.rotationY,h=i.rotationX,u=i.skewX,d=i.skewY,p=i.scaleX,f=i.scaleY,m=i.transformPerspective,g=i.force3D,v=i.target,y=i.zOrigin,b="",x="auto"===g&&e&&1!==e||!0===g;if(y&&(h!==zd||c!==zd)){var w,_=parseFloat(c)*zu,S=Math.sin(_),E=Math.cos(_);_=parseFloat(h)*zu,w=Math.cos(_),a=Ld(v,a,S*w*-y),s=Ld(v,s,-Math.sin(_)*-y),o=Ld(v,o,E*w*-y+y)}m!==Nd&&(b+="perspective("+m+Fd),(n||r)&&(b+="translate("+n+"%, "+r+"%) "),(x||a!==Nd||s!==Nd||o!==Nd)&&(b+=o!==Nd||x?"translate3d("+a+", "+s+", "+o+") ":"translate("+a+", "+s+Fd),l!==zd&&(b+="rotate("+l+Fd),c!==zd&&(b+="rotateY("+c+Fd),h!==zd&&(b+="rotateX("+h+Fd),u===zd&&d===zd||(b+="skew("+u+", "+d+Fd),1===p&&1===f||(b+="scale("+p+", "+f+Fd),v.style[td]=b||"translate(0, 0)"},Vd=function(e,t){var i,n,r,a,s,o=t||this,l=o.xPercent,c=o.yPercent,h=o.x,u=o.y,d=o.rotation,p=o.skewX,f=o.skewY,m=o.scaleX,g=o.scaleY,v=o.target,y=o.xOrigin,b=o.yOrigin,x=o.xOffset,w=o.yOffset,_=o.forceCSS,S=parseFloat(h),E=parseFloat(u);d=parseFloat(d),p=parseFloat(p),(f=parseFloat(f))&&(p+=f=parseFloat(f),d+=f),d||p?(d*=zu,p*=zu,i=Math.cos(d)*m,n=Math.sin(d)*m,r=Math.sin(d-p)*-g,a=Math.cos(d-p)*g,p&&(f*=zu,s=Math.tan(p-f),r*=s=Math.sqrt(1+s*s),a*=s,f&&(s=Math.tan(f),i*=s=Math.sqrt(1+s*s),n*=s)),i=vc(i),n=vc(n),r=vc(r),a=vc(a)):(i=m,a=g,n=r=0),(S&&!~(h+"").indexOf("px")||E&&!~(u+"").indexOf("px"))&&(S=xd(v,"x",h,"px"),E=xd(v,"y",u,"px")),(y||b||x||w)&&(S=vc(S+y-(y*i+b*r)+x),E=vc(E+b-(y*n+b*a)+w)),(l||c)&&(s=v.getBBox(),S=vc(S+l/100*s.width),E=vc(E+c/100*s.height)),s="matrix("+i+","+n+","+r+","+a+","+S+","+E+")",v.setAttribute("transform",s),_&&(v.style[td]=s)},Ud=function(e,t,i,n,r){var a,s,o=360,l=Ol(r),c=parseFloat(r)*(l&&~r.indexOf("rad")?Bu:1)-n,h=n+c+"deg";return l&&("short"===(a=r.split("_")[1])&&(c%=o)!==c%180&&(c+=c<0?o:-360),"cw"===a&&c<0?c=(c+36e9)%o-~~(c/o)*o:"ccw"===a&&c>0&&(c=(c-36e9)%o-~~(c/o)*o)),e._pt=s=new pu(e._pt,t,i,n,c,Hu),s.e=h,s.u="deg",e._props.push(i),s},Gd=function(e,t){for(var i in t)e[i]=t[i];return e},Hd=function(e,t,i){var n,r,a,s,o,l,c,h=Gd({},i._gsap),u=i.style;for(r in h.svg?(a=i.getAttribute("transform"),i.setAttribute("transform",""),u[td]=t,n=Id(i,1),gd(i,td),i.setAttribute("transform",a)):(a=getComputedStyle(i)[td],u[td]=t,n=Id(i,1),u[td]=a),Lu)(a=h[r])!==(s=n[r])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(r)<0&&(o=eh(a)!==(c=eh(s))?xd(i,r,a,c):parseFloat(a),l=parseFloat(s),e._pt=new pu(e._pt,n,r,o,l-o,Gu),e._pt.u=c||0,e._props.push(r));Gd(n,h)};gc("padding,margin,Width,Radius",(function(e,t){var i="Top",n="Right",r="Bottom",a="Left",s=(t<3?[i,n,r,a]:[i+a,i+n,r+n,r+a]).map((function(i){return t<2?e+i:"border"+i+e}));Ad[t>1?"border"+e:e]=function(e,t,i,n,r){var a,o;if(arguments.length<4)return a=s.map((function(t){return wd(e,t,i)})),5===(o=a.join(" ")).split(a[0]).length?a[0]:o;a=(n+"").split(" "),o={},s.forEach((function(e,t){return o[e]=a[t]=a[t]||a[(t-1)/2|0]})),e.init(t,o,r)}}));var Wd={name:"css",register:ud,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,i,n,r){var a,s,o,l,c,h,u,d,p,f,m,g,v,y,b,x,w=this._props,_=e.style,S=i.vars.startAt;for(u in Du||ud(),this.styles=this.styles||sd(e),x=this.styles.props,this.tween=i,t)if("autoRound"!==u&&(s=t[u],!lc[u]||!Xh(u,t,i,n,e,r)))if(c=typeof s,h=Ad[u],"function"===c&&(c=typeof(s=s.call(i,n,e,r))),"string"===c&&~s.indexOf("random(")&&(s=uh(s)),h)h(this,e,u,s,i)&&(b=1);else if("--"===u.substr(0,2))a=(getComputedStyle(e).getPropertyValue(u)+"").trim(),s+="",Eh.lastIndex=0,Eh.test(a)||(d=eh(a),p=eh(s)),p?d!==p&&(a=xd(e,u,a,p)+p):d&&(s+=d),this.add(_,"setProperty",a,s,n,r,0,0,u),w.push(u),x.push(u,0,_[u]);else if("undefined"!==c){if(S&&u in S?(a="function"===typeof S[u]?S[u].call(i,n,e,r):S[u],Ol(a)&&~a.indexOf("random(")&&(a=uh(a)),eh(a+"")||"auto"===a||(a+=_l.units[u]||eh(wd(e,u))||""),"="===(a+"").charAt(1)&&(a=wd(e,u))):a=wd(e,u),l=parseFloat(a),(f="string"===c&&"="===s.charAt(1)&&s.substr(0,2))&&(s=s.substr(2)),o=parseFloat(s),u in Uu&&("autoAlpha"===u&&(1===l&&"hidden"===wd(e,"visibility")&&o&&(l=0),x.push("visibility",0,_.visibility),vd(this,_,"visibility",l?"inherit":"hidden",o?"inherit":"hidden",!o)),"scale"!==u&&"transform"!==u&&~(u=Uu[u]).indexOf(",")&&(u=u.split(",")[0])),m=u in Lu)if(this.styles.save(u),g||((v=e._gsap).renderTransform&&!t.parseTransform||Id(e,t.parseTransform),y=!1!==t.smoothOrigin&&v.smooth,(g=this._pt=new pu(this._pt,_,td,0,1,v.renderTransform,v,0,-1)).dep=1),"scale"===u)this._pt=new pu(this._pt,v,"scaleY",v.scaleY,(f?bc(v.scaleY,f+o):o)-v.scaleY||0,Gu),this._pt.u=0,w.push("scaleY",u),u+="X";else{if("transformOrigin"===u){x.push(id,0,_[id]),s=Ed(s),v.svg?Od(e,s,0,y,0,this):((p=parseFloat(s.split(" ")[2])||0)!==v.zOrigin&&vd(this,v,"zOrigin",v.zOrigin,p),vd(this,_,u,Rd(a),Rd(s)));continue}if("svgOrigin"===u){Od(e,s,1,y,0,this);continue}if(u in Td){Ud(this,v,u,l,f?bc(l,f+s):s);continue}if("smoothOrigin"===u){vd(this,v,"smooth",v.smooth,s);continue}if("force3D"===u){v[u]=s;continue}if("transform"===u){Hd(this,s,e);continue}}else u in _||(u=hd(u)||u);if(m||(o||0===o)&&(l||0===l)&&!Vu.test(s)&&u in _)o||(o=0),(d=(a+"").substr((l+"").length))!==(p=eh(s)||(u in _l.units?_l.units[u]:d))&&(l=xd(e,u,a,p)),this._pt=new pu(this._pt,m?v:_,u,l,(f?bc(l,f+o):o)-l,m||"px"!==p&&"zIndex"!==u||!1===t.autoRound?Gu:qu),this._pt.u=p||0,d!==p&&"%"!==p&&(this._pt.b=a,this._pt.r=Wu);else if(u in _)_d.call(this,e,u,a,f?f+s:s);else if(u in e)this.add(e,u,a||e[u],f?f+s:s,n,r);else if("parseTransform"!==u){Jl(u,s);continue}m||(u in _?x.push(u,0,_[u]):x.push(u,1,a||e[u])),w.push(u)}b&&du(this)},render:function(e,t){if(t.tween._time||!Iu())for(var i=t._pt;i;)i.r(e,i.d),i=i._next;else t.styles.revert()},get:wd,aliases:Uu,getSetter:function(e,t,i){var n=Uu[t];return n&&n.indexOf(",")<0&&(t=n),t in Lu&&t!==id&&(e._gsap.x||wd(e,"x"))?i&&Ou===i?"scale"===t?Ju:Ku:(Ou=i||{})&&("scale"===t?$u:ed):e.style&&!Ll(e.style[t])?Qu:~t.indexOf("-")?Zu:ru(e,t)},core:{_removeProperty:gd,_getMatrix:kd}};Au.utils.checkPrefix=hd,Au.core.getStyleSaver=sd,function(e,t,i,n){var r=gc(e+","+t+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",(function(e){Lu[e]=1}));gc(t,(function(e){_l.units[e]="deg",Td[e]=1})),Uu[r[13]]=e+","+t,gc("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",(function(e){var t=e.split(":");Uu[t[1]]=r[t[0]]}))}("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY"),gc("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",(function(e){_l.units[e]="px"})),Au.registerPlugin(Wd);var qd=Au.registerPlugin(Wd)||Au;qd.core.Tween;let Xd="undefined"!==typeof window?t.useLayoutEffect:t.useEffect,Yd=e=>e&&!Array.isArray(e)&&"object"===typeof e,Qd=[],Zd={},Kd=qd;const Jd=function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Qd,n=Zd;Yd(e)?(n=e,e=null,i="dependencies"in n?n.dependencies:Qd):Yd(i)&&(n=i,i="dependencies"in n?n.dependencies:Qd);let{scope:r,revertOnUpdate:a}=n,[s,o]=(0,t.useState)(!1);e&&"function"!==typeof e&&console.warn("First parameter must be a function or config object");const l=Kd.context((()=>{}),r),c=()=>l.revert(),h=i&&i.length&&!a;return Xd((()=>{if(e&&l.add(e,r),!h||!s)return c}),i),h&&Xd((()=>(o(!0),c)),Qd),{context:l,contextSafe:e=>l.add(null,e)}};function $d(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Jd.register=e=>{Kd=e},Jd.headless=!0;var ep,tp,ip,np,rp,ap,sp,op,lp,cp,hp,up,dp,pp=function(){return ep||"undefined"!==typeof window&&(ep=window.gsap)&&ep.registerPlugin&&ep},fp=1,mp=[],gp=[],vp=[],yp=Date.now,bp=function(e,t){return t},xp=function(e,t){return~vp.indexOf(e)&&vp[vp.indexOf(e)+1][t]},wp=function(e){return!!~cp.indexOf(e)},_p=function(e,t,i,n,r){return e.addEventListener(t,i,{passive:!1!==n,capture:!!r})},Sp=function(e,t,i,n){return e.removeEventListener(t,i,!!n)},Ep="scrollLeft",Cp="scrollTop",Ap=function(){return hp&&hp.isPressed||gp.cache++},Mp=function(e,t){var i=function i(n){if(n||0===n){fp&&(ip.history.scrollRestoration="manual");var r=hp&&hp.isPressed;n=i.v=Math.round(n)||(hp&&hp.iOS?1:0),e(n),i.cacheID=gp.cache,r&&bp("ss",n)}else(t||gp.cache!==i.cacheID||bp("ref"))&&(i.cacheID=gp.cache,i.v=e());return i.v+i.offset};return i.offset=0,e&&i},Tp={s:Ep,p:"left",p2:"Left",os:"right",os2:"Right",d:"width",d2:"Width",a:"x",sc:Mp((function(e){return arguments.length?ip.scrollTo(e,Pp.sc()):ip.pageXOffset||np[Ep]||rp[Ep]||ap[Ep]||0}))},Pp={s:Cp,p:"top",p2:"Top",os:"bottom",os2:"Bottom",d:"height",d2:"Height",a:"y",op:Tp,sc:Mp((function(e){return arguments.length?ip.scrollTo(Tp.sc(),e):ip.pageYOffset||np[Cp]||rp[Cp]||ap[Cp]||0}))},Dp=function(e,t){return(t&&t._ctx&&t._ctx.selector||ep.utils.toArray)(e)[0]||("string"===typeof e&&!1!==ep.config().nullTargetWarn?console.warn("Element not found:",e):null)},kp=function(e,t){var i=t.s,n=t.sc;wp(e)&&(e=np.scrollingElement||rp);var r=gp.indexOf(e),a=n===Pp.sc?1:2;!~r&&(r=gp.push(e)-1),gp[r+a]||_p(e,"scroll",Ap);var s=gp[r+a],o=s||(gp[r+a]=Mp(xp(e,i),!0)||(wp(e)?n:Mp((function(t){return arguments.length?e[i]=t:e[i]}))));return o.target=e,s||(o.smooth="smooth"===ep.getProperty(e,"scrollBehavior")),o},Op=function(e,t,i){var n=e,r=e,a=yp(),s=a,o=t||50,l=Math.max(500,3*o),c=function(e,t){var l=yp();t||l-a>o?(r=n,n=e,s=a,a=l):i?n+=e:n=r+(e-r)/(l-s)*(a-s)};return{update:c,reset:function(){r=n=i?0:n,s=a=0},getVelocity:function(e){var t=s,o=r,h=yp();return(e||0===e)&&e!==n&&c(e),a===s||h-s>l?0:(n+(i?o:-o))/((i?h:a)-t)*1e3}}},Ip=function(e,t){return t&&!e._gsapAllow&&e.preventDefault(),e.changedTouches?e.changedTouches[0]:e},Rp=function(e){var t=Math.max.apply(Math,e),i=Math.min.apply(Math,e);return Math.abs(t)>=Math.abs(i)?t:i},Lp=function(){(lp=ep.core.globals().ScrollTrigger)&&lp.core&&function(){var e=lp.core,t=e.bridge||{},i=e._scrollers,n=e._proxies;i.push.apply(i,gp),n.push.apply(n,vp),gp=i,vp=n,bp=function(e,i){return t[e](i)}}()},Bp=function(e){return ep=e||pp(),!tp&&ep&&"undefined"!==typeof document&&document.body&&(ip=window,np=document,rp=np.documentElement,ap=np.body,cp=[ip,np,rp,ap],ep.utils.clamp,dp=ep.core.context||function(){},op="onpointerenter"in ap?"pointer":"mouse",sp=zp.isTouch=ip.matchMedia&&ip.matchMedia("(hover: none), (pointer: coarse)").matches?1:"ontouchstart"in ip||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?2:0,up=zp.eventTypes=("ontouchstart"in rp?"touchstart,touchmove,touchcancel,touchend":"onpointerdown"in rp?"pointerdown,pointermove,pointercancel,pointerup":"mousedown,mousemove,mouseup,mouseup").split(","),setTimeout((function(){return fp=0}),500),Lp(),tp=1),tp};Tp.op=Pp,gp.cache=0;var zp=function(){function e(e){this.init(e)}var t,i,n;return e.prototype.init=function(e){tp||Bp(ep)||console.warn("Please gsap.registerPlugin(Observer)"),lp||Lp();var t=e.tolerance,i=e.dragMinimum,n=e.type,r=e.target,a=e.lineHeight,s=e.debounce,o=e.preventDefault,l=e.onStop,c=e.onStopDelay,h=e.ignore,u=e.wheelSpeed,d=e.event,p=e.onDragStart,f=e.onDragEnd,m=e.onDrag,g=e.onPress,v=e.onRelease,y=e.onRight,b=e.onLeft,x=e.onUp,w=e.onDown,_=e.onChangeX,S=e.onChangeY,E=e.onChange,C=e.onToggleX,A=e.onToggleY,M=e.onHover,T=e.onHoverEnd,P=e.onMove,D=e.ignoreCheck,k=e.isNormalizer,O=e.onGestureStart,I=e.onGestureEnd,R=e.onWheel,L=e.onEnable,B=e.onDisable,z=e.onClick,N=e.scrollSpeed,F=e.capture,j=e.allowClicks,V=e.lockAxis,U=e.onLockAxis;this.target=r=Dp(r)||rp,this.vars=e,h&&(h=ep.utils.toArray(h)),t=t||1e-9,i=i||0,u=u||1,N=N||1,n=n||"wheel,touch,pointer",s=!1!==s,a||(a=parseFloat(ip.getComputedStyle(ap).lineHeight)||22);var G,H,W,q,X,Y,Q,Z=this,K=0,J=0,$=e.passive||!o,ee=kp(r,Tp),te=kp(r,Pp),ie=ee(),ne=te(),re=~n.indexOf("touch")&&!~n.indexOf("pointer")&&"pointerdown"===up[0],ae=wp(r),se=r.ownerDocument||np,oe=[0,0,0],le=[0,0,0],ce=0,he=function(){return ce=yp()},ue=function(e,t){return(Z.event=e)&&h&&~h.indexOf(e.target)||t&&re&&"touch"!==e.pointerType||D&&D(e,t)},de=function(){var e=Z.deltaX=Rp(oe),i=Z.deltaY=Rp(le),n=Math.abs(e)>=t,r=Math.abs(i)>=t;E&&(n||r)&&E(Z,e,i,oe,le),n&&(y&&Z.deltaX>0&&y(Z),b&&Z.deltaX<0&&b(Z),_&&_(Z),C&&Z.deltaX<0!==K<0&&C(Z),K=Z.deltaX,oe[0]=oe[1]=oe[2]=0),r&&(w&&Z.deltaY>0&&w(Z),x&&Z.deltaY<0&&x(Z),S&&S(Z),A&&Z.deltaY<0!==J<0&&A(Z),J=Z.deltaY,le[0]=le[1]=le[2]=0),(q||W)&&(P&&P(Z),W&&(m(Z),W=!1),q=!1),Y&&!(Y=!1)&&U&&U(Z),X&&(R(Z),X=!1),G=0},pe=function(e,t,i){oe[i]+=e,le[i]+=t,Z._vx.update(e),Z._vy.update(t),s?G||(G=requestAnimationFrame(de)):de()},fe=function(e,t){V&&!Q&&(Z.axis=Q=Math.abs(e)>Math.abs(t)?"x":"y",Y=!0),"y"!==Q&&(oe[2]+=e,Z._vx.update(e,!0)),"x"!==Q&&(le[2]+=t,Z._vy.update(t,!0)),s?G||(G=requestAnimationFrame(de)):de()},me=function(e){if(!ue(e,1)){var t=(e=Ip(e,o)).clientX,n=e.clientY,r=t-Z.x,a=n-Z.y,s=Z.isDragging;Z.x=t,Z.y=n,(s||Math.abs(Z.startX-t)>=i||Math.abs(Z.startY-n)>=i)&&(m&&(W=!0),s||(Z.isDragging=!0),fe(r,a),s||p&&p(Z))}},ge=Z.onPress=function(e){ue(e,1)||e&&e.button||(Z.axis=Q=null,H.pause(),Z.isPressed=!0,e=Ip(e),K=J=0,Z.startX=Z.x=e.clientX,Z.startY=Z.y=e.clientY,Z._vx.reset(),Z._vy.reset(),_p(k?r:se,up[1],me,$,!0),Z.deltaX=Z.deltaY=0,g&&g(Z))},ve=Z.onRelease=function(e){if(!ue(e,1)){Sp(k?r:se,up[1],me,!0);var t=!isNaN(Z.y-Z.startY),i=Z.isDragging,n=i&&(Math.abs(Z.x-Z.startX)>3||Math.abs(Z.y-Z.startY)>3),a=Ip(e);!n&&t&&(Z._vx.reset(),Z._vy.reset(),o&&j&&ep.delayedCall(.08,(function(){if(yp()-ce>300&&!e.defaultPrevented)if(e.target.click)e.target.click();else if(se.createEvent){var t=se.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,ip,1,a.screenX,a.screenY,a.clientX,a.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(t)}}))),Z.isDragging=Z.isGesturing=Z.isPressed=!1,l&&i&&!k&&H.restart(!0),f&&i&&f(Z),v&&v(Z,n)}},ye=function(e){return e.touches&&e.touches.length>1&&(Z.isGesturing=!0)&&O(e,Z.isDragging)},be=function(){return(Z.isGesturing=!1)||I(Z)},xe=function(e){if(!ue(e)){var t=ee(),i=te();pe((t-ie)*N,(i-ne)*N,1),ie=t,ne=i,l&&H.restart(!0)}},we=function(e){if(!ue(e)){e=Ip(e,o),R&&(X=!0);var t=(1===e.deltaMode?a:2===e.deltaMode?ip.innerHeight:1)*u;pe(e.deltaX*t,e.deltaY*t,0),l&&!k&&H.restart(!0)}},_e=function(e){if(!ue(e)){var t=e.clientX,i=e.clientY,n=t-Z.x,r=i-Z.y;Z.x=t,Z.y=i,q=!0,l&&H.restart(!0),(n||r)&&fe(n,r)}},Se=function(e){Z.event=e,M(Z)},Ee=function(e){Z.event=e,T(Z)},Ce=function(e){return ue(e)||Ip(e,o)&&z(Z)};H=Z._dc=ep.delayedCall(c||.25,(function(){Z._vx.reset(),Z._vy.reset(),H.pause(),l&&l(Z)})).pause(),Z.deltaX=Z.deltaY=0,Z._vx=Op(0,50,!0),Z._vy=Op(0,50,!0),Z.scrollX=ee,Z.scrollY=te,Z.isDragging=Z.isGesturing=Z.isPressed=!1,dp(this),Z.enable=function(e){return Z.isEnabled||(_p(ae?se:r,"scroll",Ap),n.indexOf("scroll")>=0&&_p(ae?se:r,"scroll",xe,$,F),n.indexOf("wheel")>=0&&_p(r,"wheel",we,$,F),(n.indexOf("touch")>=0&&sp||n.indexOf("pointer")>=0)&&(_p(r,up[0],ge,$,F),_p(se,up[2],ve),_p(se,up[3],ve),j&&_p(r,"click",he,!0,!0),z&&_p(r,"click",Ce),O&&_p(se,"gesturestart",ye),I&&_p(se,"gestureend",be),M&&_p(r,op+"enter",Se),T&&_p(r,op+"leave",Ee),P&&_p(r,op+"move",_e)),Z.isEnabled=!0,e&&e.type&&ge(e),L&&L(Z)),Z},Z.disable=function(){Z.isEnabled&&(mp.filter((function(e){return e!==Z&&wp(e.target)})).length||Sp(ae?se:r,"scroll",Ap),Z.isPressed&&(Z._vx.reset(),Z._vy.reset(),Sp(k?r:se,up[1],me,!0)),Sp(ae?se:r,"scroll",xe,F),Sp(r,"wheel",we,F),Sp(r,up[0],ge,F),Sp(se,up[2],ve),Sp(se,up[3],ve),Sp(r,"click",he,!0),Sp(r,"click",Ce),Sp(se,"gesturestart",ye),Sp(se,"gestureend",be),Sp(r,op+"enter",Se),Sp(r,op+"leave",Ee),Sp(r,op+"move",_e),Z.isEnabled=Z.isPressed=Z.isDragging=!1,B&&B(Z))},Z.kill=Z.revert=function(){Z.disable();var e=mp.indexOf(Z);e>=0&&mp.splice(e,1),hp===Z&&(hp=0)},mp.push(Z),k&&wp(r)&&(hp=Z),Z.enable(d)},t=e,(i=[{key:"velocityX",get:function(){return this._vx.getVelocity()}},{key:"velocityY",get:function(){return this._vy.getVelocity()}}])&&$d(t.prototype,i),n&&$d(t,n),e}();zp.version="3.12.5",zp.create=function(e){return new zp(e)},zp.register=Bp,zp.getAll=function(){return mp.slice()},zp.getById=function(e){return mp.filter((function(t){return t.vars.id===e}))[0]},pp()&&ep.registerPlugin(zp);var Np,Fp,jp,Vp,Up,Gp,Hp,Wp,qp,Xp,Yp,Qp,Zp,Kp,Jp,$p,ef,tf,nf,rf,af,sf,of,lf,cf,hf,uf,df,pf,ff,mf,gf,vf,yf,bf,xf,wf,_f,Sf=1,Ef=Date.now,Cf=Ef(),Af=0,Mf=0,Tf=function(e,t,i){var n=Uf(e)&&("clamp("===e.substr(0,6)||e.indexOf("max")>-1);return i["_"+t+"Clamp"]=n,n?e.substr(6,e.length-7):e},Pf=function(e,t){return!t||Uf(e)&&"clamp("===e.substr(0,6)?e:"clamp("+e+")"},Df=function e(){return Mf&&requestAnimationFrame(e)},kf=function(){return Kp=1},Of=function(){return Kp=0},If=function(e){return e},Rf=function(e){return Math.round(1e5*e)/1e5||0},Lf=function(){return"undefined"!==typeof window},Bf=function(){return Np||Lf()&&(Np=window.gsap)&&Np.registerPlugin&&Np},zf=function(e){return!!~Hp.indexOf(e)},Nf=function(e){return("Height"===e?mf:jp["inner"+e])||Up["client"+e]||Gp["client"+e]},Ff=function(e){return xp(e,"getBoundingClientRect")||(zf(e)?function(){return Jm.width=jp.innerWidth,Jm.height=mf,Jm}:function(){return um(e)})},jf=function(e,t){var i=t.s,n=t.d2,r=t.d,a=t.a;return Math.max(0,(i="scroll"+n)&&(a=xp(e,i))?a()-Ff(e)()[r]:zf(e)?(Up[i]||Gp[i])-Nf(n):e[i]-e["offset"+n])},Vf=function(e,t){for(var i=0;i<nf.length;i+=3)(!t||~t.indexOf(nf[i+1]))&&e(nf[i],nf[i+1],nf[i+2])},Uf=function(e){return"string"===typeof e},Gf=function(e){return"function"===typeof e},Hf=function(e){return"number"===typeof e},Wf=function(e){return"object"===typeof e},qf=function(e,t,i){return e&&e.progress(t?0:1)&&i&&e.pause()},Xf=function(e,t){if(e.enabled){var i=e._ctx?e._ctx.add((function(){return t(e)})):t(e);i&&i.totalTime&&(e.callbackAnimation=i)}},Yf=Math.abs,Qf="left",Zf="right",Kf="bottom",Jf="width",$f="height",em="Right",tm="Left",im="Top",nm="Bottom",rm="padding",am="margin",sm="Width",om="Height",lm="px",cm=function(e){return jp.getComputedStyle(e)},hm=function(e,t){for(var i in t)i in e||(e[i]=t[i]);return e},um=function(e,t){var i=t&&"matrix(1, 0, 0, 1, 0, 0)"!==cm(e)[Jp]&&Np.to(e,{x:0,y:0,xPercent:0,yPercent:0,rotation:0,rotationX:0,rotationY:0,scale:1,skewX:0,skewY:0}).progress(1),n=e.getBoundingClientRect();return i&&i.progress(0).kill(),n},dm=function(e,t){var i=t.d2;return e["offset"+i]||e["client"+i]||0},pm=function(e){var t,i=[],n=e.labels,r=e.duration();for(t in n)i.push(n[t]/r);return i},fm=function(e){var t=Np.utils.snap(e),i=Array.isArray(e)&&e.slice(0).sort((function(e,t){return e-t}));return i?function(e,n,r){var a;if(void 0===r&&(r=.001),!n)return t(e);if(n>0){for(e-=r,a=0;a<i.length;a++)if(i[a]>=e)return i[a];return i[a-1]}for(a=i.length,e+=r;a--;)if(i[a]<=e)return i[a];return i[0]}:function(i,n,r){void 0===r&&(r=.001);var a=t(i);return!n||Math.abs(a-i)<r||a-i<0===n<0?a:t(n<0?i-e:i+e)}},mm=function(e,t,i,n){return i.split(",").forEach((function(i){return e(t,i,n)}))},gm=function(e,t,i,n,r){return e.addEventListener(t,i,{passive:!n,capture:!!r})},vm=function(e,t,i,n){return e.removeEventListener(t,i,!!n)},ym=function(e,t,i){(i=i&&i.wheelHandler)&&(e(t,"wheel",i),e(t,"touchmove",i))},bm={startColor:"green",endColor:"red",indent:0,fontSize:"16px",fontWeight:"normal"},xm={toggleActions:"play",anticipatePin:0},wm={top:0,left:0,center:.5,bottom:1,right:1},_m=function(e,t){if(Uf(e)){var i=e.indexOf("="),n=~i?+(e.charAt(i-1)+1)*parseFloat(e.substr(i+1)):0;~i&&(e.indexOf("%")>i&&(n*=t/100),e=e.substr(0,i-1)),e=n+(e in wm?wm[e]*t:~e.indexOf("%")?parseFloat(e)*t/100:parseFloat(e)||0)}return e},Sm=function(e,t,i,n,r,a,s,o){var l=r.startColor,c=r.endColor,h=r.fontSize,u=r.indent,d=r.fontWeight,p=Vp.createElement("div"),f=zf(i)||"fixed"===xp(i,"pinType"),m=-1!==e.indexOf("scroller"),g=f?Gp:i,v=-1!==e.indexOf("start"),y=v?l:c,b="border-color:"+y+";font-size:"+h+";color:"+y+";font-weight:"+d+";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;";return b+="position:"+((m||o)&&f?"fixed;":"absolute;"),(m||o||!f)&&(b+=(n===Pp?Zf:Kf)+":"+(a+parseFloat(u))+"px;"),s&&(b+="box-sizing:border-box;text-align:left;width:"+s.offsetWidth+"px;"),p._isStart=v,p.setAttribute("class","gsap-marker-"+e+(t?" marker-"+t:"")),p.style.cssText=b,p.innerText=t||0===t?e+"-"+t:e,g.children[0]?g.insertBefore(p,g.children[0]):g.appendChild(p),p._offset=p["offset"+n.op.d2],Em(p,0,n,v),p},Em=function(e,t,i,n){var r={display:"block"},a=i[n?"os2":"p2"],s=i[n?"p2":"os2"];e._isFlipped=n,r[i.a+"Percent"]=n?-100:0,r[i.a]=n?"1px":0,r["border"+a+sm]=1,r["border"+s+sm]=0,r[i.p]=t+"px",Np.set(e,r)},Cm=[],Am={},Mm=function(){return Ef()-Af>34&&(bf||(bf=requestAnimationFrame(Wm)))},Tm=function(){(!of||!of.isPressed||of.startX>Gp.clientWidth)&&(gp.cache++,of?bf||(bf=requestAnimationFrame(Wm)):Wm(),Af||Rm("scrollStart"),Af=Ef())},Pm=function(){hf=jp.innerWidth,cf=jp.innerHeight},Dm=function(){gp.cache++,!Zp&&!sf&&!Vp.fullscreenElement&&!Vp.webkitFullscreenElement&&(!lf||hf!==jp.innerWidth||Math.abs(jp.innerHeight-cf)>.25*jp.innerHeight)&&Wp.restart(!0)},km={},Om=[],Im=function e(){return vm(ag,"scrollEnd",e)||Um(!0)},Rm=function(e){return km[e]&&km[e].map((function(e){return e()}))||Om},Lm=[],Bm=function(e){for(var t=0;t<Lm.length;t+=5)(!e||Lm[t+4]&&Lm[t+4].query===e)&&(Lm[t].style.cssText=Lm[t+1],Lm[t].getBBox&&Lm[t].setAttribute("transform",Lm[t+2]||""),Lm[t+3].uncache=1)},zm=function(e,t){var i;for($p=0;$p<Cm.length;$p++)!(i=Cm[$p])||t&&i._ctx!==t||(e?i.kill(1):i.revert(!0,!0));gf=!0,t&&Bm(t),t||Rm("revert")},Nm=function(e,t){gp.cache++,(t||!xf)&&gp.forEach((function(e){return Gf(e)&&e.cacheID++&&(e.rec=0)})),Uf(e)&&(jp.history.scrollRestoration=pf=e)},Fm=0,jm=function(){Gp.appendChild(ff),mf=!of&&ff.offsetHeight||jp.innerHeight,Gp.removeChild(ff)},Vm=function(e){return qp(".gsap-marker-start, .gsap-marker-end, .gsap-marker-scroller-start, .gsap-marker-scroller-end").forEach((function(t){return t.style.display=e?"none":"block"}))},Um=function(e,t){if(!Af||e||gf){jm(),xf=ag.isRefreshing=!0,gp.forEach((function(e){return Gf(e)&&++e.cacheID&&(e.rec=e())}));var i=Rm("refreshInit");rf&&ag.sort(),t||zm(),gp.forEach((function(e){Gf(e)&&(e.smooth&&(e.target.style.scrollBehavior="auto"),e(0))})),Cm.slice(0).forEach((function(e){return e.refresh()})),gf=!1,Cm.forEach((function(e){if(e._subPinOffset&&e.pin){var t=e.vars.horizontal?"offsetWidth":"offsetHeight",i=e.pin[t];e.revert(!0,1),e.adjustPinSpacing(e.pin[t]-i),e.refresh()}})),vf=1,Vm(!0),Cm.forEach((function(e){var t=jf(e.scroller,e._dir),i="max"===e.vars.end||e._endClamp&&e.end>t,n=e._startClamp&&e.start>=t;(i||n)&&e.setPositions(n?t-1:e.start,i?Math.max(n?t:e.start+1,t):e.end,!0)})),Vm(!1),vf=0,i.forEach((function(e){return e&&e.render&&e.render(-1)})),gp.forEach((function(e){Gf(e)&&(e.smooth&&requestAnimationFrame((function(){return e.target.style.scrollBehavior="smooth"})),e.rec&&e(e.rec))})),Nm(pf,1),Wp.pause(),Fm++,xf=2,Wm(2),Cm.forEach((function(e){return Gf(e.vars.onRefresh)&&e.vars.onRefresh(e)})),xf=ag.isRefreshing=!1,Rm("refresh")}else gm(ag,"scrollEnd",Im)},Gm=0,Hm=1,Wm=function(e){if(2===e||!xf&&!gf){ag.isUpdating=!0,_f&&_f.update(0);var t=Cm.length,i=Ef(),n=i-Cf>=50,r=t&&Cm[0].scroll();if(Hm=Gm>r?-1:1,xf||(Gm=r),n&&(Af&&!Kp&&i-Af>200&&(Af=0,Rm("scrollEnd")),Yp=Cf,Cf=i),Hm<0){for($p=t;$p-- >0;)Cm[$p]&&Cm[$p].update(0,n);Hm=1}else for($p=0;$p<t;$p++)Cm[$p]&&Cm[$p].update(0,n);ag.isUpdating=!1}bf=0},qm=[Qf,"top",Kf,Zf,am+nm,am+em,am+im,am+tm,"display","flexShrink","float","zIndex","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd","gridArea","justifySelf","alignSelf","placeSelf","order"],Xm=qm.concat([Jf,$f,"boxSizing","max"+sm,"max"+om,"position",am,rm,rm+im,rm+em,rm+nm,rm+tm]),Ym=function(e,t,i,n){if(!e._gsap.swappedIn){for(var r,a=qm.length,s=t.style,o=e.style;a--;)s[r=qm[a]]=i[r];s.position="absolute"===i.position?"absolute":"relative","inline"===i.display&&(s.display="inline-block"),o[Kf]=o[Zf]="auto",s.flexBasis=i.flexBasis||"auto",s.overflow="visible",s.boxSizing="border-box",s[Jf]=dm(e,Tp)+lm,s[$f]=dm(e,Pp)+lm,s[rm]=o[am]=o.top=o[Qf]="0",Zm(n),o[Jf]=o["max"+sm]=i[Jf],o[$f]=o["max"+om]=i[$f],o[rm]=i[rm],e.parentNode!==t&&(e.parentNode.insertBefore(t,e),t.appendChild(e)),e._gsap.swappedIn=!0}},Qm=/([A-Z])/g,Zm=function(e){if(e){var t,i,n=e.t.style,r=e.length,a=0;for((e.t._gsap||Np.core.getCache(e.t)).uncache=1;a<r;a+=2)i=e[a+1],t=e[a],i?n[t]=i:n[t]&&n.removeProperty(t.replace(Qm,"-$1").toLowerCase())}},Km=function(e){for(var t=Xm.length,i=e.style,n=[],r=0;r<t;r++)n.push(Xm[r],i[Xm[r]]);return n.t=e,n},Jm={left:0,top:0},$m=function(e,t,i,n,r,a,s,o,l,c,h,u,d,p){Gf(e)&&(e=e(o)),Uf(e)&&"max"===e.substr(0,3)&&(e=u+("="===e.charAt(4)?_m("0"+e.substr(3),i):0));var f,m,g,v=d?d.time():0;if(d&&d.seek(0),isNaN(e)||(e=+e),Hf(e))d&&(e=Np.utils.mapRange(d.scrollTrigger.start,d.scrollTrigger.end,0,u,e)),s&&Em(s,i,n,!0);else{Gf(t)&&(t=t(o));var y,b,x,w,_=(e||"0").split(" ");g=Dp(t,o)||Gp,(y=um(g)||{})&&(y.left||y.top)||"none"!==cm(g).display||(w=g.style.display,g.style.display="block",y=um(g),w?g.style.display=w:g.style.removeProperty("display")),b=_m(_[0],y[n.d]),x=_m(_[1]||"0",i),e=y[n.p]-l[n.p]-c+b+r-x,s&&Em(s,x,n,i-x<20||s._isStart&&x>20),i-=i-x}if(p&&(o[p]=e||-.001,e<0&&(e=0)),a){var S=e+i,E=a._isStart;f="scroll"+n.d2,Em(a,S,n,E&&S>20||!E&&(h?Math.max(Gp[f],Up[f]):a.parentNode[f])<=S+1),h&&(l=um(s),h&&(a.style[n.op.p]=l[n.op.p]-n.op.m-a._offset+lm))}return d&&g&&(f=um(g),d.seek(u),m=um(g),d._caScrollDist=f[n.p]-m[n.p],e=e/d._caScrollDist*u),d&&d.seek(v),d?e:Math.round(e)},eg=/(webkit|moz|length|cssText|inset)/i,tg=function(e,t,i,n){if(e.parentNode!==t){var r,a,s=e.style;if(t===Gp){for(r in e._stOrig=s.cssText,a=cm(e))+r||eg.test(r)||!a[r]||"string"!==typeof s[r]||"0"===r||(s[r]=a[r]);s.top=i,s.left=n}else s.cssText=e._stOrig;Np.core.getCache(e).uncache=1,t.appendChild(e)}},ig=function(e,t,i){var n=t,r=n;return function(t){var a=Math.round(e());return a!==n&&a!==r&&Math.abs(a-n)>3&&Math.abs(a-r)>3&&(t=a,i&&i()),r=n,n=t,t}},ng=function(e,t,i){var n={};n[t.p]="+="+i,Np.set(e,n)},rg=function(e,t){var i=kp(e,t),n="_scroll"+t.p2,r=function t(r,a,s,o,l){var c=t.tween,h=a.onComplete,u={};s=s||i();var d=ig(i,s,(function(){c.kill(),t.tween=0}));return l=o&&l||0,o=o||r-s,c&&c.kill(),a[n]=r,a.inherit=!1,a.modifiers=u,u[n]=function(){return d(s+o*c.ratio+l*c.ratio*c.ratio)},a.onUpdate=function(){gp.cache++,t.tween&&Wm()},a.onComplete=function(){t.tween=0,h&&h.call(c)},c=t.tween=Np.to(e,a)};return e[n]=i,i.wheelHandler=function(){return r.tween&&r.tween.kill()&&(r.tween=0)},gm(e,"wheel",i.wheelHandler),ag.isTouch&&gm(e,"touchmove",i.wheelHandler),r},ag=function(){function e(t,i){Fp||e.register(Np)||console.warn("Please gsap.registerPlugin(ScrollTrigger)"),df(this),this.init(t,i)}return e.prototype.init=function(t,i){if(this.progress=this.start=0,this.vars&&this.kill(!0,!0),Mf){var n,r,a,s,o,l,c,h,u,d,p,f,m,g,v,y,b,x,w,_,S,E,C,A,M,T,P,D,k,O,I,R,L,B,z,N,F,j,V,U,G=t=hm(Uf(t)||Hf(t)||t.nodeType?{trigger:t}:t,xm),H=G.onUpdate,W=G.toggleClass,q=G.id,X=G.onToggle,Y=G.onRefresh,Q=G.scrub,Z=G.trigger,K=G.pin,J=G.pinSpacing,$=G.invalidateOnRefresh,ee=G.anticipatePin,te=G.onScrubComplete,ie=G.onSnapComplete,ne=G.once,re=G.snap,ae=G.pinReparent,se=G.pinSpacer,oe=G.containerAnimation,le=G.fastScrollEnd,ce=G.preventOverlaps,he=t.horizontal||t.containerAnimation&&!1!==t.horizontal?Tp:Pp,ue=!Q&&0!==Q,de=Dp(t.scroller||jp),pe=Np.core.getCache(de),fe=zf(de),me="fixed"===("pinType"in t?t.pinType:xp(de,"pinType")||fe&&"fixed"),ge=[t.onEnter,t.onLeave,t.onEnterBack,t.onLeaveBack],ve=ue&&t.toggleActions.split(" "),ye="markers"in t?t.markers:xm.markers,be=fe?0:parseFloat(cm(de)["border"+he.p2+sm])||0,xe=this,we=t.onRefreshInit&&function(){return t.onRefreshInit(xe)},_e=function(e,t,i){var n=i.d,r=i.d2,a=i.a;return(a=xp(e,"getBoundingClientRect"))?function(){return a()[n]}:function(){return(t?Nf(r):e["client"+r])||0}}(de,fe,he),Se=function(e,t){return!t||~vp.indexOf(e)?Ff(e):function(){return Jm}}(de,fe),Ee=0,Ce=0,Ae=0,Me=kp(de,he);if(xe._startClamp=xe._endClamp=!1,xe._dir=he,ee*=45,xe.scroller=de,xe.scroll=oe?oe.time.bind(oe):Me,s=Me(),xe.vars=t,i=i||t.animation,"refreshPriority"in t&&(rf=1,-9999===t.refreshPriority&&(_f=xe)),pe.tweenScroll=pe.tweenScroll||{top:rg(de,Pp),left:rg(de,Tp)},xe.tweenTo=n=pe.tweenScroll[he.p],xe.scrubDuration=function(e){(L=Hf(e)&&e)?R?R.duration(e):R=Np.to(i,{ease:"expo",totalProgress:"+=0",inherit:!1,duration:L,paused:!0,onComplete:function(){return te&&te(xe)}}):(R&&R.progress(1).kill(),R=0)},i&&(i.vars.lazy=!1,i._initted&&!xe.isReverted||!1!==i.vars.immediateRender&&!1!==t.immediateRender&&i.duration()&&i.render(0,!0,!0),xe.animation=i.pause(),i.scrollTrigger=xe,xe.scrubDuration(Q),O=0,q||(q=i.vars.id)),re&&(Wf(re)&&!re.push||(re={snapTo:re}),"scrollBehavior"in Gp.style&&Np.set(fe?[Gp,Up]:de,{scrollBehavior:"auto"}),gp.forEach((function(e){return Gf(e)&&e.target===(fe?Vp.scrollingElement||Up:de)&&(e.smooth=!1)})),a=Gf(re.snapTo)?re.snapTo:"labels"===re.snapTo?function(e){return function(t){return Np.utils.snap(pm(e),t)}}(i):"labelsDirectional"===re.snapTo?(U=i,function(e,t){return fm(pm(U))(e,t.direction)}):!1!==re.directional?function(e,t){return fm(re.snapTo)(e,Ef()-Ce<500?0:t.direction)}:Np.utils.snap(re.snapTo),B=re.duration||{min:.1,max:2},B=Wf(B)?Xp(B.min,B.max):Xp(B,B),z=Np.delayedCall(re.delay||L/2||.1,(function(){var e=Me(),t=Ef()-Ce<500,r=n.tween;if(!(t||Math.abs(xe.getVelocity())<10)||r||Kp||Ee===e)xe.isActive&&Ee!==e&&z.restart(!0);else{var s,o,h=(e-l)/g,u=i&&!ue?i.totalProgress():h,d=t?0:(u-I)/(Ef()-Yp)*1e3||0,p=Np.utils.clamp(-h,1-h,Yf(d/2)*d/.185),f=h+(!1===re.inertia?0:p),m=re,v=m.onStart,y=m.onInterrupt,b=m.onComplete;if(s=a(f,xe),Hf(s)||(s=f),o=Math.round(l+s*g),e<=c&&e>=l&&o!==e){if(r&&!r._initted&&r.data<=Yf(o-e))return;!1===re.inertia&&(p=s-h),n(o,{duration:B(Yf(.185*Math.max(Yf(f-u),Yf(s-u))/d/.05||0)),ease:re.ease||"power3",data:Yf(o-e),onInterrupt:function(){return z.restart(!0)&&y&&y(xe)},onComplete:function(){xe.update(),Ee=Me(),i&&(R?R.resetTo("totalProgress",s,i._tTime/i._tDur):i.progress(s)),O=I=i&&!ue?i.totalProgress():xe.progress,ie&&ie(xe),b&&b(xe)}},e,p*g,o-e-p*g),v&&v(xe,n.tween)}}})).pause()),q&&(Am[q]=xe),(V=(Z=xe.trigger=Dp(Z||!0!==K&&K))&&Z._gsap&&Z._gsap.stRevert)&&(V=V(xe)),K=!0===K?Z:Dp(K),Uf(W)&&(W={targets:Z,className:W}),K&&(!1===J||J===am||(J=!(!J&&K.parentNode&&K.parentNode.style&&"flex"===cm(K.parentNode).display)&&rm),xe.pin=K,(r=Np.core.getCache(K)).spacer?v=r.pinState:(se&&((se=Dp(se))&&!se.nodeType&&(se=se.current||se.nativeElement),r.spacerIsNative=!!se,se&&(r.spacerState=Km(se))),r.spacer=x=se||Vp.createElement("div"),x.classList.add("pin-spacer"),q&&x.classList.add("pin-spacer-"+q),r.pinState=v=Km(K)),!1!==t.force3D&&Np.set(K,{force3D:!0}),xe.spacer=x=r.spacer,k=cm(K),A=k[J+he.os2],_=Np.getProperty(K),S=Np.quickSetter(K,he.a,lm),Ym(K,x,k),b=Km(K)),ye){f=Wf(ye)?hm(ye,bm):bm,d=Sm("scroller-start",q,de,he,f,0),p=Sm("scroller-end",q,de,he,f,0,d),w=d["offset"+he.op.d2];var Te=Dp(xp(de,"content")||de);h=this.markerStart=Sm("start",q,Te,he,f,w,0,oe),u=this.markerEnd=Sm("end",q,Te,he,f,w,0,oe),oe&&(j=Np.quickSetter([h,u],he.a,lm)),me||vp.length&&!0===xp(de,"fixedMarkers")||(!function(e){var t=cm(e).position;e.style.position="absolute"===t||"fixed"===t?t:"relative"}(fe?Gp:de),Np.set([d,p],{force3D:!0}),T=Np.quickSetter(d,he.a,lm),D=Np.quickSetter(p,he.a,lm))}if(oe){var Pe=oe.vars.onUpdate,De=oe.vars.onUpdateParams;oe.eventCallback("onUpdate",(function(){xe.update(0,0,1),Pe&&Pe.apply(oe,De||[])}))}if(xe.previous=function(){return Cm[Cm.indexOf(xe)-1]},xe.next=function(){return Cm[Cm.indexOf(xe)+1]},xe.revert=function(e,t){if(!t)return xe.kill(!0);var n=!1!==e||!xe.enabled,r=Zp;n!==xe.isReverted&&(n&&(N=Math.max(Me(),xe.scroll.rec||0),Ae=xe.progress,F=i&&i.progress()),h&&[h,u,d,p].forEach((function(e){return e.style.display=n?"none":"block"})),n&&(Zp=xe,xe.update(n)),!K||ae&&xe.isActive||(n?function(e,t,i){Zm(i);var n=e._gsap;if(n.spacerIsNative)Zm(n.spacerState);else if(e._gsap.swappedIn){var r=t.parentNode;r&&(r.insertBefore(e,t),r.removeChild(t))}e._gsap.swappedIn=!1}(K,x,v):Ym(K,x,cm(K),M)),n||xe.update(n),Zp=r,xe.isReverted=n)},xe.refresh=function(r,a,f,w){if(!Zp&&xe.enabled||a)if(K&&r&&Af)gm(e,"scrollEnd",Im);else{!xf&&we&&we(xe),Zp=xe,n.tween&&!f&&(n.tween.kill(),n.tween=0),R&&R.pause(),$&&i&&i.revert({kill:!1}).invalidate(),xe.isReverted||xe.revert(!0,!0),xe._subPinOffset=!1;var S,A,T,D,k,O,I,L,B,j,V,U,G,H=_e(),W=Se(),q=oe?oe.duration():jf(de,he),X=g<=.01,Q=0,ee=w||0,te=Wf(f)?f.end:t.end,ie=t.endTrigger||Z,ne=Wf(f)?f.start:t.start||(0!==t.start&&Z?K?"0 0":"0 100%":0),re=xe.pinnedContainer=t.pinnedContainer&&Dp(t.pinnedContainer,xe),se=Z&&Math.max(0,Cm.indexOf(xe))||0,le=se;for(ye&&Wf(f)&&(U=Np.getProperty(d,he.p),G=Np.getProperty(p,he.p));le--;)(O=Cm[le]).end||O.refresh(0,1)||(Zp=xe),!(I=O.pin)||I!==Z&&I!==K&&I!==re||O.isReverted||(j||(j=[]),j.unshift(O),O.revert(!0,!0)),O!==Cm[le]&&(se--,le--);for(Gf(ne)&&(ne=ne(xe)),ne=Tf(ne,"start",xe),l=$m(ne,Z,H,he,Me(),h,d,xe,W,be,me,q,oe,xe._startClamp&&"_startClamp")||(K?-.001:0),Gf(te)&&(te=te(xe)),Uf(te)&&!te.indexOf("+=")&&(~te.indexOf(" ")?te=(Uf(ne)?ne.split(" ")[0]:"")+te:(Q=_m(te.substr(2),H),te=Uf(ne)?ne:(oe?Np.utils.mapRange(0,oe.duration(),oe.scrollTrigger.start,oe.scrollTrigger.end,l):l)+Q,ie=Z)),te=Tf(te,"end",xe),c=Math.max(l,$m(te||(ie?"100% 0":q),ie,H,he,Me()+Q,u,p,xe,W,be,me,q,oe,xe._endClamp&&"_endClamp"))||-.001,Q=0,le=se;le--;)(I=(O=Cm[le]).pin)&&O.start-O._pinPush<=l&&!oe&&O.end>0&&(S=O.end-(xe._startClamp?Math.max(0,O.start):O.start),(I===Z&&O.start-O._pinPush<l||I===re)&&isNaN(ne)&&(Q+=S*(1-O.progress)),I===K&&(ee+=S));if(l+=Q,c+=Q,xe._startClamp&&(xe._startClamp+=Q),xe._endClamp&&!xf&&(xe._endClamp=c||-.001,c=Math.min(c,jf(de,he))),g=c-l||(l-=.01)&&.001,X&&(Ae=Np.utils.clamp(0,1,Np.utils.normalize(l,c,N))),xe._pinPush=ee,h&&Q&&((S={})[he.a]="+="+Q,re&&(S[he.p]="-="+Me()),Np.set([h,u],S)),!K||vf&&xe.end>=jf(de,he)){if(Z&&Me()&&!oe)for(A=Z.parentNode;A&&A!==Gp;)A._pinOffset&&(l-=A._pinOffset,c-=A._pinOffset),A=A.parentNode}else S=cm(K),D=he===Pp,T=Me(),E=parseFloat(_(he.a))+ee,!q&&c>1&&(V={style:V=(fe?Vp.scrollingElement||Up:de).style,value:V["overflow"+he.a.toUpperCase()]},fe&&"scroll"!==cm(Gp)["overflow"+he.a.toUpperCase()]&&(V.style["overflow"+he.a.toUpperCase()]="scroll")),Ym(K,x,S),b=Km(K),A=um(K,!0),L=me&&kp(de,D?Tp:Pp)(),J?((M=[J+he.os2,g+ee+lm]).t=x,(le=J===rm?dm(K,he)+g+ee:0)&&(M.push(he.d,le+lm),"auto"!==x.style.flexBasis&&(x.style.flexBasis=le+lm)),Zm(M),re&&Cm.forEach((function(e){e.pin===re&&!1!==e.vars.pinSpacing&&(e._subPinOffset=!0)})),me&&Me(N)):(le=dm(K,he))&&"auto"!==x.style.flexBasis&&(x.style.flexBasis=le+lm),me&&((k={top:A.top+(D?T-l:L)+lm,left:A.left+(D?L:T-l)+lm,boxSizing:"border-box",position:"fixed"})[Jf]=k["max"+sm]=Math.ceil(A.width)+lm,k[$f]=k["max"+om]=Math.ceil(A.height)+lm,k[am]=k[am+im]=k[am+em]=k[am+nm]=k[am+tm]="0",k[rm]=S[rm],k[rm+im]=S[rm+im],k[rm+em]=S[rm+em],k[rm+nm]=S[rm+nm],k[rm+tm]=S[rm+tm],y=function(e,t,i){for(var n,r=[],a=e.length,s=i?8:0;s<a;s+=2)n=e[s],r.push(n,n in t?t[n]:e[s+1]);return r.t=e.t,r}(v,k,ae),xf&&Me(0)),i?(B=i._initted,af(1),i.render(i.duration(),!0,!0),C=_(he.a)-E+g+ee,P=Math.abs(g-C)>1,me&&P&&y.splice(y.length-2,2),i.render(0,!0,!0),B||i.invalidate(!0),i.parent||i.totalTime(i.totalTime()),af(0)):C=g,V&&(V.value?V.style["overflow"+he.a.toUpperCase()]=V.value:V.style.removeProperty("overflow-"+he.a));j&&j.forEach((function(e){return e.revert(!1,!0)})),xe.start=l,xe.end=c,s=o=xf?N:Me(),oe||xf||(s<N&&Me(N),xe.scroll.rec=0),xe.revert(!1,!0),Ce=Ef(),z&&(Ee=-1,z.restart(!0)),Zp=0,i&&ue&&(i._initted||F)&&i.progress()!==F&&i.progress(F||0,!0).render(i.time(),!0,!0),(X||Ae!==xe.progress||oe||$)&&(i&&!ue&&i.totalProgress(oe&&l<-.001&&!Ae?Np.utils.normalize(l,c,0):Ae,!0),xe.progress=X||(s-l)/g===Ae?0:Ae),K&&J&&(x._pinOffset=Math.round(xe.progress*C)),R&&R.invalidate(),isNaN(U)||(U-=Np.getProperty(d,he.p),G-=Np.getProperty(p,he.p),ng(d,he,U),ng(h,he,U-(w||0)),ng(p,he,G),ng(u,he,G-(w||0))),X&&!xf&&xe.update(),!Y||xf||m||(m=!0,Y(xe),m=!1)}},xe.getVelocity=function(){return(Me()-o)/(Ef()-Yp)*1e3||0},xe.endAnimation=function(){qf(xe.callbackAnimation),i&&(R?R.progress(1):i.paused()?ue||qf(i,xe.direction<0,1):qf(i,i.reversed()))},xe.labelToScroll=function(e){return i&&i.labels&&(l||xe.refresh()||l)+i.labels[e]/i.duration()*g||0},xe.getTrailing=function(e){var t=Cm.indexOf(xe),i=xe.direction>0?Cm.slice(0,t).reverse():Cm.slice(t+1);return(Uf(e)?i.filter((function(t){return t.vars.preventOverlaps===e})):i).filter((function(e){return xe.direction>0?e.end<=l:e.start>=c}))},xe.update=function(e,t,r){if(!oe||r||e){var a,h,u,p,f,m,v,w=!0===xf?N:xe.scroll(),_=e?0:(w-l)/g,M=_<0?0:_>1?1:_||0,k=xe.progress;if(t&&(o=s,s=oe?Me():w,re&&(I=O,O=i&&!ue?i.totalProgress():M)),ee&&K&&!Zp&&!Sf&&Af&&(!M&&l<w+(w-o)/(Ef()-Yp)*ee?M=1e-4:1===M&&c>w+(w-o)/(Ef()-Yp)*ee&&(M=.9999)),M!==k&&xe.enabled){if(p=(f=(a=xe.isActive=!!M&&M<1)!==(!!k&&k<1))||!!M!==!!k,xe.direction=M>k?1:-1,xe.progress=M,p&&!Zp&&(h=M&&!k?0:1===M?1:1===k?2:3,ue&&(u=!f&&"none"!==ve[h+1]&&ve[h+1]||ve[h],v=i&&("complete"===u||"reset"===u||u in i))),ce&&(f||v)&&(v||Q||!i)&&(Gf(ce)?ce(xe):xe.getTrailing(ce).forEach((function(e){return e.endAnimation()}))),ue||(!R||Zp||Sf?i&&i.totalProgress(M,!(!Zp||!Ce&&!e)):(R._dp._time-R._start!==R._time&&R.render(R._dp._time-R._start),R.resetTo?R.resetTo("totalProgress",M,i._tTime/i._tDur):(R.vars.totalProgress=M,R.invalidate().restart()))),K)if(e&&J&&(x.style[J+he.os2]=A),me){if(p){if(m=!e&&M>k&&c+1>w&&w+1>=jf(de,he),ae)if(e||!a&&!m)tg(K,x);else{var L=um(K,!0),B=w-l;tg(K,Gp,L.top+(he===Pp?B:0)+lm,L.left+(he===Pp?0:B)+lm)}Zm(a||m?y:b),P&&M<1&&a||S(E+(1!==M||m?0:C))}}else S(Rf(E+C*M));re&&!n.tween&&!Zp&&!Sf&&z.restart(!0),W&&(f||ne&&M&&(M<1||!yf))&&qp(W.targets).forEach((function(e){return e.classList[a||ne?"add":"remove"](W.className)})),H&&!ue&&!e&&H(xe),p&&!Zp?(ue&&(v&&("complete"===u?i.pause().totalProgress(1):"reset"===u?i.restart(!0).pause():"restart"===u?i.restart(!0):i[u]()),H&&H(xe)),!f&&yf||(X&&f&&Xf(xe,X),ge[h]&&Xf(xe,ge[h]),ne&&(1===M?xe.kill(!1,1):ge[h]=0),f||ge[h=1===M?1:3]&&Xf(xe,ge[h])),le&&!a&&Math.abs(xe.getVelocity())>(Hf(le)?le:2500)&&(qf(xe.callbackAnimation),R?R.progress(1):qf(i,"reverse"===u?1:!M,1))):ue&&H&&!Zp&&H(xe)}if(D){var F=oe?w/oe.duration()*(oe._caScrollDist||0):w;T(F+(d._isFlipped?1:0)),D(F)}j&&j(-w/oe.duration()*(oe._caScrollDist||0))}},xe.enable=function(t,i){xe.enabled||(xe.enabled=!0,gm(de,"resize",Dm),fe||gm(de,"scroll",Tm),we&&gm(e,"refreshInit",we),!1!==t&&(xe.progress=Ae=0,s=o=Ee=Me()),!1!==i&&xe.refresh())},xe.getTween=function(e){return e&&n?n.tween:R},xe.setPositions=function(e,t,i,n){if(oe){var r=oe.scrollTrigger,a=oe.duration(),s=r.end-r.start;e=r.start+s*e/a,t=r.start+s*t/a}xe.refresh(!1,!1,{start:Pf(e,i&&!!xe._startClamp),end:Pf(t,i&&!!xe._endClamp)},n),xe.update()},xe.adjustPinSpacing=function(e){if(M&&e){var t=M.indexOf(he.d)+1;M[t]=parseFloat(M[t])+e+lm,M[1]=parseFloat(M[1])+e+lm,Zm(M)}},xe.disable=function(t,i){if(xe.enabled&&(!1!==t&&xe.revert(!0,!0),xe.enabled=xe.isActive=!1,i||R&&R.pause(),N=0,r&&(r.uncache=1),we&&vm(e,"refreshInit",we),z&&(z.pause(),n.tween&&n.tween.kill()&&(n.tween=0)),!fe)){for(var a=Cm.length;a--;)if(Cm[a].scroller===de&&Cm[a]!==xe)return;vm(de,"resize",Dm),fe||vm(de,"scroll",Tm)}},xe.kill=function(e,n){xe.disable(e,n),R&&!n&&R.kill(),q&&delete Am[q];var a=Cm.indexOf(xe);a>=0&&Cm.splice(a,1),a===$p&&Hm>0&&$p--,a=0,Cm.forEach((function(e){return e.scroller===xe.scroller&&(a=1)})),a||xf||(xe.scroll.rec=0),i&&(i.scrollTrigger=null,e&&i.revert({kill:!1}),n||i.kill()),h&&[h,u,d,p].forEach((function(e){return e.parentNode&&e.parentNode.removeChild(e)})),_f===xe&&(_f=0),K&&(r&&(r.uncache=1),a=0,Cm.forEach((function(e){return e.pin===K&&a++})),a||(r.spacer=0)),t.onKill&&t.onKill(xe)},Cm.push(xe),xe.enable(!1,!1),V&&V(xe),i&&i.add&&!g){var ke=xe.update;xe.update=function(){xe.update=ke,l||c||xe.refresh()},Np.delayedCall(.01,xe.update),g=.01,l=c=0}else xe.refresh();K&&function(){if(wf!==Fm){var e=wf=Fm;requestAnimationFrame((function(){return e===Fm&&Um(!0)}))}}()}else this.update=this.refresh=this.kill=If},e.register=function(t){return Fp||(Np=t||Bf(),Lf()&&window.document&&e.enable(),Fp=Mf),Fp},e.defaults=function(e){if(e)for(var t in e)xm[t]=e[t];return xm},e.disable=function(e,t){Mf=0,Cm.forEach((function(i){return i[t?"kill":"disable"](e)})),vm(jp,"wheel",Tm),vm(Vp,"scroll",Tm),clearInterval(Qp),vm(Vp,"touchcancel",If),vm(Gp,"touchstart",If),mm(vm,Vp,"pointerdown,touchstart,mousedown",kf),mm(vm,Vp,"pointerup,touchend,mouseup",Of),Wp.kill(),Vf(vm);for(var i=0;i<gp.length;i+=3)ym(vm,gp[i],gp[i+1]),ym(vm,gp[i],gp[i+2])},e.enable=function(){if(jp=window,Vp=document,Up=Vp.documentElement,Gp=Vp.body,Np&&(qp=Np.utils.toArray,Xp=Np.utils.clamp,df=Np.core.context||If,af=Np.core.suppressOverwrites||If,pf=jp.history.scrollRestoration||"auto",Gm=jp.pageYOffset,Np.core.globals("ScrollTrigger",e),Gp)){Mf=1,(ff=document.createElement("div")).style.height="100vh",ff.style.position="absolute",jm(),Df(),zp.register(Np),e.isTouch=zp.isTouch,uf=zp.isTouch&&/(iPad|iPhone|iPod|Mac)/g.test(navigator.userAgent),lf=1===zp.isTouch,gm(jp,"wheel",Tm),Hp=[jp,Vp,Up,Gp],Np.matchMedia?(e.matchMedia=function(e){var t,i=Np.matchMedia();for(t in e)i.add(t,e[t]);return i},Np.addEventListener("matchMediaInit",(function(){return zm()})),Np.addEventListener("matchMediaRevert",(function(){return Bm()})),Np.addEventListener("matchMedia",(function(){Um(0,1),Rm("matchMedia")})),Np.matchMedia("(orientation: portrait)",(function(){return Pm(),Pm}))):console.warn("Requires GSAP 3.11.0 or later"),Pm(),gm(Vp,"scroll",Tm);var t,i,n=Gp.style,r=n.borderTopStyle,a=Np.core.Animation.prototype;for(a.revert||Object.defineProperty(a,"revert",{value:function(){return this.time(-.01,!0)}}),n.borderTopStyle="solid",t=um(Gp),Pp.m=Math.round(t.top+Pp.sc())||0,Tp.m=Math.round(t.left+Tp.sc())||0,r?n.borderTopStyle=r:n.removeProperty("border-top-style"),Qp=setInterval(Mm,250),Np.delayedCall(.5,(function(){return Sf=0})),gm(Vp,"touchcancel",If),gm(Gp,"touchstart",If),mm(gm,Vp,"pointerdown,touchstart,mousedown",kf),mm(gm,Vp,"pointerup,touchend,mouseup",Of),Jp=Np.utils.checkPrefix("transform"),Xm.push(Jp),Fp=Ef(),Wp=Np.delayedCall(.2,Um).pause(),nf=[Vp,"visibilitychange",function(){var e=jp.innerWidth,t=jp.innerHeight;Vp.hidden?(ef=e,tf=t):ef===e&&tf===t||Dm()},Vp,"DOMContentLoaded",Um,jp,"load",Um,jp,"resize",Dm],Vf(gm),Cm.forEach((function(e){return e.enable(0,1)})),i=0;i<gp.length;i+=3)ym(vm,gp[i],gp[i+1]),ym(vm,gp[i],gp[i+2])}},e.config=function(t){"limitCallbacks"in t&&(yf=!!t.limitCallbacks);var i=t.syncInterval;i&&clearInterval(Qp)||(Qp=i)&&setInterval(Mm,i),"ignoreMobileResize"in t&&(lf=1===e.isTouch&&t.ignoreMobileResize),"autoRefreshEvents"in t&&(Vf(vm)||Vf(gm,t.autoRefreshEvents||"none"),sf=-1===(t.autoRefreshEvents+"").indexOf("resize"))},e.scrollerProxy=function(e,t){var i=Dp(e),n=gp.indexOf(i),r=zf(i);~n&&gp.splice(n,r?6:2),t&&(r?vp.unshift(jp,t,Gp,t,Up,t):vp.unshift(i,t))},e.clearMatchMedia=function(e){Cm.forEach((function(t){return t._ctx&&t._ctx.query===e&&t._ctx.kill(!0,!0)}))},e.isInViewport=function(e,t,i){var n=(Uf(e)?Dp(e):e).getBoundingClientRect(),r=n[i?Jf:$f]*t||0;return i?n.right-r>0&&n.left+r<jp.innerWidth:n.bottom-r>0&&n.top+r<jp.innerHeight},e.positionInViewport=function(e,t,i){Uf(e)&&(e=Dp(e));var n=e.getBoundingClientRect(),r=n[i?Jf:$f],a=null==t?r/2:t in wm?wm[t]*r:~t.indexOf("%")?parseFloat(t)*r/100:parseFloat(t)||0;return i?(n.left+a)/jp.innerWidth:(n.top+a)/jp.innerHeight},e.killAll=function(e){if(Cm.slice(0).forEach((function(e){return"ScrollSmoother"!==e.vars.id&&e.kill()})),!0!==e){var t=km.killAll||[];km={},t.forEach((function(e){return e()}))}},e}();ag.version="3.12.5",ag.saveStyles=function(e){return e?qp(e).forEach((function(e){if(e&&e.style){var t=Lm.indexOf(e);t>=0&&Lm.splice(t,5),Lm.push(e,e.style.cssText,e.getBBox&&e.getAttribute("transform"),Np.core.getCache(e),df())}})):Lm},ag.revert=function(e,t){return zm(!e,t)},ag.create=function(e,t){return new ag(e,t)},ag.refresh=function(e){return e?Dm():(Fp||ag.register())&&Um(!0)},ag.update=function(e){return++gp.cache&&Wm(!0===e?2:0)},ag.clearScrollMemory=Nm,ag.maxScroll=function(e,t){return jf(e,t?Tp:Pp)},ag.getScrollFunc=function(e,t){return kp(Dp(e),t?Tp:Pp)},ag.getById=function(e){return Am[e]},ag.getAll=function(){return Cm.filter((function(e){return"ScrollSmoother"!==e.vars.id}))},ag.isScrolling=function(){return!!Af},ag.snapDirectional=fm,ag.addEventListener=function(e,t){var i=km[e]||(km[e]=[]);~i.indexOf(t)||i.push(t)},ag.removeEventListener=function(e,t){var i=km[e],n=i&&i.indexOf(t);n>=0&&i.splice(n,1)},ag.batch=function(e,t){var i,n=[],r={},a=t.interval||.016,s=t.batchMax||1e9,o=function(e,t){var i=[],n=[],r=Np.delayedCall(a,(function(){t(i,n),i=[],n=[]})).pause();return function(e){i.length||r.restart(!0),i.push(e.trigger),n.push(e),s<=i.length&&r.progress(1)}};for(i in t)r[i]="on"===i.substr(0,2)&&Gf(t[i])&&"onRefreshInit"!==i?o(0,t[i]):t[i];return Gf(s)&&(s=s(),gm(ag,"refresh",(function(){return s=t.batchMax()}))),qp(e).forEach((function(e){var t={};for(i in r)t[i]=r[i];t.trigger=e,n.push(ag.create(t))})),n};var sg,og=function(e,t,i,n){return t>n?e(n):t<0&&e(0),i>n?(n-t)/(i-t):i<0?t/(t-i):1},lg=function e(t,i){!0===i?t.style.removeProperty("touch-action"):t.style.touchAction=!0===i?"auto":i?"pan-"+i+(zp.isTouch?" pinch-zoom":""):"none",t===Up&&e(Gp,i)},cg={auto:1,scroll:1},hg=function(e){var t,i=e.event,n=e.target,r=e.axis,a=(i.changedTouches?i.changedTouches[0]:i).target,s=a._gsap||Np.core.getCache(a),o=Ef();if(!s._isScrollT||o-s._isScrollT>2e3){for(;a&&a!==Gp&&(a.scrollHeight<=a.clientHeight&&a.scrollWidth<=a.clientWidth||!cg[(t=cm(a)).overflowY]&&!cg[t.overflowX]);)a=a.parentNode;s._isScroll=a&&a!==n&&!zf(a)&&(cg[(t=cm(a)).overflowY]||cg[t.overflowX]),s._isScrollT=o}(s._isScroll||"x"===r)&&(i.stopPropagation(),i._gsapAllow=!0)},ug=function(e,t,i,n){return zp.create({target:e,capture:!0,debounce:!1,lockAxis:!0,type:t,onWheel:n=n&&hg,onPress:n,onDrag:n,onScroll:n,onEnable:function(){return i&&gm(Vp,zp.eventTypes[0],pg,!1,!0)},onDisable:function(){return vm(Vp,zp.eventTypes[0],pg,!0)}})},dg=/(input|label|select|textarea)/i,pg=function(e){var t=dg.test(e.target.tagName);(t||sg)&&(e._gsapAllow=!0,sg=t)},fg=function(e){Wf(e)||(e={}),e.preventDefault=e.isNormalizer=e.allowClicks=!0,e.type||(e.type="wheel,touch"),e.debounce=!!e.debounce,e.id=e.id||"normalizer";var t,i,n,r,a,s,o,l,c=e,h=c.normalizeScrollX,u=c.momentum,d=c.allowNestedScroll,p=c.onRelease,f=Dp(e.target)||Up,m=Np.core.globals().ScrollSmoother,g=m&&m.get(),v=uf&&(e.content&&Dp(e.content)||g&&!1!==e.content&&!g.smooth()&&g.content()),y=kp(f,Pp),b=kp(f,Tp),x=1,w=(zp.isTouch&&jp.visualViewport?jp.visualViewport.scale*jp.visualViewport.width:jp.outerWidth)/jp.innerWidth,_=0,S=Gf(u)?function(){return u(t)}:function(){return u||2.8},E=ug(f,e.type,!0,d),C=function(){return r=!1},A=If,M=If,T=function(){i=jf(f,Pp),M=Xp(uf?1:0,i),h&&(A=Xp(0,jf(f,Tp))),n=Fm},P=function(){v._gsap.y=Rf(parseFloat(v._gsap.y)+y.offset)+"px",v.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+parseFloat(v._gsap.y)+", 0, 1)",y.offset=y.cacheID=0},D=function(){T(),a.isActive()&&a.vars.scrollY>i&&(y()>i?a.progress(1)&&y(i):a.resetTo("scrollY",i))};return v&&Np.set(v,{y:"+=0"}),e.ignoreCheck=function(e){return uf&&"touchmove"===e.type&&function(){if(r){requestAnimationFrame(C);var e=Rf(t.deltaY/2),i=M(y.v-e);if(v&&i!==y.v+y.offset){y.offset=i-y.v;var n=Rf((parseFloat(v&&v._gsap.y)||0)-y.offset);v.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+n+", 0, 1)",v._gsap.y=n+"px",y.cacheID=gp.cache,Wm()}return!0}y.offset&&P(),r=!0}()||x>1.05&&"touchstart"!==e.type||t.isGesturing||e.touches&&e.touches.length>1},e.onPress=function(){r=!1;var e=x;x=Rf((jp.visualViewport&&jp.visualViewport.scale||1)/w),a.pause(),e!==x&&lg(f,x>1.01||!h&&"x"),s=b(),o=y(),T(),n=Fm},e.onRelease=e.onGestureStart=function(e,t){if(y.offset&&P(),t){gp.cache++;var n,r,s=S();h&&(r=(n=b())+.05*s*-e.velocityX/.227,s*=og(b,n,r,jf(f,Tp)),a.vars.scrollX=A(r)),r=(n=y())+.05*s*-e.velocityY/.227,s*=og(y,n,r,jf(f,Pp)),a.vars.scrollY=M(r),a.invalidate().duration(s).play(.01),(uf&&a.vars.scrollY>=i||n>=i-1)&&Np.to({},{onUpdate:D,duration:s})}else l.restart(!0);p&&p(e)},e.onWheel=function(){a._ts&&a.pause(),Ef()-_>1e3&&(n=0,_=Ef())},e.onChange=function(e,t,i,r,a){if(Fm!==n&&T(),t&&h&&b(A(r[2]===t?s+(e.startX-e.x):b()+t-r[1])),i){y.offset&&P();var l=a[2]===i,c=l?o+e.startY-e.y:y()+i-a[1],u=M(c);l&&c!==u&&(o+=u-c),y(u)}(i||t)&&Wm()},e.onEnable=function(){lg(f,!h&&"x"),ag.addEventListener("refresh",D),gm(jp,"resize",D),y.smooth&&(y.target.style.scrollBehavior="auto",y.smooth=b.smooth=!1),E.enable()},e.onDisable=function(){lg(f,!0),vm(jp,"resize",D),ag.removeEventListener("refresh",D),E.kill()},e.lockAxis=!1!==e.lockAxis,(t=new zp(e)).iOS=uf,uf&&!y()&&y(1),uf&&Np.ticker.add(If),l=t._dc,a=Np.to(t,{ease:"power4",paused:!0,inherit:!1,scrollX:h?"+=0.1":"+=0",scrollY:"+=0.1",modifiers:{scrollY:ig(y,y(),(function(){return a.pause()}))},onUpdate:Wm,onComplete:l.vars.onComplete}),t};ag.sort=function(e){return Cm.sort(e||function(e,t){return-1e6*(e.vars.refreshPriority||0)+e.start-(t.start+-1e6*(t.vars.refreshPriority||0))})},ag.observe=function(e){return new zp(e)},ag.normalizeScroll=function(e){if("undefined"===typeof e)return of;if(!0===e&&of)return of.enable();if(!1===e)return of&&of.kill(),void(of=e);var t=e instanceof zp?e:fg(e);return of&&of.target===t.target&&of.kill(),zf(t.target)&&(of=t),t},ag.core={_getVelocityProp:Op,_inputObserver:ug,_scrollers:gp,_proxies:vp,bridge:{ss:function(){Af||Rm("scrollStart"),Af=Ef()},ref:function(){return Zp}}},Bf()&&Np.registerPlugin(ag),qd.registerPlugin(ag);const mg=!1,gg="power1.in",vg="top 75%",yg=e=>qd.from(e,{y:e.classList.contains("label-button")?0:10,opacity:0,ease:gg,duration:.4,scrollTrigger:{trigger:e,start:vg,end:"top",markers:mg}}),bg=[".has-animation",".label-button",".form-section"],xg=e=>{let{items:t,container:i,dependencies:n=[]}=e;Jd((()=>{qd.utils.toArray([...bg,...t]).forEach((e=>yg(e)))}),{dependencies:n,scope:i,revertOnUpdate:!0})},wg=e=>{let{item:t,container:i,trigger:n,dependencies:r=[]}=e;Jd((()=>{(e=>{let{item:t,trigger:i}=e;qd.from(t,{opacity:0,ease:gg,duration:.4,stagger:.15,scrollTrigger:{trigger:i,start:vg,markers:mg}})})({item:t,trigger:n})}),{dependencies:r,scope:i,revertOnUpdate:!0})};var _g=__webpack_require__(302),Sg=__webpack_require__.n(_g),Eg=__webpack_require__(756),Cg=__webpack_require__.n(Eg),Ag=__webpack_require__(128),Mg=__webpack_require__.n(Ag);function Tg(){return Tg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},Tg.apply(this,arguments)}function Pg(e,t){return e(t={exports:{}},t.exports),t.exports}var Dg="function"===typeof Symbol&&Symbol.for,kg=Dg?Symbol.for("react.element"):60103,Og=Dg?Symbol.for("react.portal"):60106,Ig=Dg?Symbol.for("react.fragment"):60107,Rg=Dg?Symbol.for("react.strict_mode"):60108,Lg=Dg?Symbol.for("react.profiler"):60114,Bg=Dg?Symbol.for("react.provider"):60109,zg=Dg?Symbol.for("react.context"):60110,Ng=Dg?Symbol.for("react.async_mode"):60111,Fg=Dg?Symbol.for("react.concurrent_mode"):60111,jg=Dg?Symbol.for("react.forward_ref"):60112,Vg=Dg?Symbol.for("react.suspense"):60113,Ug=Dg?Symbol.for("react.suspense_list"):60120,Gg=Dg?Symbol.for("react.memo"):60115,Hg=Dg?Symbol.for("react.lazy"):60116,Wg=Dg?Symbol.for("react.block"):60121,qg=Dg?Symbol.for("react.fundamental"):60117,Xg=Dg?Symbol.for("react.responder"):60118,Yg=Dg?Symbol.for("react.scope"):60119;function Qg(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case kg:switch(e=e.type){case Ng:case Fg:case Ig:case Lg:case Rg:case Vg:return e;default:switch(e=e&&e.$$typeof){case zg:case jg:case Hg:case Gg:case Bg:return e;default:return t}}case Og:return t}}}function Zg(e){return Qg(e)===Fg}var Kg={AsyncMode:Ng,ConcurrentMode:Fg,ContextConsumer:zg,ContextProvider:Bg,Element:kg,ForwardRef:jg,Fragment:Ig,Lazy:Hg,Memo:Gg,Portal:Og,Profiler:Lg,StrictMode:Rg,Suspense:Vg,isAsyncMode:function(e){return Zg(e)||Qg(e)===Ng},isConcurrentMode:Zg,isContextConsumer:function(e){return Qg(e)===zg},isContextProvider:function(e){return Qg(e)===Bg},isElement:function(e){return"object"===typeof e&&null!==e&&e.$$typeof===kg},isForwardRef:function(e){return Qg(e)===jg},isFragment:function(e){return Qg(e)===Ig},isLazy:function(e){return Qg(e)===Hg},isMemo:function(e){return Qg(e)===Gg},isPortal:function(e){return Qg(e)===Og},isProfiler:function(e){return Qg(e)===Lg},isStrictMode:function(e){return Qg(e)===Rg},isSuspense:function(e){return Qg(e)===Vg},isValidElementType:function(e){return"string"===typeof e||"function"===typeof e||e===Ig||e===Fg||e===Lg||e===Rg||e===Vg||e===Ug||"object"===typeof e&&null!==e&&(e.$$typeof===Hg||e.$$typeof===Gg||e.$$typeof===Bg||e.$$typeof===zg||e.$$typeof===jg||e.$$typeof===qg||e.$$typeof===Xg||e.$$typeof===Yg||e.$$typeof===Wg)},typeOf:Qg},Jg=(Pg((function(e,t){0})),Pg((function(e){e.exports=Kg})),Object.getOwnPropertySymbols),$g=Object.prototype.hasOwnProperty,ev=Object.prototype.propertyIsEnumerable;(function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},i=0;i<10;i++)t["_"+String.fromCharCode(i)]=i;var n=Object.getOwnPropertyNames(t).map((function(e){return t[e]}));if("0123456789"!==n.join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(a){return!1}})()&&Object.assign;var tv="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Function.call.bind(Object.prototype.hasOwnProperty);function iv(e,t,i,n,r){}iv.resetWarningCache=function(){0};function nv(){}function rv(){}rv.resetWarningCache=nv;var av=Pg((function(e){e.exports=function(){function e(e,t,i,n,r,a){if(a!==tv){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var i={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:rv,resetWarningCache:nv};return i.PropTypes=i,i}()})),sv={animationData:av.object,path:av.string,play:av.bool,goTo:av.number,speed:av.number,direction:av.number,loop:av.oneOfType([av.number,av.bool]),useSubframes:av.bool,segments:av.oneOfType([av.arrayOf(av.number),av.bool]),rendererSettings:av.object,renderer:av.string,audioFactory:av.func,onComplete:av.func,onLoopComplete:av.func,onEnterFrame:av.func,onSegmentStart:av.func},ov={},lv=function(){},cv=function(e){var i=e.loadAnimation,n=(0,t.memo)((0,t.forwardRef)((function(e,n){var r=e.animationData,a=void 0===r?null:r,s=e.path,o=void 0===s?null:s,l=e.play,c=void 0===l?null:l,h=e.speed,u=void 0===h?1:h,d=e.direction,p=void 0===d?1:d,f=e.segments,m=void 0===f?null:f,g=e.goTo,v=void 0===g?null:g,y=e.useSubframes,b=void 0===y||y,x=e.renderer,w=void 0===x?"svg":x,_=e.loop,S=void 0===_||_,E=e.rendererSettings,C=void 0===E?ov:E,A=e.audioFactory,M=void 0===A?null:A,T=e.onLoad,P=void 0===T?lv:T,D=e.onComplete,k=void 0===D?lv:D,O=e.onLoopComplete,I=void 0===O?lv:O,R=e.onEnterFrame,L=void 0===R?lv:R,B=e.onSegmentStart,z=void 0===B?lv:B,N=function(e,t){if(null==e)return{};var i,n,r={},a=Object.keys(e);for(n=0;n<a.length;n++)i=a[n],t.indexOf(i)>=0||(r[i]=e[i]);return r}(e,["animationData","path","play","speed","direction","segments","goTo","useSubframes","renderer","loop","rendererSettings","audioFactory","onLoad","onComplete","onLoopComplete","onEnterFrame","onSegmentStart"]),F=(0,t.useRef)(),j=(0,t.useRef)(),V=(0,t.useState)(!1),U=V[0],G=V[1],H=(0,t.useState)(m),W=H[0],q=H[1];(0,t.useEffect)((function(){Cg()(W,m)||q(m)}),[m,W]);var X=(0,t.useState)(C),Y=X[0],Q=X[1];(0,t.useEffect)((function(){Cg()(Y,C)||Q(C)}),[C,Y]),(0,t.useEffect)((function(){return function(){return j.current.removeEventListener("complete",k)}}),[k]),(0,t.useEffect)((function(){return function(){return j.current.removeEventListener("loopComplete",I)}}),[I]),(0,t.useEffect)((function(){return function(){return j.current.removeEventListener("enterFrame",L)}}),[L]),(0,t.useEffect)((function(){return function(){return j.current.removeEventListener("segmentStart",z)}}),[z]),(0,t.useEffect)((function(){return function(){return j.current.removeEventListener("DOMLoaded",P)}}),[P]);var Z=(0,t.useCallback)((function(e){j.current=e,"function"===typeof n?n(e):void 0!==n&&null!==n&&(n.current=e)}),[n]);(0,t.useEffect)((function(){var e=i({animationData:null==a||"object"!==typeof a?a:"object"===typeof a.default?Mg()(a.default):Mg()(a),path:o,container:F.current,renderer:w,loop:!1,autoplay:!1,rendererSettings:Y,audioFactory:M});Z(e);var t=function(){return G(!0)};return j.current.addEventListener("DOMLoaded",t),function(){j.current.removeEventListener("DOMLoaded",t),G(!1),j.current.destroy(),Z(void 0)}}),[S,w,Y,a,o,M,Z]),(0,t.useEffect)((function(){j.current.addEventListener("DOMLoaded",P)}),[P]),(0,t.useEffect)((function(){j.current.addEventListener("complete",k)}),[k]),(0,t.useEffect)((function(){j.current.addEventListener("loopComplete",I)}),[I]),(0,t.useEffect)((function(){j.current.addEventListener("enterFrame",L)}),[L]),(0,t.useEffect)((function(){j.current.addEventListener("segmentStart",z)}),[z]),(0,t.useEffect)((function(){U&&(j.current.loop=S)}),[U,S]);var K=(0,t.useRef)(!1);return(0,t.useEffect)((function(){if(U)if(!0===c){if(W){if(j.current.playSegments(W,true),K.current=!0,-1===p)e(W[1])}else if(K.current&&j.current.resetSegments(true),K.current=!1,-1===p)e(j.current.getDuration(!0));else j.current.play()}else!1===c&&j.current.pause();function e(e){j.current.goToAndPlay(e,!0),j.current.setDirection(p)}}),[c,W,U,p]),(0,t.useEffect)((function(){U&&(Number.isNaN(u)||j.current.setSpeed(u))}),[u,U]),(0,t.useEffect)((function(){U&&j.current.setDirection(p)}),[p,U]),(0,t.useEffect)((function(){if(U&&null!=v){c?j.current.goToAndPlay(v,true):j.current.goToAndStop(v,true)}}),[v,c,U]),(0,t.useEffect)((function(){j.current.setSubframe&&j.current.setSubframe(b)}),[b]),t.createElement("div",Tg({},N,{ref:F}))})));return n.propTypes=sv,n}(Sg());const hv=cv,uv=JSON.parse('{"nm":"Preloader","v":"5.9.6","fr":60,"ip":0,"op":239,"w":1440,"h":800,"ddd":0,"markers":[],"assets":[{"nm":"Progress","fr":60,"id":"3567:24596","layers":[{"ty":3,"ddd":0,"ind":11,"hd":false,"nm":"Progress - Null","ks":{"a":{"a":0,"k":[0,0]},"o":{"a":0,"k":100},"p":{"a":0,"k":[608,440]},"r":{"a":0,"k":0},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0}},"st":0,"ip":0,"op":240,"bm":0,"sr":1},{"ty":4,"ddd":0,"ind":12,"hd":false,"nm":"Progress - Shape Mask","parent":11,"ks":{"a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}},"st":0,"ip":0,"op":240,"bm":0,"sr":1,"shapes":[{"ty":"gr","nm":"Group","hd":false,"np":3,"it":[{"ty":"sh","nm":"Path","hd":false,"ks":{"a":0,"k":{"c":true,"v":[[2,0],[222,0],[224,2],[224,2],[222,4],[2,4],[0,2],[0,2],[2,0],[2,0]],"i":[[0,0],[0,0],[0,-1.1046],[0,0],[1.1046,0],[0,0],[0,1.1046],[0,0],[-1.1046,0],[0,0]],"o":[[0,0],[1.1045699999999954,0],[0,0],[0,1.1045699999999998],[0,0],[-1.10457,0],[0,0],[0,-1.10457],[0,0],[0,0]]}}},{"ty":"fl","o":{"a":0,"k":100},"c":{"a":0,"k":[0,1,0,1]},"nm":"Fill","hd":false,"r":1},{"ty":"tr","a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}}]}]}]},{"nm":"[GROUP] Vector - Null / Vector / Vector - Null / Vector / Vector - Null / Vector / Vector - Null / Vector / Vector - Null / Vector / Vector - Null / Vector / Vector - Null / Vector","fr":60,"id":"lqwldr6djxkcaiduwd","layers":[{"ty":3,"ddd":0,"ind":13,"hd":false,"nm":"Logo UniferX - Null","ks":{"a":{"a":0,"k":[0,0]},"o":{"a":0,"k":100},"p":{"a":0,"k":[602,356]},"r":{"a":0,"k":0},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0}},"st":0,"ip":0,"op":240,"bm":0,"sr":1},{"ty":3,"ddd":0,"ind":14,"hd":false,"nm":"Text - Null","parent":13,"ks":{"a":{"a":0,"k":[83.8417,26.2013]},"o":{"a":0,"k":100},"p":{"a":1,"k":[{"t":6,"s":[178.0001,32.2013],"o":{"x":[0.5],"y":[0.35]},"i":{"x":[0.15],"y":[1]},"ti":[0,0],"to":[0,0]},{"t":168,"s":[89.8417,32.2013]}]},"r":{"a":0,"k":0},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0}},"st":0,"ip":0,"op":240,"bm":0,"sr":1},{"ty":3,"ddd":0,"ind":15,"hd":false,"nm":"Vector - Null","parent":14,"ks":{"a":{"a":0,"k":[0,0]},"o":{"a":1,"k":[{"t":44.4,"s":[0],"o":{"x":[0.5],"y":[0.35]},"i":{"x":[0.15],"y":[1]}},{"t":97.8,"s":[100]}]},"p":{"a":0,"k":[72.5802,0]},"r":{"a":0,"k":0},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0}},"st":0,"ip":0,"op":240,"bm":0,"sr":1},{"ty":4,"ddd":0,"ind":16,"hd":false,"nm":"Vector","parent":15,"ks":{"a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":1,"k":[{"t":44.4,"s":[0],"o":{"x":[0.5],"y":[0.35]},"i":{"x":[0.15],"y":[1]}},{"t":97.8,"s":[100]}]}},"st":0,"ip":0,"op":240,"bm":0,"sr":1,"shapes":[{"ty":"gr","nm":"Group","hd":false,"np":3,"it":[{"ty":"sh","nm":"Path","hd":false,"ks":{"a":0,"k":{"c":true,"v":[[12.8398,6.2403],[6.4199,12.4806],[0,6.2404],[6.4199,0.0001],[12.8398,6.2404],[12.8398,6.2403]],"i":[[0,0],[3.5431,0],[0,3.4439],[-3.5431,0],[0,-3.4439],[0,0]],"o":[[0,3.4512799999999997],[-3.54307,0],[0,-3.44392],[3.54307,0],[0,0],[0,0]]}}},{"ty":"fl","o":{"a":0,"k":100},"c":{"a":0,"k":[1,1,1,1]},"nm":"Fill","hd":false,"r":1},{"ty":"tr","a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}}]}]},{"ty":3,"ddd":0,"ind":17,"hd":false,"nm":"Vector - Null","parent":14,"ks":{"a":{"a":0,"k":[0,0]},"o":{"a":1,"k":[{"t":44.4,"s":[0],"o":{"x":[0.5],"y":[0.35]},"i":{"x":[0.15],"y":[1]}},{"t":97.8,"s":[100]}]},"p":{"a":0,"k":[72.8147,16.2925]},"r":{"a":0,"k":0},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0}},"st":0,"ip":0,"op":240,"bm":0,"sr":1},{"ty":4,"ddd":0,"ind":18,"hd":false,"nm":"Vector","parent":17,"ks":{"a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":1,"k":[{"t":44.4,"s":[0],"o":{"x":[0.5],"y":[0.35]},"i":{"x":[0.15],"y":[1]}},{"t":97.8,"s":[100]}]}},"st":0,"ip":0,"op":240,"bm":0,"sr":1,"shapes":[{"ty":"gr","nm":"Group","hd":false,"np":3,"it":[{"ty":"sh","nm":"Path","hd":false,"ks":{"a":0,"k":{"c":true,"v":[[0,0],[12.3629,0],[12.3629,34.8366],[0,34.8366],[0,0]],"i":[[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0]]}}},{"ty":"fl","o":{"a":0,"k":100},"c":{"a":0,"k":[1,1,1,1]},"nm":"Fill","hd":false,"r":1},{"ty":"tr","a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}}]}]},{"ty":3,"ddd":0,"ind":19,"hd":false,"nm":"Vector - Null","parent":14,"ks":{"a":{"a":0,"k":[0,0]},"o":{"a":1,"k":[{"t":76.8,"s":[0],"o":{"x":[0.5],"y":[0.35]},"i":{"x":[0.15],"y":[1]}},{"t":131.4,"s":[100]}]},"p":{"a":0,"k":[147.2047,15.6287]},"r":{"a":0,"k":0},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0}},"st":0,"ip":0,"op":240,"bm":0,"sr":1},{"ty":4,"ddd":0,"ind":20,"hd":false,"nm":"Vector","parent":19,"ks":{"a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":1,"k":[{"t":76.8,"s":[0],"o":{"x":[0.5],"y":[0.35]},"i":{"x":[0.15],"y":[1]}},{"t":131.4,"s":[100]}]}},"st":0,"ip":0,"op":240,"bm":0,"sr":1,"shapes":[{"ty":"gr","nm":"Group","hd":false,"np":3,"it":[{"ty":"sh","nm":"Path","hd":false,"ks":{"a":0,"k":{"c":false,"v":[[0,2.7314],[0,35.5002],[12.3629,35.5002],[12.3629,9.0674],[17.9501,10.0977],[20.4787,0.2075],[0.0076,2.7316]],"i":[[0,0],[0,0],[0,0],[0,0],[-2.0668,-1.1627],[0,0],[4.4516,-2.0678]],"o":[[0,0],[0,0],[0,0],[1.59741,-0.3237900000000007],[0,0],[-10.84118,-0.70644],[0,0]]}}},{"ty":"fl","o":{"a":0,"k":100},"c":{"a":0,"k":[1,1,1,1]},"nm":"Fill","hd":false,"r":1},{"ty":"tr","a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}}]}]},{"ty":3,"ddd":0,"ind":21,"hd":false,"nm":"Vector - Null","parent":14,"ks":{"a":{"a":0,"k":[0,0]},"o":{"a":1,"k":[{"t":64.80000000000001,"s":[0],"o":{"x":[0.5],"y":[0.35]},"i":{"x":[0.15],"y":[1]}},{"t":119.4,"s":[100]}]},"p":{"a":0,"k":[109.8808,15.5055]},"r":{"a":0,"k":0},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0}},"st":0,"ip":0,"op":240,"bm":0,"sr":1},{"ty":4,"ddd":0,"ind":22,"hd":false,"nm":"Vector","parent":21,"ks":{"a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":1,"k":[{"t":64.80000000000001,"s":[0],"o":{"x":[0.5],"y":[0.35]},"i":{"x":[0.15],"y":[1]}},{"t":119.4,"s":[100]}]}},"st":0,"ip":0,"op":240,"bm":0,"sr":1,"shapes":[{"ty":"gr","nm":"Group","hd":false,"np":4,"it":[{"ty":"sh","nm":"Path","hd":false,"ks":{"a":0,"k":{"c":false,"v":[[32.6144,10.2508],[29.2606,4.5992],[17.0794,0],[10.6519,1.1995],[5.3449,4.7464],[1.4687,10.5819],[0,18.706],[1.1204,25.8514],[4.6407,31.6501],[10.3868,35.4987],[18.8054,36.8969],[22.5832,36.6982],[26.1112,36.2052],[29.1243,35.5135],[31.3425,34.7041],[31.7438,34.5054],[30.2145,25.5277],[29.5029,25.8368],[25.3542,26.9848],[20.1229,27.4558],[13.7106,25.8222],[11.2198,22.187],[33.4927,22.187],[33.5381,21.6425],[33.6744,19.8616],[33.7425,17.9851],[32.6221,10.2363]],"i":[[0,0],[1.4839,1.5233],[5.1026,0],[2.0744,-0.7947],[1.605,-1.5527],[0.969,-2.318],[0,-3.076],[-0.7419,-2.1929],[-1.5823,-1.6263],[-2.3923,-0.9272],[-3.2024,0],[-1.2567,0.1325],[-1.0977,0.1987],[-0.9009,0.2649],[-0.5602,0.2723],[0,0],[0,0],[0,0],[1.6958,-0.3091],[1.7715,0],[1.5671,1.0817],[0.318,1.5012],[0,0],[0,0],[-0.0454,0.6697],[0,0.5593],[0.7419,2.2371]],"o":[[-0.7495000000000012,-2.237070000000001],[-2.9828399999999995,-3.0539],[-2.18792,0],[-2.08193,0.8021099999999999],[-1.6049800000000003,1.5527100000000003],[-0.97662,2.3180200000000006],[0,2.546140000000001],[0.7570700000000001,2.2223599999999983],[1.5747,1.626290000000001],[2.38476,0.9272100000000023],[1.256730000000001,0],[1.2491599999999998,-0.1324600000000018],[1.0977500000000013,-0.19868999999999915],[0.9160499999999985,-0.2649199999999965],[0,0],[0,0],[0,0],[-1.0598899999999993,0.4488899999999987],[-1.7033999999999985,0.31643000000000043],[-2.6875800000000005,0],[-1.35515,-0.9345700000000008],[0,0],[0,0],[0.045420000000000016,-0.5224699999999984],[0.045420000000000016,-0.6843700000000013],[0,-2.9214400000000005],[0,0]]}}},{"ty":"sh","nm":"Path","hd":false,"ks":{"a":0,"k":{"c":true,"v":[[11.2576,14.4306],[11.6512,11.7888],[17.1399,7.6532],[22.6059,11.7888],[22.9238,13.2606],[23.0298,14.4306],[11.2576,14.4306]],"i":[[0,0],[-0.4845,1.6263],[-3.4674,0],[-1.3551,-4.3417],[-0.0681,-0.5445],[0,-0.5961],[0,0]],"o":[[0,0],[0.5905100000000001,-1.9721600000000006],[0,0],[0.13626999999999967,0.4415300000000002],[0.06813999999999965,0.5003999999999991],[0,0],[0,0]]}}},{"ty":"fl","o":{"a":0,"k":100},"c":{"a":0,"k":[1,1,1,1]},"nm":"Fill","hd":false,"r":1},{"ty":"tr","a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}}]}]},{"ty":3,"ddd":0,"ind":23,"hd":false,"nm":"Vector - Null","parent":14,"ks":{"a":{"a":0,"k":[0,0]},"o":{"a":1,"k":[{"t":32.400000000000006,"s":[0],"o":{"x":[0.5],"y":[0.35]},"i":{"x":[0.15],"y":[1]}},{"t":87,"s":[100]}]},"p":{"a":0,"k":[36.4073,15.6449]},"r":{"a":0,"k":0},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0}},"st":0,"ip":0,"op":240,"bm":0,"sr":1},{"ty":4,"ddd":0,"ind":24,"hd":false,"nm":"Vector","parent":23,"ks":{"a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":1,"k":[{"t":32.400000000000006,"s":[0],"o":{"x":[0.5],"y":[0.35]},"i":{"x":[0.15],"y":[1]}},{"t":87,"s":[100]}]}},"st":0,"ip":0,"op":240,"bm":0,"sr":1,"shapes":[{"ty":"gr","nm":"Group","hd":false,"np":3,"it":[{"ty":"sh","nm":"Path","hd":false,"ks":{"a":0,"k":{"c":false,"v":[[15.5577,0],[0,2.6492],[0,35.4841],[12.3175,35.4841],[12.3175,9.0513],[15.2171,8.86],[19.8428,11.8329],[19.8428,35.4841],[32.3041,35.4841],[32.3041,11.7005],[15.5502,0]],"i":[[0,0],[3.9292,-1.5527],[0,0],[0,0],[0,0],[-0.8025,0],[0,-2.0825],[0,0],[0,0],[0,0],[12.9004,0]],"o":[[-6.91958,0],[0,0],[0,0],[0,0],[0.46937999999999924,-0.06622999999999912],[2.1954900000000013,0],[0,0],[0,0],[0,0],[0,-7.63107],[0,0]]}}},{"ty":"fl","o":{"a":0,"k":100},"c":{"a":0,"k":[1,1,1,1]},"nm":"Fill","hd":false,"r":1},{"ty":"tr","a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}}]}]},{"ty":3,"ddd":0,"ind":25,"hd":false,"nm":"Vector - Null","parent":14,"ks":{"a":{"a":0,"k":[0,0]},"o":{"a":1,"k":[{"t":22.2,"s":[0],"o":{"x":[0.5],"y":[0.35]},"i":{"x":[0.15],"y":[1]}},{"t":76.8,"s":[100]}]},"p":{"a":0,"k":[0,16.2848]},"r":{"a":0,"k":0},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0}},"st":0,"ip":0,"op":240,"bm":0,"sr":1},{"ty":4,"ddd":0,"ind":26,"hd":false,"nm":"Vector","parent":25,"ks":{"a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":1,"k":[{"t":22.2,"s":[0],"o":{"x":[0.5],"y":[0.35]},"i":{"x":[0.15],"y":[1]}},{"t":76.8,"s":[100]}]}},"st":0,"ip":0,"op":240,"bm":0,"sr":1,"shapes":[{"ty":"gr","nm":"Group","hd":false,"np":3,"it":[{"ty":"sh","nm":"Path","hd":false,"ks":{"a":0,"k":{"c":true,"v":[[19.9563,0.0074],[19.9563,21.0756],[16.2316,24.2399],[12.363,21.1419],[12.363,0.0074],[0.0001,0.0074],[0.0001,21.3332],[15.626,35.6167],[32.3041,21.2671],[32.3041,0.0002],[19.9412,0.0002],[19.9563,0.0074]],"i":[[0,0],[0,0],[1.7942,0],[0,2.3254],[0,0],[0,0],[0,0],[-9.5088,0],[0,9.4413],[0,0],[0,0],[0,0]],"o":[[0,0],[0,2.39161],[-1.79425,0],[0,0],[0,0],[0,0],[0,9.37511],[9.508749999999997,0],[0,0],[0,0],[0,0],[0,0]]}}},{"ty":"fl","o":{"a":0,"k":100},"c":{"a":0,"k":[1,1,1,1]},"nm":"Fill","hd":false,"r":1},{"ty":"tr","a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}}]}]},{"ty":3,"ddd":0,"ind":27,"hd":false,"nm":"Vector - Null","parent":14,"ks":{"a":{"a":0,"k":[0,0]},"o":{"a":1,"k":[{"t":54.6,"s":[0],"o":{"x":[0.5],"y":[0.35]},"i":{"x":[0.15],"y":[1]}},{"t":108,"s":[100]}]},"p":{"a":0,"k":[88.623,0.1502]},"r":{"a":0,"k":0},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0}},"st":0,"ip":0,"op":240,"bm":0,"sr":1},{"ty":4,"ddd":0,"ind":28,"hd":false,"nm":"Vector","parent":27,"ks":{"a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":1,"k":[{"t":54.6,"s":[0],"o":{"x":[0.5],"y":[0.35]},"i":{"x":[0.15],"y":[1]}},{"t":108,"s":[100]}]}},"st":0,"ip":0,"op":240,"bm":0,"sr":1,"shapes":[{"ty":"gr","nm":"Group","hd":false,"np":3,"it":[{"ty":"sh","nm":"Path","hd":false,"ks":{"a":0,"k":{"c":false,"v":[[20.5619,9.5047],[20.5619,0.3283],[3.4144,13.9715],[3.4144,16.1718],[0,16.1718],[0,25.672],[3.4144,25.672],[3.4144,51.0083],[15.7697,51.0083],[15.7697,25.672],[20.5543,25.672],[20.5543,16.1718],[15.7697,16.1718],[15.7697,13.0075],[20.5543,9.5194]],"i":[[0,0],[0,0],[0,-10.5378],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[-3.3917,-0.3238]],"o":[[0,0],[-11.49983,-1.67781],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,-3.1642799999999998],[0,0]]}}},{"ty":"fl","o":{"a":0,"k":100},"c":{"a":0,"k":[1,1,1,1]},"nm":"Fill","hd":false,"r":1},{"ty":"tr","a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}}]}]}]},{"nm":"[FRAME] Logo UniferX - Null / Mark - Null / Mark / Text","fr":60,"id":"lqwldr6amvv38mz5xzq","layers":[{"ty":3,"ddd":0,"ind":29,"hd":false,"nm":"Logo UniferX - Null","ks":{"a":{"a":0,"k":[0,0]},"o":{"a":0,"k":100},"p":{"a":0,"k":[602,356]},"r":{"a":0,"k":0},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0}},"st":0,"ip":0,"op":240,"bm":0,"sr":1},{"ty":3,"ddd":0,"ind":30,"hd":false,"nm":"Mark - Null","parent":29,"ks":{"a":{"a":0,"k":[28.9124,29.7663]},"o":{"a":0,"k":100},"p":{"a":1,"k":[{"t":6,"s":[118.0001,36.2363],"o":{"x":[0.5],"y":[0.35]},"i":{"x":[0.15],"y":[1]},"ti":[0,0],"to":[0,0]},{"t":162,"s":[202.08239999999998,36.2363]}]},"r":{"a":0,"k":0},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0}},"st":0,"ip":0,"op":240,"bm":0,"sr":1},{"ty":4,"ddd":0,"ind":31,"hd":false,"nm":"Mark","parent":30,"ks":{"a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}},"st":0,"ip":0,"op":240,"bm":0,"sr":1,"shapes":[{"ty":"gr","nm":"Group","hd":false,"np":3,"it":[{"ty":"sh","nm":"Path","hd":false,"ks":{"a":0,"k":{"c":false,"v":[[34.8705,29.321],[57.5446,0.6511],[28.8367,21.2336],[0.4694,0.7026],[22.7651,29.3136],[0.0001,58.8812],[28.8368,37.4744],[57.8248,59.0283],[34.863,29.3135]],"i":[[0,0],[-7.9795,2.2591],[4.3001,-16.0569],[15.7848,-3.2084],[-14.4902,-4.327],[10.7655,-3.0686],[-3.967,15.5197],[-15.8605,2.7669],[14.0663,0]],"o":[[13.82403,-3.2452299999999994],[-16.557029999999997,-2.81106],[-4.2622800000000005,-15.79934],[8.5397,2.20764],[-11.17429,0],[16.85229,2.950879999999998],[4.065439999999999,15.497630000000001],[-10.56107,-1.0375900000000016],[0,0]]}}},{"ty":"fl","o":{"a":0,"k":100},"c":{"a":0,"k":[0,1,0,1]},"nm":"Fill","hd":false,"r":1},{"ty":"tr","a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}}]}]},{"ddd":0,"ind":32,"ty":0,"nm":"Text","refId":"lqwldr6djxkcaiduwd","sr":1,"ks":{"a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}},"ao":0,"w":1440,"h":800,"ip":0,"op":240,"st":0,"hd":false,"bm":0}]},{"nm":"Progress","fr":60,"id":"lqwldr6qh5xpu4e8m4","layers":[{"ty":3,"ddd":0,"ind":40,"hd":false,"nm":"Progress - Null","ks":{"a":{"a":0,"k":[0,0]},"o":{"a":0,"k":100},"p":{"a":0,"k":[608,440]},"r":{"a":0,"k":0},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0}},"st":0,"ip":0,"op":240,"bm":0,"sr":1},{"ty":3,"ddd":0,"ind":34,"hd":false,"nm":"Rectangle - Null","parent":40,"ks":{"a":{"a":0,"k":[0,0]},"o":{"a":0,"k":100},"p":{"a":0,"k":[0,0]},"r":{"a":0,"k":0},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0}},"st":0,"ip":0,"op":240,"bm":0,"sr":1},{"ty":4,"ddd":0,"ind":35,"hd":false,"nm":"Rectangle","parent":34,"ks":{"a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}},"st":0,"ip":0,"op":240,"bm":0,"sr":1,"shapes":[{"ty":"gr","nm":"Group","hd":false,"np":3,"it":[{"ty":"sh","nm":"Path","hd":false,"ks":{"a":1,"k":[{"t":0,"s":[{"c":true,"v":[[0,0],[0,0],[0,0],[0,4],[0,4],[0,4],[0,4],[0,0]],"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]}],"o":{"x":[0.3365],"y":[0.2115]},"i":{"x":[0.0237],"y":[0.9808]}},{"t":240,"s":[{"c":true,"v":[[0,0],[224,0],[224,0],[224,4],[224,4],[0,4],[0,4],[0,0]],"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]}]}]}},{"ty":"fl","o":{"a":0,"k":100},"c":{"a":0,"k":[0,1,0,1]},"nm":"Fill","hd":false,"r":1},{"ty":"tr","a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}}]}]},{"ty":4,"ddd":0,"ind":36,"hd":false,"nm":"Progress","parent":40,"ks":{"a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}},"st":0,"ip":0,"op":240,"bm":0,"sr":1,"shapes":[{"ty":"gr","nm":"Group","hd":false,"np":3,"it":[{"ty":"sh","nm":"Path","hd":false,"ks":{"a":0,"k":{"c":true,"v":[[2,0],[222,0],[224,2],[224,2],[222,4],[2,4],[0,2],[0,2],[2,0],[2,0]],"i":[[0,0],[0,0],[0,-1.1046],[0,0],[1.1046,0],[0,0],[0,1.1046],[0,0],[-1.1046,0],[0,0]],"o":[[0,0],[1.1045699999999954,0],[0,0],[0,1.1045699999999998],[0,0],[-1.10457,0],[0,0],[0,-1.10457],[0,0],[0,0]]}}},{"ty":"fl","o":{"a":0,"k":20},"c":{"a":0,"k":[1,1,1,1]},"nm":"Fill","hd":false,"r":1},{"ty":"tr","a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}}]}]}]},{"nm":"Preloader","fr":60,"id":"lqwldr680ead7dvt8bwj","layers":[{"ty":3,"ddd":0,"ind":37,"hd":false,"nm":"Preloader - Null","ks":{"a":{"a":0,"k":[0,0]},"o":{"a":0,"k":100},"p":{"a":0,"k":[0,0]},"r":{"a":0,"k":0},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0}},"st":0,"ip":0,"op":240,"bm":0,"sr":1},{"ddd":0,"ind":38,"ty":0,"nm":"Logo UniferX","refId":"lqwldr6amvv38mz5xzq","sr":1,"ks":{"a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}},"ao":0,"w":1440,"h":800,"ip":0,"op":240,"st":0,"hd":false,"bm":0},{"ty":3,"ddd":0,"ind":39,"hd":false,"nm":"Progress - Null","ks":{"a":{"a":0,"k":[0,0]},"o":{"a":0,"k":100},"p":{"a":0,"k":[608,440]},"r":{"a":0,"k":0},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0}},"st":0,"ip":0,"op":240,"bm":0,"sr":1},{"ty":3,"ddd":0,"ind":40,"hd":false,"nm":"Progress - Null","ks":{"a":{"a":0,"k":[0,0]},"o":{"a":0,"k":100},"p":{"a":0,"k":[608,440]},"r":{"a":0,"k":0},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0}},"st":0,"ip":0,"op":240,"bm":0,"sr":1},{"ddd":0,"ind":41,"ty":0,"nm":"Progress","td":1,"refId":"3567:24596","sr":1,"ks":{"a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}},"ao":0,"w":1440,"h":800,"ip":0,"op":240,"st":0,"hd":false,"bm":0},{"ddd":0,"ind":42,"ty":0,"nm":"Progress","refId":"lqwldr6qh5xpu4e8m4","sr":1,"ks":{"a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}},"ao":0,"w":1440,"h":800,"ip":0,"op":240,"st":0,"hd":false,"bm":0,"tt":1},{"ty":4,"ddd":0,"ind":43,"hd":false,"nm":"Preloader","parent":37,"ks":{"a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}},"st":0,"ip":0,"op":240,"bm":0,"sr":1,"shapes":[{"ty":"gr","nm":"Group","hd":false,"np":3,"it":[{"ty":"sh","nm":"Path","hd":false,"ks":{"a":0,"k":{"c":true,"v":[[0,0],[1440,0],[1440,0],[1440,800],[1440,800],[0,800],[0,800],[0,0]],"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]}}},{"ty":"gf","o":{"a":0,"k":100},"g":{"p":2,"k":{"a":0,"k":[0,0.09803921568627451,0.38823529411764707,0.4196078431372549,1,0,1,0,0,0,1,0.7]}},"s":{"a":0,"k":[722.2154258763405,-0.000003360184469825132]},"e":{"a":0,"k":[722.2154354442332,799.9999966398155]},"t":1,"nm":"Fill","hd":false,"r":1},{"ty":"tr","a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}}]}]},{"ty":4,"ddd":0,"ind":44,"hd":false,"nm":"Preloader","parent":37,"ks":{"a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}},"st":0,"ip":0,"op":240,"bm":0,"sr":1,"shapes":[{"ty":"gr","nm":"Group","hd":false,"np":3,"it":[{"ty":"sh","nm":"Path","hd":false,"ks":{"a":0,"k":{"c":true,"v":[[0,0],[1440,0],[1440,0],[1440,800],[1440,800],[0,800],[0,800],[0,0]],"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]}}},{"ty":"fl","o":{"a":0,"k":100},"c":{"a":0,"k":[0.07058823529411765,0.08235294117647059,0.09019607843137255,1]},"nm":"Fill","hd":false,"r":1},{"ty":"tr","a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}}]}]}]}],"layers":[{"ty":3,"ddd":0,"ind":37,"hd":false,"nm":"Preloader - Null","ks":{"a":{"a":0,"k":[0,0]},"o":{"a":0,"k":100},"p":{"a":0,"k":[0,0]},"r":{"a":0,"k":0},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0}},"st":0,"ip":0,"op":240,"bm":0,"sr":1},{"ddd":0,"ind":2,"ty":0,"nm":"Preloader","refId":"lqwldr680ead7dvt8bwj","sr":1,"ks":{"a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}},"ao":0,"w":1440,"h":800,"ip":0,"op":240,"st":0,"hd":false,"bm":0}],"meta":{"a":"","d":"","tc":"","g":"Aninix"}}'),dv=JSON.parse('{"nm":"Preloader X","v":"5.9.6","fr":60,"ip":0,"op":119,"w":1440,"h":800,"ddd":0,"markers":[],"assets":[{"nm":"Preloader X","fr":60,"id":"lr0iaaxxb3dp9w61bfq","layers":[{"ty":3,"ddd":0,"ind":5,"hd":false,"nm":"Preloader X - Null","ks":{"a":{"a":0,"k":[0,0]},"o":{"a":0,"k":100},"p":{"a":0,"k":[0,0]},"r":{"a":0,"k":0},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0}},"st":0,"ip":0,"op":120,"bm":0,"sr":1},{"ty":3,"ddd":0,"ind":6,"hd":false,"nm":"Mark - Null","parent":5,"ks":{"a":{"a":0,"k":[40,40]},"o":{"a":0,"k":100},"p":{"a":0,"k":[725,405]},"r":{"a":0,"k":0},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0}},"st":0,"ip":0,"op":120,"bm":0,"sr":1},{"ty":4,"ddd":0,"ind":7,"hd":false,"nm":"Mark","parent":6,"ks":{"a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}},"st":0,"ip":0,"op":120,"bm":0,"sr":1,"shapes":[{"ty":"gr","nm":"Group","hd":false,"np":3,"it":[{"ty":"sh","nm":"Path","hd":false,"ks":{"a":1,"k":[{"t":0,"s":[{"c":false,"v":[[47.2127,39.4764],[74.6609,5.7656],[39.9084,29.9671],[5.5682,5.8262],[32.5583,39.4678],[5,74.2342],[39.9084,49.0636],[75,74.4073],[47.2035,39.4678]],"i":[[0,0],[-9.6596,2.6564],[5.2055,-18.8801],[19.1084,-3.7726],[-17.5412,-5.0878],[13.0322,-3.6082],[-4.8023,18.2485],[-19.2,3.2534],[17.028,0]],"o":[[16.73475,-3.8158299999999983],[-20.0432,-3.30532],[-5.159729999999996,-18.57728],[10.337779999999999,2.5958000000000006],[-13.5271,0],[20.40063,3.4697199999999953],[4.921439999999997,18.22253],[-12.784759999999999,-1.2200299999999942],[0,0]]}],"o":{"x":[0.5],"y":[0.35]},"i":{"x":[0.15],"y":[1]}},{"t":60,"s":[{"c":false,"v":[[48.243,39.4016],[79.6124,0.8749],[39.8953,28.5338],[0.6493,0.9442],[31.4952,39.3917],[0,79.1248],[39.8954,50.3583],[80.0001,79.3225],[48.2327,39.3917]],"i":[[0,0],[-11.0395,3.0358],[5.9492,-21.5773],[21.8382,-4.3115],[-20.0471,-5.8146],[14.894,-4.1236],[-5.4884,20.8554],[-21.9429,3.7182],[19.4606,0]],"o":[[19.12542,-4.3609500000000025],[-22.90652,-3.7775100000000004],[-5.896830000000001,-21.23118],[11.81461,2.96663],[-15.45954,0],[23.315,3.9654000000000025],[5.624510000000001,20.825739999999996],[-14.611149999999995,-1.3943199999999933],[0,0]]}],"o":{"x":[0.5],"y":[0.35]},"i":{"x":[0.15],"y":[1]}},{"t":120,"s":[{"c":false,"v":[[47.2127,39.4764],[74.6609,5.7656],[39.9084,29.9671],[5.5682,5.8262],[32.5583,39.4678],[5,74.2342],[39.9084,49.0636],[75,74.4073],[47.2035,39.4678]],"i":[[0,0],[-9.6596,2.6564],[5.2055,-18.8801],[19.1084,-3.7726],[-17.5412,-5.0878],[13.0322,-3.6082],[-4.8023,18.2485],[-19.2,3.2534],[17.028,0]],"o":[[16.73475,-3.8158299999999983],[-20.0432,-3.30532],[-5.159729999999996,-18.57728],[10.337779999999999,2.5958000000000006],[-13.5271,0],[20.40063,3.4697199999999953],[4.921439999999997,18.22253],[-12.784759999999999,-1.2200299999999942],[0,0]]}]}]}},{"ty":"fl","o":{"a":0,"k":100},"c":{"a":0,"k":[0,1,0,1]},"nm":"Fill","hd":false,"r":1},{"ty":"tr","a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}}]}]},{"ty":4,"ddd":0,"ind":8,"hd":false,"nm":"Preloader X","parent":5,"ks":{"a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}},"st":0,"ip":0,"op":120,"bm":0,"sr":1,"shapes":[{"ty":"gr","nm":"Group","hd":false,"np":3,"it":[{"ty":"sh","nm":"Path","hd":false,"ks":{"a":0,"k":{"c":true,"v":[[0,0],[1440,0],[1440,0],[1440,800],[1440,800],[0,800],[0,800],[0,0]],"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]}}},{"ty":"gf","o":{"a":0,"k":100},"g":{"p":2,"k":{"a":0,"k":[0,0.09803921568627451,0.38823529411764707,0.4196078431372549,1,0,1,0,0,0,1,0.699999988079071]}},"s":{"a":0,"k":[722.2154258755136,-0.000003360373182693965]},"e":{"a":0,"k":[722.2154354452384,799.9999966396268]},"t":1,"nm":"Fill","hd":false,"r":1},{"ty":"tr","a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}}]}]},{"ty":4,"ddd":0,"ind":9,"hd":false,"nm":"Preloader X","parent":5,"ks":{"a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}},"st":0,"ip":0,"op":120,"bm":0,"sr":1,"shapes":[{"ty":"gr","nm":"Group","hd":false,"np":3,"it":[{"ty":"sh","nm":"Path","hd":false,"ks":{"a":0,"k":{"c":true,"v":[[0,0],[1440,0],[1440,0],[1440,800],[1440,800],[0,800],[0,800],[0,0]],"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]}}},{"ty":"fl","o":{"a":0,"k":100},"c":{"a":0,"k":[0.07058823529411765,0.08235294117647059,0.09019607843137255,1]},"nm":"Fill","hd":false,"r":1},{"ty":"tr","a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}}]}]}]}],"layers":[{"ty":3,"ddd":0,"ind":5,"hd":false,"nm":"Preloader X - Null","ks":{"a":{"a":0,"k":[0,0]},"o":{"a":0,"k":100},"p":{"a":0,"k":[0,0]},"r":{"a":0,"k":0},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0}},"st":0,"ip":0,"op":120,"bm":0,"sr":1},{"ddd":0,"ind":2,"ty":0,"nm":"Preloader X","refId":"lr0iaaxxb3dp9w61bfq","sr":1,"ks":{"a":{"a":0,"k":[0,0]},"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"r":{"a":0,"k":0},"o":{"a":0,"k":100}},"ao":0,"w":1440,"h":800,"ip":0,"op":120,"st":0,"hd":false,"bm":0}],"meta":{"a":"","d":"","tc":"","g":"Aninix"}}'),pv=e=>{let{main:t=!1}=e;return t?(0,$o.jsx)(hv,{loop:!1,animationData:uv,play:!0,speed:1,className:"preloader",rendererSettings:{preserveAspectRatio:"xMidYMid slice"}}):(0,$o.jsx)(hv,{loop:!0,animationData:dv,play:!0,className:"preloader",rendererSettings:{preserveAspectRatio:"xMidYMid slice"}})},fv=()=>{const e=xs(),i=us(yn),n=us(mn),{fs_title:r,fs_title_background:a,fs_view_button:s,agricultural_tag:o,agricultural_title:l,agricultural_description:c}=us(fn);(0,t.useEffect)((()=>{e(cn())}),[e]);const h=(0,t.useRef)();return xg({items:[".product-card "],container:h,dependencies:[n]}),n?(0,$o.jsx)(pv,{}):(0,$o.jsxs)("div",{ref:h,children:[(0,$o.jsx)(sl,{title:r,image:a,buttonText:s,onClickButton:()=>ja("product-card-container",100)}),(0,$o.jsx)("section",{className:"container",children:(0,$o.jsx)("div",{className:"inner-container type-2",children:(0,$o.jsxs)("div",{className:"main-text-container",children:[(0,$o.jsx)(ll,{children:o}),(0,$o.jsx)(ol,{className:"has-animation",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:l}})}),(0,$o.jsx)("div",{className:"offset-left-4 max-width-760",children:(0,$o.jsx)(ol,{size:"super-small",className:"has-animation",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:c}})})})]})})}),(0,$o.jsx)(tl,{data:i})]})},mv=()=>{const e=xs(),i=us(on);(0,t.useEffect)((()=>{e(rn())}),[e]);const{fs_title:n,fs_view_button:r,fs_title_background:a,agricultural_tag:s,agricultural_title:o,agricultural_description:l,crop_nutrition_programs:c,trial_results:h,information_materials:u}=us(sn),d=[{slug:Xo.cropNutritionPrograms,...c},{slug:Xo.trialResults,...h},{slug:Xo.informationMaterials,...u}],p=(0,t.useRef)();return xg({items:[".product-card"],container:p,dependencies:[i]}),i?(0,$o.jsx)(pv,{}):(0,$o.jsxs)("div",{ref:p,children:[(0,$o.jsx)(sl,{title:n,image:a,buttonText:r,onClickButton:()=>ja("product-card-container",100)}),(0,$o.jsx)("section",{className:"container",children:(0,$o.jsx)("div",{className:"inner-container type-2",children:(0,$o.jsxs)("div",{className:"main-text-container",children:[(0,$o.jsx)(ll,{children:s}),(0,$o.jsx)(ol,{className:"has-animation",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:o}})}),(0,$o.jsx)("div",{className:"offset-left-4 max-width-760",children:(0,$o.jsx)(ol,{size:"super-small",className:"has-animation",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:l}})})})]})})}),(0,$o.jsx)(tl,{data:d})]})};const gv=__webpack_require__.p+"static/media/GoodfaceLogo.d13214ff6ee9bfd14094468112bd4e1c.svg",vv=e=>{let{children:t,pathName:i}=e;const n=Xo[i];return(0,$o.jsx)(Ho,{to:n,className:"button-text",children:t})},yv=()=>{const{menu_logo:e}=us(Pa);return(0,$o.jsx)(Ho,{to:"/",children:(0,$o.jsx)("img",{src:e,alt:"",className:"main-logo-icon"})})};var bv,xv;function wv(){return wv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},wv.apply(this,arguments)}function _v(e,i){let{title:n,titleId:r,...a}=e;return t.createElement("svg",wv({width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",ref:i,"aria-labelledby":r},a),n?t.createElement("title",{id:r},n):null,bv||(bv=t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.81858 6.71713C5.16627 6.40964 5.62012 6.25 6.07692 6.25H17.9231C18.3799 6.25 18.8337 6.40965 19.1814 6.71713C19.5321 7.02724 19.75 7.46906 19.75 7.95238V16.0476C19.75 16.5309 19.5321 16.9728 19.1814 17.2829C18.8337 17.5904 18.3799 17.75 17.9231 17.75H6.07692C5.62012 17.75 5.16626 17.5904 4.81858 17.2829C4.4679 16.9728 4.25 16.5309 4.25 16.0476V7.95238C4.25 7.46906 4.4679 7.02725 4.81858 6.71713ZM6.07692 7.75C5.96249 7.75 5.86851 7.79103 5.81227 7.84077C5.75902 7.88786 5.75 7.93053 5.75 7.95238V16.0476C5.75 16.0695 5.75902 16.1121 5.81227 16.1592C5.86851 16.209 5.96249 16.25 6.07692 16.25H17.9231C18.0375 16.25 18.1315 16.209 18.1877 16.1592C18.241 16.1121 18.25 16.0695 18.25 16.0476V7.95238C18.25 7.93053 18.241 7.88786 18.1877 7.84077C18.1315 7.79103 18.0375 7.75 17.9231 7.75H6.07692Z"})),xv||(xv=t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.35852 7.61139C4.57314 7.25712 5.03433 7.14391 5.3886 7.35854L11.6955 11.1794C11.759 11.2164 11.8658 11.25 12 11.25C12.1342 11.25 12.241 11.2164 12.3044 11.1794L18.6114 7.35854C18.9657 7.14391 19.4268 7.25712 19.6415 7.61139C19.8561 7.96567 19.7429 8.42685 19.3886 8.64147L13.0719 12.4682C12.7474 12.6607 12.3683 12.75 12 12.75C11.6317 12.75 11.2526 12.6607 10.9281 12.4682L10.9221 12.4647L4.61138 8.64147C4.2571 8.42685 4.1439 7.96567 4.35852 7.61139Z"})))}const Sv=t.forwardRef(_v);__webpack_require__.p;var Ev,Cv;function Av(){return Av=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},Av.apply(this,arguments)}function Mv(e,i){let{title:n,titleId:r,...a}=e;return t.createElement("svg",Av({width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",ref:i,"aria-labelledby":r},a),n?t.createElement("title",{id:r},n):null,Ev||(Ev=t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.7852 4.81772C7.13185 4.45773 7.60818 4.25 8.11111 4.25H15.8889C16.3918 4.25 16.8681 4.45773 17.2148 4.81772C17.5605 5.17675 17.75 5.65786 17.75 6.15385V18.8462C17.75 19.3421 17.5605 19.8233 17.2148 20.1823C16.8681 20.5423 16.3918 20.75 15.8889 20.75H8.11111C7.60818 20.75 7.13185 20.5423 6.7852 20.1823C6.43947 19.8233 6.25 19.3421 6.25 18.8462V6.15385C6.25 5.65786 6.43947 5.17675 6.7852 4.81772ZM8.11111 5.75C8.02467 5.75 7.93577 5.7854 7.86568 5.85819C7.79466 5.93194 7.75 6.0378 7.75 6.15385V18.8462C7.75 18.9622 7.79466 19.0681 7.86568 19.1418C7.93577 19.2146 8.02467 19.25 8.11111 19.25H15.8889C15.9753 19.25 16.0642 19.2146 16.1343 19.1418C16.2053 19.0681 16.25 18.9622 16.25 18.8462V6.15385C16.25 6.0378 16.2053 5.93194 16.1343 5.85819C16.0642 5.7854 15.9753 5.75 15.8889 5.75H8.11111Z"})),Cv||(Cv=t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.25 16C10.25 15.5858 10.5858 15.25 11 15.25H13C13.4142 15.25 13.75 15.5858 13.75 16C13.75 16.4142 13.4142 16.75 13 16.75H11C10.5858 16.75 10.25 16.4142 10.25 16Z"})))}const Tv=t.forwardRef(Mv);__webpack_require__.p;var Pv,Dv;function kv(){return kv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},kv.apply(this,arguments)}function Ov(e,i){let{title:n,titleId:r,...a}=e;return t.createElement("svg",kv({width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",ref:i,"aria-labelledby":r},a),n?t.createElement("title",{id:r},n):null,Pv||(Pv=t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 8.75C11.3096 8.75 10.75 9.30964 10.75 10C10.75 10.6904 11.3096 11.25 12 11.25C12.6904 11.25 13.25 10.6904 13.25 10C13.25 9.30964 12.6904 8.75 12 8.75ZM9.25 10C9.25 8.48122 10.4812 7.25 12 7.25C13.5188 7.25 14.75 8.48122 14.75 10C14.75 11.5188 13.5188 12.75 12 12.75C10.4812 12.75 9.25 11.5188 9.25 10Z"})),Dv||(Dv=t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 4.75C10.6138 4.75 9.28047 5.3146 8.29436 6.32599C7.30762 7.33804 6.75 8.71462 6.75 10.1538C6.75 12.6596 8.11544 14.9508 9.57207 16.6688C10.292 17.5179 11.0136 18.2028 11.5554 18.6751C11.7232 18.8214 11.8733 18.9469 12 19.05C12.1267 18.9469 12.2768 18.8214 12.4446 18.6751C12.9864 18.2028 13.708 17.5179 14.4279 16.6688C15.8846 14.9508 17.25 12.6596 17.25 10.1538C17.25 8.71462 16.6924 7.33804 15.7056 6.32599C14.7195 5.3146 13.3862 4.75 12 4.75ZM12 20C11.5626 20.6092 11.5624 20.6091 11.5622 20.6089L11.5616 20.6085L11.56 20.6074L11.5553 20.604L11.5395 20.5924C11.5261 20.5826 11.5072 20.5687 11.4831 20.5506C11.435 20.5146 11.3661 20.4622 11.2795 20.3944C11.1063 20.2586 10.8618 20.0604 10.5696 19.8057C9.98636 19.2972 9.20803 18.559 8.42793 17.6389C6.88456 15.8185 5.25 13.1866 5.25 10.1538C5.25 8.32887 5.95667 6.57494 7.22036 5.27884C8.48468 3.9821 10.2036 3.25 12 3.25C13.7964 3.25 15.5153 3.9821 16.7796 5.27884C18.0433 6.57494 18.75 8.32887 18.75 10.1538C18.75 13.1866 17.1154 15.8185 15.5721 17.6389C14.792 18.559 14.0136 19.2972 13.4304 19.8057C13.1382 20.0604 12.8937 20.2586 12.7205 20.3944C12.6339 20.4622 12.565 20.5146 12.5169 20.5506C12.4928 20.5687 12.4739 20.5826 12.4605 20.5924L12.4447 20.604L12.44 20.6074L12.4384 20.6085L12.4378 20.6089C12.4376 20.6091 12.4374 20.6092 12 20ZM12 20L12.4374 20.6092L12 20.9233L11.5626 20.6092L12 20Z"})))}const Iv=t.forwardRef(Ov),Rv=(__webpack_require__.p,()=>{const e=us(yn),{footer_description_text:t,menu_company_text:i,menu_about_text:n,menu_news_text:r,menu_career_text:a,menu_contacts_text:s,menu_products_text:o,menu_resources_text:l,menu_crop_nutrition_text:c,menu_trial_results_text:h,menu_information_materials_text:u,footer_social_media_text:d,footer_contacts_email_text:p,footer_contacts_phone_text:f,footer_contacts_address_text:m,footer_copyright_text:g,footer_terms_conditions_text:v,footer_legal_info_text:y,footer_instagram_link:b,footer_facebook_link:x,footer_youtube_link:w}=us(Pa),_=()=>(0,$o.jsxs)("div",{className:"new-footer-start",children:[(0,$o.jsx)(yv,{}),(0,$o.jsx)("p",{className:"description-medium",children:t})]}),S=()=>(0,$o.jsxs)("div",{className:"footer-links-block",children:[(0,$o.jsx)("div",{className:"footer-title",children:i}),(0,$o.jsx)(vv,{pathName:"aboutUs",children:n}),(0,$o.jsx)(vv,{pathName:"news",children:r}),(0,$o.jsx)(vv,{pathName:"career",children:a}),(0,$o.jsx)(vv,{pathName:"contacts",children:s})]}),E=()=>(0,$o.jsxs)("div",{className:"footer-links-block",children:[(0,$o.jsx)("div",{className:"footer-title",children:o}),e.map((e=>(0,$o.jsx)(Ho,{to:Xo.products+"/"+e.slug,className:"button-text",children:e.preview_title},e.slug)))]}),C=()=>(0,$o.jsxs)("div",{className:"footer-links-block",children:[(0,$o.jsx)("div",{className:"footer-title",children:l}),(0,$o.jsx)(vv,{pathName:"cropNutritionPrograms",children:c}),(0,$o.jsx)(vv,{pathName:"trialResults",children:h}),(0,$o.jsx)(vv,{pathName:"informationMaterials",children:u})]}),A=()=>(0,$o.jsxs)("div",{children:[(0,$o.jsx)("div",{className:"footer-title",children:d}),(0,$o.jsxs)("div",{className:"footer-social",children:[(0,$o.jsx)(Ho,{target:"_blank",to:b,className:"button instagram"}),(0,$o.jsx)(Ho,{target:"_blank",to:x,className:"button facebook"}),(0,$o.jsx)(Ho,{target:"_blank",to:w,className:"button youtube"})]})]}),M=()=>(0,$o.jsxs)("div",{className:"footer-links-block",children:[(0,$o.jsx)("div",{className:"footer-title",children:s}),(0,$o.jsxs)("a",{href:"mailto:".concat(p),className:"footer-contact-link",children:[(0,$o.jsx)(Sv,{}),(0,$o.jsx)("span",{children:p})]}),(0,$o.jsxs)("a",{href:"tel:".concat(f),className:"footer-contact-link",children:[(0,$o.jsx)(Tv,{}),(0,$o.jsx)("span",{children:f})]}),(0,$o.jsxs)("a",{href:"/#",className:"footer-contact-link",children:[(0,$o.jsx)(Iv,{}),(0,$o.jsx)("span",{children:m})]})]}),T=()=>(0,$o.jsxs)("div",{className:"footer-copy",children:[(0,$o.jsx)("p",{className:"copyright",children:g}),(0,$o.jsxs)("div",{className:"policies",children:[(0,$o.jsx)(vv,{pathName:"termsAndConditions",children:v}),(0,$o.jsx)(vv,{pathName:"legalInfo",children:y})]}),(0,$o.jsxs)("div",{className:"goodface-bar",children:[(0,$o.jsx)("span",{className:"body1",children:"Created by"}),(0,$o.jsxs)("a",{href:"https://goodface.agency",target:"_blank",rel:"noreferrer",className:"goodface-link",children:[(0,$o.jsx)("span",{children:"Goodface"}),(0,$o.jsx)("img",{src:gv,alt:"Goodface logo"})]})]})]});return(0,$o.jsx)("footer",{className:"container",children:(0,$o.jsxs)("div",{className:"new-footer",children:[(0,$o.jsxs)("div",{className:"new-footer-row",children:[(0,$o.jsx)(_,{}),(0,$o.jsx)(S,{}),(0,$o.jsx)(E,{}),(0,$o.jsx)(C,{})]}),(0,$o.jsxs)("div",{className:"new-footer-row",children:[(0,$o.jsx)("div",{}),(0,$o.jsx)(A,{}),(0,$o.jsx)(M,{})]}),(0,$o.jsx)(T,{})]})})}),Lv=e=>{const[i,n]=(0,t.useState)(!1);return(0,t.useEffect)((()=>{const t=window.matchMedia("(".concat(e,")"));t.matches!==i&&n(t.matches);const r=()=>n(t.matches);return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)}),[i,e]),i};var Bv;function zv(){return zv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},zv.apply(this,arguments)}function Nv(e,i){let{title:n,titleId:r,...a}=e;return t.createElement("svg",zv({width:18,height:18,viewBox:"0 0 18 18",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",ref:i,"aria-labelledby":r},a),n?t.createElement("title",{id:r},n):null,Bv||(Bv=t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.00001 1.29291L16.7071 9.00001L9.00001 16.7071L7.5858 15.2929L12.8787 10H1.29291V8.00001H12.8787L7.5858 2.70712L9.00001 1.29291Z"})))}const Fv=t.forwardRef(Nv),jv=(__webpack_require__.p,e=>{let{item:t}=e;return(0,$o.jsxs)(Ho,{className:"header-navigation-card",to:t.link,children:[(0,$o.jsx)("span",{className:"header-navigation-card__icons",children:t.icons.map(((e,t)=>(0,$o.jsx)("img",{src:e,alt:"icon"},t)))}),(0,$o.jsxs)("span",{className:"header-navigation-card__title",children:[t.name,(0,$o.jsx)(Fv,{})]})]})}),Vv=e=>{let{items:i,button:n}=e;const r=fo(),[a,s]=(0,t.useState)(!1);(0,t.useEffect)((()=>{s(!0);const e=setTimeout((()=>{s(!1)}),50);return()=>clearTimeout(e)}),[r]);const o=a?{display:"none"}:null;return(0,$o.jsxs)("div",{className:"navigation-item__dropdown",style:o,children:[(0,$o.jsx)("div",{className:"navigation-item__dropdown-items",children:i.map((e=>(0,$o.jsx)(jv,{item:e},e.link)))}),n&&(0,$o.jsx)("div",{className:"navigation-item__dropdown-button",children:(0,$o.jsx)(al,{href:n.link,type:"learn-more-arrow white-text",children:n.name})})]})};var Uv;function Gv(){return Gv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},Gv.apply(this,arguments)}function Hv(e,i){let{title:n,titleId:r,...a}=e;return t.createElement("svg",Gv({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 16 16",fill:"currentColor",ref:i,"aria-labelledby":r},a),n?t.createElement("title",{id:r},n):null,Uv||(Uv=t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.51978 6.57616L2.48005 5.42383L7.99991 10.0237L13.5198 5.42383L14.4801 6.57616L7.99991 11.9763L1.51978 6.57616Z"})))}const Wv=t.forwardRef(Hv),qv=(__webpack_require__.p,e=>{let{name:t,link:i,hasList:n,onClickMobile:r,mobileClassName:a=""}=e;return n?(0,$o.jsxs)("div",{className:"navigation-item__name ".concat(a),onClick:()=>r(t),children:[(0,$o.jsx)("span",{children:t}),n&&(0,$o.jsx)(Wv,{className:"navigation-item__name-arrow"})]}):(0,$o.jsx)(Ho,{to:i,className:"navigation-item__name",children:(0,$o.jsx)("span",{children:t})})}),Xv=e=>{var t;let{category:i,mobileState:n,onClick:r}=e;const a=xs(),s=null===(t=n.find((e=>e.name===i.name)))||void 0===t?void 0:t.isOpen;return(0,$o.jsxs)("div",{className:"navigation-item",onMouseOver:()=>a(qa(!0)),onMouseLeave:()=>a(qa(!1)),children:[(0,$o.jsx)(qv,{mobileClassName:s?"opened":"",onClickMobile:r,link:i.link,name:i.name,hasList:!!i.items}),i.items&&(0,$o.jsx)(Vv,{button:i.button,items:i.items})]})},Yv=()=>{const{footer_instagram_link:e,footer_facebook_link:t,footer_youtube_link:i}=us(Pa);return(0,$o.jsxs)("div",{className:"social-media-section",children:[(0,$o.jsx)("p",{children:"We're on social media"}),(0,$o.jsxs)("div",{className:"social-media-wrapper",children:[(0,$o.jsx)(Ho,{target:"_blank",to:e,className:"button instagram"}),(0,$o.jsx)(Ho,{target:"_blank",to:t,className:"button facebook"}),(0,$o.jsx)(Ho,{target:"_blank",to:i,className:"button youtube"})]})]})};const Qv=__webpack_require__.p+"static/media/variant1.64445f5f4ad5602ca6f8f608ae4ccd6b.svg";const Zv=__webpack_require__.p+"static/media/variant2.ab39f172278087a342a22625bcdfb611.svg";const Kv=__webpack_require__.p+"static/media/variant3.a0f5c767658cfe200b15a8430a9501f4.svg";const Jv=__webpack_require__.p+"static/media/variant4.a967d1c3055e1e96dfb1683193604458.svg";const $v=__webpack_require__.p+"static/media/variant5.eeb9b8e215af824a0b7b0207d13c6f69.svg";const ey=__webpack_require__.p+"static/media/variant6.5023db131f46ab9963fed588dea09c3b.svg";const ty=__webpack_require__.p+"static/media/variant7.df06ba0f50204170b7028a809458d263.svg";const iy=__webpack_require__.p+"static/media/variant8.10e57877d5c7fdd6232db935bd9a5da9.svg",ny=()=>{const e=Lv("max-width: 1023px"),i=us(yn),n=fo(),{menu_company_text:r,menu_products_text:a,menu_resources_text:s,menu_contacts_text:o,menu_about_text:l,menu_news_text:c,menu_career_text:h,menu_all_products_btn:u,menu_crop_nutrition_text:d,menu_trial_results_text:p,menu_information_materials_text:f,menu_all_resources_btn:m}=us(Pa),g=i.map((e=>({icons:[e.logo],name:e.preview_title,link:Xo.products+"/"+e.slug}))),v=(e=>{const{menu_company_text:t,menu_products_text:i,menu_resources_text:n,menu_contacts_text:r,menu_about_text:a,menu_news_text:s,menu_career_text:o,menu_all_products_btn:l,menu_crop_nutrition_text:c,menu_trial_results_text:h,menu_information_materials_text:u,menu_all_resources_btn:d,formated_products:p}=e;return[{id:1,name:t,items:[{name:a,link:Xo.aboutUs,icons:[Qv]},{name:s,link:Xo.news,icons:[iy,Zv,ty]},{name:o,link:Xo.career,icons:[Kv]}]},{id:2,name:i,button:{name:l,link:Xo.products},items:p},{id:3,name:n,button:{name:d,link:Xo.resources},items:[{icons:[Jv],name:c,link:Xo.cropNutritionPrograms},{icons:[$v],name:h,link:Xo.trialResults},{icons:[ey],name:u,link:Xo.informationMaterials}]},{id:4,name:r,link:Xo.contacts}]})({menu_company_text:r,menu_products_text:a,menu_resources_text:s,menu_contacts_text:o,menu_about_text:l,menu_news_text:c,menu_career_text:h,menu_all_products_btn:u,menu_crop_nutrition_text:d,menu_trial_results_text:p,menu_information_materials_text:f,menu_all_resources_btn:m,formated_products:g}),y=v.filter((e=>!!e.items)).map((e=>({name:e.name,isOpen:!1}))),[b,x]=(0,t.useState)(y),w=e=>{const t=b.map((t=>({...t,isOpen:t.name===e&&!t.isOpen})));x(t)};return(0,t.useEffect)((()=>{x(y)}),[n]),(0,$o.jsxs)("div",{className:"header-nav",children:[v.map((e=>(0,$o.jsx)(Xv,{category:e,mobileState:b,onClick:w},e.id))),e&&(0,$o.jsx)(Yv,{})]})},ry=e=>{let{label:i="",options:n=[],onChange:r,selectedValue:a}=e;const{dropdown_not_selected_text:s}=us(Pa),[o,l]=(0,t.useState)(!1),c=(0,t.useRef)(null);(0,t.useEffect)((()=>{const e=e=>{c.current&&!c.current.contains(e.target)&&l(!1)};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}}),[]);return(0,$o.jsxs)("label",{className:"new-dropdown form-control-container",children:[i&&(0,$o.jsx)("div",{className:"form-control__label",children:i}),(0,$o.jsxs)("div",{className:"select-input ".concat(o?"-active":""," ").concat(a?"-selected":""),ref:c,children:[(0,$o.jsx)("div",{className:"--dropdown__value",onClick:()=>{l(!o)},children:(0,$o.jsx)("span",{className:"--dropdown__value-text body1",children:null!==a&&void 0!==a&&a.name?(0,$o.jsxs)("div",{className:"selected-item",children:[(null===a||void 0===a?void 0:a.icon)&&(0,$o.jsx)("img",{src:null===a||void 0===a?void 0:a.icon,alt:null===a||void 0===a?void 0:a.name}),null===a||void 0===a?void 0:a.name]}):(0,$o.jsx)("div",{children:s})})}),(0,$o.jsx)("ul",{children:n.filter((e=>(null===e||void 0===e?void 0:e.name)!==(null===a||void 0===a?void 0:a.name)&&!(null===e||void 0===e||!e.name))).map((e=>(0,$o.jsxs)("li",{className:"body1",onClick:()=>{return t=e,l(!1),void r(t);var t},children:[(null===e||void 0===e?void 0:e.icon)&&(0,$o.jsx)("img",{src:null===e||void 0===e?void 0:e.icon,alt:e.name}),e.name]},e.name)))})]})]})};var ay;function sy(){return sy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},sy.apply(this,arguments)}function oy(e,i){let{title:n,titleId:r,...a}=e;return t.createElement("svg",sy({width:20,height:20,viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",ref:i,"aria-labelledby":r},a),n?t.createElement("title",{id:r},n):null,ay||(ay=t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.5304 2.53044L19.0608 2.00011L18.0001 0.939453L17.4698 1.46978L10.0001 8.93945L2.53044 1.46978L2.00011 0.939453L0.939453 2.00011L1.46978 2.53044L8.93945 10.0001L1.46978 17.4698L0.939453 18.0001L2.00011 19.0608L2.53044 18.5304L10.0001 11.0608L17.4698 18.5304L18.0001 19.0608L19.0608 18.0001L18.5304 17.4698L11.0608 10.0001L18.5304 2.53044Z"})))}const ly=t.forwardRef(oy);__webpack_require__.p;var cy,hy;function uy(){return uy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},uy.apply(this,arguments)}function dy(e,i){let{title:n,titleId:r,...a}=e;return t.createElement("svg",uy({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",ref:i,"aria-labelledby":r},a),n?t.createElement("title",{id:r},n):null,cy||(cy=t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 4.25C7.27208 4.25 4.25 7.27208 4.25 11C4.25 14.7279 7.27208 17.75 11 17.75C14.7279 17.75 17.75 14.7279 17.75 11C17.75 7.27208 14.7279 4.25 11 4.25ZM2.75 11C2.75 6.44365 6.44365 2.75 11 2.75C15.5563 2.75 19.25 6.44365 19.25 11C19.25 15.5563 15.5563 19.25 11 19.25C6.44365 19.25 2.75 15.5563 2.75 11Z"})),hy||(hy=t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.3048 15.2432L21.1155 20.0538L20.0548 21.1145L15.2441 16.3038L16.3048 15.2432Z"})))}const py=t.forwardRef(dy);__webpack_require__.p;var fy,my,gy;function vy(){return vy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},vy.apply(this,arguments)}function yy(e,i){let{title:n,titleId:r,...a}=e;return t.createElement("svg",vy({width:24,height:24,viewBox:"0 0 24 24",stroke:"currentColor",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:i,"aria-labelledby":r},a),n?t.createElement("title",{id:r},n):null,fy||(fy=t.createElement("path",{d:"M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),my||(my=t.createElement("path",{d:"M8.25 12.0001C8.25 15.512 9.49969 18.6489 11.4637 20.7648C11.532 20.839 11.6149 20.8983 11.7072 20.9388C11.7995 20.9793 11.8992 21.0002 12 21.0002C12.1008 21.0002 12.2005 20.9793 12.2928 20.9388C12.3851 20.8983 12.468 20.839 12.5363 20.7648C14.5003 18.6489 15.75 15.512 15.75 12.0001C15.75 8.48824 14.5003 5.35137 12.5363 3.23543C12.468 3.16122 12.3851 3.10197 12.2928 3.06145C12.2005 3.02092 12.1008 3 12 3C11.8992 3 11.7995 3.02092 11.7072 3.06145C11.6149 3.10197 11.532 3.16122 11.4637 3.23543C9.49969 5.35137 8.25 8.48824 8.25 12.0001Z",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),gy||(gy=t.createElement("path",{d:"M3 12H21",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})))}const by=t.forwardRef(yy),xy=(__webpack_require__.p,e=>({close:(0,$o.jsx)(ly,{}),search:(0,$o.jsx)(py,{}),globe:(0,$o.jsx)(by,{})}[e])),wy=e=>{let{onClick:t,size:i="",iconName:n="close",text:r=""}=e;const a="header-button header-button-".concat(n," header-button--").concat(i);return(0,$o.jsxs)("button",{className:a,onClick:t,children:[xy(n),r&&(0,$o.jsx)("span",{children:r})]})},_y=e=>{let{onClose:i}=e;const n=xs(),{country:r,language:a,languages:s,countries:o}=us(hr),{menu_change_country_text:l,menu_choose_country_text:c,menu_available_languages_text:h,menu_save_choice_text:u}=us(Pa),[d,p]=t.useState({language:a,country:r}),f=go();return(0,$o.jsxs)("div",{className:"country-selector-popup",children:[(0,$o.jsx)("div",{className:"country-selector-popup__title",children:l}),(0,$o.jsx)(wy,{onClick:i,size:"small"}),(0,$o.jsxs)("div",{className:"country-selector-controls",children:[(0,$o.jsx)(ry,{label:c,selectedValue:d.country,options:o,onChange:e=>p({...d,country:e})}),(0,$o.jsx)(ry,{label:h,selectedValue:d.language,options:s,onChange:e=>p({...d,language:e})}),(0,$o.jsx)(al,{onClick:()=>{n(gr(d.language)),n(vr(d.country)),i(),f(0)},type:"default",children:u})]})]})},Sy=e=>{let{isOpen:i,setIsOpen:n}=e;const{menu_change_country_text:r}=us(Pa),a=(0,t.useRef)(null),s=()=>n(!i);return(0,t.useEffect)((()=>{const e=e=>{const t=e.target.matches("li.body1");!a.current||a.current.contains(e.target)||t||n(!1)};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}}),[]),(0,$o.jsxs)("div",{ref:a,className:"country-selector-container",children:[(0,$o.jsx)(wy,{iconName:"globe",text:r,onClick:s}),i&&(0,$o.jsx)(_y,{onClose:s})]})},Ey=e=>{let{value:t,onClear:i,onChange:n,inputRef:r}=e;const{menu_search_placeholder:a,menu_clear_button_text:s}=us(Pa);return(0,$o.jsxs)("label",{className:"search-control",children:[(0,$o.jsx)(py,{}),(0,$o.jsx)("input",{ref:r,value:t,onChange:n,type:"text",placeholder:a,className:"body1 search-control__input"}),!!t&&(0,$o.jsxs)("button",{className:"search-control__clear",onClick:i,children:[(0,$o.jsx)("span",{children:s}),(0,$o.jsx)(ly,{})]})]})},Cy=e=>{let{title:t,slug:i,img:n,desc:r}=e;return(0,$o.jsxs)(Ho,{to:i,className:"result-item-card",children:[n&&(0,$o.jsx)("img",{src:n,alt:t}),(0,$o.jsxs)("div",{className:"result-item-card__desc",children:[(0,$o.jsx)("p",{children:t}),(0,$o.jsx)("p",{children:r})]}),(0,$o.jsx)("div",{className:"learn-more-arrow",children:(0,$o.jsx)("div",{})})]})},Ay=e=>{let{data:t,title:i,children:n,link:r,linkText:a}=e;return!!t.length&&(0,$o.jsxs)("div",{className:"result-category-block",children:[(0,$o.jsx)("div",{className:"result-category-block__title",children:i}),(0,$o.jsx)("div",{className:"result-category-block__content",children:n}),r&&(0,$o.jsx)(al,{href:r,type:"learn-more-arrow",className:"result-category-block__button",children:a})]})};const My=__webpack_require__.p+"static/media/pdf.97f7accb812c1c2a1929e053064cde0e.svg",Ty=()=>{const e=us(Ba),t=us(za),{menu_search_results_text:i,menu_search_not_found_text:n,menu_search_products_text:r,menu_search_all_products_text:a,menu_search_resources_text:s,menu_search_all_resources_text:o,menu_search_nutrition_programs_text:l,menu_search_all_nutrition_programs_text:c,menu_search_trial_results_text:h,menu_search_all_trial_results_text:u,menu_search_posts_text:d,menu_search_all_posts_text:p,menu_search_vacancies_text:f,menu_search_all_vacancies_text:m,menu_crop_nutrition_text:g,menu_information_materials_text:v,menu_trial_results_text:y,menu_career_text:b}=us(Pa),{products:x,cropsNutrition:w,cropsTrials:_,posts:S,catalogs:E,vacancies:C,flyers:A}=e,M=!(null!==x&&void 0!==x&&x.length)&&!(null!==w&&void 0!==w&&w.length)&&!(null!==_&&void 0!==_&&_.length)&&!(null!==S&&void 0!==S&&S.length)&&!(null!==E&&void 0!==E&&E.length)&&!(null!==A&&void 0!==A&&A.length)&&!(null!==C&&void 0!==C&&C.length),T=M&&t?n:t&&!M?i:"Searching...",P=[...E,...A];return(0,$o.jsxs)("div",{className:"search-results",children:[(0,$o.jsx)("div",{className:"search-results-title",children:T}),(0,$o.jsxs)("div",{className:"search-results-content",children:[(0,$o.jsx)(Ay,{data:x,title:r,link:Xo.products,linkText:a,children:x.map((e=>{let{slug:t,preview_title:i,logo:n}=e;return(0,$o.jsx)(Cy,{title:i,slug:Xo.products+"/"+t,img:n,desc:r},t)}))}),(0,$o.jsx)(Ay,{data:w,title:l,link:Xo.cropNutritionPrograms,linkText:c,children:w.map((e=>{let{icon:t,slug:i,title:n}=e;return(0,$o.jsx)(Cy,{title:n,slug:Xo.cropNutritionPrograms+"/"+i,img:t,desc:g},i)}))}),(0,$o.jsx)(Ay,{data:_,title:h,link:Xo.trialResults,linkText:u,children:_.map((e=>{let{icon:t,slug:i,title:n}=e;return(0,$o.jsx)(Cy,{title:n,slug:Xo.trialResults+"/"+i,img:t,desc:y},i)}))}),(0,$o.jsx)(Ay,{data:S,title:d,link:Xo.news,linkText:p,children:S.map((e=>{let{slug:t,title:i,title_background:n,type:r}=e;return(0,$o.jsx)(Cy,{title:i,slug:Xo.news+"/"+t,img:n,desc:r},t)}))}),(0,$o.jsx)(Ay,{data:C,title:f,link:Xo.career,linkText:m,children:C.map((e=>{let{slug:t,title:i,title_background:n}=e;return(0,$o.jsx)(Cy,{title:i,slug:Xo.career+"/"+t,img:n,desc:b},t)}))}),(0,$o.jsxs)(Ay,{data:P,title:s,link:Xo.informationMaterials,linkText:o,children:[null===E||void 0===E?void 0:E.map((e=>{let{id:t,title:i,image:n}=e;return(0,$o.jsx)(Cy,{title:i,slug:Xo.informationMaterials,img:n,desc:v},t)})),null===A||void 0===A?void 0:A.map(((e,t)=>{let{title:i}=e;return(0,$o.jsx)(Cy,{title:i,slug:Xo.informationMaterials,img:My,desc:v},t)}))]})]})]})},Py=(e,i)=>{const[n,r]=(0,t.useState)(e);return(0,t.useEffect)((()=>{const t=setTimeout((()=>r(e)),i||500);return()=>{clearTimeout(t)}}),[e,i]),n},Dy=()=>{const e=xs(),[i,n]=(0,t.useState)(""),r=Py(i),a=(0,t.useRef)(null);return(0,t.useEffect)((()=>{a&&a.current.focus()}),[]),(0,t.useEffect)((()=>{r&&e(Ia({search:r}))}),[e,r]),(0,$o.jsxs)("div",{className:"search-component",children:[(0,$o.jsx)(Ey,{inputRef:a,value:i,onClear:()=>{n(""),e(Na())},onChange:e=>n(e.target.value)}),!!i&&(0,$o.jsx)(Ty,{})]})},ky=e=>{let{isOpen:i,setIsOpen:n}=e;const r=xs(),a=fo();return(0,t.useEffect)((()=>{n(!1),r(Na())}),[r,a,n]),(0,$o.jsxs)("div",{className:"search-container",children:[(0,$o.jsx)(wy,{iconName:i?"close":"search",onClick:()=>{n(!i),!1===i&&r(Na())}}),i&&(0,$o.jsx)("div",{className:"search-dropdown ".concat(i?"opened":""),children:(0,$o.jsx)(Dy,{})})]})},Oy=()=>(0,$o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"56",height:"40",viewBox:"0 0 56 40",fill:"none",children:[(0,$o.jsx)("line",{x1:"16",y1:"15.25",x2:"41",y2:"15.25",stroke:"white",strokeWidth:"1.5"}),(0,$o.jsx)("line",{x1:"16",y1:"23.25",x2:"41",y2:"23.25",stroke:"white",strokeWidth:"1.5"})]}),Iy=()=>{const e=fo(),[i,n]=t.useState(!1),[r,a]=t.useState(!1),[s,o]=t.useState(!1),l=()=>n(!i),c=us(Ga);return t.useEffect((()=>{n(!1)}),[e]),t.useEffect((()=>{s&&(a(!1),n(!1))}),[s]),t.useEffect((()=>{r&&(o(!1),n(!1))}),[r]),t.useEffect((()=>{c&&(o(!1),a(!1))}),[c]),t.useEffect((()=>{i&&(o(!1),a(!1))}),[i]),(0,$o.jsxs)($o.Fragment,{children:[!!i&&(0,$o.jsx)("div",{className:"overlay",onClick:l}),(0,$o.jsx)("header",{children:(0,$o.jsx)("div",{className:"container",children:(0,$o.jsx)("div",{className:"header ".concat(i?"mobile-menu-isOpen":""),children:(0,$o.jsxs)("div",{className:"header__main",children:[(0,$o.jsx)("div",{className:"header-logo",children:(0,$o.jsx)(yv,{})}),(0,$o.jsx)(ny,{}),(0,$o.jsxs)("div",{className:"header-finish",children:[(0,$o.jsx)(Sy,{isOpen:r,setIsOpen:a}),(0,$o.jsx)(ky,{isOpen:s,setIsOpen:o}),(0,$o.jsx)("button",{className:"burger-button",onClick:l,children:(0,$o.jsx)(Oy,{})})]})]})})})})]})},Ry=()=>{const{language:e}=us(fr);return(0,$o.jsxs)($o.Fragment,{children:[(0,$o.jsx)(Iy,{}),(0,$o.jsx)("main",{className:"lang-"+(null===e||void 0===e?void 0:e.code),children:(0,$o.jsx)(Oo,{})}),(0,$o.jsx)(Rv,{})]})},Ly=e=>{let{Sidebar:t,children:i,mobileReversed:n=!1,containerType:r="",breakpoint:a="xl"}=e;return(0,$o.jsx)("div",{className:"inner-container ".concat(r),children:(0,$o.jsxs)("div",{className:"with-sidebar-layout ".concat(n?"mobile-reverse":""," ").concat(a),children:[(0,$o.jsx)("div",{className:"with-sidebar-layout__left",children:t}),(0,$o.jsx)("div",{className:"with-sidebar-layout__right",children:i})]})})},By=e=>{let{sidebar:t,children:i,className:n=""}=e;return(0,$o.jsx)("section",{className:"container form-section ".concat(n),children:(0,$o.jsx)(Ly,{Sidebar:t,breakpoint:"lg",children:i})})},zy=e=>{let{children:t}=e;return(0,$o.jsxs)("div",{className:"new-form-sidebar",children:[(0,$o.jsx)("div",{className:"new-form-sidebar-inner",children:t}),(0,$o.jsx)("div",{className:"new-form-sidebar__gradient"})]})},Ny=()=>{const{cta_tag:e,cta_title:t,cta_image:i}=us(Pa);return(0,$o.jsxs)(zy,{children:[(0,$o.jsx)(ll,{children:e}),(0,$o.jsx)("div",{className:"pb-24",children:(0,$o.jsx)(ol,{size:"middle",textColor:"white",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:t}})})}),(0,$o.jsx)("img",{src:i,alt:""})]})},Fy=e=>/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(e),jy=e=>{let{value:i,onChange:n,label:r,placeholder:a,required:s=!1,type:o,className:l=""}=e;const{cta_required_error:c,cta_invalid_error:h}=us(Pa),[u,d]=(0,t.useState)("");return(0,$o.jsx)("div",{className:"form-control-container ".concat(l),children:(0,$o.jsxs)("label",{className:"form-control ".concat(u?"invalid":""),children:[r&&(0,$o.jsxs)("span",{className:"form-control__label",children:[r,s?"*":""]}),(0,$o.jsx)("input",{onBlur:()=>{s&&d(""===i?c:""),"email"===o&&d(Fy(i)?"":h)},type:"text",placeholder:a,value:i,onChange:e=>n(e.target.value),className:"form-control__input"}),u&&(0,$o.jsx)("div",{className:"invalid-text",children:u})]})})},Vy=e=>{let{value:t,onChange:i,label:n,placeholder:r}=e;return(0,$o.jsx)("div",{className:"form-control-container",children:(0,$o.jsxs)("label",{className:"form-control",children:[(0,$o.jsx)("span",{className:"form-control__label",children:n}),(0,$o.jsx)("textarea",{className:"form-control__textarea",value:t,onChange:e=>i(e.target.value),placeholder:r})]})})},Uy=e=>{let{checked:t,onChange:i,children:n}=e;return(0,$o.jsxs)("div",{className:"checkbox-container",children:[(0,$o.jsx)("div",{className:"checkbox",children:(0,$o.jsx)("input",{className:t?"checked":"",type:"checkbox",checked:t,onChange:i})}),(0,$o.jsx)("div",{className:"checkbox-label",children:n})]})},Gy=e=>{let{onClick:t,disabled:i=!1}=e;const{cta_submit_button:n}=us(Pa);return(0,$o.jsx)("button",{className:"button-submit",onClick:t,disabled:i,children:n})},Hy=()=>{const{cta_thanks_title:e,cta_thanks_description:t,cta_thanks_image:i,cta_thanks_social_text:n,footer_instagram_link:r,footer_facebook_link:a,footer_youtube_link:s}=us(Pa);return(0,$o.jsx)("div",{className:"thankyou-container",children:(0,$o.jsx)("div",{className:"thankyou-wrapper",style:{backgroundImage:'url("'.concat(i,'")')},children:(0,$o.jsxs)("div",{className:"thankyou-background",children:[(0,$o.jsx)("h3",{children:e}),(0,$o.jsx)("p",{className:"body1",children:t}),(0,$o.jsx)("div",{className:"thankyou-bottom-wrapper",children:(0,$o.jsxs)("div",{className:"thankyou-background-bottom",children:[(0,$o.jsx)("p",{className:"body1",children:n}),(0,$o.jsxs)("div",{className:"social-buttons",children:[(0,$o.jsx)(Ho,{target:"_blank",to:r,className:"button instagram"}),(0,$o.jsx)(Ho,{target:"_blank",to:a,className:"button facebook"}),(0,$o.jsx)(Ho,{target:"_blank",to:s,className:"button youtube"})]})]})})]})})})},Wy="feedback",qy=e=>{let{name:t,activeType:i,type:n,onClick:r}=e;return(0,$o.jsx)("button",{className:"form-type-change__item ".concat(i===n?"active":""),onClick:()=>r(n),children:t})},Xy=e=>{let{activeType:t,onClick:i}=e;const{cta_feedback_title:n,cta_anonymous_feedback_title:r}=us(Pa);return(0,$o.jsxs)("div",{className:"form-type-change",children:[(0,$o.jsx)(qy,{onClick:i,name:n,activeType:t,type:Wy}),(0,$o.jsx)(qy,{onClick:i,name:r,activeType:t,type:"anonymous"})]})},Yy=()=>{const{pathname:e}=fo(),[i,n]=(0,t.useState)(""),[r,a]=(0,t.useState)(!1),[s,o]=(0,t.useState)(!1),[l,c]=(0,t.useState)(null),[h,u]=(0,t.useState)(""),[d,p]=(0,t.useState)(""),[f,m]=(0,t.useState)(Wy),[g,v]=(0,t.useState)({name:"",email:"",phone:"",organization:""}),y=f===Wy,{cta_field_email_placeholder:b,cta_field_email_title:x,cta_field_message_placeholder:w,cta_field_message_title:_,cta_field_name_placeholder:S,cta_field_name_title:E,cta_field_organization_placeholder:C,cta_field_organization_title:A,cta_field_phone_placeholder:M,cta_field_phone_title:T,cta_field_sender_title:P,cta_policy_text:D,cta_field_sender_options:k,cta_field_subject_message_title:O,cta_field_subject_message_placeholder:I}=us(Pa),R=[{name:"name",required:!0,label:E,placeholder:S},{name:"email",required:!0,label:x,placeholder:b},{name:"phone",label:T,placeholder:M},{name:"organization",label:A,placeholder:C}],L=null===k||void 0===k?void 0:k.map((e=>({...e,name:e.title}))),B=y?!s||""===g.name||""===g.email||r:!s||r||""===h||""===d;return"success"===i?(0,$o.jsx)(Hy,{}):(0,$o.jsxs)("div",{className:"form-container form-type-".concat(f),children:[(0,$o.jsxs)("div",{className:"form-body",children:[(0,$o.jsx)(Xy,{activeType:f,onClick:m}),y&&R.map((e=>{let{placeholder:t,label:i,name:n,required:r}=e;return(0,$o.jsx)(jy,{type:n,value:g[n],onChange:e=>v({...g,[n]:e}),label:i,placeholder:t,required:r,className:"form-item-half"},n)})),(0,$o.jsx)(ry,{label:P,options:L,selectedValue:l,onChange:e=>c(e)}),!y&&(0,$o.jsx)(jy,{value:d,onChange:p,label:O,placeholder:I,type:void 0}),(0,$o.jsx)(Vy,{value:h,onChange:e=>u(e),label:_,placeholder:w})]}),(0,$o.jsxs)("div",{className:"form-footer",children:[(0,$o.jsx)(Uy,{onChange:()=>o(!s),checked:s,children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:D}})}),(0,$o.jsx)(Gy,{onClick:()=>{if(!B){a(!0);const t={...g,message:h,category:null===l||void 0===l?void 0:l.value,from_page:e},i={message:h,subject:d,category:null===l||void 0===l?void 0:l.value,from_page:e};Xi.postForm("".concat(tn+Yi.Zd),y?t:i).then((e=>{n(e.data.status),a(!1)})).catch((function(e){console.log(e),a(!1)}))}},disabled:B})]})]})},Qy=()=>(0,$o.jsx)(By,{sidebar:(0,$o.jsx)(Ny,{}),children:(0,$o.jsx)(Yy,{})}),Zy=e=>{let{item:t,index:i,withCustomContent:n}=e;const{title:r,description:a,type:s}=t,o=n?(0,$o.jsx)("div",{dangerouslySetInnerHTML:{__html:t.description}}):(0,$o.jsxs)($o.Fragment,{children:[r&&(0,$o.jsx)("div",{className:"description-demibold benefit-card__title",children:r}),(0,$o.jsx)("div",{className:"body1 opacity-80 benefit-card__text",children:a})]});return(0,$o.jsxs)("div",{className:"benefit-card ".concat(s?"benefit-card__".concat(s):""),children:[(0,$o.jsx)("div",{className:"gradient-number dark",children:(0,$o.jsx)("span",{children:i+1})}),o]},r)},Ky=e=>{let{data:t,withCustomContent:i=!1}=e;return(0,$o.jsx)("div",{className:"benefits-container",children:null===t||void 0===t?void 0:t.map(((e,t)=>(0,$o.jsx)(Zy,{item:e,index:t,withCustomContent:i},t)))})},Jy=e=>{let{title:t,data:i,children:n}=e;return(0,$o.jsxs)("div",{className:"box",children:[t&&(0,$o.jsx)("h3",{children:t}),(0,$o.jsx)(Ky,{data:i}),n]})},$y=e=>{let{children:t}=e;return(0,$o.jsx)("div",{className:"box general-info-box",children:t})},eb=e=>{let{index:t,activeIndex:i,text:n,onClick:r}=e;return(0,$o.jsx)("div",{className:"navigation-sidebar__item ".concat(t===i?"navigation-sidebar__active":""),onClick:r,children:(0,$o.jsx)("p",{className:"button-text",children:n})})},tb=e=>{let{items:t,activeIndex:i,refs:n,includesTitle:r=""}=e;return(0,$o.jsx)("div",{className:"navigation-sidebar",children:t.map(((e,t)=>e!==r&&(0,$o.jsx)(eb,{index:t,activeIndex:i,text:e,onClick:()=>{window.scrollTo({top:n[t].current.getBoundingClientRect().top+window.scrollY-100,behavior:"smooth"})}},t)))})},ib=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return Array.from({length:(t-e)/i+1},((t,r)=>Number((e+r*i).toFixed(n))))},nb=(e,i)=>{const[n,r]=t.useState({isIntersecting:!1,ratio:0,width:0,height:0});return t.useEffect((()=>{const t=e.current,n=new IntersectionObserver((e=>{let[t]=e;r((e=>({...e,isIntersecting:t.isIntersecting,ratio:Math.round(100*t.intersectionRatio),width:Math.round(t.intersectionRect.width),height:Math.round(t.intersectionRect.height)})))}),i);return n.observe(t),()=>n.unobserve(t)}),[]),n},rb=e=>{let{children:i,index:n,setData:r}=e;const a=t.useRef(null),s={threshold:ib(0,1,.01,2)},{ratio:o}=nb(a,{...s});return t.useEffect((()=>{r((e=>({...e,[n]:o})))}),[n,o,r]),(0,$o.jsx)("div",{ref:a,children:i})},ab=e=>{let t=0;for(const i in e)e[i]>50&&(t=Number(i));return t},sb=e=>{let{data:t}=e;return(0,$o.jsxs)("div",{className:"pdf-card",children:[(0,$o.jsxs)("div",{className:"pdf-card__top",children:[(0,$o.jsx)("img",{src:My,alt:"pdf"}),(0,$o.jsxs)("div",{className:"pdf-card__top__right-icons",children:[(0,$o.jsx)(Ho,{to:null===t||void 0===t?void 0:t.file,rel:"noopener noreferrer",target:"_blank",children:(0,$o.jsx)("div",{className:"button view"})}),(0,$o.jsx)(Ho,{to:null===t||void 0===t?void 0:t.file,target:"_blank",rel:"noopener noreferrer",download:!0,children:(0,$o.jsx)("div",{className:"button download"})})]})]}),(0,$o.jsx)("p",{className:"body2",children:t.title})]})},ob=e=>{let{title:t="",data:i,children:n}=e;return(0,$o.jsxs)("div",{className:"box pdf-box",children:[t&&(0,$o.jsx)("h3",{children:t}),(0,$o.jsx)("div",{className:"pdf-items",children:null===i||void 0===i?void 0:i.map(((e,t)=>(0,$o.jsx)(sb,{data:e},t)))}),n]})},lb=e=>{let{title:t,image:i,description:n,file:r}=e;return(0,$o.jsxs)("div",{className:"box product-box",children:[(0,$o.jsx)("h3",{children:t}),(0,$o.jsxs)("div",{className:"product-catalog",children:[(0,$o.jsx)("img",{src:i,alt:t}),(0,$o.jsx)("p",{className:"body1 product-catalog__text",children:n}),(0,$o.jsxs)("div",{className:"product-catalog__buttons",children:[(0,$o.jsxs)(Ho,{to:r,rel:"noopener noreferrer",target:"_blank",className:"button button-eye  has-children",children:[(0,$o.jsx)("div",{}),(0,$o.jsx)("div",{children:"VIEW CATALOG"})]}),(0,$o.jsxs)(Ho,{to:r,rel:"noopener noreferrer",target:"_blank",className:"button download-button has-children",download:!0,children:[(0,$o.jsx)("div",{}),(0,$o.jsx)("div",{children:"DOWNLOAD"})]})]})]})]})},cb=e=>{let{icon:t,slug:i,title:n}=e;return(0,$o.jsxs)(Ho,{to:i,className:"product-item",children:[(0,$o.jsx)("div",{className:"product-item__image",children:t&&(0,$o.jsx)("img",{src:t,alt:n})}),(0,$o.jsx)("div",{className:"product-item__name",children:(0,$o.jsx)("p",{className:"body2",children:n})})]})},hb=e=>{let{data:t,baseRoute:i,withSixItems:n=!1}=e;const r=null===t||void 0===t?void 0:t.map((e=>({...e,__slug:i+"/"+e.slug,__icon:e.logo||e.icon,__title:e.preview_title||e.title})));return(0,$o.jsx)("div",{className:"product-items ".concat(n?"six-items":""),children:null===r||void 0===r?void 0:r.map((e=>{let{__slug:t,__icon:i,__title:n}=e;return(0,$o.jsx)(cb,{icon:i,slug:t,title:n},t)}))})},ub=e=>{let{text:t="",onClick:i,next:n}=e;const{other_show_more_button:r}=us(Pa);return n&&(0,$o.jsx)("button",{className:"button show-more full-width has-children",onClick:i,children:t||r})},db=e=>{let{title:i}=e;const n=xs(),{slug:r}=yo(),[a,s]=(0,t.useState)(1),{data:o,next:l}=us(qr);(0,t.useEffect)((()=>{n(zr({product:r,type:Qi,page:a}))}),[n,r,a]);return(0,$o.jsxs)("div",{className:"box product-box",children:[i&&(0,$o.jsx)("h3",{children:i}),(null===o||void 0===o?void 0:o.length)&&(0,$o.jsx)(hb,{data:o,baseRoute:Xo.cropNutritionPrograms}),(0,$o.jsx)(ub,{next:l,onClick:()=>s(a+1)})]})},pb=e=>{let{title:i}=e;const[n,r]=(0,t.useState)(1),a=xs(),{slug:s}=yo(),{data:o,next:l}=us(xn);(0,t.useEffect)((()=>{a(dn({slug:s,page:n}))}),[a,s,n]);return(0,$o.jsxs)("div",{className:"box product-box",children:[i&&(0,$o.jsx)("h3",{children:i}),(null===o||void 0===o?void 0:o.length)>0&&(0,$o.jsx)(hb,{data:o,baseRoute:Xo.products}),(0,$o.jsx)(ub,{next:l,onClick:()=>r(n+1)})]})},fb=e=>{let{title:i,setSelectedTab:n,index:r,isActive:a}=e;const s=(0,t.useCallback)((()=>{n(r)}),[n,r]);return(0,$o.jsx)("button",{className:"tab-button ".concat(a?"active":""),onClick:s,children:i})},mb=e=>{let{children:i,preSelectedTabIndex:n=0}=e;const[r,a]=(0,t.useState)(n);return(0,$o.jsxs)("div",{className:"tabs",children:[(0,$o.jsx)("div",{className:"tabs-nav",children:i.map(((e,t)=>(0,$o.jsx)(fb,{title:e.props.title,index:t,isActive:t===r,setSelectedTab:a},e.props.title)))}),i[r]]})},gb=e=>{let{title:t,children:i}=e;return(0,$o.jsx)("div",{className:"tab-pane","data-title":t,children:i})},vb=e=>{let{title:i}=e;const n=xs(),{slug:r}=yo(),[a,s]=(0,t.useState)(1),[o,l]=(0,t.useState)(1),c=us(In),h=us(Rn),u=us(dr),{code:d}=u,{trial_in_country_tab:p,trial_in_other_country_tab:f}=us(gn);(0,t.useEffect)((()=>{n(Cn({product:r,type:Zi,trials_country:d,page:a}))}),[n,r,d,a]),(0,t.useEffect)((()=>{n(An({product:r,type:Zi,page:o}))}),[n,r,d,o]);const m=[{title:p,data:c.data||[],next:c.next,onClick:()=>s(a+1)},{title:f,data:h.data||[],next:h.next,onClick:()=>l(o+1)}];return(0,$o.jsxs)("div",{className:"box product-box",children:[i&&(0,$o.jsx)("h3",{children:i}),(0,$o.jsx)(mb,{children:m.map((e=>(0,$o.jsxs)(gb,{title:e.title,children:[(0,$o.jsx)(hb,{data:e.data,baseRoute:Xo.trialResults}),(0,$o.jsx)(ub,{next:e.next,onClick:e.onClick})]},e.title)))})]})};const yb=__webpack_require__.p+"static/media/uniferIcon.1bb5c3c02f5b2e23f6d3dc9f63e92ec4.svg",bb=e=>{let{image:t,href:i,title:n,icon:r=yb}=e;return i&&(0,$o.jsxs)("div",{className:"youtube-link",children:[(0,$o.jsxs)("div",{className:"youtube-link__title",children:[(0,$o.jsx)("img",{src:r,alt:"uniferX icon"}),(0,$o.jsx)("p",{className:"description-demibold",children:n})]}),(0,$o.jsx)("a",{href:i,target:"_blank",className:"button youtube youtube-link_button",rel:"noreferrer"}),(0,$o.jsx)("img",{src:t,alt:"Video Thumbnail",className:"youtube-link__image"})]})},xb=(e,i)=>{(0,t.useEffect)((()=>{const t=setTimeout((()=>e()),i);return()=>clearTimeout(t)}),[i,e])},wb=e=>{let{title:t,table:i,description:n}=e;return(0,$o.jsxs)("div",{className:"box table-box",children:[t&&(0,$o.jsx)("h3",{children:t}),(0,$o.jsx)("div",{className:"table-box__table",dangerouslySetInnerHTML:{__html:i}}),!!n&&(0,$o.jsx)("div",{className:"table-box__description",dangerouslySetInnerHTML:{__html:n}}),(0,$o.jsx)("div",{className:"table-box__piece"})]})},_b=e=>{let{title:t}=e;return(0,$o.jsxs)("div",{className:"box table-box table-box-without-table",children:[(0,$o.jsx)(ol,{size:"middle",textColor:"white",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:t}})}),(0,$o.jsx)("div",{className:"table-box__piece"})]})},Sb=e=>{let{pageContentData:i}=e;const[n,r]=(0,t.useState)({}),[a,s]=(0,t.useState)(0),o=[],l=[],c=us(vn),[h,u]=(0,t.useState)(!1);Object.entries(i).forEach((e=>{let[t,i]=e;((e,t)=>{return"benefits_data"===e?null!==t:"table_data"===e?!(null===t||void 0===t||!t.formula_table):"text_block"===e?!(null===t||void 0===t||!t.text):"composition_compatibility"===e?(null===t||void 0===t||null===(i=t.composition_compatibility)||void 0===i?void 0:i.length)>0:"related_products"===e||"trial_results"===e||"nutrition_programs"===e?null===t||void 0===t?void 0:t.hasOwnProperty("main_title"):!e.startsWith("catalog_")||!(null===t||void 0===t||null===(n=t.data)||void 0===n||!n.file);var i,n})(t,i)&&(o.push(((e,t)=>{if("general_information"===e){const{main_title:e,general_information:i}=t;return(0,$o.jsxs)($y,{children:[e&&(0,$o.jsx)("h3",{children:e}),(0,$o.jsx)("div",{dangerouslySetInnerHTML:{__html:i}})]})}if("table_data"===e){const{main_title:e,formula_table:i,formula_description:n}=t;return(0,$o.jsx)(wb,{title:e,table:i,description:n})}if("text_block"===e)return(0,$o.jsx)(_b,{title:null===t||void 0===t?void 0:t.text});if("benefits_data"===e){const{benefits_preview_video:e,benefits_preview_text:i,benefits_video:n}=(null===t||void 0===t?void 0:t.video)||{};return(0,$o.jsx)(Jy,{title:null===t||void 0===t?void 0:t.main_title,data:null===t||void 0===t?void 0:t.benefits,children:n&&(0,$o.jsx)(bb,{image:e,href:n,title:i})})}if("composition_compatibility"===e){const{main_title:e,composition_compatibility:i}=t;return(0,$o.jsx)(ob,{title:e,data:i})}return"related_products"===e?(0,$o.jsx)(pb,{title:t.main_title}):"nutrition_programs"===e?(0,$o.jsx)(db,{title:t.main_title}):"trial_results"===e?(0,$o.jsx)(vb,{title:t.main_title}):e.startsWith(Eb)?(0,$o.jsx)(lb,{file:t.data.file,title:t.main_title,image:t.data.image,description:t.data.description}):null})(t,i)),l.push(i.main_title))}));const d=o.length,[p,f]=(0,t.useState)([]);(0,t.useEffect)((()=>{f((e=>Array(d).fill().map(((i,n)=>e[n]||(0,t.createRef)()))))}),[d]),(0,t.useEffect)((()=>{s(ab(n))}),[n]),xb((()=>u(!0)),2e3);const m=(0,t.useRef)();return xg({items:[".box",".picture-component"],container:m,dependencies:[c,h]}),(0,$o.jsx)("div",{ref:m,children:(0,$o.jsx)(Ly,{Sidebar:(0,$o.jsx)(tb,{activeIndex:a,refs:p,items:l,includesTitle:"formula_text"}),children:o.map(((e,t)=>(0,$o.jsx)("div",{ref:p[t],children:(0,$o.jsx)(rb,{index:t,setData:r,children:e})},t)))})})},Eb="catalog_",Cb=()=>{const{slug:e}=yo(),i=xs(),n=fo(),r=us(vn),a=go(),{general_information:s,general_information_title:o,benefits_title:l,benefits:c,benefits_preview_video:h,benefits_video:u,benefits_preview_text:d,formula_description:p,formula_table:f,formula_title:m,formula_text:g,title:v,title_image:y,title_button:b,about_title:x,about_description:w,composition_compatibility:_,composition_compatibility_title:S,products_title:E,nutrition_programs_title:C,trial_results_title:A,has_related_products:M,has_nutrition_programs:T,has_trial_results:P,catalogs:D,group_slug:k}=us(gn);(0,t.useEffect)((()=>()=>{i(Ya({pathname:n.pathname,state:k}))}),[n,k]),(0,t.useEffect)((()=>{Va(i(hn({slug:e})),a)}),[i,e]);const O=us(Pa),I=null===O||void 0===O?void 0:O.product_about_tag,R=null===O||void 0===O?void 0:O.benefits_title,L={general_information:{general_information:s,main_title:o},table_data:{main_title:m,formula_table:f,formula_description:p},text_block:{main_title:"formula_text",text:g},benefits_data:c&&c.length||u?{main_title:l||R,benefits:c,video:u&&{benefits_preview_video:h,benefits_preview_text:d,benefits_video:u}}:null,related_products:M?{main_title:E}:null,composition_compatibility:{composition_compatibility:_,main_title:S},nutrition_programs:T?{main_title:C}:null,trial_results:P?{main_title:A}:null,...null===D||void 0===D?void 0:D.reduce(((e,t,i)=>({...e,["".concat(Eb).concat(i)]:{main_title:t.title,data:t}})),{})},B=(0,t.useRef)();return xg({items:[],container:B,dependencies:[r]}),r?(0,$o.jsx)(pv,{}):(0,$o.jsxs)("div",{ref:B,children:[(0,$o.jsx)(sl,{title:v,image:y,buttonText:b,buttonType:"find-desktop",to:Xo.contacts+"#find"}),(0,$o.jsxs)("section",{className:"container",children:[(0,$o.jsx)("div",{className:"inner-container type-2",children:(0,$o.jsxs)("div",{className:"main-text-container",children:[(0,$o.jsx)(ll,{children:I}),(0,$o.jsx)(ol,{className:"has-animation",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:x}})}),w&&(0,$o.jsx)("div",{className:"offset-left-4 max-width-760",children:(0,$o.jsx)(ol,{size:"super-small",className:"has-animation",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:w}})})})]})}),(0,$o.jsx)(Sb,{pageContentData:L})]}),(0,$o.jsx)(Qy,{})]})},Ab=()=>{const e=xs(),i=us(Vr),{fs_title:n,fs_title_background:r,fs_view_button:a,agricultural_tag:s,agricultural_title:o}=us(jr),l=us(Ur);(0,t.useEffect)((()=>{e(Lr()),e(Nr({type:Qi,all:!0}))}),[e]);const c=(0,t.useRef)();return xg({items:[".with-sidebar-layout"],container:c,dependencies:[i]}),i?(0,$o.jsx)(pv,{}):(0,$o.jsxs)("div",{ref:c,children:[(0,$o.jsx)(sl,{title:n,image:r,buttonText:a,onClickButton:()=>ja("box",100)}),(0,$o.jsxs)("section",{className:"container",children:[(0,$o.jsx)("div",{className:"inner-container type-3",children:(0,$o.jsxs)("div",{className:"main-text-container",children:[(0,$o.jsx)(ll,{children:s}),(0,$o.jsx)(ol,{className:"has-animation",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:o}})})]})}),(0,$o.jsx)("div",{className:"box",children:(0,$o.jsx)(hb,{data:l,baseRoute:Xo.cropNutritionPrograms,withSixItems:!0})})]}),(0,$o.jsx)(Qy,{})]})},Mb=()=>{const e=xs(),i=us(kn),{fs_title:n,fs_title_background:r,fs_view_button:a,agricultural_tag:s,agricultural_title:o,agricultural_description:l}=us(Dn),c=us(Ln);(0,t.useEffect)((()=>{e(Mn({all:!0,type:Zi})),e(Sn())}),[e]);const h=(0,t.useRef)();return xg({items:[".with-sidebar-layout"],container:h,dependencies:[i]}),i?(0,$o.jsx)(pv,{}):(0,$o.jsxs)("div",{ref:h,children:[(0,$o.jsx)(sl,{title:n,image:r,buttonText:a,onClickButton:()=>ja("box",100)}),(0,$o.jsxs)("section",{className:"container",children:[(0,$o.jsx)("div",{className:"inner-container type-2",children:(0,$o.jsxs)("div",{className:"main-text-container",children:[(0,$o.jsx)(ll,{children:s}),(0,$o.jsx)(ol,{className:"has-animation",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:o}})}),(0,$o.jsx)("div",{className:"offset-left-4 max-width-760",children:(0,$o.jsx)(ol,{size:"super-small",className:"has-animation",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:l}})})})]})}),(0,$o.jsx)("div",{className:"box",children:(0,$o.jsx)(hb,{data:c,baseRoute:Xo.trialResults,withSixItems:!0})})]}),(0,$o.jsx)(Qy,{})]})},Tb=e=>{let{title:t,data:i,baseRoute:n}=e;return(0,$o.jsxs)("div",{className:"product-sidebar",children:[(0,$o.jsx)("div",{className:"description-demibold product-sidebar__title",children:t}),(0,$o.jsx)("div",{className:"product-sidebar-cards",children:null===i||void 0===i?void 0:i.map((e=>(0,$o.jsx)(Ho,{to:n+"/"+e.slug,className:"product-sidebar-card",title:e.title,children:e.icon?(0,$o.jsx)("img",{src:e.icon,alt:e.title}):(0,$o.jsx)("span",{children:e.title})},n+"/"+e.slug)))})]})};var Pb,Db,kb,Ob,Ib,Rb;function Lb(){return Lb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},Lb.apply(this,arguments)}function Bb(e,i){let{title:n,titleId:r,...a}=e;return t.createElement("svg",Lb({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:i,"aria-labelledby":r},a),n?t.createElement("title",{id:r},n):null,Pb||(Pb=t.createElement("path",{d:"M6.125 6.125C7.16053 6.125 8 5.28553 8 4.25C8 3.21447 7.16053 2.375 6.125 2.375C5.08947 2.375 4.25 3.21447 4.25 4.25C4.25 5.28553 5.08947 6.125 6.125 6.125Z",stroke:"white",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Db||(Db=t.createElement("path",{d:"M11.125 13.625C12.1605 13.625 13 12.7855 13 11.75C13 10.7145 12.1605 9.875 11.125 9.875C10.0895 9.875 9.25 10.7145 9.25 11.75C9.25 12.7855 10.0895 13.625 11.125 13.625Z",stroke:"white",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),kb||(kb=t.createElement("path",{d:"M8 4.25H14.875",stroke:"white",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"})),Ob||(Ob=t.createElement("path",{d:"M1.125 4.25H4.25",stroke:"white",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"})),Ib||(Ib=t.createElement("path",{d:"M13 11.75H14.875",stroke:"white",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"})),Rb||(Rb=t.createElement("path",{d:"M1.125 11.75H9.25",stroke:"white",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"})))}const zb=t.forwardRef(Bb),Nb=(__webpack_require__.p,e=>{let{children:t,onReset:i,hasSelected:n,title:r="Filter",withoutSticky:a=!1}=e;const{reset_filter:s}=us(Pa);return(0,$o.jsxs)("div",{className:"filter-sidebar ".concat(a?"without-sticky":""),children:[(0,$o.jsxs)("div",{className:"filter-sidebar__header",children:[(0,$o.jsx)(zb,{}),r]}),(0,$o.jsx)("div",{className:"filter-sidebar__body",children:t}),n&&(0,$o.jsx)("button",{className:"filter-sidebar-reset",onClick:i,children:s})]})}),Fb=()=>{var e;const t=xs(),i=us(Xr),{filter_name:n,product_select:r}=us(jr),a=us(bn),s=us(Wa);if(null===s||void 0===s||null===(e=s.pathname)||void 0===e?void 0:e.startsWith(Xo.products)){const e=a.find((e=>e.value===s.state));t(Yr(e))}return(0,$o.jsx)(Nb,{onReset:()=>{t(Yr(null)),t(Ya(null))},hasSelected:i,title:n,withoutSticky:!0,children:(0,$o.jsx)(ry,{label:r,options:a,onChange:e=>{t(Yr(e)),t(Ya(null))},selectedValue:i})})},jb=()=>{const e=xs(),{slug:i}=yo(),n=go(),{title:r,fs_view_button:a,fs_background:s,details:o,sidebar_text:l}=us(Hr),{sidebar_text_crop_nutrition:c}=us(Pa),h=us(Ur),u=us(Wr),d=us(Xr);(0,t.useEffect)((()=>{e(Nr({type:Qi,all:!0})),Va(e(Br({slug:i,type:Qi,product:null===d||void 0===d?void 0:d.value})),n)}),[e,i,d]);const p=(0,t.useRef)();return xg({items:[".box"],container:p,dependencies:[u]}),u?(0,$o.jsx)(pv,{}):(0,$o.jsxs)("div",{ref:p,children:[(0,$o.jsx)(sl,{title:r,image:s,buttonText:a,onClickButton:()=>ja("this")}),(0,$o.jsx)("section",{className:"container this",children:(0,$o.jsx)(Ly,{containerType:"type-1",mobileReversed:!0,Sidebar:(0,$o.jsxs)($o.Fragment,{children:[(0,$o.jsx)(Fb,{}),(0,$o.jsx)(Tb,{baseRoute:Xo.cropNutritionPrograms,title:c||l,data:h})]}),children:null===o||void 0===o?void 0:o.map(((e,t)=>{let{product:i,detailed_data:n,purpose_processing:r,purposes:a}=e;return(0,$o.jsxs)($y,{children:[i&&(0,$o.jsx)("h3",{children:i}),(0,$o.jsx)("div",{dangerouslySetInnerHTML:{__html:n}}),r&&(0,$o.jsx)("h3",{children:r}),!(null===a||void 0===a||!a.length)&&(0,$o.jsx)(Ky,{data:a,withCustomContent:!0})]},t)}))})})]})},Vb=()=>{var e;const t=xs(),i=us(Fn),n=us(jn),r=us(mr),{filter_name:a,product_select:s,country_select:o}=us(Dn),l=us(bn),c=us(Wa);if(null===c||void 0===c||null===(e=c.pathname)||void 0===e?void 0:e.startsWith(Xo.products)){const e=l.find((e=>e.value===c.state));t(Vn(e))}return(0,$o.jsxs)(Nb,{onReset:()=>{t(Vn(null)),t(Un(null)),t(Ya(null))},hasSelected:i||n,title:a,withoutSticky:!0,children:[(0,$o.jsx)(ry,{label:s,options:l,onChange:e=>{t(Vn(e)),t(Ya(null))},selectedValue:i}),(0,$o.jsx)(ry,{label:o,options:r,onChange:e=>{t(Un(e))},selectedValue:n})]})},Ub=()=>{const e=xs(),i=go(),{slug:n}=yo(),[r,a]=(0,t.useState)(1),{flyers:s,next:o}=us(On),l=us(Bn),c=us(Ln),{sidebar_text_trials_result:h}=us(Pa),u=us(zn),{title:d,fs_background:p,fs_view_button:f}=l,m=us(Fn),g=us(jn);(0,t.useEffect)((()=>{a(1),e(Mn({all:!0})),Va(e(Tn({slug:n})),i),e(Sn())}),[e,n]),(0,t.useEffect)((()=>{a(1)}),[e,m,g]),(0,t.useEffect)((()=>{e(En({slug:n,page:r,product:null===m||void 0===m?void 0:m.value,trials_country:null===g||void 0===g?void 0:g.value}))}),[e,r,n,m,g]);const v=(0,t.useRef)();return xg({items:[".box"],container:v,dependencies:[u]}),u?(0,$o.jsx)(pv,{}):(0,$o.jsxs)("div",{ref:v,children:[(0,$o.jsx)(sl,{title:d,image:p,buttonText:f,onClickButton:()=>ja("this")}),(0,$o.jsx)("section",{className:"container this",children:(0,$o.jsx)(Ly,{containerType:"type-1",mobileReversed:!0,Sidebar:(0,$o.jsxs)($o.Fragment,{children:[(0,$o.jsx)(Vb,{}),(0,$o.jsx)(Tb,{title:h,data:c,baseRoute:Xo.trialResults})]}),children:(0,$o.jsx)(ob,{data:s,children:(0,$o.jsx)(ub,{onClick:()=>a(r+1),next:o})})})})]})},Gb=()=>{const e=xs(),i=us(ta),n=us(ia),{filter_name:r,product_select:a}=us(jr),{fs_title:s,fs_title_background:o,fs_view_button:l,agricultural_tag:c,agricultural_title:h,agricultural_description:u,catalogs:d=[]}=us(ea);(0,t.useEffect)((()=>{e(Zr())}),[e]);const p=us(na);(0,t.useEffect)((()=>{Object.entries(p).forEach((t=>{let[i]=t;e(Kr({id:i,page:1}))}))}),[d]);const f=us(bn),[m,g]=(0,t.useState)(null),v=e=>g(e);(0,t.useEffect)((()=>{m&&e(Jr({product:m.value}))}),[e,m]);const y=()=>{g(null),e(Zr())},b=()=>(0,$o.jsx)(Nb,{onReset:y,hasSelected:m,title:r,children:(0,$o.jsx)(ry,{label:a,options:f,onChange:v,selectedValue:m})}),x=(0,t.useRef)();return xg({items:[".box",".with-sidebar-layout__left"],container:x,dependencies:[i]}),i&&n?(0,$o.jsx)(pv,{}):(0,$o.jsxs)("div",{ref:x,children:[(0,$o.jsx)(sl,{title:s,image:o,buttonText:l,onClickButton:()=>ja("with-sidebar-layout__right",100)}),(0,$o.jsxs)("section",{className:"container",children:[(0,$o.jsx)("div",{className:"inner-container type-2",children:(0,$o.jsxs)("div",{className:"main-text-container",children:[(0,$o.jsx)(ll,{children:c}),(0,$o.jsx)(ol,{className:"has-animation",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:h}})}),(0,$o.jsx)("div",{className:"offset-left-4 max-width-760",children:(0,$o.jsx)(ol,{size:"super-small",className:"has-animation",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:u}})})})]})}),(0,$o.jsx)(Ly,{Sidebar:(0,$o.jsx)(b,{}),children:d.map(((i,n)=>{let{title:r,image:a,description:s,file:o,id:l}=i;return(0,$o.jsxs)(t.Fragment,{children:[(0,$o.jsx)(lb,{file:o,title:r,image:a,description:s}),p.hasOwnProperty(l)&&(0,$o.jsx)(ob,{data:p[l].flyers,children:(0,$o.jsx)(ub,{onClick:()=>e(Kr({id:l,page:p[l].page+1})),next:p[l].next})})]},n)}))})]}),(0,$o.jsx)(Qy,{})]})};const Hb=__webpack_require__.p+"static/media/headOfficePin.6e886e7a5ba1eeed4df677e8e03bf220.svg",Wb=e=>{let{data:t}=e;const{image:i,title:n,description:r}=t;return(0,$o.jsxs)("div",{className:"team-member-card",children:[(0,$o.jsx)("div",{className:"team-member-card__img",children:(0,$o.jsx)("img",{src:i,alt:n})}),(0,$o.jsx)("div",{className:"description-demibold",children:n}),(0,$o.jsx)("div",{className:"body1 opacity-80",children:r})]})};const qb=__webpack_require__.p+"static/media/career-card.aca668808c3922bf33a141b062aafbd8.svg",Xb=()=>{const{team_card_button:e,team_card_text:t,team_card_title:i}=us(_a);return(0,$o.jsx)("div",{className:"team-career-card",children:(0,$o.jsxs)("div",{className:"team-career-card-inner",children:[(0,$o.jsx)("img",{className:"team-career-card__img",src:qb,alt:""}),(0,$o.jsxs)("div",{className:"team-career-card__content",children:[(0,$o.jsxs)("div",{children:[(0,$o.jsx)("div",{className:"h2",children:i}),(0,$o.jsx)("p",{className:"body1 opacity-80",children:t})]}),(0,$o.jsx)(al,{href:Xo.career,type:"button-arrow",children:e})]})]})})};const Yb=__webpack_require__.p+"static/media/team-info-card.d643a6cd1284bbbbaf9b523aa78ffcd3.svg",Qb=e=>{let{data:t}=e;const{image:i,title:n,description:r}=t;return(0,$o.jsx)("div",{className:"team-info-card",children:(0,$o.jsxs)("div",{className:"team-info-card-inner",children:[(0,$o.jsx)("img",{className:"team-info-card__img",src:Yb,alt:""}),(0,$o.jsxs)("div",{className:"team-info-card__content",children:[(0,$o.jsx)("img",{className:"team-info-card__icon",src:i,alt:"icon"}),(0,$o.jsxs)("div",{children:[(0,$o.jsx)(ol,{textColor:"white",children:(0,$o.jsx)("em",{children:n})}),(0,$o.jsx)("div",{className:"body1 opacity-70",children:r})]})]})]})})},Zb=e=>{let{showMore:t}=e;const{team_show_more:i}=us(_a),{data:n=[],next:r}=us(Sa);return(0,$o.jsxs)($o.Fragment,{children:[(0,$o.jsxs)("div",{className:"team",children:[n.map(((e,t)=>"info"===e.type?(0,$o.jsx)(Qb,{data:e},t):(0,$o.jsx)(Wb,{data:e},t))),(0,$o.jsx)(Xb,{})]}),(0,$o.jsx)(ub,{next:r,text:i,onClick:t})]})},Kb=e=>{let{showMore:t}=e;const{team_title:i,team_tag:n}=us(_a);return(0,$o.jsx)("section",{className:"container",children:(0,$o.jsxs)("div",{className:"inner-container type-2",children:[(0,$o.jsxs)("div",{className:"main-text-container with-absolute-label",children:[(0,$o.jsx)(ll,{children:n}),(0,$o.jsx)("div",{className:"offset-left-4",children:(0,$o.jsx)(ol,{size:"middle",className:"has-animation",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:i}})})})]}),(0,$o.jsx)(Zb,{showMore:t})]})})};const Jb=__webpack_require__.p+"static/media/mission-mask.46a257d5932de2a36b3fcf38b105693d.svg";qd.registerPlugin(ag);const $b=!1,ex="power1.in",tx=e=>{let{background:i="",title:n="",data:r=[],loading:a}=e;const s={maskImage:"url('".concat(Jb,"')"),WebkitMaskImage:"url('".concat(Jb,"')")},o=(0,t.useRef)();return Jd((()=>{qd.from(".mission-section__title",{y:10,opacity:0,ease:ex,duration:.4,scrollTrigger:{trigger:".mission-section",start:"top 70%",markers:$b}}),qd.from(".mission-section__mask",{y:10,opacity:0,ease:ex,duration:.4,scrollTrigger:{trigger:".mission-section",start:"top 50%",markers:$b}})}),{dependencies:[a,r],scope:o,revertOnUpdate:!0}),Jd((()=>{if(r.length){qd.timeline({scrollTrigger:{trigger:".mission-section",start:"top 8px",end:"+=100%",scrub:1,markers:$b,pin:!0}}).fromTo(".mission-section__mask",{maskSize:30},{maskSize:100}).to(".mission-section__title",{opacity:0},0).fromTo(".values-card-wrapper",{yPercent:400},{yPercent:0,stagger:.1}).fromTo(".values-section",{yPercent:0},{yPercent:-50})}}),{dependencies:[a,r],scope:o}),(0,$o.jsx)("section",{className:"mission-values-section container",ref:o,children:(0,$o.jsxs)("div",{className:"mission-section",children:[(0,$o.jsx)("div",{className:"mission-section__gradient"}),(0,$o.jsx)("div",{className:"mission-section__mask",style:s,children:(0,$o.jsx)("img",{src:i,alt:"background"})}),(0,$o.jsx)("div",{className:"mission-section__title",children:n}),(0,$o.jsx)("div",{className:"values-section",children:null===r||void 0===r?void 0:r.map(((e,t)=>(0,$o.jsxs)("div",{className:"values-card-wrapper",children:[(0,$o.jsx)("div",{className:"angle-decor"}),(0,$o.jsxs)("div",{className:"values-card",children:[(0,$o.jsx)("div",{className:"gradient-number light",children:(0,$o.jsx)("span",{children:t+1})}),e.title&&(0,$o.jsx)("div",{className:"values-card__title",children:e.title}),e.text&&(0,$o.jsx)("div",{className:"values-card__text",children:e.text})]})]},t)))})]})})},ix=__webpack_require__.p+"static/media/our-history.648bb5c2a84d93e9c0dd.jpg",nx=e=>{let{title:t,cards:i=[]}=e;const n=i.filter((e=>!!e.title&&!!e.text));return(0,$o.jsx)("section",{className:"container",children:(0,$o.jsxs)("div",{className:"our-history-section",style:{backgroundImage:'url("'.concat(ix,'")')},children:[(0,$o.jsx)("div",{className:"our-history-section-gradient"}),(0,$o.jsxs)("div",{className:"our-history",children:[(0,$o.jsx)("div",{className:"our-history__title h1 has-animation",children:t}),(0,$o.jsx)("div",{className:"our-history-cards",children:n.map((e=>(0,$o.jsxs)("div",{className:"history-card-wrapper",children:[(0,$o.jsx)("div",{className:"angle-decor"}),(0,$o.jsxs)("div",{className:"history-card",children:[(0,$o.jsx)(ol,{textColor:"white",children:(0,$o.jsx)("em",{children:e.title})}),(0,$o.jsx)("div",{className:"body1 opacity-80",children:e.text})]})]},e.title)))})]})]})})},rx=()=>{const e=xs(),i=us(Ca),n=us(Ea),[r,a]=t.useState(1),{fs_title:s,fs_background:o,fs_description:l,about_tag:c,about_title:h,about_text:u,about_card_text:d,about_card_image:p,mission_cards:f,history_title:m,histories_cards:g,histories_image:v,mission_background_image:y,mission_title:b}=us(_a);t.useEffect((()=>{e(ba())}),[e]),t.useEffect((()=>{e(xa({page:r}))}),[e,r]);const x=(0,t.useRef)();return xg({items:[".team",".our-history-cards"],container:x,dependencies:[i,n]}),i||n?(0,$o.jsx)(pv,{}):(0,$o.jsxs)("div",{ref:x,children:[(0,$o.jsx)(sl,{image:o,buttonText:l,onClickButton:()=>ja("this",100),children:(0,$o.jsx)(ol,{size:"middle",textColor:"white",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:s}})})}),(0,$o.jsx)("section",{className:"container this",children:(0,$o.jsx)("div",{className:"inner-container type-2",children:(0,$o.jsxs)("div",{className:"main-text-container",children:[(0,$o.jsx)(ll,{children:c}),(0,$o.jsx)(ol,{className:"has-animation",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:h}})}),(0,$o.jsx)("div",{className:"offset-left-4 max-width-760",children:(0,$o.jsx)(ol,{size:"small",className:"has-animation",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:u}})})})]})})}),(0,$o.jsx)("section",{className:"container",children:(0,$o.jsx)("div",{className:"inner-container type-2",children:(0,$o.jsxs)("div",{className:"head-office has-animation",children:[(0,$o.jsxs)("div",{className:"head-office__left",children:[(0,$o.jsx)("img",{src:Hb,alt:"icon pin"}),(0,$o.jsx)(ol,{size:"super-small",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:d}})})]}),(0,$o.jsx)("div",{className:"head-office__right",children:(0,$o.jsx)("img",{src:p,alt:"head office"})})]})})}),(0,$o.jsx)(tx,{loading:i,background:y,title:b,data:f}),(0,$o.jsx)(Kb,{showMore:()=>a(r+1)}),(0,$o.jsx)(nx,{title:m,cards:g}),v&&(0,$o.jsx)("section",{className:"container about-us-photo",children:(0,$o.jsx)("img",{src:v,alt:"",loading:"eager"})}),(0,$o.jsx)(Qy,{})]})},ax=e=>{let{children:t}=e;return(0,$o.jsx)("div",{className:"label body3",children:t})};var sx;function ox(){return ox=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},ox.apply(this,arguments)}function lx(e,i){let{title:n,titleId:r,...a}=e;return t.createElement("svg",ox({width:16,height:16,viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",ref:i,"aria-labelledby":r},a),n?t.createElement("title",{id:r},n):null,sx||(sx=t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.75 -0.25V0.75H10.25V-0.25H11.75V0.75H13.9091C14.6497 0.75 15.25 1.35034 15.25 2.09091V13.9091C15.25 14.6497 14.6497 15.25 13.9091 15.25H2.09091C1.35034 15.25 0.75 14.6497 0.75 13.9091V2.09091C0.75 1.35035 1.35035 0.75 2.09091 0.75H4.25V-0.25H5.75ZM4.25 2.25H2.25V4.75H13.75V2.25H11.75V3.25H10.25V2.25H5.75V3.25H4.25V2.25ZM13.75 6.25H2.25V13.75H13.75V6.25Z"})))}const cx=t.forwardRef(lx);__webpack_require__.p;var hx;function ux(){return ux=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},ux.apply(this,arguments)}function dx(e,i){let{title:n,titleId:r,...a}=e;return t.createElement("svg",ux({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 16 16",fill:"currentColor",ref:i,"aria-labelledby":r},a),n?t.createElement("title",{id:r},n):null,hx||(hx=t.createElement("path",{d:"M8.75 4.5V3.75H7.25V4.5H8.75ZM8 8H7.25V8.75H8V8ZM11.5 8.75H12.25V7.25H11.5V8.75ZM13.75 8C13.75 11.1756 11.1756 13.75 8 13.75V15.25C12.0041 15.25 15.25 12.0041 15.25 8H13.75ZM8 13.75C4.82436 13.75 2.25 11.1756 2.25 8H0.75C0.75 12.0041 3.99594 15.25 8 15.25V13.75ZM2.25 8C2.25 4.82436 4.82436 2.25 8 2.25V0.75C3.99594 0.75 0.75 3.99594 0.75 8H2.25ZM8 2.25C11.1756 2.25 13.75 4.82436 13.75 8H15.25C15.25 3.99594 12.0041 0.75 8 0.75V2.25ZM7.25 4.5V8H8.75V4.5H7.25ZM8 8.75H11.5V7.25H8V8.75Z"})))}const px=t.forwardRef(dx),fx=(__webpack_require__.p,e=>({calendar:(0,$o.jsx)(cx,{}),clock:(0,$o.jsx)(px,{})}[e])),mx=e=>{let{iconName:t,text:i}=e;return i&&(0,$o.jsxs)("div",{className:"text-with-icon body3",children:[(0,$o.jsx)("div",{className:"text-with-icon__icon",children:fx(t)}),(0,$o.jsx)("div",{className:"text-with-icon__text",children:i})]})},gx=e=>{let{data:t,big:i=!1}=e;const{title_background:n,title:r,type:a,slug:s,crated_at:o,time_to_read:l}=t,c=us(ka)[a];return(0,$o.jsxs)(Ho,{to:Xo.news+"/"+s,className:"news-card ".concat(i?"news-card--big":""),children:[(0,$o.jsx)("div",{className:"news-card__image",children:(0,$o.jsx)("img",{src:n,alt:"news"})}),(0,$o.jsxs)("div",{className:"news-card__content",children:[(0,$o.jsx)("div",{className:"news-card-labels",children:(0,$o.jsx)(ax,{children:c})}),(0,$o.jsx)("div",{className:"news-card__title description-demibold",children:r}),(0,$o.jsxs)("div",{className:"news-card-date",children:[(0,$o.jsx)(mx,{iconName:"calendar",text:o}),(0,$o.jsx)(mx,{iconName:"clock",text:l})]})]})]})},vx=()=>(0,$o.jsx)("svg",{width:"287",height:"80",viewBox:"0 0 287 80",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,$o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M286.069 80V16C286.069 7.16345 278.906 0 270.069 0H0C3.9104 0 7.6853 1.43201 10.6119 4.02554L73.7448 59.9745C76.6714 62.568 80.4463 64 84.3567 64H270.069C278.906 64 286.069 71.1635 286.069 80Z",fill:"#ffffff"})}),yx=()=>{const{subscribe_title:e,subscribe_description:i,subscribe_policy_text:n,subscribe_thanks_description:r,subscribe_thanks_title:a,subscribe_tag:s}=us(Ar),{cta_field_email_placeholder:o}=us(Pa),[l,c]=t.useState(""),[h,u]=t.useState(""),[d,p]=t.useState(!0),[f,m]=t.useState(!1),g=""===l||!d||!Fy(l)||f;return(0,$o.jsxs)("div",{className:"subscribe-card",children:[(0,$o.jsxs)("div",{className:"subscribe-card__label",children:[(0,$o.jsxs)("div",{className:"subscribe-card__label-label",children:["\u2022 ",s]}),(0,$o.jsx)(vx,{})]}),"success"===h?(0,$o.jsxs)("div",{className:"subscribe-card__content",children:[(0,$o.jsx)("h2",{children:a}),(0,$o.jsx)("p",{className:"body1 opacity-80",children:r})]}):(0,$o.jsxs)("div",{className:"subscribe-card__content",children:[(0,$o.jsx)("h2",{dangerouslySetInnerHTML:{__html:e}}),(0,$o.jsx)("p",{className:"body1 opacity-80",children:i}),(0,$o.jsxs)("div",{className:"subscribe-form",children:[(0,$o.jsxs)("div",{className:"subscribe-form__input",children:[(0,$o.jsx)(jy,{value:l,onChange:e=>c(e),label:void 0,placeholder:o,type:"email"}),(0,$o.jsx)("button",{className:"button send ".concat(g?"disabled":""),onClick:()=>{m(!0),Xi.post("".concat(tn+Yi.B1),{email:l}).then((e=>{u(e.data.status),m(!1)})).catch((function(e){console.log(e),m(!1)}))}})]}),(0,$o.jsx)(Uy,{checked:d,onChange:()=>p(!d),children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:n}})})]})]})]})},bx=e=>{let{posts:t=[]}=e;return(0,$o.jsxs)("div",{className:"news-cards",children:[t.map(((e,t)=>(0,$o.jsx)(gx,{data:e,big:0===t},t))),(0,$o.jsx)(yx,{})]})},xx=e=>{let{tag:t,onClick:i,selectedTag:n}=e;const r=(null===n||void 0===n?void 0:n.type)===(null===t||void 0===t?void 0:t.type);return(0,$o.jsx)("button",{onClick:()=>i(t),className:"tag-item ".concat(r?"selected":""),children:t.name})},wx=e=>{let{tags:t=[],selectedTag:i,onClick:n}=e;return(0,$o.jsx)("div",{className:"tags-filter",children:t.map((e=>(0,$o.jsx)(xx,{tag:e,selectedTag:i,onClick:n},e.type)))})},_x=()=>{const e=xs(),[i,n]=(0,t.useState)(void 0),[r,a]=(0,t.useState)(1),s=us(Ir),{title:o,description:l,tags:c,title_background:h,show_all_button:u,show_more_button:d,fs_button_text:p}=us(Ar),f=us(ka),{data:m,next:g}=us(Pr),v={type:"all",name:u};(0,t.useEffect)((()=>{e(wr()),n(v)}),[e,u]),(0,t.useEffect)((()=>{e(Sr({tag:"all"===(null===i||void 0===i?void 0:i.type)?null:null===i||void 0===i?void 0:i.type,page:r}))}),[e,i,r,u]);const y=null===c||void 0===c?void 0:c.map((e=>({type:e,name:f[e]}))),b=y?[v,...y]:[],x=(0,t.useRef)();return xg({items:[".news-heading",".news-cards"],container:x,dependencies:[s]}),s?(0,$o.jsx)(pv,{}):(0,$o.jsxs)("div",{ref:x,children:[(0,$o.jsx)(sl,{title:o,image:h,buttonText:p,onClickButton:()=>ja("subscribe-card",100)}),(0,$o.jsx)("section",{className:"container",children:(0,$o.jsxs)("div",{className:"inner-container",children:[(0,$o.jsxs)("div",{className:"news-heading",children:[(0,$o.jsx)(ol,{size:"small",children:(0,$o.jsx)("div",{className:"max-width-760",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:l}})})}),(0,$o.jsx)(wx,{tags:b,selectedTag:i,onClick:e=>{a(1),n(e)}})]}),(0,$o.jsx)(bx,{posts:m}),(0,$o.jsx)(ub,{next:g,text:d,onClick:()=>a(r+1)})]})})]})};function Sx(e){return null!==e&&"object"===typeof e&&"constructor"in e&&e.constructor===Object}function Ex(e,t){void 0===e&&(e={}),void 0===t&&(t={}),Object.keys(t).forEach((i=>{"undefined"===typeof e[i]?e[i]=t[i]:Sx(t[i])&&Sx(e[i])&&Object.keys(t[i]).length>0&&Ex(e[i],t[i])}))}const Cx={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector:()=>null,querySelectorAll:()=>[],getElementById:()=>null,createEvent:()=>({initEvent(){}}),createElement:()=>({children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName:()=>[]}),createElementNS:()=>({}),importNode:()=>null,location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function Ax(){const e="undefined"!==typeof document?document:{};return Ex(e,Cx),e}const Mx={document:Cx,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle:()=>({getPropertyValue:()=>""}),Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia:()=>({}),requestAnimationFrame:e=>"undefined"===typeof setTimeout?(e(),null):setTimeout(e,0),cancelAnimationFrame(e){"undefined"!==typeof setTimeout&&clearTimeout(e)}};function Tx(){const e="undefined"!==typeof window?window:{};return Ex(e,Mx),e}function Px(e,t){return void 0===t&&(t=0),setTimeout(e,t)}function Dx(){return Date.now()}function kx(e,t){void 0===t&&(t="x");const i=Tx();let n,r,a;const s=function(e){const t=Tx();let i;return t.getComputedStyle&&(i=t.getComputedStyle(e,null)),!i&&e.currentStyle&&(i=e.currentStyle),i||(i=e.style),i}(e);return i.WebKitCSSMatrix?(r=s.transform||s.webkitTransform,r.split(",").length>6&&(r=r.split(", ").map((e=>e.replace(",","."))).join(", ")),a=new i.WebKitCSSMatrix("none"===r?"":r)):(a=s.MozTransform||s.OTransform||s.MsTransform||s.msTransform||s.transform||s.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),n=a.toString().split(",")),"x"===t&&(r=i.WebKitCSSMatrix?a.m41:16===n.length?parseFloat(n[12]):parseFloat(n[4])),"y"===t&&(r=i.WebKitCSSMatrix?a.m42:16===n.length?parseFloat(n[13]):parseFloat(n[5])),r||0}function Ox(e){return"object"===typeof e&&null!==e&&e.constructor&&"Object"===Object.prototype.toString.call(e).slice(8,-1)}function Ix(){const e=Object(arguments.length<=0?void 0:arguments[0]),t=["__proto__","constructor","prototype"];for(let n=1;n<arguments.length;n+=1){const r=n<0||arguments.length<=n?void 0:arguments[n];if(void 0!==r&&null!==r&&(i=r,!("undefined"!==typeof window&&"undefined"!==typeof window.HTMLElement?i instanceof HTMLElement:i&&(1===i.nodeType||11===i.nodeType)))){const i=Object.keys(Object(r)).filter((e=>t.indexOf(e)<0));for(let t=0,n=i.length;t<n;t+=1){const n=i[t],a=Object.getOwnPropertyDescriptor(r,n);void 0!==a&&a.enumerable&&(Ox(e[n])&&Ox(r[n])?r[n].__swiper__?e[n]=r[n]:Ix(e[n],r[n]):!Ox(e[n])&&Ox(r[n])?(e[n]={},r[n].__swiper__?e[n]=r[n]:Ix(e[n],r[n])):e[n]=r[n])}}}var i;return e}function Rx(e,t,i){e.style.setProperty(t,i)}function Lx(e){let{swiper:t,targetPosition:i,side:n}=e;const r=Tx(),a=-t.translate;let s,o=null;const l=t.params.speed;t.wrapperEl.style.scrollSnapType="none",r.cancelAnimationFrame(t.cssModeFrameID);const c=i>a?"next":"prev",h=(e,t)=>"next"===c&&e>=t||"prev"===c&&e<=t,u=()=>{s=(new Date).getTime(),null===o&&(o=s);const e=Math.max(Math.min((s-o)/l,1),0),c=.5-Math.cos(e*Math.PI)/2;let d=a+c*(i-a);if(h(d,i)&&(d=i),t.wrapperEl.scrollTo({[n]:d}),h(d,i))return t.wrapperEl.style.overflow="hidden",t.wrapperEl.style.scrollSnapType="",setTimeout((()=>{t.wrapperEl.style.overflow="",t.wrapperEl.scrollTo({[n]:d})})),void r.cancelAnimationFrame(t.cssModeFrameID);t.cssModeFrameID=r.requestAnimationFrame(u)};u()}function Bx(e){return e.querySelector(".swiper-slide-transform")||e.shadowRoot&&e.shadowRoot.querySelector(".swiper-slide-transform")||e}function zx(e,t){return void 0===t&&(t=""),[...e.children].filter((e=>e.matches(t)))}function Nx(e,t){void 0===t&&(t=[]);const i=document.createElement(e);return i.classList.add(...Array.isArray(t)?t:[t]),i}function Fx(e,t){return Tx().getComputedStyle(e,null).getPropertyValue(t)}function jx(e){let t,i=e;if(i){for(t=0;null!==(i=i.previousSibling);)1===i.nodeType&&(t+=1);return t}}function Vx(e,t){const i=[];let n=e.parentElement;for(;n;)t?n.matches(t)&&i.push(n):i.push(n),n=n.parentElement;return i}function Ux(e,t,i){const n=Tx();return i?e["width"===t?"offsetWidth":"offsetHeight"]+parseFloat(n.getComputedStyle(e,null).getPropertyValue("width"===t?"margin-right":"margin-top"))+parseFloat(n.getComputedStyle(e,null).getPropertyValue("width"===t?"margin-left":"margin-bottom")):e.offsetWidth}let Gx,Hx,Wx;function qx(){return Gx||(Gx=function(){const e=Tx(),t=Ax();return{smoothScroll:t.documentElement&&t.documentElement.style&&"scrollBehavior"in t.documentElement.style,touch:!!("ontouchstart"in e||e.DocumentTouch&&t instanceof e.DocumentTouch)}}()),Gx}function Xx(e){return void 0===e&&(e={}),Hx||(Hx=function(e){let{userAgent:t}=void 0===e?{}:e;const i=qx(),n=Tx(),r=n.navigator.platform,a=t||n.navigator.userAgent,s={ios:!1,android:!1},o=n.screen.width,l=n.screen.height,c=a.match(/(Android);?[\s\/]+([\d.]+)?/);let h=a.match(/(iPad).*OS\s([\d_]+)/);const u=a.match(/(iPod)(.*OS\s([\d_]+))?/),d=!h&&a.match(/(iPhone\sOS|iOS)\s([\d_]+)/),p="Win32"===r;let f="MacIntel"===r;return!h&&f&&i.touch&&["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"].indexOf("".concat(o,"x").concat(l))>=0&&(h=a.match(/(Version)\/([\d.]+)/),h||(h=[0,1,"13_0_0"]),f=!1),c&&!p&&(s.os="android",s.android=!0),(h||d||u)&&(s.os="ios",s.ios=!0),s}(e)),Hx}function Yx(){return Wx||(Wx=function(){const e=Tx();let t=!1;function i(){const t=e.navigator.userAgent.toLowerCase();return t.indexOf("safari")>=0&&t.indexOf("chrome")<0&&t.indexOf("android")<0}if(i()){const i=String(e.navigator.userAgent);if(i.includes("Version/")){const[e,n]=i.split("Version/")[1].split(" ")[0].split(".").map((e=>Number(e)));t=e<16||16===e&&n<2}}return{isSafari:t||i(),needPerspectiveFix:t,isWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(e.navigator.userAgent)}}()),Wx}var Qx={on(e,t,i){const n=this;if(!n.eventsListeners||n.destroyed)return n;if("function"!==typeof t)return n;const r=i?"unshift":"push";return e.split(" ").forEach((e=>{n.eventsListeners[e]||(n.eventsListeners[e]=[]),n.eventsListeners[e][r](t)})),n},once(e,t,i){const n=this;if(!n.eventsListeners||n.destroyed)return n;if("function"!==typeof t)return n;function r(){n.off(e,r),r.__emitterProxy&&delete r.__emitterProxy;for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];t.apply(n,a)}return r.__emitterProxy=t,n.on(e,r,i)},onAny(e,t){const i=this;if(!i.eventsListeners||i.destroyed)return i;if("function"!==typeof e)return i;const n=t?"unshift":"push";return i.eventsAnyListeners.indexOf(e)<0&&i.eventsAnyListeners[n](e),i},offAny(e){const t=this;if(!t.eventsListeners||t.destroyed)return t;if(!t.eventsAnyListeners)return t;const i=t.eventsAnyListeners.indexOf(e);return i>=0&&t.eventsAnyListeners.splice(i,1),t},off(e,t){const i=this;return!i.eventsListeners||i.destroyed?i:i.eventsListeners?(e.split(" ").forEach((e=>{"undefined"===typeof t?i.eventsListeners[e]=[]:i.eventsListeners[e]&&i.eventsListeners[e].forEach(((n,r)=>{(n===t||n.__emitterProxy&&n.__emitterProxy===t)&&i.eventsListeners[e].splice(r,1)}))})),i):i},emit(){const e=this;if(!e.eventsListeners||e.destroyed)return e;if(!e.eventsListeners)return e;let t,i,n;for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];"string"===typeof a[0]||Array.isArray(a[0])?(t=a[0],i=a.slice(1,a.length),n=e):(t=a[0].events,i=a[0].data,n=a[0].context||e),i.unshift(n);return(Array.isArray(t)?t:t.split(" ")).forEach((t=>{e.eventsAnyListeners&&e.eventsAnyListeners.length&&e.eventsAnyListeners.forEach((e=>{e.apply(n,[t,...i])})),e.eventsListeners&&e.eventsListeners[t]&&e.eventsListeners[t].forEach((e=>{e.apply(n,i)}))})),e}};const Zx=(e,t)=>{if(!e||e.destroyed||!e.params)return;const i=t.closest(e.isElement?"swiper-slide":".".concat(e.params.slideClass));if(i){let t=i.querySelector(".".concat(e.params.lazyPreloaderClass));!t&&e.isElement&&(i.shadowRoot?t=i.shadowRoot.querySelector(".".concat(e.params.lazyPreloaderClass)):requestAnimationFrame((()=>{i.shadowRoot&&(t=i.shadowRoot.querySelector(".".concat(e.params.lazyPreloaderClass)),t&&t.remove())}))),t&&t.remove()}},Kx=(e,t)=>{if(!e.slides[t])return;const i=e.slides[t].querySelector('[loading="lazy"]');i&&i.removeAttribute("loading")},Jx=e=>{if(!e||e.destroyed||!e.params)return;let t=e.params.lazyPreloadPrevNext;const i=e.slides.length;if(!i||!t||t<0)return;t=Math.min(t,i);const n="auto"===e.params.slidesPerView?e.slidesPerViewDynamic():Math.ceil(e.params.slidesPerView),r=e.activeIndex;if(e.params.grid&&e.params.grid.rows>1){const i=r,a=[i-t];return a.push(...Array.from({length:t}).map(((e,t)=>i+n+t))),void e.slides.forEach(((t,i)=>{a.includes(t.column)&&Kx(e,i)}))}const a=r+n-1;if(e.params.rewind||e.params.loop)for(let s=r-t;s<=a+t;s+=1){const t=(s%i+i)%i;(t<r||t>a)&&Kx(e,t)}else for(let s=Math.max(r-t,0);s<=Math.min(a+t,i-1);s+=1)s!==r&&(s>a||s<r)&&Kx(e,s)};var $x={updateSize:function(){const e=this;let t,i;const n=e.el;t="undefined"!==typeof e.params.width&&null!==e.params.width?e.params.width:n.clientWidth,i="undefined"!==typeof e.params.height&&null!==e.params.height?e.params.height:n.clientHeight,0===t&&e.isHorizontal()||0===i&&e.isVertical()||(t=t-parseInt(Fx(n,"padding-left")||0,10)-parseInt(Fx(n,"padding-right")||0,10),i=i-parseInt(Fx(n,"padding-top")||0,10)-parseInt(Fx(n,"padding-bottom")||0,10),Number.isNaN(t)&&(t=0),Number.isNaN(i)&&(i=0),Object.assign(e,{width:t,height:i,size:e.isHorizontal()?t:i}))},updateSlides:function(){const e=this;function t(t){return e.isHorizontal()?t:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[t]}function i(e,i){return parseFloat(e.getPropertyValue(t(i))||0)}const n=e.params,{wrapperEl:r,slidesEl:a,size:s,rtlTranslate:o,wrongRTL:l}=e,c=e.virtual&&n.virtual.enabled,h=c?e.virtual.slides.length:e.slides.length,u=zx(a,".".concat(e.params.slideClass,", swiper-slide")),d=c?e.virtual.slides.length:u.length;let p=[];const f=[],m=[];let g=n.slidesOffsetBefore;"function"===typeof g&&(g=n.slidesOffsetBefore.call(e));let v=n.slidesOffsetAfter;"function"===typeof v&&(v=n.slidesOffsetAfter.call(e));const y=e.snapGrid.length,b=e.slidesGrid.length;let x=n.spaceBetween,w=-g,_=0,S=0;if("undefined"===typeof s)return;"string"===typeof x&&x.indexOf("%")>=0?x=parseFloat(x.replace("%",""))/100*s:"string"===typeof x&&(x=parseFloat(x)),e.virtualSize=-x,u.forEach((e=>{o?e.style.marginLeft="":e.style.marginRight="",e.style.marginBottom="",e.style.marginTop=""})),n.centeredSlides&&n.cssMode&&(Rx(r,"--swiper-centered-offset-before",""),Rx(r,"--swiper-centered-offset-after",""));const E=n.grid&&n.grid.rows>1&&e.grid;let C;E&&e.grid.initSlides(d);const A="auto"===n.slidesPerView&&n.breakpoints&&Object.keys(n.breakpoints).filter((e=>"undefined"!==typeof n.breakpoints[e].slidesPerView)).length>0;for(let M=0;M<d;M+=1){let r;if(C=0,u[M]&&(r=u[M]),E&&e.grid.updateSlide(M,r,d,t),!u[M]||"none"!==Fx(r,"display")){if("auto"===n.slidesPerView){A&&(u[M].style[t("width")]="");const a=getComputedStyle(r),s=r.style.transform,o=r.style.webkitTransform;if(s&&(r.style.transform="none"),o&&(r.style.webkitTransform="none"),n.roundLengths)C=e.isHorizontal()?Ux(r,"width",!0):Ux(r,"height",!0);else{const e=i(a,"width"),t=i(a,"padding-left"),n=i(a,"padding-right"),s=i(a,"margin-left"),o=i(a,"margin-right"),l=a.getPropertyValue("box-sizing");if(l&&"border-box"===l)C=e+s+o;else{const{clientWidth:i,offsetWidth:a}=r;C=e+t+n+s+o+(a-i)}}s&&(r.style.transform=s),o&&(r.style.webkitTransform=o),n.roundLengths&&(C=Math.floor(C))}else C=(s-(n.slidesPerView-1)*x)/n.slidesPerView,n.roundLengths&&(C=Math.floor(C)),u[M]&&(u[M].style[t("width")]="".concat(C,"px"));u[M]&&(u[M].swiperSlideSize=C),m.push(C),n.centeredSlides?(w=w+C/2+_/2+x,0===_&&0!==M&&(w=w-s/2-x),0===M&&(w=w-s/2-x),Math.abs(w)<.001&&(w=0),n.roundLengths&&(w=Math.floor(w)),S%n.slidesPerGroup===0&&p.push(w),f.push(w)):(n.roundLengths&&(w=Math.floor(w)),(S-Math.min(e.params.slidesPerGroupSkip,S))%e.params.slidesPerGroup===0&&p.push(w),f.push(w),w=w+C+x),e.virtualSize+=C+x,_=C,S+=1}}if(e.virtualSize=Math.max(e.virtualSize,s)+v,o&&l&&("slide"===n.effect||"coverflow"===n.effect)&&(r.style.width="".concat(e.virtualSize+x,"px")),n.setWrapperSize&&(r.style[t("width")]="".concat(e.virtualSize+x,"px")),E&&e.grid.updateWrapperSize(C,p,t),!n.centeredSlides){const t=[];for(let i=0;i<p.length;i+=1){let r=p[i];n.roundLengths&&(r=Math.floor(r)),p[i]<=e.virtualSize-s&&t.push(r)}p=t,Math.floor(e.virtualSize-s)-Math.floor(p[p.length-1])>1&&p.push(e.virtualSize-s)}if(c&&n.loop){const t=m[0]+x;if(n.slidesPerGroup>1){const i=Math.ceil((e.virtual.slidesBefore+e.virtual.slidesAfter)/n.slidesPerGroup),r=t*n.slidesPerGroup;for(let e=0;e<i;e+=1)p.push(p[p.length-1]+r)}for(let i=0;i<e.virtual.slidesBefore+e.virtual.slidesAfter;i+=1)1===n.slidesPerGroup&&p.push(p[p.length-1]+t),f.push(f[f.length-1]+t),e.virtualSize+=t}if(0===p.length&&(p=[0]),0!==x){const i=e.isHorizontal()&&o?"marginLeft":t("marginRight");u.filter(((e,t)=>!(n.cssMode&&!n.loop)||t!==u.length-1)).forEach((e=>{e.style[i]="".concat(x,"px")}))}if(n.centeredSlides&&n.centeredSlidesBounds){let e=0;m.forEach((t=>{e+=t+(x||0)})),e-=x;const t=e-s;p=p.map((e=>e<=0?-g:e>t?t+v:e))}if(n.centerInsufficientSlides){let e=0;if(m.forEach((t=>{e+=t+(x||0)})),e-=x,e<s){const t=(s-e)/2;p.forEach(((e,i)=>{p[i]=e-t})),f.forEach(((e,i)=>{f[i]=e+t}))}}if(Object.assign(e,{slides:u,snapGrid:p,slidesGrid:f,slidesSizesGrid:m}),n.centeredSlides&&n.cssMode&&!n.centeredSlidesBounds){Rx(r,"--swiper-centered-offset-before","".concat(-p[0],"px")),Rx(r,"--swiper-centered-offset-after","".concat(e.size/2-m[m.length-1]/2,"px"));const t=-e.snapGrid[0],i=-e.slidesGrid[0];e.snapGrid=e.snapGrid.map((e=>e+t)),e.slidesGrid=e.slidesGrid.map((e=>e+i))}if(d!==h&&e.emit("slidesLengthChange"),p.length!==y&&(e.params.watchOverflow&&e.checkOverflow(),e.emit("snapGridLengthChange")),f.length!==b&&e.emit("slidesGridLengthChange"),n.watchSlidesProgress&&e.updateSlidesOffset(),!c&&!n.cssMode&&("slide"===n.effect||"fade"===n.effect)){const t="".concat(n.containerModifierClass,"backface-hidden"),i=e.el.classList.contains(t);d<=n.maxBackfaceHiddenSlides?i||e.el.classList.add(t):i&&e.el.classList.remove(t)}},updateAutoHeight:function(e){const t=this,i=[],n=t.virtual&&t.params.virtual.enabled;let r,a=0;"number"===typeof e?t.setTransition(e):!0===e&&t.setTransition(t.params.speed);const s=e=>n?t.slides[t.getSlideIndexByData(e)]:t.slides[e];if("auto"!==t.params.slidesPerView&&t.params.slidesPerView>1)if(t.params.centeredSlides)(t.visibleSlides||[]).forEach((e=>{i.push(e)}));else for(r=0;r<Math.ceil(t.params.slidesPerView);r+=1){const e=t.activeIndex+r;if(e>t.slides.length&&!n)break;i.push(s(e))}else i.push(s(t.activeIndex));for(r=0;r<i.length;r+=1)if("undefined"!==typeof i[r]){const e=i[r].offsetHeight;a=e>a?e:a}(a||0===a)&&(t.wrapperEl.style.height="".concat(a,"px"))},updateSlidesOffset:function(){const e=this,t=e.slides,i=e.isElement?e.isHorizontal()?e.wrapperEl.offsetLeft:e.wrapperEl.offsetTop:0;for(let n=0;n<t.length;n+=1)t[n].swiperSlideOffset=(e.isHorizontal()?t[n].offsetLeft:t[n].offsetTop)-i-e.cssOverflowAdjustment()},updateSlidesProgress:function(e){void 0===e&&(e=this&&this.translate||0);const t=this,i=t.params,{slides:n,rtlTranslate:r,snapGrid:a}=t;if(0===n.length)return;"undefined"===typeof n[0].swiperSlideOffset&&t.updateSlidesOffset();let s=-e;r&&(s=e),n.forEach((e=>{e.classList.remove(i.slideVisibleClass)})),t.visibleSlidesIndexes=[],t.visibleSlides=[];let o=i.spaceBetween;"string"===typeof o&&o.indexOf("%")>=0?o=parseFloat(o.replace("%",""))/100*t.size:"string"===typeof o&&(o=parseFloat(o));for(let l=0;l<n.length;l+=1){const e=n[l];let c=e.swiperSlideOffset;i.cssMode&&i.centeredSlides&&(c-=n[0].swiperSlideOffset);const h=(s+(i.centeredSlides?t.minTranslate():0)-c)/(e.swiperSlideSize+o),u=(s-a[0]+(i.centeredSlides?t.minTranslate():0)-c)/(e.swiperSlideSize+o),d=-(s-c),p=d+t.slidesSizesGrid[l];(d>=0&&d<t.size-1||p>1&&p<=t.size||d<=0&&p>=t.size)&&(t.visibleSlides.push(e),t.visibleSlidesIndexes.push(l),n[l].classList.add(i.slideVisibleClass)),e.progress=r?-h:h,e.originalProgress=r?-u:u}},updateProgress:function(e){const t=this;if("undefined"===typeof e){const i=t.rtlTranslate?-1:1;e=t&&t.translate&&t.translate*i||0}const i=t.params,n=t.maxTranslate()-t.minTranslate();let{progress:r,isBeginning:a,isEnd:s,progressLoop:o}=t;const l=a,c=s;if(0===n)r=0,a=!0,s=!0;else{r=(e-t.minTranslate())/n;const i=Math.abs(e-t.minTranslate())<1,o=Math.abs(e-t.maxTranslate())<1;a=i||r<=0,s=o||r>=1,i&&(r=0),o&&(r=1)}if(i.loop){const i=t.getSlideIndexByData(0),n=t.getSlideIndexByData(t.slides.length-1),r=t.slidesGrid[i],a=t.slidesGrid[n],s=t.slidesGrid[t.slidesGrid.length-1],l=Math.abs(e);o=l>=r?(l-r)/s:(l+s-a)/s,o>1&&(o-=1)}Object.assign(t,{progress:r,progressLoop:o,isBeginning:a,isEnd:s}),(i.watchSlidesProgress||i.centeredSlides&&i.autoHeight)&&t.updateSlidesProgress(e),a&&!l&&t.emit("reachBeginning toEdge"),s&&!c&&t.emit("reachEnd toEdge"),(l&&!a||c&&!s)&&t.emit("fromEdge"),t.emit("progress",r)},updateSlidesClasses:function(){const e=this,{slides:t,params:i,slidesEl:n,activeIndex:r}=e,a=e.virtual&&i.virtual.enabled,s=e=>zx(n,".".concat(i.slideClass).concat(e,", swiper-slide").concat(e))[0];let o;if(t.forEach((e=>{e.classList.remove(i.slideActiveClass,i.slideNextClass,i.slidePrevClass)})),a)if(i.loop){let t=r-e.virtual.slidesBefore;t<0&&(t=e.virtual.slides.length+t),t>=e.virtual.slides.length&&(t-=e.virtual.slides.length),o=s('[data-swiper-slide-index="'.concat(t,'"]'))}else o=s('[data-swiper-slide-index="'.concat(r,'"]'));else o=t[r];if(o){o.classList.add(i.slideActiveClass);let e=function(e,t){const i=[];for(;e.nextElementSibling;){const n=e.nextElementSibling;t?n.matches(t)&&i.push(n):i.push(n),e=n}return i}(o,".".concat(i.slideClass,", swiper-slide"))[0];i.loop&&!e&&(e=t[0]),e&&e.classList.add(i.slideNextClass);let n=function(e,t){const i=[];for(;e.previousElementSibling;){const n=e.previousElementSibling;t?n.matches(t)&&i.push(n):i.push(n),e=n}return i}(o,".".concat(i.slideClass,", swiper-slide"))[0];i.loop&&0===!n&&(n=t[t.length-1]),n&&n.classList.add(i.slidePrevClass)}e.emitSlidesClasses()},updateActiveIndex:function(e){const t=this,i=t.rtlTranslate?t.translate:-t.translate,{snapGrid:n,params:r,activeIndex:a,realIndex:s,snapIndex:o}=t;let l,c=e;const h=e=>{let i=e-t.virtual.slidesBefore;return i<0&&(i=t.virtual.slides.length+i),i>=t.virtual.slides.length&&(i-=t.virtual.slides.length),i};if("undefined"===typeof c&&(c=function(e){const{slidesGrid:t,params:i}=e,n=e.rtlTranslate?e.translate:-e.translate;let r;for(let a=0;a<t.length;a+=1)"undefined"!==typeof t[a+1]?n>=t[a]&&n<t[a+1]-(t[a+1]-t[a])/2?r=a:n>=t[a]&&n<t[a+1]&&(r=a+1):n>=t[a]&&(r=a);return i.normalizeSlideIndex&&(r<0||"undefined"===typeof r)&&(r=0),r}(t)),n.indexOf(i)>=0)l=n.indexOf(i);else{const e=Math.min(r.slidesPerGroupSkip,c);l=e+Math.floor((c-e)/r.slidesPerGroup)}if(l>=n.length&&(l=n.length-1),c===a)return l!==o&&(t.snapIndex=l,t.emit("snapIndexChange")),void(t.params.loop&&t.virtual&&t.params.virtual.enabled&&(t.realIndex=h(c)));let u;u=t.virtual&&r.virtual.enabled&&r.loop?h(c):t.slides[c]?parseInt(t.slides[c].getAttribute("data-swiper-slide-index")||c,10):c,Object.assign(t,{previousSnapIndex:o,snapIndex:l,previousRealIndex:s,realIndex:u,previousIndex:a,activeIndex:c}),t.initialized&&Jx(t),t.emit("activeIndexChange"),t.emit("snapIndexChange"),(t.initialized||t.params.runCallbacksOnInit)&&(s!==u&&t.emit("realIndexChange"),t.emit("slideChange"))},updateClickedSlide:function(e,t){const i=this,n=i.params;let r=e.closest(".".concat(n.slideClass,", swiper-slide"));!r&&i.isElement&&t&&t.length>1&&t.includes(e)&&[...t.slice(t.indexOf(e)+1,t.length)].forEach((e=>{!r&&e.matches&&e.matches(".".concat(n.slideClass,", swiper-slide"))&&(r=e)}));let a,s=!1;if(r)for(let o=0;o<i.slides.length;o+=1)if(i.slides[o]===r){s=!0,a=o;break}if(!r||!s)return i.clickedSlide=void 0,void(i.clickedIndex=void 0);i.clickedSlide=r,i.virtual&&i.params.virtual.enabled?i.clickedIndex=parseInt(r.getAttribute("data-swiper-slide-index"),10):i.clickedIndex=a,n.slideToClickedSlide&&void 0!==i.clickedIndex&&i.clickedIndex!==i.activeIndex&&i.slideToClickedSlide()}};var ew={getTranslate:function(e){void 0===e&&(e=this.isHorizontal()?"x":"y");const{params:t,rtlTranslate:i,translate:n,wrapperEl:r}=this;if(t.virtualTranslate)return i?-n:n;if(t.cssMode)return n;let a=kx(r,e);return a+=this.cssOverflowAdjustment(),i&&(a=-a),a||0},setTranslate:function(e,t){const i=this,{rtlTranslate:n,params:r,wrapperEl:a,progress:s}=i;let o,l=0,c=0;i.isHorizontal()?l=n?-e:e:c=e,r.roundLengths&&(l=Math.floor(l),c=Math.floor(c)),i.previousTranslate=i.translate,i.translate=i.isHorizontal()?l:c,r.cssMode?a[i.isHorizontal()?"scrollLeft":"scrollTop"]=i.isHorizontal()?-l:-c:r.virtualTranslate||(i.isHorizontal()?l-=i.cssOverflowAdjustment():c-=i.cssOverflowAdjustment(),a.style.transform="translate3d(".concat(l,"px, ").concat(c,"px, ").concat(0,"px)"));const h=i.maxTranslate()-i.minTranslate();o=0===h?0:(e-i.minTranslate())/h,o!==s&&i.updateProgress(e),i.emit("setTranslate",i.translate,t)},minTranslate:function(){return-this.snapGrid[0]},maxTranslate:function(){return-this.snapGrid[this.snapGrid.length-1]},translateTo:function(e,t,i,n,r){void 0===e&&(e=0),void 0===t&&(t=this.params.speed),void 0===i&&(i=!0),void 0===n&&(n=!0);const a=this,{params:s,wrapperEl:o}=a;if(a.animating&&s.preventInteractionOnTransition)return!1;const l=a.minTranslate(),c=a.maxTranslate();let h;if(h=n&&e>l?l:n&&e<c?c:e,a.updateProgress(h),s.cssMode){const e=a.isHorizontal();if(0===t)o[e?"scrollLeft":"scrollTop"]=-h;else{if(!a.support.smoothScroll)return Lx({swiper:a,targetPosition:-h,side:e?"left":"top"}),!0;o.scrollTo({[e?"left":"top"]:-h,behavior:"smooth"})}return!0}return 0===t?(a.setTransition(0),a.setTranslate(h),i&&(a.emit("beforeTransitionStart",t,r),a.emit("transitionEnd"))):(a.setTransition(t),a.setTranslate(h),i&&(a.emit("beforeTransitionStart",t,r),a.emit("transitionStart")),a.animating||(a.animating=!0,a.onTranslateToWrapperTransitionEnd||(a.onTranslateToWrapperTransitionEnd=function(e){a&&!a.destroyed&&e.target===this&&(a.wrapperEl.removeEventListener("transitionend",a.onTranslateToWrapperTransitionEnd),a.onTranslateToWrapperTransitionEnd=null,delete a.onTranslateToWrapperTransitionEnd,i&&a.emit("transitionEnd"))}),a.wrapperEl.addEventListener("transitionend",a.onTranslateToWrapperTransitionEnd))),!0}};function tw(e){let{swiper:t,runCallbacks:i,direction:n,step:r}=e;const{activeIndex:a,previousIndex:s}=t;let o=n;if(o||(o=a>s?"next":a<s?"prev":"reset"),t.emit("transition".concat(r)),i&&a!==s){if("reset"===o)return void t.emit("slideResetTransition".concat(r));t.emit("slideChangeTransition".concat(r)),"next"===o?t.emit("slideNextTransition".concat(r)):t.emit("slidePrevTransition".concat(r))}}var iw={setTransition:function(e,t){const i=this;i.params.cssMode||(i.wrapperEl.style.transitionDuration="".concat(e,"ms"),i.wrapperEl.style.transitionDelay=0===e?"0ms":""),i.emit("setTransition",e,t)},transitionStart:function(e,t){void 0===e&&(e=!0);const i=this,{params:n}=i;n.cssMode||(n.autoHeight&&i.updateAutoHeight(),tw({swiper:i,runCallbacks:e,direction:t,step:"Start"}))},transitionEnd:function(e,t){void 0===e&&(e=!0);const i=this,{params:n}=i;i.animating=!1,n.cssMode||(i.setTransition(0),tw({swiper:i,runCallbacks:e,direction:t,step:"End"}))}};var nw={slideTo:function(e,t,i,n,r){void 0===e&&(e=0),void 0===t&&(t=this.params.speed),void 0===i&&(i=!0),"string"===typeof e&&(e=parseInt(e,10));const a=this;let s=e;s<0&&(s=0);const{params:o,snapGrid:l,slidesGrid:c,previousIndex:h,activeIndex:u,rtlTranslate:d,wrapperEl:p,enabled:f}=a;if(a.animating&&o.preventInteractionOnTransition||!f&&!n&&!r)return!1;const m=Math.min(a.params.slidesPerGroupSkip,s);let g=m+Math.floor((s-m)/a.params.slidesPerGroup);g>=l.length&&(g=l.length-1);const v=-l[g];if(o.normalizeSlideIndex)for(let b=0;b<c.length;b+=1){const e=-Math.floor(100*v),t=Math.floor(100*c[b]),i=Math.floor(100*c[b+1]);"undefined"!==typeof c[b+1]?e>=t&&e<i-(i-t)/2?s=b:e>=t&&e<i&&(s=b+1):e>=t&&(s=b)}if(a.initialized&&s!==u){if(!a.allowSlideNext&&(d?v>a.translate&&v>a.minTranslate():v<a.translate&&v<a.minTranslate()))return!1;if(!a.allowSlidePrev&&v>a.translate&&v>a.maxTranslate()&&(u||0)!==s)return!1}let y;if(s!==(h||0)&&i&&a.emit("beforeSlideChangeStart"),a.updateProgress(v),y=s>u?"next":s<u?"prev":"reset",d&&-v===a.translate||!d&&v===a.translate)return a.updateActiveIndex(s),o.autoHeight&&a.updateAutoHeight(),a.updateSlidesClasses(),"slide"!==o.effect&&a.setTranslate(v),"reset"!==y&&(a.transitionStart(i,y),a.transitionEnd(i,y)),!1;if(o.cssMode){const e=a.isHorizontal(),i=d?v:-v;if(0===t){const t=a.virtual&&a.params.virtual.enabled;t&&(a.wrapperEl.style.scrollSnapType="none",a._immediateVirtual=!0),t&&!a._cssModeVirtualInitialSet&&a.params.initialSlide>0?(a._cssModeVirtualInitialSet=!0,requestAnimationFrame((()=>{p[e?"scrollLeft":"scrollTop"]=i}))):p[e?"scrollLeft":"scrollTop"]=i,t&&requestAnimationFrame((()=>{a.wrapperEl.style.scrollSnapType="",a._immediateVirtual=!1}))}else{if(!a.support.smoothScroll)return Lx({swiper:a,targetPosition:i,side:e?"left":"top"}),!0;p.scrollTo({[e?"left":"top"]:i,behavior:"smooth"})}return!0}return a.setTransition(t),a.setTranslate(v),a.updateActiveIndex(s),a.updateSlidesClasses(),a.emit("beforeTransitionStart",t,n),a.transitionStart(i,y),0===t?a.transitionEnd(i,y):a.animating||(a.animating=!0,a.onSlideToWrapperTransitionEnd||(a.onSlideToWrapperTransitionEnd=function(e){a&&!a.destroyed&&e.target===this&&(a.wrapperEl.removeEventListener("transitionend",a.onSlideToWrapperTransitionEnd),a.onSlideToWrapperTransitionEnd=null,delete a.onSlideToWrapperTransitionEnd,a.transitionEnd(i,y))}),a.wrapperEl.addEventListener("transitionend",a.onSlideToWrapperTransitionEnd)),!0},slideToLoop:function(e,t,i,n){if(void 0===e&&(e=0),void 0===t&&(t=this.params.speed),void 0===i&&(i=!0),"string"===typeof e){e=parseInt(e,10)}const r=this;let a=e;return r.params.loop&&(r.virtual&&r.params.virtual.enabled?a+=r.virtual.slidesBefore:a=r.getSlideIndexByData(a)),r.slideTo(a,t,i,n)},slideNext:function(e,t,i){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0);const n=this,{enabled:r,params:a,animating:s}=n;if(!r)return n;let o=a.slidesPerGroup;"auto"===a.slidesPerView&&1===a.slidesPerGroup&&a.slidesPerGroupAuto&&(o=Math.max(n.slidesPerViewDynamic("current",!0),1));const l=n.activeIndex<a.slidesPerGroupSkip?1:o,c=n.virtual&&a.virtual.enabled;if(a.loop){if(s&&!c&&a.loopPreventsSliding)return!1;if(n.loopFix({direction:"next"}),n._clientLeft=n.wrapperEl.clientLeft,n.activeIndex===n.slides.length-1&&a.cssMode)return requestAnimationFrame((()=>{n.slideTo(n.activeIndex+l,e,t,i)})),!0}return a.rewind&&n.isEnd?n.slideTo(0,e,t,i):n.slideTo(n.activeIndex+l,e,t,i)},slidePrev:function(e,t,i){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0);const n=this,{params:r,snapGrid:a,slidesGrid:s,rtlTranslate:o,enabled:l,animating:c}=n;if(!l)return n;const h=n.virtual&&r.virtual.enabled;if(r.loop){if(c&&!h&&r.loopPreventsSliding)return!1;n.loopFix({direction:"prev"}),n._clientLeft=n.wrapperEl.clientLeft}function u(e){return e<0?-Math.floor(Math.abs(e)):Math.floor(e)}const d=u(o?n.translate:-n.translate),p=a.map((e=>u(e)));let f=a[p.indexOf(d)-1];if("undefined"===typeof f&&r.cssMode){let e;a.forEach(((t,i)=>{d>=t&&(e=i)})),"undefined"!==typeof e&&(f=a[e>0?e-1:e])}let m=0;if("undefined"!==typeof f&&(m=s.indexOf(f),m<0&&(m=n.activeIndex-1),"auto"===r.slidesPerView&&1===r.slidesPerGroup&&r.slidesPerGroupAuto&&(m=m-n.slidesPerViewDynamic("previous",!0)+1,m=Math.max(m,0))),r.rewind&&n.isBeginning){const r=n.params.virtual&&n.params.virtual.enabled&&n.virtual?n.virtual.slides.length-1:n.slides.length-1;return n.slideTo(r,e,t,i)}return r.loop&&0===n.activeIndex&&r.cssMode?(requestAnimationFrame((()=>{n.slideTo(m,e,t,i)})),!0):n.slideTo(m,e,t,i)},slideReset:function(e,t,i){return void 0===e&&(e=this.params.speed),void 0===t&&(t=!0),this.slideTo(this.activeIndex,e,t,i)},slideToClosest:function(e,t,i,n){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0),void 0===n&&(n=.5);const r=this;let a=r.activeIndex;const s=Math.min(r.params.slidesPerGroupSkip,a),o=s+Math.floor((a-s)/r.params.slidesPerGroup),l=r.rtlTranslate?r.translate:-r.translate;if(l>=r.snapGrid[o]){const e=r.snapGrid[o];l-e>(r.snapGrid[o+1]-e)*n&&(a+=r.params.slidesPerGroup)}else{const e=r.snapGrid[o-1];l-e<=(r.snapGrid[o]-e)*n&&(a-=r.params.slidesPerGroup)}return a=Math.max(a,0),a=Math.min(a,r.slidesGrid.length-1),r.slideTo(a,e,t,i)},slideToClickedSlide:function(){const e=this,{params:t,slidesEl:i}=e,n="auto"===t.slidesPerView?e.slidesPerViewDynamic():t.slidesPerView;let r,a=e.clickedIndex;const s=e.isElement?"swiper-slide":".".concat(t.slideClass);if(t.loop){if(e.animating)return;r=parseInt(e.clickedSlide.getAttribute("data-swiper-slide-index"),10),t.centeredSlides?a<e.loopedSlides-n/2||a>e.slides.length-e.loopedSlides+n/2?(e.loopFix(),a=e.getSlideIndex(zx(i,"".concat(s,'[data-swiper-slide-index="').concat(r,'"]'))[0]),Px((()=>{e.slideTo(a)}))):e.slideTo(a):a>e.slides.length-n?(e.loopFix(),a=e.getSlideIndex(zx(i,"".concat(s,'[data-swiper-slide-index="').concat(r,'"]'))[0]),Px((()=>{e.slideTo(a)}))):e.slideTo(a)}else e.slideTo(a)}};var rw={loopCreate:function(e){const t=this,{params:i,slidesEl:n}=t;if(!i.loop||t.virtual&&t.params.virtual.enabled)return;zx(n,".".concat(i.slideClass,", swiper-slide")).forEach(((e,t)=>{e.setAttribute("data-swiper-slide-index",t)})),t.loopFix({slideRealIndex:e,direction:i.centeredSlides?void 0:"next"})},loopFix:function(e){let{slideRealIndex:t,slideTo:i=!0,direction:n,setTranslate:r,activeSlideIndex:a,byController:s,byMousewheel:o}=void 0===e?{}:e;const l=this;if(!l.params.loop)return;l.emit("beforeLoopFix");const{slides:c,allowSlidePrev:h,allowSlideNext:u,slidesEl:d,params:p}=l;if(l.allowSlidePrev=!0,l.allowSlideNext=!0,l.virtual&&p.virtual.enabled)return i&&(p.centeredSlides||0!==l.snapIndex?p.centeredSlides&&l.snapIndex<p.slidesPerView?l.slideTo(l.virtual.slides.length+l.snapIndex,0,!1,!0):l.snapIndex===l.snapGrid.length-1&&l.slideTo(l.virtual.slidesBefore,0,!1,!0):l.slideTo(l.virtual.slides.length,0,!1,!0)),l.allowSlidePrev=h,l.allowSlideNext=u,void l.emit("loopFix");const f="auto"===p.slidesPerView?l.slidesPerViewDynamic():Math.ceil(parseFloat(p.slidesPerView,10));let m=p.loopedSlides||f;m%p.slidesPerGroup!==0&&(m+=p.slidesPerGroup-m%p.slidesPerGroup),l.loopedSlides=m;const g=[],v=[];let y=l.activeIndex;"undefined"===typeof a?a=l.getSlideIndex(l.slides.filter((e=>e.classList.contains(p.slideActiveClass)))[0]):y=a;const b="next"===n||!n,x="prev"===n||!n;let w=0,_=0;if(a<m){w=Math.max(m-a,p.slidesPerGroup);for(let e=0;e<m-a;e+=1){const t=e-Math.floor(e/c.length)*c.length;g.push(c.length-t-1)}}else if(a>l.slides.length-2*m){_=Math.max(a-(l.slides.length-2*m),p.slidesPerGroup);for(let e=0;e<_;e+=1){const t=e-Math.floor(e/c.length)*c.length;v.push(t)}}if(x&&g.forEach((e=>{l.slides[e].swiperLoopMoveDOM=!0,d.prepend(l.slides[e]),l.slides[e].swiperLoopMoveDOM=!1})),b&&v.forEach((e=>{l.slides[e].swiperLoopMoveDOM=!0,d.append(l.slides[e]),l.slides[e].swiperLoopMoveDOM=!1})),l.recalcSlides(),"auto"===p.slidesPerView&&l.updateSlides(),p.watchSlidesProgress&&l.updateSlidesOffset(),i)if(g.length>0&&x)if("undefined"===typeof t){const e=l.slidesGrid[y],t=l.slidesGrid[y+w]-e;o?l.setTranslate(l.translate-t):(l.slideTo(y+w,0,!1,!0),r&&(l.touches[l.isHorizontal()?"startX":"startY"]+=t,l.touchEventsData.currentTranslate=l.translate))}else r&&(l.slideToLoop(t,0,!1,!0),l.touchEventsData.currentTranslate=l.translate);else if(v.length>0&&b)if("undefined"===typeof t){const e=l.slidesGrid[y],t=l.slidesGrid[y-_]-e;o?l.setTranslate(l.translate-t):(l.slideTo(y-_,0,!1,!0),r&&(l.touches[l.isHorizontal()?"startX":"startY"]+=t,l.touchEventsData.currentTranslate=l.translate))}else l.slideToLoop(t,0,!1,!0);if(l.allowSlidePrev=h,l.allowSlideNext=u,l.controller&&l.controller.control&&!s){const e={slideRealIndex:t,direction:n,setTranslate:r,activeSlideIndex:a,byController:!0};Array.isArray(l.controller.control)?l.controller.control.forEach((t=>{!t.destroyed&&t.params.loop&&t.loopFix({...e,slideTo:t.params.slidesPerView===p.slidesPerView&&i})})):l.controller.control instanceof l.constructor&&l.controller.control.params.loop&&l.controller.control.loopFix({...e,slideTo:l.controller.control.params.slidesPerView===p.slidesPerView&&i})}l.emit("loopFix")},loopDestroy:function(){const e=this,{params:t,slidesEl:i}=e;if(!t.loop||e.virtual&&e.params.virtual.enabled)return;e.recalcSlides();const n=[];e.slides.forEach((e=>{const t="undefined"===typeof e.swiperSlideIndex?1*e.getAttribute("data-swiper-slide-index"):e.swiperSlideIndex;n[t]=e})),e.slides.forEach((e=>{e.removeAttribute("data-swiper-slide-index")})),n.forEach((e=>{i.append(e)})),e.recalcSlides(),e.slideTo(e.realIndex,0)}};var aw={setGrabCursor:function(e){const t=this;if(!t.params.simulateTouch||t.params.watchOverflow&&t.isLocked||t.params.cssMode)return;const i="container"===t.params.touchEventsTarget?t.el:t.wrapperEl;t.isElement&&(t.__preventObserver__=!0),i.style.cursor="move",i.style.cursor=e?"grabbing":"grab",t.isElement&&requestAnimationFrame((()=>{t.__preventObserver__=!1}))},unsetGrabCursor:function(){const e=this;e.params.watchOverflow&&e.isLocked||e.params.cssMode||(e.isElement&&(e.__preventObserver__=!0),e["container"===e.params.touchEventsTarget?"el":"wrapperEl"].style.cursor="",e.isElement&&requestAnimationFrame((()=>{e.__preventObserver__=!1})))}};function sw(e){const t=this,i=Ax(),n=Tx(),r=t.touchEventsData;r.evCache.push(e);const{params:a,touches:s,enabled:o}=t;if(!o)return;if(!a.simulateTouch&&"mouse"===e.pointerType)return;if(t.animating&&a.preventInteractionOnTransition)return;!t.animating&&a.cssMode&&a.loop&&t.loopFix();let l=e;l.originalEvent&&(l=l.originalEvent);let c=l.target;if("wrapper"===a.touchEventsTarget&&!t.wrapperEl.contains(c))return;if("which"in l&&3===l.which)return;if("button"in l&&l.button>0)return;if(r.isTouched&&r.isMoved)return;const h=!!a.noSwipingClass&&""!==a.noSwipingClass,u=e.composedPath?e.composedPath():e.path;h&&l.target&&l.target.shadowRoot&&u&&(c=u[0]);const d=a.noSwipingSelector?a.noSwipingSelector:".".concat(a.noSwipingClass),p=!(!l.target||!l.target.shadowRoot);if(a.noSwiping&&(p?function(e,t){return void 0===t&&(t=this),function t(i){if(!i||i===Ax()||i===Tx())return null;i.assignedSlot&&(i=i.assignedSlot);const n=i.closest(e);return n||i.getRootNode?n||t(i.getRootNode().host):null}(t)}(d,c):c.closest(d)))return void(t.allowClick=!0);if(a.swipeHandler&&!c.closest(a.swipeHandler))return;s.currentX=l.pageX,s.currentY=l.pageY;const f=s.currentX,m=s.currentY,g=a.edgeSwipeDetection||a.iOSEdgeSwipeDetection,v=a.edgeSwipeThreshold||a.iOSEdgeSwipeThreshold;if(g&&(f<=v||f>=n.innerWidth-v)){if("prevent"!==g)return;e.preventDefault()}Object.assign(r,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),s.startX=f,s.startY=m,r.touchStartTime=Dx(),t.allowClick=!0,t.updateSize(),t.swipeDirection=void 0,a.threshold>0&&(r.allowThresholdMove=!1);let y=!0;c.matches(r.focusableElements)&&(y=!1,"SELECT"===c.nodeName&&(r.isTouched=!1)),i.activeElement&&i.activeElement.matches(r.focusableElements)&&i.activeElement!==c&&i.activeElement.blur();const b=y&&t.allowTouchMove&&a.touchStartPreventDefault;!a.touchStartForcePreventDefault&&!b||c.isContentEditable||l.preventDefault(),a.freeMode&&a.freeMode.enabled&&t.freeMode&&t.animating&&!a.cssMode&&t.freeMode.onTouchStart(),t.emit("touchStart",l)}function ow(e){const t=Ax(),i=this,n=i.touchEventsData,{params:r,touches:a,rtlTranslate:s,enabled:o}=i;if(!o)return;if(!r.simulateTouch&&"mouse"===e.pointerType)return;let l=e;if(l.originalEvent&&(l=l.originalEvent),!n.isTouched)return void(n.startMoving&&n.isScrolling&&i.emit("touchMoveOpposite",l));const c=n.evCache.findIndex((e=>e.pointerId===l.pointerId));c>=0&&(n.evCache[c]=l);const h=n.evCache.length>1?n.evCache[0]:l,u=h.pageX,d=h.pageY;if(l.preventedByNestedSwiper)return a.startX=u,void(a.startY=d);if(!i.allowTouchMove)return l.target.matches(n.focusableElements)||(i.allowClick=!1),void(n.isTouched&&(Object.assign(a,{startX:u,startY:d,prevX:i.touches.currentX,prevY:i.touches.currentY,currentX:u,currentY:d}),n.touchStartTime=Dx()));if(r.touchReleaseOnEdges&&!r.loop)if(i.isVertical()){if(d<a.startY&&i.translate<=i.maxTranslate()||d>a.startY&&i.translate>=i.minTranslate())return n.isTouched=!1,void(n.isMoved=!1)}else if(u<a.startX&&i.translate<=i.maxTranslate()||u>a.startX&&i.translate>=i.minTranslate())return;if(t.activeElement&&l.target===t.activeElement&&l.target.matches(n.focusableElements))return n.isMoved=!0,void(i.allowClick=!1);if(n.allowTouchCallbacks&&i.emit("touchMove",l),l.targetTouches&&l.targetTouches.length>1)return;a.currentX=u,a.currentY=d;const p=a.currentX-a.startX,f=a.currentY-a.startY;if(i.params.threshold&&Math.sqrt(p**2+f**2)<i.params.threshold)return;if("undefined"===typeof n.isScrolling){let e;i.isHorizontal()&&a.currentY===a.startY||i.isVertical()&&a.currentX===a.startX?n.isScrolling=!1:p*p+f*f>=25&&(e=180*Math.atan2(Math.abs(f),Math.abs(p))/Math.PI,n.isScrolling=i.isHorizontal()?e>r.touchAngle:90-e>r.touchAngle)}if(n.isScrolling&&i.emit("touchMoveOpposite",l),"undefined"===typeof n.startMoving&&(a.currentX===a.startX&&a.currentY===a.startY||(n.startMoving=!0)),n.isScrolling||i.zoom&&i.params.zoom&&i.params.zoom.enabled&&n.evCache.length>1)return void(n.isTouched=!1);if(!n.startMoving)return;i.allowClick=!1,!r.cssMode&&l.cancelable&&l.preventDefault(),r.touchMoveStopPropagation&&!r.nested&&l.stopPropagation();let m=i.isHorizontal()?p:f,g=i.isHorizontal()?a.currentX-a.previousX:a.currentY-a.previousY;r.oneWayMovement&&(m=Math.abs(m)*(s?1:-1),g=Math.abs(g)*(s?1:-1)),a.diff=m,m*=r.touchRatio,s&&(m=-m,g=-g);const v=i.touchesDirection;i.swipeDirection=m>0?"prev":"next",i.touchesDirection=g>0?"prev":"next";const y=i.params.loop&&!r.cssMode,b="next"===i.swipeDirection&&i.allowSlideNext||"prev"===i.swipeDirection&&i.allowSlidePrev;if(!n.isMoved){if(y&&b&&i.loopFix({direction:i.swipeDirection}),n.startTranslate=i.getTranslate(),i.setTransition(0),i.animating){const e=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});i.wrapperEl.dispatchEvent(e)}n.allowMomentumBounce=!1,!r.grabCursor||!0!==i.allowSlideNext&&!0!==i.allowSlidePrev||i.setGrabCursor(!0),i.emit("sliderFirstMove",l)}let x;n.isMoved&&v!==i.touchesDirection&&y&&b&&Math.abs(m)>=1&&(i.loopFix({direction:i.swipeDirection,setTranslate:!0}),x=!0),i.emit("sliderMove",l),n.isMoved=!0,n.currentTranslate=m+n.startTranslate;let w=!0,_=r.resistanceRatio;if(r.touchReleaseOnEdges&&(_=0),m>0?(y&&b&&!x&&n.currentTranslate>(r.centeredSlides?i.minTranslate()-i.size/2:i.minTranslate())&&i.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),n.currentTranslate>i.minTranslate()&&(w=!1,r.resistance&&(n.currentTranslate=i.minTranslate()-1+(-i.minTranslate()+n.startTranslate+m)**_))):m<0&&(y&&b&&!x&&n.currentTranslate<(r.centeredSlides?i.maxTranslate()+i.size/2:i.maxTranslate())&&i.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:i.slides.length-("auto"===r.slidesPerView?i.slidesPerViewDynamic():Math.ceil(parseFloat(r.slidesPerView,10)))}),n.currentTranslate<i.maxTranslate()&&(w=!1,r.resistance&&(n.currentTranslate=i.maxTranslate()+1-(i.maxTranslate()-n.startTranslate-m)**_))),w&&(l.preventedByNestedSwiper=!0),!i.allowSlideNext&&"next"===i.swipeDirection&&n.currentTranslate<n.startTranslate&&(n.currentTranslate=n.startTranslate),!i.allowSlidePrev&&"prev"===i.swipeDirection&&n.currentTranslate>n.startTranslate&&(n.currentTranslate=n.startTranslate),i.allowSlidePrev||i.allowSlideNext||(n.currentTranslate=n.startTranslate),r.threshold>0){if(!(Math.abs(m)>r.threshold||n.allowThresholdMove))return void(n.currentTranslate=n.startTranslate);if(!n.allowThresholdMove)return n.allowThresholdMove=!0,a.startX=a.currentX,a.startY=a.currentY,n.currentTranslate=n.startTranslate,void(a.diff=i.isHorizontal()?a.currentX-a.startX:a.currentY-a.startY)}r.followFinger&&!r.cssMode&&((r.freeMode&&r.freeMode.enabled&&i.freeMode||r.watchSlidesProgress)&&(i.updateActiveIndex(),i.updateSlidesClasses()),r.freeMode&&r.freeMode.enabled&&i.freeMode&&i.freeMode.onTouchMove(),i.updateProgress(n.currentTranslate),i.setTranslate(n.currentTranslate))}function lw(e){const t=this,i=t.touchEventsData,n=i.evCache.findIndex((t=>t.pointerId===e.pointerId));if(n>=0&&i.evCache.splice(n,1),["pointercancel","pointerout","pointerleave","contextmenu"].includes(e.type)){if(!(["pointercancel","contextmenu"].includes(e.type)&&(t.browser.isSafari||t.browser.isWebView)))return}const{params:r,touches:a,rtlTranslate:s,slidesGrid:o,enabled:l}=t;if(!l)return;if(!r.simulateTouch&&"mouse"===e.pointerType)return;let c=e;if(c.originalEvent&&(c=c.originalEvent),i.allowTouchCallbacks&&t.emit("touchEnd",c),i.allowTouchCallbacks=!1,!i.isTouched)return i.isMoved&&r.grabCursor&&t.setGrabCursor(!1),i.isMoved=!1,void(i.startMoving=!1);r.grabCursor&&i.isMoved&&i.isTouched&&(!0===t.allowSlideNext||!0===t.allowSlidePrev)&&t.setGrabCursor(!1);const h=Dx(),u=h-i.touchStartTime;if(t.allowClick){const e=c.path||c.composedPath&&c.composedPath();t.updateClickedSlide(e&&e[0]||c.target,e),t.emit("tap click",c),u<300&&h-i.lastClickTime<300&&t.emit("doubleTap doubleClick",c)}if(i.lastClickTime=Dx(),Px((()=>{t.destroyed||(t.allowClick=!0)})),!i.isTouched||!i.isMoved||!t.swipeDirection||0===a.diff||i.currentTranslate===i.startTranslate)return i.isTouched=!1,i.isMoved=!1,void(i.startMoving=!1);let d;if(i.isTouched=!1,i.isMoved=!1,i.startMoving=!1,d=r.followFinger?s?t.translate:-t.translate:-i.currentTranslate,r.cssMode)return;if(r.freeMode&&r.freeMode.enabled)return void t.freeMode.onTouchEnd({currentPos:d});let p=0,f=t.slidesSizesGrid[0];for(let b=0;b<o.length;b+=b<r.slidesPerGroupSkip?1:r.slidesPerGroup){const e=b<r.slidesPerGroupSkip-1?1:r.slidesPerGroup;"undefined"!==typeof o[b+e]?d>=o[b]&&d<o[b+e]&&(p=b,f=o[b+e]-o[b]):d>=o[b]&&(p=b,f=o[o.length-1]-o[o.length-2])}let m=null,g=null;r.rewind&&(t.isBeginning?g=r.virtual&&r.virtual.enabled&&t.virtual?t.virtual.slides.length-1:t.slides.length-1:t.isEnd&&(m=0));const v=(d-o[p])/f,y=p<r.slidesPerGroupSkip-1?1:r.slidesPerGroup;if(u>r.longSwipesMs){if(!r.longSwipes)return void t.slideTo(t.activeIndex);"next"===t.swipeDirection&&(v>=r.longSwipesRatio?t.slideTo(r.rewind&&t.isEnd?m:p+y):t.slideTo(p)),"prev"===t.swipeDirection&&(v>1-r.longSwipesRatio?t.slideTo(p+y):null!==g&&v<0&&Math.abs(v)>r.longSwipesRatio?t.slideTo(g):t.slideTo(p))}else{if(!r.shortSwipes)return void t.slideTo(t.activeIndex);t.navigation&&(c.target===t.navigation.nextEl||c.target===t.navigation.prevEl)?c.target===t.navigation.nextEl?t.slideTo(p+y):t.slideTo(p):("next"===t.swipeDirection&&t.slideTo(null!==m?m:p+y),"prev"===t.swipeDirection&&t.slideTo(null!==g?g:p))}}function cw(){const e=this,{params:t,el:i}=e;if(i&&0===i.offsetWidth)return;t.breakpoints&&e.setBreakpoint();const{allowSlideNext:n,allowSlidePrev:r,snapGrid:a}=e,s=e.virtual&&e.params.virtual.enabled;e.allowSlideNext=!0,e.allowSlidePrev=!0,e.updateSize(),e.updateSlides(),e.updateSlidesClasses();const o=s&&t.loop;!("auto"===t.slidesPerView||t.slidesPerView>1)||!e.isEnd||e.isBeginning||e.params.centeredSlides||o?e.params.loop&&!s?e.slideToLoop(e.realIndex,0,!1,!0):e.slideTo(e.activeIndex,0,!1,!0):e.slideTo(e.slides.length-1,0,!1,!0),e.autoplay&&e.autoplay.running&&e.autoplay.paused&&(clearTimeout(e.autoplay.resizeTimeout),e.autoplay.resizeTimeout=setTimeout((()=>{e.autoplay&&e.autoplay.running&&e.autoplay.paused&&e.autoplay.resume()}),500)),e.allowSlidePrev=r,e.allowSlideNext=n,e.params.watchOverflow&&a!==e.snapGrid&&e.checkOverflow()}function hw(e){const t=this;t.enabled&&(t.allowClick||(t.params.preventClicks&&e.preventDefault(),t.params.preventClicksPropagation&&t.animating&&(e.stopPropagation(),e.stopImmediatePropagation())))}function uw(){const e=this,{wrapperEl:t,rtlTranslate:i,enabled:n}=e;if(!n)return;let r;e.previousTranslate=e.translate,e.isHorizontal()?e.translate=-t.scrollLeft:e.translate=-t.scrollTop,0===e.translate&&(e.translate=0),e.updateActiveIndex(),e.updateSlidesClasses();const a=e.maxTranslate()-e.minTranslate();r=0===a?0:(e.translate-e.minTranslate())/a,r!==e.progress&&e.updateProgress(i?-e.translate:e.translate),e.emit("setTranslate",e.translate,!1)}function dw(e){const t=this;Zx(t,e.target),t.params.cssMode||"auto"!==t.params.slidesPerView&&!t.params.autoHeight||t.update()}let pw=!1;function fw(){}const mw=(e,t)=>{const i=Ax(),{params:n,el:r,wrapperEl:a,device:s}=e,o=!!n.nested,l="on"===t?"addEventListener":"removeEventListener",c=t;r[l]("pointerdown",e.onTouchStart,{passive:!1}),i[l]("pointermove",e.onTouchMove,{passive:!1,capture:o}),i[l]("pointerup",e.onTouchEnd,{passive:!0}),i[l]("pointercancel",e.onTouchEnd,{passive:!0}),i[l]("pointerout",e.onTouchEnd,{passive:!0}),i[l]("pointerleave",e.onTouchEnd,{passive:!0}),i[l]("contextmenu",e.onTouchEnd,{passive:!0}),(n.preventClicks||n.preventClicksPropagation)&&r[l]("click",e.onClick,!0),n.cssMode&&a[l]("scroll",e.onScroll),n.updateOnWindowResize?e[c](s.ios||s.android?"resize orientationchange observerUpdate":"resize observerUpdate",cw,!0):e[c]("observerUpdate",cw,!0),r[l]("load",e.onLoad,{capture:!0})};var gw={attachEvents:function(){const e=this,t=Ax(),{params:i}=e;e.onTouchStart=sw.bind(e),e.onTouchMove=ow.bind(e),e.onTouchEnd=lw.bind(e),i.cssMode&&(e.onScroll=uw.bind(e)),e.onClick=hw.bind(e),e.onLoad=dw.bind(e),pw||(t.addEventListener("touchstart",fw),pw=!0),mw(e,"on")},detachEvents:function(){mw(this,"off")}};const vw=(e,t)=>e.grid&&t.grid&&t.grid.rows>1;var yw={setBreakpoint:function(){const e=this,{realIndex:t,initialized:i,params:n,el:r}=e,a=n.breakpoints;if(!a||a&&0===Object.keys(a).length)return;const s=e.getBreakpoint(a,e.params.breakpointsBase,e.el);if(!s||e.currentBreakpoint===s)return;const o=(s in a?a[s]:void 0)||e.originalParams,l=vw(e,n),c=vw(e,o),h=n.enabled;l&&!c?(r.classList.remove("".concat(n.containerModifierClass,"grid"),"".concat(n.containerModifierClass,"grid-column")),e.emitContainerClasses()):!l&&c&&(r.classList.add("".concat(n.containerModifierClass,"grid")),(o.grid.fill&&"column"===o.grid.fill||!o.grid.fill&&"column"===n.grid.fill)&&r.classList.add("".concat(n.containerModifierClass,"grid-column")),e.emitContainerClasses()),["navigation","pagination","scrollbar"].forEach((t=>{if("undefined"===typeof o[t])return;const i=n[t]&&n[t].enabled,r=o[t]&&o[t].enabled;i&&!r&&e[t].disable(),!i&&r&&e[t].enable()}));const u=o.direction&&o.direction!==n.direction,d=n.loop&&(o.slidesPerView!==n.slidesPerView||u),p=n.loop;u&&i&&e.changeDirection(),Ix(e.params,o);const f=e.params.enabled,m=e.params.loop;Object.assign(e,{allowTouchMove:e.params.allowTouchMove,allowSlideNext:e.params.allowSlideNext,allowSlidePrev:e.params.allowSlidePrev}),h&&!f?e.disable():!h&&f&&e.enable(),e.currentBreakpoint=s,e.emit("_beforeBreakpoint",o),i&&(d?(e.loopDestroy(),e.loopCreate(t),e.updateSlides()):!p&&m?(e.loopCreate(t),e.updateSlides()):p&&!m&&e.loopDestroy()),e.emit("breakpoint",o)},getBreakpoint:function(e,t,i){if(void 0===t&&(t="window"),!e||"container"===t&&!i)return;let n=!1;const r=Tx(),a="window"===t?r.innerHeight:i.clientHeight,s=Object.keys(e).map((e=>{if("string"===typeof e&&0===e.indexOf("@")){const t=parseFloat(e.substr(1));return{value:a*t,point:e}}return{value:e,point:e}}));s.sort(((e,t)=>parseInt(e.value,10)-parseInt(t.value,10)));for(let o=0;o<s.length;o+=1){const{point:e,value:a}=s[o];"window"===t?r.matchMedia("(min-width: ".concat(a,"px)")).matches&&(n=e):a<=i.clientWidth&&(n=e)}return n||"max"}};var bw={addClasses:function(){const e=this,{classNames:t,params:i,rtl:n,el:r,device:a}=e,s=function(e,t){const i=[];return e.forEach((e=>{"object"===typeof e?Object.keys(e).forEach((n=>{e[n]&&i.push(t+n)})):"string"===typeof e&&i.push(t+e)})),i}(["initialized",i.direction,{"free-mode":e.params.freeMode&&i.freeMode.enabled},{autoheight:i.autoHeight},{rtl:n},{grid:i.grid&&i.grid.rows>1},{"grid-column":i.grid&&i.grid.rows>1&&"column"===i.grid.fill},{android:a.android},{ios:a.ios},{"css-mode":i.cssMode},{centered:i.cssMode&&i.centeredSlides},{"watch-progress":i.watchSlidesProgress}],i.containerModifierClass);t.push(...s),r.classList.add(...t),e.emitContainerClasses()},removeClasses:function(){const{el:e,classNames:t}=this;e.classList.remove(...t),this.emitContainerClasses()}};var xw={checkOverflow:function(){const e=this,{isLocked:t,params:i}=e,{slidesOffsetBefore:n}=i;if(n){const t=e.slides.length-1,i=e.slidesGrid[t]+e.slidesSizesGrid[t]+2*n;e.isLocked=e.size>i}else e.isLocked=1===e.snapGrid.length;!0===i.allowSlideNext&&(e.allowSlideNext=!e.isLocked),!0===i.allowSlidePrev&&(e.allowSlidePrev=!e.isLocked),t&&t!==e.isLocked&&(e.isEnd=!1),t!==e.isLocked&&e.emit(e.isLocked?"lock":"unlock")}},ww={init:!0,direction:"horizontal",oneWayMovement:!1,touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopedSlides:null,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function _w(e,t){return function(i){void 0===i&&(i={});const n=Object.keys(i)[0],r=i[n];"object"===typeof r&&null!==r?(!0===e[n]&&(e[n]={enabled:!0}),"navigation"===n&&e[n]&&e[n].enabled&&!e[n].prevEl&&!e[n].nextEl&&(e[n].auto=!0),["pagination","scrollbar"].indexOf(n)>=0&&e[n]&&e[n].enabled&&!e[n].el&&(e[n].auto=!0),n in e&&"enabled"in r?("object"!==typeof e[n]||"enabled"in e[n]||(e[n].enabled=!0),e[n]||(e[n]={enabled:!1}),Ix(t,i)):Ix(t,i)):Ix(t,i)}}const Sw={eventsEmitter:Qx,update:$x,translate:ew,transition:iw,slide:nw,loop:rw,grabCursor:aw,events:gw,breakpoints:yw,checkOverflow:xw,classes:bw},Ew={};class Cw{constructor(){let e,t;for(var i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];1===n.length&&n[0].constructor&&"Object"===Object.prototype.toString.call(n[0]).slice(8,-1)?t=n[0]:[e,t]=n,t||(t={}),t=Ix({},t),e&&!t.el&&(t.el=e);const a=Ax();if(t.el&&"string"===typeof t.el&&a.querySelectorAll(t.el).length>1){const e=[];return a.querySelectorAll(t.el).forEach((i=>{const n=Ix({},t,{el:i});e.push(new Cw(n))})),e}const s=this;s.__swiper__=!0,s.support=qx(),s.device=Xx({userAgent:t.userAgent}),s.browser=Yx(),s.eventsListeners={},s.eventsAnyListeners=[],s.modules=[...s.__modules__],t.modules&&Array.isArray(t.modules)&&s.modules.push(...t.modules);const o={};s.modules.forEach((e=>{e({params:t,swiper:s,extendParams:_w(t,o),on:s.on.bind(s),once:s.once.bind(s),off:s.off.bind(s),emit:s.emit.bind(s)})}));const l=Ix({},ww,o);return s.params=Ix({},l,Ew,t),s.originalParams=Ix({},s.params),s.passedParams=Ix({},t),s.params&&s.params.on&&Object.keys(s.params.on).forEach((e=>{s.on(e,s.params.on[e])})),s.params&&s.params.onAny&&s.onAny(s.params.onAny),Object.assign(s,{enabled:s.params.enabled,el:e,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal:()=>"horizontal"===s.params.direction,isVertical:()=>"vertical"===s.params.direction,activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:s.params.allowSlideNext,allowSlidePrev:s.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:s.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,evCache:[]},allowClick:!0,allowTouchMove:s.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),s.emit("_swiper"),s.params.init&&s.init(),s}getSlideIndex(e){const{slidesEl:t,params:i}=this,n=jx(zx(t,".".concat(i.slideClass,", swiper-slide"))[0]);return jx(e)-n}getSlideIndexByData(e){return this.getSlideIndex(this.slides.filter((t=>1*t.getAttribute("data-swiper-slide-index")===e))[0])}recalcSlides(){const{slidesEl:e,params:t}=this;this.slides=zx(e,".".concat(t.slideClass,", swiper-slide"))}enable(){const e=this;e.enabled||(e.enabled=!0,e.params.grabCursor&&e.setGrabCursor(),e.emit("enable"))}disable(){const e=this;e.enabled&&(e.enabled=!1,e.params.grabCursor&&e.unsetGrabCursor(),e.emit("disable"))}setProgress(e,t){const i=this;e=Math.min(Math.max(e,0),1);const n=i.minTranslate(),r=(i.maxTranslate()-n)*e+n;i.translateTo(r,"undefined"===typeof t?0:t),i.updateActiveIndex(),i.updateSlidesClasses()}emitContainerClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=e.el.className.split(" ").filter((t=>0===t.indexOf("swiper")||0===t.indexOf(e.params.containerModifierClass)));e.emit("_containerClasses",t.join(" "))}getSlideClasses(e){const t=this;return t.destroyed?"":e.className.split(" ").filter((e=>0===e.indexOf("swiper-slide")||0===e.indexOf(t.params.slideClass))).join(" ")}emitSlidesClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=[];e.slides.forEach((i=>{const n=e.getSlideClasses(i);t.push({slideEl:i,classNames:n}),e.emit("_slideClass",i,n)})),e.emit("_slideClasses",t)}slidesPerViewDynamic(e,t){void 0===e&&(e="current"),void 0===t&&(t=!1);const{params:i,slides:n,slidesGrid:r,slidesSizesGrid:a,size:s,activeIndex:o}=this;let l=1;if("number"===typeof i.slidesPerView)return i.slidesPerView;if(i.centeredSlides){let e,t=n[o]?n[o].swiperSlideSize:0;for(let i=o+1;i<n.length;i+=1)n[i]&&!e&&(t+=n[i].swiperSlideSize,l+=1,t>s&&(e=!0));for(let i=o-1;i>=0;i-=1)n[i]&&!e&&(t+=n[i].swiperSlideSize,l+=1,t>s&&(e=!0))}else if("current"===e)for(let c=o+1;c<n.length;c+=1){(t?r[c]+a[c]-r[o]<s:r[c]-r[o]<s)&&(l+=1)}else for(let c=o-1;c>=0;c-=1){r[o]-r[c]<s&&(l+=1)}return l}update(){const e=this;if(!e||e.destroyed)return;const{snapGrid:t,params:i}=e;function n(){const t=e.rtlTranslate?-1*e.translate:e.translate,i=Math.min(Math.max(t,e.maxTranslate()),e.minTranslate());e.setTranslate(i),e.updateActiveIndex(),e.updateSlidesClasses()}let r;if(i.breakpoints&&e.setBreakpoint(),[...e.el.querySelectorAll('[loading="lazy"]')].forEach((t=>{t.complete&&Zx(e,t)})),e.updateSize(),e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),i.freeMode&&i.freeMode.enabled&&!i.cssMode)n(),i.autoHeight&&e.updateAutoHeight();else{if(("auto"===i.slidesPerView||i.slidesPerView>1)&&e.isEnd&&!i.centeredSlides){const t=e.virtual&&i.virtual.enabled?e.virtual.slides:e.slides;r=e.slideTo(t.length-1,0,!1,!0)}else r=e.slideTo(e.activeIndex,0,!1,!0);r||n()}i.watchOverflow&&t!==e.snapGrid&&e.checkOverflow(),e.emit("update")}changeDirection(e,t){void 0===t&&(t=!0);const i=this,n=i.params.direction;return e||(e="horizontal"===n?"vertical":"horizontal"),e===n||"horizontal"!==e&&"vertical"!==e||(i.el.classList.remove("".concat(i.params.containerModifierClass).concat(n)),i.el.classList.add("".concat(i.params.containerModifierClass).concat(e)),i.emitContainerClasses(),i.params.direction=e,i.slides.forEach((t=>{"vertical"===e?t.style.width="":t.style.height=""})),i.emit("changeDirection"),t&&i.update()),i}changeLanguageDirection(e){const t=this;t.rtl&&"rtl"===e||!t.rtl&&"ltr"===e||(t.rtl="rtl"===e,t.rtlTranslate="horizontal"===t.params.direction&&t.rtl,t.rtl?(t.el.classList.add("".concat(t.params.containerModifierClass,"rtl")),t.el.dir="rtl"):(t.el.classList.remove("".concat(t.params.containerModifierClass,"rtl")),t.el.dir="ltr"),t.update())}mount(e){const t=this;if(t.mounted)return!0;let i=e||t.params.el;if("string"===typeof i&&(i=document.querySelector(i)),!i)return!1;i.swiper=t,i.parentNode&&i.parentNode.host&&"SWIPER-CONTAINER"===i.parentNode.host.nodeName&&(t.isElement=!0);const n=()=>".".concat((t.params.wrapperClass||"").trim().split(" ").join("."));let r=(()=>{if(i&&i.shadowRoot&&i.shadowRoot.querySelector){return i.shadowRoot.querySelector(n())}return zx(i,n())[0]})();return!r&&t.params.createElements&&(r=Nx("div",t.params.wrapperClass),i.append(r),zx(i,".".concat(t.params.slideClass)).forEach((e=>{r.append(e)}))),Object.assign(t,{el:i,wrapperEl:r,slidesEl:t.isElement&&!i.parentNode.host.slideSlots?i.parentNode.host:r,hostEl:t.isElement?i.parentNode.host:i,mounted:!0,rtl:"rtl"===i.dir.toLowerCase()||"rtl"===Fx(i,"direction"),rtlTranslate:"horizontal"===t.params.direction&&("rtl"===i.dir.toLowerCase()||"rtl"===Fx(i,"direction")),wrongRTL:"-webkit-box"===Fx(r,"display")}),!0}init(e){const t=this;if(t.initialized)return t;if(!1===t.mount(e))return t;t.emit("beforeInit"),t.params.breakpoints&&t.setBreakpoint(),t.addClasses(),t.updateSize(),t.updateSlides(),t.params.watchOverflow&&t.checkOverflow(),t.params.grabCursor&&t.enabled&&t.setGrabCursor(),t.params.loop&&t.virtual&&t.params.virtual.enabled?t.slideTo(t.params.initialSlide+t.virtual.slidesBefore,0,t.params.runCallbacksOnInit,!1,!0):t.slideTo(t.params.initialSlide,0,t.params.runCallbacksOnInit,!1,!0),t.params.loop&&t.loopCreate(),t.attachEvents();const i=[...t.el.querySelectorAll('[loading="lazy"]')];return t.isElement&&i.push(...t.hostEl.querySelectorAll('[loading="lazy"]')),i.forEach((e=>{e.complete?Zx(t,e):e.addEventListener("load",(e=>{Zx(t,e.target)}))})),Jx(t),t.initialized=!0,Jx(t),t.emit("init"),t.emit("afterInit"),t}destroy(e,t){void 0===e&&(e=!0),void 0===t&&(t=!0);const i=this,{params:n,el:r,wrapperEl:a,slides:s}=i;return"undefined"===typeof i.params||i.destroyed||(i.emit("beforeDestroy"),i.initialized=!1,i.detachEvents(),n.loop&&i.loopDestroy(),t&&(i.removeClasses(),r.removeAttribute("style"),a.removeAttribute("style"),s&&s.length&&s.forEach((e=>{e.classList.remove(n.slideVisibleClass,n.slideActiveClass,n.slideNextClass,n.slidePrevClass),e.removeAttribute("style"),e.removeAttribute("data-swiper-slide-index")}))),i.emit("destroy"),Object.keys(i.eventsListeners).forEach((e=>{i.off(e)})),!1!==e&&(i.el.swiper=null,function(e){const t=e;Object.keys(t).forEach((e=>{try{t[e]=null}catch(vne){}try{delete t[e]}catch(vne){}}))}(i)),i.destroyed=!0),null}static extendDefaults(e){Ix(Ew,e)}static get extendedDefaults(){return Ew}static get defaults(){return ww}static installModule(e){Cw.prototype.__modules__||(Cw.prototype.__modules__=[]);const t=Cw.prototype.__modules__;"function"===typeof e&&t.indexOf(e)<0&&t.push(e)}static use(e){return Array.isArray(e)?(e.forEach((e=>Cw.installModule(e))),Cw):(Cw.installModule(e),Cw)}}Object.keys(Sw).forEach((e=>{Object.keys(Sw[e]).forEach((t=>{Cw.prototype[t]=Sw[e][t]}))})),Cw.use([function(e){let{swiper:t,on:i,emit:n}=e;const r=Tx();let a=null,s=null;const o=()=>{t&&!t.destroyed&&t.initialized&&(n("beforeResize"),n("resize"))},l=()=>{t&&!t.destroyed&&t.initialized&&n("orientationchange")};i("init",(()=>{t.params.resizeObserver&&"undefined"!==typeof r.ResizeObserver?t&&!t.destroyed&&t.initialized&&(a=new ResizeObserver((e=>{s=r.requestAnimationFrame((()=>{const{width:i,height:n}=t;let r=i,a=n;e.forEach((e=>{let{contentBoxSize:i,contentRect:n,target:s}=e;s&&s!==t.el||(r=n?n.width:(i[0]||i).inlineSize,a=n?n.height:(i[0]||i).blockSize)})),r===i&&a===n||o()}))})),a.observe(t.el)):(r.addEventListener("resize",o),r.addEventListener("orientationchange",l))})),i("destroy",(()=>{s&&r.cancelAnimationFrame(s),a&&a.unobserve&&t.el&&(a.unobserve(t.el),a=null),r.removeEventListener("resize",o),r.removeEventListener("orientationchange",l)}))},function(e){let{swiper:t,extendParams:i,on:n,emit:r}=e;const a=[],s=Tx(),o=function(e,i){void 0===i&&(i={});const n=new(s.MutationObserver||s.WebkitMutationObserver)((e=>{if(t.__preventObserver__)return;if(1===e.length)return void r("observerUpdate",e[0]);const i=function(){r("observerUpdate",e[0])};s.requestAnimationFrame?s.requestAnimationFrame(i):s.setTimeout(i,0)}));n.observe(e,{attributes:"undefined"===typeof i.attributes||i.attributes,childList:"undefined"===typeof i.childList||i.childList,characterData:"undefined"===typeof i.characterData||i.characterData}),a.push(n)};i({observer:!1,observeParents:!1,observeSlideChildren:!1}),n("init",(()=>{if(t.params.observer){if(t.params.observeParents){const e=Vx(t.hostEl);for(let t=0;t<e.length;t+=1)o(e[t])}o(t.hostEl,{childList:t.params.observeSlideChildren}),o(t.wrapperEl,{attributes:!1})}})),n("destroy",(()=>{a.forEach((e=>{e.disconnect()})),a.splice(0,a.length)}))}]);const Aw=["eventsPrefix","injectStyles","injectStylesUrls","modules","init","_direction","oneWayMovement","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","breakpointsBase","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_loop","loopedSlides","loopPreventsSliding","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideActiveClass","slideVisibleClass","slideNextClass","slidePrevClass","wrapperClass","lazyPreloaderClass","lazyPreloadPrevNext","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom","control"];function Mw(e){return"object"===typeof e&&null!==e&&e.constructor&&"Object"===Object.prototype.toString.call(e).slice(8,-1)&&!e.__swiper__}function Tw(e,t){const i=["__proto__","constructor","prototype"];Object.keys(t).filter((e=>i.indexOf(e)<0)).forEach((i=>{"undefined"===typeof e[i]?e[i]=t[i]:Mw(t[i])&&Mw(e[i])&&Object.keys(t[i]).length>0?t[i].__swiper__?e[i]=t[i]:Tw(e[i],t[i]):e[i]=t[i]}))}function Pw(e){return void 0===e&&(e={}),e.navigation&&"undefined"===typeof e.navigation.nextEl&&"undefined"===typeof e.navigation.prevEl}function Dw(e){return void 0===e&&(e={}),e.pagination&&"undefined"===typeof e.pagination.el}function kw(e){return void 0===e&&(e={}),e.scrollbar&&"undefined"===typeof e.scrollbar.el}function Ow(e){void 0===e&&(e="");const t=e.split(" ").map((e=>e.trim())).filter((e=>!!e)),i=[];return t.forEach((e=>{i.indexOf(e)<0&&i.push(e)})),i.join(" ")}function Iw(e){return void 0===e&&(e=""),e?e.includes("swiper-wrapper")?e:"swiper-wrapper ".concat(e):"swiper-wrapper"}function Rw(){return Rw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},Rw.apply(this,arguments)}function Lw(e){return e.type&&e.type.displayName&&e.type.displayName.includes("SwiperSlide")}function Bw(e){const i=[];return t.Children.toArray(e).forEach((e=>{Lw(e)?i.push(e):e.props&&e.props.children&&Bw(e.props.children).forEach((e=>i.push(e)))})),i}function zw(e){const i=[],n={"container-start":[],"container-end":[],"wrapper-start":[],"wrapper-end":[]};return t.Children.toArray(e).forEach((e=>{if(Lw(e))i.push(e);else if(e.props&&e.props.slot&&n[e.props.slot])n[e.props.slot].push(e);else if(e.props&&e.props.children){const t=Bw(e.props.children);t.length>0?t.forEach((e=>i.push(e))):n["container-end"].push(e)}else n["container-end"].push(e)})),{slides:i,slots:n}}function Nw(e,i){return"undefined"===typeof window?(0,t.useEffect)(e,i):(0,t.useLayoutEffect)(e,i)}const Fw=(0,t.createContext)(null),jw=(0,t.createContext)(null),Vw=(0,t.forwardRef)((function(e,i){let{className:n,tag:r="div",wrapperTag:a="div",children:s,onSwiper:o,...l}=void 0===e?{}:e,c=!1;const[h,u]=(0,t.useState)("swiper"),[d,p]=(0,t.useState)(null),[f,m]=(0,t.useState)(!1),g=(0,t.useRef)(!1),v=(0,t.useRef)(null),y=(0,t.useRef)(null),b=(0,t.useRef)(null),x=(0,t.useRef)(null),w=(0,t.useRef)(null),_=(0,t.useRef)(null),S=(0,t.useRef)(null),E=(0,t.useRef)(null),{params:C,passedParams:A,rest:M,events:T}=function(e,t){void 0===e&&(e={}),void 0===t&&(t=!0);const i={on:{}},n={},r={};Tw(i,ww),i._emitClasses=!0,i.init=!1;const a={},s=Aw.map((e=>e.replace(/_/,""))),o=Object.assign({},e);return Object.keys(o).forEach((o=>{"undefined"!==typeof e[o]&&(s.indexOf(o)>=0?Mw(e[o])?(i[o]={},r[o]={},Tw(i[o],e[o]),Tw(r[o],e[o])):(i[o]=e[o],r[o]=e[o]):0===o.search(/on[A-Z]/)&&"function"===typeof e[o]?t?n["".concat(o[2].toLowerCase()).concat(o.substr(3))]=e[o]:i.on["".concat(o[2].toLowerCase()).concat(o.substr(3))]=e[o]:a[o]=e[o])})),["navigation","pagination","scrollbar"].forEach((e=>{!0===i[e]&&(i[e]={}),!1===i[e]&&delete i[e]})),{params:i,passedParams:r,rest:a,events:n}}(l),{slides:P,slots:D}=zw(s),k=()=>{m(!f)};Object.assign(C.on,{_containerClasses(e,t){u(t)}});const O=()=>{Object.assign(C.on,T),c=!0;const e={...C};if(delete e.wrapperClass,y.current=new Cw(e),y.current.virtual&&y.current.params.virtual.enabled){y.current.virtual.slides=P;const e={cache:!1,slides:P,renderExternal:p,renderExternalUpdate:!1};Tw(y.current.params.virtual,e),Tw(y.current.originalParams.virtual,e)}};v.current||O(),y.current&&y.current.on("_beforeBreakpoint",k);return(0,t.useEffect)((()=>()=>{y.current&&y.current.off("_beforeBreakpoint",k)})),(0,t.useEffect)((()=>{!g.current&&y.current&&(y.current.emitSlidesClasses(),g.current=!0)})),Nw((()=>{if(i&&(i.current=v.current),v.current)return y.current.destroyed&&O(),function(e,t){let{el:i,nextEl:n,prevEl:r,paginationEl:a,scrollbarEl:s,swiper:o}=e;Pw(t)&&n&&r&&(o.params.navigation.nextEl=n,o.originalParams.navigation.nextEl=n,o.params.navigation.prevEl=r,o.originalParams.navigation.prevEl=r),Dw(t)&&a&&(o.params.pagination.el=a,o.originalParams.pagination.el=a),kw(t)&&s&&(o.params.scrollbar.el=s,o.originalParams.scrollbar.el=s),o.init(i)}({el:v.current,nextEl:w.current,prevEl:_.current,paginationEl:S.current,scrollbarEl:E.current,swiper:y.current},C),o&&o(y.current),()=>{y.current&&!y.current.destroyed&&y.current.destroy(!0,!1)}}),[]),Nw((()=>{!c&&T&&y.current&&Object.keys(T).forEach((e=>{y.current.on(e,T[e])}));const e=function(e,t,i,n,r){const a=[];if(!t)return a;const s=e=>{a.indexOf(e)<0&&a.push(e)};if(i&&n){const e=n.map(r),t=i.map(r);e.join("")!==t.join("")&&s("children"),n.length!==i.length&&s("children")}return Aw.filter((e=>"_"===e[0])).map((e=>e.replace(/_/,""))).forEach((i=>{if(i in e&&i in t)if(Mw(e[i])&&Mw(t[i])){const n=Object.keys(e[i]),r=Object.keys(t[i]);n.length!==r.length?s(i):(n.forEach((n=>{e[i][n]!==t[i][n]&&s(i)})),r.forEach((n=>{e[i][n]!==t[i][n]&&s(i)})))}else e[i]!==t[i]&&s(i)})),a}(A,b.current,P,x.current,(e=>e.key));return b.current=A,x.current=P,e.length&&y.current&&!y.current.destroyed&&function(e){let{swiper:t,slides:i,passedParams:n,changedParams:r,nextEl:a,prevEl:s,scrollbarEl:o,paginationEl:l}=e;const c=r.filter((e=>"children"!==e&&"direction"!==e&&"wrapperClass"!==e)),{params:h,pagination:u,navigation:d,scrollbar:p,virtual:f,thumbs:m}=t;let g,v,y,b,x,w,_,S;r.includes("thumbs")&&n.thumbs&&n.thumbs.swiper&&h.thumbs&&!h.thumbs.swiper&&(g=!0),r.includes("controller")&&n.controller&&n.controller.control&&h.controller&&!h.controller.control&&(v=!0),r.includes("pagination")&&n.pagination&&(n.pagination.el||l)&&(h.pagination||!1===h.pagination)&&u&&!u.el&&(y=!0),r.includes("scrollbar")&&n.scrollbar&&(n.scrollbar.el||o)&&(h.scrollbar||!1===h.scrollbar)&&p&&!p.el&&(b=!0),r.includes("navigation")&&n.navigation&&(n.navigation.prevEl||s)&&(n.navigation.nextEl||a)&&(h.navigation||!1===h.navigation)&&d&&!d.prevEl&&!d.nextEl&&(x=!0);const E=e=>{t[e]&&(t[e].destroy(),"navigation"===e?(t.isElement&&(t[e].prevEl.remove(),t[e].nextEl.remove()),h[e].prevEl=void 0,h[e].nextEl=void 0,t[e].prevEl=void 0,t[e].nextEl=void 0):(t.isElement&&t[e].el.remove(),h[e].el=void 0,t[e].el=void 0))};r.includes("loop")&&t.isElement&&(h.loop&&!n.loop?w=!0:!h.loop&&n.loop?_=!0:S=!0),c.forEach((e=>{if(Mw(h[e])&&Mw(n[e]))Tw(h[e],n[e]),"navigation"!==e&&"pagination"!==e&&"scrollbar"!==e||!("enabled"in n[e])||n[e].enabled||E(e);else{const t=n[e];!0!==t&&!1!==t||"navigation"!==e&&"pagination"!==e&&"scrollbar"!==e?h[e]=n[e]:!1===t&&E(e)}})),c.includes("controller")&&!v&&t.controller&&t.controller.control&&h.controller&&h.controller.control&&(t.controller.control=h.controller.control),r.includes("children")&&i&&f&&h.virtual.enabled&&(f.slides=i,f.update(!0)),r.includes("children")&&i&&h.loop&&(S=!0),g&&m.init()&&m.update(!0);v&&(t.controller.control=h.controller.control),y&&(!t.isElement||l&&"string"!==typeof l||(l=document.createElement("div"),l.classList.add("swiper-pagination"),l.part.add("pagination"),t.el.appendChild(l)),l&&(h.pagination.el=l),u.init(),u.render(),u.update()),b&&(!t.isElement||o&&"string"!==typeof o||(o=document.createElement("div"),o.classList.add("swiper-scrollbar"),o.part.add("scrollbar"),t.el.appendChild(o)),o&&(h.scrollbar.el=o),p.init(),p.updateSize(),p.setTranslate()),x&&(t.isElement&&(a&&"string"!==typeof a||(a=document.createElement("div"),a.classList.add("swiper-button-next"),a.innerHTML=t.hostEl.constructor.nextButtonSvg,a.part.add("button-next"),t.el.appendChild(a)),s&&"string"!==typeof s||(s=document.createElement("div"),s.classList.add("swiper-button-prev"),s.innerHTML=t.hostEl.constructor.prevButtonSvg,s.part.add("button-prev"),t.el.appendChild(s))),a&&(h.navigation.nextEl=a),s&&(h.navigation.prevEl=s),d.init(),d.update()),r.includes("allowSlideNext")&&(t.allowSlideNext=n.allowSlideNext),r.includes("allowSlidePrev")&&(t.allowSlidePrev=n.allowSlidePrev),r.includes("direction")&&t.changeDirection(n.direction,!1),(w||S)&&t.loopDestroy(),(_||S)&&t.loopCreate(),t.update()}({swiper:y.current,slides:P,passedParams:A,changedParams:e,nextEl:w.current,prevEl:_.current,scrollbarEl:E.current,paginationEl:S.current}),()=>{T&&y.current&&Object.keys(T).forEach((e=>{y.current.off(e,T[e])}))}})),Nw((()=>{(e=>{!e||e.destroyed||!e.params.virtual||e.params.virtual&&!e.params.virtual.enabled||(e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),e.parallax&&e.params.parallax&&e.params.parallax.enabled&&e.parallax.setTranslate())})(y.current)}),[d]),t.createElement(r,Rw({ref:v,className:Ow("".concat(h).concat(n?" ".concat(n):""))},M),t.createElement(jw.Provider,{value:y.current},D["container-start"],t.createElement(a,{className:Iw(C.wrapperClass)},D["wrapper-start"],C.virtual?function(e,i,n){if(!n)return null;const r=e=>{let t=e;return e<0?t=i.length+e:t>=i.length&&(t-=i.length),t},a=e.isHorizontal()?{[e.rtlTranslate?"right":"left"]:"".concat(n.offset,"px")}:{top:"".concat(n.offset,"px")},{from:s,to:o}=n,l=e.params.loop?-i.length:0,c=e.params.loop?2*i.length:i.length,h=[];for(let t=l;t<c;t+=1)t>=s&&t<=o&&h.push(i[r(t)]);return h.map(((i,n)=>t.cloneElement(i,{swiper:e,style:a,key:"slide-".concat(n)})))}(y.current,P,d):P.map(((e,i)=>t.cloneElement(e,{swiper:y.current,swiperSlideIndex:i}))),D["wrapper-end"]),Pw(C)&&t.createElement(t.Fragment,null,t.createElement("div",{ref:_,className:"swiper-button-prev"}),t.createElement("div",{ref:w,className:"swiper-button-next"})),kw(C)&&t.createElement("div",{ref:E,className:"swiper-scrollbar"}),Dw(C)&&t.createElement("div",{ref:S,className:"swiper-pagination"}),D["container-end"]))}));Vw.displayName="Swiper";const Uw=(0,t.forwardRef)((function(e,i){let{tag:n="div",children:r,className:a="",swiper:s,zoom:o,lazy:l,virtualIndex:c,swiperSlideIndex:h,...u}=void 0===e?{}:e;const d=(0,t.useRef)(null),[p,f]=(0,t.useState)("swiper-slide"),[m,g]=(0,t.useState)(!1);function v(e,t,i){t===d.current&&f(i)}Nw((()=>{if("undefined"!==typeof h&&(d.current.swiperSlideIndex=h),i&&(i.current=d.current),d.current&&s){if(!s.destroyed)return s.on("_slideClass",v),()=>{s&&s.off("_slideClass",v)};"swiper-slide"!==p&&f("swiper-slide")}})),Nw((()=>{s&&d.current&&!s.destroyed&&f(s.getSlideClasses(d.current))}),[s]);const y={isActive:p.indexOf("swiper-slide-active")>=0,isVisible:p.indexOf("swiper-slide-visible")>=0,isPrev:p.indexOf("swiper-slide-prev")>=0,isNext:p.indexOf("swiper-slide-next")>=0},b=()=>"function"===typeof r?r(y):r;return t.createElement(n,Rw({ref:d,className:Ow("".concat(p).concat(a?" ".concat(a):"")),"data-swiper-slide-index":c,onLoad:()=>{g(!0)}},u),o&&t.createElement(Fw.Provider,{value:y},t.createElement("div",{className:"swiper-zoom-container","data-swiper-zoom":"number"===typeof o?o:void 0},b(),l&&!m&&t.createElement("div",{className:"swiper-lazy-preloader"}))),!o&&t.createElement(Fw.Provider,{value:y},b(),l&&!m&&t.createElement("div",{className:"swiper-lazy-preloader"})))}));function Gw(e,t,i,n){return e.params.createElements&&Object.keys(n).forEach((r=>{if(!i[r]&&!0===i.auto){let a=zx(e.el,".".concat(n[r]))[0];a||(a=Nx("div",n[r]),a.className=n[r],e.el.append(a)),i[r]=a,t[r]=a}})),i}function Hw(e){let{swiper:t,extendParams:i,on:n,emit:r}=e;i({navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock",navigationDisabledClass:"swiper-navigation-disabled"}}),t.navigation={nextEl:null,prevEl:null};const a=e=>(Array.isArray(e)?e:[e]).filter((e=>!!e));function s(e){let i;return e&&"string"===typeof e&&t.isElement&&(i=t.el.querySelector(e),i)?i:(e&&("string"===typeof e&&(i=[...document.querySelectorAll(e)]),t.params.uniqueNavElements&&"string"===typeof e&&i.length>1&&1===t.el.querySelectorAll(e).length&&(i=t.el.querySelector(e))),e&&!i?e:i)}function o(e,i){const n=t.params.navigation;(e=a(e)).forEach((e=>{e&&(e.classList[i?"add":"remove"](...n.disabledClass.split(" ")),"BUTTON"===e.tagName&&(e.disabled=i),t.params.watchOverflow&&t.enabled&&e.classList[t.isLocked?"add":"remove"](n.lockClass))}))}function l(){const{nextEl:e,prevEl:i}=t.navigation;if(t.params.loop)return o(i,!1),void o(e,!1);o(i,t.isBeginning&&!t.params.rewind),o(e,t.isEnd&&!t.params.rewind)}function c(e){e.preventDefault(),(!t.isBeginning||t.params.loop||t.params.rewind)&&(t.slidePrev(),r("navigationPrev"))}function h(e){e.preventDefault(),(!t.isEnd||t.params.loop||t.params.rewind)&&(t.slideNext(),r("navigationNext"))}function u(){const e=t.params.navigation;if(t.params.navigation=Gw(t,t.originalParams.navigation,t.params.navigation,{nextEl:"swiper-button-next",prevEl:"swiper-button-prev"}),!e.nextEl&&!e.prevEl)return;let i=s(e.nextEl),n=s(e.prevEl);Object.assign(t.navigation,{nextEl:i,prevEl:n}),i=a(i),n=a(n);const r=(i,n)=>{i&&i.addEventListener("click","next"===n?h:c),!t.enabled&&i&&i.classList.add(...e.lockClass.split(" "))};i.forEach((e=>r(e,"next"))),n.forEach((e=>r(e,"prev")))}function d(){let{nextEl:e,prevEl:i}=t.navigation;e=a(e),i=a(i);const n=(e,i)=>{e.removeEventListener("click","next"===i?h:c),e.classList.remove(...t.params.navigation.disabledClass.split(" "))};e.forEach((e=>n(e,"next"))),i.forEach((e=>n(e,"prev")))}n("init",(()=>{!1===t.params.navigation.enabled?p():(u(),l())})),n("toEdge fromEdge lock unlock",(()=>{l()})),n("destroy",(()=>{d()})),n("enable disable",(()=>{let{nextEl:e,prevEl:i}=t.navigation;e=a(e),i=a(i),t.enabled?l():[...e,...i].filter((e=>!!e)).forEach((e=>e.classList.add(t.params.navigation.lockClass)))})),n("click",((e,i)=>{let{nextEl:n,prevEl:s}=t.navigation;n=a(n),s=a(s);const o=i.target;if(t.params.navigation.hideOnClick&&!s.includes(o)&&!n.includes(o)){if(t.pagination&&t.params.pagination&&t.params.pagination.clickable&&(t.pagination.el===o||t.pagination.el.contains(o)))return;let e;n.length?e=n[0].classList.contains(t.params.navigation.hiddenClass):s.length&&(e=s[0].classList.contains(t.params.navigation.hiddenClass)),r(!0===e?"navigationShow":"navigationHide"),[...n,...s].filter((e=>!!e)).forEach((e=>e.classList.toggle(t.params.navigation.hiddenClass)))}}));const p=()=>{t.el.classList.add(...t.params.navigation.navigationDisabledClass.split(" ")),d()};Object.assign(t.navigation,{enable:()=>{t.el.classList.remove(...t.params.navigation.navigationDisabledClass.split(" ")),u(),l()},disable:p,update:l,init:u,destroy:d})}function Ww(e){return void 0===e&&(e=""),".".concat(e.trim().replace(/([\.:!+\/])/g,"\\$1").replace(/ /g,"."))}function qw(e){let{swiper:t,extendParams:i,on:n,emit:r}=e;const a="swiper-pagination";let s;i({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:e=>e,formatFractionTotal:e=>e,bulletClass:"".concat(a,"-bullet"),bulletActiveClass:"".concat(a,"-bullet-active"),modifierClass:"".concat(a,"-"),currentClass:"".concat(a,"-current"),totalClass:"".concat(a,"-total"),hiddenClass:"".concat(a,"-hidden"),progressbarFillClass:"".concat(a,"-progressbar-fill"),progressbarOppositeClass:"".concat(a,"-progressbar-opposite"),clickableClass:"".concat(a,"-clickable"),lockClass:"".concat(a,"-lock"),horizontalClass:"".concat(a,"-horizontal"),verticalClass:"".concat(a,"-vertical"),paginationDisabledClass:"".concat(a,"-disabled")}}),t.pagination={el:null,bullets:[]};let o=0;const l=e=>(Array.isArray(e)?e:[e]).filter((e=>!!e));function c(){return!t.params.pagination.el||!t.pagination.el||Array.isArray(t.pagination.el)&&0===t.pagination.el.length}function h(e,i){const{bulletActiveClass:n}=t.params.pagination;e&&(e=e["".concat("prev"===i?"previous":"next","ElementSibling")])&&(e.classList.add("".concat(n,"-").concat(i)),(e=e["".concat("prev"===i?"previous":"next","ElementSibling")])&&e.classList.add("".concat(n,"-").concat(i,"-").concat(i)))}function u(e){const i=e.target.closest(Ww(t.params.pagination.bulletClass));if(!i)return;e.preventDefault();const n=jx(i)*t.params.slidesPerGroup;if(t.params.loop){if(t.realIndex===n)return;const e=t.realIndex,i=t.getSlideIndexByData(n),r=t.getSlideIndexByData(t.realIndex),a=n=>{const r=t.activeIndex;t.loopFix({direction:n,activeSlideIndex:i,slideTo:!1});r===t.activeIndex&&t.slideToLoop(e,0,!1,!0)};if(i>t.slides.length-t.loopedSlides)a(i>r?"next":"prev");else if(t.params.centeredSlides){const e="auto"===t.params.slidesPerView?t.slidesPerViewDynamic():Math.ceil(parseFloat(t.params.slidesPerView,10));i<Math.floor(e/2)&&a("prev")}t.slideToLoop(n)}else t.slideTo(n)}function d(){const e=t.rtl,i=t.params.pagination;if(c())return;let n,a,u=t.pagination.el;u=l(u);const d=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:t.slides.length,p=t.params.loop?Math.ceil(d/t.params.slidesPerGroup):t.snapGrid.length;if(t.params.loop?(a=t.previousRealIndex||0,n=t.params.slidesPerGroup>1?Math.floor(t.realIndex/t.params.slidesPerGroup):t.realIndex):"undefined"!==typeof t.snapIndex?(n=t.snapIndex,a=t.previousSnapIndex):(a=t.previousIndex||0,n=t.activeIndex||0),"bullets"===i.type&&t.pagination.bullets&&t.pagination.bullets.length>0){const r=t.pagination.bullets;let l,c,d;if(i.dynamicBullets&&(s=Ux(r[0],t.isHorizontal()?"width":"height",!0),u.forEach((e=>{e.style[t.isHorizontal()?"width":"height"]="".concat(s*(i.dynamicMainBullets+4),"px")})),i.dynamicMainBullets>1&&void 0!==a&&(o+=n-(a||0),o>i.dynamicMainBullets-1?o=i.dynamicMainBullets-1:o<0&&(o=0)),l=Math.max(n-o,0),c=l+(Math.min(r.length,i.dynamicMainBullets)-1),d=(c+l)/2),r.forEach((e=>{const t=[...["","-next","-next-next","-prev","-prev-prev","-main"].map((e=>"".concat(i.bulletActiveClass).concat(e)))].map((e=>"string"===typeof e&&e.includes(" ")?e.split(" "):e)).flat();e.classList.remove(...t)})),u.length>1)r.forEach((e=>{const r=jx(e);r===n?e.classList.add(...i.bulletActiveClass.split(" ")):t.isElement&&e.setAttribute("part","bullet"),i.dynamicBullets&&(r>=l&&r<=c&&e.classList.add(..."".concat(i.bulletActiveClass,"-main").split(" ")),r===l&&h(e,"prev"),r===c&&h(e,"next"))}));else{const e=r[n];if(e&&e.classList.add(...i.bulletActiveClass.split(" ")),t.isElement&&r.forEach(((e,t)=>{e.setAttribute("part",t===n?"bullet-active":"bullet")})),i.dynamicBullets){const e=r[l],t=r[c];for(let n=l;n<=c;n+=1)r[n]&&r[n].classList.add(..."".concat(i.bulletActiveClass,"-main").split(" "));h(e,"prev"),h(t,"next")}}if(i.dynamicBullets){const n=Math.min(r.length,i.dynamicMainBullets+4),a=(s*n-s)/2-d*s,o=e?"right":"left";r.forEach((e=>{e.style[t.isHorizontal()?o:"top"]="".concat(a,"px")}))}}u.forEach(((e,a)=>{if("fraction"===i.type&&(e.querySelectorAll(Ww(i.currentClass)).forEach((e=>{e.textContent=i.formatFractionCurrent(n+1)})),e.querySelectorAll(Ww(i.totalClass)).forEach((e=>{e.textContent=i.formatFractionTotal(p)}))),"progressbar"===i.type){let r;r=i.progressbarOpposite?t.isHorizontal()?"vertical":"horizontal":t.isHorizontal()?"horizontal":"vertical";const a=(n+1)/p;let s=1,o=1;"horizontal"===r?s=a:o=a,e.querySelectorAll(Ww(i.progressbarFillClass)).forEach((e=>{e.style.transform="translate3d(0,0,0) scaleX(".concat(s,") scaleY(").concat(o,")"),e.style.transitionDuration="".concat(t.params.speed,"ms")}))}"custom"===i.type&&i.renderCustom?(e.innerHTML=i.renderCustom(t,n+1,p),0===a&&r("paginationRender",e)):(0===a&&r("paginationRender",e),r("paginationUpdate",e)),t.params.watchOverflow&&t.enabled&&e.classList[t.isLocked?"add":"remove"](i.lockClass)}))}function p(){const e=t.params.pagination;if(c())return;const i=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:t.slides.length;let n=t.pagination.el;n=l(n);let a="";if("bullets"===e.type){let n=t.params.loop?Math.ceil(i/t.params.slidesPerGroup):t.snapGrid.length;t.params.freeMode&&t.params.freeMode.enabled&&n>i&&(n=i);for(let i=0;i<n;i+=1)e.renderBullet?a+=e.renderBullet.call(t,i,e.bulletClass):a+="<".concat(e.bulletElement," ").concat(t.isElement?'part="bullet"':"",' class="').concat(e.bulletClass,'"></').concat(e.bulletElement,">")}"fraction"===e.type&&(a=e.renderFraction?e.renderFraction.call(t,e.currentClass,e.totalClass):'<span class="'.concat(e.currentClass,'"></span>')+" / "+'<span class="'.concat(e.totalClass,'"></span>')),"progressbar"===e.type&&(a=e.renderProgressbar?e.renderProgressbar.call(t,e.progressbarFillClass):'<span class="'.concat(e.progressbarFillClass,'"></span>')),t.pagination.bullets=[],n.forEach((i=>{"custom"!==e.type&&(i.innerHTML=a||""),"bullets"===e.type&&t.pagination.bullets.push(...i.querySelectorAll(Ww(e.bulletClass)))})),"custom"!==e.type&&r("paginationRender",n[0])}function f(){t.params.pagination=Gw(t,t.originalParams.pagination,t.params.pagination,{el:"swiper-pagination"});const e=t.params.pagination;if(!e.el)return;let i;"string"===typeof e.el&&t.isElement&&(i=t.el.querySelector(e.el)),i||"string"!==typeof e.el||(i=[...document.querySelectorAll(e.el)]),i||(i=e.el),i&&0!==i.length&&(t.params.uniqueNavElements&&"string"===typeof e.el&&Array.isArray(i)&&i.length>1&&(i=[...t.el.querySelectorAll(e.el)],i.length>1&&(i=i.filter((e=>Vx(e,".swiper")[0]===t.el))[0])),Array.isArray(i)&&1===i.length&&(i=i[0]),Object.assign(t.pagination,{el:i}),i=l(i),i.forEach((i=>{"bullets"===e.type&&e.clickable&&i.classList.add(...(e.clickableClass||"").split(" ")),i.classList.add(e.modifierClass+e.type),i.classList.add(t.isHorizontal()?e.horizontalClass:e.verticalClass),"bullets"===e.type&&e.dynamicBullets&&(i.classList.add("".concat(e.modifierClass).concat(e.type,"-dynamic")),o=0,e.dynamicMainBullets<1&&(e.dynamicMainBullets=1)),"progressbar"===e.type&&e.progressbarOpposite&&i.classList.add(e.progressbarOppositeClass),e.clickable&&i.addEventListener("click",u),t.enabled||i.classList.add(e.lockClass)})))}function m(){const e=t.params.pagination;if(c())return;let i=t.pagination.el;i&&(i=l(i),i.forEach((i=>{i.classList.remove(e.hiddenClass),i.classList.remove(e.modifierClass+e.type),i.classList.remove(t.isHorizontal()?e.horizontalClass:e.verticalClass),e.clickable&&(i.classList.remove(...(e.clickableClass||"").split(" ")),i.removeEventListener("click",u))}))),t.pagination.bullets&&t.pagination.bullets.forEach((t=>t.classList.remove(...e.bulletActiveClass.split(" "))))}n("changeDirection",(()=>{if(!t.pagination||!t.pagination.el)return;const e=t.params.pagination;let{el:i}=t.pagination;i=l(i),i.forEach((i=>{i.classList.remove(e.horizontalClass,e.verticalClass),i.classList.add(t.isHorizontal()?e.horizontalClass:e.verticalClass)}))})),n("init",(()=>{!1===t.params.pagination.enabled?g():(f(),p(),d())})),n("activeIndexChange",(()=>{"undefined"===typeof t.snapIndex&&d()})),n("snapIndexChange",(()=>{d()})),n("snapGridLengthChange",(()=>{p(),d()})),n("destroy",(()=>{m()})),n("enable disable",(()=>{let{el:e}=t.pagination;e&&(e=l(e),e.forEach((e=>e.classList[t.enabled?"remove":"add"](t.params.pagination.lockClass))))})),n("lock unlock",(()=>{d()})),n("click",((e,i)=>{const n=i.target,a=l(t.pagination.el);if(t.params.pagination.el&&t.params.pagination.hideOnClick&&a&&a.length>0&&!n.classList.contains(t.params.pagination.bulletClass)){if(t.navigation&&(t.navigation.nextEl&&n===t.navigation.nextEl||t.navigation.prevEl&&n===t.navigation.prevEl))return;const e=a[0].classList.contains(t.params.pagination.hiddenClass);r(!0===e?"paginationShow":"paginationHide"),a.forEach((e=>e.classList.toggle(t.params.pagination.hiddenClass)))}}));const g=()=>{t.el.classList.add(t.params.pagination.paginationDisabledClass);let{el:e}=t.pagination;e&&(e=l(e),e.forEach((e=>e.classList.add(t.params.pagination.paginationDisabledClass)))),m()};Object.assign(t.pagination,{enable:()=>{t.el.classList.remove(t.params.pagination.paginationDisabledClass);let{el:e}=t.pagination;e&&(e=l(e),e.forEach((e=>e.classList.remove(t.params.pagination.paginationDisabledClass)))),f(),p(),d()},disable:g,render:p,update:d,init:f,destroy:m})}function Xw(e){let t,i,{swiper:n,extendParams:r,on:a,emit:s,params:o}=e;n.autoplay={running:!1,paused:!1,timeLeft:0},r({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!0,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}});let l,c,h,u,d,p,f,m=o&&o.autoplay?o.autoplay.delay:3e3,g=o&&o.autoplay?o.autoplay.delay:3e3,v=(new Date).getTime;function y(e){n&&!n.destroyed&&n.wrapperEl&&e.target===n.wrapperEl&&(n.wrapperEl.removeEventListener("transitionend",y),E())}const b=()=>{if(n.destroyed||!n.autoplay.running)return;n.autoplay.paused?c=!0:c&&(g=l,c=!1);const e=n.autoplay.paused?l:v+g-(new Date).getTime();n.autoplay.timeLeft=e,s("autoplayTimeLeft",e,e/m),i=requestAnimationFrame((()=>{b()}))},x=e=>{if(n.destroyed||!n.autoplay.running)return;cancelAnimationFrame(i),b();let r="undefined"===typeof e?n.params.autoplay.delay:e;m=n.params.autoplay.delay,g=n.params.autoplay.delay;const a=(()=>{let e;if(e=n.virtual&&n.params.virtual.enabled?n.slides.filter((e=>e.classList.contains("swiper-slide-active")))[0]:n.slides[n.activeIndex],!e)return;return parseInt(e.getAttribute("data-swiper-autoplay"),10)})();!Number.isNaN(a)&&a>0&&"undefined"===typeof e&&(r=a,m=a,g=a),l=r;const o=n.params.speed,c=()=>{n&&!n.destroyed&&(n.params.autoplay.reverseDirection?!n.isBeginning||n.params.loop||n.params.rewind?(n.slidePrev(o,!0,!0),s("autoplay")):n.params.autoplay.stopOnLastSlide||(n.slideTo(n.slides.length-1,o,!0,!0),s("autoplay")):!n.isEnd||n.params.loop||n.params.rewind?(n.slideNext(o,!0,!0),s("autoplay")):n.params.autoplay.stopOnLastSlide||(n.slideTo(0,o,!0,!0),s("autoplay")),n.params.cssMode&&(v=(new Date).getTime(),requestAnimationFrame((()=>{x()}))))};return r>0?(clearTimeout(t),t=setTimeout((()=>{c()}),r)):requestAnimationFrame((()=>{c()})),r},w=()=>{n.autoplay.running=!0,x(),s("autoplayStart")},_=()=>{n.autoplay.running=!1,clearTimeout(t),cancelAnimationFrame(i),s("autoplayStop")},S=(e,i)=>{if(n.destroyed||!n.autoplay.running)return;clearTimeout(t),e||(f=!0);const r=()=>{s("autoplayPause"),n.params.autoplay.waitForTransition?n.wrapperEl.addEventListener("transitionend",y):E()};if(n.autoplay.paused=!0,i)return p&&(l=n.params.autoplay.delay),p=!1,void r();const a=l||n.params.autoplay.delay;l=a-((new Date).getTime()-v),n.isEnd&&l<0&&!n.params.loop||(l<0&&(l=0),r())},E=()=>{n.isEnd&&l<0&&!n.params.loop||n.destroyed||!n.autoplay.running||(v=(new Date).getTime(),f?(f=!1,x(l)):x(),n.autoplay.paused=!1,s("autoplayResume"))},C=()=>{if(n.destroyed||!n.autoplay.running)return;const e=Ax();"hidden"===e.visibilityState&&(f=!0,S(!0)),"visible"===e.visibilityState&&E()},A=e=>{"mouse"===e.pointerType&&(f=!0,n.animating||n.autoplay.paused||S(!0))},M=e=>{"mouse"===e.pointerType&&n.autoplay.paused&&E()};a("init",(()=>{n.params.autoplay.enabled&&(n.params.autoplay.pauseOnMouseEnter&&(n.el.addEventListener("pointerenter",A),n.el.addEventListener("pointerleave",M)),Ax().addEventListener("visibilitychange",C),v=(new Date).getTime(),w())})),a("destroy",(()=>{n.el.removeEventListener("pointerenter",A),n.el.removeEventListener("pointerleave",M),Ax().removeEventListener("visibilitychange",C),n.autoplay.running&&_()})),a("beforeTransitionStart",((e,t,i)=>{!n.destroyed&&n.autoplay.running&&(i||!n.params.autoplay.disableOnInteraction?S(!0,!0):_())})),a("sliderFirstMove",(()=>{!n.destroyed&&n.autoplay.running&&(n.params.autoplay.disableOnInteraction?_():(h=!0,u=!1,f=!1,d=setTimeout((()=>{f=!0,u=!0,S(!0)}),200)))})),a("touchEnd",(()=>{if(!n.destroyed&&n.autoplay.running&&h){if(clearTimeout(d),clearTimeout(t),n.params.autoplay.disableOnInteraction)return u=!1,void(h=!1);u&&n.params.cssMode&&E(),u=!1,h=!1}})),a("slideChange",(()=>{!n.destroyed&&n.autoplay.running&&(p=!0)})),Object.assign(n.autoplay,{start:w,stop:_,pause:S,resume:E})}function Yw(e,t){const i=Bx(t);return i!==t&&(i.style.backfaceVisibility="hidden",i.style["-webkit-backface-visibility"]="hidden"),i}function Qw(e){let{swiper:t,duration:i,transformElements:n,allSlides:r}=e;const{activeIndex:a}=t;if(t.params.virtualTranslate&&0!==i){let e,i=!1;e=r?n:n.filter((e=>{const i=e.classList.contains("swiper-slide-transform")?(e=>{if(!e.parentElement)return t.slides.filter((t=>t.shadowRoot&&t.shadowRoot===e.parentNode))[0];return e.parentElement})(e):e;return t.getSlideIndex(i)===a})),e.forEach((e=>{!function(e,t){t&&e.addEventListener("transitionend",(function i(n){n.target===e&&(t.call(e,n),e.removeEventListener("transitionend",i))}))}(e,(()=>{if(i)return;if(!t||t.destroyed)return;i=!0,t.animating=!1;const e=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});t.wrapperEl.dispatchEvent(e)}))}))}}function Zw(e){let{swiper:t,extendParams:i,on:n}=e;i({fadeEffect:{crossFade:!1}});!function(e){const{effect:t,swiper:i,on:n,setTranslate:r,setTransition:a,overwriteParams:s,perspective:o,recreateShadows:l,getEffectParams:c}=e;let h;n("beforeInit",(()=>{if(i.params.effect!==t)return;i.classNames.push("".concat(i.params.containerModifierClass).concat(t)),o&&o()&&i.classNames.push("".concat(i.params.containerModifierClass,"3d"));const e=s?s():{};Object.assign(i.params,e),Object.assign(i.originalParams,e)})),n("setTranslate",(()=>{i.params.effect===t&&r()})),n("setTransition",((e,n)=>{i.params.effect===t&&a(n)})),n("transitionEnd",(()=>{if(i.params.effect===t&&l){if(!c||!c().slideShadows)return;i.slides.forEach((e=>{e.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((e=>e.remove()))})),l()}})),n("virtualUpdate",(()=>{i.params.effect===t&&(i.slides.length||(h=!0),requestAnimationFrame((()=>{h&&i.slides&&i.slides.length&&(r(),h=!1)})))}))}({effect:"fade",swiper:t,on:n,setTranslate:()=>{const{slides:e}=t;t.params.fadeEffect;for(let i=0;i<e.length;i+=1){const e=t.slides[i];let n=-e.swiperSlideOffset;t.params.virtualTranslate||(n-=t.translate);let r=0;t.isHorizontal()||(r=n,n=0);const a=t.params.fadeEffect.crossFade?Math.max(1-Math.abs(e.progress),0):1+Math.min(Math.max(e.progress,-1),0),s=Yw(0,e);s.style.opacity=a,s.style.transform="translate3d(".concat(n,"px, ").concat(r,"px, 0px)")}},setTransition:e=>{const i=t.slides.map((e=>Bx(e)));i.forEach((t=>{t.style.transitionDuration="".concat(e,"ms")})),Qw({swiper:t,duration:e,transformElements:i,allSlides:!0})},overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!t.params.cssMode})})}Uw.displayName="SwiperSlide";const Kw=e=>{let{prev:t=!1}=e;const i=(t?"backwards":"")+" "+(t?"swiper-button-prev":"swiper-button-next");return(0,$o.jsx)("button",{className:"button next ".concat(i)})},Jw=()=>{const{slug:e}=yo(),i=xs(),n=us(Or);t.useEffect((()=>{i(Er())}),[i,e]);const r=n.filter((t=>t.slug!==e)),a=[Hw,qw];return!!r.length&&(0,$o.jsx)("section",{className:"container",children:(0,$o.jsxs)("div",{className:"news-slider-section",children:[(0,$o.jsx)("h2",{children:"You may be interested"}),(0,$o.jsxs)("div",{className:"news-slider",children:[(0,$o.jsxs)("div",{className:"news-slider__navigation",children:[(0,$o.jsx)(Kw,{prev:!0}),(0,$o.jsx)(Kw,{})]}),(0,$o.jsx)(Vw,{pagination:!0,modules:a,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},breakpoints:{320:{slidesPerView:1},768:{slidesPerView:2},1024:{slidesPerView:3}},spaceBetween:8,children:r.map((e=>(0,$o.jsx)(Uw,{children:(0,$o.jsx)(gx,{data:e})},e.title)))})]})]})})},$w=()=>{const{slug:e}=yo(),i=xs(),n=us(Dr),r=us(kr),a=us(ka),s=go(),o=ja("article-content");t.useEffect((()=>{Va(i(xr({slug:e})),s)}),[i,e]);const{up_text:l="",down_text:c="",section_text:h=[],title:u,title_background:d,type:p,crated_at:f,time_to_read:m,fs_button:g}=n,v=h.map((e=>"<div class='box'><img src='".concat(e.image,"' alt='article-image' /><div>").concat(e.text,"</div></div>"))).join(""),y="".concat(l||"").concat(v).concat(c||""),b=a[p];return r?(0,$o.jsx)(pv,{}):(0,$o.jsxs)($o.Fragment,{children:[(0,$o.jsxs)(sl,{image:d,buttonText:g,onClickButton:o,children:[(0,$o.jsx)(ax,{children:b}),(0,$o.jsx)("h2",{children:u}),(0,$o.jsxs)("div",{children:[(0,$o.jsx)(mx,{iconName:"calendar",text:f}),(0,$o.jsx)(mx,{iconName:"clock",text:m})]})]}),(0,$o.jsx)("article",{className:"article-content",dangerouslySetInnerHTML:{__html:y}}),(0,$o.jsx)(Jw,{})]})},e_=e=>{let{label:i,children:n,setFile:r}=e;const[a,s]=(0,t.useState)(""),o=a?"file-attached":"";return(0,$o.jsxs)("div",{className:"form-control-container",children:[(0,$o.jsx)("span",{className:"form-control__label",children:i}),(0,$o.jsx)("div",{className:"attach-file-wrapper",children:(0,$o.jsxs)("label",{className:"button attach-file ".concat(o),children:[a||n,(0,$o.jsx)("input",{type:"file",onChange:e=>{var t;const i=e.target;s((null===i||void 0===i||null===(t=i.files[0])||void 0===t?void 0:t.name)||n),r(null===i||void 0===i?void 0:i.files[0])}})]})})]})},t_=()=>{const{pathname:e}=fo(),[i,n]=(0,t.useState)(""),[r,a]=(0,t.useState)(!1),[s,o]=(0,t.useState)(!1),[l,c]=(0,t.useState)(""),[h,u]=(0,t.useState)(null),[d,p]=(0,t.useState)({name:"",email:"",phone:"",last_name:""}),{cta_field_email_placeholder:f,cta_field_email_title:m,cta_field_message_placeholder:g,cta_field_message_title:v,cta_field_name_placeholder:y,cta_field_name_title:b,cta_field_phone_placeholder:x,cta_field_phone_title:w,cta_field_file_title:_,cta_field_file_placeholder:S,cta_policy_careers_text:E,cta_field_last_name_title:C,cta_field_last_name_placeholder:A}=us(Pa),M=[{name:"name",required:!0,label:b,placeholder:y},{name:"last_name",required:!0,label:C,placeholder:A},{name:"email",required:!0,label:m,placeholder:f},{name:"phone",label:w,placeholder:x}],T=!s||""===d.name||""===d.last_name||""===d.email||r;return"success"===i?(0,$o.jsx)(Hy,{}):(0,$o.jsxs)("div",{className:"form-container",children:[(0,$o.jsxs)("div",{className:"form-body",children:[M.map((e=>{let{placeholder:t,label:i,name:n,required:r}=e;return(0,$o.jsx)(jy,{type:n,value:d[n],onChange:e=>p({...d,[n]:e}),label:i,placeholder:t,required:r,className:"form-item-half"},n)})),(0,$o.jsx)(Vy,{value:l,onChange:e=>c(e),label:v,placeholder:g}),(0,$o.jsx)(e_,{setFile:u,label:_,children:S})]}),(0,$o.jsxs)("div",{className:"form-footer",children:[(0,$o.jsx)(Uy,{onChange:()=>o(!s),checked:s,children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:E}})}),(0,$o.jsx)(Gy,{onClick:()=>{T||(a(!0),Xi.postForm("".concat(tn+Yi.Zd),{...d,message:l,from_page:e,file:h}).then((e=>{n(e.data.status),a(!1)})).catch((function(e){console.log(e),a(!1)})))},disabled:T})]})]})},i_=()=>{const{cta_description:e}=us(Pa);return(0,$o.jsx)(zy,{children:(0,$o.jsx)("div",{className:"career-form",children:(0,$o.jsx)("p",{className:"description-medium",dangerouslySetInnerHTML:{__html:e}})})})},n_=()=>(0,$o.jsx)(By,{sidebar:(0,$o.jsx)(i_,{}),className:"career-form-section",children:(0,$o.jsx)(t_,{})});var r_,a_;function s_(){return s_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},s_.apply(this,arguments)}function o_(e,i){let{title:n,titleId:r,...a}=e;return t.createElement("svg",s_({xmlns:"http://www.w3.org/2000/svg",width:18,height:18,viewBox:"0 0 18 18",fill:"currentColor",ref:i,"aria-labelledby":r},a),n?t.createElement("title",{id:r},n):null,r_||(r_=t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 6.9375C8.79289 6.9375 8.625 7.10539 8.625 7.3125C8.625 7.51961 8.79289 7.6875 9 7.6875C9.20711 7.6875 9.375 7.51961 9.375 7.3125C9.375 7.10539 9.20711 6.9375 9 6.9375ZM7.125 7.3125C7.125 6.27697 7.96447 5.4375 9 5.4375C10.0355 5.4375 10.875 6.27697 10.875 7.3125C10.875 8.34803 10.0355 9.1875 9 9.1875C7.96447 9.1875 7.125 8.34803 7.125 7.3125Z"})),a_||(a_=t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 2.4375C7.62099 2.4375 6.30538 2.95957 5.34089 3.87813C4.37765 4.79551 3.84375 6.0317 3.84375 7.3125C3.84375 9.5607 5.16578 11.6336 6.60074 13.2052C7.30744 13.9792 8.01637 14.604 8.54905 15.0352C8.72019 15.1738 8.87253 15.2919 9 15.388C9.12747 15.2919 9.27981 15.1738 9.45095 15.0352C9.98363 14.604 10.6926 13.9792 11.3993 13.2052C12.8342 11.6336 14.1562 9.5607 14.1562 7.3125C14.1562 6.0317 13.6224 4.79551 12.6591 3.87813C11.6946 2.95957 10.379 2.4375 9 2.4375ZM9 16.3125C8.58397 16.9365 8.58377 16.9364 8.58355 16.9363L8.58298 16.9359L8.58144 16.9348L8.57677 16.9317L8.56112 16.9211C8.54793 16.9121 8.52928 16.8993 8.50554 16.8828C8.45808 16.8498 8.3902 16.8019 8.30484 16.7398C8.13419 16.6156 7.89319 16.4342 7.60525 16.2011C7.03051 15.7358 6.26287 15.0598 5.49301 14.2166C3.97485 12.5539 2.34375 10.1268 2.34375 7.3125C2.34375 5.60961 3.05438 3.98433 4.30641 2.79192C5.55719 1.6007 7.24614 0.9375 9 0.9375C10.7539 0.9375 12.4428 1.6007 13.6936 2.79192C14.9456 3.98433 15.6562 5.60961 15.6562 7.3125C15.6562 10.1268 14.0252 12.5539 12.507 14.2166C11.7371 15.0598 10.9695 15.7358 10.3948 16.2011C10.1068 16.4342 9.86581 16.6156 9.69516 16.7398C9.6098 16.8019 9.54192 16.8498 9.49446 16.8828C9.47072 16.8993 9.45207 16.9121 9.43888 16.9211L9.42323 16.9317L9.41856 16.9348L9.41702 16.9359L9.41645 16.9363C9.41623 16.9364 9.41603 16.9365 9 16.3125ZM9 16.3125L9.41603 16.9365L9 17.2139L8.58397 16.9365L9 16.3125Z"})))}const l_=t.forwardRef(o_);__webpack_require__.p;var c_,h_,u_,d_,p_,f_,m_;function g_(){return g_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},g_.apply(this,arguments)}function v_(e,i){let{title:n,titleId:r,...a}=e;return t.createElement("svg",g_({xmlns:"http://www.w3.org/2000/svg",width:18,height:18,viewBox:"0 0 18 18",fill:"currentColor",ref:i,"aria-labelledby":r},a),n?t.createElement("title",{id:r},n):null,c_||(c_=t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.93608 0.939394C9.17333 0.927825 9.40928 0.980859 9.61876 1.09284C9.82824 1.20482 10.0034 1.37155 10.1256 1.57526C10.2478 1.77897 10.3124 2.01201 10.3125 2.24955V2.25V15.1875H8.8125V2.60067L3.5625 6.10045V15.1875H2.0625V6.00172M8.93608 0.939394C8.69892 0.950958 8.46934 1.02664 8.27181 1.15837ZM9.10406 2.40631C9.10398 2.40636 9.1039 2.40642 9.10382 2.40647Z"})),h_||(h_=t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.4375 6.9375H9.5625V5.4375H14.625C14.9731 5.4375 15.3069 5.57578 15.5531 5.82192C15.7992 6.06806 15.9375 6.4019 15.9375 6.75V15.1875H14.4375V6.9375Z"})),u_||(u_=t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.875 15.9375H1.125V14.4375H16.875V15.9375Z"})),d_||(d_=t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.5625 9V7.875H8.0625V9H6.5625Z"})),p_||(p_=t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.3125 9V7.875H5.8125V9H4.3125Z"})),f_||(f_=t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.3125 12.9375V11.8125H5.8125V12.9375H4.3125Z"})),m_||(m_=t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.5625 12.9375V11.8125H8.0625V12.9375H6.5625Z"})))}const y_=t.forwardRef(v_);__webpack_require__.p;var b_,x_;function w_(){return w_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},w_.apply(this,arguments)}function __(e,i){let{title:n,titleId:r,...a}=e;return t.createElement("svg",w_({xmlns:"http://www.w3.org/2000/svg",width:18,height:18,viewBox:"0 0 18 18",fill:"currentColor",ref:i,"aria-labelledby":r},a),n?t.createElement("title",{id:r},n):null,b_||(b_=t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.7155 3.45704C7.50071 3.64211 7.23331 3.84465 6.91804 3.97516L6.91794 3.9752C6.60554 4.10447 6.27442 4.14598 5.99737 4.16395C5.81653 4.17567 5.60999 4.17889 5.42788 4.18173C5.34366 4.18304 5.26466 4.18427 5.19584 4.18622C4.64709 4.2018 4.44666 4.27244 4.35955 4.35955C4.27244 4.44666 4.2018 4.64709 4.18622 5.19584C4.18427 5.26466 4.18304 5.34366 4.18173 5.42788C4.17889 5.60999 4.17567 5.81653 4.16395 5.99737C4.14598 6.27442 4.10447 6.60554 3.9752 6.91794L3.97472 6.91909C3.84412 7.23324 3.64159 7.50002 3.45684 7.71426C3.33023 7.86107 3.18183 8.016 3.05159 8.15196C2.99838 8.2075 2.94821 8.25988 2.90379 8.30725C2.73133 8.49116 2.60793 8.63714 2.52692 8.76845C2.44894 8.89485 2.4375 8.96472 2.4375 9C2.4375 9.03528 2.44894 9.10515 2.52692 9.23155C2.60793 9.36286 2.73133 9.50884 2.90379 9.69275C2.94821 9.74012 2.99838 9.79249 3.05158 9.84803C3.18182 9.984 3.33023 10.1389 3.45684 10.2857C3.64159 10.5 3.84412 10.7668 3.97472 11.0809L3.97529 11.0823C4.10447 11.3947 4.14598 11.7258 4.16395 12.0029C4.17567 12.1838 4.17889 12.3903 4.18173 12.5724C4.18304 12.6566 4.18427 12.7356 4.18622 12.8044C4.20179 13.353 4.27241 13.5533 4.35955 13.6405C4.44666 13.7276 4.64709 13.7982 5.19584 13.8138C5.26465 13.8157 5.34365 13.817 5.42787 13.8183C5.60998 13.8211 5.81652 13.8243 5.99737 13.8361C6.27442 13.854 6.60554 13.8955 6.91794 14.0248L6.91909 14.0253C7.23324 14.1559 7.50002 14.3584 7.71426 14.5432C7.86108 14.6698 8.01601 14.8182 8.15197 14.9484C8.20751 15.0016 8.25988 15.0518 8.30725 15.0962C8.49116 15.2687 8.63714 15.3921 8.76845 15.4731C8.89485 15.5511 8.96472 15.5625 9 15.5625C9.03528 15.5625 9.10515 15.5511 9.23155 15.4731C9.36286 15.3921 9.50884 15.2687 9.69275 15.0962C9.74012 15.0518 9.79249 15.0016 9.84803 14.9484C9.98399 14.8182 10.1389 14.6698 10.2857 14.5432C10.5 14.3584 10.7668 14.1559 11.0809 14.0253L11.0823 14.0247C11.3947 13.8955 11.7258 13.854 12.0029 13.8361C12.1838 13.8243 12.3903 13.8211 12.5724 13.8183C12.6566 13.817 12.7356 13.8157 12.8044 13.8138C13.353 13.7982 13.5533 13.7276 13.6405 13.6405C13.7276 13.5533 13.7982 13.353 13.8138 12.8044C13.8157 12.7356 13.817 12.6566 13.8183 12.5724C13.8211 12.3903 13.8243 12.1838 13.8361 12.0029C13.854 11.7258 13.8955 11.3947 14.0247 11.0823L14.0253 11.0809C14.1559 10.7668 14.3584 10.5 14.5432 10.2857C14.6698 10.1389 14.8182 9.98399 14.9484 9.84803C15.0016 9.79249 15.0518 9.74012 15.0962 9.69275C15.2687 9.50884 15.3921 9.36286 15.4731 9.23155C15.5511 9.10515 15.5625 9.03528 15.5625 9C15.5625 8.96485 15.5511 8.89531 15.4733 8.76934C15.3924 8.63835 15.2691 8.49273 15.0965 8.30888C15.0526 8.26207 15.003 8.21042 14.9506 8.15567C14.8198 8.01924 14.6705 7.86354 14.543 7.7155C14.3579 7.50071 14.1554 7.23331 14.0248 6.91804L14.0247 6.91772C13.8955 6.60527 13.854 6.27418 13.8361 5.99707C13.8243 5.81621 13.8211 5.60968 13.8183 5.42759C13.817 5.34337 13.8157 5.26438 13.8138 5.19558C13.7982 4.647 13.7276 4.44669 13.6405 4.35955C13.5533 4.27241 13.353 4.20179 12.8044 4.18622C12.7356 4.18427 12.6566 4.18304 12.5724 4.18173C12.3903 4.17889 12.1838 4.17567 12.0029 4.16395C11.7258 4.14598 11.3947 4.10447 11.0823 3.97529L11.0809 3.97472C10.7668 3.84412 10.5 3.64159 10.2857 3.45684C10.1389 3.33023 9.984 3.18182 9.84803 3.05158C9.79249 2.99838 9.74012 2.94821 9.69275 2.90379C9.50884 2.73133 9.36286 2.60793 9.23155 2.52692C9.10515 2.44894 9.03528 2.4375 9 2.4375C8.96485 2.4375 8.89531 2.44886 8.76934 2.52668C8.63835 2.6076 8.49273 2.7309 8.30888 2.9035C8.26207 2.94744 8.21042 2.99696 8.15566 3.04945C8.01924 3.18024 7.86354 3.32949 7.7155 3.45704ZM7.98099 1.25055C8.25259 1.08276 8.5957 0.9375 9 0.9375C9.40418 0.9375 9.74739 1.08268 10.0191 1.25031C10.2859 1.41491 10.5231 1.62611 10.7188 1.80961C10.7926 1.87884 10.8591 1.94258 10.9217 2.00259C11.0424 2.11839 11.1487 2.22029 11.2653 2.32087C11.4346 2.46683 11.5593 2.54902 11.6561 2.58937C11.7416 2.62459 11.8788 2.65275 12.1 2.66709C12.2466 2.6766 12.3837 2.67857 12.5399 2.68082C12.6334 2.68217 12.7337 2.68361 12.847 2.68683C13.3387 2.70078 14.1414 2.73915 14.7011 3.29889C15.2608 3.85863 15.2992 4.66133 15.3132 5.15301C15.3164 5.26629 15.3178 5.36659 15.3192 5.46006C15.3214 5.61626 15.3234 5.75338 15.3329 5.90003C15.3473 6.12182 15.3756 6.25911 15.4109 6.34462L14.7178 6.63117L15.4108 6.3443C15.4511 6.44177 15.5334 6.56698 15.6793 6.7364C15.7803 6.85355 15.8828 6.96041 15.9995 7.08197C16.0588 7.14382 16.1218 7.20947 16.1901 7.28221C16.3735 7.47753 16.5848 7.71441 16.7494 7.98099C16.9172 8.25259 17.0625 8.5957 17.0625 9C17.0625 9.40418 16.9173 9.74739 16.7497 10.0191C16.5851 10.2859 16.3739 10.5231 16.1904 10.7188C16.1212 10.7926 16.0574 10.8591 15.9974 10.9217C15.8816 11.0424 15.7797 11.1487 15.6791 11.2653C15.5332 11.4345 15.451 11.5592 15.4107 11.656C15.3754 11.7415 15.3473 11.8787 15.3329 12.1C15.3234 12.2466 15.3214 12.3837 15.3192 12.5399C15.3178 12.6334 15.3164 12.7337 15.3132 12.847C15.2992 13.3387 15.2608 14.1414 14.7011 14.7011C14.1414 15.2608 13.3387 15.2992 12.847 15.3132C12.7337 15.3164 12.6334 15.3178 12.5399 15.3192C12.3837 15.3214 12.2466 15.3234 12.1 15.3329C11.8787 15.3473 11.7415 15.3754 11.656 15.4107C11.5592 15.451 11.4345 15.5332 11.2653 15.6791C11.1487 15.7797 11.0424 15.8816 10.9217 15.9974C10.8591 16.0574 10.7926 16.1212 10.7188 16.1904C10.5231 16.3739 10.2859 16.5851 10.0191 16.7497C9.74739 16.9173 9.40418 17.0625 9 17.0625C8.59582 17.0625 8.25261 16.9173 7.98089 16.7497C7.71407 16.5851 7.47689 16.3739 7.28121 16.1904C7.20738 16.1212 7.14091 16.0574 7.07833 15.9974C6.95758 15.8816 6.85132 15.7797 6.73467 15.6791C6.56542 15.5332 6.44065 15.451 6.34393 15.4106C6.25867 15.3755 6.12169 15.3473 5.90032 15.3329C5.75369 15.3234 5.61657 15.3214 5.46035 15.3192C5.36688 15.3178 5.26656 15.3164 5.15328 15.3132C4.66158 15.2992 3.85865 15.2609 3.29889 14.7011C2.73915 14.1414 2.70078 13.3387 2.68683 12.847C2.68361 12.7337 2.68217 12.6334 2.68082 12.5399C2.67857 12.3837 2.6766 12.2466 2.66709 12.1C2.65275 11.8788 2.62459 11.7416 2.58937 11.6561C2.54902 11.5593 2.46683 11.4346 2.32087 11.2653C2.22029 11.1487 2.11839 11.0424 2.00259 10.9217C1.94258 10.8591 1.87884 10.7926 1.80961 10.7188C1.62611 10.5231 1.41491 10.2859 1.25031 10.0191C1.08268 9.74739 0.9375 9.40418 0.9375 9C0.9375 8.59582 1.08268 8.25261 1.25031 7.98089C1.41491 7.71407 1.62611 7.47689 1.80961 7.28121C1.87883 7.20738 1.94258 7.14091 2.00259 7.07833C2.11839 6.95758 2.22029 6.85132 2.32087 6.73467C2.46688 6.56536 2.54908 6.44056 2.58942 6.34382C2.62457 6.25856 2.65274 6.1216 2.66709 5.90032C2.6766 5.75369 2.67857 5.61657 2.68082 5.46034C2.68217 5.36687 2.68361 5.26656 2.68683 5.15328C2.70078 4.66158 2.73913 3.85865 3.29889 3.29889C3.85865 2.73913 4.66158 2.70078 5.15328 2.68683C5.26656 2.68361 5.36687 2.68217 5.46034 2.68082C5.61657 2.67857 5.75369 2.6766 5.90032 2.66709C6.12202 2.65271 6.25908 2.62446 6.3443 2.58922M7.98099 1.25055C7.71441 1.41524 7.47753 1.62654 7.28221 1.8099ZM7.28221 1.8099C7.20947 1.8782 7.14382 1.94119 7.08197 2.00054ZM7.08197 2.00054C6.96041 2.11719 6.85355 2.21973 6.7364 2.32067ZM6.7364 2.32067C6.56704 2.46659 6.44186 2.54881 6.34441 2.58917Z"})),x_||(x_=t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.3429 7.84283L7.87506 12.3107L5.65723 10.0928L6.71789 9.03217L7.87506 10.1893L11.2822 6.78217L12.3429 7.84283Z"})))}const S_=t.forwardRef(__),E_=(__webpack_require__.p,e=>{let{experience:t,locations:i,work_type:n}=e;const r=[{type:"experience",text:t},{type:"locations",text:i},{type:"work_type",text:n}].filter((e=>!!e.text));return!!r.length&&(0,$o.jsx)("div",{className:"job-labels",children:r.map(((e,t)=>{return(0,$o.jsxs)("div",{className:"job-label body3",children:[(i=e.type,{locations:(0,$o.jsx)(l_,{}),work_type:(0,$o.jsx)(y_,{}),experience:(0,$o.jsx)(S_,{})}[i]),(0,$o.jsx)("div",{children:e.text})]},t);var i}))})}),C_=()=>{const{slug:e}=yo(),i=xs(),n=us(Kn),r=us(Jn),a=go();t.useEffect((()=>{Va(i(qn({slug:e})),a)}),[i,e]);const{title:s,data:o,experience:l,locations:c,work_type:h,title_background:u,created_at:d,fs_button:p}=n,f=(0,t.useRef)();return xg({items:[".article-content"],container:f,dependencies:[r]}),r?(0,$o.jsx)(pv,{}):(0,$o.jsxs)("div",{ref:f,children:[(0,$o.jsxs)(sl,{image:u,buttonText:p,onClickButton:()=>ja("form-section",100),children:[(0,$o.jsx)("h2",{children:s}),(0,$o.jsx)(E_,{experience:l,locations:c,work_type:h}),(0,$o.jsx)(mx,{iconName:"calendar",text:d})]}),(0,$o.jsx)("article",{className:"article-content",dangerouslySetInnerHTML:{__html:o}}),(0,$o.jsx)(n_,{})]})},A_=e=>{let{item:t}=e;const{slug:i,title:n,locations:r,experience:a,work_type:s,created_at:o,preview_description:l}=t;return(0,$o.jsxs)(Ho,{to:"".concat(Xo.career,"/").concat(i),className:"job-card",children:[(0,$o.jsxs)("div",{className:"job-card__title",children:[(0,$o.jsx)("span",{children:n}),(0,$o.jsx)(Fv,{})]}),(0,$o.jsx)("div",{className:"job-card__description opacity-70 body1",children:l}),(0,$o.jsx)(E_,{experience:a,locations:r,work_type:s}),(0,$o.jsx)(mx,{iconName:"calendar",text:o})]})},M_=()=>{const[e,i]=(0,t.useState)(1),n=xs(),{data:r,next:a}=us(Zn);(0,t.useEffect)((()=>{n(Wn({page:e}))}),[n,e]);return!!r.length&&(0,$o.jsxs)($o.Fragment,{children:[(0,$o.jsx)("div",{className:"job-cards",children:r.map((e=>(0,$o.jsx)(A_,{item:e},e.title)))}),(0,$o.jsx)(ub,{next:a,onClick:()=>i(e+1)})]})},T_=e=>{let{list:i,time:n,toRight:r=!1}=e;const a=t.useRef(null),s=t.useRef(null),[o,l]=t.useState(0),[c,h]=t.useState(i),[u,d]=t.useState(n);return t.useEffect((()=>{const e=Math.floor(a.current.offsetWidth),t=Math.floor(464*i.length),r=Math.max(2,Math.ceil(2*e/t)),s=n*parseFloat((1856/e).toFixed(2));h(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=[];for(let n=0;n<t;n++)i.push(...e);return i}(i,r)),l(1856),d(s)}),[i,n]),(0,$o.jsx)("div",{className:"marquee-container",ref:a,children:(0,$o.jsx)("div",{className:"marquee-area",ref:s,style:{transform:"translateX(-".concat(o,"px)"),animationDuration:"".concat(u,"s"),animationDirection:"".concat(r?" reverse":"")},children:c.map(((e,t)=>(0,$o.jsx)("div",{className:"marquee-item",style:{backgroundImage:'url("'.concat(e,'")')}},t)))})})},P_=e=>{let{images:t=[],title:i}=e;const n=t.slice(0,t.length/2),r=t.slice(t.length/2);return t.length&&(0,$o.jsx)("section",{className:"container",children:(0,$o.jsxs)("div",{className:"marquee-gallery-section",children:[(0,$o.jsx)("h2",{className:"has-animation",children:i}),(0,$o.jsxs)("div",{className:"marquee-gallery",children:[(0,$o.jsx)(T_,{list:n,time:35}),(0,$o.jsx)(T_,{list:r,toRight:!0,time:50})]})]})})},D_=()=>{const e=xs(),i=us(Qn),{fs_title:n,about_tag:r,fs_title_background:a,about_title:s,about_description:o,open_jobs_tag:l,open_jobs_title:c,git_tag:h,git_title:u,git_text:d,team_gallery:p,team_title:f,mission_large_background:m,mission_text:g,mission_cards:v,fs_view_button:y}=us(Yn);(0,t.useEffect)((()=>{e(Hn())}),[e]);const b=(0,t.useRef)();return xg({items:[".job-cards"],container:b,dependencies:[i]}),i?(0,$o.jsx)(pv,{}):(0,$o.jsxs)("div",{ref:b,children:[(0,$o.jsx)(sl,{image:a,buttonText:y,onClickButton:()=>ja("JobCards"),children:(0,$o.jsx)(ol,{size:"middle",textColor:"white",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:n}})})}),(0,$o.jsx)("section",{className:"container",children:(0,$o.jsx)("div",{className:"inner-container type-2",children:(0,$o.jsxs)("div",{className:"main-text-container",children:[(0,$o.jsx)(ll,{children:r}),(0,$o.jsx)(ol,{className:"has-animation",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:s}})}),(0,$o.jsx)("div",{className:"offset-left-4 max-width-760",children:(0,$o.jsx)(ol,{size:"super-small",className:"has-animation",children:o})})]})})}),(0,$o.jsx)(tx,{loading:i,background:m,title:g,data:v}),(0,$o.jsx)("section",{className:"container JobCards",children:(0,$o.jsxs)("div",{className:"inner-container type-2",children:[(0,$o.jsxs)("div",{className:"main-text-container with-absolute-label",children:[(0,$o.jsx)(ll,{children:l}),(0,$o.jsx)("div",{className:"offset-left-4 max-width-760",children:(0,$o.jsx)(ol,{size:"middle",className:"has-animation",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:c}})})})]}),(0,$o.jsx)(M_,{})]})}),(0,$o.jsx)(P_,{images:p,title:f}),(0,$o.jsx)("section",{className:"container",children:(0,$o.jsx)("div",{className:"inner-container type-3",children:(0,$o.jsxs)("div",{className:"main-text-container",children:[(0,$o.jsx)(ll,{children:h}),(0,$o.jsx)(ol,{size:"middle",className:"has-animation",children:(0,$o.jsx)("p",{className:"max-width-1024 pb-40 ",dangerouslySetInnerHTML:{__html:u}})}),(0,$o.jsx)("div",{className:"offset-left-4 max-width-760",children:(0,$o.jsx)(ol,{size:"super-small",className:"has-animation",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:d}})})})]})})}),(0,$o.jsx)(n_,{})]})},k_=e=>{let{pageContentData:i}=e;const[n,r]=(0,t.useState)({}),[a,s]=(0,t.useState)(0),o=[],l=[];i.forEach((e=>{Object.entries(e).forEach((e=>{let[t,i]=e;const n=i.title||i.policy_title;n&&(o.push(((e,t)=>{switch(e){case"block":return(0,$o.jsxs)($y,{children:[t.title&&(0,$o.jsx)("h3",{children:t.title}),(0,$o.jsx)("div",{dangerouslySetInnerHTML:{__html:t.text}})]});case"pdf":{const{policy_title:e,flyers:i}=t;return(0,$o.jsx)(ob,{title:e,data:i})}default:return null}})(t,i)),l.push(n))}))}));const c=o.length,[h,u]=(0,t.useState)([]);return(0,t.useEffect)((()=>{u((e=>Array(c).fill().map(((i,n)=>e[n]||(0,t.createRef)()))))}),[c]),(0,t.useEffect)((()=>{s(ab(n))}),[n]),(0,$o.jsx)("section",{className:"container",children:(0,$o.jsx)(Ly,{containerType:"type-1",Sidebar:(0,$o.jsx)(tb,{activeIndex:a,refs:h,items:l}),children:o.map(((e,t)=>(0,$o.jsx)("div",{ref:h[t],children:(0,$o.jsx)(rb,{index:t,setData:r,children:e})},t)))})})},O_=e=>{let{title:t,background:i,buttonText:n,pageContentData:r,pageRef:a}=e;return(0,$o.jsxs)("div",{ref:a,children:[(0,$o.jsx)(sl,{title:t,image:i,buttonText:n,onClickButton:()=>ja("with-sidebar-layout",100)}),(0,$o.jsx)(k_,{pageContentData:r})]})},I_=()=>{const e=xs(),i=us(ua),{fs_title:n,fs_background:r,fs_description:a,blocks:s=[],policy_title:o,flyers:l}=us(ca);t.useEffect((()=>{e(sa())}),[e]);const c=[{pdf:{policy_title:o,flyers:l}},...s.map((e=>({block:e})))],h=(0,t.useRef)();return xg({items:[".with-sidebar-layout__left",".box"],container:h,dependencies:[i]}),i?(0,$o.jsx)(pv,{}):(0,$o.jsx)(O_,{pageRef:h,title:n,background:r,buttonText:a,pageContentData:c})},R_=()=>{const e=xs(),i=us(ha),{fs_title:n,fs_background:r,fs_button:a,blocks:s=[]}=us(la),o=s.map((e=>({block:e})));t.useEffect((()=>{e(aa())}),[e]);const l=(0,t.useRef)();return xg({items:[".with-sidebar-layout__left",".box"],container:l,dependencies:[i]}),i?(0,$o.jsx)(pv,{}):(0,$o.jsx)(O_,{pageRef:l,title:n,background:r,buttonText:a,pageContentData:o})},L_=__webpack_require__.p+"static/media/office.e823084fc37a2da3babe.jpg",B_=e=>{let{data:t}=e;const{sales_photo:i,sales_name:n,sales_description:r,sales_phone:a,sales_email:s}=t||{};return t&&(0,$o.jsxs)("div",{className:"distribution-contacts__contacts-wrapper__distributor",children:[i&&(0,$o.jsx)("img",{src:i,alt:""}),n&&(0,$o.jsx)("p",{className:"description-demibold",children:n}),r&&(0,$o.jsx)("p",{className:"body1",children:r}),a&&(0,$o.jsx)("a",{className:"distribution-contacts__contact button-text distributor-phone",href:"tel:".concat(a),children:a}),s&&(0,$o.jsx)("a",{className:"distribution-contacts__contact button-text distributor-email",href:"mailto:".concat(s),children:s})]})},z_=e=>{let{image:t}=e;return(0,$o.jsx)("img",{src:t||L_,alt:"map"})},N_=()=>{const{countries:e=[],country_description:i,country_select_text:n,region_select_text:r}=us(ma),[a,s]=(0,t.useState)(void 0),[o,l]=(0,t.useState)(void 0);(0,t.useEffect)((()=>{s(e[0])}),[e]),(0,t.useEffect)((()=>{l(null===a||void 0===a?void 0:a.regions[0])}),[a]);const c=Lv("max-width: 1023px");return(0,$o.jsx)("section",{className:"container",children:(0,$o.jsxs)("div",{className:"distribution-contacts",children:[(0,$o.jsxs)("div",{className:"distribution-contacts__contacts-wrapper",children:[(0,$o.jsxs)("div",{className:"distribution-contacts__contacts-wrapper__contacts",children:[(0,$o.jsx)("p",{className:"description-medium",children:i}),(0,$o.jsxs)("div",{className:"dropdowns",children:[(0,$o.jsx)(ry,{label:n,options:e,selectedValue:a,onChange:e=>s(e)}),!(null===a||void 0===a||!a.regions.length)&&(0,$o.jsx)(ry,{label:r,options:a.regions,selectedValue:o,onChange:e=>l(e)})]})]}),!c&&(0,$o.jsx)(B_,{data:o||a})]}),(0,$o.jsx)(z_,{image:(null===o||void 0===o?void 0:o.image)||(null===a||void 0===a?void 0:a.image)}),c&&(0,$o.jsx)(B_,{data:o||a})]})})},F_=e=>{let{data:t=[]}=e;return(0,$o.jsx)("div",{className:"contacts-cards",children:t.map((e=>{let{icon:t,title:i,text:n}=e;return(0,$o.jsxs)("div",{className:"contact-card",children:[(0,$o.jsxs)("div",{className:"body3 contact-card__title",children:[(0,$o.jsx)("img",{src:t,alt:"icon"}),i]}),(0,$o.jsx)("div",{className:"description-demibold",children:n})]},i)}))})},j_=()=>{const e=xs(),i=fo(),{fs_title:n,fs_background:r,fs_button:a,international_tag:s,international_title:o,international_text:l,contacts:c,contact_tag:h,contact_title:u}=us(ma),d=us(ga);t.useEffect((()=>{e(pa())}),[e]),t.useEffect((()=>{"#find"===i.hash&&ja("distribution-contacts",100)}),[i.hash]);const p=(0,t.useRef)();return xg({items:[".distribution-contacts",".contacts-cards"],container:p,dependencies:[d]}),d?(0,$o.jsx)(pv,{}):(0,$o.jsxs)("div",{ref:p,children:[(0,$o.jsx)(sl,{title:n,image:r,buttonText:a,onClickButton:()=>ja("form-section")}),(0,$o.jsx)("section",{className:"container",children:(0,$o.jsx)("div",{className:"inner-container type-2",children:(0,$o.jsxs)("div",{className:"main-text-container",children:[(0,$o.jsx)(ll,{children:s}),(0,$o.jsx)(ol,{className:"has-animation",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:o}})}),(0,$o.jsx)("div",{className:"offset-left-4 max-width-760",children:(0,$o.jsx)(ol,{size:"super-small",className:"has-animation",children:l})})]})})}),(0,$o.jsx)(N_,{}),(0,$o.jsx)("section",{className:"container",children:(0,$o.jsxs)("div",{className:"inner-container type-3",children:[(0,$o.jsxs)("div",{className:"main-text-container",children:[(0,$o.jsx)(ll,{children:h}),(0,$o.jsx)("div",{className:"offset-left-4 max-width-760",children:(0,$o.jsx)(ol,{size:"middle",className:"has-animation",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:u}})})})]}),(0,$o.jsx)(F_,{data:c})]})}),(0,$o.jsx)(Qy,{})]})},V_=__webpack_require__.p+"static/media/404-banner.77519085fc0e5d40bf62.jpg",U_=()=>{const e=us(Pa);return(0,$o.jsx)("section",{className:"container page-404",children:(0,$o.jsxs)(sl,{image:V_,buttonText:e["404_btn"],buttonType:"banner",withCrumbs:!1,children:[(0,$o.jsx)("h2",{children:e["404_title"]}),(0,$o.jsx)("p",{className:"body1 opacity-80",children:e["404_description"]})]})})},G_=e=>{let{children:t,settings:i={},className:n}=e;const r={slidesPerView:1,navigation:!1,loop:!0,speed:1e3,autoplay:{delay:5e3},effect:"fade",...i};return(0,$o.jsx)(Vw,{...r,modules:[Xw,Zw,qw],pagination:{clickable:!0},className:n,children:t})},H_=e=>{let{card:t,array:i}=e;const{slug:n,title:r,title_background:a,type:s,time_to_read:o,crated_at:l}=t,c=us(ka)[s];return(0,$o.jsxs)($o.Fragment,{children:[(0,$o.jsx)("img",{className:"news-wrapper-image",src:a,alt:"img"}),(0,$o.jsxs)("div",{className:"news-box",children:[(0,$o.jsxs)("div",{children:[(0,$o.jsx)(ax,{children:c}),(0,$o.jsx)("p",{className:"description-demibold",children:r}),(0,$o.jsxs)("div",{className:"news-time-data",children:[(0,$o.jsx)(mx,{iconName:"calendar",text:l}),(0,$o.jsx)(mx,{iconName:"clock",text:o})]})]}),(0,$o.jsx)("div",{className:"news-box-bottom",children:(0,$o.jsx)(al,{href:Xo.news+"/"+n,type:"learn-more-arrow white-text",children:"LEARN MORE"})})]})]})};var W_=Object.create,q_=Object.defineProperty,X_=Object.getOwnPropertyDescriptor,Y_=Object.getOwnPropertyNames,Q_=Object.getPrototypeOf,Z_=Object.prototype.hasOwnProperty,K_=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),J_=(e,t,i)=>(i=null!=e?W_(Q_(e)):{},((e,t,i,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of Y_(t))!Z_.call(e,r)&&r!==i&&q_(e,r,{get:()=>t[r],enumerable:!(n=X_(t,r))||n.enumerable});return e})(!t&&e&&e.__esModule?i:q_(i,"default",{value:e,enumerable:!0}),e)),$_=(e,t,i)=>(((e,t,i)=>{t in e?q_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i})(e,"symbol"!=typeof t?t+"":t,i),i),eS=K_(((e,t)=>{!function(i,n){"object"==typeof e?t.exports=n():"function"==typeof define&&define.amd?define(n):i.Alea=n()}(e,(function(){return e.importState=function(t){var i=new e;return i.importState(t),i},e;function e(){return function(e){var t=0,i=0,n=0,r=1;0==e.length&&(e=[+new Date]);var a=function(){var e=4022871197,t=function(t){t=t.toString();for(var i=0;i<t.length;i++){var n=.02519603282416938*(e+=t.charCodeAt(i));n-=e=n>>>0,e=(n*=e)>>>0,e+=4294967296*(n-=e)}return 2.3283064365386963e-10*(e>>>0)};return t.version="Mash 0.9",t}();t=a(" "),i=a(" "),n=a(" ");for(var s=0;s<e.length;s++)(t-=a(e[s]))<0&&(t+=1),(i-=a(e[s]))<0&&(i+=1),(n-=a(e[s]))<0&&(n+=1);a=null;var o=function(){var e=2091639*t+2.3283064365386963e-10*r;return t=i,i=n,n=e-(r=0|e)};return o.next=o,o.uint32=function(){return 4294967296*o()},o.fract53=function(){return o()+11102230246251565e-32*(2097152*o()|0)},o.version="Alea 0.9",o.args=e,o.exportState=function(){return[t,i,n,r]},o.importState=function(e){t=+e[0]||0,i=+e[1]||0,n=+e[2]||0,r=+e[3]||0},o}(Array.prototype.slice.call(arguments))}}))})),tS=K_(((e,t)=>{!function(i,n){"object"==typeof e&&typeof t<"u"?n(e):"function"==typeof define&&define.amd?define(["exports"],n):n((i=typeof globalThis<"u"?globalThis:i||self).SVDJS={})}(e,(function(e){e.SVD=function(e,t,i,n,r){if(t=void 0===t||t,i=void 0===i||i,r=1e-64/(n=n||Math.pow(2,-52)),!e)throw new TypeError("Matrix a is not defined");var a,s,o,l,c,h,u,d,p,f,m,g,v=e[0].length,y=e.length;if(y<v)throw new TypeError("Invalid matrix: m < n");for(var b=[],x=[],w=[],_="f"===t?y:v,S=f=u=0;S<y;S++)x[S]=new Array(_).fill(0);for(S=0;S<v;S++)w[S]=new Array(v).fill(0);var E,C=new Array(v).fill(0);for(S=0;S<y;S++)for(a=0;a<v;a++)x[S][a]=e[S][a];for(S=0;S<v;S++){for(b[S]=u,p=0,o=S+1,a=S;a<y;a++)p+=Math.pow(x[a][S],2);if(p<r)u=0;else for(d=(h=x[S][S])*(u=h<0?Math.sqrt(p):-Math.sqrt(p))-p,x[S][S]=h-u,a=o;a<v;a++){for(p=0,s=S;s<y;s++)p+=x[s][S]*x[s][a];for(h=p/d,s=S;s<y;s++)x[s][a]=x[s][a]+h*x[s][S]}for(C[S]=u,p=0,a=o;a<v;a++)p+=Math.pow(x[S][a],2);if(p<r)u=0;else{for(d=(h=x[S][S+1])*(u=h<0?Math.sqrt(p):-Math.sqrt(p))-p,x[S][S+1]=h-u,a=o;a<v;a++)b[a]=x[S][a]/d;for(a=o;a<y;a++){for(p=0,s=o;s<v;s++)p+=x[a][s]*x[S][s];for(s=o;s<v;s++)x[a][s]=x[a][s]+p*b[s]}}f<(m=Math.abs(C[S])+Math.abs(b[S]))&&(f=m)}if(i)for(S=v-1;0<=S;S--){if(0!==u){for(d=x[S][S+1]*u,a=o;a<v;a++)w[a][S]=x[S][a]/d;for(a=o;a<v;a++){for(p=0,s=o;s<v;s++)p+=x[S][s]*w[s][a];for(s=o;s<v;s++)w[s][a]=w[s][a]+p*w[s][S]}}for(a=o;a<v;a++)w[S][a]=0,w[a][S]=0;w[S][S]=1,u=b[S],o=S}if(t){if("f"===t)for(S=v;S<y;S++){for(a=v;a<y;a++)x[S][a]=0;x[S][S]=1}for(S=v-1;0<=S;S--){for(o=S+1,u=C[S],a=o;a<_;a++)x[S][a]=0;if(0!==u){for(d=x[S][S]*u,a=o;a<_;a++){for(p=0,s=o;s<y;s++)p+=x[s][S]*x[s][a];for(h=p/d,s=S;s<y;s++)x[s][a]=x[s][a]+h*x[s][S]}for(a=S;a<y;a++)x[a][S]=x[a][S]/u}else for(a=S;a<y;a++)x[a][S]=0;x[S][S]=x[S][S]+1}}for(n*=f,s=v-1;0<=s;s--)for(var A=0;A<50;A++){for(E=!1,o=s;0<=o;o--){if(Math.abs(b[o])<=n){E=!0;break}if(Math.abs(C[o-1])<=n)break}if(!E)for(c=0,l=o-(p=1),S=o;S<s+1&&(h=p*b[S],b[S]=c*b[S],!(Math.abs(h)<=n));S++)if(u=C[S],C[S]=Math.sqrt(h*h+u*u),c=u/(d=C[S]),p=-h/d,t)for(a=0;a<y;a++)m=x[a][l],g=x[a][S],x[a][l]=m*c+g*p,x[a][S]=-m*p+g*c;if(g=C[s],o===s){if(g<0&&(C[s]=-g,i))for(a=0;a<v;a++)w[a][s]=-w[a][s];break}for(f=C[o],h=(((m=C[s-1])-g)*(m+g)+((u=b[s-1])-(d=b[s]))*(u+d))/(2*d*m),u=Math.sqrt(h*h+1),h=((f-g)*(f+g)+d*(m/(h<0?h-u:h+u)-d))/f,S=o+(p=c=1);S<s+1;S++){if(u=b[S],m=C[S],d=p*u,u*=c,g=Math.sqrt(h*h+d*d),h=f*(c=h/(b[S-1]=g))+u*(p=d/g),u=-f*p+u*c,d=m*p,m*=c,i)for(a=0;a<v;a++)f=w[a][S-1],g=w[a][S],w[a][S-1]=f*c+g*p,w[a][S]=-f*p+g*c;if(g=Math.sqrt(h*h+d*d),h=(c=h/(C[S-1]=g))*u+(p=d/g)*m,f=-p*u+c*m,t)for(a=0;a<y;a++)m=x[a][S-1],g=x[a][S],x[a][S-1]=m*c+g*p,x[a][S]=-m*p+g*c}b[o]=0,b[s]=h,C[s]=f}for(S=0;S<v;S++)C[S]<n&&(C[S]=0);return{u:x,q:C,v:w}},e.VERSION="1.1.1",Object.defineProperty(e,"__esModule",{value:!0})}))})),iS=K_(((e,t)=>{!function(i,n){"object"==typeof e&&typeof t<"u"?t.exports=n():"function"==typeof define&&define.amd?define(n):(i=i||self).TinyQueue=n()}(e,(function(){var e=function(e,i){if(void 0===e&&(e=[]),void 0===i&&(i=t),this.data=e,this.length=this.data.length,this.compare=i,this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)};function t(e,t){return e<t?-1:e>t?1:0}return e.prototype.push=function(e){this.data.push(e),this.length++,this._up(this.length-1)},e.prototype.pop=function(){if(0!==this.length){var e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}},e.prototype.peek=function(){return this.data[0]},e.prototype._up=function(e){for(var t=this.data,i=this.compare,n=t[e];e>0;){var r=e-1>>1,a=t[r];if(i(n,a)>=0)break;t[e]=a,e=r}t[e]=n},e.prototype._down=function(e){for(var t=this.data,i=this.compare,n=this.length>>1,r=t[e];e<n;){var a=1+(e<<1),s=t[a],o=a+1;if(o<this.length&&i(t[o],s)<0&&(a=o,s=t[o]),i(s,r)>=0)break;t[e]=s,e=a}t[e]=r},e}))})),nS=K_(((e,t)=>{var i=iS();function n(e,t,n){t=t||1;for(var s,o,l,c,h=0;h<e[0].length;h++){var u=e[0][h];(!h||u[0]<s)&&(s=u[0]),(!h||u[1]<o)&&(o=u[1]),(!h||u[0]>l)&&(l=u[0]),(!h||u[1]>c)&&(c=u[1])}var d=l-s,p=c-o,f=Math.min(d,p),m=f/2;if(0===f){var g=[s,o];return g.distance=0,g}for(var v=new i(void 0,r),y=s;y<l;y+=f)for(var b=o;b<c;b+=f)v.push(new a(y+m,b+m,m,e));var x=function(e){for(var t=0,i=0,n=0,r=e[0],s=0,o=r.length,l=o-1;s<o;l=s++){var c=r[s],h=r[l],u=c[0]*h[1]-h[0]*c[1];i+=(c[0]+h[0])*u,n+=(c[1]+h[1])*u,t+=3*u}return 0===t?new a(r[0][0],r[0][1],0,e):new a(i/t,n/t,0,e)}(e),w=new a(s+d/2,o+p/2,0,e);w.d>x.d&&(x=w);for(var _=v.length;v.length;){var S=v.pop();S.d>x.d&&(x=S,n&&console.log("found best %d after %d probes",Math.round(1e4*S.d)/1e4,_)),!(S.max-x.d<=t)&&(m=S.h/2,v.push(new a(S.x-m,S.y-m,m,e)),v.push(new a(S.x+m,S.y-m,m,e)),v.push(new a(S.x-m,S.y+m,m,e)),v.push(new a(S.x+m,S.y+m,m,e)),_+=4)}n&&(console.log("num probes: "+_),console.log("best distance: "+x.d));var E=[x.x,x.y];return E.distance=x.d,E}function r(e,t){return t.max-e.max}function a(e,t,i,n){this.x=e,this.y=t,this.h=i,this.d=function(e,t,i){for(var n=!1,r=1/0,a=0;a<i.length;a++)for(var o=i[a],l=0,c=o.length,h=c-1;l<c;h=l++){var u=o[l],d=o[h];u[1]>t!=d[1]>t&&e<(d[0]-u[0])*(t-u[1])/(d[1]-u[1])+u[0]&&(n=!n),r=Math.min(r,s(e,t,u,d))}return 0===r?0:(n?1:-1)*Math.sqrt(r)}(e,t,n),this.max=this.d+this.h*Math.SQRT2}function s(e,t,i,n){var r=i[0],a=i[1],s=n[0]-r,o=n[1]-a;if(0!==s||0!==o){var l=((e-r)*s+(t-a)*o)/(s*s+o*o);l>1?(r=n[0],a=n[1]):l>0&&(r+=s*l,a+=o*l)}return(s=e-r)*s+(o=t-a)*o}i.default&&(i=i.default),t.exports=n,t.exports.default=n})),rS=K_(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)},t.exports=e.default})),aS=K_(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()},t.exports=e.default})),sS=K_((e=>{!function(){var t=function(){this.init()};t.prototype={init:function(){var e=this||i;return e._counter=1e3,e._html5AudioPool=[],e.html5PoolSize=10,e._codecs={},e._howls=[],e._muted=!1,e._volume=1,e._canPlayEvent="canplaythrough",e._navigator=typeof window<"u"&&window.navigator?window.navigator:null,e.masterGain=null,e.noAudio=!1,e.usingWebAudio=!0,e.autoSuspend=!0,e.ctx=null,e.autoUnlock=!0,e._setup(),e},volume:function(e){var t=this||i;if(e=parseFloat(e),t.ctx||h(),typeof e<"u"&&e>=0&&e<=1){if(t._volume=e,t._muted)return t;t.usingWebAudio&&t.masterGain.gain.setValueAtTime(e,i.ctx.currentTime);for(var n=0;n<t._howls.length;n++)if(!t._howls[n]._webAudio)for(var r=t._howls[n]._getSoundIds(),a=0;a<r.length;a++){var s=t._howls[n]._soundById(r[a]);s&&s._node&&(s._node.volume=s._volume*e)}return t}return t._volume},mute:function(e){var t=this||i;t.ctx||h(),t._muted=e,t.usingWebAudio&&t.masterGain.gain.setValueAtTime(e?0:t._volume,i.ctx.currentTime);for(var n=0;n<t._howls.length;n++)if(!t._howls[n]._webAudio)for(var r=t._howls[n]._getSoundIds(),a=0;a<r.length;a++){var s=t._howls[n]._soundById(r[a]);s&&s._node&&(s._node.muted=!!e||s._muted)}return t},stop:function(){for(var e=this||i,t=0;t<e._howls.length;t++)e._howls[t].stop();return e},unload:function(){for(var e=this||i,t=e._howls.length-1;t>=0;t--)e._howls[t].unload();return e.usingWebAudio&&e.ctx&&typeof e.ctx.close<"u"&&(e.ctx.close(),e.ctx=null,h()),e},codecs:function(e){return(this||i)._codecs[e.replace(/^x-/,"")]},_setup:function(){var e=this||i;if(e.state=e.ctx&&e.ctx.state||"suspended",e._autoSuspend(),!e.usingWebAudio)if(typeof Audio<"u")try{typeof(new Audio).oncanplaythrough>"u"&&(e._canPlayEvent="canplay")}catch{e.noAudio=!0}else e.noAudio=!0;try{(new Audio).muted&&(e.noAudio=!0)}catch{}return e.noAudio||e._setupCodecs(),e},_setupCodecs:function(){var e=this||i,t=null;try{t=typeof Audio<"u"?new Audio:null}catch{return e}if(!t||"function"!=typeof t.canPlayType)return e;var n=t.canPlayType("audio/mpeg;").replace(/^no$/,""),r=e._navigator?e._navigator.userAgent:"",a=r.match(/OPR\/([0-6].)/g),s=a&&parseInt(a[0].split("/")[1],10)<33,o=-1!==r.indexOf("Safari")&&-1===r.indexOf("Chrome"),l=r.match(/Version\/(.*?) /),c=o&&l&&parseInt(l[1],10)<15;return e._codecs={mp3:!(s||!n&&!t.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!n,opus:!!t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(t.canPlayType('audio/wav; codecs="1"')||t.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!t.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!t.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/m4a;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(t.canPlayType("audio/x-m4b;")||t.canPlayType("audio/m4b;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(t.canPlayType("audio/x-mp4;")||t.canPlayType("audio/mp4;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(c||!t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(c||!t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!t.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(t.canPlayType("audio/x-flac;")||t.canPlayType("audio/flac;")).replace(/^no$/,"")},e},_unlockAudio:function(){var e=this||i;if(!e._audioUnlocked&&e.ctx){e._audioUnlocked=!1,e.autoUnlock=!1,!e._mobileUnloaded&&44100!==e.ctx.sampleRate&&(e._mobileUnloaded=!0,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var t=function(i){for(;e._html5AudioPool.length<e.html5PoolSize;)try{var n=new Audio;n._unlocked=!0,e._releaseHtml5Audio(n)}catch{e.noAudio=!0;break}for(var r=0;r<e._howls.length;r++)if(!e._howls[r]._webAudio)for(var a=e._howls[r]._getSoundIds(),s=0;s<a.length;s++){var o=e._howls[r]._soundById(a[s]);o&&o._node&&!o._node._unlocked&&(o._node._unlocked=!0,o._node.load())}e._autoResume();var l=e.ctx.createBufferSource();l.buffer=e._scratchBuffer,l.connect(e.ctx.destination),typeof l.start>"u"?l.noteOn(0):l.start(0),"function"==typeof e.ctx.resume&&e.ctx.resume(),l.onended=function(){l.disconnect(0),e._audioUnlocked=!0,document.removeEventListener("touchstart",t,!0),document.removeEventListener("touchend",t,!0),document.removeEventListener("click",t,!0),document.removeEventListener("keydown",t,!0);for(var i=0;i<e._howls.length;i++)e._howls[i]._emit("unlock")}};return document.addEventListener("touchstart",t,!0),document.addEventListener("touchend",t,!0),document.addEventListener("click",t,!0),document.addEventListener("keydown",t,!0),e}},_obtainHtml5Audio:function(){var e=this||i;if(e._html5AudioPool.length)return e._html5AudioPool.pop();var t=(new Audio).play();return t&&typeof Promise<"u"&&(t instanceof Promise||"function"==typeof t.then)&&t.catch((function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")})),new Audio},_releaseHtml5Audio:function(e){var t=this||i;return e._unlocked&&t._html5AudioPool.push(e),t},_autoSuspend:function(){var e=this;if(e.autoSuspend&&e.ctx&&!(typeof e.ctx.suspend>"u")&&i.usingWebAudio){for(var t=0;t<e._howls.length;t++)if(e._howls[t]._webAudio)for(var n=0;n<e._howls[t]._sounds.length;n++)if(!e._howls[t]._sounds[n]._paused)return e;return e._suspendTimer&&clearTimeout(e._suspendTimer),e._suspendTimer=setTimeout((function(){if(e.autoSuspend){e._suspendTimer=null,e.state="suspending";var t=function(){e.state="suspended",e._resumeAfterSuspend&&(delete e._resumeAfterSuspend,e._autoResume())};e.ctx.suspend().then(t,t)}}),3e4),e}},_autoResume:function(){var e=this;if(e.ctx&&!(typeof e.ctx.resume>"u")&&i.usingWebAudio)return"running"===e.state&&"interrupted"!==e.ctx.state&&e._suspendTimer?(clearTimeout(e._suspendTimer),e._suspendTimer=null):"suspended"===e.state||"running"===e.state&&"interrupted"===e.ctx.state?(e.ctx.resume().then((function(){e.state="running";for(var t=0;t<e._howls.length;t++)e._howls[t]._emit("resume")})),e._suspendTimer&&(clearTimeout(e._suspendTimer),e._suspendTimer=null)):"suspending"===e.state&&(e._resumeAfterSuspend=!0),e}};var i=new t,n=function(e){e.src&&0!==e.src.length?this.init(e):console.error("An array of source files must be passed with any new Howl.")};n.prototype={init:function(e){var t=this;return i.ctx||h(),t._autoplay=e.autoplay||!1,t._format="string"!=typeof e.format?e.format:[e.format],t._html5=e.html5||!1,t._muted=e.mute||!1,t._loop=e.loop||!1,t._pool=e.pool||5,t._preload="boolean"!=typeof e.preload&&"metadata"!==e.preload||e.preload,t._rate=e.rate||1,t._sprite=e.sprite||{},t._src="string"!=typeof e.src?e.src:[e.src],t._volume=void 0!==e.volume?e.volume:1,t._xhr={method:e.xhr&&e.xhr.method?e.xhr.method:"GET",headers:e.xhr&&e.xhr.headers?e.xhr.headers:null,withCredentials:!(!e.xhr||!e.xhr.withCredentials)&&e.xhr.withCredentials},t._duration=0,t._state="unloaded",t._sounds=[],t._endTimers={},t._queue=[],t._playLock=!1,t._onend=e.onend?[{fn:e.onend}]:[],t._onfade=e.onfade?[{fn:e.onfade}]:[],t._onload=e.onload?[{fn:e.onload}]:[],t._onloaderror=e.onloaderror?[{fn:e.onloaderror}]:[],t._onplayerror=e.onplayerror?[{fn:e.onplayerror}]:[],t._onpause=e.onpause?[{fn:e.onpause}]:[],t._onplay=e.onplay?[{fn:e.onplay}]:[],t._onstop=e.onstop?[{fn:e.onstop}]:[],t._onmute=e.onmute?[{fn:e.onmute}]:[],t._onvolume=e.onvolume?[{fn:e.onvolume}]:[],t._onrate=e.onrate?[{fn:e.onrate}]:[],t._onseek=e.onseek?[{fn:e.onseek}]:[],t._onunlock=e.onunlock?[{fn:e.onunlock}]:[],t._onresume=[],t._webAudio=i.usingWebAudio&&!t._html5,typeof i.ctx<"u"&&i.ctx&&i.autoUnlock&&i._unlockAudio(),i._howls.push(t),t._autoplay&&t._queue.push({event:"play",action:function(){t.play()}}),t._preload&&"none"!==t._preload&&t.load(),t},load:function(){var e=this,t=null;if(i.noAudio)e._emit("loaderror",null,"No audio support.");else{"string"==typeof e._src&&(e._src=[e._src]);for(var n=0;n<e._src.length;n++){var a,o;if(e._format&&e._format[n])a=e._format[n];else{if("string"!=typeof(o=e._src[n])){e._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}(a=/^data:audio\/([^;,]+);/i.exec(o))||(a=/\.([^.]+)$/.exec(o.split("?",1)[0])),a&&(a=a[1].toLowerCase())}if(a||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),a&&i.codecs(a)){t=e._src[n];break}}if(t)return e._src=t,e._state="loading","https:"===window.location.protocol&&"http:"===t.slice(0,5)&&(e._html5=!0,e._webAudio=!1),new r(e),e._webAudio&&s(e),e;e._emit("loaderror",null,"No codec support for selected audio sources.")}},play:function(e,t){var n=this,r=null;if("number"==typeof e)r=e,e=null;else{if("string"==typeof e&&"loaded"===n._state&&!n._sprite[e])return null;if(typeof e>"u"&&(e="__default",!n._playLock)){for(var a=0,s=0;s<n._sounds.length;s++)n._sounds[s]._paused&&!n._sounds[s]._ended&&(a++,r=n._sounds[s]._id);1===a?e=null:r=null}}var o=r?n._soundById(r):n._inactiveSound();if(!o)return null;if(r&&!e&&(e=o._sprite||"__default"),"loaded"!==n._state){o._sprite=e,o._ended=!1;var l=o._id;return n._queue.push({event:"play",action:function(){n.play(l)}}),l}if(r&&!o._paused)return t||n._loadQueue("play"),o._id;n._webAudio&&i._autoResume();var c=Math.max(0,o._seek>0?o._seek:n._sprite[e][0]/1e3),h=Math.max(0,(n._sprite[e][0]+n._sprite[e][1])/1e3-c),u=1e3*h/Math.abs(o._rate),d=n._sprite[e][0]/1e3,p=(n._sprite[e][0]+n._sprite[e][1])/1e3;o._sprite=e,o._ended=!1;var f=function(){o._paused=!1,o._seek=c,o._start=d,o._stop=p,o._loop=!(!o._loop&&!n._sprite[e][2])};if(!(c>=p)){var m=o._node;if(n._webAudio){var g=function(){n._playLock=!1,f(),n._refreshBuffer(o);var e=o._muted||n._muted?0:o._volume;m.gain.setValueAtTime(e,i.ctx.currentTime),o._playStart=i.ctx.currentTime,typeof m.bufferSource.start>"u"?o._loop?m.bufferSource.noteGrainOn(0,c,86400):m.bufferSource.noteGrainOn(0,c,h):o._loop?m.bufferSource.start(0,c,86400):m.bufferSource.start(0,c,h),u!==1/0&&(n._endTimers[o._id]=setTimeout(n._ended.bind(n,o),u)),t||setTimeout((function(){n._emit("play",o._id),n._loadQueue()}),0)};"running"===i.state&&"interrupted"!==i.ctx.state?g():(n._playLock=!0,n.once("resume",g),n._clearTimer(o._id))}else{var v=function(){m.currentTime=c,m.muted=o._muted||n._muted||i._muted||m.muted,m.volume=o._volume*i.volume(),m.playbackRate=o._rate;try{var r=m.play();if(r&&typeof Promise<"u"&&(r instanceof Promise||"function"==typeof r.then)?(n._playLock=!0,f(),r.then((function(){n._playLock=!1,m._unlocked=!0,t?n._loadQueue():n._emit("play",o._id)})).catch((function(){n._playLock=!1,n._emit("playerror",o._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),o._ended=!0,o._paused=!0}))):t||(n._playLock=!1,f(),n._emit("play",o._id)),m.playbackRate=o._rate,m.paused)return void n._emit("playerror",o._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==e||o._loop?n._endTimers[o._id]=setTimeout(n._ended.bind(n,o),u):(n._endTimers[o._id]=function(){n._ended(o),m.removeEventListener("ended",n._endTimers[o._id],!1)},m.addEventListener("ended",n._endTimers[o._id],!1))}catch(C){n._emit("playerror",o._id,C)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===m.src&&(m.src=n._src,m.load());var y=window&&window.ejecta||!m.readyState&&i._navigator.isCocoonJS;if(m.readyState>=3||y)v();else{n._playLock=!0,n._state="loading";var b=function(){n._state="loaded",v(),m.removeEventListener(i._canPlayEvent,b,!1)};m.addEventListener(i._canPlayEvent,b,!1),n._clearTimer(o._id)}}return o._id}n._ended(o)},pause:function(e){var t=this;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"pause",action:function(){t.pause(e)}}),t;for(var i=t._getSoundIds(e),n=0;n<i.length;n++){t._clearTimer(i[n]);var r=t._soundById(i[n]);if(r&&!r._paused&&(r._seek=t.seek(i[n]),r._rateSeek=0,r._paused=!0,t._stopFade(i[n]),r._node))if(t._webAudio){if(!r._node.bufferSource)continue;typeof r._node.bufferSource.stop>"u"?r._node.bufferSource.noteOff(0):r._node.bufferSource.stop(0),t._cleanBuffer(r._node)}else(!isNaN(r._node.duration)||r._node.duration===1/0)&&r._node.pause();arguments[1]||t._emit("pause",r?r._id:null)}return t},stop:function(e,t){var i=this;if("loaded"!==i._state||i._playLock)return i._queue.push({event:"stop",action:function(){i.stop(e)}}),i;for(var n=i._getSoundIds(e),r=0;r<n.length;r++){i._clearTimer(n[r]);var a=i._soundById(n[r]);a&&(a._seek=a._start||0,a._rateSeek=0,a._paused=!0,a._ended=!0,i._stopFade(n[r]),a._node&&(i._webAudio?a._node.bufferSource&&(typeof a._node.bufferSource.stop>"u"?a._node.bufferSource.noteOff(0):a._node.bufferSource.stop(0),i._cleanBuffer(a._node)):(!isNaN(a._node.duration)||a._node.duration===1/0)&&(a._node.currentTime=a._start||0,a._node.pause(),a._node.duration===1/0&&i._clearSound(a._node))),t||i._emit("stop",a._id))}return i},mute:function(e,t){var n=this;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"mute",action:function(){n.mute(e,t)}}),n;if(typeof t>"u"){if("boolean"!=typeof e)return n._muted;n._muted=e}for(var r=n._getSoundIds(t),a=0;a<r.length;a++){var s=n._soundById(r[a]);s&&(s._muted=e,s._interval&&n._stopFade(s._id),n._webAudio&&s._node?s._node.gain.setValueAtTime(e?0:s._volume,i.ctx.currentTime):s._node&&(s._node.muted=!!i._muted||e),n._emit("mute",s._id))}return n},volume:function(){var e,t,n,r=this,a=arguments;if(0===a.length)return r._volume;1===a.length||2===a.length&&typeof a[1]>"u"?r._getSoundIds().indexOf(a[0])>=0?t=parseInt(a[0],10):e=parseFloat(a[0]):a.length>=2&&(e=parseFloat(a[0]),t=parseInt(a[1],10));if(!(typeof e<"u"&&e>=0&&e<=1))return(n=t?r._soundById(t):r._sounds[0])?n._volume:0;if("loaded"!==r._state||r._playLock)return r._queue.push({event:"volume",action:function(){r.volume.apply(r,a)}}),r;typeof t>"u"&&(r._volume=e),t=r._getSoundIds(t);for(var s=0;s<t.length;s++)(n=r._soundById(t[s]))&&(n._volume=e,a[2]||r._stopFade(t[s]),r._webAudio&&n._node&&!n._muted?n._node.gain.setValueAtTime(e,i.ctx.currentTime):n._node&&!n._muted&&(n._node.volume=e*i.volume()),r._emit("volume",n._id));return r},fade:function(e,t,n,r){var a=this;if("loaded"!==a._state||a._playLock)return a._queue.push({event:"fade",action:function(){a.fade(e,t,n,r)}}),a;e=Math.min(Math.max(0,parseFloat(e)),1),t=Math.min(Math.max(0,parseFloat(t)),1),n=parseFloat(n),a.volume(e,r);for(var s=a._getSoundIds(r),o=0;o<s.length;o++){var l=a._soundById(s[o]);if(l){if(r||a._stopFade(s[o]),a._webAudio&&!l._muted){var c=i.ctx.currentTime,h=c+n/1e3;l._volume=e,l._node.gain.setValueAtTime(e,c),l._node.gain.linearRampToValueAtTime(t,h)}a._startFadeInterval(l,e,t,n,s[o],typeof r>"u")}}return a},_startFadeInterval:function(e,t,i,n,r,a){var s=this,o=t,l=i-t,c=Math.abs(l/.01),h=Math.max(4,c>0?n/c:n),u=Date.now();e._fadeTo=i,e._interval=setInterval((function(){var r=(Date.now()-u)/n;u=Date.now(),o+=l*r,o=Math.round(100*o)/100,o=l<0?Math.max(i,o):Math.min(i,o),s._webAudio?e._volume=o:s.volume(o,e._id,!0),a&&(s._volume=o),(i<t&&o<=i||i>t&&o>=i)&&(clearInterval(e._interval),e._interval=null,e._fadeTo=null,s.volume(i,e._id),s._emit("fade",e._id))}),h)},_stopFade:function(e){var t=this,n=t._soundById(e);return n&&n._interval&&(t._webAudio&&n._node.gain.cancelScheduledValues(i.ctx.currentTime),clearInterval(n._interval),n._interval=null,t.volume(n._fadeTo,e),n._fadeTo=null,t._emit("fade",e)),t},loop:function(){var e,t,i,n=this,r=arguments;if(0===r.length)return n._loop;if(1===r.length){if("boolean"!=typeof r[0])return!!(i=n._soundById(parseInt(r[0],10)))&&i._loop;e=r[0],n._loop=e}else 2===r.length&&(e=r[0],t=parseInt(r[1],10));for(var a=n._getSoundIds(t),s=0;s<a.length;s++)(i=n._soundById(a[s]))&&(i._loop=e,n._webAudio&&i._node&&i._node.bufferSource&&(i._node.bufferSource.loop=e,e&&(i._node.bufferSource.loopStart=i._start||0,i._node.bufferSource.loopEnd=i._stop,n.playing(a[s])&&(n.pause(a[s],!0),n.play(a[s],!0)))));return n},rate:function(){var e,t,n,r=this,a=arguments;if(0===a.length)t=r._sounds[0]._id;else if(1===a.length){r._getSoundIds().indexOf(a[0])>=0?t=parseInt(a[0],10):e=parseFloat(a[0])}else 2===a.length&&(e=parseFloat(a[0]),t=parseInt(a[1],10));if("number"!=typeof e)return(n=r._soundById(t))?n._rate:r._rate;if("loaded"!==r._state||r._playLock)return r._queue.push({event:"rate",action:function(){r.rate.apply(r,a)}}),r;typeof t>"u"&&(r._rate=e),t=r._getSoundIds(t);for(var s=0;s<t.length;s++)if(n=r._soundById(t[s])){r.playing(t[s])&&(n._rateSeek=r.seek(t[s]),n._playStart=r._webAudio?i.ctx.currentTime:n._playStart),n._rate=e,r._webAudio&&n._node&&n._node.bufferSource?n._node.bufferSource.playbackRate.setValueAtTime(e,i.ctx.currentTime):n._node&&(n._node.playbackRate=e);var o=r.seek(t[s]),l=1e3*((r._sprite[n._sprite][0]+r._sprite[n._sprite][1])/1e3-o)/Math.abs(n._rate);(r._endTimers[t[s]]||!n._paused)&&(r._clearTimer(t[s]),r._endTimers[t[s]]=setTimeout(r._ended.bind(r,n),l)),r._emit("rate",n._id)}return r},seek:function(){var e,t,n=this,r=arguments;if(0===r.length)n._sounds.length&&(t=n._sounds[0]._id);else if(1===r.length){n._getSoundIds().indexOf(r[0])>=0?t=parseInt(r[0],10):n._sounds.length&&(t=n._sounds[0]._id,e=parseFloat(r[0]))}else 2===r.length&&(e=parseFloat(r[0]),t=parseInt(r[1],10));if(typeof t>"u")return 0;if("number"==typeof e&&("loaded"!==n._state||n._playLock))return n._queue.push({event:"seek",action:function(){n.seek.apply(n,r)}}),n;var a=n._soundById(t);if(a){if(!("number"==typeof e&&e>=0)){if(n._webAudio){var s=n.playing(t)?i.ctx.currentTime-a._playStart:0,o=a._rateSeek?a._rateSeek-a._seek:0;return a._seek+(o+s*Math.abs(a._rate))}return a._node.currentTime}var l=n.playing(t);l&&n.pause(t,!0),a._seek=e,a._ended=!1,n._clearTimer(t),!n._webAudio&&a._node&&!isNaN(a._node.duration)&&(a._node.currentTime=e);var c=function(){l&&n.play(t,!0),n._emit("seek",t)};if(l&&!n._webAudio){var h=function(){n._playLock?setTimeout(h,0):c()};setTimeout(h,0)}else c()}return n},playing:function(e){var t=this;if("number"==typeof e){var i=t._soundById(e);return!!i&&!i._paused}for(var n=0;n<t._sounds.length;n++)if(!t._sounds[n]._paused)return!0;return!1},duration:function(e){var t=this,i=t._duration,n=t._soundById(e);return n&&(i=t._sprite[n._sprite][1]/1e3),i},state:function(){return this._state},unload:function(){for(var e=this,t=e._sounds,n=0;n<t.length;n++)t[n]._paused||e.stop(t[n]._id),e._webAudio||(e._clearSound(t[n]._node),t[n]._node.removeEventListener("error",t[n]._errorFn,!1),t[n]._node.removeEventListener(i._canPlayEvent,t[n]._loadFn,!1),t[n]._node.removeEventListener("ended",t[n]._endFn,!1),i._releaseHtml5Audio(t[n]._node)),delete t[n]._node,e._clearTimer(t[n]._id);var r=i._howls.indexOf(e);r>=0&&i._howls.splice(r,1);var s=!0;for(n=0;n<i._howls.length;n++)if(i._howls[n]._src===e._src||e._src.indexOf(i._howls[n]._src)>=0){s=!1;break}return a&&s&&delete a[e._src],i.noAudio=!1,e._state="unloaded",e._sounds=[],e=null,null},on:function(e,t,i,n){var r=this["_on"+e];return"function"==typeof t&&r.push(n?{id:i,fn:t,once:n}:{id:i,fn:t}),this},off:function(e,t,i){var n=this,r=n["_on"+e],a=0;if("number"==typeof t&&(i=t,t=null),t||i)for(a=0;a<r.length;a++){var s=i===r[a].id;if(t===r[a].fn&&s||!t&&s){r.splice(a,1);break}}else if(e)n["_on"+e]=[];else{var o=Object.keys(n);for(a=0;a<o.length;a++)0===o[a].indexOf("_on")&&Array.isArray(n[o[a]])&&(n[o[a]]=[])}return n},once:function(e,t,i){return this.on(e,t,i,1),this},_emit:function(e,t,i){for(var n=this,r=n["_on"+e],a=r.length-1;a>=0;a--)(!r[a].id||r[a].id===t||"load"===e)&&(setTimeout(function(e){e.call(this,t,i)}.bind(n,r[a].fn),0),r[a].once&&n.off(e,r[a].fn,r[a].id));return n._loadQueue(e),n},_loadQueue:function(e){var t=this;if(t._queue.length>0){var i=t._queue[0];i.event===e&&(t._queue.shift(),t._loadQueue()),e||i.action()}return t},_ended:function(e){var t=this,n=e._sprite;if(!t._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime<e._stop)return setTimeout(t._ended.bind(t,e),100),t;var r=!(!e._loop&&!t._sprite[n][2]);if(t._emit("end",e._id),!t._webAudio&&r&&t.stop(e._id,!0).play(e._id),t._webAudio&&r){t._emit("play",e._id),e._seek=e._start||0,e._rateSeek=0,e._playStart=i.ctx.currentTime;var a=1e3*(e._stop-e._start)/Math.abs(e._rate);t._endTimers[e._id]=setTimeout(t._ended.bind(t,e),a)}return t._webAudio&&!r&&(e._paused=!0,e._ended=!0,e._seek=e._start||0,e._rateSeek=0,t._clearTimer(e._id),t._cleanBuffer(e._node),i._autoSuspend()),!t._webAudio&&!r&&t.stop(e._id,!0),t},_clearTimer:function(e){var t=this;if(t._endTimers[e]){if("function"!=typeof t._endTimers[e])clearTimeout(t._endTimers[e]);else{var i=t._soundById(e);i&&i._node&&i._node.removeEventListener("ended",t._endTimers[e],!1)}delete t._endTimers[e]}return t},_soundById:function(e){for(var t=this,i=0;i<t._sounds.length;i++)if(e===t._sounds[i]._id)return t._sounds[i];return null},_inactiveSound:function(){var e=this;e._drain();for(var t=0;t<e._sounds.length;t++)if(e._sounds[t]._ended)return e._sounds[t].reset();return new r(e)},_drain:function(){var e=this,t=e._pool,i=0,n=0;if(!(e._sounds.length<t)){for(n=0;n<e._sounds.length;n++)e._sounds[n]._ended&&i++;for(n=e._sounds.length-1;n>=0;n--){if(i<=t)return;e._sounds[n]._ended&&(e._webAudio&&e._sounds[n]._node&&e._sounds[n]._node.disconnect(0),e._sounds.splice(n,1),i--)}}},_getSoundIds:function(e){if(typeof e>"u"){for(var t=[],i=0;i<this._sounds.length;i++)t.push(this._sounds[i]._id);return t}return[e]},_refreshBuffer:function(e){return e._node.bufferSource=i.ctx.createBufferSource(),e._node.bufferSource.buffer=a[this._src],e._panner?e._node.bufferSource.connect(e._panner):e._node.bufferSource.connect(e._node),e._node.bufferSource.loop=e._loop,e._loop&&(e._node.bufferSource.loopStart=e._start||0,e._node.bufferSource.loopEnd=e._stop||0),e._node.bufferSource.playbackRate.setValueAtTime(e._rate,i.ctx.currentTime),this},_cleanBuffer:function(e){var t=i._navigator&&i._navigator.vendor.indexOf("Apple")>=0;if(i._scratchBuffer&&e.bufferSource&&(e.bufferSource.onended=null,e.bufferSource.disconnect(0),t))try{e.bufferSource.buffer=i._scratchBuffer}catch{}return e.bufferSource=null,this},_clearSound:function(e){/MSIE |Trident\//.test(i._navigator&&i._navigator.userAgent)||(e.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var r=function(e){this._parent=e,this.init()};r.prototype={init:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++i._counter,t._sounds.push(e),e.create(),e},create:function(){var e=this,t=e._parent,n=i._muted||e._muted||e._parent._muted?0:e._volume;return t._webAudio?(e._node=typeof i.ctx.createGain>"u"?i.ctx.createGainNode():i.ctx.createGain(),e._node.gain.setValueAtTime(n,i.ctx.currentTime),e._node.paused=!0,e._node.connect(i.masterGain)):i.noAudio||(e._node=i._obtainHtml5Audio(),e._errorFn=e._errorListener.bind(e),e._node.addEventListener("error",e._errorFn,!1),e._loadFn=e._loadListener.bind(e),e._node.addEventListener(i._canPlayEvent,e._loadFn,!1),e._endFn=e._endListener.bind(e),e._node.addEventListener("ended",e._endFn,!1),e._node.src=t._src,e._node.preload=!0===t._preload?"auto":t._preload,e._node.volume=n*i.volume(),e._node.load()),e},reset:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._rateSeek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++i._counter,e},_errorListener:function(){var e=this;e._parent._emit("loaderror",e._id,e._node.error?e._node.error.code:0),e._node.removeEventListener("error",e._errorFn,!1)},_loadListener:function(){var e=this,t=e._parent;t._duration=Math.ceil(10*e._node.duration)/10,0===Object.keys(t._sprite).length&&(t._sprite={__default:[0,1e3*t._duration]}),"loaded"!==t._state&&(t._state="loaded",t._emit("load"),t._loadQueue()),e._node.removeEventListener(i._canPlayEvent,e._loadFn,!1)},_endListener:function(){var e=this,t=e._parent;t._duration===1/0&&(t._duration=Math.ceil(10*e._node.duration)/10,t._sprite.__default[1]===1/0&&(t._sprite.__default[1]=1e3*t._duration),t._ended(e)),e._node.removeEventListener("ended",e._endFn,!1)}};var a={},s=function(e){var t=e._src;if(a[t])return e._duration=a[t].duration,void c(e);if(/^data:[^;]+;base64,/.test(t)){for(var i=atob(t.split(",")[1]),n=new Uint8Array(i.length),r=0;r<i.length;++r)n[r]=i.charCodeAt(r);l(n.buffer,e)}else{var s=new XMLHttpRequest;s.open(e._xhr.method,t,!0),s.withCredentials=e._xhr.withCredentials,s.responseType="arraybuffer",e._xhr.headers&&Object.keys(e._xhr.headers).forEach((function(t){s.setRequestHeader(t,e._xhr.headers[t])})),s.onload=function(){var t=(s.status+"")[0];"0"===t||"2"===t||"3"===t?l(s.response,e):e._emit("loaderror",null,"Failed loading audio file with status: "+s.status+".")},s.onerror=function(){e._webAudio&&(e._html5=!0,e._webAudio=!1,e._sounds=[],delete a[t],e.load())},o(s)}},o=function(e){try{e.send()}catch{e.onerror()}},l=function(e,t){var n=function(){t._emit("loaderror",null,"Decoding audio data failed.")},r=function(e){e&&t._sounds.length>0?(a[t._src]=e,c(t,e)):n()};typeof Promise<"u"&&1===i.ctx.decodeAudioData.length?i.ctx.decodeAudioData(e).then(r).catch(n):i.ctx.decodeAudioData(e,r,n)},c=function(e,t){t&&!e._duration&&(e._duration=t.duration),0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue())},h=function(){if(i.usingWebAudio){try{typeof AudioContext<"u"?i.ctx=new AudioContext:typeof webkitAudioContext<"u"?i.ctx=new webkitAudioContext:i.usingWebAudio=!1}catch{i.usingWebAudio=!1}i.ctx||(i.usingWebAudio=!1);var e=/iP(hone|od|ad)/.test(i._navigator&&i._navigator.platform),t=i._navigator&&i._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),n=t?parseInt(t[1],10):null;if(e&&n&&n<9){var r=/safari/.test(i._navigator&&i._navigator.userAgent.toLowerCase());i._navigator&&!r&&(i.usingWebAudio=!1)}i.usingWebAudio&&(i.masterGain=typeof i.ctx.createGain>"u"?i.ctx.createGainNode():i.ctx.createGain(),i.masterGain.gain.setValueAtTime(i._muted?0:i._volume,i.ctx.currentTime),i.masterGain.connect(i.ctx.destination)),i._setup()}};"function"==typeof define&&define.amd&&define([],(function(){return{Howler:i,Howl:n}})),typeof e<"u"&&(e.Howler=i,e.Howl=n),typeof global<"u"?(global.HowlerGlobal=t,global.Howler=i,global.Howl=n,global.Sound=r):typeof window<"u"&&(window.HowlerGlobal=t,window.Howler=i,window.Howl=n,window.Sound=r)}(),function(){HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(e){var t=this;if(!t.ctx||!t.ctx.listener)return t;for(var i=t._howls.length-1;i>=0;i--)t._howls[i].stereo(e);return t},HowlerGlobal.prototype.pos=function(e,t,i){var n=this;return n.ctx&&n.ctx.listener?(t="number"!=typeof t?n._pos[1]:t,i="number"!=typeof i?n._pos[2]:i,"number"!=typeof e?n._pos:(n._pos=[e,t,i],typeof n.ctx.listener.positionX<"u"?(n.ctx.listener.positionX.setTargetAtTime(n._pos[0],Howler.ctx.currentTime,.1),n.ctx.listener.positionY.setTargetAtTime(n._pos[1],Howler.ctx.currentTime,.1),n.ctx.listener.positionZ.setTargetAtTime(n._pos[2],Howler.ctx.currentTime,.1)):n.ctx.listener.setPosition(n._pos[0],n._pos[1],n._pos[2]),n)):n},HowlerGlobal.prototype.orientation=function(e,t,i,n,r,a){var s=this;if(!s.ctx||!s.ctx.listener)return s;var o=s._orientation;return t="number"!=typeof t?o[1]:t,i="number"!=typeof i?o[2]:i,n="number"!=typeof n?o[3]:n,r="number"!=typeof r?o[4]:r,a="number"!=typeof a?o[5]:a,"number"!=typeof e?o:(s._orientation=[e,t,i,n,r,a],typeof s.ctx.listener.forwardX<"u"?(s.ctx.listener.forwardX.setTargetAtTime(e,Howler.ctx.currentTime,.1),s.ctx.listener.forwardY.setTargetAtTime(t,Howler.ctx.currentTime,.1),s.ctx.listener.forwardZ.setTargetAtTime(i,Howler.ctx.currentTime,.1),s.ctx.listener.upX.setTargetAtTime(n,Howler.ctx.currentTime,.1),s.ctx.listener.upY.setTargetAtTime(r,Howler.ctx.currentTime,.1),s.ctx.listener.upZ.setTargetAtTime(a,Howler.ctx.currentTime,.1)):s.ctx.listener.setOrientation(e,t,i,n,r,a),s)},Howl.prototype.init=function(e){return function(t){var i=this;return i._orientation=t.orientation||[1,0,0],i._stereo=t.stereo||null,i._pos=t.pos||null,i._pannerAttr={coneInnerAngle:typeof t.coneInnerAngle<"u"?t.coneInnerAngle:360,coneOuterAngle:typeof t.coneOuterAngle<"u"?t.coneOuterAngle:360,coneOuterGain:typeof t.coneOuterGain<"u"?t.coneOuterGain:0,distanceModel:typeof t.distanceModel<"u"?t.distanceModel:"inverse",maxDistance:typeof t.maxDistance<"u"?t.maxDistance:1e4,panningModel:typeof t.panningModel<"u"?t.panningModel:"HRTF",refDistance:typeof t.refDistance<"u"?t.refDistance:1,rolloffFactor:typeof t.rolloffFactor<"u"?t.rolloffFactor:1},i._onstereo=t.onstereo?[{fn:t.onstereo}]:[],i._onpos=t.onpos?[{fn:t.onpos}]:[],i._onorientation=t.onorientation?[{fn:t.onorientation}]:[],e.call(this,t)}}(Howl.prototype.init),Howl.prototype.stereo=function(t,i){var n=this;if(!n._webAudio)return n;if("loaded"!==n._state)return n._queue.push({event:"stereo",action:function(){n.stereo(t,i)}}),n;var r=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof i>"u"){if("number"!=typeof t)return n._stereo;n._stereo=t,n._pos=[t,0,0]}for(var a=n._getSoundIds(i),s=0;s<a.length;s++){var o=n._soundById(a[s]);if(o){if("number"!=typeof t)return o._stereo;o._stereo=t,o._pos=[t,0,0],o._node&&(o._pannerAttr.panningModel="equalpower",(!o._panner||!o._panner.pan)&&e(o,r),"spatial"===r?typeof o._panner.positionX<"u"?(o._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),o._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),o._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):o._panner.setPosition(t,0,0):o._panner.pan.setValueAtTime(t,Howler.ctx.currentTime)),n._emit("stereo",o._id)}}return n},Howl.prototype.pos=function(t,i,n,r){var a=this;if(!a._webAudio)return a;if("loaded"!==a._state)return a._queue.push({event:"pos",action:function(){a.pos(t,i,n,r)}}),a;if(i="number"!=typeof i?0:i,n="number"!=typeof n?-.5:n,typeof r>"u"){if("number"!=typeof t)return a._pos;a._pos=[t,i,n]}for(var s=a._getSoundIds(r),o=0;o<s.length;o++){var l=a._soundById(s[o]);if(l){if("number"!=typeof t)return l._pos;l._pos=[t,i,n],l._node&&((!l._panner||l._panner.pan)&&e(l,"spatial"),typeof l._panner.positionX<"u"?(l._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),l._panner.positionY.setValueAtTime(i,Howler.ctx.currentTime),l._panner.positionZ.setValueAtTime(n,Howler.ctx.currentTime)):l._panner.setPosition(t,i,n)),a._emit("pos",l._id)}}return a},Howl.prototype.orientation=function(t,i,n,r){var a=this;if(!a._webAudio)return a;if("loaded"!==a._state)return a._queue.push({event:"orientation",action:function(){a.orientation(t,i,n,r)}}),a;if(i="number"!=typeof i?a._orientation[1]:i,n="number"!=typeof n?a._orientation[2]:n,typeof r>"u"){if("number"!=typeof t)return a._orientation;a._orientation=[t,i,n]}for(var s=a._getSoundIds(r),o=0;o<s.length;o++){var l=a._soundById(s[o]);if(l){if("number"!=typeof t)return l._orientation;l._orientation=[t,i,n],l._node&&(l._panner||(l._pos||(l._pos=a._pos||[0,0,-.5]),e(l,"spatial")),typeof l._panner.orientationX<"u"?(l._panner.orientationX.setValueAtTime(t,Howler.ctx.currentTime),l._panner.orientationY.setValueAtTime(i,Howler.ctx.currentTime),l._panner.orientationZ.setValueAtTime(n,Howler.ctx.currentTime)):l._panner.setOrientation(t,i,n)),a._emit("orientation",l._id)}}return a},Howl.prototype.pannerAttr=function(){var t,i,n,r=this,a=arguments;if(!r._webAudio)return r;if(0===a.length)return r._pannerAttr;if(1===a.length){if("object"!=typeof a[0])return(n=r._soundById(parseInt(a[0],10)))?n._pannerAttr:r._pannerAttr;t=a[0],typeof i>"u"&&(t.pannerAttr||(t.pannerAttr={coneInnerAngle:t.coneInnerAngle,coneOuterAngle:t.coneOuterAngle,coneOuterGain:t.coneOuterGain,distanceModel:t.distanceModel,maxDistance:t.maxDistance,refDistance:t.refDistance,rolloffFactor:t.rolloffFactor,panningModel:t.panningModel}),r._pannerAttr={coneInnerAngle:typeof t.pannerAttr.coneInnerAngle<"u"?t.pannerAttr.coneInnerAngle:r._coneInnerAngle,coneOuterAngle:typeof t.pannerAttr.coneOuterAngle<"u"?t.pannerAttr.coneOuterAngle:r._coneOuterAngle,coneOuterGain:typeof t.pannerAttr.coneOuterGain<"u"?t.pannerAttr.coneOuterGain:r._coneOuterGain,distanceModel:typeof t.pannerAttr.distanceModel<"u"?t.pannerAttr.distanceModel:r._distanceModel,maxDistance:typeof t.pannerAttr.maxDistance<"u"?t.pannerAttr.maxDistance:r._maxDistance,refDistance:typeof t.pannerAttr.refDistance<"u"?t.pannerAttr.refDistance:r._refDistance,rolloffFactor:typeof t.pannerAttr.rolloffFactor<"u"?t.pannerAttr.rolloffFactor:r._rolloffFactor,panningModel:typeof t.pannerAttr.panningModel<"u"?t.pannerAttr.panningModel:r._panningModel})}else 2===a.length&&(t=a[0],i=parseInt(a[1],10));for(var s=r._getSoundIds(i),o=0;o<s.length;o++)if(n=r._soundById(s[o])){var l=n._pannerAttr;l={coneInnerAngle:typeof t.coneInnerAngle<"u"?t.coneInnerAngle:l.coneInnerAngle,coneOuterAngle:typeof t.coneOuterAngle<"u"?t.coneOuterAngle:l.coneOuterAngle,coneOuterGain:typeof t.coneOuterGain<"u"?t.coneOuterGain:l.coneOuterGain,distanceModel:typeof t.distanceModel<"u"?t.distanceModel:l.distanceModel,maxDistance:typeof t.maxDistance<"u"?t.maxDistance:l.maxDistance,refDistance:typeof t.refDistance<"u"?t.refDistance:l.refDistance,rolloffFactor:typeof t.rolloffFactor<"u"?t.rolloffFactor:l.rolloffFactor,panningModel:typeof t.panningModel<"u"?t.panningModel:l.panningModel};var c=n._panner;c?(c.coneInnerAngle=l.coneInnerAngle,c.coneOuterAngle=l.coneOuterAngle,c.coneOuterGain=l.coneOuterGain,c.distanceModel=l.distanceModel,c.maxDistance=l.maxDistance,c.refDistance=l.refDistance,c.rolloffFactor=l.rolloffFactor,c.panningModel=l.panningModel):(n._pos||(n._pos=r._pos||[0,0,-.5]),e(n,"spatial"))}return r},Sound.prototype.init=function(e){return function(){var t=this,i=t._parent;t._orientation=i._orientation,t._stereo=i._stereo,t._pos=i._pos,t._pannerAttr=i._pannerAttr,e.call(this),t._stereo?i.stereo(t._stereo):t._pos&&i.pos(t._pos[0],t._pos[1],t._pos[2],t._id)}}(Sound.prototype.init),Sound.prototype.reset=function(e){return function(){var t=this,i=t._parent;return t._orientation=i._orientation,t._stereo=i._stereo,t._pos=i._pos,t._pannerAttr=i._pannerAttr,t._stereo?i.stereo(t._stereo):t._pos?i.pos(t._pos[0],t._pos[1],t._pos[2],t._id):t._panner&&(t._panner.disconnect(0),t._panner=void 0,i._refreshBuffer(t)),e.call(this)}}(Sound.prototype.reset);var e=function(e,t){"spatial"===(t=t||"spatial")?(e._panner=Howler.ctx.createPanner(),e._panner.coneInnerAngle=e._pannerAttr.coneInnerAngle,e._panner.coneOuterAngle=e._pannerAttr.coneOuterAngle,e._panner.coneOuterGain=e._pannerAttr.coneOuterGain,e._panner.distanceModel=e._pannerAttr.distanceModel,e._panner.maxDistance=e._pannerAttr.maxDistance,e._panner.refDistance=e._pannerAttr.refDistance,e._panner.rolloffFactor=e._pannerAttr.rolloffFactor,e._panner.panningModel=e._pannerAttr.panningModel,typeof e._panner.positionX<"u"?(e._panner.positionX.setValueAtTime(e._pos[0],Howler.ctx.currentTime),e._panner.positionY.setValueAtTime(e._pos[1],Howler.ctx.currentTime),e._panner.positionZ.setValueAtTime(e._pos[2],Howler.ctx.currentTime)):e._panner.setPosition(e._pos[0],e._pos[1],e._pos[2]),typeof e._panner.orientationX<"u"?(e._panner.orientationX.setValueAtTime(e._orientation[0],Howler.ctx.currentTime),e._panner.orientationY.setValueAtTime(e._orientation[1],Howler.ctx.currentTime),e._panner.orientationZ.setValueAtTime(e._orientation[2],Howler.ctx.currentTime)):e._panner.setOrientation(e._orientation[0],e._orientation[1],e._orientation[2])):(e._panner=Howler.ctx.createStereoPanner(),e._panner.pan.setValueAtTime(e._stereo,Howler.ctx.currentTime)),e._panner.connect(e._node),e._paused||e._parent.pause(e._id,!0).play(e._id,!0)}}()})),oS=K_(((e,t)=>{function i(e,t,n,r){this.message=e,this.expected=t,this.found=n,this.location=r,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,i)}!function(e,t){function i(){this.constructor=e}i.prototype=t.prototype,e.prototype=new i}(i,Error),i.buildMessage=function(e,t){var i={literal:function(e){return'"'+r(e.text)+'"'},class:function(e){var t,i="";for(t=0;t<e.parts.length;t++)i+=e.parts[t]instanceof Array?a(e.parts[t][0])+"-"+a(e.parts[t][1]):a(e.parts[t]);return"["+(e.inverted?"^":"")+i+"]"},any:function(e){return"any character"},end:function(e){return"end of input"},other:function(e){return e.description}};function n(e){return e.charCodeAt(0).toString(16).toUpperCase()}function r(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function a(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function s(e){return i[e.type](e)}return"Expected "+function(e){var t,i,n=new Array(e.length);for(t=0;t<e.length;t++)n[t]=s(e[t]);if(n.sort(),n.length>0){for(t=1,i=1;t<n.length;t++)n[t-1]!==n[t]&&(n[i]=n[t],i++);n.length=i}switch(n.length){case 1:return n[0];case 2:return n[0]+" or "+n[1];default:return n.slice(0,-1).join(", ")+", or "+n[n.length-1]}}(e)+" but "+function(e){return e?'"'+r(e)+'"':"end of input"}(t)+" found."},t.exports={SyntaxError:i,parse:function(e,t){t=void 0!==t?t:{};var n,r={},a={svg_path:ge},s=ge,o=function(e){if(!e)return[];for(var t=[],i=0;i<e.length;i++)t=t.concat.apply(t,e[i]);var n=t[0];return n&&"m"==n.code&&(delete n.relative,n.code="M"),t},l=function(e,t){return function(e,t){if(!t)return[e];for(var i=[e],n=0,r=t.length;n<r;n++)i[n+1]=t[n][1];return i}(e,t)},c=/^[Mm]/,h=ue(["M","m"],!1,!1),u=function(e,t,i){var n=Ne(e,[t]);return i&&(n=n.concat(Ne("M"==e?"L":"l",i[1]))),n},d=/^[Zz]/,p=ue(["Z","z"],!1,!1),f=function(){return Ne("Z")},m=/^[Ll]/,g=ue(["L","l"],!1,!1),v=function(e,t){return Ne(e,t)},y=/^[Hh]/,b=ue(["H","h"],!1,!1),x=function(e,t){return Ne(e,t.map((function(e){return{x:e}})))},w=/^[Vv]/,_=ue(["V","v"],!1,!1),S=function(e,t){return Ne(e,t.map((function(e){return{y:e}})))},E=/^[Cc]/,C=ue(["C","c"],!1,!1),A=function(e,t,i){return{x1:e.x,y1:e.y,x2:t.x,y2:t.y,x:i.x,y:i.y}},M=/^[Ss]/,T=ue(["S","s"],!1,!1),P=function(e,t){return{x2:e.x,y2:e.y,x:t.x,y:t.y}},D=/^[Qq]/,k=ue(["Q","q"],!1,!1),O=function(e,t){return{x1:e.x,y1:e.y,x:t.x,y:t.y}},I=/^[Tt]/,R=ue(["T","t"],!1,!1),L=/^[Aa]/,B=ue(["A","a"],!1,!1),z=function(e,t,i,n,r,a){return{rx:e,ry:t,xAxisRotation:i,largeArc:n,sweep:r,x:a.x,y:a.y}},N=function(e,t){return{x:e,y:t}},F=function(e){return 1*e},j=function(e){return 1*e.join("")},V=/^[01]/,U=ue(["0","1"],!1,!1),G=function(e){return"1"==e},H=function(){return""},W=",",q=he(",",!1),X=function(e){return e.join("")},Y=".",Q=he(".",!1),Z=/^[eE]/,K=ue(["e","E"],!1,!1),J=/^[+\-]/,$=ue(["+","-"],!1,!1),ee=/^[0-9]/,te=ue([["0","9"]],!1,!1),ie=function(e){return e.join("")},ne=/^[ \t\n\r]/,re=ue([" ","\t","\n","\r"],!1,!1),ae=0,se=[{line:1,column:1}],oe=0,le=[],ce=0;if("startRule"in t){if(!(t.startRule in a))throw new Error("Can't start parsing from rule \""+t.startRule+'".');s=a[t.startRule]}function he(e,t){return{type:"literal",text:e,ignoreCase:t}}function ue(e,t,i){return{type:"class",parts:e,inverted:t,ignoreCase:i}}function de(t){var i,n=se[t];if(n)return n;for(i=t-1;!se[i];)i--;for(n={line:(n=se[i]).line,column:n.column};i<t;)10===e.charCodeAt(i)?(n.line++,n.column=1):n.column++,i++;return se[t]=n,n}function pe(e,t){var i=de(e),n=de(t);return{start:{offset:e,line:i.line,column:i.column},end:{offset:t,line:n.line,column:n.column}}}function fe(e){ae<oe||(ae>oe&&(oe=ae,le=[]),le.push(e))}function me(e,t,n){return new i(i.buildMessage(e,t),e,t,n)}function ge(){var e,t,i,n,a;for(e=ae,t=[],i=Le();i!==r;)t.push(i),i=Le();if(t!==r)if(i=function(){var e,t,i,n,a,s;if(e=ae,t=ve(),t!==r){for(i=[],n=ae,a=[],s=Le();s!==r;)a.push(s),s=Le();for(a!==r?(s=ve())!==r?n=a=[a,s]:(ae=n,n=r):(ae=n,n=r);n!==r;){for(i.push(n),n=ae,a=[],s=Le();s!==r;)a.push(s),s=Le();a!==r?(s=ve())!==r?n=a=[a,s]:(ae=n,n=r):(ae=n,n=r)}i!==r?(e,e=t=l(t,i)):(ae=e,e=r)}else ae=e,e=r;return e}(),i===r&&(i=null),i!==r){for(n=[],a=Le();a!==r;)n.push(a),a=Le();n!==r?(e,e=t=o(i)):(ae=e,e=r)}else ae=e,e=r;else ae=e,e=r;return e}function ve(){var t,i,n,a,s,o;if(t=ae,i=function(){var t,i,n,a,s,o,l;if(t=ae,c.test(e.charAt(ae))?(i=e.charAt(ae),ae++):(i=r,0===ce&&fe(h)),i!==r){for(n=[],a=Le();a!==r;)n.push(a),a=Le();n!==r?(a=Ce())!==r?(s=ae,(o=Pe())===r&&(o=null),o!==r?(l=be())!==r?s=o=[o,l]:(ae=s,s=r):(ae=s,s=r),s===r&&(s=null),s!==r?(t,t=i=u(i,a,s)):(ae=t,t=r)):(ae=t,t=r):(ae=t,t=r)}else ae=t,t=r;return t}(),i!==r){for(n=[],a=ae,s=[],o=Le();o!==r;)s.push(o),o=Le();for(s!==r?(o=ye())!==r?a=s=[s,o]:(ae=a,a=r):(ae=a,a=r);a!==r;){for(n.push(a),a=ae,s=[],o=Le();o!==r;)s.push(o),o=Le();s!==r?(o=ye())!==r?a=s=[s,o]:(ae=a,a=r):(ae=a,a=r)}n!==r?(t,t=i=l(i,n)):(ae=t,t=r)}else ae=t,t=r;return t}function ye(){var t;return t=function(){var t,i;return t=ae,d.test(e.charAt(ae))?(i=e.charAt(ae),ae++):(i=r,0===ce&&fe(p)),i!==r&&(t,i=f()),t=i,t}(),t===r&&(t=function(){var t,i,n,a;if(t=ae,m.test(e.charAt(ae))?(i=e.charAt(ae),ae++):(i=r,0===ce&&fe(g)),i!==r){for(n=[],a=Le();a!==r;)n.push(a),a=Le();n!==r?(a=be())!==r?(t,t=i=v(i,a)):(ae=t,t=r):(ae=t,t=r)}else ae=t,t=r;return t}(),t===r&&(t=function(){var t,i,n,a;if(t=ae,y.test(e.charAt(ae))?(i=e.charAt(ae),ae++):(i=r,0===ce&&fe(b)),i!==r){for(n=[],a=Le();a!==r;)n.push(a),a=Le();n!==r?(a=xe())!==r?(t,t=i=x(i,a)):(ae=t,t=r):(ae=t,t=r)}else ae=t,t=r;return t}(),t===r&&(t=function(){var t,i,n,a;if(t=ae,w.test(e.charAt(ae))?(i=e.charAt(ae),ae++):(i=r,0===ce&&fe(_)),i!==r){for(n=[],a=Le();a!==r;)n.push(a),a=Le();n!==r?(a=xe())!==r?(t,t=i=S(i,a)):(ae=t,t=r):(ae=t,t=r)}else ae=t,t=r;return t}(),t===r&&(t=function(){var t,i,n,a;if(t=ae,E.test(e.charAt(ae))?(i=e.charAt(ae),ae++):(i=r,0===ce&&fe(C)),i!==r){for(n=[],a=Le();a!==r;)n.push(a),a=Le();n!==r?(a=function(){var e,t,i,n,a,s;if(e=ae,t=we(),t!==r){for(i=[],n=ae,(a=Pe())===r&&(a=null),a!==r?(s=we())!==r?n=a=[a,s]:(ae=n,n=r):(ae=n,n=r);n!==r;)i.push(n),n=ae,(a=Pe())===r&&(a=null),a!==r?(s=we())!==r?n=a=[a,s]:(ae=n,n=r):(ae=n,n=r);i!==r?(e,e=t=l(t,i)):(ae=e,e=r)}else ae=e,e=r;return e}(),a!==r?(t,t=i=v(i,a)):(ae=t,t=r)):(ae=t,t=r)}else ae=t,t=r;return t}(),t===r&&(t=function(){var t,i,n,a;if(t=ae,M.test(e.charAt(ae))?(i=e.charAt(ae),ae++):(i=r,0===ce&&fe(T)),i!==r){for(n=[],a=Le();a!==r;)n.push(a),a=Le();n!==r?(a=function(){var e,t,i,n,a,s;if(e=ae,t=_e(),t!==r){for(i=[],n=ae,(a=Pe())===r&&(a=null),a!==r?(s=_e())!==r?n=a=[a,s]:(ae=n,n=r):(ae=n,n=r);n!==r;)i.push(n),n=ae,(a=Pe())===r&&(a=null),a!==r?(s=_e())!==r?n=a=[a,s]:(ae=n,n=r):(ae=n,n=r);i!==r?(e,e=t=l(t,i)):(ae=e,e=r)}else ae=e,e=r;return e}(),a!==r?(t,t=i=v(i,a)):(ae=t,t=r)):(ae=t,t=r)}else ae=t,t=r;return t}(),t===r&&(t=function(){var t,i,n,a;if(t=ae,D.test(e.charAt(ae))?(i=e.charAt(ae),ae++):(i=r,0===ce&&fe(k)),i!==r){for(n=[],a=Le();a!==r;)n.push(a),a=Le();n!==r?(a=function(){var e,t,i,n,a,s;if(e=ae,t=Se(),t!==r){for(i=[],n=ae,(a=Pe())===r&&(a=null),a!==r?(s=Se())!==r?n=a=[a,s]:(ae=n,n=r):(ae=n,n=r);n!==r;)i.push(n),n=ae,(a=Pe())===r&&(a=null),a!==r?(s=Se())!==r?n=a=[a,s]:(ae=n,n=r):(ae=n,n=r);i!==r?(e,e=t=l(t,i)):(ae=e,e=r)}else ae=e,e=r;return e}(),a!==r?(t,t=i=v(i,a)):(ae=t,t=r)):(ae=t,t=r)}else ae=t,t=r;return t}(),t===r&&(t=function(){var t,i,n,a;if(t=ae,I.test(e.charAt(ae))?(i=e.charAt(ae),ae++):(i=r,0===ce&&fe(R)),i!==r){for(n=[],a=Le();a!==r;)n.push(a),a=Le();n!==r?(a=function(){var e,t,i,n,a,s;if(e=ae,t=Ce(),t!==r){for(i=[],n=ae,(a=Pe())===r&&(a=null),a!==r?(s=Ce())!==r?n=a=[a,s]:(ae=n,n=r):(ae=n,n=r);n!==r;)i.push(n),n=ae,(a=Pe())===r&&(a=null),a!==r?(s=Ce())!==r?n=a=[a,s]:(ae=n,n=r):(ae=n,n=r);i!==r?(e,e=t=l(t,i)):(ae=e,e=r)}else ae=e,e=r;return e}(),a!==r?(t,t=i=v(i,a)):(ae=t,t=r)):(ae=t,t=r)}else ae=t,t=r;return t}(),t===r&&(t=function(){var t,i,n,a;if(t=ae,L.test(e.charAt(ae))?(i=e.charAt(ae),ae++):(i=r,0===ce&&fe(B)),i!==r){for(n=[],a=Le();a!==r;)n.push(a),a=Le();n!==r?(a=function(){var e,t,i,n,a,s;if(e=ae,t=Ee(),t!==r){for(i=[],n=ae,(a=Pe())===r&&(a=null),a!==r?(s=Ee())!==r?n=a=[a,s]:(ae=n,n=r):(ae=n,n=r);n!==r;)i.push(n),n=ae,(a=Pe())===r&&(a=null),a!==r?(s=Ee())!==r?n=a=[a,s]:(ae=n,n=r):(ae=n,n=r);i!==r?(e,e=t=l(t,i)):(ae=e,e=r)}else ae=e,e=r;return e}(),a!==r?(t,t=i=v(i,a)):(ae=t,t=r)):(ae=t,t=r)}else ae=t,t=r;return t}())))))))),t}function be(){var e,t,i,n,a,s;if(e=ae,(t=Ce())!==r){for(i=[],n=ae,(a=Pe())===r&&(a=null),a!==r?(s=Ce())!==r?n=a=[a,s]:(ae=n,n=r):(ae=n,n=r);n!==r;)i.push(n),n=ae,(a=Pe())===r&&(a=null),a!==r?(s=Ce())!==r?n=a=[a,s]:(ae=n,n=r):(ae=n,n=r);i!==r?(e,e=t=l(t,i)):(ae=e,e=r)}else ae=e,e=r;return e}function xe(){var e,t,i,n,a,s;if(e=ae,(t=Me())!==r){for(i=[],n=ae,(a=Pe())===r&&(a=null),a!==r?(s=Me())!==r?n=a=[a,s]:(ae=n,n=r):(ae=n,n=r);n!==r;)i.push(n),n=ae,(a=Pe())===r&&(a=null),a!==r?(s=Me())!==r?n=a=[a,s]:(ae=n,n=r):(ae=n,n=r);i!==r?(e,e=t=l(t,i)):(ae=e,e=r)}else ae=e,e=r;return e}function we(){var e,t,i,n,a,s;return e=ae,(t=Ce())!==r?((i=Pe())===r&&(i=null),i!==r?(n=Ce())!==r?((a=Pe())===r&&(a=null),a!==r?(s=Ce())!==r?(e,e=t=A(t,n,s)):(ae=e,e=r):(ae=e,e=r)):(ae=e,e=r):(ae=e,e=r)):(ae=e,e=r),e}function _e(){var e,t,i,n;return e=ae,(t=Ce())!==r?((i=Pe())===r&&(i=null),i!==r?(n=Ce())!==r?(e,e=t=P(t,n)):(ae=e,e=r):(ae=e,e=r)):(ae=e,e=r),e}function Se(){var e,t,i,n;return e=ae,(t=Ce())!==r?((i=Pe())===r&&(i=null),i!==r?(n=Ce())!==r?(e,e=t=O(t,n)):(ae=e,e=r):(ae=e,e=r)):(ae=e,e=r),e}function Ee(){var e,t,i,n,a,s,o,l,c,h,u;return e=ae,(t=Ae())!==r?((i=Pe())===r&&(i=null),i!==r?(n=Ae())!==r?((a=Pe())===r&&(a=null),a!==r?(s=Me())!==r?Pe()!==r?(o=Te())!==r?((l=Pe())===r&&(l=null),l!==r?(c=Te())!==r?((h=Pe())===r&&(h=null),h!==r?(u=Ce())!==r?(e,e=t=z(t,n,s,o,c,u)):(ae=e,e=r):(ae=e,e=r)):(ae=e,e=r):(ae=e,e=r)):(ae=e,e=r):(ae=e,e=r):(ae=e,e=r):(ae=e,e=r)):(ae=e,e=r):(ae=e,e=r)):(ae=e,e=r),e}function Ce(){var e,t,i,n;return e=ae,(t=Me())!==r?((i=Pe())===r&&(i=null),i!==r?(n=Me())!==r?(e,e=t=N(t,n)):(ae=e,e=r):(ae=e,e=r)):(ae=e,e=r),e}function Ae(){var e,t;return e=ae,(t=ke())===r&&(t=Re()),t!==r&&(e,t=F(t)),e=t}function Me(){var e,t,i,n;return e=ae,t=ae,(i=Ie())===r&&(i=null),i!==r?(n=ke())!==r?t=i=[i,n]:(ae=t,t=r):(ae=t,t=r),t===r&&(t=ae,(i=Ie())===r&&(i=null),i!==r?(n=Re())!==r?t=i=[i,n]:(ae=t,t=r):(ae=t,t=r)),t!==r&&(e,t=j(t)),e=t}function Te(){var t,i;return t=ae,V.test(e.charAt(ae))?(i=e.charAt(ae),ae++):(i=r,0===ce&&fe(U)),i!==r&&(t,i=G(i)),t=i}function Pe(){var e,t,i,n,a;if(e=ae,t=[],(i=Le())!==r)for(;i!==r;)t.push(i),i=Le();else t=r;if(t!==r)if((i=De())===r&&(i=null),i!==r){for(n=[],a=Le();a!==r;)n.push(a),a=Le();n!==r?e=t=[t,i,n]:(ae=e,e=r)}else ae=e,e=r;else ae=e,e=r;if(e===r){if(e=ae,t=ae,(i=De())!==r){for(n=[],a=Le();a!==r;)n.push(a),a=Le();n!==r?t=i=[i,n]:(ae=t,t=r)}else ae=t,t=r;t!==r&&(e,t=H()),e=t}return e}function De(){var t;return 44===e.charCodeAt(ae)?(t=W,ae++):(t=r,0===ce&&fe(q)),t}function ke(){var t,i,n,a;return t=ae,i=ae,n=function(){var t,i,n,a,s;return t=ae,i=ae,n=Re(),n===r&&(n=null),n!==r?(46===e.charCodeAt(ae)?(a=Y,ae++):(a=r,0===ce&&fe(Q)),a!==r&&(s=Re())!==r?(n=[n,a,s],i=n):(ae=i,i=r)):(ae=i,i=r),i===r&&(i=ae,n=Re(),n!==r?(46===e.charCodeAt(ae)?(a=Y,ae++):(a=r,0===ce&&fe(Q)),a!==r?(n=[n,a],i=n):(ae=i,i=r)):(ae=i,i=r)),i!==r&&(t,i=X(i)),t=i,t}(),n!==r?((a=Oe())===r&&(a=null),a!==r?i=n=[n,a]:(ae=i,i=r)):(ae=i,i=r),i===r&&(i=ae,(n=Re())!==r?(a=Oe())!==r?i=n=[n,a]:(ae=i,i=r):(ae=i,i=r)),i!==r&&(t,i=X(i)),t=i}function Oe(){var t,i,n,a,s;return t=ae,i=ae,Z.test(e.charAt(ae))?(n=e.charAt(ae),ae++):(n=r,0===ce&&fe(K)),n!==r?((a=Ie())===r&&(a=null),a!==r?(s=Re())!==r?i=n=[n,a,s]:(ae=i,i=r):(ae=i,i=r)):(ae=i,i=r),i!==r&&(t,i=X(i)),t=i}function Ie(){var t;return J.test(e.charAt(ae))?(t=e.charAt(ae),ae++):(t=r,0===ce&&fe($)),t}function Re(){var t,i,n;if(t=ae,i=[],ee.test(e.charAt(ae))?(n=e.charAt(ae),ae++):(n=r,0===ce&&fe(te)),n!==r)for(;n!==r;)i.push(n),ee.test(e.charAt(ae))?(n=e.charAt(ae),ae++):(n=r,0===ce&&fe(te));else i=r;return i!==r&&(t,i=ie(i)),t=i}function Le(){var t,i;return t=ae,ne.test(e.charAt(ae))?(i=e.charAt(ae),ae++):(i=r,0===ce&&fe(re)),i!==r&&(t,i=H()),t=i}var Be={m:"moveto",l:"lineto",h:"horizontal lineto",v:"vertical lineto",c:"curveto",s:"smooth curveto",q:"quadratic curveto",t:"smooth quadratic curveto",a:"elliptical arc",z:"closepath"};for(var ze in Be)Be[ze.toUpperCase()]=Be[ze];function Ne(e,t){t||(t=[{}]);for(var i=t.length;i--;){var n={code:e,command:Be[e]};for(var r in e==e.toLowerCase()&&(n.relative=!0),t[i])n[r]=t[i][r];t[i]=n}return t}if((n=s())!==r&&ae===e.length)return n;throw n!==r&&ae<e.length&&fe({type:"end"}),me(le,oe<e.length?e.charAt(oe):null,oe<e.length?pe(oe,oe+1):pe(oe,oe))}}})),lS=K_(((e,t)=>{var i=oS().parse;i.parseSVG=i,i.makeAbsolute=function(e){var t,i={x:0,y:0},n={x:"x0",y:"y0",x1:"x0",y1:"y0",x2:"x0",y2:"y0"};return e.forEach((function(e){for(var r in"moveto"===e.command&&(t=e),e.x0=i.x,e.y0=i.y,n)r in e&&(e[r]+=e.relative?e[n[r]]:0);"x"in e||(e.x=i.x),"y"in e||(e.y=i.y),e.relative=!1,e.code=e.code.toUpperCase(),"closepath"==e.command&&(e.x=t.x,e.y=t.y),i=e})),e},t.exports=i})),cS=K_(((e,t)=>{t.exports=function(e){for(var t=new Array(e),i=0;i<e;++i)t[i]=i;return t}})),hS=K_(((e,t)=>{function i(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}t.exports=function(e){return null!=e&&(i(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&i(e.slice(0,0))}(e)||!!e._isBuffer)}})),uS=K_(((e,t)=>{var i=cS(),n=hS(),r=typeof Float64Array<"u";function a(e,t){return e[0]-t[0]}function s(){var e,t=this.stride,i=new Array(t.length);for(e=0;e<i.length;++e)i[e]=[Math.abs(t[e]),e];i.sort(a);var n=new Array(i.length);for(e=0;e<n.length;++e)n[e]=i[e][1];return n}function o(e,t){var n=["View",t,"d",e].join("");t<0&&(n="View_Nil"+e);var r="generic"===e;if(-1===t){var a="function "+n+"(a){this.data=a;};var proto="+n+".prototype;proto.dtype='"+e+"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new "+n+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+n+"(a){return new "+n+"(a);}";return new Function(a)()}if(0===t){a="function "+n+"(a,d) {this.data = a;this.offset = d};var proto="+n+".prototype;proto.dtype='"+e+"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function "+n+"_copy() {return new "+n+"(this.data,this.offset)};proto.pick=function "+n+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+n+"_get(){return "+(r?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+n+"_set(v){return "+(r?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+n+"(a,b,c,d){return new "+n+"(a,d)}";return new Function("TrivialArray",a)(l[e][0])}a=["'use strict'"];var o=i(t),c=o.map((function(e){return"i"+e})),h="this.offset+"+o.map((function(e){return"this.stride["+e+"]*i"+e})).join("+"),u=o.map((function(e){return"b"+e})).join(","),d=o.map((function(e){return"c"+e})).join(",");a.push("function "+n+"(a,"+u+","+d+",d){this.data=a","this.shape=["+u+"]","this.stride=["+d+"]","this.offset=d|0}","var proto="+n+".prototype","proto.dtype='"+e+"'","proto.dimension="+t),a.push("Object.defineProperty(proto,'size',{get:function "+n+"_size(){return "+o.map((function(e){return"this.shape["+e+"]"})).join("*"),"}})"),1===t?a.push("proto.order=[0]"):(a.push("Object.defineProperty(proto,'order',{get:"),t<4?(a.push("function "+n+"_order(){"),2===t?a.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===t&&a.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):a.push("ORDER})")),a.push("proto.set=function "+n+"_set("+c.join(",")+",v){"),r?a.push("return this.data.set("+h+",v)}"):a.push("return this.data["+h+"]=v}"),a.push("proto.get=function "+n+"_get("+c.join(",")+"){"),r?a.push("return this.data.get("+h+")}"):a.push("return this.data["+h+"]}"),a.push("proto.index=function "+n+"_index(",c.join(),"){return "+h+"}"),a.push("proto.hi=function "+n+"_hi("+c.join(",")+"){return new "+n+"(this.data,"+o.map((function(e){return["(typeof i",e,"!=='number'||i",e,"<0)?this.shape[",e,"]:i",e,"|0"].join("")})).join(",")+","+o.map((function(e){return"this.stride["+e+"]"})).join(",")+",this.offset)}");var p=o.map((function(e){return"a"+e+"=this.shape["+e+"]"})),f=o.map((function(e){return"c"+e+"=this.stride["+e+"]"}));a.push("proto.lo=function "+n+"_lo("+c.join(",")+"){var b=this.offset,d=0,"+p.join(",")+","+f.join(","));for(var m=0;m<t;++m)a.push("if(typeof i"+m+"==='number'&&i"+m+">=0){d=i"+m+"|0;b+=c"+m+"*d;a"+m+"-=d}");a.push("return new "+n+"(this.data,"+o.map((function(e){return"a"+e})).join(",")+","+o.map((function(e){return"c"+e})).join(",")+",b)}"),a.push("proto.step=function "+n+"_step("+c.join(",")+"){var "+o.map((function(e){return"a"+e+"=this.shape["+e+"]"})).join(",")+","+o.map((function(e){return"b"+e+"=this.stride["+e+"]"})).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(m=0;m<t;++m)a.push("if(typeof i"+m+"==='number'){d=i"+m+"|0;if(d<0){c+=b"+m+"*(a"+m+"-1);a"+m+"=ceil(-a"+m+"/d)}else{a"+m+"=ceil(a"+m+"/d)}b"+m+"*=d}");a.push("return new "+n+"(this.data,"+o.map((function(e){return"a"+e})).join(",")+","+o.map((function(e){return"b"+e})).join(",")+",c)}");var g=new Array(t),v=new Array(t);for(m=0;m<t;++m)g[m]="a[i"+m+"]",v[m]="b[i"+m+"]";a.push("proto.transpose=function "+n+"_transpose("+c+"){"+c.map((function(e,t){return e+"=("+e+"===undefined?"+t+":"+e+"|0)"})).join(";"),"var a=this.shape,b=this.stride;return new "+n+"(this.data,"+g.join(",")+","+v.join(",")+",this.offset)}"),a.push("proto.pick=function "+n+"_pick("+c+"){var a=[],b=[],c=this.offset");for(m=0;m<t;++m)a.push("if(typeof i"+m+"==='number'&&i"+m+">=0){c=(c+this.stride["+m+"]*i"+m+")|0}else{a.push(this.shape["+m+"]);b.push(this.stride["+m+"])}");return a.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),a.push("return function construct_"+n+"(data,shape,stride,offset){return new "+n+"(data,"+o.map((function(e){return"shape["+e+"]"})).join(",")+","+o.map((function(e){return"stride["+e+"]"})).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",a.join("\n"))(l[e],s)}var l={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};t.exports=function(e,t,i,a){if(void 0===e)return(0,l.array[0])([]);"number"==typeof e&&(e=[e]),void 0===t&&(t=[e.length]);var s=t.length;if(void 0===i){i=new Array(s);for(var c=s-1,h=1;c>=0;--c)i[c]=h,h*=t[c]}if(void 0===a){a=0;for(c=0;c<s;++c)i[c]<0&&(a-=(t[c]-1)*i[c])}for(var u=function(e){if(n(e))return"buffer";if(r)switch(Object.prototype.toString.call(e)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(e)?"array":"generic"}(e),d=l[u];d.length<=s+1;)d.push(o(u,d.length-1));return(0,d[s+1])(e,t,i,a)}})),dS=K_(((e,t)=>{t.exports=function(e,t,i){return 0===e.length?e:t?(i||e.sort(t),function(e,t){for(var i=1,n=e.length,r=e[0],a=e[0],s=1;s<n;++s)if(a=r,t(r=e[s],a)){if(s===i){i++;continue}e[i++]=r}return e.length=i,e}(e,t)):(i||e.sort(),function(e){for(var t=1,i=e.length,n=e[0],r=e[0],a=1;a<i;++a,r=n)if(r=n,(n=e[a])!==r){if(a===t){t++;continue}e[t++]=n}return e.length=t,e}(e))}})),pS=K_(((e,t)=>{var i=dS();function n(e,t,i){var n,r,a=e.length,s=t.arrayArgs.length,o=t.indexArgs.length>0,l=[],c=[],h=0,u=0;for(n=0;n<a;++n)c.push(["i",n,"=0"].join(""));for(r=0;r<s;++r)for(n=0;n<a;++n)u=h,h=e[n],0===n?c.push(["d",r,"s",n,"=t",r,"p",h].join("")):c.push(["d",r,"s",n,"=(t",r,"p",h,"-s",u,"*t",r,"p",u,")"].join(""));for(c.length>0&&l.push("var "+c.join(",")),n=a-1;n>=0;--n)h=e[n],l.push(["for(i",n,"=0;i",n,"<s",h,";++i",n,"){"].join(""));for(l.push(i),n=0;n<a;++n){for(u=h,h=e[n],r=0;r<s;++r)l.push(["p",r,"+=d",r,"s",n].join(""));o&&(n>0&&l.push(["index[",u,"]-=s",u].join("")),l.push(["++index[",h,"]"].join(""))),l.push("}")}return l.join("\n")}function r(e,t,i){for(var n=e.body,r=[],a=[],s=0;s<e.args.length;++s){var o=e.args[s];if(!(o.count<=0)){var l=new RegExp(o.name,"g"),c="",h=t.arrayArgs.indexOf(s);switch(t.argTypes[s]){case"offset":var u=t.offsetArgIndex.indexOf(s);h=t.offsetArgs[u].array,c="+q"+u;case"array":c="p"+h+c;var d="l"+s,p="a"+h;if(0===t.arrayBlockIndices[h])1===o.count?"generic"===i[h]?o.lvalue?(r.push(["var ",d,"=",p,".get(",c,")"].join("")),n=n.replace(l,d),a.push([p,".set(",c,",",d,")"].join(""))):n=n.replace(l,[p,".get(",c,")"].join("")):n=n.replace(l,[p,"[",c,"]"].join("")):"generic"===i[h]?(r.push(["var ",d,"=",p,".get(",c,")"].join("")),n=n.replace(l,d),o.lvalue&&a.push([p,".set(",c,",",d,")"].join(""))):(r.push(["var ",d,"=",p,"[",c,"]"].join("")),n=n.replace(l,d),o.lvalue&&a.push([p,"[",c,"]=",d].join("")));else{for(var f=[o.name],m=[c],g=0;g<Math.abs(t.arrayBlockIndices[h]);g++)f.push("\\s*\\[([^\\]]+)\\]"),m.push("$"+(g+1)+"*t"+h+"b"+g);if(l=new RegExp(f.join(""),"g"),c=m.join("+"),"generic"===i[h])throw new Error("cwise: Generic arrays not supported in combination with blocks!");n=n.replace(l,[p,"[",c,"]"].join(""))}break;case"scalar":n=n.replace(l,"Y"+t.scalarArgs.indexOf(s));break;case"index":n=n.replace(l,"index");break;case"shape":n=n.replace(l,"shape")}}}return[r.join("\n"),n,a.join("\n")].join("\n").trim()}function a(e){for(var t=new Array(e.length),i=!0,n=0;n<e.length;++n){var r=e[n],a=r.match(/\d+/);a=a?a[0]:"",0===r.charAt(0)?t[n]="u"+r.charAt(1)+a:t[n]=r.charAt(0)+a,n>0&&(i=i&&t[n]===t[n-1])}return i?t[0]:t.join("")}t.exports=function(e,t){for(var s=t[1].length-Math.abs(e.arrayBlockIndices[0])|0,o=new Array(e.arrayArgs.length),l=new Array(e.arrayArgs.length),c=0;c<e.arrayArgs.length;++c)l[c]=t[2*c],o[c]=t[2*c+1];var h=[],u=[],d=[],p=[],f=[];for(c=0;c<e.arrayArgs.length;++c){e.arrayBlockIndices[c]<0?(d.push(0),p.push(s),h.push(s),u.push(s+e.arrayBlockIndices[c])):(d.push(e.arrayBlockIndices[c]),p.push(e.arrayBlockIndices[c]+s),h.push(0),u.push(e.arrayBlockIndices[c]));for(var m=[],g=0;g<o[c].length;g++)d[c]<=o[c][g]&&o[c][g]<p[c]&&m.push(o[c][g]-d[c]);f.push(m)}var v=["SS"],y=["'use strict'"],b=[];for(g=0;g<s;++g)b.push(["s",g,"=SS[",g,"]"].join(""));for(c=0;c<e.arrayArgs.length;++c){v.push("a"+c),v.push("t"+c),v.push("p"+c);for(g=0;g<s;++g)b.push(["t",c,"p",g,"=t",c,"[",d[c]+g,"]"].join(""));for(g=0;g<Math.abs(e.arrayBlockIndices[c]);++g)b.push(["t",c,"b",g,"=t",c,"[",h[c]+g,"]"].join(""))}for(c=0;c<e.scalarArgs.length;++c)v.push("Y"+c);if(e.shapeArgs.length>0&&b.push("shape=SS.slice(0)"),e.indexArgs.length>0){var x=new Array(s);for(c=0;c<s;++c)x[c]="0";b.push(["index=[",x.join(","),"]"].join(""))}for(c=0;c<e.offsetArgs.length;++c){var w=e.offsetArgs[c],_=[];for(g=0;g<w.offset.length;++g)0!==w.offset[g]&&(1===w.offset[g]?_.push(["t",w.array,"p",g].join("")):_.push([w.offset[g],"*t",w.array,"p",g].join("")));0===_.length?b.push("q"+c+"=0"):b.push(["q",c,"=",_.join("+")].join(""))}var S=i([].concat(e.pre.thisVars).concat(e.body.thisVars).concat(e.post.thisVars));for((b=b.concat(S)).length>0&&y.push("var "+b.join(",")),c=0;c<e.arrayArgs.length;++c)y.push("p"+c+"|=0");e.pre.body.length>3&&y.push(r(e.pre,e,l));var E=r(e.body,e,l),C=function(e){for(var t=0,i=e[0].length;t<i;){for(var n=1;n<e.length;++n)if(e[n][t]!==e[0][t])return t;++t}return t}(f);C<s?y.push(function(e,t,i,r){for(var a=t.length,s=i.arrayArgs.length,o=i.blockSize,l=i.indexArgs.length>0,c=[],h=0;h<s;++h)c.push(["var offset",h,"=p",h].join(""));for(h=e;h<a;++h)c.push(["for(var j"+h+"=SS[",t[h],"]|0;j",h,">0;){"].join("")),c.push(["if(j",h,"<",o,"){"].join("")),c.push(["s",t[h],"=j",h].join("")),c.push(["j",h,"=0"].join("")),c.push(["}else{s",t[h],"=",o].join("")),c.push(["j",h,"-=",o,"}"].join("")),l&&c.push(["index[",t[h],"]=j",h].join(""));for(h=0;h<s;++h){for(var u=["offset"+h],d=e;d<a;++d)u.push(["j",d,"*t",h,"p",t[d]].join(""));c.push(["p",h,"=(",u.join("+"),")"].join(""))}for(c.push(n(t,i,r)),h=e;h<a;++h)c.push("}");return c.join("\n")}(C,f[0],e,E)):y.push(n(f[0],e,E)),e.post.body.length>3&&y.push(r(e.post,e,l)),e.debug&&console.log("-----Generated cwise routine for ",t,":\n"+y.join("\n")+"\n----------");var A=[e.funcName||"unnamed","_cwise_loop_",o[0].join("s"),"m",C,a(l)].join("");return new Function(["function ",A,"(",v.join(","),"){",y.join("\n"),"} return ",A].join(""))()}})),fS=K_(((e,t)=>{var i=pS();t.exports=function(e){var t=["'use strict'","var CACHED={}"],n=[],r=e.funcName+"_cwise_thunk";t.push(["return function ",r,"(",e.shimArgs.join(","),"){"].join(""));for(var a=[],s=[],o=[["array",e.arrayArgs[0],".shape.slice(",Math.max(0,e.arrayBlockIndices[0]),e.arrayBlockIndices[0]<0?","+e.arrayBlockIndices[0]+")":")"].join("")],l=[],c=[],h=0;h<e.arrayArgs.length;++h){var u=e.arrayArgs[h];n.push(["t",u,"=array",u,".dtype,","r",u,"=array",u,".order"].join("")),a.push("t"+u),a.push("r"+u),s.push("t"+u),s.push("r"+u+".join()"),o.push("array"+u+".data"),o.push("array"+u+".stride"),o.push("array"+u+".offset|0"),h>0&&(l.push("array"+e.arrayArgs[0]+".shape.length===array"+u+".shape.length+"+(Math.abs(e.arrayBlockIndices[0])-Math.abs(e.arrayBlockIndices[h]))),c.push("array"+e.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,e.arrayBlockIndices[0])+"]===array"+u+".shape[shapeIndex+"+Math.max(0,e.arrayBlockIndices[h])+"]"))}for(e.arrayArgs.length>1&&(t.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),t.push("for(var shapeIndex=array"+e.arrayArgs[0]+".shape.length-"+Math.abs(e.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),t.push("if (!("+c.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),t.push("}")),h=0;h<e.scalarArgs.length;++h)o.push("scalar"+e.scalarArgs[h]);return n.push(["type=[",s.join(","),"].join()"].join("")),n.push("proc=CACHED[type]"),t.push("var "+n.join(",")),t.push(["if(!proc){","CACHED[type]=proc=compile([",a.join(","),"])}","return proc(",o.join(","),")}"].join("")),e.debug&&console.log("-----Generated thunk:\n"+t.join("\n")+"\n----------"),new Function("compile",t.join("\n"))(i.bind(void 0,e))}})),mS=K_(((e,t)=>{var i=fS();function n(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}t.exports=function(e){var t=new n;t.pre=e.pre,t.body=e.body,t.post=e.post;var r=e.args.slice(0);t.argTypes=r;for(var a=0;a<r.length;++a){var s=r[a];if("array"===s||"object"==typeof s&&s.blockIndices){if(t.argTypes[a]="array",t.arrayArgs.push(a),t.arrayBlockIndices.push(s.blockIndices?s.blockIndices:0),t.shimArgs.push("array"+a),a<t.pre.args.length&&t.pre.args[a].count>0)throw new Error("cwise: pre() block may not reference array args");if(a<t.post.args.length&&t.post.args[a].count>0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===s)t.scalarArgs.push(a),t.shimArgs.push("scalar"+a);else if("index"===s){if(t.indexArgs.push(a),a<t.pre.args.length&&t.pre.args[a].count>0)throw new Error("cwise: pre() block may not reference array index");if(a<t.body.args.length&&t.body.args[a].lvalue)throw new Error("cwise: body() block may not write to array index");if(a<t.post.args.length&&t.post.args[a].count>0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===s){if(t.shapeArgs.push(a),a<t.pre.args.length&&t.pre.args[a].lvalue)throw new Error("cwise: pre() block may not write to array shape");if(a<t.body.args.length&&t.body.args[a].lvalue)throw new Error("cwise: body() block may not write to array shape");if(a<t.post.args.length&&t.post.args[a].lvalue)throw new Error("cwise: post() block may not write to array shape")}else{if("object"!=typeof s||!s.offset)throw new Error("cwise: Unknown argument type "+r[a]);t.argTypes[a]="offset",t.offsetArgs.push({array:s.array,offset:s.offset}),t.offsetArgIndex.push(a)}}if(t.arrayArgs.length<=0)throw new Error("cwise: No array arguments specified");if(t.pre.args.length>r.length)throw new Error("cwise: Too many arguments in pre() block");if(t.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(t.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return t.debug=!!e.printCode||!!e.debug,t.funcName=e.funcName||"cwise",t.blockSize=e.blockSize||64,i(t)}})),gS=K_((e=>{var t=mS(),i={body:"",args:[],thisVars:[],localVars:[]};function n(e){if(!e)return i;for(var t=0;t<e.args.length;++t){var n=e.args[t];e.args[t]=0===t?{name:n,lvalue:!0,rvalue:!!e.rvalue,count:e.count||1}:{name:n,lvalue:!1,rvalue:!0,count:1}}return e.thisVars||(e.thisVars=[]),e.localVars||(e.localVars=[]),e}function r(e){for(var i=[],r=0;r<e.args.length;++r)i.push("a"+r);return new Function("P",["return function ",e.funcName,"_ndarrayops(",i.join(","),") {P(",i.join(","),");return a0}"].join(""))(function(e){return t({args:e.args,pre:n(e.pre),body:n(e.body),post:n(e.proc),funcName:e.funcName})}(e))}var a={add:"+",sub:"-",mul:"*",div:"/",mod:"%",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"};!function(){for(var t in a){var i=a[t];e[t]=r({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+i+"c"},funcName:t}),e[t+"eq"]=r({args:["array","array"],body:{args:["a","b"],body:"a"+i+"=b"},rvalue:!0,funcName:t+"eq"}),e[t+"s"]=r({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+i+"s"},funcName:t+"s"}),e[t+"seq"]=r({args:["array","scalar"],body:{args:["a","s"],body:"a"+i+"=s"},rvalue:!0,funcName:t+"seq"})}}();var s={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in s){var i=s[t];e[t]=r({args:["array","array"],body:{args:["a","b"],body:"a="+i+"b"},funcName:t}),e[t+"eq"]=r({args:["array"],body:{args:["a"],body:"a="+i+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var o={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in o){var i=o[t];e[t]=r({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+i+"c"},funcName:t}),e[t+"s"]=r({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+i+"s"},funcName:t+"s"}),e[t+"eq"]=r({args:["array","array"],body:{args:["a","b"],body:"a=a"+i+"b"},rvalue:!0,count:2,funcName:t+"eq"}),e[t+"seq"]=r({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+i+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var l=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;t<l.length;++t){var i=l[t];e[i]=r({args:["array","array"],pre:{args:[],body:"this_f=Math."+i,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b)",thisVars:["this_f"]},funcName:i}),e[i+"eq"]=r({args:["array"],pre:{args:[],body:"this_f=Math."+i,thisVars:["this_f"]},body:{args:["a"],body:"a=this_f(a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:i+"eq"})}}();var c=["max","min","atan2","pow"];!function(){for(var t=0;t<c.length;++t){var i=c[t];e[i]=r({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+i,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:i}),e[i+"s"]=r({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+i,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:i+"s"}),e[i+"eq"]=r({args:["array","array"],pre:{args:[],body:"this_f=Math."+i,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:i+"eq"}),e[i+"seq"]=r({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+i,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:i+"seq"})}}();var h=["atan2","pow"];!function(){for(var t=0;t<h.length;++t){var i=h[t];e[i+"op"]=r({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+i,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:i+"op"}),e[i+"ops"]=r({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+i,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:i+"ops"}),e[i+"opeq"]=r({args:["array","array"],pre:{args:[],body:"this_f=Math."+i,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:i+"opeq"}),e[i+"opseq"]=r({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+i,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:i+"opseq"})}}(),e.any=t({args:["array"],pre:i,body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"if(a){return true}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return false"},funcName:"any"}),e.all=t({args:["array"],pre:i,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1}],body:"if(!x){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"all"}),e.sum=t({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s+=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"sum"}),e.prod=t({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=1"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s*=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"prod"}),e.norm2squared=t({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm2squared"}),e.norm2=t({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return Math.sqrt(this_s)"},funcName:"norm2"}),e.norminf=t({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:4}],body:"if(-a>this_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),e.norm1=t({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),e.sup=t({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),e.inf=t({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_<this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),e.argmin=t({args:["index","array","shape"],pre:{body:"{this_v=Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_<this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),e.argmax=t({args:["index","array","shape"],pre:{body:"{this_v=-Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_>this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),e.random=r({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),e.assign=r({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),e.assigns=r({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),e.equals=t({args:["array","array"],pre:i,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})})),vS=K_(((e,t)=>{t.exports=function(e,t){for(var i=e.split("."),n=t.split("."),r=0;r<3;r++){var a=Number(i[r]),s=Number(n[r]);if(a>s)return 1;if(s>a)return-1;if(!isNaN(a)&&isNaN(s))return 1;if(isNaN(a)&&!isNaN(s))return-1}return 0}})),yS="149",bS=0,xS=1,wS=2,_S=3,SS=0,ES=1,CS=2,AS=1,MS=2,TS=3,PS=0,DS=1,kS=2,OS=0,IS=1,RS=2,LS=3,BS=4,zS=5,NS=100,FS=101,jS=102,VS=103,US=104,GS=200,HS=201,WS=202,qS=203,XS=204,YS=205,QS=206,ZS=207,KS=208,JS=209,$S=210,eE=0,tE=1,iE=2,nE=3,rE=4,aE=5,sE=6,oE=7,lE=0,cE=1,hE=2,uE=0,dE=1,pE=2,fE=3,mE=4,gE=5,vE=301,yE=302,bE=303,xE=304,wE=306,_E=1e3,SE=1001,EE=1002,CE=1003,AE=1004,ME=1005,TE=1006,PE=1007,DE=1008,kE=1009,OE=1010,IE=1011,RE=1012,LE=1013,BE=1014,zE=1015,NE=1016,FE=1017,jE=1018,VE=1020,UE=1021,GE=1023,HE=1024,WE=1025,qE=1026,XE=1027,YE=1028,QE=1029,ZE=1030,KE=1031,JE=1033,$E=33776,eC=33777,tC=33778,iC=33779,nC=35840,rC=35841,aC=35842,sC=35843,oC=36196,lC=37492,cC=37496,hC=37808,uC=37809,dC=37810,pC=37811,fC=37812,mC=37813,gC=37814,vC=37815,yC=37816,bC=37817,xC=37818,wC=37819,_C=37820,SC=37821,EC=36492,CC=36283,AC=36284,MC=36285,TC=36286,PC=2202,DC=2300,kC=2301,OC=2302,IC=2400,RC=2401,LC=2402,BC=2500,zC=3e3,NC=3001,FC=3200,jC=3201,VC=0,UC=1,GC="srgb",HC="srgb-linear",WC=7680,qC=35044,XC="300 es",YC=1035,QC=class{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&i[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;let i=this._listeners;return void 0!==i[e]&&-1!==i[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;let i=this._listeners[e];if(void 0!==i){let e=i.indexOf(t);-1!==e&&i.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;let t=this._listeners[e.type];if(void 0!==t){e.target=this;let i=t.slice(0);for(let t=0,n=i.length;t<n;t++)i[t].call(this,e);e.target=null}}},ZC=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],KC=1234567,JC=Math.PI/180,$C=180/Math.PI;function eA(){let e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(ZC[255&e]+ZC[e>>8&255]+ZC[e>>16&255]+ZC[e>>24&255]+"-"+ZC[255&t]+ZC[t>>8&255]+"-"+ZC[t>>16&15|64]+ZC[t>>24&255]+"-"+ZC[63&i|128]+ZC[i>>8&255]+"-"+ZC[i>>16&255]+ZC[i>>24&255]+ZC[255&n]+ZC[n>>8&255]+ZC[n>>16&255]+ZC[n>>24&255]).toLowerCase()}function tA(e,t,i){return Math.max(t,Math.min(i,e))}function iA(e,t){return(e%t+t)%t}function nA(e,t,i){return(1-i)*e+i*t}function rA(e){return 0===(e&e-1)&&0!==e}function aA(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function sA(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function oA(e,t){switch(t.constructor){case Float32Array:return e;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function lA(e,t){switch(t.constructor){case Float32Array:return e;case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("Invalid component type.")}}var cA=Object.freeze({__proto__:null,DEG2RAD:JC,RAD2DEG:$C,ceilPowerOfTwo:aA,clamp:tA,damp:function(e,t,i,n){return nA(e,t,1-Math.exp(-i*n))},degToRad:function(e){return e*JC},denormalize:oA,euclideanModulo:iA,floorPowerOfTwo:sA,generateUUID:eA,inverseLerp:function(e,t,i){return e!==t?(i-e)/(t-e):0},isPowerOfTwo:rA,lerp:nA,mapLinear:function(e,t,i,n,r){return n+(e-t)*(r-n)/(i-t)},normalize:lA,pingpong:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t-Math.abs(iA(e,2*t)-t)},radToDeg:function(e){return e*$C},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},seededRandom:function(e){void 0!==e&&(KC=e);let t=KC+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296},setQuaternionFromProperEuler:function(e,t,i,n,r){let a=Math.cos,s=Math.sin,o=a(i/2),l=s(i/2),c=a((t+n)/2),h=s((t+n)/2),u=a((t-n)/2),d=s((t-n)/2),p=a((n-t)/2),f=s((n-t)/2);switch(r){case"XYX":e.set(o*h,l*u,l*d,o*c);break;case"YZY":e.set(l*d,o*h,l*u,o*c);break;case"ZXZ":e.set(l*u,l*d,o*h,o*c);break;case"XZX":e.set(o*h,l*f,l*p,o*c);break;case"YXY":e.set(l*p,o*h,l*f,o*c);break;case"ZYZ":e.set(l*f,l*p,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},smootherstep:function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*e*(e*(6*e-15)+10)},smoothstep:function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*(3-2*e)}}),hA=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;hA.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,i=this.y,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6],this.y=n[1]*t+n[4]*i+n[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let i=Math.cos(t),n=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*i-a*n+e.x,this.y=r*n+a*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},uA=class{constructor(){uA.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(e,t,i,n,r,a,s,o,l){let c=this.elements;return c[0]=e,c[1]=n,c[2]=s,c[3]=t,c[4]=r,c[5]=o,c[6]=i,c[7]=a,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,n=t.elements,r=this.elements,a=i[0],s=i[3],o=i[6],l=i[1],c=i[4],h=i[7],u=i[2],d=i[5],p=i[8],f=n[0],m=n[3],g=n[6],v=n[1],y=n[4],b=n[7],x=n[2],w=n[5],_=n[8];return r[0]=a*f+s*v+o*x,r[3]=a*m+s*y+o*w,r[6]=a*g+s*b+o*_,r[1]=l*f+c*v+h*x,r[4]=l*m+c*y+h*w,r[7]=l*g+c*b+h*_,r[2]=u*f+d*v+p*x,r[5]=u*m+d*y+p*w,r[8]=u*g+d*b+p*_,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],c=e[8];return t*a*c-t*s*l-i*r*c+i*s*o+n*r*l-n*a*o}invert(){let e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],c=e[8],h=c*a-s*l,u=s*o-c*r,d=l*r-a*o,p=t*h+i*u+n*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);let f=1/p;return e[0]=h*f,e[1]=(n*l-c*i)*f,e[2]=(s*i-n*a)*f,e[3]=u*f,e[4]=(c*t-n*o)*f,e[5]=(n*r-s*t)*f,e[6]=d*f,e[7]=(i*o-l*t)*f,e[8]=(a*t-i*r)*f,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,n,r,a,s){let o=Math.cos(r),l=Math.sin(r);return this.set(i*o,i*l,-i*(o*a+l*s)+a+e,-n*l,n*o,-n*(-l*a+o*s)+s+t,0,0,1),this}scale(e,t){return this.premultiply(dA.makeScale(e,t)),this}rotate(e){return this.premultiply(dA.makeRotation(-e)),this}translate(e,t){return this.premultiply(dA.makeTranslation(e,t)),this}makeTranslation(e,t){return this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,i=e.elements;for(let n=0;n<9;n++)if(t[n]!==i[n])return!1;return!0}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return(new this.constructor).fromArray(this.elements)}},dA=new uA;function pA(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}var fA={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function mA(e,t){return new fA[e](t)}function gA(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function vA(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function yA(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}var bA={[GC]:{[HC]:vA},[HC]:{[GC]:yA}},xA={legacyMode:!0,get workingColorSpace(){return HC},set workingColorSpace(e){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(e,t,i){if(this.legacyMode||t===i||!t||!i)return e;if(bA[t]&&void 0!==bA[t][i]){let n=bA[t][i];return e.r=n(e.r),e.g=n(e.g),e.b=n(e.b),e}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this.workingColorSpace)}},wA={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},_A={r:0,g:0,b:0},SA={h:0,s:0,l:0},EA={h:0,s:0,l:0};function CA(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+6*(t-e)*(2/3-i):e}function AA(e,t){return t.r=e.r,t.g=e.g,t.b=e.b,t}var MA=class{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,void 0===t&&void 0===i?this.set(e):this.setRGB(e,t,i)}set(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:GC;return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,xA.toWorkingColorSpace(this,t),this}setRGB(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:xA.workingColorSpace;return this.r=e,this.g=t,this.b=i,xA.toWorkingColorSpace(this,n),this}setHSL(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:xA.workingColorSpace;if(e=iA(e,1),t=tA(t,0,1),i=tA(i,0,1),0===t)this.r=this.g=this.b=i;else{let n=i<=.5?i*(1+t):i+t-i*t,r=2*i-n;this.r=CA(r,n,e+1/3),this.g=CA(r,n,e),this.b=CA(r,n,e-1/3)}return xA.toWorkingColorSpace(this,n),this}setStyle(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:GC;function n(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}if(t=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let e,r=t[1],a=t[2];switch(r){case"rgb":case"rgba":if(e=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(e[1],10))/255,this.g=Math.min(255,parseInt(e[2],10))/255,this.b=Math.min(255,parseInt(e[3],10))/255,xA.toWorkingColorSpace(this,i),n(e[4]),this;if(e=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(e[1],10))/100,this.g=Math.min(100,parseInt(e[2],10))/100,this.b=Math.min(100,parseInt(e[3],10))/100,xA.toWorkingColorSpace(this,i),n(e[4]),this;break;case"hsl":case"hsla":if(e=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)){let t=parseFloat(e[1])/360,r=parseFloat(e[2])/100,a=parseFloat(e[3])/100;return n(e[4]),this.setHSL(t,r,a,i)}}}else if(t=/^\#([A-Fa-f\d]+)$/.exec(e)){let e=t[1],n=e.length;if(3===n)return this.r=parseInt(e.charAt(0)+e.charAt(0),16)/255,this.g=parseInt(e.charAt(1)+e.charAt(1),16)/255,this.b=parseInt(e.charAt(2)+e.charAt(2),16)/255,xA.toWorkingColorSpace(this,i),this;if(6===n)return this.r=parseInt(e.charAt(0)+e.charAt(1),16)/255,this.g=parseInt(e.charAt(2)+e.charAt(3),16)/255,this.b=parseInt(e.charAt(4)+e.charAt(5),16)/255,xA.toWorkingColorSpace(this,i),this}return e&&e.length>0?this.setColorName(e,i):this}setColorName(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:GC,i=wA[e.toLowerCase()];return void 0!==i?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=vA(e.r),this.g=vA(e.g),this.b=vA(e.b),this}copyLinearToSRGB(e){return this.r=yA(e.r),this.g=yA(e.g),this.b=yA(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:GC;return xA.fromWorkingColorSpace(AA(this,_A),e),tA(255*_A.r,0,255)<<16^tA(255*_A.g,0,255)<<8^tA(255*_A.b,0,255)<<0}getHexString(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:GC;return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xA.workingColorSpace;xA.fromWorkingColorSpace(AA(this,_A),t);let i,n,r=_A.r,a=_A.g,s=_A.b,o=Math.max(r,a,s),l=Math.min(r,a,s),c=(l+o)/2;if(l===o)i=0,n=0;else{let e=o-l;switch(n=c<=.5?e/(o+l):e/(2-o-l),o){case r:i=(a-s)/e+(a<s?6:0);break;case a:i=(s-r)/e+2;break;case s:i=(r-a)/e+4}i/=6}return e.h=i,e.s=n,e.l=c,e}getRGB(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xA.workingColorSpace;return xA.fromWorkingColorSpace(AA(this,_A),t),e.r=_A.r,e.g=_A.g,e.b=_A.b,e}getStyle(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:GC;return xA.fromWorkingColorSpace(AA(this,_A),e),e!==GC?"color(".concat(e," ").concat(_A.r," ").concat(_A.g," ").concat(_A.b,")"):"rgb(".concat(255*_A.r|0,",").concat(255*_A.g|0,",").concat(255*_A.b|0,")")}offsetHSL(e,t,i){return this.getHSL(SA),SA.h+=e,SA.s+=t,SA.l+=i,this.setHSL(SA.h,SA.s,SA.l),this}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(SA),e.getHSL(EA);let i=nA(SA.h,EA.h,t),n=nA(SA.s,EA.s,t),r=nA(SA.l,EA.l,t);return this.setHSL(i,n,r),this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};MA.NAMES=wA;var TA,PA=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===TA&&(TA=gA("canvas")),TA.width=e.width,TA.height=e.height;let i=TA.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=TA}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=gA("canvas");t.width=e.width,t.height=e.height;let i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);let n=i.getImageData(0,0,e.width,e.height),r=n.data;for(let e=0;e<r.length;e++)r[e]=255*vA(r[e]/255);return i.putImageData(n,0,0),t}if(e.data){let t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(255*vA(t[e]/255)):t[e]=vA(t[e]);return{data:t,width:e.width,height:e.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}},DA=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.isSource=!0,this.uuid=eA(),this.data=e,this.version=0}set needsUpdate(e){!0===e&&this.version++}toJSON(e){let t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];let i={uuid:this.uuid,url:""},n=this.data;if(null!==n){let e;if(Array.isArray(n)){e=[];for(let t=0,i=n.length;t<i;t++)n[t].isDataTexture?e.push(kA(n[t].image)):e.push(kA(n[t]))}else e=kA(n);i.url=e}return t||(e.images[this.uuid]=i),i}};function kA(e){return typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap?PA.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var OA=0,IA=class extends QC{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:IA.DEFAULT_IMAGE,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:IA.DEFAULT_MAPPING,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:SE,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:SE,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:TE,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:DE,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:GE,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:kE,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:IA.DEFAULT_ANISOTROPY,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:zC;super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:OA++}),this.uuid=eA(),this.name="",this.source=new DA(e),this.mipmaps=[],this.mapping=t,this.wrapS=i,this.wrapT=n,this.magFilter=r,this.minFilter=a,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=o,this.offset=new hA(0,0),this.repeat=new hA(1,1),this.center=new hA(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new uA,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=c,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){let t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];let i={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case _E:e.x=e.x-Math.floor(e.x);break;case SE:e.x=e.x<0?0:1;break;case EE:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case _E:e.y=e.y-Math.floor(e.y);break;case SE:e.y=e.y<0?0:1;break;case EE:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}};IA.DEFAULT_IMAGE=null,IA.DEFAULT_MAPPING=300,IA.DEFAULT_ANISOTROPY=1;var RA=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;RA.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=n}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,i=this.y,n=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*n+a[12]*r,this.y=a[1]*t+a[5]*i+a[9]*n+a[13]*r,this.z=a[2]*t+a[6]*i+a[10]*n+a[14]*r,this.w=a[3]*t+a[7]*i+a[11]*n+a[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,n,r,a=e.elements,s=a[0],o=a[4],l=a[8],c=a[1],h=a[5],u=a[9],d=a[2],p=a[6],f=a[10];if(Math.abs(o-c)<.01&&Math.abs(l-d)<.01&&Math.abs(u-p)<.01){if(Math.abs(o+c)<.1&&Math.abs(l+d)<.1&&Math.abs(u+p)<.1&&Math.abs(s+h+f-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;let e=(s+1)/2,a=(h+1)/2,m=(f+1)/2,g=(o+c)/4,v=(l+d)/4,y=(u+p)/4;return e>a&&e>m?e<.01?(i=0,n=.707106781,r=.707106781):(i=Math.sqrt(e),n=g/i,r=v/i):a>m?a<.01?(i=.707106781,n=0,r=.707106781):(n=Math.sqrt(a),i=g/n,r=y/n):m<.01?(i=.707106781,n=.707106781,r=0):(r=Math.sqrt(m),i=v/r,n=y/r),this.set(i,n,r,t),this}let m=Math.sqrt((p-u)*(p-u)+(l-d)*(l-d)+(c-o)*(c-o));return Math.abs(m)<.001&&(m=1),this.x=(p-u)/m,this.y=(l-d)/m,this.z=(c-o)/m,this.w=Math.acos((s+h+f-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},LA=class extends QC{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new RA(0,0,e,t),this.scissorTest=!1,this.viewport=new RA(0,0,e,t);let n={width:e,height:t,depth:1};this.texture=new IA(n,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=void 0!==i.generateMipmaps&&i.generateMipmaps,this.texture.internalFormat=void 0!==i.internalFormat?i.internalFormat:null,this.texture.minFilter=void 0!==i.minFilter?i.minFilter:TE,this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0!==i.stencilBuffer&&i.stencilBuffer,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null,this.samples=void 0!==i.samples?i.samples:0}setSize(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;(this.width!==e||this.height!==t||this.depth!==i)&&(this.width=e,this.height=t,this.depth=i,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;let t=Object.assign({},e.texture.image);return this.texture.source=new DA(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}},BA=class extends IA{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:n},this.magFilter=CE,this.minFilter=CE,this.wrapR=SE,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},zA=class extends LA{constructor(){let e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}),this.isWebGLMultipleRenderTargets=!0;let t=this.texture;this.texture=[];for(let i=0;i<e;i++)this.texture[i]=t.clone(),this.texture[i].isRenderTargetTexture=!0}setSize(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let n=0,r=this.texture.length;n<r;n++)this.texture[n].image.width=e,this.texture[n].image.height=t,this.texture[n].image.depth=i;this.dispose()}return this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t),this}copy(e){this.dispose(),this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.texture.length=0;for(let t=0,i=e.texture.length;t<i;t++)this.texture[t]=e.texture[t].clone(),this.texture[t].isRenderTargetTexture=!0;return this}},NA=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=n}static slerpFlat(e,t,i,n,r,a,s){let o=i[n+0],l=i[n+1],c=i[n+2],h=i[n+3],u=r[a+0],d=r[a+1],p=r[a+2],f=r[a+3];if(0===s)return e[t+0]=o,e[t+1]=l,e[t+2]=c,void(e[t+3]=h);if(1===s)return e[t+0]=u,e[t+1]=d,e[t+2]=p,void(e[t+3]=f);if(h!==f||o!==u||l!==d||c!==p){let e=1-s,t=o*u+l*d+c*p+h*f,i=t>=0?1:-1,n=1-t*t;if(n>Number.EPSILON){let r=Math.sqrt(n),a=Math.atan2(r,t*i);e=Math.sin(e*a)/r,s=Math.sin(s*a)/r}let r=s*i;if(o=o*e+u*r,l=l*e+d*r,c=c*e+p*r,h=h*e+f*r,e===1-s){let e=1/Math.sqrt(o*o+l*l+c*c+h*h);o*=e,l*=e,c*=e,h*=e}}e[t]=o,e[t+1]=l,e[t+2]=c,e[t+3]=h}static multiplyQuaternionsFlat(e,t,i,n,r,a){let s=i[n],o=i[n+1],l=i[n+2],c=i[n+3],h=r[a],u=r[a+1],d=r[a+2],p=r[a+3];return e[t]=s*p+c*h+o*d-l*u,e[t+1]=o*p+c*u+l*h-s*d,e[t+2]=l*p+c*d+s*u-o*h,e[t+3]=c*p-s*h-o*u-l*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){let i=e._x,n=e._y,r=e._z,a=e._order,s=Math.cos,o=Math.sin,l=s(i/2),c=s(n/2),h=s(r/2),u=o(i/2),d=o(n/2),p=o(r/2);switch(a){case"XYZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"YXZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"ZXY":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"ZYX":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"YZX":this._x=u*c*h+l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h-u*d*p;break;case"XZY":this._x=u*c*h-l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h+u*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let i=t/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,i=t[0],n=t[4],r=t[8],a=t[1],s=t[5],o=t[9],l=t[2],c=t[6],h=t[10],u=i+s+h;if(u>0){let e=.5/Math.sqrt(u+1);this._w=.25/e,this._x=(c-o)*e,this._y=(r-l)*e,this._z=(a-n)*e}else if(i>s&&i>h){let e=2*Math.sqrt(1+i-s-h);this._w=(c-o)/e,this._x=.25*e,this._y=(n+a)/e,this._z=(r+l)/e}else if(s>h){let e=2*Math.sqrt(1+s-i-h);this._w=(r-l)/e,this._x=(n+a)/e,this._y=.25*e,this._z=(o+c)/e}else{let e=2*Math.sqrt(1+h-i-s);this._w=(a-n)/e,this._x=(r+l)/e,this._y=(o+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<Number.EPSILON?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(tA(this.dot(e),-1,1)))}rotateTowards(e,t){let i=this.angleTo(e);if(0===i)return this;let n=Math.min(1,t/i);return this.slerp(e,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let i=e._x,n=e._y,r=e._z,a=e._w,s=t._x,o=t._y,l=t._z,c=t._w;return this._x=i*c+a*s+n*l-r*o,this._y=n*c+a*o+r*s-i*l,this._z=r*c+a*l+i*o-n*s,this._w=a*c-i*s-n*o-r*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);let i=this._x,n=this._y,r=this._z,a=this._w,s=a*e._w+i*e._x+n*e._y+r*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=a,this._x=i,this._y=n,this._z=r,this;let o=1-s*s;if(o<=Number.EPSILON){let e=1-t;return this._w=e*a+t*this._w,this._x=e*i+t*this._x,this._y=e*n+t*this._y,this._z=e*r+t*this._z,this.normalize(),this._onChangeCallback(),this}let l=Math.sqrt(o),c=Math.atan2(l,s),h=Math.sin((1-t)*c)/l,u=Math.sin(t*c)/l;return this._w=a*h+this._w*u,this._x=i*h+this._x*u,this._y=n*h+this._y*u,this._z=r*h+this._z*u,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){let e=Math.random(),t=Math.sqrt(1-e),i=Math.sqrt(e),n=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(t*Math.cos(n),i*Math.sin(r),i*Math.cos(r),t*Math.sin(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},FA=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;FA.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return void 0===i&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(VA.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(VA.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,i=this.y,n=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*n,this.y=r[1]*t+r[4]*i+r[7]*n,this.z=r[2]*t+r[5]*i+r[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,i=this.y,n=this.z,r=e.elements,a=1/(r[3]*t+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*n+r[12])*a,this.y=(r[1]*t+r[5]*i+r[9]*n+r[13])*a,this.z=(r[2]*t+r[6]*i+r[10]*n+r[14])*a,this}applyQuaternion(e){let t=this.x,i=this.y,n=this.z,r=e.x,a=e.y,s=e.z,o=e.w,l=o*t+a*n-s*i,c=o*i+s*t-r*n,h=o*n+r*i-a*t,u=-r*t-a*i-s*n;return this.x=l*o+u*-r+c*-s-h*-a,this.y=c*o+u*-a+h*-r-l*-s,this.z=h*o+u*-s+l*-a-c*-r,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,i=this.y,n=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*n,this.y=r[1]*t+r[5]*i+r[9]*n,this.z=r[2]*t+r[6]*i+r[10]*n,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let i=e.x,n=e.y,r=e.z,a=t.x,s=t.y,o=t.z;return this.x=n*o-r*s,this.y=r*a-i*o,this.z=i*s-n*a,this}projectOnVector(e){let t=e.lengthSq();if(0===t)return this.set(0,0,0);let i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return jA.copy(this).projectOnVector(e),this.sub(jA)}reflect(e){return this.sub(jA.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;let i=this.dot(e)/t;return Math.acos(tA(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){let n=Math.sin(t)*e;return this.x=n*Math.sin(i),this.y=Math.cos(t)*e,this.z=n*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=n,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=2*(Math.random()-.5),t=Math.random()*Math.PI*2,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(t),this.y=i*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},jA=new FA,VA=new NA,UA=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new FA(1/0,1/0,1/0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new FA(-1/0,-1/0,-1/0);this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,i=1/0,n=1/0,r=-1/0,a=-1/0,s=-1/0;for(let o=0,l=e.length;o<l;o+=3){let l=e[o],c=e[o+1],h=e[o+2];l<t&&(t=l),c<i&&(i=c),h<n&&(n=h),l>r&&(r=l),c>a&&(a=c),h>s&&(s=h)}return this.min.set(t,i,n),this.max.set(r,a,s),this}setFromBufferAttribute(e){let t=1/0,i=1/0,n=1/0,r=-1/0,a=-1/0,s=-1/0;for(let o=0,l=e.count;o<l;o++){let l=e.getX(o),c=e.getY(o),h=e.getZ(o);l<t&&(t=l),c<i&&(i=c),h<n&&(n=h),l>r&&(r=l),c>a&&(a=c),h>s&&(s=h)}return this.min.set(t,i,n),this.max.set(r,a,s),this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let i=HA.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.makeEmpty(),this.expandByObject(e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.updateWorldMatrix(!1,!1);let i=e.geometry;if(void 0!==i)if(t&&null!=i.attributes&&void 0!==i.attributes.position){let t=i.attributes.position;for(let i=0,n=t.count;i<n;i++)HA.fromBufferAttribute(t,i).applyMatrix4(e.matrixWorld),this.expandByPoint(HA)}else null===i.boundingBox&&i.computeBoundingBox(),WA.copy(i.boundingBox),WA.applyMatrix4(e.matrixWorld),this.union(WA);let n=e.children;for(let r=0,a=n.length;r<a;r++)this.expandByObject(n[r],t);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,HA),HA.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(JA),$A.subVectors(this.max,JA),qA.subVectors(e.a,JA),XA.subVectors(e.b,JA),YA.subVectors(e.c,JA),QA.subVectors(XA,qA),ZA.subVectors(YA,XA),KA.subVectors(qA,YA);let t=[0,-QA.z,QA.y,0,-ZA.z,ZA.y,0,-KA.z,KA.y,QA.z,0,-QA.x,ZA.z,0,-ZA.x,KA.z,0,-KA.x,-QA.y,QA.x,0,-ZA.y,ZA.x,0,-KA.y,KA.x,0];return!(!iM(t,qA,XA,YA,$A)||(t=[1,0,0,0,1,0,0,0,1],!iM(t,qA,XA,YA,$A)))&&(eM.crossVectors(QA,ZA),t=[eM.x,eM.y,eM.z],iM(t,qA,XA,YA,$A))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return HA.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=.5*this.getSize(HA).length(),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(GA[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),GA[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),GA[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),GA[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),GA[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),GA[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),GA[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),GA[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(GA)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}},GA=[new FA,new FA,new FA,new FA,new FA,new FA,new FA,new FA],HA=new FA,WA=new UA,qA=new FA,XA=new FA,YA=new FA,QA=new FA,ZA=new FA,KA=new FA,JA=new FA,$A=new FA,eM=new FA,tM=new FA;function iM(e,t,i,n,r){for(let a=0,s=e.length-3;a<=s;a+=3){tM.fromArray(e,a);let s=r.x*Math.abs(tM.x)+r.y*Math.abs(tM.y)+r.z*Math.abs(tM.z),o=t.dot(tM),l=i.dot(tM),c=n.dot(tM);if(Math.max(-Math.max(o,l,c),Math.min(o,l,c))>s)return!1}return!0}var nM=new UA,rM=new FA,aM=new FA,sM=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new FA,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let i=this.center;void 0!==t?i.copy(t):nM.setFromPoints(e).getCenter(i);let n=0;for(let r=0,a=e.length;r<a;r++)n=Math.max(n,i.distanceToSquared(e[r]));return this.radius=Math.sqrt(n),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){let t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){let i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;rM.subVectors(e,this.center);let t=rM.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),i=.5*(e-this.radius);this.center.addScaledVector(rM,i/e),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(aM.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(rM.copy(e.center).add(aM)),this.expandByPoint(rM.copy(e.center).sub(aM))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}},oM=new FA,lM=new FA,cM=new FA,hM=new FA,uM=new FA,dM=new FA,pM=new FA,fM=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new FA,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new FA(0,0,-1);this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,oM)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(i).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=oM.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(oM.copy(this.direction).multiplyScalar(t).add(this.origin),oM.distanceToSquared(e))}distanceSqToSegment(e,t,i,n){lM.copy(e).add(t).multiplyScalar(.5),cM.copy(t).sub(e).normalize(),hM.copy(this.origin).sub(lM);let r,a,s,o,l=.5*e.distanceTo(t),c=-this.direction.dot(cM),h=hM.dot(this.direction),u=-hM.dot(cM),d=hM.lengthSq(),p=Math.abs(1-c*c);if(p>0)if(r=c*u-h,a=c*h-u,o=l*p,r>=0)if(a>=-o)if(a<=o){let e=1/p;r*=e,a*=e,s=r*(r+c*a+2*h)+a*(c*r+a+2*u)+d}else a=l,r=Math.max(0,-(c*a+h)),s=-r*r+a*(a+2*u)+d;else a=-l,r=Math.max(0,-(c*a+h)),s=-r*r+a*(a+2*u)+d;else a<=-o?(r=Math.max(0,-(-c*l+h)),a=r>0?-l:Math.min(Math.max(-l,-u),l),s=-r*r+a*(a+2*u)+d):a<=o?(r=0,a=Math.min(Math.max(-l,-u),l),s=a*(a+2*u)+d):(r=Math.max(0,-(c*l+h)),a=r>0?l:Math.min(Math.max(-l,-u),l),s=-r*r+a*(a+2*u)+d);else a=c>0?-l:l,r=Math.max(0,-(c*a+h)),s=-r*r+a*(a+2*u)+d;return i&&i.copy(this.direction).multiplyScalar(r).add(this.origin),n&&n.copy(cM).multiplyScalar(a).add(lM),s}intersectSphere(e,t){oM.subVectors(e.center,this.origin);let i=oM.dot(this.direction),n=oM.dot(oM)-i*i,r=e.radius*e.radius;if(n>r)return null;let a=Math.sqrt(r-n),s=i-a,o=i+a;return s<0&&o<0?null:s<0?this.at(o,t):this.at(s,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;let i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){let i=this.distanceToPlane(e);return null===i?null:this.at(i,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,n,r,a,s,o,l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(i=(e.min.x-u.x)*l,n=(e.max.x-u.x)*l):(i=(e.max.x-u.x)*l,n=(e.min.x-u.x)*l),c>=0?(r=(e.min.y-u.y)*c,a=(e.max.y-u.y)*c):(r=(e.max.y-u.y)*c,a=(e.min.y-u.y)*c),i>a||r>n||((r>i||isNaN(i))&&(i=r),(a<n||isNaN(n))&&(n=a),h>=0?(s=(e.min.z-u.z)*h,o=(e.max.z-u.z)*h):(s=(e.max.z-u.z)*h,o=(e.min.z-u.z)*h),i>o||s>n)||((s>i||i!==i)&&(i=s),(o<n||n!==n)&&(n=o),n<0)?null:this.at(i>=0?i:n,t)}intersectsBox(e){return null!==this.intersectBox(e,oM)}intersectTriangle(e,t,i,n,r){uM.subVectors(t,e),dM.subVectors(i,e),pM.crossVectors(uM,dM);let a,s=this.direction.dot(pM);if(s>0){if(n)return null;a=1}else{if(!(s<0))return null;a=-1,s=-s}hM.subVectors(this.origin,e);let o=a*this.direction.dot(dM.crossVectors(hM,dM));if(o<0)return null;let l=a*this.direction.dot(uM.cross(hM));if(l<0||o+l>s)return null;let c=-a*hM.dot(pM);return c<0?null:this.at(c/s,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}},mM=class{constructor(){mM.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(e,t,i,n,r,a,s,o,l,c,h,u,d,p,f,m){let g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=n,g[1]=r,g[5]=a,g[9]=s,g[13]=o,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new mM).fromArray(this.elements)}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){let t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,i=e.elements,n=1/gM.setFromMatrixColumn(e,0).length(),r=1/gM.setFromMatrixColumn(e,1).length(),a=1/gM.setFromMatrixColumn(e,2).length();return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*a,t[9]=i[9]*a,t[10]=i[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,i=e.x,n=e.y,r=e.z,a=Math.cos(i),s=Math.sin(i),o=Math.cos(n),l=Math.sin(n),c=Math.cos(r),h=Math.sin(r);if("XYZ"===e.order){let e=a*c,i=a*h,n=s*c,r=s*h;t[0]=o*c,t[4]=-o*h,t[8]=l,t[1]=i+n*l,t[5]=e-r*l,t[9]=-s*o,t[2]=r-e*l,t[6]=n+i*l,t[10]=a*o}else if("YXZ"===e.order){let e=o*c,i=o*h,n=l*c,r=l*h;t[0]=e+r*s,t[4]=n*s-i,t[8]=a*l,t[1]=a*h,t[5]=a*c,t[9]=-s,t[2]=i*s-n,t[6]=r+e*s,t[10]=a*o}else if("ZXY"===e.order){let e=o*c,i=o*h,n=l*c,r=l*h;t[0]=e-r*s,t[4]=-a*h,t[8]=n+i*s,t[1]=i+n*s,t[5]=a*c,t[9]=r-e*s,t[2]=-a*l,t[6]=s,t[10]=a*o}else if("ZYX"===e.order){let e=a*c,i=a*h,n=s*c,r=s*h;t[0]=o*c,t[4]=n*l-i,t[8]=e*l+r,t[1]=o*h,t[5]=r*l+e,t[9]=i*l-n,t[2]=-l,t[6]=s*o,t[10]=a*o}else if("YZX"===e.order){let e=a*o,i=a*l,n=s*o,r=s*l;t[0]=o*c,t[4]=r-e*h,t[8]=n*h+i,t[1]=h,t[5]=a*c,t[9]=-s*c,t[2]=-l*c,t[6]=i*h+n,t[10]=e-r*h}else if("XZY"===e.order){let e=a*o,i=a*l,n=s*o,r=s*l;t[0]=o*c,t[4]=-h,t[8]=l*c,t[1]=e*h+r,t[5]=a*c,t[9]=i*h-n,t[2]=n*h-i,t[6]=s*c,t[10]=r*h+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(yM,e,bM)}lookAt(e,t,i){let n=this.elements;return _M.subVectors(e,t),0===_M.lengthSq()&&(_M.z=1),_M.normalize(),xM.crossVectors(i,_M),0===xM.lengthSq()&&(1===Math.abs(i.z)?_M.x+=1e-4:_M.z+=1e-4,_M.normalize(),xM.crossVectors(i,_M)),xM.normalize(),wM.crossVectors(_M,xM),n[0]=xM.x,n[4]=wM.x,n[8]=_M.x,n[1]=xM.y,n[5]=wM.y,n[9]=_M.y,n[2]=xM.z,n[6]=wM.z,n[10]=_M.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,n=t.elements,r=this.elements,a=i[0],s=i[4],o=i[8],l=i[12],c=i[1],h=i[5],u=i[9],d=i[13],p=i[2],f=i[6],m=i[10],g=i[14],v=i[3],y=i[7],b=i[11],x=i[15],w=n[0],_=n[4],S=n[8],E=n[12],C=n[1],A=n[5],M=n[9],T=n[13],P=n[2],D=n[6],k=n[10],O=n[14],I=n[3],R=n[7],L=n[11],B=n[15];return r[0]=a*w+s*C+o*P+l*I,r[4]=a*_+s*A+o*D+l*R,r[8]=a*S+s*M+o*k+l*L,r[12]=a*E+s*T+o*O+l*B,r[1]=c*w+h*C+u*P+d*I,r[5]=c*_+h*A+u*D+d*R,r[9]=c*S+h*M+u*k+d*L,r[13]=c*E+h*T+u*O+d*B,r[2]=p*w+f*C+m*P+g*I,r[6]=p*_+f*A+m*D+g*R,r[10]=p*S+f*M+m*k+g*L,r[14]=p*E+f*T+m*O+g*B,r[3]=v*w+y*C+b*P+x*I,r[7]=v*_+y*A+b*D+x*R,r[11]=v*S+y*M+b*k+x*L,r[15]=v*E+y*T+b*O+x*B,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[4],n=e[8],r=e[12],a=e[1],s=e[5],o=e[9],l=e[13],c=e[2],h=e[6],u=e[10],d=e[14];return e[3]*(+r*o*h-n*l*h-r*s*u+i*l*u+n*s*d-i*o*d)+e[7]*(+t*o*d-t*l*u+r*a*u-n*a*d+n*l*c-r*o*c)+e[11]*(+t*l*h-t*s*d-r*a*h+i*a*d+r*s*c-i*l*c)+e[15]*(-n*s*c-t*o*h+t*s*u+n*a*h-i*a*u+i*o*c)}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(e,t,i){let n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=i),this}invert(){let e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],c=e[8],h=e[9],u=e[10],d=e[11],p=e[12],f=e[13],m=e[14],g=e[15],v=h*m*l-f*u*l+f*o*d-s*m*d-h*o*g+s*u*g,y=p*u*l-c*m*l-p*o*d+a*m*d+c*o*g-a*u*g,b=c*f*l-p*h*l+p*s*d-a*f*d-c*s*g+a*h*g,x=p*h*o-c*f*o-p*s*u+a*f*u+c*s*m-a*h*m,w=t*v+i*y+n*b+r*x;if(0===w)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let _=1/w;return e[0]=v*_,e[1]=(f*u*r-h*m*r-f*n*d+i*m*d+h*n*g-i*u*g)*_,e[2]=(s*m*r-f*o*r+f*n*l-i*m*l-s*n*g+i*o*g)*_,e[3]=(h*o*r-s*u*r-h*n*l+i*u*l+s*n*d-i*o*d)*_,e[4]=y*_,e[5]=(c*m*r-p*u*r+p*n*d-t*m*d-c*n*g+t*u*g)*_,e[6]=(p*o*r-a*m*r-p*n*l+t*m*l+a*n*g-t*o*g)*_,e[7]=(a*u*r-c*o*r+c*n*l-t*u*l-a*n*d+t*o*d)*_,e[8]=b*_,e[9]=(p*h*r-c*f*r-p*i*d+t*f*d+c*i*g-t*h*g)*_,e[10]=(a*f*r-p*s*r+p*i*l-t*f*l-a*i*g+t*s*g)*_,e[11]=(c*s*r-a*h*r-c*i*l+t*h*l+a*i*d-t*s*d)*_,e[12]=x*_,e[13]=(c*f*n-p*h*n+p*i*u-t*f*u-c*i*m+t*h*m)*_,e[14]=(p*s*n-a*f*n-p*i*o+t*f*o+a*i*m-t*s*m)*_,e[15]=(a*h*n-c*s*n+c*i*o-t*h*o-a*i*u+t*s*u)*_,this}scale(e){let t=this.elements,i=e.x,n=e.y,r=e.z;return t[0]*=i,t[4]*=n,t[8]*=r,t[1]*=i,t[5]*=n,t[9]*=r,t[2]*=i,t[6]*=n,t[10]*=r,t[3]*=i,t[7]*=n,t[11]*=r,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,n))}makeTranslation(e,t,i){return this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let i=Math.cos(t),n=Math.sin(t),r=1-i,a=e.x,s=e.y,o=e.z,l=r*a,c=r*s;return this.set(l*a+i,l*s-n*o,l*o+n*s,0,l*s+n*o,c*s+i,c*o-n*a,0,l*o-n*s,c*o+n*a,r*o*o+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,n,r,a){return this.set(1,i,r,0,e,1,a,0,t,n,1,0,0,0,0,1),this}compose(e,t,i){let n=this.elements,r=t._x,a=t._y,s=t._z,o=t._w,l=r+r,c=a+a,h=s+s,u=r*l,d=r*c,p=r*h,f=a*c,m=a*h,g=s*h,v=o*l,y=o*c,b=o*h,x=i.x,w=i.y,_=i.z;return n[0]=(1-(f+g))*x,n[1]=(d+b)*x,n[2]=(p-y)*x,n[3]=0,n[4]=(d-b)*w,n[5]=(1-(u+g))*w,n[6]=(m+v)*w,n[7]=0,n[8]=(p+y)*_,n[9]=(m-v)*_,n[10]=(1-(u+f))*_,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,i){let n=this.elements,r=gM.set(n[0],n[1],n[2]).length(),a=gM.set(n[4],n[5],n[6]).length(),s=gM.set(n[8],n[9],n[10]).length();this.determinant()<0&&(r=-r),e.x=n[12],e.y=n[13],e.z=n[14],vM.copy(this);let o=1/r,l=1/a,c=1/s;return vM.elements[0]*=o,vM.elements[1]*=o,vM.elements[2]*=o,vM.elements[4]*=l,vM.elements[5]*=l,vM.elements[6]*=l,vM.elements[8]*=c,vM.elements[9]*=c,vM.elements[10]*=c,t.setFromRotationMatrix(vM),i.x=r,i.y=a,i.z=s,this}makePerspective(e,t,i,n,r,a){let s=this.elements,o=2*r/(t-e),l=2*r/(i-n),c=(t+e)/(t-e),h=(i+n)/(i-n),u=-(a+r)/(a-r),d=-2*a*r/(a-r);return s[0]=o,s[4]=0,s[8]=c,s[12]=0,s[1]=0,s[5]=l,s[9]=h,s[13]=0,s[2]=0,s[6]=0,s[10]=u,s[14]=d,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this}makeOrthographic(e,t,i,n,r,a){let s=this.elements,o=1/(t-e),l=1/(i-n),c=1/(a-r),h=(t+e)*o,u=(i+n)*l,d=(a+r)*c;return s[0]=2*o,s[4]=0,s[8]=0,s[12]=-h,s[1]=0,s[5]=2*l,s[9]=0,s[13]=-u,s[2]=0,s[6]=0,s[10]=-2*c,s[14]=-d,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this}equals(e){let t=this.elements,i=e.elements;for(let n=0;n<16;n++)if(t[n]!==i[n])return!1;return!0}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}},gM=new FA,vM=new mM,yM=new FA(0,0,0),bM=new FA(1,1,1),xM=new FA,wM=new FA,_M=new FA,SM=new mM,EM=new NA,CM=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:CM.DEFAULT_ORDER;this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=n}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._order;return this._x=e,this._y=t,this._z=i,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=e.elements,r=n[0],a=n[4],s=n[8],o=n[1],l=n[5],c=n[9],h=n[2],u=n[6],d=n[10];switch(t){case"XYZ":this._y=Math.asin(tA(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(u,l),this._z=0);break;case"YXZ":this._x=Math.asin(-tA(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-h,r),this._z=0);break;case"ZXY":this._x=Math.asin(tA(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-tA(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(u,d),this._z=Math.atan2(o,r)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(tA(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-h,r)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-tA(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(u,l),this._y=Math.atan2(s,r)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===i&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return SM.makeRotationFromQuaternion(e),this.setFromRotationMatrix(SM,t,i)}setFromVector3(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order;return this.set(e.x,e.y,e.z,t)}reorder(e){return EM.setFromEuler(this),this.setFromQuaternion(EM,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};CM.DEFAULT_ORDER="XYZ";var AM=class{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return 0!==(this.mask&e.mask)}isEnabled(e){return 0!==(this.mask&(1<<e|0))}},MM=0,TM=new FA,PM=new NA,DM=new mM,kM=new FA,OM=new FA,IM=new FA,RM=new NA,LM=new FA(1,0,0),BM=new FA(0,1,0),zM=new FA(0,0,1),NM={type:"added"},FM={type:"removed"},jM=class extends QC{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:MM++}),this.uuid=eA(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=jM.DEFAULT_UP.clone();let e=new FA,t=new CM,i=new NA,n=new FA(1,1,1);t._onChange((function(){i.setFromEuler(t,!1)})),i._onChange((function(){t.setFromQuaternion(i,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new mM},normalMatrix:{value:new uA}}),this.matrix=new mM,this.matrixWorld=new mM,this.matrixAutoUpdate=jM.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.matrixWorldAutoUpdate=jM.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.layers=new AM,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return PM.setFromAxisAngle(e,t),this.quaternion.multiply(PM),this}rotateOnWorldAxis(e,t){return PM.setFromAxisAngle(e,t),this.quaternion.premultiply(PM),this}rotateX(e){return this.rotateOnAxis(LM,e)}rotateY(e){return this.rotateOnAxis(BM,e)}rotateZ(e){return this.rotateOnAxis(zM,e)}translateOnAxis(e,t){return TM.copy(e).applyQuaternion(this.quaternion),this.position.add(TM.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(LM,e)}translateY(e){return this.translateOnAxis(BM,e)}translateZ(e){return this.translateOnAxis(zM,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(DM.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?kM.copy(e):kM.set(e,t,i);let n=this.parent;this.updateWorldMatrix(!0,!1),OM.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?DM.lookAt(OM,kM,this.up):DM.lookAt(kM,OM,this.up),this.quaternion.setFromRotationMatrix(DM),n&&(DM.extractRotation(n.matrixWorld),PM.setFromRotationMatrix(DM),this.quaternion.premultiply(PM.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(NM)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}let t=this.children.indexOf(e);return-1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(FM)),this}removeFromParent(){let e=this.parent;return null!==e&&e.remove(this),this}clear(){for(let e=0;e<this.children.length;e++){let t=this.children[e];t.parent=null,t.dispatchEvent(FM)}return this.children.length=0,this}attach(e){return this.updateWorldMatrix(!0,!1),DM.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),DM.multiply(e.parent.matrixWorld)),e.applyMatrix4(DM),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let i=0,n=this.children.length;i<n;i++){let n=this.children[i].getObjectByProperty(e,t);if(void 0!==n)return n}}getObjectsByProperty(e,t){let i=[];this[e]===t&&i.push(this);for(let n=0,r=this.children.length;n<r;n++){let r=this.children[n].getObjectsByProperty(e,t);r.length>0&&(i=i.concat(r))}return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(OM,e,IM),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(OM,RM,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);let t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);let t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].traverseVisible(e)}traverseAncestors(e){let t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);let t=this.children;for(let i=0,n=t.length;i<n;i++){let n=t[i];(!0===n.matrixWorldAutoUpdate||!0===e)&&n.updateMatrixWorld(e)}}updateWorldMatrix(e,t){let i=this.parent;if(!0===e&&null!==i&&!0===i.matrixWorldAutoUpdate&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t){let e=this.children;for(let t=0,i=e.length;t<i;t++){let i=e[t];!0===i.matrixWorldAutoUpdate&&i.updateWorldMatrix(!1,!0)}}}toJSON(e){let t=void 0===e||"string"==typeof e,i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});let n={};function r(t,i){return void 0===t[i.uuid]&&(t[i.uuid]=i.toJSON(e)),i.uuid}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(n.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=r(e.geometries,this.geometry);let t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){let i=t.shapes;if(Array.isArray(i))for(let t=0,n=i.length;t<n;t++){let n=i[t];r(e.shapes,n)}else r(e.shapes,i)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(e.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){let t=[];for(let i=0,n=this.material.length;i<n;i++)t.push(r(e.materials,this.material[i]));n.material=t}else n.material=r(e.materials,this.material);if(this.children.length>0){n.children=[];for(let t=0;t<this.children.length;t++)n.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){n.animations=[];for(let t=0;t<this.animations.length;t++){let i=this.animations[t];n.animations.push(r(e.animations,i))}}if(t){let t=a(e.geometries),n=a(e.materials),r=a(e.textures),s=a(e.images),o=a(e.shapes),l=a(e.skeletons),c=a(e.animations),h=a(e.nodes);t.length>0&&(i.geometries=t),n.length>0&&(i.materials=n),r.length>0&&(i.textures=r),s.length>0&&(i.images=s),o.length>0&&(i.shapes=o),l.length>0&&(i.skeletons=l),c.length>0&&(i.animations=c),h.length>0&&(i.nodes=h)}return i.object=n,i;function a(e){let t=[];for(let i in e){let n=e[i];delete n.metadata,t.push(n)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let i=0;i<e.children.length;i++){let t=e.children[i];this.add(t.clone())}return this}};jM.DEFAULT_UP=new FA(0,1,0),jM.DEFAULT_MATRIX_AUTO_UPDATE=!0,jM.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var VM=new FA,UM=new FA,GM=new FA,HM=new FA,WM=new FA,qM=new FA,XM=new FA,YM=new FA,QM=new FA,ZM=new FA,KM=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new FA,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new FA,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new FA;this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,n){n.subVectors(i,t),VM.subVectors(e,t),n.cross(VM);let r=n.lengthSq();return r>0?n.multiplyScalar(1/Math.sqrt(r)):n.set(0,0,0)}static getBarycoord(e,t,i,n,r){VM.subVectors(n,t),UM.subVectors(i,t),GM.subVectors(e,t);let a=VM.dot(VM),s=VM.dot(UM),o=VM.dot(GM),l=UM.dot(UM),c=UM.dot(GM),h=a*l-s*s;if(0===h)return r.set(-2,-1,-1);let u=1/h,d=(l*o-s*c)*u,p=(a*c-s*o)*u;return r.set(1-d-p,p,d)}static containsPoint(e,t,i,n){return this.getBarycoord(e,t,i,n,HM),HM.x>=0&&HM.y>=0&&HM.x+HM.y<=1}static getUV(e,t,i,n,r,a,s,o){return this.getBarycoord(e,t,i,n,HM),o.set(0,0),o.addScaledVector(r,HM.x),o.addScaledVector(a,HM.y),o.addScaledVector(s,HM.z),o}static isFrontFacing(e,t,i,n){return VM.subVectors(i,t),UM.subVectors(e,t),VM.cross(UM).dot(n)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this}setFromAttributeAndIndices(e,t,i,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,n),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return VM.subVectors(this.c,this.b),UM.subVectors(this.a,this.b),.5*VM.cross(UM).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return KM.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return KM.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,n,r){return KM.getUV(e,this.a,this.b,this.c,t,i,n,r)}containsPoint(e){return KM.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return KM.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let i,n,r=this.a,a=this.b,s=this.c;WM.subVectors(a,r),qM.subVectors(s,r),YM.subVectors(e,r);let o=WM.dot(YM),l=qM.dot(YM);if(o<=0&&l<=0)return t.copy(r);QM.subVectors(e,a);let c=WM.dot(QM),h=qM.dot(QM);if(c>=0&&h<=c)return t.copy(a);let u=o*h-c*l;if(u<=0&&o>=0&&c<=0)return i=o/(o-c),t.copy(r).addScaledVector(WM,i);ZM.subVectors(e,s);let d=WM.dot(ZM),p=qM.dot(ZM);if(p>=0&&d<=p)return t.copy(s);let f=d*l-o*p;if(f<=0&&l>=0&&p<=0)return n=l/(l-p),t.copy(r).addScaledVector(qM,n);let m=c*p-d*h;if(m<=0&&h-c>=0&&d-p>=0)return XM.subVectors(s,a),n=(h-c)/(h-c+(d-p)),t.copy(a).addScaledVector(XM,n);let g=1/(m+f+u);return i=f*g,n=u*g,t.copy(r).addScaledVector(WM,i).addScaledVector(qM,n)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},JM=0,$M=class extends QC{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:JM++}),this.uuid=eA(),this.name="",this.type="Material",this.blending=IS,this.side=PS,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=XS,this.blendDst=YS,this.blendEquation=NS,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=nE,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=WC,this.stencilZFail=WC,this.stencilZPass=WC,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(let t in e){let i=e[t];if(void 0===i){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}let n=this[t];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[t]=i:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}}toJSON(e){let t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});let i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function n(e){let t=[];for(let i in e){let n=e[i];delete n.metadata,t.push(n)}return t}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(i.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(i.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==IS&&(i.blending=this.blending),this.side!==PS&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(i.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.forceSinglePass&&(i.forceSinglePass=this.forceSinglePass),!0===this.wireframe&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=this.flatShading),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData),t){let t=n(e.textures),r=n(e.images);t.length>0&&(i.textures=t),r.length>0&&(i.images=r)}return i}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,i=null;if(null!==t){let e=t.length;i=new Array(e);for(let n=0;n!==e;++n)i[n]=t[n].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}},eT=class extends $M{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new MA(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=lE,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}},tT=new FA,iT=new hA,nT=class{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=i,this.usage=qC,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let n=0,r=this.itemSize;n<r;n++)this.array[e+n]=t.array[i+n];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,i=this.count;t<i;t++)iT.fromBufferAttribute(this,t),iT.applyMatrix3(e),this.setXY(t,iT.x,iT.y);else if(3===this.itemSize)for(let t=0,i=this.count;t<i;t++)tT.fromBufferAttribute(this,t),tT.applyMatrix3(e),this.setXYZ(t,tT.x,tT.y,tT.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)tT.fromBufferAttribute(this,t),tT.applyMatrix4(e),this.setXYZ(t,tT.x,tT.y,tT.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)tT.fromBufferAttribute(this,t),tT.applyNormalMatrix(e),this.setXYZ(t,tT.x,tT.y,tT.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)tT.fromBufferAttribute(this,t),tT.transformDirection(e),this.setXYZ(t,tT.x,tT.y,tT.z);return this}set(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=oA(t,this.array)),t}setX(e,t){return this.normalized&&(t=lA(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=oA(t,this.array)),t}setY(e,t){return this.normalized&&(t=lA(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=oA(t,this.array)),t}setZ(e,t){return this.normalized&&(t=lA(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=oA(t,this.array)),t}setW(e,t){return this.normalized&&(t=lA(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=lA(t,this.array),i=lA(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,n){return e*=this.itemSize,this.normalized&&(t=lA(t,this.array),i=lA(i,this.array),n=lA(n,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this}setXYZW(e,t,i,n,r){return e*=this.itemSize,this.normalized&&(t=lA(t,this.array),i=lA(i,this.array),n=lA(n,this.array),r=lA(r,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==qC&&(e.usage=this.usage),(0!==this.updateRange.offset||-1!==this.updateRange.count)&&(e.updateRange=this.updateRange),e}copyColorsArray(){console.error("THREE.BufferAttribute: copyColorsArray() was removed in r144.")}copyVector2sArray(){console.error("THREE.BufferAttribute: copyVector2sArray() was removed in r144.")}copyVector3sArray(){console.error("THREE.BufferAttribute: copyVector3sArray() was removed in r144.")}copyVector4sArray(){console.error("THREE.BufferAttribute: copyVector4sArray() was removed in r144.")}},rT=class extends nT{constructor(e,t,i){super(new Uint16Array(e),t,i)}},aT=class extends nT{constructor(e,t,i){super(new Uint32Array(e),t,i)}},sT=class extends nT{constructor(e,t,i){super(new Float32Array(e),t,i)}},oT=0,lT=new mM,cT=new jM,hT=new FA,uT=new UA,dT=new UA,pT=new FA,fT=class extends QC{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:oT++}),this.uuid=eA(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(pA(e)?aT:rT)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);let i=this.attributes.normal;if(void 0!==i){let t=(new uA).getNormalMatrix(e);i.applyNormalMatrix(t),i.needsUpdate=!0}let n=this.attributes.tangent;return void 0!==n&&(n.transformDirection(e),n.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return lT.makeRotationFromQuaternion(e),this.applyMatrix4(lT),this}rotateX(e){return lT.makeRotationX(e),this.applyMatrix4(lT),this}rotateY(e){return lT.makeRotationY(e),this.applyMatrix4(lT),this}rotateZ(e){return lT.makeRotationZ(e),this.applyMatrix4(lT),this}translate(e,t,i){return lT.makeTranslation(e,t,i),this.applyMatrix4(lT),this}scale(e,t,i){return lT.makeScale(e,t,i),this.applyMatrix4(lT),this}lookAt(e){return cT.lookAt(e),cT.updateMatrix(),this.applyMatrix4(cT.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(hT).negate(),this.translate(hT.x,hT.y,hT.z),this}setFromPoints(e){let t=[];for(let i=0,n=e.length;i<n;i++){let n=e[i];t.push(n.x,n.y,n.z||0)}return this.setAttribute("position",new sT(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new UA);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new FA(-1/0,-1/0,-1/0),new FA(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,n=t.length;i<n;i++){let e=t[i];uT.setFromBufferAttribute(e),this.morphTargetsRelative?(pT.addVectors(this.boundingBox.min,uT.min),this.boundingBox.expandByPoint(pT),pT.addVectors(this.boundingBox.max,uT.max),this.boundingBox.expandByPoint(pT)):(this.boundingBox.expandByPoint(uT.min),this.boundingBox.expandByPoint(uT.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new sM);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new FA,1/0);if(e){let i=this.boundingSphere.center;if(uT.setFromBufferAttribute(e),t)for(let e=0,r=t.length;e<r;e++){let i=t[e];dT.setFromBufferAttribute(i),this.morphTargetsRelative?(pT.addVectors(uT.min,dT.min),uT.expandByPoint(pT),pT.addVectors(uT.max,dT.max),uT.expandByPoint(pT)):(uT.expandByPoint(dT.min),uT.expandByPoint(dT.max))}uT.getCenter(i);let n=0;for(let t=0,r=e.count;t<r;t++)pT.fromBufferAttribute(e,t),n=Math.max(n,i.distanceToSquared(pT));if(t)for(let r=0,a=t.length;r<a;r++){let a=t[r],s=this.morphTargetsRelative;for(let t=0,r=a.count;t<r;t++)pT.fromBufferAttribute(a,t),s&&(hT.fromBufferAttribute(e,t),pT.add(hT)),n=Math.max(n,i.distanceToSquared(pT))}this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");let i=e.array,n=t.position.array,r=t.normal.array,a=t.uv.array,s=n.length/3;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new nT(new Float32Array(4*s),4));let o=this.getAttribute("tangent").array,l=[],c=[];for(let C=0;C<s;C++)l[C]=new FA,c[C]=new FA;let h=new FA,u=new FA,d=new FA,p=new hA,f=new hA,m=new hA,g=new FA,v=new FA;function y(e,t,i){h.fromArray(n,3*e),u.fromArray(n,3*t),d.fromArray(n,3*i),p.fromArray(a,2*e),f.fromArray(a,2*t),m.fromArray(a,2*i),u.sub(h),d.sub(h),f.sub(p),m.sub(p);let r=1/(f.x*m.y-m.x*f.y);!isFinite(r)||(g.copy(u).multiplyScalar(m.y).addScaledVector(d,-f.y).multiplyScalar(r),v.copy(d).multiplyScalar(f.x).addScaledVector(u,-m.x).multiplyScalar(r),l[e].add(g),l[t].add(g),l[i].add(g),c[e].add(v),c[t].add(v),c[i].add(v))}let b=this.groups;0===b.length&&(b=[{start:0,count:i.length}]);for(let C=0,A=b.length;C<A;++C){let e=b[C],t=e.start;for(let n=t,r=t+e.count;n<r;n+=3)y(i[n+0],i[n+1],i[n+2])}let x=new FA,w=new FA,_=new FA,S=new FA;function E(e){_.fromArray(r,3*e),S.copy(_);let t=l[e];x.copy(t),x.sub(_.multiplyScalar(_.dot(t))).normalize(),w.crossVectors(S,t);let i=w.dot(c[e])<0?-1:1;o[4*e]=x.x,o[4*e+1]=x.y,o[4*e+2]=x.z,o[4*e+3]=i}for(let C=0,A=b.length;C<A;++C){let e=b[C],t=e.start;for(let n=t,r=t+e.count;n<r;n+=3)E(i[n+0]),E(i[n+1]),E(i[n+2])}}computeVertexNormals(){let e=this.index,t=this.getAttribute("position");if(void 0!==t){let i=this.getAttribute("normal");if(void 0===i)i=new nT(new Float32Array(3*t.count),3),this.setAttribute("normal",i);else for(let e=0,t=i.count;e<t;e++)i.setXYZ(e,0,0,0);let n=new FA,r=new FA,a=new FA,s=new FA,o=new FA,l=new FA,c=new FA,h=new FA;if(e)for(let u=0,d=e.count;u<d;u+=3){let d=e.getX(u+0),p=e.getX(u+1),f=e.getX(u+2);n.fromBufferAttribute(t,d),r.fromBufferAttribute(t,p),a.fromBufferAttribute(t,f),c.subVectors(a,r),h.subVectors(n,r),c.cross(h),s.fromBufferAttribute(i,d),o.fromBufferAttribute(i,p),l.fromBufferAttribute(i,f),s.add(c),o.add(c),l.add(c),i.setXYZ(d,s.x,s.y,s.z),i.setXYZ(p,o.x,o.y,o.z),i.setXYZ(f,l.x,l.y,l.z)}else for(let e=0,u=t.count;e<u;e+=3)n.fromBufferAttribute(t,e+0),r.fromBufferAttribute(t,e+1),a.fromBufferAttribute(t,e+2),c.subVectors(a,r),h.subVectors(n,r),c.cross(h),i.setXYZ(e+0,c.x,c.y,c.z),i.setXYZ(e+1,c.x,c.y,c.z),i.setXYZ(e+2,c.x,c.y,c.z);this.normalizeNormals(),i.needsUpdate=!0}}merge(){return console.error("THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeBufferGeometries() instead."),this}normalizeNormals(){let e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)pT.fromBufferAttribute(e,t),pT.normalize(),e.setXYZ(t,pT.x,pT.y,pT.z)}toNonIndexed(){function e(e,t){let i=e.array,n=e.itemSize,r=e.normalized,a=new i.constructor(t.length*n),s=0,o=0;for(let l=0,c=t.length;l<c;l++){s=e.isInterleavedBufferAttribute?t[l]*e.data.stride+e.offset:t[l]*n;for(let e=0;e<n;e++)a[o++]=i[s++]}return new nT(a,n,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let t=new fT,i=this.index.array,n=this.attributes;for(let s in n){let r=e(n[s],i);t.setAttribute(s,r)}let r=this.morphAttributes;for(let s in r){let n=[],a=r[s];for(let t=0,r=a.length;t<r;t++){let r=e(a[t],i);n.push(r)}t.morphAttributes[s]=n}t.morphTargetsRelative=this.morphTargetsRelative;let a=this.groups;for(let s=0,o=a.length;s<o;s++){let e=a[s];t.addGroup(e.start,e.count,e.materialIndex)}return t}toJSON(){let e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){let t=this.parameters;for(let i in t)void 0!==t[i]&&(e[i]=t[i]);return e}e.data={attributes:{}};let t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let i=this.attributes;for(let o in i){let t=i[o];e.data.attributes[o]=t.toJSON(e.data)}let n={},r=!1;for(let o in this.morphAttributes){let t=this.morphAttributes[o],i=[];for(let n=0,r=t.length;n<r;n++){let r=t[n];i.push(r.toJSON(e.data))}i.length>0&&(n[o]=i,r=!0)}r&&(e.data.morphAttributes=n,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let s=this.boundingSphere;return null!==s&&(e.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let i=e.index;null!==i&&this.setIndex(i.clone(t));let n=e.attributes;for(let l in n){let e=n[l];this.setAttribute(l,e.clone(t))}let r=e.morphAttributes;for(let l in r){let e=[],i=r[l];for(let n=0,r=i.length;n<r;n++)e.push(i[n].clone(t));this.morphAttributes[l]=e}this.morphTargetsRelative=e.morphTargetsRelative;let a=e.groups;for(let l=0,c=a.length;l<c;l++){let e=a[l];this.addGroup(e.start,e.count,e.materialIndex)}let s=e.boundingBox;null!==s&&(this.boundingBox=s.clone());let o=e.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,void 0!==e.parameters&&(this.parameters=Object.assign({},e.parameters)),this}dispose(){this.dispatchEvent({type:"dispose"})}},mT=new mM,gT=new fM,vT=new sM,yT=new FA,bT=new FA,xT=new FA,wT=new FA,_T=new FA,ST=new hA,ET=new hA,CT=new hA,AT=new FA,MT=new FA,TT=class extends jM{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new fT,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new eT;super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=i.length;e<t;e++){let t=i[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){let i=this.geometry,n=i.attributes.position,r=i.morphAttributes.position,a=i.morphTargetsRelative;t.fromBufferAttribute(n,e);let s=this.morphTargetInfluences;if(r&&s){_T.set(0,0,0);for(let i=0,n=r.length;i<n;i++){let n=s[i],o=r[i];0!==n&&(wT.fromBufferAttribute(o,e),a?_T.addScaledVector(wT,n):_T.addScaledVector(wT.sub(t),n))}t.add(_T)}return this.isSkinnedMesh&&this.boneTransform(e,t),t}raycast(e,t){let i=this.geometry,n=this.material,r=this.matrixWorld;if(void 0===n||(null===i.boundingSphere&&i.computeBoundingSphere(),vT.copy(i.boundingSphere),vT.applyMatrix4(r),!1===e.ray.intersectsSphere(vT))||(mT.copy(r).invert(),gT.copy(e.ray).applyMatrix4(mT),null!==i.boundingBox&&!1===gT.intersectsBox(i.boundingBox)))return;let a,s=i.index,o=i.attributes.position,l=i.attributes.uv,c=i.attributes.uv2,h=i.groups,u=i.drawRange;if(null!==s)if(Array.isArray(n))for(let d=0,p=h.length;d<p;d++){let i=h[d],r=n[i.materialIndex];for(let n=Math.max(i.start,u.start),o=Math.min(s.count,Math.min(i.start+i.count,u.start+u.count));n<o;n+=3){let o=s.getX(n),h=s.getX(n+1),u=s.getX(n+2);a=PT(this,r,e,gT,l,c,o,h,u),a&&(a.faceIndex=Math.floor(n/3),a.face.materialIndex=i.materialIndex,t.push(a))}}else{for(let i=Math.max(0,u.start),r=Math.min(s.count,u.start+u.count);i<r;i+=3){let r=s.getX(i),o=s.getX(i+1),h=s.getX(i+2);a=PT(this,n,e,gT,l,c,r,o,h),a&&(a.faceIndex=Math.floor(i/3),t.push(a))}}else if(void 0!==o)if(Array.isArray(n))for(let d=0,p=h.length;d<p;d++){let i=h[d],r=n[i.materialIndex];for(let n=Math.max(i.start,u.start),s=Math.min(o.count,Math.min(i.start+i.count,u.start+u.count));n<s;n+=3){a=PT(this,r,e,gT,l,c,n,n+1,n+2),a&&(a.faceIndex=Math.floor(n/3),a.face.materialIndex=i.materialIndex,t.push(a))}}else{for(let i=Math.max(0,u.start),r=Math.min(o.count,u.start+u.count);i<r;i+=3){a=PT(this,n,e,gT,l,c,i,i+1,i+2),a&&(a.faceIndex=Math.floor(i/3),t.push(a))}}}};function PT(e,t,i,n,r,a,s,o,l){e.getVertexPosition(s,yT),e.getVertexPosition(o,bT),e.getVertexPosition(l,xT);let c=function(e,t,i,n,r,a,s,o){let l;if(l=t.side===DS?n.intersectTriangle(s,a,r,!0,o):n.intersectTriangle(r,a,s,t.side===PS,o),null===l)return null;MT.copy(o),MT.applyMatrix4(e.matrixWorld);let c=i.ray.origin.distanceTo(MT);return c<i.near||c>i.far?null:{distance:c,point:MT.clone(),object:e}}(e,t,i,n,yT,bT,xT,AT);if(c){r&&(ST.fromBufferAttribute(r,s),ET.fromBufferAttribute(r,o),CT.fromBufferAttribute(r,l),c.uv=KM.getUV(AT,yT,bT,xT,ST,ET,CT,new hA)),a&&(ST.fromBufferAttribute(a,s),ET.fromBufferAttribute(a,o),CT.fromBufferAttribute(a,l),c.uv2=KM.getUV(AT,yT,bT,xT,ST,ET,CT,new hA));let e={a:s,b:o,c:l,normal:new FA,materialIndex:0};KM.getNormal(yT,bT,xT,e.normal),c.face=e}return c}var DT=class extends fT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:n,heightSegments:r,depthSegments:a};let s=this;n=Math.floor(n),r=Math.floor(r),a=Math.floor(a);let o=[],l=[],c=[],h=[],u=0,d=0;function p(e,t,i,n,r,a,p,f,m,g,v){let y=a/m,b=p/g,x=a/2,w=p/2,_=f/2,S=m+1,E=g+1,C=0,A=0,M=new FA;for(let s=0;s<E;s++){let a=s*b-w;for(let o=0;o<S;o++){let u=o*y-x;M[e]=u*n,M[t]=a*r,M[i]=_,l.push(M.x,M.y,M.z),M[e]=0,M[t]=0,M[i]=f>0?1:-1,c.push(M.x,M.y,M.z),h.push(o/m),h.push(1-s/g),C+=1}}for(let s=0;s<g;s++)for(let e=0;e<m;e++){let t=u+e+S*s,i=u+e+S*(s+1),n=u+(e+1)+S*(s+1),r=u+(e+1)+S*s;o.push(t,i,r),o.push(i,n,r),A+=6}s.addGroup(d,A,v),d+=A,u+=C}p("z","y","x",-1,-1,i,t,e,a,r,0),p("z","y","x",1,-1,i,t,-e,a,r,1),p("x","z","y",1,1,e,i,t,n,a,2),p("x","z","y",1,-1,e,i,-t,n,a,3),p("x","y","z",1,-1,e,t,i,n,r,4),p("x","y","z",-1,-1,e,t,-i,n,r,5),this.setIndex(o),this.setAttribute("position",new sT(l,3)),this.setAttribute("normal",new sT(c,3)),this.setAttribute("uv",new sT(h,2))}static fromJSON(e){return new DT(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}};function kT(e){let t={};for(let i in e){t[i]={};for(let n in e[i]){let r=e[i][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?t[i][n]=r.clone():Array.isArray(r)?t[i][n]=r.slice():t[i][n]=r}}return t}function OT(e){let t={};for(let i=0;i<e.length;i++){let n=kT(e[i]);for(let e in n)t[e]=n[e]}return t}function IT(e){return null===e.getRenderTarget()&&e.outputEncoding===NC?GC:HC}var RT={clone:kT,merge:OT},LT=class extends $M{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=kT(e.uniforms),this.uniformsGroups=function(e){let t=[];for(let i=0;i<e.length;i++)t.push(e[i].clone());return t}(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){let t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(let n in this.uniforms){let i=this.uniforms[n].value;i&&i.isTexture?t.uniforms[n]={type:"t",value:i.toJSON(e).uuid}:i&&i.isColor?t.uniforms[n]={type:"c",value:i.getHex()}:i&&i.isVector2?t.uniforms[n]={type:"v2",value:i.toArray()}:i&&i.isVector3?t.uniforms[n]={type:"v3",value:i.toArray()}:i&&i.isVector4?t.uniforms[n]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?t.uniforms[n]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?t.uniforms[n]={type:"m4",value:i.toArray()}:t.uniforms[n]={value:i}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;let i={};for(let n in this.extensions)!0===this.extensions[n]&&(i[n]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}},BT=class extends jM{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new mM,this.projectionMatrix=new mM,this.projectionMatrixInverse=new mM}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}},zT=class extends BT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2e3;super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=2*$C*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(.5*JC*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*$C*Math.atan(Math.tan(.5*JC*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,i,n,r,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(.5*JC*this.fov)/this.zoom,i=2*t,n=this.aspect*i,r=-.5*n,a=this.view;if(null!==this.view&&this.view.enabled){let e=a.fullWidth,s=a.fullHeight;r+=a.offsetX*n/e,t-=a.offsetY*i/s,n*=a.width/e,i*=a.height/s}let s=this.filmOffset;0!==s&&(r+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,t,t-i,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}},NT=-90,FT=class extends jM{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i;let n=new zT(NT,1,e,t);n.layers=this.layers,n.up.set(0,1,0),n.lookAt(1,0,0),this.add(n);let r=new zT(NT,1,e,t);r.layers=this.layers,r.up.set(0,1,0),r.lookAt(-1,0,0),this.add(r);let a=new zT(NT,1,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(0,1,0),this.add(a);let s=new zT(NT,1,e,t);s.layers=this.layers,s.up.set(0,0,1),s.lookAt(0,-1,0),this.add(s);let o=new zT(NT,1,e,t);o.layers=this.layers,o.up.set(0,1,0),o.lookAt(0,0,1),this.add(o);let l=new zT(NT,1,e,t);l.layers=this.layers,l.up.set(0,1,0),l.lookAt(0,0,-1),this.add(l)}update(e,t){null===this.parent&&this.updateMatrixWorld();let i=this.renderTarget,[n,r,a,s,o,l]=this.children,c=e.getRenderTarget(),h=e.toneMapping,u=e.xr.enabled;e.toneMapping=uE,e.xr.enabled=!1;let d=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0),e.render(t,n),e.setRenderTarget(i,1),e.render(t,r),e.setRenderTarget(i,2),e.render(t,a),e.setRenderTarget(i,3),e.render(t,s),e.setRenderTarget(i,4),e.render(t,o),i.texture.generateMipmaps=d,e.setRenderTarget(i,5),e.render(t,l),e.setRenderTarget(c),e.toneMapping=h,e.xr.enabled=u,i.texture.needsPMREMUpdate=!0}},jT=class extends IA{constructor(e,t,i,n,r,a,s,o,l,c){super(e=void 0!==e?e:[],t=void 0!==t?t:vE,i,n,r,a,s,o,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},VT=class extends LA{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(e,e,t),this.isWebGLCubeRenderTarget=!0;let i={width:e,height:e,depth:1},n=[i,i,i,i,i,i];this.texture=new jT(n,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:TE}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let i={tEquirect:{value:null}},n="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",r="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",a=new DT(5,5,5),s=new LT({name:"CubemapFromEquirect",uniforms:kT(i),vertexShader:n,fragmentShader:r,side:DS,blending:OS});s.uniforms.tEquirect.value=t;let o=new TT(a,s),l=t.minFilter;return t.minFilter===DE&&(t.minFilter=TE),new FT(1,10,this).update(e,o),t.minFilter=l,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,n){let r=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,i,n);e.setRenderTarget(r)}},UT=new FA,GT=new FA,HT=new uA,WT=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new FA(1,0,0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,n){return this.normal.set(e,t,i),this.constant=n,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){let n=UT.subVectors(i,t).cross(GT.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(n,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){let i=e.delta(UT),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;let r=-(e.start.dot(this.normal)+this.constant)/n;return r<0||r>1?null:t.copy(i).multiplyScalar(r).add(e.start)}intersectsLine(e){let t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let i=t||HT.getNormalMatrix(e),n=this.coplanarPoint(UT).applyMatrix4(e),r=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}},qT=new sM,XT=new FA,YT=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new WT,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WT,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new WT,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new WT,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new WT,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:new WT;this.planes=[e,t,i,n,r,a]}set(e,t,i,n,r,a){let s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(i),s[3].copy(n),s[4].copy(r),s[5].copy(a),this}copy(e){let t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e){let t=this.planes,i=e.elements,n=i[0],r=i[1],a=i[2],s=i[3],o=i[4],l=i[5],c=i[6],h=i[7],u=i[8],d=i[9],p=i[10],f=i[11],m=i[12],g=i[13],v=i[14],y=i[15];return t[0].setComponents(s-n,h-o,f-u,y-m).normalize(),t[1].setComponents(s+n,h+o,f+u,y+m).normalize(),t[2].setComponents(s+r,h+l,f+d,y+g).normalize(),t[3].setComponents(s-r,h-l,f-d,y-g).normalize(),t[4].setComponents(s-a,h-c,f-p,y-v).normalize(),t[5].setComponents(s+a,h+c,f+p,y+v).normalize(),this}intersectsObject(e){let t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),qT.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(qT)}intersectsSprite(e){return qT.center.set(0,0,0),qT.radius=.7071067811865476,qT.applyMatrix4(e.matrixWorld),this.intersectsSphere(qT)}intersectsSphere(e){let t=this.planes,i=e.center,n=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(i)<n)return!1;return!0}intersectsBox(e){let t=this.planes;for(let i=0;i<6;i++){let n=t[i];if(XT.x=n.normal.x>0?e.max.x:e.min.x,XT.y=n.normal.y>0?e.max.y:e.min.y,XT.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(XT)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}};function QT(){let e=null,t=!1,i=null,n=null;function r(t,a){i(t,a),n=e.requestAnimationFrame(r)}return{start:function(){!0!==t&&null!==i&&(n=e.requestAnimationFrame(r),t=!0)},stop:function(){e.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(e){i=e},setContext:function(t){e=t}}}function ZT(e,t){let i=t.isWebGL2,n=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),n.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);let i=n.get(t);i&&(e.deleteBuffer(i.buffer),n.delete(t))},update:function(t,r){if(t.isGLBufferAttribute){let e=n.get(t);return void((!e||e.version<t.version)&&n.set(t,{buffer:t.buffer,type:t.type,bytesPerElement:t.elementSize,version:t.version}))}t.isInterleavedBufferAttribute&&(t=t.data);let a=n.get(t);void 0===a?n.set(t,function(t,n){let r,a=t.array,s=t.usage,o=e.createBuffer();if(e.bindBuffer(n,o),e.bufferData(n,a,s),t.onUploadCallback(),a instanceof Float32Array)r=5126;else if(a instanceof Uint16Array)if(t.isFloat16BufferAttribute){if(!i)throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");r=5131}else r=5123;else if(a instanceof Int16Array)r=5122;else if(a instanceof Uint32Array)r=5125;else if(a instanceof Int32Array)r=5124;else if(a instanceof Int8Array)r=5120;else if(a instanceof Uint8Array)r=5121;else{if(!(a instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+a);r=5121}return{buffer:o,type:r,bytesPerElement:a.BYTES_PER_ELEMENT,version:t.version}}(t,r)):a.version<t.version&&(function(t,n,r){let a=n.array,s=n.updateRange;e.bindBuffer(r,t),-1===s.count?e.bufferSubData(r,0,a):(i?e.bufferSubData(r,s.offset*a.BYTES_PER_ELEMENT,a,s.offset,s.count):e.bufferSubData(r,s.offset*a.BYTES_PER_ELEMENT,a.subarray(s.offset,s.offset+s.count)),s.count=-1),n.onUploadCallback()}(a.buffer,t,r),a.version=t.version)}}}var KT=class extends fT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:n};let r=e/2,a=t/2,s=Math.floor(i),o=Math.floor(n),l=s+1,c=o+1,h=e/s,u=t/o,d=[],p=[],f=[],m=[];for(let g=0;g<c;g++){let e=g*u-a;for(let t=0;t<l;t++){let i=t*h-r;p.push(i,-e,0),f.push(0,0,1),m.push(t/s),m.push(1-g/o)}}for(let g=0;g<o;g++)for(let e=0;e<s;e++){let t=e+l*g,i=e+l*(g+1),n=e+1+l*(g+1),r=e+1+l*g;d.push(t,i,r),d.push(i,n,r)}this.setIndex(d),this.setAttribute("position",new sT(p,3)),this.setAttribute("normal",new sT(f,3)),this.setAttribute("uv",new sT(m,2))}static fromJSON(e){return new KT(e.width,e.height,e.widthSegments,e.heightSegments)}},JT={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",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( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n    float x2 = x * x;\n    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * D );\n}\n#ifdef USE_IRIDESCENCE\n\tvec3 BRDF_GGX_Iridescence( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float iridescence, const in vec3 iridescenceFresnel, const in float roughness ) {\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = mix( F_Schlick( f0, f90, dotVH ), iridescenceFresnel, iridescence );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\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_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660,  0.0556434,\n\t\t-1.5371385,  1.8760108, -0.2040259,\n\t\t-0.4985314,  0.0415560,  1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\t return vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat R21 = R12;\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( 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, float faceDirection ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos.xyz );\n\t\tvec3 vSigmaY = dFdy( surf_pos.xyz );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\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}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, 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_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in 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.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3(    0, 1,    0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in 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#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX_Iridescence( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness );\n\t#else\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\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_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float 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}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n  varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n  uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t  f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t  f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n  uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n  varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tuniform int boneTextureSize;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tfloat j = i * 4.0;\n\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\ty = dy * ( y + 0.5 );\n\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\treturn bone;\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, 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\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3(  1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108,  1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605,  1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef texture2DLodEXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\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\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\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>\nvarying vec2 vHighPrecisionZW;\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\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\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\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <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}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <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}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\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 <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <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\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\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 <morphcolor_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\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\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\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}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\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 <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\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_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\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}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\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 <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <output_fragment>\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}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <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 <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",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 <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\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_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\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}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\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 <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\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_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <output_fragment>\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}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\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 <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\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 <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <output_fragment>\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}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_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\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\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 <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_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_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}"},$T={common:{diffuse:{value:new MA(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new uA},uv2Transform:{value:new uA},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},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 hA(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:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new MA(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new MA(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new uA}},sprite:{diffuse:{value:new MA(16777215)},opacity:{value:1},center:{value:new hA(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new uA}}},eP={basic:{uniforms:OT([$T.common,$T.specularmap,$T.envmap,$T.aomap,$T.lightmap,$T.fog]),vertexShader:JT.meshbasic_vert,fragmentShader:JT.meshbasic_frag},lambert:{uniforms:OT([$T.common,$T.specularmap,$T.envmap,$T.aomap,$T.lightmap,$T.emissivemap,$T.bumpmap,$T.normalmap,$T.displacementmap,$T.fog,$T.lights,{emissive:{value:new MA(0)}}]),vertexShader:JT.meshlambert_vert,fragmentShader:JT.meshlambert_frag},phong:{uniforms:OT([$T.common,$T.specularmap,$T.envmap,$T.aomap,$T.lightmap,$T.emissivemap,$T.bumpmap,$T.normalmap,$T.displacementmap,$T.fog,$T.lights,{emissive:{value:new MA(0)},specular:{value:new MA(1118481)},shininess:{value:30}}]),vertexShader:JT.meshphong_vert,fragmentShader:JT.meshphong_frag},standard:{uniforms:OT([$T.common,$T.envmap,$T.aomap,$T.lightmap,$T.emissivemap,$T.bumpmap,$T.normalmap,$T.displacementmap,$T.roughnessmap,$T.metalnessmap,$T.fog,$T.lights,{emissive:{value:new MA(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:JT.meshphysical_vert,fragmentShader:JT.meshphysical_frag},toon:{uniforms:OT([$T.common,$T.aomap,$T.lightmap,$T.emissivemap,$T.bumpmap,$T.normalmap,$T.displacementmap,$T.gradientmap,$T.fog,$T.lights,{emissive:{value:new MA(0)}}]),vertexShader:JT.meshtoon_vert,fragmentShader:JT.meshtoon_frag},matcap:{uniforms:OT([$T.common,$T.bumpmap,$T.normalmap,$T.displacementmap,$T.fog,{matcap:{value:null}}]),vertexShader:JT.meshmatcap_vert,fragmentShader:JT.meshmatcap_frag},points:{uniforms:OT([$T.points,$T.fog]),vertexShader:JT.points_vert,fragmentShader:JT.points_frag},dashed:{uniforms:OT([$T.common,$T.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:JT.linedashed_vert,fragmentShader:JT.linedashed_frag},depth:{uniforms:OT([$T.common,$T.displacementmap]),vertexShader:JT.depth_vert,fragmentShader:JT.depth_frag},normal:{uniforms:OT([$T.common,$T.bumpmap,$T.normalmap,$T.displacementmap,{opacity:{value:1}}]),vertexShader:JT.meshnormal_vert,fragmentShader:JT.meshnormal_frag},sprite:{uniforms:OT([$T.sprite,$T.fog]),vertexShader:JT.sprite_vert,fragmentShader:JT.sprite_frag},background:{uniforms:{uvTransform:{value:new uA},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:JT.background_vert,fragmentShader:JT.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:JT.backgroundCube_vert,fragmentShader:JT.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:JT.cube_vert,fragmentShader:JT.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:JT.equirect_vert,fragmentShader:JT.equirect_frag},distanceRGBA:{uniforms:OT([$T.common,$T.displacementmap,{referencePosition:{value:new FA},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:JT.distanceRGBA_vert,fragmentShader:JT.distanceRGBA_frag},shadow:{uniforms:OT([$T.lights,$T.fog,{color:{value:new MA(0)},opacity:{value:1}}]),vertexShader:JT.shadow_vert,fragmentShader:JT.shadow_frag}};eP.physical={uniforms:OT([eP.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new hA(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new MA(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new hA},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new MA(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new MA(1,1,1)},specularColorMap:{value:null}}]),vertexShader:JT.meshphysical_vert,fragmentShader:JT.meshphysical_frag};var tP={r:0,b:0,g:0};function iP(e,t,i,n,r,a,s){let o,l,c=new MA(0),h=!0===a?0:1,u=null,d=0,p=null;function f(t,i){t.getRGB(tP,IT(e)),n.buffers.color.setClear(tP.r,tP.g,tP.b,i,s)}return{getClearColor:function(){return c},setClearColor:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;c.set(e),h=t,f(c,h)},getClearAlpha:function(){return h},setClearAlpha:function(e){h=e,f(c,h)},render:function(n,a){let s=!1,m=!0===a.isScene?a.background:null;m&&m.isTexture&&(m=(a.backgroundBlurriness>0?i:t).get(m));let g=e.xr,v=g.getSession&&g.getSession();v&&"additive"===v.environmentBlendMode&&(m=null),null===m?f(c,h):m&&m.isColor&&(f(m,1),s=!0),(e.autoClear||s)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),m&&(m.isCubeTexture||m.mapping===wE)?(void 0===l&&(l=new TT(new DT(1,1,1),new LT({name:"BackgroundCubeMaterial",uniforms:kT(eP.backgroundCube.uniforms),vertexShader:eP.backgroundCube.vertexShader,fragmentShader:eP.backgroundCube.fragmentShader,side:DS,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(e,t,i){this.matrixWorld.copyPosition(i.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(l)),l.material.uniforms.envMap.value=m,l.material.uniforms.flipEnvMap.value=m.isCubeTexture&&!1===m.isRenderTargetTexture?-1:1,l.material.uniforms.backgroundBlurriness.value=a.backgroundBlurriness,l.material.uniforms.backgroundIntensity.value=a.backgroundIntensity,l.material.toneMapped=m.encoding!==NC,(u!==m||d!==m.version||p!==e.toneMapping)&&(l.material.needsUpdate=!0,u=m,d=m.version,p=e.toneMapping),l.layers.enableAll(),n.unshift(l,l.geometry,l.material,0,0,null)):m&&m.isTexture&&(void 0===o&&(o=new TT(new KT(2,2),new LT({name:"BackgroundMaterial",uniforms:kT(eP.background.uniforms),vertexShader:eP.background.vertexShader,fragmentShader:eP.background.fragmentShader,side:PS,depthTest:!1,depthWrite:!1,fog:!1})),o.geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(o)),o.material.uniforms.t2D.value=m,o.material.uniforms.backgroundIntensity.value=a.backgroundIntensity,o.material.toneMapped=m.encoding!==NC,!0===m.matrixAutoUpdate&&m.updateMatrix(),o.material.uniforms.uvTransform.value.copy(m.matrix),(u!==m||d!==m.version||p!==e.toneMapping)&&(o.material.needsUpdate=!0,u=m,d=m.version,p=e.toneMapping),o.layers.enableAll(),n.unshift(o,o.geometry,o.material,0,0,null))}}}function nP(e,t,i,n){let r=e.getParameter(34921),a=n.isWebGL2?null:t.get("OES_vertex_array_object"),s=n.isWebGL2||null!==a,o={},l=p(null),c=l,h=!1;function u(t){return n.isWebGL2?e.bindVertexArray(t):a.bindVertexArrayOES(t)}function d(t){return n.isWebGL2?e.deleteVertexArray(t):a.deleteVertexArrayOES(t)}function p(e){let t=[],i=[],n=[];for(let a=0;a<r;a++)t[a]=0,i[a]=0,n[a]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:i,attributeDivisors:n,object:e,attributes:{},index:null}}function f(){let e=c.newAttributes;for(let t=0,i=e.length;t<i;t++)e[t]=0}function m(e){g(e,0)}function g(i,r){let a=c.newAttributes,s=c.enabledAttributes,o=c.attributeDivisors;a[i]=1,0===s[i]&&(e.enableVertexAttribArray(i),s[i]=1),o[i]!==r&&((n.isWebGL2?e:t.get("ANGLE_instanced_arrays"))[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](i,r),o[i]=r)}function v(){let t=c.newAttributes,i=c.enabledAttributes;for(let n=0,r=i.length;n<r;n++)i[n]!==t[n]&&(e.disableVertexAttribArray(n),i[n]=0)}function y(t,i,r,a,s,o){!0!==n.isWebGL2||5124!==r&&5125!==r?e.vertexAttribPointer(t,i,r,a,s,o):e.vertexAttribIPointer(t,i,r,s,o)}function b(){x(),h=!0,c!==l&&(c=l,u(c.object))}function x(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function(r,l,d,b,x){let w=!1;if(s){let t=function(t,i,r){let s=!0===r.wireframe,l=o[t.id];void 0===l&&(l={},o[t.id]=l);let c=l[i.id];void 0===c&&(c={},l[i.id]=c);let h=c[s];return void 0===h&&(h=p(n.isWebGL2?e.createVertexArray():a.createVertexArrayOES()),c[s]=h),h}(b,d,l);c!==t&&(c=t,u(c.object)),w=function(e,t,i,n){let r=c.attributes,a=t.attributes,s=0,o=i.getAttributes();for(let l in o)if(o[l].location>=0){let t=r[l],i=a[l];if(void 0===i&&("instanceMatrix"===l&&e.instanceMatrix&&(i=e.instanceMatrix),"instanceColor"===l&&e.instanceColor&&(i=e.instanceColor)),void 0===t||t.attribute!==i||i&&t.data!==i.data)return!0;s++}return c.attributesNum!==s||c.index!==n}(r,b,d,x),w&&function(e,t,i,n){let r={},a=t.attributes,s=0,o=i.getAttributes();for(let l in o)if(o[l].location>=0){let t=a[l];void 0===t&&("instanceMatrix"===l&&e.instanceMatrix&&(t=e.instanceMatrix),"instanceColor"===l&&e.instanceColor&&(t=e.instanceColor));let i={};i.attribute=t,t&&t.data&&(i.data=t.data),r[l]=i,s++}c.attributes=r,c.attributesNum=s,c.index=n}(r,b,d,x)}else{let e=!0===l.wireframe;(c.geometry!==b.id||c.program!==d.id||c.wireframe!==e)&&(c.geometry=b.id,c.program=d.id,c.wireframe=e,w=!0)}null!==x&&i.update(x,34963),(w||h)&&(h=!1,function(r,a,s,o){if(!1===n.isWebGL2&&(r.isInstancedMesh||o.isInstancedBufferGeometry)&&null===t.get("ANGLE_instanced_arrays"))return;f();let l=o.attributes,c=s.getAttributes(),h=a.defaultAttributeValues;for(let t in c){let n=c[t];if(n.location>=0){let a=l[t];if(void 0===a&&("instanceMatrix"===t&&r.instanceMatrix&&(a=r.instanceMatrix),"instanceColor"===t&&r.instanceColor&&(a=r.instanceColor)),void 0!==a){let t=a.normalized,s=a.itemSize,l=i.get(a);if(void 0===l)continue;let c=l.buffer,h=l.type,u=l.bytesPerElement;if(a.isInterleavedBufferAttribute){let i=a.data,l=i.stride,d=a.offset;if(i.isInstancedInterleavedBuffer){for(let e=0;e<n.locationSize;e++)g(n.location+e,i.meshPerAttribute);!0!==r.isInstancedMesh&&void 0===o._maxInstanceCount&&(o._maxInstanceCount=i.meshPerAttribute*i.count)}else for(let e=0;e<n.locationSize;e++)m(n.location+e);e.bindBuffer(34962,c);for(let e=0;e<n.locationSize;e++)y(n.location+e,s/n.locationSize,h,t,l*u,(d+s/n.locationSize*e)*u)}else{if(a.isInstancedBufferAttribute){for(let e=0;e<n.locationSize;e++)g(n.location+e,a.meshPerAttribute);!0!==r.isInstancedMesh&&void 0===o._maxInstanceCount&&(o._maxInstanceCount=a.meshPerAttribute*a.count)}else for(let e=0;e<n.locationSize;e++)m(n.location+e);e.bindBuffer(34962,c);for(let e=0;e<n.locationSize;e++)y(n.location+e,s/n.locationSize,h,t,s*u,s/n.locationSize*e*u)}}else if(void 0!==h){let i=h[t];if(void 0!==i)switch(i.length){case 2:e.vertexAttrib2fv(n.location,i);break;case 3:e.vertexAttrib3fv(n.location,i);break;case 4:e.vertexAttrib4fv(n.location,i);break;default:e.vertexAttrib1fv(n.location,i)}}}}v()}(r,l,d,b),null!==x&&e.bindBuffer(34963,i.get(x).buffer))},reset:b,resetDefaultState:x,dispose:function(){b();for(let e in o){let t=o[e];for(let e in t){let i=t[e];for(let e in i)d(i[e].object),delete i[e];delete t[e]}delete o[e]}},releaseStatesOfGeometry:function(e){if(void 0===o[e.id])return;let t=o[e.id];for(let i in t){let e=t[i];for(let t in e)d(e[t].object),delete e[t];delete t[i]}delete o[e.id]},releaseStatesOfProgram:function(e){for(let t in o){let i=o[t];if(void 0===i[e.id])continue;let n=i[e.id];for(let e in n)d(n[e].object),delete n[e];delete i[e.id]}},initAttributes:f,enableAttribute:m,disableUnusedAttributes:v}}function rP(e,t,i,n){let r,a=n.isWebGL2;this.setMode=function(e){r=e},this.render=function(t,n){e.drawArrays(r,t,n),i.update(n,r,1)},this.renderInstances=function(n,s,o){if(0===o)return;let l,c;if(a)l=e,c="drawArraysInstanced";else if(l=t.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](r,n,s,o),i.update(s,r,o)}}function aP(e,t,i){let n;function r(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}let a=typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext,s=void 0!==i.precision?i.precision:"highp",o=r(s);o!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",o,"instead."),s=o);let l=a||t.has("WEBGL_draw_buffers"),c=!0===i.logarithmicDepthBuffer,h=e.getParameter(34930),u=e.getParameter(35660),d=e.getParameter(3379),p=e.getParameter(34076),f=e.getParameter(34921),m=e.getParameter(36347),g=e.getParameter(36348),v=e.getParameter(36349),y=u>0,b=a||t.has("OES_texture_float");return{isWebGL2:a,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==n)return n;if(!0===t.has("EXT_texture_filter_anisotropic")){let i=t.get("EXT_texture_filter_anisotropic");n=e.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n},getMaxPrecision:r,precision:s,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:v,vertexTextures:y,floatFragmentTextures:b,floatVertexTextures:y&&b,maxSamples:a?e.getParameter(36183):0}}function sP(e){let t=this,i=null,n=0,r=!1,a=!1,s=new WT,o=new uA,l={value:null,needsUpdate:!1};function c(e,i,n,r){let a=null!==e?e.length:0,c=null;if(0!==a){if(c=l.value,!0!==r||null===c){let t=n+4*a,r=i.matrixWorldInverse;o.getNormalMatrix(r),(null===c||c.length<t)&&(c=new Float32Array(t));for(let i=0,l=n;i!==a;++i,l+=4)s.copy(e[i]).applyMatrix4(r,o),s.normal.toArray(c,l),c[l+3]=s.constant}l.value=c,l.needsUpdate=!0}return t.numPlanes=a,t.numIntersection=0,c}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){let i=0!==e.length||t||0!==n||r;return r=t,n=e.length,i},this.beginShadows=function(){a=!0,c(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(e,t){i=c(e,t,0)},this.setState=function(s,o,h){let u=s.clippingPlanes,d=s.clipIntersection,p=s.clipShadows,f=e.get(s);if(!r||null===u||0===u.length||a&&!p)a?c(null):(l.value!==i&&(l.value=i,l.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0);else{let e=a?0:n,t=4*e,r=f.clippingState||null;l.value=r,r=c(u,o,t,h);for(let n=0;n!==t;++n)r[n]=i[n];f.clippingState=r,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=e}}}function oP(e){let t=new WeakMap;function i(e,t){return t===bE?e.mapping=vE:t===xE&&(e.mapping=yE),e}function n(e){let i=e.target;i.removeEventListener("dispose",n);let r=t.get(i);void 0!==r&&(t.delete(i),r.dispose())}return{get:function(r){if(r&&r.isTexture&&!1===r.isRenderTargetTexture){let a=r.mapping;if(a===bE||a===xE){if(t.has(r)){return i(t.get(r).texture,r.mapping)}{let a=r.image;if(a&&a.height>0){let s=new VT(a.height/2);return s.fromEquirectangularTexture(e,r),t.set(r,s),r.addEventListener("dispose",n),i(s.texture,r.mapping)}return null}}}return r},dispose:function(){t=new WeakMap}}}var lP=class extends BT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2e3;super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=n,this.near=r,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,i,n,r,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2,r=i-e,a=i+e,s=n+t,o=n-t;if(null!==this.view&&this.view.enabled){let e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=e*this.view.offsetX,a=r+e*this.view.width,s-=t*this.view.offsetY,o=s-t*this.view.height}this.projectionMatrix.makeOrthographic(r,a,s,o,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}},cP=[.125,.215,.35,.446,.526,.582],hP=20,uP=new lP,dP=new MA,pP=null,fP=(1+Math.sqrt(5))/2,mP=1/fP,gP=[new FA(1,1,1),new FA(-1,1,1),new FA(1,1,-1),new FA(-1,1,-1),new FA(0,fP,mP),new FA(0,fP,-mP),new FA(mP,0,fP),new FA(-mP,0,fP),new FA(fP,mP,0),new FA(-fP,mP,0)],vP=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100;pP=this._renderer.getRenderTarget(),this._setSize(256);let r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(e,i,n,r),t>0&&this._blur(r,0,0,t),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this._fromTexture(e,t)}fromCubemap(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=wP(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=xP(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(pP),e.scissorTest=!1,bP(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===vE||e.mapping===yE?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),pP=this._renderer.getRenderTarget();let i=t||this._allocateTargets();return this._textureToCubeUV(e,i),this._applyPMREM(i),this._cleanup(i),i}_allocateTargets(){let e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,i={magFilter:TE,minFilter:TE,generateMipmaps:!1,type:NE,format:GE,encoding:zC,depthBuffer:!1},n=yP(e,t,i);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=yP(e,t,i);let{_lodMax:n}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(e){let t=[],i=[],n=[],r=e,a=e-4+1+cP.length;for(let s=0;s<a;s++){let a=Math.pow(2,r);i.push(a);let o=1/a;s>e-4?o=cP[s-e+4-1]:0===s&&(o=0),n.push(o);let l=1/(a-2),c=-l,h=1+l,u=[c,c,h,c,h,h,c,c,h,h,c,h],d=6,p=6,f=3,m=2,g=1,v=new Float32Array(f*p*d),y=new Float32Array(m*p*d),b=new Float32Array(g*p*d);for(let e=0;e<d;e++){let t=e%3*2/3-1,i=e>2?0:-1,n=[t,i,0,t+2/3,i,0,t+2/3,i+1,0,t,i,0,t+2/3,i+1,0,t,i+1,0];v.set(n,f*p*e),y.set(u,m*p*e);let r=[e,e,e,e,e,e];b.set(r,g*p*e)}let x=new fT;x.setAttribute("position",new nT(v,f)),x.setAttribute("uv",new nT(y,m)),x.setAttribute("faceIndex",new nT(b,g)),t.push(x),r>4&&r--}return{lodPlanes:t,sizeLods:i,sigmas:n}}(n)),this._blurMaterial=function(e,t,i){let n=new Float32Array(hP),r=new FA(0,1,0);return new LT({name:"SphericalGaussianBlur",defines:{n:hP,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/i,CUBEUV_MAX_MIP:"".concat(e,".0")},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:OS,depthTest:!1,depthWrite:!1})}(n,e,t)}return n}_compileMaterial(e){let t=new TT(this._lodPlanes[0],e);this._renderer.compile(t,uP)}_sceneToCubeUV(e,t,i,n){let r=new zT(90,1,t,i),a=[1,-1,1,1,1,1],s=[1,1,1,-1,-1,-1],o=this._renderer,l=o.autoClear,c=o.toneMapping;o.getClearColor(dP),o.toneMapping=uE,o.autoClear=!1;let h=new eT({name:"PMREM.Background",side:DS,depthWrite:!1,depthTest:!1}),u=new TT(new DT,h),d=!1,p=e.background;p?p.isColor&&(h.color.copy(p),e.background=null,d=!0):(h.color.copy(dP),d=!0);for(let f=0;f<6;f++){let t=f%3;0===t?(r.up.set(0,a[f],0),r.lookAt(s[f],0,0)):1===t?(r.up.set(0,0,a[f]),r.lookAt(0,s[f],0)):(r.up.set(0,a[f],0),r.lookAt(0,0,s[f]));let i=this._cubeSize;bP(n,t*i,f>2?i:0,i,i),o.setRenderTarget(n),d&&o.render(u,r),o.render(e,r)}u.geometry.dispose(),u.material.dispose(),o.toneMapping=c,o.autoClear=l,e.background=p}_textureToCubeUV(e,t){let i=this._renderer,n=e.mapping===vE||e.mapping===yE;n?(null===this._cubemapMaterial&&(this._cubemapMaterial=wP()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=xP());let r=n?this._cubemapMaterial:this._equirectMaterial,a=new TT(this._lodPlanes[0],r);r.uniforms.envMap.value=e;let s=this._cubeSize;bP(t,0,0,3*s,2*s),i.setRenderTarget(t),i.render(a,uP)}_applyPMREM(e){let t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let n=1;n<this._lodPlanes.length;n++){let t=Math.sqrt(this._sigmas[n]*this._sigmas[n]-this._sigmas[n-1]*this._sigmas[n-1]),i=gP[(n-1)%gP.length];this._blur(e,n-1,n,t,i)}t.autoClear=i}_blur(e,t,i,n,r){let a=this._pingPongRenderTarget;this._halfBlur(e,a,t,i,n,"latitudinal",r),this._halfBlur(a,e,i,i,n,"longitudinal",r)}_halfBlur(e,t,i,n,r,a,s){let o=this._renderer,l=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");let c=new TT(this._lodPlanes[n],l),h=l.uniforms,u=this._sizeLods[i]-1,d=isFinite(r)?Math.PI/(2*u):2*Math.PI/39,p=r/d,f=isFinite(r)?1+Math.floor(3*p):hP;f>hP&&console.warn("sigmaRadians, ".concat(r,", is too large and will clip, as it requested ").concat(f," samples when the maximum is set to ").concat(hP));let m=[],g=0;for(let b=0;b<hP;++b){let e=b/p,t=Math.exp(-e*e/2);m.push(t),0===b?g+=t:b<f&&(g+=2*t)}for(let b=0;b<m.length;b++)m[b]=m[b]/g;h.envMap.value=e.texture,h.samples.value=f,h.weights.value=m,h.latitudinal.value="latitudinal"===a,s&&(h.poleAxis.value=s);let{_lodMax:v}=this;h.dTheta.value=d,h.mipInt.value=v-i;let y=this._sizeLods[n];bP(t,3*y*(n>v-4?n-v+4:0),4*(this._cubeSize-y),3*y,2*y),o.setRenderTarget(t),o.render(c,uP)}};function yP(e,t,i){let n=new LA(e,t,i);return n.texture.mapping=wE,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function bP(e,t,i,n,r){e.viewport.set(t,i,n,r),e.scissor.set(t,i,n,r)}function xP(){return new LT({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:OS,depthTest:!1,depthWrite:!1})}function wP(){return new LT({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:OS,depthTest:!1,depthWrite:!1})}function _P(e){let t=new WeakMap,i=null;function n(e){let i=e.target;i.removeEventListener("dispose",n);let r=t.get(i);void 0!==r&&(t.delete(i),r.dispose())}return{get:function(r){if(r&&r.isTexture){let a=r.mapping,s=a===bE||a===xE,o=a===vE||a===yE;if(s||o){if(r.isRenderTargetTexture&&!0===r.needsPMREMUpdate){r.needsPMREMUpdate=!1;let n=t.get(r);return null===i&&(i=new vP(e)),n=s?i.fromEquirectangular(r,n):i.fromCubemap(r,n),t.set(r,n),n.texture}if(t.has(r))return t.get(r).texture;{let a=r.image;if(s&&a&&a.height>0||o&&a&&function(e){let t=0,i=6;for(let n=0;n<i;n++)void 0!==e[n]&&t++;return t===i}(a)){null===i&&(i=new vP(e));let a=s?i.fromEquirectangular(r):i.fromCubemap(r);return t.set(r,a),r.addEventListener("dispose",n),a.texture}return null}}}return r},dispose:function(){t=new WeakMap,null!==i&&(i.dispose(),i=null)}}}function SP(e){let t={};function i(i){if(void 0!==t[i])return t[i];let n;switch(i){case"WEBGL_depth_texture":n=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=e.getExtension(i)}return t[i]=n,n}return{has:function(e){return null!==i(e)},init:function(e){e.isWebGL2?i("EXT_color_buffer_float"):(i("WEBGL_depth_texture"),i("OES_texture_float"),i("OES_texture_half_float"),i("OES_texture_half_float_linear"),i("OES_standard_derivatives"),i("OES_element_index_uint"),i("OES_vertex_array_object"),i("ANGLE_instanced_arrays")),i("OES_texture_float_linear"),i("EXT_color_buffer_half_float"),i("WEBGL_multisampled_render_to_texture")},get:function(e){let t=i(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function EP(e,t,i,n){let r={},a=new WeakMap;function s(e){let o=e.target;null!==o.index&&t.remove(o.index);for(let i in o.attributes)t.remove(o.attributes[i]);o.removeEventListener("dispose",s),delete r[o.id];let l=a.get(o);l&&(t.remove(l),a.delete(o)),n.releaseStatesOfGeometry(o),!0===o.isInstancedBufferGeometry&&delete o._maxInstanceCount,i.memory.geometries--}function o(e){let i=[],n=e.index,r=e.attributes.position,s=0;if(null!==n){let e=n.array;s=n.version;for(let t=0,n=e.length;t<n;t+=3){let n=e[t+0],r=e[t+1],a=e[t+2];i.push(n,r,r,a,a,n)}}else{let e=r.array;s=r.version;for(let t=0,n=e.length/3-1;t<n;t+=3){let e=t+0,n=t+1,r=t+2;i.push(e,n,n,r,r,e)}}let o=new(pA(i)?aT:rT)(i,1);o.version=s;let l=a.get(e);l&&t.remove(l),a.set(e,o)}return{get:function(e,t){return!0===r[t.id]||(t.addEventListener("dispose",s),r[t.id]=!0,i.memory.geometries++),t},update:function(e){let i=e.attributes;for(let r in i)t.update(i[r],34962);let n=e.morphAttributes;for(let r in n){let e=n[r];for(let i=0,n=e.length;i<n;i++)t.update(e[i],34962)}},getWireframeAttribute:function(e){let t=a.get(e);if(t){let i=e.index;null!==i&&t.version<i.version&&o(e)}else o(e);return a.get(e)}}}function CP(e,t,i,n){let r,a,s,o=n.isWebGL2;this.setMode=function(e){r=e},this.setIndex=function(e){a=e.type,s=e.bytesPerElement},this.render=function(t,n){e.drawElements(r,n,a,t*s),i.update(n,r,1)},this.renderInstances=function(n,l,c){if(0===c)return;let h,u;if(o)h=e,u="drawElementsInstanced";else if(h=t.get("ANGLE_instanced_arrays"),u="drawElementsInstancedANGLE",null===h)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[u](r,l,a,n*s,c),i.update(l,r,c)}}function AP(e){let t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(e,i,n){switch(t.calls++,i){case 4:t.triangles+=n*(e/3);break;case 1:t.lines+=n*(e/2);break;case 3:t.lines+=n*(e-1);break;case 2:t.lines+=n*e;break;case 0:t.points+=n*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",i)}}}}function MP(e,t){return e[0]-t[0]}function TP(e,t){return Math.abs(t[1])-Math.abs(e[1])}function PP(e,t,i){let n={},r=new Float32Array(8),a=new WeakMap,s=new RA,o=[];for(let l=0;l<8;l++)o[l]=[l,0];return{update:function(l,c,h,u){let d=l.morphTargetInfluences;if(!0===t.isWebGL2){let n=c.morphAttributes.position||c.morphAttributes.normal||c.morphAttributes.color,r=void 0!==n?n.length:0,o=a.get(c);if(void 0===o||o.count!==r){let e=function(){v.dispose(),a.delete(c),c.removeEventListener("dispose",e)};void 0!==o&&o.texture.dispose();let i=void 0!==c.morphAttributes.position,n=void 0!==c.morphAttributes.normal,l=void 0!==c.morphAttributes.color,h=c.morphAttributes.position||[],u=c.morphAttributes.normal||[],d=c.morphAttributes.color||[],p=0;!0===i&&(p=1),!0===n&&(p=2),!0===l&&(p=3);let f=c.attributes.position.count*p,m=1;f>t.maxTextureSize&&(m=Math.ceil(f/t.maxTextureSize),f=t.maxTextureSize);let g=new Float32Array(f*m*4*r),v=new BA(g,f,m,r);v.type=zE,v.needsUpdate=!0;let y=4*p;for(let t=0;t<r;t++){let e=h[t],r=u[t],a=d[t],o=f*m*4*t;for(let t=0;t<e.count;t++){let c=t*y;!0===i&&(s.fromBufferAttribute(e,t),g[o+c+0]=s.x,g[o+c+1]=s.y,g[o+c+2]=s.z,g[o+c+3]=0),!0===n&&(s.fromBufferAttribute(r,t),g[o+c+4]=s.x,g[o+c+5]=s.y,g[o+c+6]=s.z,g[o+c+7]=0),!0===l&&(s.fromBufferAttribute(a,t),g[o+c+8]=s.x,g[o+c+9]=s.y,g[o+c+10]=s.z,g[o+c+11]=4===a.itemSize?s.w:1)}}o={count:r,texture:v,size:new hA(f,m)},a.set(c,o),c.addEventListener("dispose",e)}let l=0;for(let e=0;e<d.length;e++)l+=d[e];let h=c.morphTargetsRelative?1:1-l;u.getUniforms().setValue(e,"morphTargetBaseInfluence",h),u.getUniforms().setValue(e,"morphTargetInfluences",d),u.getUniforms().setValue(e,"morphTargetsTexture",o.texture,i),u.getUniforms().setValue(e,"morphTargetsTextureSize",o.size)}else{let t=void 0===d?0:d.length,i=n[c.id];if(void 0===i||i.length!==t){i=[];for(let e=0;e<t;e++)i[e]=[e,0];n[c.id]=i}for(let e=0;e<t;e++){let t=i[e];t[0]=e,t[1]=d[e]}i.sort(TP);for(let e=0;e<8;e++)e<t&&i[e][1]?(o[e][0]=i[e][0],o[e][1]=i[e][1]):(o[e][0]=Number.MAX_SAFE_INTEGER,o[e][1]=0);o.sort(MP);let a=c.morphAttributes.position,s=c.morphAttributes.normal,l=0;for(let e=0;e<8;e++){let t=o[e],i=t[0],n=t[1];i!==Number.MAX_SAFE_INTEGER&&n?(a&&c.getAttribute("morphTarget"+e)!==a[i]&&c.setAttribute("morphTarget"+e,a[i]),s&&c.getAttribute("morphNormal"+e)!==s[i]&&c.setAttribute("morphNormal"+e,s[i]),r[e]=n,l+=n):(a&&!0===c.hasAttribute("morphTarget"+e)&&c.deleteAttribute("morphTarget"+e),s&&!0===c.hasAttribute("morphNormal"+e)&&c.deleteAttribute("morphNormal"+e),r[e]=0)}let h=c.morphTargetsRelative?1:1-l;u.getUniforms().setValue(e,"morphTargetBaseInfluence",h),u.getUniforms().setValue(e,"morphTargetInfluences",r)}}}}function DP(e,t,i,n){let r=new WeakMap;function a(e){let t=e.target;t.removeEventListener("dispose",a),i.remove(t.instanceMatrix),null!==t.instanceColor&&i.remove(t.instanceColor)}return{update:function(e){let s=n.render.frame,o=e.geometry,l=t.get(e,o);return r.get(l)!==s&&(t.update(l),r.set(l,s)),e.isInstancedMesh&&(!1===e.hasEventListener("dispose",a)&&e.addEventListener("dispose",a),i.update(e.instanceMatrix,34962),null!==e.instanceColor&&i.update(e.instanceColor,34962)),l},dispose:function(){r=new WeakMap}}}var kP=new IA,OP=new BA,IP=new class extends IA{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:n},this.magFilter=CE,this.minFilter=CE,this.wrapR=SE,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},RP=new jT,LP=[],BP=[],zP=new Float32Array(16),NP=new Float32Array(9),FP=new Float32Array(4);function jP(e,t,i){let n=e[0];if(n<=0||n>0)return e;let r=t*i,a=LP[r];if(void 0===a&&(a=new Float32Array(r),LP[r]=a),0!==t){n.toArray(a,0);for(let n=1,r=0;n!==t;++n)r+=i,e[n].toArray(a,r)}return a}function VP(e,t){if(e.length!==t.length)return!1;for(let i=0,n=e.length;i<n;i++)if(e[i]!==t[i])return!1;return!0}function UP(e,t){for(let i=0,n=t.length;i<n;i++)e[i]=t[i]}function GP(e,t){let i=BP[t];void 0===i&&(i=new Int32Array(t),BP[t]=i);for(let n=0;n!==t;++n)i[n]=e.allocateTextureUnit();return i}function HP(e,t){let i=this.cache;i[0]!==t&&(e.uniform1f(this.addr,t),i[0]=t)}function WP(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y)&&(e.uniform2f(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if(VP(i,t))return;e.uniform2fv(this.addr,t),UP(i,t)}}function qP(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z)&&(e.uniform3f(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else if(void 0!==t.r)(i[0]!==t.r||i[1]!==t.g||i[2]!==t.b)&&(e.uniform3f(this.addr,t.r,t.g,t.b),i[0]=t.r,i[1]=t.g,i[2]=t.b);else{if(VP(i,t))return;e.uniform3fv(this.addr,t),UP(i,t)}}function XP(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z||i[3]!==t.w)&&(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if(VP(i,t))return;e.uniform4fv(this.addr,t),UP(i,t)}}function YP(e,t){let i=this.cache,n=t.elements;if(void 0===n){if(VP(i,t))return;e.uniformMatrix2fv(this.addr,!1,t),UP(i,t)}else{if(VP(i,n))return;FP.set(n),e.uniformMatrix2fv(this.addr,!1,FP),UP(i,n)}}function QP(e,t){let i=this.cache,n=t.elements;if(void 0===n){if(VP(i,t))return;e.uniformMatrix3fv(this.addr,!1,t),UP(i,t)}else{if(VP(i,n))return;NP.set(n),e.uniformMatrix3fv(this.addr,!1,NP),UP(i,n)}}function ZP(e,t){let i=this.cache,n=t.elements;if(void 0===n){if(VP(i,t))return;e.uniformMatrix4fv(this.addr,!1,t),UP(i,t)}else{if(VP(i,n))return;zP.set(n),e.uniformMatrix4fv(this.addr,!1,zP),UP(i,n)}}function KP(e,t){let i=this.cache;i[0]!==t&&(e.uniform1i(this.addr,t),i[0]=t)}function JP(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y)&&(e.uniform2i(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if(VP(i,t))return;e.uniform2iv(this.addr,t),UP(i,t)}}function $P(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z)&&(e.uniform3i(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else{if(VP(i,t))return;e.uniform3iv(this.addr,t),UP(i,t)}}function eD(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z||i[3]!==t.w)&&(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if(VP(i,t))return;e.uniform4iv(this.addr,t),UP(i,t)}}function tD(e,t){let i=this.cache;i[0]!==t&&(e.uniform1ui(this.addr,t),i[0]=t)}function iD(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y)&&(e.uniform2ui(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if(VP(i,t))return;e.uniform2uiv(this.addr,t),UP(i,t)}}function nD(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z)&&(e.uniform3ui(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else{if(VP(i,t))return;e.uniform3uiv(this.addr,t),UP(i,t)}}function rD(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z||i[3]!==t.w)&&(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if(VP(i,t))return;e.uniform4uiv(this.addr,t),UP(i,t)}}function aD(e,t,i){let n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(e.uniform1i(this.addr,r),n[0]=r),i.setTexture2D(t||kP,r)}function sD(e,t,i){let n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(e.uniform1i(this.addr,r),n[0]=r),i.setTexture3D(t||IP,r)}function oD(e,t,i){let n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(e.uniform1i(this.addr,r),n[0]=r),i.setTextureCube(t||RP,r)}function lD(e,t,i){let n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(e.uniform1i(this.addr,r),n[0]=r),i.setTexture2DArray(t||OP,r)}function cD(e,t){e.uniform1fv(this.addr,t)}function hD(e,t){let i=jP(t,this.size,2);e.uniform2fv(this.addr,i)}function uD(e,t){let i=jP(t,this.size,3);e.uniform3fv(this.addr,i)}function dD(e,t){let i=jP(t,this.size,4);e.uniform4fv(this.addr,i)}function pD(e,t){let i=jP(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,i)}function fD(e,t){let i=jP(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,i)}function mD(e,t){let i=jP(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,i)}function gD(e,t){e.uniform1iv(this.addr,t)}function vD(e,t){e.uniform2iv(this.addr,t)}function yD(e,t){e.uniform3iv(this.addr,t)}function bD(e,t){e.uniform4iv(this.addr,t)}function xD(e,t){e.uniform1uiv(this.addr,t)}function wD(e,t){e.uniform2uiv(this.addr,t)}function _D(e,t){e.uniform3uiv(this.addr,t)}function SD(e,t){e.uniform4uiv(this.addr,t)}function ED(e,t,i){let n=this.cache,r=t.length,a=GP(i,r);VP(n,a)||(e.uniform1iv(this.addr,a),UP(n,a));for(let s=0;s!==r;++s)i.setTexture2D(t[s]||kP,a[s])}function CD(e,t,i){let n=this.cache,r=t.length,a=GP(i,r);VP(n,a)||(e.uniform1iv(this.addr,a),UP(n,a));for(let s=0;s!==r;++s)i.setTexture3D(t[s]||IP,a[s])}function AD(e,t,i){let n=this.cache,r=t.length,a=GP(i,r);VP(n,a)||(e.uniform1iv(this.addr,a),UP(n,a));for(let s=0;s!==r;++s)i.setTextureCube(t[s]||RP,a[s])}function MD(e,t,i){let n=this.cache,r=t.length,a=GP(i,r);VP(n,a)||(e.uniform1iv(this.addr,a),UP(n,a));for(let s=0;s!==r;++s)i.setTexture2DArray(t[s]||OP,a[s])}var TD=class{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.setValue=function(e){switch(e){case 5126:return HP;case 35664:return WP;case 35665:return qP;case 35666:return XP;case 35674:return YP;case 35675:return QP;case 35676:return ZP;case 5124:case 35670:return KP;case 35667:case 35671:return JP;case 35668:case 35672:return $P;case 35669:case 35673:return eD;case 5125:return tD;case 36294:return iD;case 36295:return nD;case 36296:return rD;case 35678:case 36198:case 36298:case 36306:case 35682:return aD;case 35679:case 36299:case 36307:return sD;case 35680:case 36300:case 36308:case 36293:return oD;case 36289:case 36303:case 36311:case 36292:return lD}}(t.type)}},PD=class{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.size=t.size,this.setValue=function(e){switch(e){case 5126:return cD;case 35664:return hD;case 35665:return uD;case 35666:return dD;case 35674:return pD;case 35675:return fD;case 35676:return mD;case 5124:case 35670:return gD;case 35667:case 35671:return vD;case 35668:case 35672:return yD;case 35669:case 35673:return bD;case 5125:return xD;case 36294:return wD;case 36295:return _D;case 36296:return SD;case 35678:case 36198:case 36298:case 36306:case 35682:return ED;case 35679:case 36299:case 36307:return CD;case 35680:case 36300:case 36308:case 36293:return AD;case 36289:case 36303:case 36311:case 36292:return MD}}(t.type)}},DD=class{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,i){let n=this.seq;for(let r=0,a=n.length;r!==a;++r){let a=n[r];a.setValue(e,t[a.id],i)}}},kD=/(\w+)(\])?(\[|\.)?/g;function OD(e,t){e.seq.push(t),e.map[t.id]=t}function ID(e,t,i){let n=e.name,r=n.length;for(kD.lastIndex=0;;){let a=kD.exec(n),s=kD.lastIndex,o=a[1],l="]"===a[2],c=a[3];if(l&&(o|=0),void 0===c||"["===c&&s+2===r){OD(i,void 0===c?new TD(o,e,t):new PD(o,e,t));break}{let e=i.map[o];void 0===e&&(e=new DD(o),OD(i,e)),i=e}}}var RD=class{constructor(e,t){this.seq=[],this.map={};let i=e.getProgramParameter(t,35718);for(let n=0;n<i;++n){let i=e.getActiveUniform(t,n);ID(i,e.getUniformLocation(t,i.name),this)}}setValue(e,t,i,n){let r=this.map[t];void 0!==r&&r.setValue(e,i,n)}setOptional(e,t,i){let n=t[i];void 0!==n&&this.setValue(e,i,n)}static upload(e,t,i,n){for(let r=0,a=t.length;r!==a;++r){let a=t[r],s=i[a.id];!1!==s.needsUpdate&&a.setValue(e,s.value,n)}}static seqWithValue(e,t){let i=[];for(let n=0,r=e.length;n!==r;++n){let r=e[n];r.id in t&&i.push(r)}return i}};function LD(e,t,i){let n=e.createShader(t);return e.shaderSource(n,i),e.compileShader(n),n}var BD=0;function zD(e,t,i){let n=e.getShaderParameter(t,35713),r=e.getShaderInfoLog(t).trim();if(n&&""===r)return"";let a=/ERROR: 0:(\d+)/.exec(r);if(a){let n=parseInt(a[1]);return i.toUpperCase()+"\n\n"+r+"\n\n"+function(e,t){let i=e.split("\n"),n=[],r=Math.max(t-6,0),a=Math.min(t+6,i.length);for(let s=r;s<a;s++){let e=s+1;n.push("".concat(e===t?">":" "," ").concat(e,": ").concat(i[s]))}return n.join("\n")}(e.getShaderSource(t),n)}return r}function ND(e,t){let i=function(e){switch(e){case zC:return["Linear","( value )"];case NC:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",e),["Linear","( value )"]}}(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+i[0]+i[1]+"; }"}function FD(e,t){let i;switch(t){case dE:i="Linear";break;case pE:i="Reinhard";break;case fE:i="OptimizedCineon";break;case mE:i="ACESFilmic";break;case gE:i="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),i="Linear"}return"vec3 "+e+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function jD(e){return""!==e}function VD(e,t){let i=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,i).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function UD(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var GD=/^[ \t]*#include +<([\w\d./]+)>/gm;function HD(e){return e.replace(GD,WD)}function WD(e,t){let i=JT[t];if(void 0===i)throw new Error("Can not resolve #include <"+t+">");return HD(i)}var qD=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function XD(e){return e.replace(qD,YD)}function YD(e,t,i,n){let r="";for(let a=parseInt(t);a<parseInt(i);a++)r+=n.replace(/\[\s*i\s*\]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return r}function QD(e){let t="precision "+e.precision+" float;\nprecision "+e.precision+" int;";return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function ZD(e,t,i,n){let r,a,s=e.getContext(),o=i.defines,l=i.vertexShader,c=i.fragmentShader,h=function(e){let t="SHADOWMAP_TYPE_BASIC";return e.shadowMapType===AS?t="SHADOWMAP_TYPE_PCF":e.shadowMapType===MS?t="SHADOWMAP_TYPE_PCF_SOFT":e.shadowMapType===TS&&(t="SHADOWMAP_TYPE_VSM"),t}(i),u=function(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case vE:case yE:t="ENVMAP_TYPE_CUBE";break;case wE:t="ENVMAP_TYPE_CUBE_UV"}return t}(i),d=function(e){let t="ENVMAP_MODE_REFLECTION";e.envMap&&e.envMapMode===yE&&(t="ENVMAP_MODE_REFRACTION");return t}(i),p=function(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case lE:t="ENVMAP_BLENDING_MULTIPLY";break;case cE:t="ENVMAP_BLENDING_MIX";break;case hE:t="ENVMAP_BLENDING_ADD"}return t}(i),f=function(e){let t=e.envMapCubeUVHeight;if(null===t)return null;let i=Math.log2(t)-2,n=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,i),112)),texelHeight:n,maxMip:i}}(i),m=i.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUVHeight||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap||e.transmission)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(jD).join("\n")}(i),g=function(e){let t=[];for(let i in e){let n=e[i];!1!==n&&t.push("#define "+i+" "+n)}return t.join("\n")}(o),v=s.createProgram(),y=i.glslVersion?"#version "+i.glslVersion+"\n":"";i.isRawShaderMaterial?(r=[g].filter(jD).join("\n"),r.length>0&&(r+="\n"),a=[m,g].filter(jD).join("\n"),a.length>0&&(a+="\n")):(r=[QD(i),"#define SHADER_NAME "+i.shaderName,g,i.instancing?"#define USE_INSTANCING":"",i.instancingColor?"#define USE_INSTANCING_COLOR":"",i.supportsVertexTextures?"#define VERTEX_TEXTURES":"",i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+d:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.displacementMap&&i.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",i.specularColorMap?"#define USE_SPECULARCOLORMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.sheenColorMap?"#define USE_SHEENCOLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&!1===i.flatShading?"#define USE_MORPHNORMALS":"",i.morphColors&&i.isWebGL2?"#define USE_MORPHCOLORS":"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+i.morphTextureStride:"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_COUNT "+i.morphTargetsCount:"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+h:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(jD).join("\n"),a=[m,QD(i),"#define SHADER_NAME "+i.shaderName,g,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.matcap?"#define USE_MATCAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+u:"",i.envMap?"#define "+d:"",i.envMap?"#define "+p:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoat?"#define USE_CLEARCOAT":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.iridescence?"#define USE_IRIDESCENCE":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",i.specularColorMap?"#define USE_SPECULARCOLORMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaTest?"#define USE_ALPHATEST":"",i.sheen?"#define USE_SHEEN":"",i.sheenColorMap?"#define USE_SHEENCOLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors||i.instancingColor?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+h:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",i.toneMapping!==uE?"#define TONE_MAPPING":"",i.toneMapping!==uE?JT.tonemapping_pars_fragment:"",i.toneMapping!==uE?FD("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",i.opaque?"#define OPAQUE":"",JT.encodings_pars_fragment,ND("linearToOutputTexel",i.outputEncoding),i.useDepthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(jD).join("\n")),l=HD(l),l=VD(l,i),l=UD(l,i),c=HD(c),c=VD(c,i),c=UD(c,i),l=XD(l),c=XD(c),i.isWebGL2&&!0!==i.isRawShaderMaterial&&(y="#version 300 es\n",r=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+r,a=["#define varying in",i.glslVersion===XC?"":"layout(location = 0) out highp vec4 pc_fragColor;",i.glslVersion===XC?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+a);let b,x,w=y+a+c,_=LD(s,35633,y+r+l),S=LD(s,35632,w);if(s.attachShader(v,_),s.attachShader(v,S),void 0!==i.index0AttributeName?s.bindAttribLocation(v,0,i.index0AttributeName):!0===i.morphTargets&&s.bindAttribLocation(v,0,"position"),s.linkProgram(v),e.debug.checkShaderErrors){let e=s.getProgramInfoLog(v).trim(),t=s.getShaderInfoLog(_).trim(),i=s.getShaderInfoLog(S).trim(),n=!0,o=!0;if(!1===s.getProgramParameter(v,35714)){n=!1;let t=zD(s,_,"vertex"),i=zD(s,S,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(v,35715)+"\n\nProgram Info Log: "+e+"\n"+t+"\n"+i)}else""!==e?console.warn("THREE.WebGLProgram: Program Info Log:",e):(""===t||""===i)&&(o=!1);o&&(this.diagnostics={runnable:n,programLog:e,vertexShader:{log:t,prefix:r},fragmentShader:{log:i,prefix:a}})}return s.deleteShader(_),s.deleteShader(S),this.getUniforms=function(){return void 0===b&&(b=new RD(s,v)),b},this.getAttributes=function(){return void 0===x&&(x=function(e,t){let i={},n=e.getProgramParameter(t,35721);for(let r=0;r<n;r++){let n=e.getActiveAttrib(t,r),a=n.name,s=1;35674===n.type&&(s=2),35675===n.type&&(s=3),35676===n.type&&(s=4),i[a]={type:n.type,location:e.getAttribLocation(t,a),locationSize:s}}return i}(s,v)),x},this.destroy=function(){n.releaseStatesOfProgram(this),s.deleteProgram(v),this.program=void 0},this.name=i.shaderName,this.id=BD++,this.cacheKey=t,this.usedTimes=1,this.program=v,this.vertexShader=_,this.fragmentShader=S,this}var KD=0,JD=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,i=e.fragmentShader,n=this._getShaderStage(t),r=this._getShaderStage(i),a=this._getShaderCacheForMaterial(e);return!1===a.has(n)&&(a.add(n),n.usedTimes++),!1===a.has(r)&&(a.add(r),r.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let i of t)i.usedTimes--,0===i.usedTimes&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,i=t.get(e);return void 0===i&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){let t=this.shaderCache,i=t.get(e);return void 0===i&&(i=new $D(e),t.set(e,i)),i}},$D=class{constructor(e){this.id=KD++,this.code=e,this.usedTimes=0}};function ek(e,t,i,n,r,a,s){let o=new AM,l=new JD,c=[],h=r.isWebGL2,u=r.logarithmicDepthBuffer,d=r.vertexTextures,p=r.precision,f={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};return{getParameters:function(a,o,c,m,g){let v=m.fog,y=g.geometry,b=a.isMeshStandardMaterial?m.environment:null,x=(a.isMeshStandardMaterial?i:t).get(a.envMap||b),w=x&&x.mapping===wE?x.image.height:null,_=f[a.type];null!==a.precision&&(p=r.getMaxPrecision(a.precision),p!==a.precision&&console.warn("THREE.WebGLProgram.getParameters:",a.precision,"not supported, using",p,"instead."));let S,E,C,A,M=y.morphAttributes.position||y.morphAttributes.normal||y.morphAttributes.color,T=void 0!==M?M.length:0,P=0;if(void 0!==y.morphAttributes.position&&(P=1),void 0!==y.morphAttributes.normal&&(P=2),void 0!==y.morphAttributes.color&&(P=3),_){let e=eP[_];S=e.vertexShader,E=e.fragmentShader}else S=a.vertexShader,E=a.fragmentShader,l.update(a),C=l.getVertexShaderID(a),A=l.getFragmentShaderID(a);let D=e.getRenderTarget(),k=a.alphaTest>0,O=a.clearcoat>0,I=a.iridescence>0;return{isWebGL2:h,shaderID:_,shaderName:a.type,vertexShader:S,fragmentShader:E,defines:a.defines,customVertexShaderID:C,customFragmentShaderID:A,isRawShaderMaterial:!0===a.isRawShaderMaterial,glslVersion:a.glslVersion,precision:p,instancing:!0===g.isInstancedMesh,instancingColor:!0===g.isInstancedMesh&&null!==g.instanceColor,supportsVertexTextures:d,outputEncoding:null===D?e.outputEncoding:!0===D.isXRRenderTarget?D.texture.encoding:zC,map:!!a.map,matcap:!!a.matcap,envMap:!!x,envMapMode:x&&x.mapping,envMapCubeUVHeight:w,lightMap:!!a.lightMap,aoMap:!!a.aoMap,emissiveMap:!!a.emissiveMap,bumpMap:!!a.bumpMap,normalMap:!!a.normalMap,objectSpaceNormalMap:a.normalMapType===UC,tangentSpaceNormalMap:a.normalMapType===VC,decodeVideoTexture:!!a.map&&!0===a.map.isVideoTexture&&a.map.encoding===NC,clearcoat:O,clearcoatMap:O&&!!a.clearcoatMap,clearcoatRoughnessMap:O&&!!a.clearcoatRoughnessMap,clearcoatNormalMap:O&&!!a.clearcoatNormalMap,iridescence:I,iridescenceMap:I&&!!a.iridescenceMap,iridescenceThicknessMap:I&&!!a.iridescenceThicknessMap,displacementMap:!!a.displacementMap,roughnessMap:!!a.roughnessMap,metalnessMap:!!a.metalnessMap,specularMap:!!a.specularMap,specularIntensityMap:!!a.specularIntensityMap,specularColorMap:!!a.specularColorMap,opaque:!1===a.transparent&&a.blending===IS,alphaMap:!!a.alphaMap,alphaTest:k,gradientMap:!!a.gradientMap,sheen:a.sheen>0,sheenColorMap:!!a.sheenColorMap,sheenRoughnessMap:!!a.sheenRoughnessMap,transmission:a.transmission>0,transmissionMap:!!a.transmissionMap,thicknessMap:!!a.thicknessMap,combine:a.combine,vertexTangents:!!a.normalMap&&!!y.attributes.tangent,vertexColors:a.vertexColors,vertexAlphas:!0===a.vertexColors&&!!y.attributes.color&&4===y.attributes.color.itemSize,vertexUvs:!!a.map||!!a.bumpMap||!!a.normalMap||!!a.specularMap||!!a.alphaMap||!!a.emissiveMap||!!a.roughnessMap||!!a.metalnessMap||!!a.clearcoatMap||!!a.clearcoatRoughnessMap||!!a.clearcoatNormalMap||!!a.iridescenceMap||!!a.iridescenceThicknessMap||!!a.displacementMap||!!a.transmissionMap||!!a.thicknessMap||!!a.specularIntensityMap||!!a.specularColorMap||!!a.sheenColorMap||!!a.sheenRoughnessMap,uvsVertexOnly:!(a.map||a.bumpMap||a.normalMap||a.specularMap||a.alphaMap||a.emissiveMap||a.roughnessMap||a.metalnessMap||a.clearcoatNormalMap||a.iridescenceMap||a.iridescenceThicknessMap||a.transmission>0||a.transmissionMap||a.thicknessMap||a.specularIntensityMap||a.specularColorMap||a.sheen>0||a.sheenColorMap||a.sheenRoughnessMap)&&!!a.displacementMap,fog:!!v,useFog:!0===a.fog,fogExp2:v&&v.isFogExp2,flatShading:!!a.flatShading,sizeAttenuation:a.sizeAttenuation,logarithmicDepthBuffer:u,skinning:!0===g.isSkinnedMesh,morphTargets:void 0!==y.morphAttributes.position,morphNormals:void 0!==y.morphAttributes.normal,morphColors:void 0!==y.morphAttributes.color,morphTargetsCount:T,morphTextureStride:P,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:a.dithering,shadowMapEnabled:e.shadowMap.enabled&&c.length>0,shadowMapType:e.shadowMap.type,toneMapping:a.toneMapped?e.toneMapping:uE,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:a.premultipliedAlpha,doubleSided:a.side===kS,flipSided:a.side===DS,useDepthPacking:!!a.depthPacking,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionDerivatives:a.extensions&&a.extensions.derivatives,extensionFragDepth:a.extensions&&a.extensions.fragDepth,extensionDrawBuffers:a.extensions&&a.extensions.drawBuffers,extensionShaderTextureLOD:a.extensions&&a.extensions.shaderTextureLOD,rendererExtensionFragDepth:h||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||n.has("EXT_shader_texture_lod"),customProgramCacheKey:a.customProgramCacheKey()}},getProgramCacheKey:function(t){let i=[];if(t.shaderID?i.push(t.shaderID):(i.push(t.customVertexShaderID),i.push(t.customFragmentShaderID)),void 0!==t.defines)for(let e in t.defines)i.push(e),i.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(function(e,t){e.push(t.precision),e.push(t.outputEncoding),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.combine),e.push(t.vertexUvs),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}(i,t),function(e,t){o.disableAll(),t.isWebGL2&&o.enable(0),t.supportsVertexTextures&&o.enable(1),t.instancing&&o.enable(2),t.instancingColor&&o.enable(3),t.map&&o.enable(4),t.matcap&&o.enable(5),t.envMap&&o.enable(6),t.lightMap&&o.enable(7),t.aoMap&&o.enable(8),t.emissiveMap&&o.enable(9),t.bumpMap&&o.enable(10),t.normalMap&&o.enable(11),t.objectSpaceNormalMap&&o.enable(12),t.tangentSpaceNormalMap&&o.enable(13),t.clearcoat&&o.enable(14),t.clearcoatMap&&o.enable(15),t.clearcoatRoughnessMap&&o.enable(16),t.clearcoatNormalMap&&o.enable(17),t.iridescence&&o.enable(18),t.iridescenceMap&&o.enable(19),t.iridescenceThicknessMap&&o.enable(20),t.displacementMap&&o.enable(21),t.specularMap&&o.enable(22),t.roughnessMap&&o.enable(23),t.metalnessMap&&o.enable(24),t.gradientMap&&o.enable(25),t.alphaMap&&o.enable(26),t.alphaTest&&o.enable(27),t.vertexColors&&o.enable(28),t.vertexAlphas&&o.enable(29),t.vertexUvs&&o.enable(30),t.vertexTangents&&o.enable(31),t.uvsVertexOnly&&o.enable(32),e.push(o.mask),o.disableAll(),t.fog&&o.enable(0),t.useFog&&o.enable(1),t.flatShading&&o.enable(2),t.logarithmicDepthBuffer&&o.enable(3),t.skinning&&o.enable(4),t.morphTargets&&o.enable(5),t.morphNormals&&o.enable(6),t.morphColors&&o.enable(7),t.premultipliedAlpha&&o.enable(8),t.shadowMapEnabled&&o.enable(9),t.physicallyCorrectLights&&o.enable(10),t.doubleSided&&o.enable(11),t.flipSided&&o.enable(12),t.useDepthPacking&&o.enable(13),t.dithering&&o.enable(14),t.specularIntensityMap&&o.enable(15),t.specularColorMap&&o.enable(16),t.transmission&&o.enable(17),t.transmissionMap&&o.enable(18),t.thicknessMap&&o.enable(19),t.sheen&&o.enable(20),t.sheenColorMap&&o.enable(21),t.sheenRoughnessMap&&o.enable(22),t.decodeVideoTexture&&o.enable(23),t.opaque&&o.enable(24),e.push(o.mask)}(i,t),i.push(e.outputEncoding)),i.push(t.customProgramCacheKey),i.join()},getUniforms:function(e){let t,i=f[e.type];if(i){let e=eP[i];t=RT.clone(e.uniforms)}else t=e.uniforms;return t},acquireProgram:function(t,i){let n;for(let e=0,r=c.length;e<r;e++){let t=c[e];if(t.cacheKey===i){n=t,++n.usedTimes;break}}return void 0===n&&(n=new ZD(e,i,t,a),c.push(n)),n},releaseProgram:function(e){if(0===--e.usedTimes){let t=c.indexOf(e);c[t]=c[c.length-1],c.pop(),e.destroy()}},releaseShaderCache:function(e){l.remove(e)},programs:c,dispose:function(){l.dispose()}}}function tk(){let e=new WeakMap;return{get:function(t){let i=e.get(t);return void 0===i&&(i={},e.set(t,i)),i},remove:function(t){e.delete(t)},update:function(t,i,n){e.get(t)[i]=n},dispose:function(){e=new WeakMap}}}function ik(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function nk(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function rk(){let e=[],t=0,i=[],n=[],r=[];function a(i,n,r,a,s,o){let l=e[t];return void 0===l?(l={id:i.id,object:i,geometry:n,material:r,groupOrder:a,renderOrder:i.renderOrder,z:s,group:o},e[t]=l):(l.id=i.id,l.object=i,l.geometry=n,l.material=r,l.groupOrder=a,l.renderOrder=i.renderOrder,l.z=s,l.group=o),t++,l}return{opaque:i,transmissive:n,transparent:r,init:function(){t=0,i.length=0,n.length=0,r.length=0},push:function(e,t,s,o,l,c){let h=a(e,t,s,o,l,c);s.transmission>0?n.push(h):!0===s.transparent?r.push(h):i.push(h)},unshift:function(e,t,s,o,l,c){let h=a(e,t,s,o,l,c);s.transmission>0?n.unshift(h):!0===s.transparent?r.unshift(h):i.unshift(h)},finish:function(){for(let i=t,n=e.length;i<n;i++){let t=e[i];if(null===t.id)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}},sort:function(e,t){i.length>1&&i.sort(e||ik),n.length>1&&n.sort(t||nk),r.length>1&&r.sort(t||nk)}}}function ak(){let e=new WeakMap;return{get:function(t,i){let n,r=e.get(t);return void 0===r?(n=new rk,e.set(t,[n])):i>=r.length?(n=new rk,r.push(n)):n=r[i],n},dispose:function(){e=new WeakMap}}}function sk(){let e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let i;switch(t.type){case"DirectionalLight":i={direction:new FA,color:new MA};break;case"SpotLight":i={position:new FA,direction:new FA,color:new MA,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new FA,color:new MA,distance:0,decay:0};break;case"HemisphereLight":i={direction:new FA,skyColor:new MA,groundColor:new MA};break;case"RectAreaLight":i={color:new MA,position:new FA,halfWidth:new FA,halfHeight:new FA}}return e[t.id]=i,i}}}var ok=0;function lk(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function ck(e,t){let i=new sk,n=function(){let e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let i;switch(t.type){case"DirectionalLight":case"SpotLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new hA};break;case"PointLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new hA,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=i,i}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let l=0;l<9;l++)r.probe.push(new FA);let a=new FA,s=new mM,o=new mM;return{setup:function(a,s){let o=0,l=0,c=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let h=0,u=0,d=0,p=0,f=0,m=0,g=0,v=0,y=0,b=0;a.sort(lk);let x=!0!==s?Math.PI:1;for(let e=0,t=a.length;e<t;e++){let t=a[e],s=t.color,w=t.intensity,_=t.distance,S=t.shadow&&t.shadow.map?t.shadow.map.texture:null;if(t.isAmbientLight)o+=s.r*w*x,l+=s.g*w*x,c+=s.b*w*x;else if(t.isLightProbe)for(let e=0;e<9;e++)r.probe[e].addScaledVector(t.sh.coefficients[e],w);else if(t.isDirectionalLight){let e=i.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*x),t.castShadow){let e=t.shadow,i=n.get(t);i.shadowBias=e.bias,i.shadowNormalBias=e.normalBias,i.shadowRadius=e.radius,i.shadowMapSize=e.mapSize,r.directionalShadow[h]=i,r.directionalShadowMap[h]=S,r.directionalShadowMatrix[h]=t.shadow.matrix,m++}r.directional[h]=e,h++}else if(t.isSpotLight){let e=i.get(t);e.position.setFromMatrixPosition(t.matrixWorld),e.color.copy(s).multiplyScalar(w*x),e.distance=_,e.coneCos=Math.cos(t.angle),e.penumbraCos=Math.cos(t.angle*(1-t.penumbra)),e.decay=t.decay,r.spot[d]=e;let a=t.shadow;if(t.map&&(r.spotLightMap[y]=t.map,y++,a.updateMatrices(t),t.castShadow&&b++),r.spotLightMatrix[d]=a.matrix,t.castShadow){let e=n.get(t);e.shadowBias=a.bias,e.shadowNormalBias=a.normalBias,e.shadowRadius=a.radius,e.shadowMapSize=a.mapSize,r.spotShadow[d]=e,r.spotShadowMap[d]=S,v++}d++}else if(t.isRectAreaLight){let e=i.get(t);e.color.copy(s).multiplyScalar(w),e.halfWidth.set(.5*t.width,0,0),e.halfHeight.set(0,.5*t.height,0),r.rectArea[p]=e,p++}else if(t.isPointLight){let e=i.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*x),e.distance=t.distance,e.decay=t.decay,t.castShadow){let e=t.shadow,i=n.get(t);i.shadowBias=e.bias,i.shadowNormalBias=e.normalBias,i.shadowRadius=e.radius,i.shadowMapSize=e.mapSize,i.shadowCameraNear=e.camera.near,i.shadowCameraFar=e.camera.far,r.pointShadow[u]=i,r.pointShadowMap[u]=S,r.pointShadowMatrix[u]=t.shadow.matrix,g++}r.point[u]=e,u++}else if(t.isHemisphereLight){let e=i.get(t);e.skyColor.copy(t.color).multiplyScalar(w*x),e.groundColor.copy(t.groundColor).multiplyScalar(w*x),r.hemi[f]=e,f++}}p>0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(r.rectAreaLTC1=$T.LTC_FLOAT_1,r.rectAreaLTC2=$T.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(r.rectAreaLTC1=$T.LTC_HALF_1,r.rectAreaLTC2=$T.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=o,r.ambient[1]=l,r.ambient[2]=c;let w=r.hash;(w.directionalLength!==h||w.pointLength!==u||w.spotLength!==d||w.rectAreaLength!==p||w.hemiLength!==f||w.numDirectionalShadows!==m||w.numPointShadows!==g||w.numSpotShadows!==v||w.numSpotMaps!==y)&&(r.directional.length=h,r.spot.length=d,r.rectArea.length=p,r.point.length=u,r.hemi.length=f,r.directionalShadow.length=m,r.directionalShadowMap.length=m,r.pointShadow.length=g,r.pointShadowMap.length=g,r.spotShadow.length=v,r.spotShadowMap.length=v,r.directionalShadowMatrix.length=m,r.pointShadowMatrix.length=g,r.spotLightMatrix.length=v+y-b,r.spotLightMap.length=y,r.numSpotLightShadowsWithMaps=b,w.directionalLength=h,w.pointLength=u,w.spotLength=d,w.rectAreaLength=p,w.hemiLength=f,w.numDirectionalShadows=m,w.numPointShadows=g,w.numSpotShadows=v,w.numSpotMaps=y,r.version=ok++)},setupView:function(e,t){let i=0,n=0,l=0,c=0,h=0,u=t.matrixWorldInverse;for(let d=0,p=e.length;d<p;d++){let t=e[d];if(t.isDirectionalLight){let e=r.directional[i];e.direction.setFromMatrixPosition(t.matrixWorld),a.setFromMatrixPosition(t.target.matrixWorld),e.direction.sub(a),e.direction.transformDirection(u),i++}else if(t.isSpotLight){let e=r.spot[l];e.position.setFromMatrixPosition(t.matrixWorld),e.position.applyMatrix4(u),e.direction.setFromMatrixPosition(t.matrixWorld),a.setFromMatrixPosition(t.target.matrixWorld),e.direction.sub(a),e.direction.transformDirection(u),l++}else if(t.isRectAreaLight){let e=r.rectArea[c];e.position.setFromMatrixPosition(t.matrixWorld),e.position.applyMatrix4(u),o.identity(),s.copy(t.matrixWorld),s.premultiply(u),o.extractRotation(s),e.halfWidth.set(.5*t.width,0,0),e.halfHeight.set(0,.5*t.height,0),e.halfWidth.applyMatrix4(o),e.halfHeight.applyMatrix4(o),c++}else if(t.isPointLight){let e=r.point[n];e.position.setFromMatrixPosition(t.matrixWorld),e.position.applyMatrix4(u),n++}else if(t.isHemisphereLight){let e=r.hemi[h];e.direction.setFromMatrixPosition(t.matrixWorld),e.direction.transformDirection(u),h++}}},state:r}}function hk(e,t){let i=new ck(e,t),n=[],r=[];return{init:function(){n.length=0,r.length=0},state:{lightsArray:n,shadowsArray:r,lights:i},setupLights:function(e){i.setup(n,e)},setupLightsView:function(e){i.setupView(n,e)},pushLight:function(e){n.push(e)},pushShadow:function(e){r.push(e)}}}function uk(e,t){let i=new WeakMap;return{get:function(n){let r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=i.get(n);return void 0===s?(r=new hk(e,t),i.set(n,[r])):a>=s.length?(r=new hk(e,t),s.push(r)):r=s[a],r},dispose:function(){i=new WeakMap}}}var dk=class extends $M{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=FC,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}},pk=class extends $M{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new FA,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}},fk="void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",mk="uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}";function gk(e,t,i){let n=new YT,r=new hA,a=new hA,s=new RA,o=new dk({depthPacking:jC}),l=new pk,c={},h=i.maxTextureSize,u={[PS]:DS,[DS]:PS,[kS]:kS},d=new LT({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new hA},radius:{value:4}},vertexShader:fk,fragmentShader:mk}),p=d.clone();p.defines.HORIZONTAL_PASS=1;let f=new fT;f.setAttribute("position",new nT(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new TT(f,d),g=this;function v(i,n){let a=t.update(m);d.defines.VSM_SAMPLES!==i.blurSamples&&(d.defines.VSM_SAMPLES=i.blurSamples,p.defines.VSM_SAMPLES=i.blurSamples,d.needsUpdate=!0,p.needsUpdate=!0),null===i.mapPass&&(i.mapPass=new LA(r.x,r.y)),d.uniforms.shadow_pass.value=i.map.texture,d.uniforms.resolution.value=i.mapSize,d.uniforms.radius.value=i.radius,e.setRenderTarget(i.mapPass),e.clear(),e.renderBufferDirect(n,null,a,d,m,null),p.uniforms.shadow_pass.value=i.mapPass.texture,p.uniforms.resolution.value=i.mapSize,p.uniforms.radius.value=i.radius,e.setRenderTarget(i.map),e.clear(),e.renderBufferDirect(n,null,a,p,m,null)}function y(t,i,n,r,a,s){let h=null,d=!0===n.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==d)h=d;else if(h=!0===n.isPointLight?l:o,e.localClippingEnabled&&!0===i.clipShadows&&Array.isArray(i.clippingPlanes)&&0!==i.clippingPlanes.length||i.displacementMap&&0!==i.displacementScale||i.alphaMap&&i.alphaTest>0||i.map&&i.alphaTest>0){let e=h.uuid,t=i.uuid,n=c[e];void 0===n&&(n={},c[e]=n);let r=n[t];void 0===r&&(r=h.clone(),n[t]=r),h=r}return h.visible=i.visible,h.wireframe=i.wireframe,h.side=s===TS?null!==i.shadowSide?i.shadowSide:i.side:null!==i.shadowSide?i.shadowSide:u[i.side],h.alphaMap=i.alphaMap,h.alphaTest=i.alphaTest,h.map=i.map,h.clipShadows=i.clipShadows,h.clippingPlanes=i.clippingPlanes,h.clipIntersection=i.clipIntersection,h.displacementMap=i.displacementMap,h.displacementScale=i.displacementScale,h.displacementBias=i.displacementBias,h.wireframeLinewidth=i.wireframeLinewidth,h.linewidth=i.linewidth,!0===n.isPointLight&&!0===h.isMeshDistanceMaterial&&(h.referencePosition.setFromMatrixPosition(n.matrixWorld),h.nearDistance=r,h.farDistance=a),h}function b(i,r,a,s,o){if(!1===i.visible)return;if(i.layers.test(r.layers)&&(i.isMesh||i.isLine||i.isPoints)&&(i.castShadow||i.receiveShadow&&o===TS)&&(!i.frustumCulled||n.intersectsObject(i))){i.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,i.matrixWorld);let n=t.update(i),r=i.material;if(Array.isArray(r)){let t=n.groups;for(let l=0,c=t.length;l<c;l++){let c=t[l],h=r[c.materialIndex];if(h&&h.visible){let t=y(i,h,s,a.near,a.far,o);e.renderBufferDirect(a,null,n,t,i,c)}}}else if(r.visible){let t=y(i,r,s,a.near,a.far,o);e.renderBufferDirect(a,null,n,t,i,null)}}let l=i.children;for(let e=0,t=l.length;e<t;e++)b(l[e],r,a,s,o)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=AS,this.render=function(t,i,o){if(!1===g.enabled||!1===g.autoUpdate&&!1===g.needsUpdate||0===t.length)return;let l=e.getRenderTarget(),c=e.getActiveCubeFace(),u=e.getActiveMipmapLevel(),d=e.state;d.setBlending(OS),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);for(let p=0,f=t.length;p<f;p++){let l=t[p],c=l.shadow;if(void 0===c){console.warn("THREE.WebGLShadowMap:",l,"has no shadow.");continue}if(!1===c.autoUpdate&&!1===c.needsUpdate)continue;r.copy(c.mapSize);let u=c.getFrameExtents();if(r.multiply(u),a.copy(c.mapSize),(r.x>h||r.y>h)&&(r.x>h&&(a.x=Math.floor(h/u.x),r.x=a.x*u.x,c.mapSize.x=a.x),r.y>h&&(a.y=Math.floor(h/u.y),r.y=a.y*u.y,c.mapSize.y=a.y)),null===c.map){let e=this.type!==TS?{minFilter:CE,magFilter:CE}:{};c.map=new LA(r.x,r.y,e),c.map.texture.name=l.name+".shadowMap",c.camera.updateProjectionMatrix()}e.setRenderTarget(c.map),e.clear();let f=c.getViewportCount();for(let e=0;e<f;e++){let t=c.getViewport(e);s.set(a.x*t.x,a.y*t.y,a.x*t.z,a.y*t.w),d.viewport(s),c.updateMatrices(l,e),n=c.getFrustum(),b(i,o,c.camera,l,this.type)}!0!==c.isPointLightShadow&&this.type===TS&&v(c,o),c.needsUpdate=!1}g.needsUpdate=!1,e.setRenderTarget(l,c,u)}}function vk(e,t,i){let n=i.isWebGL2;let r=new function(){let t=!1,i=new RA,n=null,r=new RA(0,0,0,0);return{setMask:function(i){n!==i&&!t&&(e.colorMask(i,i,i,i),n=i)},setLocked:function(e){t=e},setClear:function(t,n,a,s,o){!0===o&&(t*=s,n*=s,a*=s),i.set(t,n,a,s),!1===r.equals(i)&&(e.clearColor(t,n,a,s),r.copy(i))},reset:function(){t=!1,n=null,r.set(-1,0,0,0)}}},a=new function(){let t=!1,i=null,n=null,r=null;return{setTest:function(e){e?j(2929):V(2929)},setMask:function(n){i!==n&&!t&&(e.depthMask(n),i=n)},setFunc:function(t){if(n!==t){switch(t){case eE:e.depthFunc(512);break;case tE:e.depthFunc(519);break;case iE:e.depthFunc(513);break;case nE:e.depthFunc(515);break;case rE:e.depthFunc(514);break;case aE:e.depthFunc(518);break;case sE:e.depthFunc(516);break;case oE:e.depthFunc(517);break;default:e.depthFunc(515)}n=t}},setLocked:function(e){t=e},setClear:function(t){r!==t&&(e.clearDepth(t),r=t)},reset:function(){t=!1,i=null,n=null,r=null}}},s=new function(){let t=!1,i=null,n=null,r=null,a=null,s=null,o=null,l=null,c=null;return{setTest:function(e){t||(e?j(2960):V(2960))},setMask:function(n){i!==n&&!t&&(e.stencilMask(n),i=n)},setFunc:function(t,i,s){(n!==t||r!==i||a!==s)&&(e.stencilFunc(t,i,s),n=t,r=i,a=s)},setOp:function(t,i,n){(s!==t||o!==i||l!==n)&&(e.stencilOp(t,i,n),s=t,o=i,l=n)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,i=null,n=null,r=null,a=null,s=null,o=null,l=null,c=null}}},o=new WeakMap,l=new WeakMap,c={},h={},u=new WeakMap,d=[],p=null,f=!1,m=null,g=null,v=null,y=null,b=null,x=null,w=null,_=!1,S=null,E=null,C=null,A=null,M=null,T=e.getParameter(35661),P=!1,D=0,k=e.getParameter(7938);-1!==k.indexOf("WebGL")?(D=parseFloat(/^WebGL (\d)/.exec(k)[1]),P=D>=1):-1!==k.indexOf("OpenGL ES")&&(D=parseFloat(/^OpenGL ES (\d)/.exec(k)[1]),P=D>=2);let O=null,I={},R=e.getParameter(3088),L=e.getParameter(2978),B=(new RA).fromArray(R),z=(new RA).fromArray(L);function N(t,i,n){let r=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(let s=0;s<n;s++)e.texImage2D(i+s,0,6408,1,1,0,6408,5121,r);return a}let F={};function j(t){!0!==c[t]&&(e.enable(t),c[t]=!0)}function V(t){!1!==c[t]&&(e.disable(t),c[t]=!1)}F[3553]=N(3553,3553,1),F[34067]=N(34067,34069,6),r.setClear(0,0,0,1),a.setClear(1),s.setClear(0),j(2929),a.setFunc(nE),W(!1),q(ES),j(2884),H(OS);let U={[NS]:32774,[FS]:32778,[jS]:32779};if(n)U[VS]=32775,U[US]=32776;else{let e=t.get("EXT_blend_minmax");null!==e&&(U[VS]=e.MIN_EXT,U[US]=e.MAX_EXT)}let G={[GS]:0,[HS]:1,[WS]:768,[XS]:770,[$S]:776,[KS]:774,[QS]:772,[qS]:769,[YS]:771,[JS]:775,[ZS]:773};function H(t,i,n,r,a,s,o,l){if(t!==OS){if(!1===f&&(j(3042),f=!0),t===zS)a=a||i,s=s||n,o=o||r,(i!==g||a!==b)&&(e.blendEquationSeparate(U[i],U[a]),g=i,b=a),(n!==v||r!==y||s!==x||o!==w)&&(e.blendFuncSeparate(G[n],G[r],G[s],G[o]),v=n,y=r,x=s,w=o),m=t,_=!1;else if(t!==m||l!==_){if((g!==NS||b!==NS)&&(e.blendEquation(32774),g=NS,b=NS),l)switch(t){case IS:e.blendFuncSeparate(1,771,1,771);break;case RS:e.blendFunc(1,1);break;case LS:e.blendFuncSeparate(0,769,0,1);break;case BS:e.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case IS:e.blendFuncSeparate(770,771,1,771);break;case RS:e.blendFunc(770,1);break;case LS:e.blendFuncSeparate(0,769,0,1);break;case BS:e.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}v=null,y=null,x=null,w=null,m=t,_=l}}else!0===f&&(V(3042),f=!1)}function W(t){S!==t&&(t?e.frontFace(2304):e.frontFace(2305),S=t)}function q(t){t!==SS?(j(2884),t!==E&&(t===ES?e.cullFace(1029):t===CS?e.cullFace(1028):e.cullFace(1032))):V(2884),E=t}function X(t,i,n){t?(j(32823),(A!==i||M!==n)&&(e.polygonOffset(i,n),A=i,M=n)):V(32823)}return{buffers:{color:r,depth:a,stencil:s},enable:j,disable:V,bindFramebuffer:function(t,i){return h[t]!==i&&(e.bindFramebuffer(t,i),h[t]=i,n&&(36009===t&&(h[36160]=i),36160===t&&(h[36009]=i)),!0)},drawBuffers:function(n,r){let a=d,s=!1;if(n)if(a=u.get(r),void 0===a&&(a=[],u.set(r,a)),n.isWebGLMultipleRenderTargets){let e=n.texture;if(a.length!==e.length||36064!==a[0]){for(let t=0,i=e.length;t<i;t++)a[t]=36064+t;a.length=e.length,s=!0}}else 36064!==a[0]&&(a[0]=36064,s=!0);else 1029!==a[0]&&(a[0]=1029,s=!0);s&&(i.isWebGL2?e.drawBuffers(a):t.get("WEBGL_draw_buffers").drawBuffersWEBGL(a))},useProgram:function(t){return p!==t&&(e.useProgram(t),p=t,!0)},setBlending:H,setMaterial:function(e,t){e.side===kS?V(2884):j(2884);let i=e.side===DS;t&&(i=!i),W(i),e.blending===IS&&!1===e.transparent?H(OS):H(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),a.setFunc(e.depthFunc),a.setTest(e.depthTest),a.setMask(e.depthWrite),r.setMask(e.colorWrite);let n=e.stencilWrite;s.setTest(n),n&&(s.setMask(e.stencilWriteMask),s.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),s.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),X(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),!0===e.alphaToCoverage?j(32926):V(32926)},setFlipSided:W,setCullFace:q,setLineWidth:function(t){t!==C&&(P&&e.lineWidth(t),C=t)},setPolygonOffset:X,setScissorTest:function(e){e?j(3089):V(3089)},activeTexture:function(t){void 0===t&&(t=33984+T-1),O!==t&&(e.activeTexture(t),O=t)},bindTexture:function(t,i,n){void 0===n&&(n=null===O?33984+T-1:O);let r=I[n];void 0===r&&(r={type:void 0,texture:void 0},I[n]=r),(r.type!==t||r.texture!==i)&&(O!==n&&(e.activeTexture(n),O=n),e.bindTexture(t,i||F[t]),r.type=t,r.texture=i)},unbindTexture:function(){let t=I[O];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexImage3D:function(){try{e.compressedTexImage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},updateUBOMapping:function(t,i){let n=l.get(i);void 0===n&&(n=new WeakMap,l.set(i,n));let r=n.get(t);void 0===r&&(r=e.getUniformBlockIndex(i,t.name),n.set(t,r))},uniformBlockBinding:function(t,i){let n=l.get(i).get(t);o.get(i)!==n&&(e.uniformBlockBinding(i,n,t.__bindingPointIndex),o.set(i,n))},texStorage2D:function(){try{e.texStorage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texStorage3D:function(){try{e.texStorage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage2D:function(){try{e.texSubImage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage3D:function(){try{e.texSubImage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage2D:function(){try{e.compressedTexSubImage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage3D:function(){try{e.compressedTexSubImage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(t){!1===B.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),B.copy(t))},viewport:function(t){!1===z.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),z.copy(t))},reset:function(){e.disable(3042),e.disable(2884),e.disable(2929),e.disable(32823),e.disable(3089),e.disable(2960),e.disable(32926),e.blendEquation(32774),e.blendFunc(1,0),e.blendFuncSeparate(1,0,1,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(513),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(519,0,4294967295),e.stencilOp(7680,7680,7680),e.clearStencil(0),e.cullFace(1029),e.frontFace(2305),e.polygonOffset(0,0),e.activeTexture(33984),e.bindFramebuffer(36160,null),!0===n&&(e.bindFramebuffer(36009,null),e.bindFramebuffer(36008,null)),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),c={},O=null,I={},h={},u=new WeakMap,d=[],p=null,f=!1,m=null,g=null,v=null,y=null,b=null,x=null,w=null,_=!1,S=null,E=null,C=null,A=null,M=null,B.set(0,0,e.canvas.width,e.canvas.height),z.set(0,0,e.canvas.width,e.canvas.height),r.reset(),a.reset(),s.reset()}}}function yk(e,t,i,n,r,a,s){let o,l=r.isWebGL2,c=r.maxTextures,h=r.maxCubemapSize,u=r.maxTextureSize,d=r.maxSamples,p=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,f=!(typeof navigator>"u")&&/OculusBrowser/g.test(navigator.userAgent),m=new WeakMap,g=new WeakMap,v=!1;try{v=typeof OffscreenCanvas<"u"&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch{}function y(e,t){return v?new OffscreenCanvas(e,t):gA("canvas")}function b(e,t,i,n){let r=1;if((e.width>n||e.height>n)&&(r=n/Math.max(e.width,e.height)),r<1||!0===t){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let n=t?sA:Math.floor,a=n(r*e.width),s=n(r*e.height);void 0===o&&(o=y(a,s));let l=i?y(a,s):o;return l.width=a,l.height=s,l.getContext("2d").drawImage(e,0,0,a,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+a+"x"+s+")."),l}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function x(e){return rA(e.width)&&rA(e.height)}function w(e,t){return e.generateMipmaps&&t&&e.minFilter!==CE&&e.minFilter!==TE}function _(t){e.generateMipmap(t)}function S(i,n,r,a){let s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(!1===l)return n;if(null!==i){if(void 0!==e[i])return e[i];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+i+"'")}let o=n;return 6403===n&&(5126===r&&(o=33326),5131===r&&(o=33325),5121===r&&(o=33321)),33319===n&&(5126===r&&(o=33328),5131===r&&(o=33327),5121===r&&(o=33323)),6408===n&&(5126===r&&(o=34836),5131===r&&(o=34842),5121===r&&(o=a===NC&&!1===s?35907:32856),32819===r&&(o=32854),32820===r&&(o=32855)),(33325===o||33326===o||33327===o||33328===o||34842===o||34836===o)&&t.get("EXT_color_buffer_float"),o}function E(e,t,i){return!0===w(e,i)||e.isFramebufferTexture&&e.minFilter!==CE&&e.minFilter!==TE?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function C(e){return e===CE||e===AE||e===ME?9728:9729}function A(e){let t=e.target;t.removeEventListener("dispose",A),function(e){let t=n.get(e);if(void 0===t.__webglInit)return;let i=e.source,r=g.get(i);if(r){let n=r[t.__cacheKey];n.usedTimes--,0===n.usedTimes&&T(e),0===Object.keys(r).length&&g.delete(i)}n.remove(e)}(t),t.isVideoTexture&&m.delete(t)}function M(t){let i=t.target;i.removeEventListener("dispose",M),function(t){let i=t.texture,r=n.get(t),a=n.get(i);if(void 0!==a.__webglTexture&&(e.deleteTexture(a.__webglTexture),s.memory.textures--),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(let n=0;n<6;n++)e.deleteFramebuffer(r.__webglFramebuffer[n]),r.__webglDepthbuffer&&e.deleteRenderbuffer(r.__webglDepthbuffer[n]);else{if(e.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&e.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&e.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRenderbuffer)for(let t=0;t<r.__webglColorRenderbuffer.length;t++)r.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(r.__webglColorRenderbuffer[t]);r.__webglDepthRenderbuffer&&e.deleteRenderbuffer(r.__webglDepthRenderbuffer)}if(t.isWebGLMultipleRenderTargets)for(let o=0,l=i.length;o<l;o++){let t=n.get(i[o]);t.__webglTexture&&(e.deleteTexture(t.__webglTexture),s.memory.textures--),n.remove(i[o])}n.remove(i),n.remove(t)}(i)}function T(t){let i=n.get(t);e.deleteTexture(i.__webglTexture);let r=t.source;delete g.get(r)[i.__cacheKey],s.memory.textures--}let P=0;function D(e,t){let r=n.get(e);if(e.isVideoTexture&&function(e){let t=s.render.frame;m.get(e)!==t&&(m.set(e,t),e.update())}(e),!1===e.isRenderTargetTexture&&e.version>0&&r.__version!==e.version){let i=e.image;if(null===i)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==i.complete)return void L(r,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}i.bindTexture(3553,r.__webglTexture,33984+t)}let k={[_E]:10497,[SE]:33071,[EE]:33648},O={[CE]:9728,[AE]:9984,[ME]:9986,[TE]:9729,[PE]:9985,[DE]:9987};function I(i,a,s){if(s?(e.texParameteri(i,10242,k[a.wrapS]),e.texParameteri(i,10243,k[a.wrapT]),(32879===i||35866===i)&&e.texParameteri(i,32882,k[a.wrapR]),e.texParameteri(i,10240,O[a.magFilter]),e.texParameteri(i,10241,O[a.minFilter])):(e.texParameteri(i,10242,33071),e.texParameteri(i,10243,33071),(32879===i||35866===i)&&e.texParameteri(i,32882,33071),(a.wrapS!==SE||a.wrapT!==SE)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(i,10240,C(a.magFilter)),e.texParameteri(i,10241,C(a.minFilter)),a.minFilter!==CE&&a.minFilter!==TE&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!0===t.has("EXT_texture_filter_anisotropic")){let s=t.get("EXT_texture_filter_anisotropic");if(a.magFilter===CE||a.minFilter!==ME&&a.minFilter!==DE||a.type===zE&&!1===t.has("OES_texture_float_linear")||!1===l&&a.type===NE&&!1===t.has("OES_texture_half_float_linear"))return;(a.anisotropy>1||n.get(a).__currentAnisotropy)&&(e.texParameterf(i,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,r.getMaxAnisotropy())),n.get(a).__currentAnisotropy=a.anisotropy)}}function R(t,i){let n=!1;void 0===t.__webglInit&&(t.__webglInit=!0,i.addEventListener("dispose",A));let r=i.source,a=g.get(r);void 0===a&&(a={},g.set(r,a));let o=function(e){let t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.encoding),t.join()}(i);if(o!==t.__cacheKey){void 0===a[o]&&(a[o]={texture:e.createTexture(),usedTimes:0},s.memory.textures++,n=!0),a[o].usedTimes++;let r=a[t.__cacheKey];void 0!==r&&(a[t.__cacheKey].usedTimes--,0===r.usedTimes&&T(i)),t.__cacheKey=o,t.__webglTexture=a[o].texture}return n}function L(t,r,s){let o=3553;(r.isDataArrayTexture||r.isCompressedArrayTexture)&&(o=35866),r.isData3DTexture&&(o=32879);let c=R(t,r),h=r.source;i.bindTexture(o,t.__webglTexture,33984+s);let d=n.get(h);if(h.version!==d.__version||!0===c){i.activeTexture(33984+s),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment),e.pixelStorei(37443,0);let t=function(e){return!l&&(e.wrapS!==SE||e.wrapT!==SE||e.minFilter!==CE&&e.minFilter!==TE)}(r)&&!1===x(r.image),n=b(r.image,t,!1,u);n=V(r,n);let p=x(n)||l,f=a.convert(r.format,r.encoding),m=a.convert(r.type),g=S(r.internalFormat,f,m,r.encoding,r.isVideoTexture);I(o,r,p);let v,y=r.mipmaps,C=l&&!0!==r.isVideoTexture,A=void 0===d.__version||!0===c,M=E(r,n,p);if(r.isDepthTexture)g=6402,l?g=r.type===zE?36012:r.type===BE?33190:r.type===VE?35056:33189:r.type===zE&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),r.format===qE&&6402===g&&r.type!==RE&&r.type!==BE&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=BE,m=a.convert(r.type)),r.format===XE&&6402===g&&(g=34041,r.type!==VE&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=VE,m=a.convert(r.type))),A&&(C?i.texStorage2D(3553,1,g,n.width,n.height):i.texImage2D(3553,0,g,n.width,n.height,0,f,m,null));else if(r.isDataTexture)if(y.length>0&&p){C&&A&&i.texStorage2D(3553,M,g,y[0].width,y[0].height);for(let e=0,t=y.length;e<t;e++)v=y[e],C?i.texSubImage2D(3553,e,0,0,v.width,v.height,f,m,v.data):i.texImage2D(3553,e,g,v.width,v.height,0,f,m,v.data);r.generateMipmaps=!1}else C?(A&&i.texStorage2D(3553,M,g,n.width,n.height),i.texSubImage2D(3553,0,0,0,n.width,n.height,f,m,n.data)):i.texImage2D(3553,0,g,n.width,n.height,0,f,m,n.data);else if(r.isCompressedTexture)if(r.isCompressedArrayTexture){C&&A&&i.texStorage3D(35866,M,g,y[0].width,y[0].height,n.depth);for(let e=0,t=y.length;e<t;e++)v=y[e],r.format!==GE?null!==f?C?i.compressedTexSubImage3D(35866,e,0,0,0,v.width,v.height,n.depth,f,v.data,0,0):i.compressedTexImage3D(35866,e,g,v.width,v.height,n.depth,0,v.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):C?i.texSubImage3D(35866,e,0,0,0,v.width,v.height,n.depth,f,m,v.data):i.texImage3D(35866,e,g,v.width,v.height,n.depth,0,f,m,v.data)}else{C&&A&&i.texStorage2D(3553,M,g,y[0].width,y[0].height);for(let e=0,t=y.length;e<t;e++)v=y[e],r.format!==GE?null!==f?C?i.compressedTexSubImage2D(3553,e,0,0,v.width,v.height,f,v.data):i.compressedTexImage2D(3553,e,g,v.width,v.height,0,v.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):C?i.texSubImage2D(3553,e,0,0,v.width,v.height,f,m,v.data):i.texImage2D(3553,e,g,v.width,v.height,0,f,m,v.data)}else if(r.isDataArrayTexture)C?(A&&i.texStorage3D(35866,M,g,n.width,n.height,n.depth),i.texSubImage3D(35866,0,0,0,0,n.width,n.height,n.depth,f,m,n.data)):i.texImage3D(35866,0,g,n.width,n.height,n.depth,0,f,m,n.data);else if(r.isData3DTexture)C?(A&&i.texStorage3D(32879,M,g,n.width,n.height,n.depth),i.texSubImage3D(32879,0,0,0,0,n.width,n.height,n.depth,f,m,n.data)):i.texImage3D(32879,0,g,n.width,n.height,n.depth,0,f,m,n.data);else if(r.isFramebufferTexture){if(A)if(C)i.texStorage2D(3553,M,g,n.width,n.height);else{let e=n.width,t=n.height;for(let n=0;n<M;n++)i.texImage2D(3553,n,g,e,t,0,f,m,null),e>>=1,t>>=1}}else if(y.length>0&&p){C&&A&&i.texStorage2D(3553,M,g,y[0].width,y[0].height);for(let e=0,t=y.length;e<t;e++)v=y[e],C?i.texSubImage2D(3553,e,0,0,f,m,v):i.texImage2D(3553,e,g,f,m,v);r.generateMipmaps=!1}else C?(A&&i.texStorage2D(3553,M,g,n.width,n.height),i.texSubImage2D(3553,0,0,0,f,m,n)):i.texImage2D(3553,0,g,f,m,n);w(r,p)&&_(o),d.__version=h.version,r.onUpdate&&r.onUpdate(r)}t.__version=r.version}function B(t,r,s,o,l){let c=a.convert(s.format,s.encoding),h=a.convert(s.type),u=S(s.internalFormat,c,h,s.encoding);n.get(r).__hasExternalTextures||(32879===l||35866===l?i.texImage3D(l,0,u,r.width,r.height,r.depth,0,c,h,null):i.texImage2D(l,0,u,r.width,r.height,0,c,h,null)),i.bindFramebuffer(36160,t),j(r)?p.framebufferTexture2DMultisampleEXT(36160,o,l,n.get(s).__webglTexture,0,F(r)):(3553===l||l>=34069&&l<=34074)&&e.framebufferTexture2D(36160,o,l,n.get(s).__webglTexture,0),i.bindFramebuffer(36160,null)}function z(t,i,n){if(e.bindRenderbuffer(36161,t),i.depthBuffer&&!i.stencilBuffer){let r=33189;if(n||j(i)){let t=i.depthTexture;t&&t.isDepthTexture&&(t.type===zE?r=36012:t.type===BE&&(r=33190));let n=F(i);j(i)?p.renderbufferStorageMultisampleEXT(36161,n,r,i.width,i.height):e.renderbufferStorageMultisample(36161,n,r,i.width,i.height)}else e.renderbufferStorage(36161,r,i.width,i.height);e.framebufferRenderbuffer(36160,36096,36161,t)}else if(i.depthBuffer&&i.stencilBuffer){let r=F(i);n&&!1===j(i)?e.renderbufferStorageMultisample(36161,r,35056,i.width,i.height):j(i)?p.renderbufferStorageMultisampleEXT(36161,r,35056,i.width,i.height):e.renderbufferStorage(36161,34041,i.width,i.height),e.framebufferRenderbuffer(36160,33306,36161,t)}else{let t=!0===i.isWebGLMultipleRenderTargets?i.texture:[i.texture];for(let r=0;r<t.length;r++){let s=t[r],o=a.convert(s.format,s.encoding),l=a.convert(s.type),c=S(s.internalFormat,o,l,s.encoding),h=F(i);n&&!1===j(i)?e.renderbufferStorageMultisample(36161,h,c,i.width,i.height):j(i)?p.renderbufferStorageMultisampleEXT(36161,h,c,i.width,i.height):e.renderbufferStorage(36161,c,i.width,i.height)}}e.bindRenderbuffer(36161,null)}function N(t){let r=n.get(t),a=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture&&!r.__autoAllocateDepthBuffer){if(a)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,r){if(r&&r.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(i.bindFramebuffer(36160,t),!r.depthTexture||!r.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(r.depthTexture).__webglTexture||r.depthTexture.image.width!==r.width||r.depthTexture.image.height!==r.height)&&(r.depthTexture.image.width=r.width,r.depthTexture.image.height=r.height,r.depthTexture.needsUpdate=!0),D(r.depthTexture,0);let a=n.get(r.depthTexture).__webglTexture,s=F(r);if(r.depthTexture.format===qE)j(r)?p.framebufferTexture2DMultisampleEXT(36160,36096,3553,a,0,s):e.framebufferTexture2D(36160,36096,3553,a,0);else{if(r.depthTexture.format!==XE)throw new Error("Unknown depthTexture format");j(r)?p.framebufferTexture2DMultisampleEXT(36160,33306,3553,a,0,s):e.framebufferTexture2D(36160,33306,3553,a,0)}}(r.__webglFramebuffer,t)}else if(a){r.__webglDepthbuffer=[];for(let n=0;n<6;n++)i.bindFramebuffer(36160,r.__webglFramebuffer[n]),r.__webglDepthbuffer[n]=e.createRenderbuffer(),z(r.__webglDepthbuffer[n],t,!1)}else i.bindFramebuffer(36160,r.__webglFramebuffer),r.__webglDepthbuffer=e.createRenderbuffer(),z(r.__webglDepthbuffer,t,!1);i.bindFramebuffer(36160,null)}function F(e){return Math.min(d,e.samples)}function j(e){let i=n.get(e);return l&&e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==i.__useRenderToTexture}function V(e,i){let n=e.encoding,r=e.format,a=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||e.format===YC||n!==zC&&(n===NC?!1===l?!0===t.has("EXT_sRGB")&&r===GE?(e.format=YC,e.minFilter=TE,e.generateMipmaps=!1):i=PA.sRGBToLinear(i):(r!==GE||a!==kE)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",n)),i}this.allocateTextureUnit=function(){let e=P;return e>=c&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+c),P+=1,e},this.resetTextureUnits=function(){P=0},this.setTexture2D=D,this.setTexture2DArray=function(e,t){let r=n.get(e);e.version>0&&r.__version!==e.version?L(r,e,t):i.bindTexture(35866,r.__webglTexture,33984+t)},this.setTexture3D=function(e,t){let r=n.get(e);e.version>0&&r.__version!==e.version?L(r,e,t):i.bindTexture(32879,r.__webglTexture,33984+t)},this.setTextureCube=function(t,r){let s=n.get(t);t.version>0&&s.__version!==t.version?function(t,r,s){if(6!==r.image.length)return;let o=R(t,r),c=r.source;i.bindTexture(34067,t.__webglTexture,33984+s);let u=n.get(c);if(c.version!==u.__version||!0===o){i.activeTexture(33984+s),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment),e.pixelStorei(37443,0);let t=r.isCompressedTexture||r.image[0].isCompressedTexture,n=r.image[0]&&r.image[0].isDataTexture,d=[];for(let e=0;e<6;e++)d[e]=t||n?n?r.image[e].image:r.image[e]:b(r.image[e],!1,!0,h),d[e]=V(r,d[e]);let p,f=d[0],m=x(f)||l,g=a.convert(r.format,r.encoding),v=a.convert(r.type),y=S(r.internalFormat,g,v,r.encoding),C=l&&!0!==r.isVideoTexture,A=void 0===u.__version||!0===o,M=E(r,f,m);if(I(34067,r,m),t){C&&A&&i.texStorage2D(34067,M,y,f.width,f.height);for(let e=0;e<6;e++){p=d[e].mipmaps;for(let t=0;t<p.length;t++){let n=p[t];r.format!==GE?null!==g?C?i.compressedTexSubImage2D(34069+e,t,0,0,n.width,n.height,g,n.data):i.compressedTexImage2D(34069+e,t,y,n.width,n.height,0,n.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):C?i.texSubImage2D(34069+e,t,0,0,n.width,n.height,g,v,n.data):i.texImage2D(34069+e,t,y,n.width,n.height,0,g,v,n.data)}}}else{p=r.mipmaps,C&&A&&(p.length>0&&M++,i.texStorage2D(34067,M,y,d[0].width,d[0].height));for(let e=0;e<6;e++)if(n){C?i.texSubImage2D(34069+e,0,0,0,d[e].width,d[e].height,g,v,d[e].data):i.texImage2D(34069+e,0,y,d[e].width,d[e].height,0,g,v,d[e].data);for(let t=0;t<p.length;t++){let n=p[t].image[e].image;C?i.texSubImage2D(34069+e,t+1,0,0,n.width,n.height,g,v,n.data):i.texImage2D(34069+e,t+1,y,n.width,n.height,0,g,v,n.data)}}else{C?i.texSubImage2D(34069+e,0,0,0,g,v,d[e]):i.texImage2D(34069+e,0,y,g,v,d[e]);for(let t=0;t<p.length;t++){let n=p[t];C?i.texSubImage2D(34069+e,t+1,0,0,g,v,n.image[e]):i.texImage2D(34069+e,t+1,y,g,v,n.image[e])}}}w(r,m)&&_(34067),u.__version=c.version,r.onUpdate&&r.onUpdate(r)}t.__version=r.version}(s,t,r):i.bindTexture(34067,s.__webglTexture,33984+r)},this.rebindTextures=function(e,t,i){let r=n.get(e);void 0!==t&&B(r.__webglFramebuffer,e,e.texture,36064,3553),void 0!==i&&N(e)},this.setupRenderTarget=function(t){let o=t.texture,c=n.get(t),h=n.get(o);t.addEventListener("dispose",M),!0!==t.isWebGLMultipleRenderTargets&&(void 0===h.__webglTexture&&(h.__webglTexture=e.createTexture()),h.__version=o.version,s.memory.textures++);let u=!0===t.isWebGLCubeRenderTarget,d=!0===t.isWebGLMultipleRenderTargets,p=x(t)||l;if(u){c.__webglFramebuffer=[];for(let t=0;t<6;t++)c.__webglFramebuffer[t]=e.createFramebuffer()}else{if(c.__webglFramebuffer=e.createFramebuffer(),d)if(r.drawBuffers){let i=t.texture;for(let t=0,r=i.length;t<r;t++){let r=n.get(i[t]);void 0===r.__webglTexture&&(r.__webglTexture=e.createTexture(),s.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(l&&t.samples>0&&!1===j(t)){let n=d?o:[o];c.__webglMultisampledFramebuffer=e.createFramebuffer(),c.__webglColorRenderbuffer=[],i.bindFramebuffer(36160,c.__webglMultisampledFramebuffer);for(let i=0;i<n.length;i++){let r=n[i];c.__webglColorRenderbuffer[i]=e.createRenderbuffer(),e.bindRenderbuffer(36161,c.__webglColorRenderbuffer[i]);let s=a.convert(r.format,r.encoding),o=a.convert(r.type),l=S(r.internalFormat,s,o,r.encoding,!0===t.isXRRenderTarget),h=F(t);e.renderbufferStorageMultisample(36161,h,l,t.width,t.height),e.framebufferRenderbuffer(36160,36064+i,36161,c.__webglColorRenderbuffer[i])}e.bindRenderbuffer(36161,null),t.depthBuffer&&(c.__webglDepthRenderbuffer=e.createRenderbuffer(),z(c.__webglDepthRenderbuffer,t,!0)),i.bindFramebuffer(36160,null)}}if(u){i.bindTexture(34067,h.__webglTexture),I(34067,o,p);for(let e=0;e<6;e++)B(c.__webglFramebuffer[e],t,o,36064,34069+e);w(o,p)&&_(34067),i.unbindTexture()}else if(d){let e=t.texture;for(let r=0,a=e.length;r<a;r++){let a=e[r],s=n.get(a);i.bindTexture(3553,s.__webglTexture),I(3553,a,p),B(c.__webglFramebuffer,t,a,36064+r,3553),w(a,p)&&_(3553)}i.unbindTexture()}else{let e=3553;(t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(l?e=t.isWebGL3DRenderTarget?32879:35866:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),i.bindTexture(e,h.__webglTexture),I(e,o,p),B(c.__webglFramebuffer,t,o,36064,e),w(o,p)&&_(e),i.unbindTexture()}t.depthBuffer&&N(t)},this.updateRenderTargetMipmap=function(e){let t=x(e)||l,r=!0===e.isWebGLMultipleRenderTargets?e.texture:[e.texture];for(let a=0,s=r.length;a<s;a++){let s=r[a];if(w(s,t)){let t=e.isWebGLCubeRenderTarget?34067:3553,r=n.get(s).__webglTexture;i.bindTexture(t,r),_(t),i.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(l&&t.samples>0&&!1===j(t)){let r=t.isWebGLMultipleRenderTargets?t.texture:[t.texture],a=t.width,s=t.height,o=16384,l=[],c=t.stencilBuffer?33306:36096,h=n.get(t),u=!0===t.isWebGLMultipleRenderTargets;if(u)for(let t=0;t<r.length;t++)i.bindFramebuffer(36160,h.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064+t,36161,null),i.bindFramebuffer(36160,h.__webglFramebuffer),e.framebufferTexture2D(36009,36064+t,3553,null,0);i.bindFramebuffer(36008,h.__webglMultisampledFramebuffer),i.bindFramebuffer(36009,h.__webglFramebuffer);for(let i=0;i<r.length;i++){l.push(36064+i),t.depthBuffer&&l.push(c);let d=void 0!==h.__ignoreDepthValues&&h.__ignoreDepthValues;if(!1===d&&(t.depthBuffer&&(o|=256),t.stencilBuffer&&(o|=1024)),u&&e.framebufferRenderbuffer(36008,36064,36161,h.__webglColorRenderbuffer[i]),!0===d&&(e.invalidateFramebuffer(36008,[c]),e.invalidateFramebuffer(36009,[c])),u){let t=n.get(r[i]).__webglTexture;e.framebufferTexture2D(36009,36064,3553,t,0)}e.blitFramebuffer(0,0,a,s,0,0,a,s,o,9728),f&&e.invalidateFramebuffer(36008,l)}if(i.bindFramebuffer(36008,null),i.bindFramebuffer(36009,null),u)for(let t=0;t<r.length;t++){i.bindFramebuffer(36160,h.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064+t,36161,h.__webglColorRenderbuffer[t]);let a=n.get(r[t]).__webglTexture;i.bindFramebuffer(36160,h.__webglFramebuffer),e.framebufferTexture2D(36009,36064+t,3553,a,0)}i.bindFramebuffer(36009,h.__webglMultisampledFramebuffer)}},this.setupDepthRenderbuffer=N,this.setupFrameBufferTexture=B,this.useMultisampledRTT=j}function bk(e,t,i){let n=i.isWebGL2;return{convert:function(i){let r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(i===kE)return 5121;if(i===FE)return 32819;if(i===jE)return 32820;if(i===OE)return 5120;if(i===IE)return 5122;if(i===RE)return 5123;if(i===LE)return 5124;if(i===BE)return 5125;if(i===zE)return 5126;if(i===NE)return n?5131:(r=t.get("OES_texture_half_float"),null!==r?r.HALF_FLOAT_OES:null);if(i===UE)return 6406;if(i===GE)return 6408;if(i===HE)return 6409;if(i===WE)return 6410;if(i===qE)return 6402;if(i===XE)return 34041;if(i===YC)return r=t.get("EXT_sRGB"),null!==r?r.SRGB_ALPHA_EXT:null;if(i===YE)return 6403;if(i===QE)return 36244;if(i===ZE)return 33319;if(i===KE)return 33320;if(i===JE)return 36249;if(i===$E||i===eC||i===tC||i===iC)if(a===NC){if(r=t.get("WEBGL_compressed_texture_s3tc_srgb"),null===r)return null;if(i===$E)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===eC)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===tC)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===iC)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(r=t.get("WEBGL_compressed_texture_s3tc"),null===r)return null;if(i===$E)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===eC)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===tC)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===iC)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(i===nC||i===rC||i===aC||i===sC){if(r=t.get("WEBGL_compressed_texture_pvrtc"),null===r)return null;if(i===nC)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===rC)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===aC)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===sC)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(i===oC)return r=t.get("WEBGL_compressed_texture_etc1"),null!==r?r.COMPRESSED_RGB_ETC1_WEBGL:null;if(i===lC||i===cC){if(r=t.get("WEBGL_compressed_texture_etc"),null===r)return null;if(i===lC)return a===NC?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(i===cC)return a===NC?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}if(i===hC||i===uC||i===dC||i===pC||i===fC||i===mC||i===gC||i===vC||i===yC||i===bC||i===xC||i===wC||i===_C||i===SC){if(r=t.get("WEBGL_compressed_texture_astc"),null===r)return null;if(i===hC)return a===NC?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===uC)return a===NC?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===dC)return a===NC?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===pC)return a===NC?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===fC)return a===NC?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===mC)return a===NC?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===gC)return a===NC?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===vC)return a===NC?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===yC)return a===NC?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===bC)return a===NC?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===xC)return a===NC?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===wC)return a===NC?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===_C)return a===NC?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===SC)return a===NC?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}if(i===EC){if(r=t.get("EXT_texture_compression_bptc"),null===r)return null;if(i===EC)return a===NC?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT}if(i===CC||i===AC||i===MC||i===TC){if(r=t.get("EXT_texture_compression_rgtc"),null===r)return null;if(i===EC)return r.COMPRESSED_RED_RGTC1_EXT;if(i===AC)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===MC)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===TC)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return i===VE?n?34042:(r=t.get("WEBGL_depth_texture"),null!==r?r.UNSIGNED_INT_24_8_WEBGL:null):void 0!==e[i]?e[i]:null}}}var xk=class extends zT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];super(),this.isArrayCamera=!0,this.cameras=e}},wk=class extends jM{constructor(){super(),this.isGroup=!0,this.type="Group"}},_k={type:"move"},Sk=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new wk,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new wk,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new FA,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new FA),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new wk,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new FA,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new FA),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,i){let n=null,r=null,a=null,s=this._targetRay,o=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){a=!0;for(let a of e.hand.values()){let e=t.getJointPose(a,i),n=this._getHandJoint(l,a);null!==e&&(n.matrix.fromArray(e.transform.matrix),n.matrix.decompose(n.position,n.rotation,n.scale),n.jointRadius=e.radius),n.visible=null!==e}let n=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],s=n.position.distanceTo(r.position),o=.02,c=.005;l.inputState.pinching&&s>o+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&s<=o-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&e.gripSpace&&(r=t.getPose(e.gripSpace,i),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1));null!==s&&(n=t.getPose(e.targetRaySpace,i),null===n&&null!==r&&(n=r),null!==n&&(s.matrix.fromArray(n.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),n.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(n.linearVelocity)):s.hasLinearVelocity=!1,n.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(n.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(_k)))}return null!==s&&(s.visible=null!==n),null!==o&&(o.visible=null!==r),null!==l&&(l.visible=null!==a),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){let i=new wk;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}},Ek=class extends IA{constructor(e,t,i,n,r,a,s,o,l,c){if((c=void 0!==c?c:qE)!==qE&&c!==XE)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&c===qE&&(i=BE),void 0===i&&c===XE&&(i=VE),super(null,n,r,a,s,o,c,i,l),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=void 0!==s?s:CE,this.minFilter=void 0!==o?o:CE,this.flipY=!1,this.generateMipmaps=!1}},Ck=class extends QC{constructor(e,t){super();let i=this,n=null,r=1,a=null,s="local-floor",o=1,l=null,c=null,h=null,u=null,d=null,p=null,f=t.getContextAttributes(),m=null,g=null,v=[],y=[],b=new Set,x=new Map,w=new zT;w.layers.enable(1),w.viewport=new RA;let _=new zT;_.layers.enable(2),_.viewport=new RA;let S=[w,_],E=new xk;E.layers.enable(1),E.layers.enable(2);let C=null,A=null;function M(e){let t=y.indexOf(e.inputSource);if(-1===t)return;let i=v[t];void 0!==i&&i.dispatchEvent({type:e.type,data:e.inputSource})}function T(){n.removeEventListener("select",M),n.removeEventListener("selectstart",M),n.removeEventListener("selectend",M),n.removeEventListener("squeeze",M),n.removeEventListener("squeezestart",M),n.removeEventListener("squeezeend",M),n.removeEventListener("end",T),n.removeEventListener("inputsourceschange",P);for(let e=0;e<v.length;e++){let t=y[e];null!==t&&(y[e]=null,v[e].disconnect(t))}C=null,A=null,e.setRenderTarget(m),d=null,u=null,h=null,n=null,g=null,R.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}function P(e){for(let t=0;t<e.removed.length;t++){let i=e.removed[t],n=y.indexOf(i);n>=0&&(y[n]=null,v[n].disconnect(i))}for(let t=0;t<e.added.length;t++){let i=e.added[t],n=y.indexOf(i);if(-1===n){for(let e=0;e<v.length;e++){if(e>=y.length){y.push(i),n=e;break}if(null===y[e]){y[e]=i,n=e;break}}if(-1===n)break}let r=v[n];r&&r.connect(i)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=v[e];return void 0===t&&(t=new Sk,v[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=v[e];return void 0===t&&(t=new Sk,v[e]=t),t.getGripSpace()},this.getHand=function(e){let t=v[e];return void 0===t&&(t=new Sk,v[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){r=e,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){s=e,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||a},this.setReferenceSpace=function(e){l=e},this.getBaseLayer=function(){return null!==u?u:d},this.getBinding=function(){return h},this.getFrame=function(){return p},this.getSession=function(){return n},this.setSession=async function(c){if(n=c,null!==n){if(m=e.getRenderTarget(),n.addEventListener("select",M),n.addEventListener("selectstart",M),n.addEventListener("selectend",M),n.addEventListener("squeeze",M),n.addEventListener("squeezestart",M),n.addEventListener("squeezeend",M),n.addEventListener("end",T),n.addEventListener("inputsourceschange",P),!0!==f.xrCompatible&&await t.makeXRCompatible(),void 0===n.renderState.layers||!1===e.capabilities.isWebGL2){let i={antialias:void 0!==n.renderState.layers||f.antialias,alpha:f.alpha,depth:f.depth,stencil:f.stencil,framebufferScaleFactor:r};d=new XRWebGLLayer(n,t,i),n.updateRenderState({baseLayer:d}),g=new LA(d.framebufferWidth,d.framebufferHeight,{format:GE,type:kE,encoding:e.outputEncoding,stencilBuffer:f.stencil})}else{let i=null,a=null,s=null;f.depth&&(s=f.stencil?35056:33190,i=f.stencil?XE:qE,a=f.stencil?VE:BE);let o={colorFormat:32856,depthFormat:s,scaleFactor:r};h=new XRWebGLBinding(n,t),u=h.createProjectionLayer(o),n.updateRenderState({layers:[u]}),g=new LA(u.textureWidth,u.textureHeight,{format:GE,type:kE,depthTexture:new Ek(u.textureWidth,u.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,i),stencilBuffer:f.stencil,encoding:e.outputEncoding,samples:f.antialias?4:0}),e.properties.get(g).__ignoreDepthValues=u.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(o),l=null,a=await n.requestReferenceSpace(s),R.setContext(n),R.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};let D=new FA,k=new FA;function O(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===n)return;E.near=_.near=w.near=e.near,E.far=_.far=w.far=e.far,(C!==E.near||A!==E.far)&&(n.updateRenderState({depthNear:E.near,depthFar:E.far}),C=E.near,A=E.far);let t=e.parent,i=E.cameras;O(E,t);for(let n=0;n<i.length;n++)O(i[n],t);E.matrixWorld.decompose(E.position,E.quaternion,E.scale),e.matrix.copy(E.matrix),e.matrix.decompose(e.position,e.quaternion,e.scale);let r=e.children;for(let n=0,a=r.length;n<a;n++)r[n].updateMatrixWorld(!0);2===i.length?function(e,t,i){D.setFromMatrixPosition(t.matrixWorld),k.setFromMatrixPosition(i.matrixWorld);let n=D.distanceTo(k),r=t.projectionMatrix.elements,a=i.projectionMatrix.elements,s=r[14]/(r[10]-1),o=r[14]/(r[10]+1),l=(r[9]+1)/r[5],c=(r[9]-1)/r[5],h=(r[8]-1)/r[0],u=(a[8]+1)/a[0],d=s*h,p=s*u,f=n/(-h+u),m=f*-h;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(f),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert();let g=s+f,v=o+f,y=d-m,b=p+(n-m),x=l*o/v*g,w=c*o/v*g;e.projectionMatrix.makePerspective(y,b,x,w,g,v)}(E,w,_):E.projectionMatrix.copy(w.projectionMatrix)},this.getCamera=function(){return E},this.getFoveation=function(){if(null!==u||null!==d)return o},this.setFoveation=function(e){o=e,null!==u&&(u.fixedFoveation=e),null!==d&&void 0!==d.fixedFoveation&&(d.fixedFoveation=e)},this.getPlanes=function(){return b};let I=null;let R=new QT;R.setAnimationLoop((function(t,n){if(c=n.getViewerPose(l||a),p=n,null!==c){let t=c.views;null!==d&&(e.setRenderTargetFramebuffer(g,d.framebuffer),e.setRenderTarget(g));let i=!1;t.length!==E.cameras.length&&(E.cameras.length=0,i=!0);for(let n=0;n<t.length;n++){let r=t[n],a=null;if(null!==d)a=d.getViewport(r);else{let t=h.getViewSubImage(u,r);a=t.viewport,0===n&&(e.setRenderTargetTextures(g,t.colorTexture,u.ignoreDepthValues?void 0:t.depthStencilTexture),e.setRenderTarget(g))}let s=S[n];void 0===s&&(s=new zT,s.layers.enable(n),s.viewport=new RA,S[n]=s),s.matrix.fromArray(r.transform.matrix),s.projectionMatrix.fromArray(r.projectionMatrix),s.viewport.set(a.x,a.y,a.width,a.height),0===n&&E.matrix.copy(s.matrix),!0===i&&E.cameras.push(s)}}for(let e=0;e<v.length;e++){let t=y[e],i=v[e];null!==t&&void 0!==i&&i.update(t,n,l||a)}if(I&&I(t,n),n.detectedPlanes){i.dispatchEvent({type:"planesdetected",data:n.detectedPlanes});let e=null;for(let t of b)n.detectedPlanes.has(t)||(null===e&&(e=[]),e.push(t));if(null!==e)for(let t of e)b.delete(t),x.delete(t),i.dispatchEvent({type:"planeremoved",data:t});for(let t of n.detectedPlanes)if(b.has(t)){let e=x.get(t);t.lastChangedTime>e&&(x.set(t,t.lastChangedTime),i.dispatchEvent({type:"planechanged",data:t}))}else b.add(t),x.set(t,n.lastChangedTime),i.dispatchEvent({type:"planeadded",data:t})}p=null})),this.setAnimationLoop=function(e){I=e},this.dispose=function(){}}};function Ak(e,t){function i(i,n){i.opacity.value=n.opacity,n.color&&i.diffuse.value.copy(n.color),n.emissive&&i.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),n.map&&(i.map.value=n.map),n.alphaMap&&(i.alphaMap.value=n.alphaMap),n.bumpMap&&(i.bumpMap.value=n.bumpMap,i.bumpScale.value=n.bumpScale,n.side===DS&&(i.bumpScale.value*=-1)),n.displacementMap&&(i.displacementMap.value=n.displacementMap,i.displacementScale.value=n.displacementScale,i.displacementBias.value=n.displacementBias),n.emissiveMap&&(i.emissiveMap.value=n.emissiveMap),n.normalMap&&(i.normalMap.value=n.normalMap,i.normalScale.value.copy(n.normalScale),n.side===DS&&i.normalScale.value.negate()),n.specularMap&&(i.specularMap.value=n.specularMap),n.alphaTest>0&&(i.alphaTest.value=n.alphaTest);let r,a,s=t.get(n).envMap;if(s&&(i.envMap.value=s,i.flipEnvMap.value=s.isCubeTexture&&!1===s.isRenderTargetTexture?-1:1,i.reflectivity.value=n.reflectivity,i.ior.value=n.ior,i.refractionRatio.value=n.refractionRatio),n.lightMap){i.lightMap.value=n.lightMap;let t=!0!==e.physicallyCorrectLights?Math.PI:1;i.lightMapIntensity.value=n.lightMapIntensity*t}n.aoMap&&(i.aoMap.value=n.aoMap,i.aoMapIntensity.value=n.aoMapIntensity),n.map?r=n.map:n.specularMap?r=n.specularMap:n.displacementMap?r=n.displacementMap:n.normalMap?r=n.normalMap:n.bumpMap?r=n.bumpMap:n.roughnessMap?r=n.roughnessMap:n.metalnessMap?r=n.metalnessMap:n.alphaMap?r=n.alphaMap:n.emissiveMap?r=n.emissiveMap:n.clearcoatMap?r=n.clearcoatMap:n.clearcoatNormalMap?r=n.clearcoatNormalMap:n.clearcoatRoughnessMap?r=n.clearcoatRoughnessMap:n.iridescenceMap?r=n.iridescenceMap:n.iridescenceThicknessMap?r=n.iridescenceThicknessMap:n.specularIntensityMap?r=n.specularIntensityMap:n.specularColorMap?r=n.specularColorMap:n.transmissionMap?r=n.transmissionMap:n.thicknessMap?r=n.thicknessMap:n.sheenColorMap?r=n.sheenColorMap:n.sheenRoughnessMap&&(r=n.sheenRoughnessMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),i.uvTransform.value.copy(r.matrix)),n.aoMap?a=n.aoMap:n.lightMap&&(a=n.lightMap),void 0!==a&&(a.isWebGLRenderTarget&&(a=a.texture),!0===a.matrixAutoUpdate&&a.updateMatrix(),i.uv2Transform.value.copy(a.matrix))}return{refreshFogUniforms:function(t,i){i.color.getRGB(t.fogColor.value,IT(e)),i.isFog?(t.fogNear.value=i.near,t.fogFar.value=i.far):i.isFogExp2&&(t.fogDensity.value=i.density)},refreshMaterialUniforms:function(e,n,r,a,s){n.isMeshBasicMaterial||n.isMeshLambertMaterial?i(e,n):n.isMeshToonMaterial?(i(e,n),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,n)):n.isMeshPhongMaterial?(i(e,n),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,n)):n.isMeshStandardMaterial?(i(e,n),function(e,i){e.roughness.value=i.roughness,e.metalness.value=i.metalness,i.roughnessMap&&(e.roughnessMap.value=i.roughnessMap),i.metalnessMap&&(e.metalnessMap.value=i.metalnessMap),t.get(i).envMap&&(e.envMapIntensity.value=i.envMapIntensity)}(e,n),n.isMeshPhysicalMaterial&&function(e,t,i){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap)),t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap),t.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),e.clearcoatNormalMap.value=t.clearcoatNormalMap,t.side===DS&&e.clearcoatNormalScale.value.negate())),t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap)),t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=i.texture,e.transmissionSamplerSize.value.set(i.width,i.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor)),e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap)}(e,n,s)):n.isMeshMatcapMaterial?(i(e,n),function(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,n)):n.isMeshDepthMaterial?i(e,n):n.isMeshDistanceMaterial?(i(e,n),function(e,t){e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(e,n)):n.isMeshNormalMaterial?i(e,n):n.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(e,n),n.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,n)):n.isPointsMaterial?function(e,t,i,n){let r;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*i,e.scale.value=.5*n,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest),t.map?r=t.map:t.alphaMap&&(r=t.alphaMap),void 0!==r&&(!0===r.matrixAutoUpdate&&r.updateMatrix(),e.uvTransform.value.copy(r.matrix))}(e,n,r,a):n.isSpriteMaterial?function(e,t){let i;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest),t.map?i=t.map:t.alphaMap&&(i=t.alphaMap),void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),e.uvTransform.value.copy(i.matrix))}(e,n):n.isShadowMaterial?(e.color.value.copy(n.color),e.opacity.value=n.opacity):n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)}}}function Mk(e,t,i,n){let r={},a={},s=[],o=i.isWebGL2?e.getParameter(35375):0;function l(e,t,i){let n=e.value;if(void 0===i[t]){if("number"==typeof n)i[t]=n;else{let e=Array.isArray(n)?n:[n],r=[];for(let t=0;t<e.length;t++)r.push(e[t].clone());i[t]=r}return!0}if("number"==typeof n){if(i[t]!==n)return i[t]=n,!0}else{let e=Array.isArray(i[t])?i[t]:[i[t]],r=Array.isArray(n)?n:[n];for(let t=0;t<e.length;t++){let i=e[t];if(!1===i.equals(r[t]))return i.copy(r[t]),!0}}return!1}function c(e){let t={boundary:0,storage:0};return"number"==typeof e?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",e),t}function h(t){let i=t.target;i.removeEventListener("dispose",h);let n=s.indexOf(i.__bindingPointIndex);s.splice(n,1),e.deleteBuffer(r[i.id]),delete r[i.id],delete a[i.id]}return{bind:function(e,t){let i=t.program;n.uniformBlockBinding(e,i)},update:function(i,u){let d=r[i.id];void 0===d&&(function(e){let t=e.uniforms,i=0,n=16,r=0;for(let a=0,s=t.length;a<s;a++){let e=t[a],s={boundary:0,storage:0},o=Array.isArray(e.value)?e.value:[e.value];for(let t=0,i=o.length;t<i;t++){let e=c(o[t]);s.boundary+=e.boundary,s.storage+=e.storage}if(e.__data=new Float32Array(s.storage/Float32Array.BYTES_PER_ELEMENT),e.__offset=i,a>0){r=i%n,0!==r&&n-r-s.boundary<0&&(i+=n-r,e.__offset=i)}i+=s.storage}r=i%n,r>0&&(i+=n-r),e.__size=i,e.__cache={}}(i),d=function(t){let i=function(){for(let e=0;e<o;e++)if(-1===s.indexOf(e))return s.push(e),e;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();t.__bindingPointIndex=i;let n=e.createBuffer(),r=t.__size,a=t.usage;return e.bindBuffer(35345,n),e.bufferData(35345,r,a),e.bindBuffer(35345,null),e.bindBufferBase(35345,i,n),n}(i),r[i.id]=d,i.addEventListener("dispose",h));let p=u.program;n.updateUBOMapping(i,p);let f=t.render.frame;a[i.id]!==f&&(function(t){let i=r[t.id],n=t.uniforms,a=t.__cache;e.bindBuffer(35345,i);for(let r=0,s=n.length;r<s;r++){let t=n[r];if(!0===l(t,r,a)){let i=t.__offset,n=Array.isArray(t.value)?t.value:[t.value],r=0;for(let a=0;a<n.length;a++){let s=n[a],o=c(s);"number"==typeof s?(t.__data[0]=s,e.bufferSubData(35345,i+r,t.__data)):s.isMatrix3?(t.__data[0]=s.elements[0],t.__data[1]=s.elements[1],t.__data[2]=s.elements[2],t.__data[3]=s.elements[0],t.__data[4]=s.elements[3],t.__data[5]=s.elements[4],t.__data[6]=s.elements[5],t.__data[7]=s.elements[0],t.__data[8]=s.elements[6],t.__data[9]=s.elements[7],t.__data[10]=s.elements[8],t.__data[11]=s.elements[0]):(s.toArray(t.__data,r),r+=o.storage/Float32Array.BYTES_PER_ELEMENT)}e.bufferSubData(35345,i,t.__data)}}e.bindBuffer(35345,null)}(i),a[i.id]=f)},dispose:function(){for(let t in r)e.deleteBuffer(r[t]);s=[],r={},a={}}}}function Tk(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.isWebGLRenderer=!0;let t,i=void 0!==e.canvas?e.canvas:function(){let e=gA("canvas");return e.style.display="block",e}(),n=void 0!==e.context?e.context:null,r=void 0===e.depth||e.depth,a=void 0===e.stencil||e.stencil,s=void 0!==e.antialias&&e.antialias,o=void 0===e.premultipliedAlpha||e.premultipliedAlpha,l=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,c=void 0!==e.powerPreference?e.powerPreference:"default",h=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat;t=null!==n?n.getContextAttributes().alpha:void 0!==e.alpha&&e.alpha;let u=null,d=null,p=[],f=[];this.domElement=i,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=zC,this.physicallyCorrectLights=!1,this.toneMapping=uE,this.toneMappingExposure=1;let m=this,g=!1,v=0,y=0,b=null,x=-1,w=null,_=new RA,S=new RA,E=null,C=i.width,A=i.height,M=1,T=null,P=null,D=new RA(0,0,C,A),k=new RA(0,0,C,A),O=!1,I=new YT,R=!1,L=!1,B=null,z=new mM,N=new hA,F=new FA,j={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function U(){return null===b?M:1}let G,H,W,q,X,Y,Q,Z,K,J,$,ee,te,ie,ne,re,ae,se,oe,le,ce,he,ue,de,pe=n;function fe(e,t){for(let n=0;n<e.length;n++){let r=e[n],a=i.getContext(r,t);if(null!==a)return a}return null}try{let e={alpha:!0,depth:r,stencil:a,antialias:s,premultipliedAlpha:o,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:h};if("setAttribute"in i&&i.setAttribute("data-engine","three.js r".concat(yS)),i.addEventListener("webglcontextlost",ve,!1),i.addEventListener("webglcontextrestored",ye,!1),i.addEventListener("webglcontextcreationerror",be,!1),null===pe){let t=["webgl2","webgl","experimental-webgl"];if(!0===m.isWebGL1Renderer&&t.shift(),pe=fe(t,e),null===pe)throw fe(t)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===pe.getShaderPrecisionFormat&&(pe.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(V){throw console.error("THREE.WebGLRenderer: "+V.message),V}function me(){G=new SP(pe),H=new aP(pe,G,e),G.init(H),he=new bk(pe,G,H),W=new vk(pe,G,H),q=new AP,X=new tk,Y=new yk(pe,G,W,X,H,he,q),Q=new oP(m),Z=new _P(m),K=new ZT(pe,H),ue=new nP(pe,G,K,H),J=new EP(pe,K,q,ue),$=new DP(pe,J,K,q),oe=new PP(pe,H,Y),re=new sP(X),ee=new ek(m,Q,Z,G,H,ue,re),te=new Ak(m,X),ie=new ak,ne=new uk(G,H),se=new iP(m,Q,Z,W,$,t,o),ae=new gk(m,$,H),de=new Mk(pe,q,H,W),le=new rP(pe,G,q,H),ce=new CP(pe,G,q,H),q.programs=ee.programs,m.capabilities=H,m.extensions=G,m.properties=X,m.renderLists=ie,m.shadowMap=ae,m.state=W,m.info=q}me();let ge=new Ck(m,pe);function ve(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),g=!0}function ye(){console.log("THREE.WebGLRenderer: Context Restored."),g=!1;let e=q.autoReset,t=ae.enabled,i=ae.autoUpdate,n=ae.needsUpdate,r=ae.type;me(),q.autoReset=e,ae.enabled=t,ae.autoUpdate=i,ae.needsUpdate=n,ae.type=r}function be(e){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",e.statusMessage)}function xe(e){let t=e.target;t.removeEventListener("dispose",xe),function(e){(function(e){let t=X.get(e).programs;void 0!==t&&(t.forEach((function(e){ee.releaseProgram(e)})),e.isShaderMaterial&&ee.releaseShaderCache(e))})(e),X.remove(e)}(t)}this.xr=ge,this.getContext=function(){return pe},this.getContextAttributes=function(){return pe.getContextAttributes()},this.forceContextLoss=function(){let e=G.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){let e=G.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return M},this.setPixelRatio=function(e){void 0!==e&&(M=e,this.setSize(C,A,!1))},this.getSize=function(e){return e.set(C,A)},this.setSize=function(e,t,n){ge.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(C=e,A=t,i.width=Math.floor(e*M),i.height=Math.floor(t*M),!1!==n&&(i.style.width=e+"px",i.style.height=t+"px"),this.setViewport(0,0,e,t))},this.getDrawingBufferSize=function(e){return e.set(C*M,A*M).floor()},this.setDrawingBufferSize=function(e,t,n){C=e,A=t,M=n,i.width=Math.floor(e*n),i.height=Math.floor(t*n),this.setViewport(0,0,e,t)},this.getCurrentViewport=function(e){return e.copy(_)},this.getViewport=function(e){return e.copy(D)},this.setViewport=function(e,t,i,n){e.isVector4?D.set(e.x,e.y,e.z,e.w):D.set(e,t,i,n),W.viewport(_.copy(D).multiplyScalar(M).floor())},this.getScissor=function(e){return e.copy(k)},this.setScissor=function(e,t,i,n){e.isVector4?k.set(e.x,e.y,e.z,e.w):k.set(e,t,i,n),W.scissor(S.copy(k).multiplyScalar(M).floor())},this.getScissorTest=function(){return O},this.setScissorTest=function(e){W.setScissorTest(O=e)},this.setOpaqueSort=function(e){T=e},this.setTransparentSort=function(e){P=e},this.getClearColor=function(e){return e.copy(se.getClearColor())},this.setClearColor=function(){se.setClearColor.apply(se,arguments)},this.getClearAlpha=function(){return se.getClearAlpha()},this.setClearAlpha=function(){se.setClearAlpha.apply(se,arguments)},this.clear=function(){let e=0;(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&(e|=16384),(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&(e|=256),(!(arguments.length>2&&void 0!==arguments[2])||arguments[2])&&(e|=1024),pe.clear(e)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){i.removeEventListener("webglcontextlost",ve,!1),i.removeEventListener("webglcontextrestored",ye,!1),i.removeEventListener("webglcontextcreationerror",be,!1),ie.dispose(),ne.dispose(),X.dispose(),Q.dispose(),Z.dispose(),$.dispose(),ue.dispose(),de.dispose(),ee.dispose(),ge.dispose(),ge.removeEventListener("sessionstart",_e),ge.removeEventListener("sessionend",Se),B&&(B.dispose(),B=null),Ee.stop()},this.renderBufferDirect=function(e,t,i,n,r,a){null===t&&(t=j);let s=r.isMesh&&r.matrixWorld.determinant()<0,o=function(e,t,i,n,r){!0!==t.isScene&&(t=j),Y.resetTextureUnits();let a=t.fog,s=n.isMeshStandardMaterial?t.environment:null,o=null===b?m.outputEncoding:!0===b.isXRRenderTarget?b.texture.encoding:zC,l=(n.isMeshStandardMaterial?Z:Q).get(n.envMap||s),c=!0===n.vertexColors&&!!i.attributes.color&&4===i.attributes.color.itemSize,h=!!n.normalMap&&!!i.attributes.tangent,u=!!i.morphAttributes.position,p=!!i.morphAttributes.normal,f=!!i.morphAttributes.color,g=n.toneMapped?m.toneMapping:uE,v=i.morphAttributes.position||i.morphAttributes.normal||i.morphAttributes.color,y=void 0!==v?v.length:0,_=X.get(n),S=d.state.lights;if(!0===R&&(!0===L||e!==w)){let t=e===w&&n.id===x;re.setState(n,e,t)}let E=!1;n.version===_.__version?(_.needsLights&&_.lightsStateVersion!==S.state.version||_.outputEncoding!==o||r.isInstancedMesh&&!1===_.instancing||!r.isInstancedMesh&&!0===_.instancing||r.isSkinnedMesh&&!1===_.skinning||!r.isSkinnedMesh&&!0===_.skinning||_.envMap!==l||!0===n.fog&&_.fog!==a||void 0!==_.numClippingPlanes&&(_.numClippingPlanes!==re.numPlanes||_.numIntersection!==re.numIntersection)||_.vertexAlphas!==c||_.vertexTangents!==h||_.morphTargets!==u||_.morphNormals!==p||_.morphColors!==f||_.toneMapping!==g||!0===H.isWebGL2&&_.morphTargetsCount!==y)&&(E=!0):(E=!0,_.__version=n.version);let C=_.currentProgram;!0===E&&(C=Pe(n,t,r));let T=!1,P=!1,D=!1,k=C.getUniforms(),O=_.uniforms;if(W.useProgram(C.program)&&(T=!0,P=!0,D=!0),n.id!==x&&(x=n.id,P=!0),T||w!==e){if(k.setValue(pe,"projectionMatrix",e.projectionMatrix),H.logarithmicDepthBuffer&&k.setValue(pe,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),w!==e&&(w=e,P=!0,D=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){let t=k.map.cameraPosition;void 0!==t&&t.setValue(pe,F.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&k.setValue(pe,"isOrthographic",!0===e.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.isShadowMaterial||r.isSkinnedMesh)&&k.setValue(pe,"viewMatrix",e.matrixWorldInverse)}if(r.isSkinnedMesh){k.setOptional(pe,r,"bindMatrix"),k.setOptional(pe,r,"bindMatrixInverse");let e=r.skeleton;e&&(H.floatVertexTextures?(null===e.boneTexture&&e.computeBoneTexture(),k.setValue(pe,"boneTexture",e.boneTexture,Y),k.setValue(pe,"boneTextureSize",e.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}let I=i.morphAttributes;if((void 0!==I.position||void 0!==I.normal||void 0!==I.color&&!0===H.isWebGL2)&&oe.update(r,i,n,C),(P||_.receiveShadow!==r.receiveShadow)&&(_.receiveShadow=r.receiveShadow,k.setValue(pe,"receiveShadow",r.receiveShadow)),n.isMeshGouraudMaterial&&null!==n.envMap&&(O.envMap.value=l,O.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1),P&&(k.setValue(pe,"toneMappingExposure",m.toneMappingExposure),_.needsLights&&function(e,t){e.ambientLightColor.needsUpdate=t,e.lightProbe.needsUpdate=t,e.directionalLights.needsUpdate=t,e.directionalLightShadows.needsUpdate=t,e.pointLights.needsUpdate=t,e.pointLightShadows.needsUpdate=t,e.spotLights.needsUpdate=t,e.spotLightShadows.needsUpdate=t,e.rectAreaLights.needsUpdate=t,e.hemisphereLights.needsUpdate=t}(O,D),a&&!0===n.fog&&te.refreshFogUniforms(O,a),te.refreshMaterialUniforms(O,n,M,A,B),RD.upload(pe,_.uniformsList,O,Y)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(RD.upload(pe,_.uniformsList,O,Y),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&k.setValue(pe,"center",r.center),k.setValue(pe,"modelViewMatrix",r.modelViewMatrix),k.setValue(pe,"normalMatrix",r.normalMatrix),k.setValue(pe,"modelMatrix",r.matrixWorld),r.previousModelViewMatrix&&k.setValue(pe,"previousModelViewMatrix",r.previousModelViewMatrix),e.previousProjectionMatrix&&k.setValue(pe,"previousProjectionMatrix",e.previousProjectionMatrix),n.isShaderMaterial||n.isRawShaderMaterial){let e=n.uniformsGroups;for(let t=0,i=e.length;t<i;t++)if(H.isWebGL2){let i=e[t];de.update(i,C),de.bind(i,C)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return C}(e,t,i,n,r);W.setMaterial(n,s);let l=i.index,c=1;!0===n.wireframe&&(l=J.getWireframeAttribute(i),c=2);let h=i.drawRange,u=i.attributes.position,p=h.start*c,f=(h.start+h.count)*c;null!==a&&(p=Math.max(p,a.start*c),f=Math.min(f,(a.start+a.count)*c)),null!==l?(p=Math.max(p,0),f=Math.min(f,l.count)):null!=u&&(p=Math.max(p,0),f=Math.min(f,u.count));let g=f-p;if(g<0||g===1/0)return;ue.setup(r,n,o,i,l);let v,y=le;if(null!==l&&(v=K.get(l),y=ce,y.setIndex(v)),r.isMesh)!0===n.wireframe?(W.setLineWidth(n.wireframeLinewidth*U()),y.setMode(1)):y.setMode(4);else if(r.isLine){let e=n.linewidth;void 0===e&&(e=1),W.setLineWidth(e*U()),r.isLineSegments?y.setMode(1):r.isLineLoop?y.setMode(2):y.setMode(3)}else r.isPoints?y.setMode(0):r.isSprite&&y.setMode(4);if(r.isInstancedMesh)y.renderInstances(p,g,r.count);else if(i.isInstancedBufferGeometry){let e=void 0!==i._maxInstanceCount?i._maxInstanceCount:1/0,t=Math.min(i.instanceCount,e);y.renderInstances(p,g,t)}else y.render(p,g)},this.compile=function(e,t){function i(e,t,i){!0===e.transparent&&e.side===kS&&!1===e.forceSinglePass?(e.side=DS,e.needsUpdate=!0,Pe(e,t,i),e.side=PS,e.needsUpdate=!0,Pe(e,t,i),e.side=kS):Pe(e,t,i)}d=ne.get(e),d.init(),f.push(d),e.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(d.pushLight(e),e.castShadow&&d.pushShadow(e))})),d.setupLights(m.physicallyCorrectLights),e.traverse((function(t){let n=t.material;if(n)if(Array.isArray(n))for(let r=0;r<n.length;r++){i(n[r],e,t)}else i(n,e,t)})),f.pop(),d=null};let we=null;function _e(){Ee.stop()}function Se(){Ee.start()}let Ee=new QT;function Ce(e,t,i,n){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)i=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)d.pushLight(e),e.castShadow&&d.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||I.intersectsSprite(e)){n&&F.setFromMatrixPosition(e.matrixWorld).applyMatrix4(z);let t=$.update(e),r=e.material;r.visible&&u.push(e,t,r,i,F.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==q.render.frame&&(e.skeleton.update(),e.skeleton.frame=q.render.frame),!e.frustumCulled||I.intersectsObject(e))){n&&F.setFromMatrixPosition(e.matrixWorld).applyMatrix4(z);let t=$.update(e),r=e.material;if(Array.isArray(r)){let n=t.groups;for(let a=0,s=n.length;a<s;a++){let s=n[a],o=r[s.materialIndex];o&&o.visible&&u.push(e,t,o,i,F.z,s)}}else r.visible&&u.push(e,t,r,i,F.z,null)}let r=e.children;for(let a=0,s=r.length;a<s;a++)Ce(r[a],t,i,n)}function Ae(e,t,i,n){let r=e.opaque,a=e.transmissive,o=e.transparent;d.setupLightsView(i),!0===R&&re.setGlobalState(m.clippingPlanes,i),a.length>0&&function(e,t,i){let n=H.isWebGL2;null===B&&(B=new LA(1,1,{generateMipmaps:!0,type:G.has("EXT_color_buffer_half_float")?NE:kE,minFilter:DE,samples:n&&!0===s?4:0})),m.getDrawingBufferSize(N),n?B.setSize(N.x,N.y):B.setSize(sA(N.x),sA(N.y));let r=m.getRenderTarget();m.setRenderTarget(B),m.clear();let a=m.toneMapping;m.toneMapping=uE,Me(e,t,i),m.toneMapping=a,Y.updateMultisampleRenderTarget(B),Y.updateRenderTargetMipmap(B),m.setRenderTarget(r)}(r,t,i),n&&W.viewport(_.copy(n)),r.length>0&&Me(r,t,i),a.length>0&&Me(a,t,i),o.length>0&&Me(o,t,i),W.buffers.depth.setTest(!0),W.buffers.depth.setMask(!0),W.buffers.color.setMask(!0),W.setPolygonOffset(!1)}function Me(e,t,i){let n=!0===t.isScene?t.overrideMaterial:null;for(let r=0,a=e.length;r<a;r++){let a=e[r],s=a.object,o=a.geometry,l=null===n?a.material:n,c=a.group;s.layers.test(i.layers)&&Te(s,t,i,o,l,c)}}function Te(e,t,i,n,r,a){e.onBeforeRender(m,t,i,n,r,a),e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),r.onBeforeRender(m,t,i,n,e,a),!0===r.transparent&&r.side===kS&&!1===r.forceSinglePass?(r.side=DS,r.needsUpdate=!0,m.renderBufferDirect(i,t,n,r,e,a),r.side=PS,r.needsUpdate=!0,m.renderBufferDirect(i,t,n,r,e,a),r.side=kS):m.renderBufferDirect(i,t,n,r,e,a),e.onAfterRender(m,t,i,n,r,a)}function Pe(e,t,i){!0!==t.isScene&&(t=j);let n=X.get(e),r=d.state.lights,a=d.state.shadowsArray,s=r.state.version,o=ee.getParameters(e,r.state,a,t,i),l=ee.getProgramCacheKey(o),c=n.programs;n.environment=e.isMeshStandardMaterial?t.environment:null,n.fog=t.fog,n.envMap=(e.isMeshStandardMaterial?Z:Q).get(e.envMap||n.environment),void 0===c&&(e.addEventListener("dispose",xe),c=new Map,n.programs=c);let h=c.get(l);if(void 0!==h){if(n.currentProgram===h&&n.lightsStateVersion===s)return De(e,o),h}else o.uniforms=ee.getUniforms(e),e.onBuild(i,o,m),e.onBeforeCompile(o,m),h=ee.acquireProgram(o,l),c.set(l,h),n.uniforms=o.uniforms;let u=n.uniforms;(!e.isShaderMaterial&&!e.isRawShaderMaterial||!0===e.clipping)&&(u.clippingPlanes=re.uniform),De(e,o),n.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),n.lightsStateVersion=s,n.needsLights&&(u.ambientLightColor.value=r.state.ambient,u.lightProbe.value=r.state.probe,u.directionalLights.value=r.state.directional,u.directionalLightShadows.value=r.state.directionalShadow,u.spotLights.value=r.state.spot,u.spotLightShadows.value=r.state.spotShadow,u.rectAreaLights.value=r.state.rectArea,u.ltc_1.value=r.state.rectAreaLTC1,u.ltc_2.value=r.state.rectAreaLTC2,u.pointLights.value=r.state.point,u.pointLightShadows.value=r.state.pointShadow,u.hemisphereLights.value=r.state.hemi,u.directionalShadowMap.value=r.state.directionalShadowMap,u.directionalShadowMatrix.value=r.state.directionalShadowMatrix,u.spotShadowMap.value=r.state.spotShadowMap,u.spotLightMatrix.value=r.state.spotLightMatrix,u.spotLightMap.value=r.state.spotLightMap,u.pointShadowMap.value=r.state.pointShadowMap,u.pointShadowMatrix.value=r.state.pointShadowMatrix);let p=h.getUniforms(),f=RD.seqWithValue(p.seq,u);return n.currentProgram=h,n.uniformsList=f,h}function De(e,t){let i=X.get(e);i.outputEncoding=t.outputEncoding,i.instancing=t.instancing,i.skinning=t.skinning,i.morphTargets=t.morphTargets,i.morphNormals=t.morphNormals,i.morphColors=t.morphColors,i.morphTargetsCount=t.morphTargetsCount,i.numClippingPlanes=t.numClippingPlanes,i.numIntersection=t.numClipIntersection,i.vertexAlphas=t.vertexAlphas,i.vertexTangents=t.vertexTangents,i.toneMapping=t.toneMapping}Ee.setAnimationLoop((function(e){we&&we(e)})),typeof self<"u"&&Ee.setContext(self),this.setAnimationLoop=function(e){we=e,ge.setAnimationLoop(e),null===e?Ee.stop():Ee.start()},ge.addEventListener("sessionstart",_e),ge.addEventListener("sessionend",Se),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===g)return;!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),!0===ge.enabled&&!0===ge.isPresenting&&(!0===ge.cameraAutoUpdate&&ge.updateCamera(t),t=ge.getCamera()),!0===e.isScene&&e.onBeforeRender(m,e,t,b),d=ne.get(e,f.length),d.init(),f.push(d),z.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),I.setFromProjectionMatrix(z),L=this.localClippingEnabled,R=re.init(this.clippingPlanes,L),u=ie.get(e,p.length),u.init(),p.push(u),Ce(e,t,0,m.sortObjects),u.finish(),!0===m.sortObjects&&u.sort(T,P),!0===R&&re.beginShadows();let i=d.state.shadowsArray;if(ae.render(i,e,t),!0===R&&re.endShadows(),!0===this.info.autoReset&&this.info.reset(),se.render(u,e),d.setupLights(m.physicallyCorrectLights),t.isArrayCamera){let i=t.cameras;for(let t=0,n=i.length;t<n;t++){let n=i[t];Ae(u,e,n,n.viewport)}}else Ae(u,e,t);null!==b&&(Y.updateMultisampleRenderTarget(b),Y.updateRenderTargetMipmap(b)),!0===e.isScene&&e.onAfterRender(m,e,t),ue.resetDefaultState(),x=-1,w=null,f.pop(),d=f.length>0?f[f.length-1]:null,p.pop(),u=p.length>0?p[p.length-1]:null},this.getActiveCubeFace=function(){return v},this.getActiveMipmapLevel=function(){return y},this.getRenderTarget=function(){return b},this.setRenderTargetTextures=function(e,t,i){X.get(e.texture).__webglTexture=t,X.get(e.depthTexture).__webglTexture=i;let n=X.get(e);n.__hasExternalTextures=!0,n.__hasExternalTextures&&(n.__autoAllocateDepthBuffer=void 0===i,n.__autoAllocateDepthBuffer||!0===G.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),n.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(e,t){let i=X.get(e);i.__webglFramebuffer=t,i.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;b=e,v=t,y=i;let n=!0,r=null,a=!1,s=!1;if(e){let i=X.get(e);void 0!==i.__useDefaultFramebuffer?(W.bindFramebuffer(36160,null),n=!1):void 0===i.__webglFramebuffer?Y.setupRenderTarget(e):i.__hasExternalTextures&&Y.rebindTextures(e,X.get(e.texture).__webglTexture,X.get(e.depthTexture).__webglTexture);let o=e.texture;(o.isData3DTexture||o.isDataArrayTexture||o.isCompressedArrayTexture)&&(s=!0);let l=X.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=l[t],a=!0):r=H.isWebGL2&&e.samples>0&&!1===Y.useMultisampledRTT(e)?X.get(e).__webglMultisampledFramebuffer:l,_.copy(e.viewport),S.copy(e.scissor),E=e.scissorTest}else _.copy(D).multiplyScalar(M).floor(),S.copy(k).multiplyScalar(M).floor(),E=O;if(W.bindFramebuffer(36160,r)&&H.drawBuffers&&n&&W.drawBuffers(e,r),W.viewport(_),W.scissor(S),W.setScissorTest(E),a){let n=X.get(e.texture);pe.framebufferTexture2D(36160,36064,34069+t,n.__webglTexture,i)}else if(s){let n=X.get(e.texture),r=t||0;pe.framebufferTextureLayer(36160,36064,n.__webglTexture,i||0,r)}x=-1},this.readRenderTargetPixels=function(e,t,i,n,r,a,s){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let o=X.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==s&&(o=o[s]),o){W.bindFramebuffer(36160,o);try{let s=e.texture,o=s.format,l=s.type;if(o!==GE&&he.convert(o)!==pe.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");let c=l===NE&&(G.has("EXT_color_buffer_half_float")||H.isWebGL2&&G.has("EXT_color_buffer_float"));if(l!==kE&&he.convert(l)!==pe.getParameter(35738)&&(l!==zE||!(H.isWebGL2||G.has("OES_texture_float")||G.has("WEBGL_color_buffer_float")))&&!c)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-n&&i>=0&&i<=e.height-r&&pe.readPixels(t,i,n,r,he.convert(o),he.convert(l),a)}finally{let e=null!==b?X.get(b).__webglFramebuffer:null;W.bindFramebuffer(36160,e)}}},this.copyFramebufferToTexture=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=Math.pow(2,-i),r=Math.floor(t.image.width*n),a=Math.floor(t.image.height*n);Y.setTexture2D(t,0),pe.copyTexSubImage2D(3553,i,0,0,e.x,e.y,r,a),W.unbindTexture()},this.copyTextureToTexture=function(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=t.image.width,a=t.image.height,s=he.convert(i.format),o=he.convert(i.type);Y.setTexture2D(i,0),pe.pixelStorei(37440,i.flipY),pe.pixelStorei(37441,i.premultiplyAlpha),pe.pixelStorei(3317,i.unpackAlignment),t.isDataTexture?pe.texSubImage2D(3553,n,e.x,e.y,r,a,s,o,t.image.data):t.isCompressedTexture?pe.compressedTexSubImage2D(3553,n,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,s,t.mipmaps[0].data):pe.texSubImage2D(3553,n,e.x,e.y,s,o,t.image),0===n&&i.generateMipmaps&&pe.generateMipmap(3553),W.unbindTexture()},this.copyTextureToTexture3D=function(e,t,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(m.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");let a,s=e.max.x-e.min.x+1,o=e.max.y-e.min.y+1,l=e.max.z-e.min.z+1,c=he.convert(n.format),h=he.convert(n.type);if(n.isData3DTexture)Y.setTexture3D(n,0),a=32879;else{if(!n.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");Y.setTexture2DArray(n,0),a=35866}pe.pixelStorei(37440,n.flipY),pe.pixelStorei(37441,n.premultiplyAlpha),pe.pixelStorei(3317,n.unpackAlignment);let u=pe.getParameter(3314),d=pe.getParameter(32878),p=pe.getParameter(3316),f=pe.getParameter(3315),g=pe.getParameter(32877),v=i.isCompressedTexture?i.mipmaps[0]:i.image;pe.pixelStorei(3314,v.width),pe.pixelStorei(32878,v.height),pe.pixelStorei(3316,e.min.x),pe.pixelStorei(3315,e.min.y),pe.pixelStorei(32877,e.min.z),i.isDataTexture||i.isData3DTexture?pe.texSubImage3D(a,r,t.x,t.y,t.z,s,o,l,c,h,v.data):i.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),pe.compressedTexSubImage3D(a,r,t.x,t.y,t.z,s,o,l,c,v.data)):pe.texSubImage3D(a,r,t.x,t.y,t.z,s,o,l,c,h,v),pe.pixelStorei(3314,u),pe.pixelStorei(32878,d),pe.pixelStorei(3316,p),pe.pixelStorei(3315,f),pe.pixelStorei(32877,g),0===r&&n.generateMipmaps&&pe.generateMipmap(a),W.unbindTexture()},this.initTexture=function(e){e.isCubeTexture?Y.setTextureCube(e,0):e.isData3DTexture?Y.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?Y.setTexture2DArray(e,0):Y.setTexture2D(e,0),W.unbindTexture()},this.resetState=function(){v=0,y=0,b=null,W.reset(),ue.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}(class extends Tk{}).prototype.isWebGL1Renderer=!0;var Pk=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3;this.isFog=!0,this.name="",this.color=new MA(e),this.near=t,this.far=i}clone(){return new Pk(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}},Dk=class extends jM{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(e){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=e}},kk=class{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=qC,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=eA()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let n=0,r=this.stride;n<r;n++)this.array[e+n]=t.array[i+n];return this}set(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=eA()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=eA()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}},Ok=new FA,Ik=class{constructor(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=n}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,i=this.data.count;t<i;t++)Ok.fromBufferAttribute(this,t),Ok.applyMatrix4(e),this.setXYZ(t,Ok.x,Ok.y,Ok.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)Ok.fromBufferAttribute(this,t),Ok.applyNormalMatrix(e),this.setXYZ(t,Ok.x,Ok.y,Ok.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)Ok.fromBufferAttribute(this,t),Ok.transformDirection(e),this.setXYZ(t,Ok.x,Ok.y,Ok.z);return this}setX(e,t){return this.normalized&&(t=lA(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=lA(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=lA(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=lA(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=oA(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=oA(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=oA(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=oA(t,this.array)),t}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=lA(t,this.array),i=lA(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=lA(t,this.array),i=lA(i,this.array),n=lA(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=n,this}setXYZW(e,t,i,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=lA(t,this.array),i=lA(i,this.array),n=lA(n,this.array),r=lA(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=n,this.data.array[e+3]=r,this}clone(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let t=0;t<this.count;t++){let i=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[i+t])}return new nT(new this.array.constructor(e),this.itemSize,this.normalized)}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Ik(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let t=0;t<this.count;t++){let i=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[i+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}},Rk=class extends jM{constructor(){super(),this.isBone=!0,this.type="Bone"}},Lk=class extends IA{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;super(null,arguments.length>5?arguments[5]:void 0,arguments.length>6?arguments[6]:void 0,arguments.length>7?arguments[7]:void 0,arguments.length>8&&void 0!==arguments[8]?arguments[8]:CE,arguments.length>9&&void 0!==arguments[9]?arguments[9]:CE,arguments.length>3?arguments[3]:void 0,arguments.length>4?arguments[4]:void 0,arguments.length>10?arguments[10]:void 0,arguments.length>11?arguments[11]:void 0),this.isDataTexture=!0,this.image={data:e,width:t,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},Bk=new mM,zk=new mM,Nk=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.uuid=eA(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){let e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new mM)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){let t=new mM;this.bones[e]&&t.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(t)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){let t=this.bones[e];t&&t.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){let t=this.bones[e];t&&(t.parent&&t.parent.isBone?(t.matrix.copy(t.parent.matrixWorld).invert(),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))}}update(){let e=this.bones,t=this.boneInverses,i=this.boneMatrices,n=this.boneTexture;for(let r=0,a=e.length;r<a;r++){let n=e[r]?e[r].matrixWorld:zk;Bk.multiplyMatrices(n,t[r]),Bk.toArray(i,16*r)}null!==n&&(n.needsUpdate=!0)}clone(){return new Nk(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(4*this.bones.length);e=aA(e),e=Math.max(e,4);let t=new Float32Array(e*e*4);t.set(this.boneMatrices);let i=new Lk(t,e,e,GE,zE);return i.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=i,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,i=this.bones.length;t<i;t++){let i=this.bones[t];if(i.name===e)return i}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let i=0,n=e.bones.length;i<n;i++){let n=e.bones[i],r=t[n];void 0===r&&(console.warn("THREE.Skeleton: No bone found with UUID:",n),r=new Rk),this.bones.push(r),this.boneInverses.push((new mM).fromArray(e.boneInverses[i]))}return this.init(),this}toJSON(){let e={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;let t=this.bones,i=this.boneInverses;for(let n=0,r=t.length;n<r;n++){let r=t[n];e.bones.push(r.uuid);let a=i[n];e.boneInverses.push(a.toArray())}return e}},Fk=class extends nT{constructor(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(e,t,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){let e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}},jk=new mM,Vk=new mM,Uk=[],Gk=new mM,Hk=new TT,Wk=class extends TT{constructor(e,t,i){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new Fk(new Float32Array(16*i),16),this.instanceColor=null,this.count=i,this.frustumCulled=!1;for(let n=0;n<i;n++)this.setMatrixAt(n,Gk)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,3*e)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,16*e)}raycast(e,t){let i=this.matrixWorld,n=this.count;if(Hk.geometry=this.geometry,Hk.material=this.material,void 0!==Hk.material)for(let r=0;r<n;r++){this.getMatrixAt(r,jk),Vk.multiplyMatrices(i,jk),Hk.matrixWorld=Vk,Hk.raycast(e,Uk);for(let e=0,i=Uk.length;e<i;e++){let i=Uk[e];i.instanceId=r,i.object=this,t.push(i)}Uk.length=0}}setColorAt(e,t){null===this.instanceColor&&(this.instanceColor=new Fk(new Float32Array(3*this.instanceMatrix.count),3)),t.toArray(this.instanceColor.array,3*e)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,16*e)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}},qk=class extends $M{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new MA(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}},Xk=new FA,Yk=new FA,Qk=new mM,Zk=new fM,Kk=new sM,Jk=class extends jM{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new fT,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new qk;super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){let e=this.geometry;if(null===e.index){let t=e.attributes.position,i=[0];for(let e=1,n=t.count;e<n;e++)Xk.fromBufferAttribute(t,e-1),Yk.fromBufferAttribute(t,e),i[e]=i[e-1],i[e]+=Xk.distanceTo(Yk);e.setAttribute("lineDistance",new sT(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){let i=this.geometry,n=this.matrixWorld,r=e.params.Line.threshold,a=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),Kk.copy(i.boundingSphere),Kk.applyMatrix4(n),Kk.radius+=r,!1===e.ray.intersectsSphere(Kk))return;Qk.copy(n).invert(),Zk.copy(e.ray).applyMatrix4(Qk);let s=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=s*s,l=new FA,c=new FA,h=new FA,u=new FA,d=this.isLineSegments?2:1,p=i.index,f=i.attributes.position;if(null!==p){for(let i=Math.max(0,a.start),n=Math.min(p.count,a.start+a.count)-1;i<n;i+=d){let n=p.getX(i),r=p.getX(i+1);if(l.fromBufferAttribute(f,n),c.fromBufferAttribute(f,r),Zk.distanceSqToSegment(l,c,u,h)>o)continue;u.applyMatrix4(this.matrixWorld);let a=e.ray.origin.distanceTo(u);a<e.near||a>e.far||t.push({distance:a,point:h.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}else{for(let i=Math.max(0,a.start),n=Math.min(f.count,a.start+a.count)-1;i<n;i+=d){if(l.fromBufferAttribute(f,i),c.fromBufferAttribute(f,i+1),Zk.distanceSqToSegment(l,c,u,h)>o)continue;u.applyMatrix4(this.matrixWorld);let n=e.ray.origin.distanceTo(u);n<e.near||n>e.far||t.push({distance:n,point:h.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=i.length;e<t;e++){let t=i[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}},$k=new FA,eO=new FA,tO=class extends Jk{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(null===e.index){let t=e.attributes.position,i=[];for(let e=0,n=t.count;e<n;e+=2)$k.fromBufferAttribute(t,e),eO.fromBufferAttribute(t,e+1),i[e]=0===e?0:i[e-1],i[e+1]=i[e]+$k.distanceTo(eO);e.setAttribute("lineDistance",new sT(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}},iO=class extends IA{constructor(e,t,i,n,r,a,s,o,l){super(e,t,i,n,r,a,s,o,l),this.isVideoTexture=!0,this.minFilter=void 0!==a?a:TE,this.magFilter=void 0!==r?r:TE,this.generateMipmaps=!1;let c=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){c.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}},nO=class extends IA{constructor(e,t,i,n,r,a,s,o,l){super(e,t,i,n,r,a,s,o,l),this.isCanvasTexture=!0,this.needsUpdate=!0}},rO=class{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){let i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){let e=this.getLengths();return e[e.length-1]}getLengths(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.arcLengthDivisions;if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let t,i=[],n=this.getPoint(0),r=0;i.push(0);for(let a=1;a<=e;a++)t=this.getPoint(a/e),r+=t.distanceTo(n),i.push(r),n=t;return this.cacheArcLengths=i,i}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){let i,n=this.getLengths(),r=0,a=n.length;i=t||e*n[a-1];let s,o=0,l=a-1;for(;o<=l;)if(r=Math.floor(o+(l-o)/2),s=n[r]-i,s<0)o=r+1;else{if(!(s>0)){l=r;break}l=r-1}if(r=l,n[r]===i)return r/(a-1);let c=n[r];return(r+(i-c)/(n[r+1]-c))/(a-1)}getTangent(e,t){let i=e-1e-4,n=e+1e-4;i<0&&(i=0),n>1&&(n=1);let r=this.getPoint(i),a=this.getPoint(n),s=t||(r.isVector2?new hA:new FA);return s.copy(a).sub(r).normalize(),s}getTangentAt(e,t){let i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){let i=new FA,n=[],r=[],a=[],s=new FA,o=new mM;for(let d=0;d<=e;d++){let t=d/e;n[d]=this.getTangentAt(t,new FA)}r[0]=new FA,a[0]=new FA;let l=Number.MAX_VALUE,c=Math.abs(n[0].x),h=Math.abs(n[0].y),u=Math.abs(n[0].z);c<=l&&(l=c,i.set(1,0,0)),h<=l&&(l=h,i.set(0,1,0)),u<=l&&i.set(0,0,1),s.crossVectors(n[0],i).normalize(),r[0].crossVectors(n[0],s),a[0].crossVectors(n[0],r[0]);for(let d=1;d<=e;d++){if(r[d]=r[d-1].clone(),a[d]=a[d-1].clone(),s.crossVectors(n[d-1],n[d]),s.length()>Number.EPSILON){s.normalize();let e=Math.acos(tA(n[d-1].dot(n[d]),-1,1));r[d].applyMatrix4(o.makeRotationAxis(s,e))}a[d].crossVectors(n[d],r[d])}if(!0===t){let t=Math.acos(tA(r[0].dot(r[e]),-1,1));t/=e,n[0].dot(s.crossVectors(r[0],r[e]))>0&&(t=-t);for(let i=1;i<=e;i++)r[i].applyMatrix4(o.makeRotationAxis(n[i],t*i)),a[i].crossVectors(n[i],r[i])}return{tangents:n,normals:r,binormals:a}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},aO=class extends rO{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI,s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0;super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=n,this.aStartAngle=r,this.aEndAngle=a,this.aClockwise=s,this.aRotation=o}getPoint(e,t){let i=t||new hA,n=2*Math.PI,r=this.aEndAngle-this.aStartAngle,a=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=n;for(;r>n;)r-=n;r<Number.EPSILON&&(r=a?0:n),!0===this.aClockwise&&!a&&(r===n?r=-n:r-=n);let s=this.aStartAngle+e*r,o=this.aX+this.xRadius*Math.cos(s),l=this.aY+this.yRadius*Math.sin(s);if(0!==this.aRotation){let e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),i=o-this.aX,n=l-this.aY;o=i*e-n*t+this.aX,l=i*t+n*e+this.aY}return i.set(o,l)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){let e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}};function sO(){let e=0,t=0,i=0,n=0;function r(r,a,s,o){e=r,t=s,i=-3*r+3*a-2*s-o,n=2*r-2*a+s+o}return{initCatmullRom:function(e,t,i,n,a){r(t,i,a*(i-e),a*(n-t))},initNonuniformCatmullRom:function(e,t,i,n,a,s,o){let l=(t-e)/a-(i-e)/(a+s)+(i-t)/s,c=(i-t)/s-(n-t)/(s+o)+(n-i)/o;l*=s,c*=s,r(t,i,l,c)},calc:function(r){let a=r*r;return e+t*r+i*a+n*(a*r)}}}var oO=new FA,lO=new sO,cO=new sO,hO=new sO;function uO(e,t,i,n,r){let a=.5*(n-t),s=.5*(r-i),o=e*e;return(2*i-2*n+a+s)*(e*o)+(-3*i+3*n-2*a-s)*o+a*e+i}function dO(e,t,i,n){return function(e,t){let i=1-e;return i*i*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,i)+function(e,t){return e*e*t}(e,n)}function pO(e,t,i,n,r){return function(e,t){let i=1-e;return i*i*i*t}(e,t)+function(e,t){let i=1-e;return 3*i*i*e*t}(e,i)+function(e,t){return 3*(1-e)*e*e*t}(e,n)+function(e,t){return e*e*e*t}(e,r)}var fO=class extends rO{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new hA,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new hA,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new hA,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new hA;super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=i,this.v3=n}getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new hA,i=this.v0,n=this.v1,r=this.v2,a=this.v3;return t.set(pO(e,i.x,n.x,r.x,a.x),pO(e,i.y,n.y,r.y,a.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}},mO=class extends rO{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new FA,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new FA,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new FA,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new FA;super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=i,this.v3=n}getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new FA,i=this.v0,n=this.v1,r=this.v2,a=this.v3;return t.set(pO(e,i.x,n.x,r.x,a.x),pO(e,i.y,n.y,r.y,a.y),pO(e,i.z,n.z,r.z,a.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}},gO=class extends rO{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new hA,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new hA;super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new hA;return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){let i=t||new hA;return i.copy(this.v2).sub(this.v1).normalize(),i}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},vO=class extends rO{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new FA,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new FA;super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new FA;return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},yO=class extends rO{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new hA,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new hA,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new hA;super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=i}getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new hA,i=this.v0,n=this.v1,r=this.v2;return t.set(dO(e,i.x,n.x,r.x),dO(e,i.y,n.y,r.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},bO=class extends rO{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new hA,i=this.points,n=(i.length-1)*e,r=Math.floor(n),a=n-r,s=i[0===r?r:r-1],o=i[r],l=i[r>i.length-2?i.length-1:r+1],c=i[r>i.length-3?i.length-1:r+2];return t.set(uO(a,s.x,o.x,l.x,c.x),uO(a,s.y,o.y,l.y,c.y)),t}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){let i=e.points[t];this.points.push(i.clone())}return this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){let i=this.points[t];e.points.push(i.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){let i=e.points[t];this.points.push((new hA).fromArray(i))}return this}},xO=Object.freeze({__proto__:null,ArcCurve:class extends aO{constructor(e,t,i,n,r,a){super(e,t,i,i,n,r,a),this.isArcCurve=!0,this.type="ArcCurve"}},CatmullRomCurve3:class extends rO{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"centripetal",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=i,this.tension=n}getPoint(e){let t,i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new FA,r=this.points,a=r.length,s=(a-(this.closed?0:1))*e,o=Math.floor(s),l=s-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/a)+1)*a:0===l&&o===a-1&&(o=a-2,l=1),this.closed||o>0?t=r[(o-1)%a]:(oO.subVectors(r[0],r[1]).add(r[0]),t=oO);let c=r[o%a],h=r[(o+1)%a];if(this.closed||o+2<a?i=r[(o+2)%a]:(oO.subVectors(r[a-1],r[a-2]).add(r[a-1]),i=oO),"centripetal"===this.curveType||"chordal"===this.curveType){let e="chordal"===this.curveType?.5:.25,n=Math.pow(t.distanceToSquared(c),e),r=Math.pow(c.distanceToSquared(h),e),a=Math.pow(h.distanceToSquared(i),e);r<1e-4&&(r=1),n<1e-4&&(n=r),a<1e-4&&(a=r),lO.initNonuniformCatmullRom(t.x,c.x,h.x,i.x,n,r,a),cO.initNonuniformCatmullRom(t.y,c.y,h.y,i.y,n,r,a),hO.initNonuniformCatmullRom(t.z,c.z,h.z,i.z,n,r,a)}else"catmullrom"===this.curveType&&(lO.initCatmullRom(t.x,c.x,h.x,i.x,this.tension),cO.initCatmullRom(t.y,c.y,h.y,i.y,this.tension),hO.initCatmullRom(t.z,c.z,h.z,i.z,this.tension));return n.set(lO.calc(l),cO.calc(l),hO.calc(l)),n}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){let i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){let i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){let i=e.points[t];this.points.push((new FA).fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}},CubicBezierCurve:fO,CubicBezierCurve3:mO,EllipseCurve:aO,LineCurve:gO,LineCurve3:vO,QuadraticBezierCurve:yO,QuadraticBezierCurve3:class extends rO{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new FA,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new FA,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new FA;super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=i}getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new FA,i=this.v0,n=this.v1,r=this.v2;return t.set(dO(e,i.x,n.x,r.x),dO(e,i.y,n.y,r.y),dO(e,i.z,n.z,r.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},SplineCurve:bO}),wO=class extends rO{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new gO(t,e))}getPoint(e,t){let i=e*this.getLength(),n=this.getCurveLengths(),r=0;for(;r<n.length;){if(n[r]>=i){let e=n[r]-i,a=this.curves[r],s=a.getLength(),o=0===s?0:1-e/s;return a.getPointAt(o,t)}r++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let i=0,n=this.curves.length;i<n;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:40,t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t}getPoints(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,i=[];for(let n=0,r=this.curves;n<r.length;n++){let a=r[n],s=a.isEllipseCurve?2*t:a.isLineCurve||a.isLineCurve3?1:a.isSplineCurve?t*a.points.length:t,o=a.getPoints(s);for(let t=0;t<o.length;t++){let n=o[t];e&&e.equals(n)||(i.push(n),e=n)}}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){let i=e.curves[t];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this}toJSON(){let e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,i=this.curves.length;t<i;t++){let i=this.curves[t];e.curves.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){let i=e.curves[t];this.curves.push((new xO[i.type]).fromJSON(i))}return this}},_O=class extends wO{constructor(e){super(),this.type="Path",this.currentPoint=new hA,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,i=e.length;t<i;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){let i=new gO(this.currentPoint.clone(),new hA(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,i,n){let r=new yO(this.currentPoint.clone(),new hA(e,t),new hA(i,n));return this.curves.push(r),this.currentPoint.set(i,n),this}bezierCurveTo(e,t,i,n,r,a){let s=new fO(this.currentPoint.clone(),new hA(e,t),new hA(i,n),new hA(r,a));return this.curves.push(s),this.currentPoint.set(r,a),this}splineThru(e){let t=[this.currentPoint.clone()].concat(e),i=new bO(t);return this.curves.push(i),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,i,n,r,a){let s=this.currentPoint.x,o=this.currentPoint.y;return this.absarc(e+s,t+o,i,n,r,a),this}absarc(e,t,i,n,r,a){return this.absellipse(e,t,i,i,n,r,a),this}ellipse(e,t,i,n,r,a,s,o){let l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(e+l,t+c,i,n,r,a,s,o),this}absellipse(e,t,i,n,r,a,s,o){let l=new aO(e,t,i,n,r,a,s,o);if(this.curves.length>0){let e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);let c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},SO=class extends fT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[new hA(0,-.5),new hA(.5,0),new hA(0,.5)],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:n},t=Math.floor(t),n=tA(n,0,2*Math.PI);let r=[],a=[],s=[],o=[],l=[],c=1/t,h=new FA,u=new hA,d=new FA,p=new FA,f=new FA,m=0,g=0;for(let v=0;v<=e.length-1;v++)switch(v){case 0:m=e[v+1].x-e[v].x,g=e[v+1].y-e[v].y,d.x=1*g,d.y=-m,d.z=0*g,f.copy(d),d.normalize(),o.push(d.x,d.y,d.z);break;case e.length-1:o.push(f.x,f.y,f.z);break;default:m=e[v+1].x-e[v].x,g=e[v+1].y-e[v].y,d.x=1*g,d.y=-m,d.z=0*g,p.copy(d),d.x+=f.x,d.y+=f.y,d.z+=f.z,d.normalize(),o.push(d.x,d.y,d.z),f.copy(p)}for(let v=0;v<=t;v++){let r=i+v*c*n,d=Math.sin(r),p=Math.cos(r);for(let i=0;i<=e.length-1;i++){h.x=e[i].x*d,h.y=e[i].y,h.z=e[i].x*p,a.push(h.x,h.y,h.z),u.x=v/t,u.y=i/(e.length-1),s.push(u.x,u.y);let n=o[3*i+0]*d,r=o[3*i+1],c=o[3*i+0]*p;l.push(n,r,c)}}for(let v=0;v<t;v++)for(let t=0;t<e.length-1;t++){let i=t+v*e.length,n=i,a=i+e.length,s=i+e.length+1,o=i+1;r.push(n,a,o),r.push(s,o,a)}this.setIndex(r),this.setAttribute("position",new sT(a,3)),this.setAttribute("uv",new sT(s,2)),this.setAttribute("normal",new sT(l,3))}static fromJSON(e){return new SO(e.points,e.segments,e.phiStart,e.phiLength)}},EO=class extends fT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:32,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:2*Math.PI;super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:n,heightSegments:r,openEnded:a,thetaStart:s,thetaLength:o};let l=this;n=Math.floor(n),r=Math.floor(r);let c=[],h=[],u=[],d=[],p=0,f=[],m=i/2,g=0;function v(i){let r=p,a=new hA,f=new FA,v=0,y=!0===i?e:t,b=!0===i?1:-1;for(let e=1;e<=n;e++)h.push(0,m*b,0),u.push(0,b,0),d.push(.5,.5),p++;let x=p;for(let e=0;e<=n;e++){let t=e/n*o+s,i=Math.cos(t),r=Math.sin(t);f.x=y*r,f.y=m*b,f.z=y*i,h.push(f.x,f.y,f.z),u.push(0,b,0),a.x=.5*i+.5,a.y=.5*r*b+.5,d.push(a.x,a.y),p++}for(let e=0;e<n;e++){let t=r+e,n=x+e;!0===i?c.push(n,n+1,t):c.push(n+1,n,t),v+=3}l.addGroup(g,v,!0===i?1:2),g+=v}(function(){let a=new FA,v=new FA,y=0,b=(t-e)/i;for(let l=0;l<=r;l++){let c=[],g=l/r,y=g*(t-e)+e;for(let e=0;e<=n;e++){let t=e/n,r=t*o+s,l=Math.sin(r),f=Math.cos(r);v.x=y*l,v.y=-g*i+m,v.z=y*f,h.push(v.x,v.y,v.z),a.set(l,b,f).normalize(),u.push(a.x,a.y,a.z),d.push(t,1-g),c.push(p++)}f.push(c)}for(let e=0;e<n;e++)for(let t=0;t<r;t++){let i=f[t][e],n=f[t+1][e],r=f[t+1][e+1],a=f[t][e+1];c.push(i,n,a),c.push(n,r,a),y+=6}l.addGroup(g,y,0),g+=y})(),!1===a&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(c),this.setAttribute("position",new sT(h,3)),this.setAttribute("normal",new sT(u,3)),this.setAttribute("uv",new sT(d,2))}static fromJSON(e){return new EO(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}},CO=class extends EO{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:32,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2*Math.PI;super(0,e,t,i,n,r,a,s),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:a,thetaLength:s}}static fromJSON(e){return new CO(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}},AO=class extends fT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:n};let r=[],a=[];function s(e,t,i,n){let r=n+1,a=[];for(let s=0;s<=r;s++){a[s]=[];let n=e.clone().lerp(i,s/r),o=t.clone().lerp(i,s/r),l=r-s;for(let e=0;e<=l;e++)a[s][e]=0===e&&s===r?n:n.clone().lerp(o,e/l)}for(let s=0;s<r;s++)for(let e=0;e<2*(r-s)-1;e++){let t=Math.floor(e/2);e%2===0?(o(a[s][t+1]),o(a[s+1][t]),o(a[s][t])):(o(a[s][t+1]),o(a[s+1][t+1]),o(a[s+1][t]))}}function o(e){r.push(e.x,e.y,e.z)}function l(t,i){let n=3*t;i.x=e[n+0],i.y=e[n+1],i.z=e[n+2]}function c(e,t,i,n){n<0&&1===e.x&&(a[t]=e.x-1),0===i.x&&0===i.z&&(a[t]=n/2/Math.PI+.5)}function h(e){return Math.atan2(e.z,-e.x)}function u(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}(function(e){let i=new FA,n=new FA,r=new FA;for(let a=0;a<t.length;a+=3)l(t[a+0],i),l(t[a+1],n),l(t[a+2],r),s(i,n,r,e)})(n),function(e){let t=new FA;for(let i=0;i<r.length;i+=3)t.x=r[i+0],t.y=r[i+1],t.z=r[i+2],t.normalize().multiplyScalar(e),r[i+0]=t.x,r[i+1]=t.y,r[i+2]=t.z}(i),function(){let e=new FA;for(let t=0;t<r.length;t+=3){e.x=r[t+0],e.y=r[t+1],e.z=r[t+2];let i=h(e)/2/Math.PI+.5,n=u(e)/Math.PI+.5;a.push(i,1-n)}(function(){let e=new FA,t=new FA,i=new FA,n=new FA,s=new hA,o=new hA,l=new hA;for(let u=0,d=0;u<r.length;u+=9,d+=6){e.set(r[u+0],r[u+1],r[u+2]),t.set(r[u+3],r[u+4],r[u+5]),i.set(r[u+6],r[u+7],r[u+8]),s.set(a[d+0],a[d+1]),o.set(a[d+2],a[d+3]),l.set(a[d+4],a[d+5]),n.copy(e).add(t).add(i).divideScalar(3);let p=h(n);c(s,d+0,e,p),c(o,d+2,t,p),c(l,d+4,i,p)}})(),function(){for(let e=0;e<a.length;e+=6){let t=a[e+0],i=a[e+2],n=a[e+4],r=Math.max(t,i,n),s=Math.min(t,i,n);r>.9&&s<.1&&(t<.2&&(a[e+0]+=1),i<.2&&(a[e+2]+=1),n<.2&&(a[e+4]+=1))}}()}(),this.setAttribute("position",new sT(r,3)),this.setAttribute("normal",new sT(r.slice(),3)),this.setAttribute("uv",new sT(a,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}static fromJSON(e){return new AO(e.vertices,e.indices,e.radius,e.details)}},MO=class extends AO{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(1+Math.sqrt(5))/2,n=1/i;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-i,0,-n,i,0,n,-i,0,n,i,-n,-i,0,-n,i,0,n,-i,0,n,i,0,-i,0,-n,i,0,-n,-i,0,n,i,0,n],[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],e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new MO(e.radius,e.detail)}},TO=class extends _O{constructor(e){super(e),this.uuid=eA(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let i=0,n=this.holes.length;i<n;i++)t[i]=this.holes[i].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){let i=e.holes[t];this.holes.push(i.clone())}return this}toJSON(){let e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,i=this.holes.length;t<i;t++){let i=this.holes[t];e.holes.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){let i=e.holes[t];this.holes.push((new _O).fromJSON(i))}return this}},PO=function(e,t){let i,n,r,a,s,o,l,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,h=t&&t.length,u=h?t[0]*c:e.length,d=DO(e,0,u,c,!0),p=[];if(!d||d.next===d.prev)return p;if(h&&(d=function(e,t,i,n){let r,a,s,o,l,c=[];for(r=0,a=t.length;r<a;r++)s=t[r]*n,o=r<a-1?t[r+1]*n:e.length,l=DO(e,s,o,n,!1),l===l.next&&(l.steiner=!0),c.push(VO(l));for(c.sort(zO),r=0;r<c.length;r++)i=NO(c[r],i);return i}(e,t,d,c)),e.length>80*c){i=r=e[0],n=a=e[1];for(let t=c;t<u;t+=c)s=e[t],o=e[t+1],s<i&&(i=s),o<n&&(n=o),s>r&&(r=s),o>a&&(a=o);l=Math.max(r-i,a-n),l=0!==l?32767/l:0}return OO(d,p,c,i,n,l,0),p};function DO(e,t,i,n,r){let a,s;if(r===function(e,t,i,n){let r=0;for(let a=t,s=i-n;a<i;a+=n)r+=(e[s]-e[a])*(e[a+1]+e[s+1]),s=a;return r}(e,t,i,n)>0)for(a=t;a<i;a+=n)s=KO(a,e[a],e[a+1],s);else for(a=i-n;a>=t;a-=n)s=KO(a,e[a],e[a+1],s);return s&&WO(s,s.next)&&(JO(s),s=s.next),s}function kO(e,t){if(!e)return e;t||(t=e);let i,n=e;do{if(i=!1,n.steiner||!WO(n,n.next)&&0!==HO(n.prev,n,n.next))n=n.next;else{if(JO(n),n=t=n.prev,n===n.next)break;i=!0}}while(i||n!==t);return t}function OO(e,t,i,n,r,a,s){if(!e)return;!s&&a&&function(e,t,i,n){let r=e;do{0===r.z&&(r.z=jO(r.x,r.y,t,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){let t,i,n,r,a,s,o,l,c=1;do{for(i=e,e=null,a=null,s=0;i;){for(s++,n=i,o=0,t=0;t<c&&(o++,n=n.nextZ,n);t++);for(l=c;o>0||l>0&&n;)0!==o&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,o--):(r=n,n=n.nextZ,l--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;i=n}a.nextZ=null,c*=2}while(s>1)}(r)}(e,n,r,a);let o,l,c=e;for(;e.prev!==e.next;)if(o=e.prev,l=e.next,a?RO(e,n,r,a):IO(e))t.push(o.i/i|0),t.push(e.i/i|0),t.push(l.i/i|0),JO(e),e=l.next,c=l.next;else if((e=l)===c){s?1===s?OO(e=LO(kO(e),t,i),t,i,n,r,a,2):2===s&&BO(e,t,i,n,r,a):OO(kO(e),t,i,n,r,a,1);break}}function IO(e){let t=e.prev,i=e,n=e.next;if(HO(t,i,n)>=0)return!1;let r=t.x,a=i.x,s=n.x,o=t.y,l=i.y,c=n.y,h=r<a?r<s?r:s:a<s?a:s,u=o<l?o<c?o:c:l<c?l:c,d=r>a?r>s?r:s:a>s?a:s,p=o>l?o>c?o:c:l>c?l:c,f=n.next;for(;f!==t;){if(f.x>=h&&f.x<=d&&f.y>=u&&f.y<=p&&UO(r,o,a,l,s,c,f.x,f.y)&&HO(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function RO(e,t,i,n){let r=e.prev,a=e,s=e.next;if(HO(r,a,s)>=0)return!1;let o=r.x,l=a.x,c=s.x,h=r.y,u=a.y,d=s.y,p=o<l?o<c?o:c:l<c?l:c,f=h<u?h<d?h:d:u<d?u:d,m=o>l?o>c?o:c:l>c?l:c,g=h>u?h>d?h:d:u>d?u:d,v=jO(p,f,t,i,n),y=jO(m,g,t,i,n),b=e.prevZ,x=e.nextZ;for(;b&&b.z>=v&&x&&x.z<=y;){if(b.x>=p&&b.x<=m&&b.y>=f&&b.y<=g&&b!==r&&b!==s&&UO(o,h,l,u,c,d,b.x,b.y)&&HO(b.prev,b,b.next)>=0||(b=b.prevZ,x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==r&&x!==s&&UO(o,h,l,u,c,d,x.x,x.y)&&HO(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;b&&b.z>=v;){if(b.x>=p&&b.x<=m&&b.y>=f&&b.y<=g&&b!==r&&b!==s&&UO(o,h,l,u,c,d,b.x,b.y)&&HO(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;x&&x.z<=y;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==r&&x!==s&&UO(o,h,l,u,c,d,x.x,x.y)&&HO(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function LO(e,t,i){let n=e;do{let r=n.prev,a=n.next.next;!WO(r,a)&&qO(r,n,n.next,a)&&QO(r,a)&&QO(a,r)&&(t.push(r.i/i|0),t.push(n.i/i|0),t.push(a.i/i|0),JO(n),JO(n.next),n=e=a),n=n.next}while(n!==e);return kO(n)}function BO(e,t,i,n,r,a){let s=e;do{let e=s.next.next;for(;e!==s.prev;){if(s.i!==e.i&&GO(s,e)){let o=ZO(s,e);return s=kO(s,s.next),o=kO(o,o.next),OO(s,t,i,n,r,a,0),void OO(o,t,i,n,r,a,0)}e=e.next}s=s.next}while(s!==e)}function zO(e,t){return e.x-t.x}function NO(e,t){let i=function(e,t){let i,n=t,r=-1/0,a=e.x,s=e.y;do{if(s<=n.y&&s>=n.next.y&&n.next.y!==n.y){let e=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=a&&e>r&&(r=e,i=n.x<n.next.x?n:n.next,e===a))return i}n=n.next}while(n!==t);if(!i)return null;let o,l=i,c=i.x,h=i.y,u=1/0;n=i;do{a>=n.x&&n.x>=c&&a!==n.x&&UO(s<h?a:r,s,c,h,s<h?r:a,s,n.x,n.y)&&(o=Math.abs(s-n.y)/(a-n.x),QO(n,e)&&(o<u||o===u&&(n.x>i.x||n.x===i.x&&FO(i,n)))&&(i=n,u=o)),n=n.next}while(n!==l);return i}(e,t);if(!i)return t;let n=ZO(i,e);return kO(n,n.next),kO(i,i.next)}function FO(e,t){return HO(e.prev,e,t.prev)<0&&HO(t.next,e,e.next)<0}function jO(e,t,i,n,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function VO(e){let t=e,i=e;do{(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next}while(t!==e);return i}function UO(e,t,i,n,r,a,s,o){return(r-s)*(t-o)>=(e-s)*(a-o)&&(e-s)*(n-o)>=(i-s)*(t-o)&&(i-s)*(a-o)>=(r-s)*(n-o)}function GO(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&qO(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(e,t)&&(QO(e,t)&&QO(t,e)&&function(e,t){let i=e,n=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do{i.y>a!=i.next.y>a&&i.next.y!==i.y&&r<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==e);return n}(e,t)&&(HO(e.prev,e,t.prev)||HO(e,t.prev,t))||WO(e,t)&&HO(e.prev,e,e.next)>0&&HO(t.prev,t,t.next)>0)}function HO(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function WO(e,t){return e.x===t.x&&e.y===t.y}function qO(e,t,i,n){let r=YO(HO(e,t,i)),a=YO(HO(e,t,n)),s=YO(HO(i,n,e)),o=YO(HO(i,n,t));return!!(r!==a&&s!==o||0===r&&XO(e,i,t)||0===a&&XO(e,n,t)||0===s&&XO(i,e,n)||0===o&&XO(i,t,n))}function XO(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function YO(e){return e>0?1:e<0?-1:0}function QO(e,t){return HO(e.prev,e,e.next)<0?HO(e,t,e.next)>=0&&HO(e,e.prev,t)>=0:HO(e,t,e.prev)<0||HO(e,e.next,t)<0}function ZO(e,t){let i=new $O(e.i,e.x,e.y),n=new $O(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,i.next=r,r.prev=i,n.next=i,i.prev=n,a.next=n,n.prev=a,n}function KO(e,t,i,n){let r=new $O(e,t,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function JO(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function $O(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}var eI=class{static area(e){let t=e.length,i=0;for(let n=t-1,r=0;r<t;n=r++)i+=e[n].x*e[r].y-e[r].x*e[n].y;return.5*i}static isClockWise(e){return eI.area(e)<0}static triangulateShape(e,t){let i=[],n=[],r=[];tI(e),iI(i,e);let a=e.length;t.forEach(tI);for(let o=0;o<t.length;o++)n.push(a),a+=t[o].length,iI(i,t[o]);let s=PO(i,n);for(let o=0;o<s.length;o+=3)r.push(s.slice(o,o+3));return r}};function tI(e){let t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function iI(e,t){for(let i=0;i<t.length;i++)e.push(t[i].x),e.push(t[i].y)}var nI=class extends AO{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(1+Math.sqrt(5))/2;super([-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new nI(e.radius,e.detail)}},rI=class extends fT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Math.PI;super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:n,phiLength:r,thetaStart:a,thetaLength:s},t=Math.max(3,Math.floor(t)),i=Math.max(2,Math.floor(i));let o=Math.min(a+s,Math.PI),l=0,c=[],h=new FA,u=new FA,d=[],p=[],f=[],m=[];for(let g=0;g<=i;g++){let d=[],v=g/i,y=0;0==g&&0==a?y=.5/t:g==i&&o==Math.PI&&(y=-.5/t);for(let i=0;i<=t;i++){let o=i/t;h.x=-e*Math.cos(n+o*r)*Math.sin(a+v*s),h.y=e*Math.cos(a+v*s),h.z=e*Math.sin(n+o*r)*Math.sin(a+v*s),p.push(h.x,h.y,h.z),u.copy(h).normalize(),f.push(u.x,u.y,u.z),m.push(o+y,1-v),d.push(l++)}c.push(d)}for(let g=0;g<i;g++)for(let e=0;e<t;e++){let t=c[g][e+1],n=c[g][e],r=c[g+1][e],s=c[g+1][e+1];(0!==g||a>0)&&d.push(t,n,s),(g!==i-1||o<Math.PI)&&d.push(n,r,s)}this.setIndex(d),this.setAttribute("position",new sT(p,3)),this.setAttribute("normal",new sT(f,3)),this.setAttribute("uv",new sT(m,2))}static fromJSON(e){return new rI(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}},aI=class extends fT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:12,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:48,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI;super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:n,arc:r},i=Math.floor(i),n=Math.floor(n);let a=[],s=[],o=[],l=[],c=new FA,h=new FA,u=new FA;for(let d=0;d<=i;d++)for(let a=0;a<=n;a++){let p=a/n*r,f=d/i*Math.PI*2;h.x=(e+t*Math.cos(f))*Math.cos(p),h.y=(e+t*Math.cos(f))*Math.sin(p),h.z=t*Math.sin(f),s.push(h.x,h.y,h.z),c.x=e*Math.cos(p),c.y=e*Math.sin(p),u.subVectors(h,c).normalize(),o.push(u.x,u.y,u.z),l.push(a/n),l.push(d/i)}for(let d=1;d<=i;d++)for(let e=1;e<=n;e++){let t=(n+1)*d+e-1,i=(n+1)*(d-1)+e-1,r=(n+1)*(d-1)+e,s=(n+1)*d+e;a.push(t,i,s),a.push(i,r,s)}this.setIndex(a),this.setAttribute("position",new sT(s,3)),this.setAttribute("normal",new sT(o,3)),this.setAttribute("uv",new sT(l,2))}static fromJSON(e){return new aI(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}},sI=class extends fT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:64,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:3;super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:n,p:r,q:a},i=Math.floor(i),n=Math.floor(n);let s=[],o=[],l=[],c=[],h=new FA,u=new FA,d=new FA,p=new FA,f=new FA,m=new FA,g=new FA;for(let y=0;y<=i;++y){let s=y/i*r*Math.PI*2;v(s,r,a,e,d),v(s+.01,r,a,e,p),m.subVectors(p,d),g.addVectors(p,d),f.crossVectors(m,g),g.crossVectors(f,m),f.normalize(),g.normalize();for(let e=0;e<=n;++e){let r=e/n*Math.PI*2,a=-t*Math.cos(r),s=t*Math.sin(r);h.x=d.x+(a*g.x+s*f.x),h.y=d.y+(a*g.y+s*f.y),h.z=d.z+(a*g.z+s*f.z),o.push(h.x,h.y,h.z),u.subVectors(h,d).normalize(),l.push(u.x,u.y,u.z),c.push(y/i),c.push(e/n)}}for(let y=1;y<=i;y++)for(let e=1;e<=n;e++){let t=(n+1)*(y-1)+(e-1),i=(n+1)*y+(e-1),r=(n+1)*y+e,a=(n+1)*(y-1)+e;s.push(t,i,a),s.push(i,r,a)}function v(e,t,i,n,r){let a=Math.cos(e),s=Math.sin(e),o=i/t*e,l=Math.cos(o);r.x=n*(2+l)*.5*a,r.y=n*(2+l)*s*.5,r.z=n*Math.sin(o)*.5}this.setIndex(s),this.setAttribute("position",new sT(o,3)),this.setAttribute("normal",new sT(l,3)),this.setAttribute("uv",new sT(c,2))}static fromJSON(e){return new sI(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}};function oI(e,t,i){return cI(e)?new e.constructor(e.subarray(t,void 0!==i?i:e.length)):e.slice(t,i)}function lI(e,t,i){return!e||!i&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)}function cI(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function hI(e){let t=e.length,i=new Array(t);for(let n=0;n!==t;++n)i[n]=n;return i.sort((function(t,i){return e[t]-e[i]})),i}function uI(e,t,i){let n=e.length,r=new e.constructor(n);for(let a=0,s=0;s!==n;++a){let n=i[a]*t;for(let i=0;i!==t;++i)r[s++]=e[n+i]}return r}function dI(e,t,i,n){let r=1,a=e[0];for(;void 0!==a&&void 0===a[n];)a=e[r++];if(void 0===a)return;let s=a[n];if(void 0!==s)if(Array.isArray(s))do{s=a[n],void 0!==s&&(t.push(a.time),i.push.apply(i,s)),a=e[r++]}while(void 0!==a);else if(void 0!==s.toArray)do{s=a[n],void 0!==s&&(t.push(a.time),s.toArray(i,i.length)),a=e[r++]}while(void 0!==a);else do{s=a[n],void 0!==s&&(t.push(a.time),i.push(s)),a=e[r++]}while(void 0!==a)}var pI=class{constructor(e,t,i,n){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,i=this._cachedIndex,n=t[i],r=t[i-1];e:{t:{let a;i:{n:if(!(e<n)){for(let a=i+2;;){if(void 0===n){if(e<r)break n;return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===a)break;if(r=n,n=t[++i],e<n)break t}a=t.length;break i}if(e>=r)break e;{let s=t[1];e<s&&(i=2,r=s);for(let a=i-2;;){if(void 0===r)return this._cachedIndex=0,this.copySampleValue_(0);if(i===a)break;if(n=r,r=t[--i-1],e>=r)break t}a=i,i=0}}for(;i<a;){let n=i+a>>>1;e<t[n]?a=n:i=n+1}if(n=t[i],r=t[i-1],void 0===r)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===n)return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,r,n)}return this.interpolate_(i,r,e,n)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,i=this.sampleValues,n=this.valueSize,r=e*n;for(let a=0;a!==n;++a)t[a]=i[r+a];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},fI=class extends pI{constructor(e,t,i,n){super(e,t,i,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:IC,endingEnd:IC}}intervalChanged_(e,t,i){let n=this.parameterPositions,r=e-2,a=e+1,s=n[r],o=n[a];if(void 0===s)switch(this.getSettings_().endingStart){case RC:r=e,s=2*t-i;break;case LC:r=n.length-2,s=t+n[r]-n[r+1];break;default:r=e,s=i}if(void 0===o)switch(this.getSettings_().endingEnd){case RC:a=e,o=2*i-t;break;case LC:a=1,o=i+n[1]-n[0];break;default:a=e-1,o=t}let l=.5*(i-t),c=this.valueSize;this._weightPrev=l/(t-s),this._weightNext=l/(o-i),this._offsetPrev=r*c,this._offsetNext=a*c}interpolate_(e,t,i,n){let r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=e*s,l=o-s,c=this._offsetPrev,h=this._offsetNext,u=this._weightPrev,d=this._weightNext,p=(i-t)/(n-t),f=p*p,m=f*p,g=-u*m+2*u*f-u*p,v=(1+u)*m+(-1.5-2*u)*f+(-.5+u)*p+1,y=(-1-d)*m+(1.5+d)*f+.5*p,b=d*m-d*f;for(let x=0;x!==s;++x)r[x]=g*a[c+x]+v*a[l+x]+y*a[o+x]+b*a[h+x];return r}},mI=class extends pI{constructor(e,t,i,n){super(e,t,i,n)}interpolate_(e,t,i,n){let r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=e*s,l=o-s,c=(i-t)/(n-t),h=1-c;for(let u=0;u!==s;++u)r[u]=a[l+u]*h+a[o+u]*c;return r}},gI=class extends pI{constructor(e,t,i,n){super(e,t,i,n)}interpolate_(e){return this.copySampleValue_(e-1)}},vI=class{constructor(e,t,i,n){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=lI(t,this.TimeBufferType),this.values=lI(i,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}static toJSON(e){let t,i=e.constructor;if(i.toJSON!==this.toJSON)t=i.toJSON(e);else{t={name:e.name,times:lI(e.times,Array),values:lI(e.values,Array)};let i=e.getInterpolation();i!==e.DefaultInterpolation&&(t.interpolation=i)}return t.type=e.ValueTypeName,t}InterpolantFactoryMethodDiscrete(e){return new gI(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new mI(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new fI(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case DC:t=this.InterpolantFactoryMethodDiscrete;break;case kC:t=this.InterpolantFactoryMethodLinear;break;case OC:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){let t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(t);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return DC;case this.InterpolantFactoryMethodLinear:return kC;case this.InterpolantFactoryMethodSmooth:return OC}}getValueSize(){return this.values.length/this.times.length}shift(e){if(0!==e){let t=this.times;for(let i=0,n=t.length;i!==n;++i)t[i]+=e}return this}scale(e){if(1!==e){let t=this.times;for(let i=0,n=t.length;i!==n;++i)t[i]*=e}return this}trim(e,t){let i=this.times,n=i.length,r=0,a=n-1;for(;r!==n&&i[r]<e;)++r;for(;-1!==a&&i[a]>t;)--a;if(++a,0!==r||a!==n){r>=a&&(a=Math.max(a,1),r=a-1);let e=this.getValueSize();this.times=oI(i,r,a),this.values=oI(this.values,r*e,a*e)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let i=this.times,n=this.values,r=i.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let s=0;s!==r;s++){let t=i[s];if("number"==typeof t&&isNaN(t)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,t),e=!1;break}if(null!==a&&a>t){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,t,a),e=!1;break}a=t}if(void 0!==n&&cI(n))for(let s=0,o=n.length;s!==o;++s){let t=n[s];if(isNaN(t)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,t),e=!1;break}}return e}optimize(){let e=oI(this.times),t=oI(this.values),i=this.getValueSize(),n=this.getInterpolation()===OC,r=e.length-1,a=1;for(let s=1;s<r;++s){let r=!1,o=e[s];if(o!==e[s+1]&&(1!==s||o!==e[0]))if(n)r=!0;else{let e=s*i,n=e-i,a=e+i;for(let s=0;s!==i;++s){let i=t[e+s];if(i!==t[n+s]||i!==t[a+s]){r=!0;break}}}if(r){if(s!==a){e[a]=e[s];let n=s*i,r=a*i;for(let e=0;e!==i;++e)t[r+e]=t[n+e]}++a}}if(r>0){e[a]=e[r];for(let e=r*i,n=a*i,s=0;s!==i;++s)t[n+s]=t[e+s];++a}return a!==e.length?(this.times=oI(e,0,a),this.values=oI(t,0,a*i)):(this.times=e,this.values=t),this}clone(){let e=oI(this.times,0),t=oI(this.values,0),i=new(0,this.constructor)(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}};vI.prototype.TimeBufferType=Float32Array,vI.prototype.ValueBufferType=Float32Array,vI.prototype.DefaultInterpolation=kC;var yI=class extends vI{};yI.prototype.ValueTypeName="bool",yI.prototype.ValueBufferType=Array,yI.prototype.DefaultInterpolation=DC,yI.prototype.InterpolantFactoryMethodLinear=void 0,yI.prototype.InterpolantFactoryMethodSmooth=void 0;var bI=class extends vI{};bI.prototype.ValueTypeName="color";var xI=class extends vI{};xI.prototype.ValueTypeName="number";var wI=class extends pI{constructor(e,t,i,n){super(e,t,i,n)}interpolate_(e,t,i,n){let r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=(i-t)/(n-t),l=e*s;for(let c=l+s;l!==c;l+=4)NA.slerpFlat(r,0,a,l-s,a,l,o);return r}},_I=class extends vI{InterpolantFactoryMethodLinear(e){return new wI(this.times,this.values,this.getValueSize(),e)}};_I.prototype.ValueTypeName="quaternion",_I.prototype.DefaultInterpolation=kC,_I.prototype.InterpolantFactoryMethodSmooth=void 0;var SI=class extends vI{};SI.prototype.ValueTypeName="string",SI.prototype.ValueBufferType=Array,SI.prototype.DefaultInterpolation=DC,SI.prototype.InterpolantFactoryMethodLinear=void 0,SI.prototype.InterpolantFactoryMethodSmooth=void 0;var EI=class extends vI{};EI.prototype.ValueTypeName="vector";var CI=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:BC;this.name=e,this.tracks=i,this.duration=t,this.blendMode=n,this.uuid=eA(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],i=e.tracks,n=1/(e.fps||1);for(let a=0,s=i.length;a!==s;++a)t.push(AI(i[a]).scale(n));let r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){let t=[],i=e.tracks,n={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,a=i.length;r!==a;++r)t.push(vI.toJSON(i[r]));return n}static CreateFromMorphTargetSequence(e,t,i,n){let r=t.length,a=[];for(let s=0;s<r;s++){let e=[],o=[];e.push((s+r-1)%r,s,(s+1)%r),o.push(0,1,0);let l=hI(e);e=uI(e,1,l),o=uI(o,1,l),!n&&0===e[0]&&(e.push(r),o.push(o[0])),a.push(new xI(".morphTargetInfluences["+t[s].name+"]",e,o).scale(1/i))}return new this(e,-1,a)}static findByName(e,t){let i=e;if(!Array.isArray(e)){let t=e;i=t.geometry&&t.geometry.animations||t.animations}for(let n=0;n<i.length;n++)if(i[n].name===t)return i[n];return null}static CreateClipsFromMorphTargetSequences(e,t,i){let n={},r=/^([\w-]*?)([\d]+)$/;for(let s=0,o=e.length;s<o;s++){let t=e[s],i=t.name.match(r);if(i&&i.length>1){let e=i[1],r=n[e];r||(n[e]=r=[]),r.push(t)}}let a=[];for(let s in n)a.push(this.CreateFromMorphTargetSequence(s,n[s],t,i));return a}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let i=function(e,t,i,n,r){if(0!==i.length){let a=[],s=[];dI(i,a,s,n),0!==a.length&&r.push(new e(t,a,s))}},n=[],r=e.name||"default",a=e.fps||30,s=e.blendMode,o=e.length||-1,l=e.hierarchy||[];for(let c=0;c<l.length;c++){let e=l[c].keys;if(e&&0!==e.length)if(e[0].morphTargets){let t,i={};for(t=0;t<e.length;t++)if(e[t].morphTargets)for(let n=0;n<e[t].morphTargets.length;n++)i[e[t].morphTargets[n]]=-1;for(let r in i){let i=[],a=[];for(let n=0;n!==e[t].morphTargets.length;++n){let n=e[t];i.push(n.time),a.push(n.morphTarget===r?1:0)}n.push(new xI(".morphTargetInfluence["+r+"]",i,a))}o=i.length*a}else{let r=".bones["+t[c].name+"]";i(EI,r+".position",e,"pos",n),i(_I,r+".quaternion",e,"rot",n),i(EI,r+".scale",e,"scl",n)}}return 0===n.length?null:new this(r,o,n,s)}resetDuration(){let e=0;for(let t=0,i=this.tracks.length;t!==i;++t){let i=this.tracks[t];e=Math.max(e,i.times[i.times.length-1])}return this.duration=e,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){let e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}};function AI(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");let t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return xI;case"vector":case"vector2":case"vector3":case"vector4":return EI;case"color":return bI;case"quaternion":return _I;case"bool":case"boolean":return yI;case"string":return SI}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){let t=[],i=[];dI(e.keys,t,i,"value"),e.times=t,e.values=i}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}var MI={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},TI=class{constructor(e,t,i){let n,r=this,a=!1,s=0,o=0,l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(e){o++,!1===a&&void 0!==r.onStart&&r.onStart(e,s,o),a=!0},this.itemEnd=function(e){s++,void 0!==r.onProgress&&r.onProgress(e,s,o),s===o&&(a=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return n?n(e):e},this.setURLModifier=function(e){return n=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){let t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,i=l.length;t<i;t+=2){let i=l[t],n=l[t+1];if(i.global&&(i.lastIndex=0),i.test(e))return n}return null}}},PI=new TI,DI=class{constructor(e){this.manager=void 0!==e?e:PI,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){let i=this;return new Promise((function(n,r){i.load(e,n,t,r)}))}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}},kI={},OI=class extends Error{constructor(e,t){super(e),this.response=t}},II=class extends DI{constructor(e){super(e)}load(e,t,i,n){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);let r=MI.get(e);if(void 0!==r)return this.manager.itemStart(e),setTimeout((()=>{t&&t(r),this.manager.itemEnd(e)}),0),r;if(void 0!==kI[e])return void kI[e].push({onLoad:t,onProgress:i,onError:n});kI[e]=[],kI[e].push({onLoad:t,onProgress:i,onError:n});let a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),s=this.mimeType,o=this.responseType;fetch(a).then((t=>{if(200===t.status||0===t.status){if(0===t.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||void 0===t.body||void 0===t.body.getReader)return t;let i=kI[e],n=t.body.getReader(),r=t.headers.get("Content-Length")||t.headers.get("X-File-Size"),a=r?parseInt(r):0,s=0!==a,o=0,l=new ReadableStream({start(e){!function t(){n.read().then((n=>{let{done:r,value:l}=n;if(r)e.close();else{o+=l.byteLength;let n=new ProgressEvent("progress",{lengthComputable:s,loaded:o,total:a});for(let e=0,t=i.length;e<t;e++){let t=i[e];t.onProgress&&t.onProgress(n)}e.enqueue(l),t()}}))}()}});return new Response(l)}throw new OI('fetch for "'.concat(t.url,'" responded with ').concat(t.status,": ").concat(t.statusText),t)})).then((e=>{switch(o){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then((e=>(new DOMParser).parseFromString(e,s)));case"json":return e.json();default:if(void 0===s)return e.text();{let t=/charset="?([^;"\s]*)"?/i.exec(s),i=t&&t[1]?t[1].toLowerCase():void 0,n=new TextDecoder(i);return e.arrayBuffer().then((e=>n.decode(e)))}}})).then((t=>{MI.add(e,t);let i=kI[e];delete kI[e];for(let e=0,n=i.length;e<n;e++){let n=i[e];n.onLoad&&n.onLoad(t)}})).catch((t=>{let i=kI[e];if(void 0===i)throw this.manager.itemError(e),t;delete kI[e];for(let e=0,n=i.length;e<n;e++){let n=i[e];n.onError&&n.onError(t)}this.manager.itemError(e)})).finally((()=>{this.manager.itemEnd(e)})),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}},RI=class extends DI{constructor(e){super(e)}load(e,t,i,n){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);let r=this,a=MI.get(e);if(void 0!==a)return r.manager.itemStart(e),setTimeout((function(){t&&t(a),r.manager.itemEnd(e)}),0),a;let s=gA("img");function o(){c(),MI.add(e,this),t&&t(this),r.manager.itemEnd(e)}function l(t){c(),n&&n(t),r.manager.itemError(e),r.manager.itemEnd(e)}function c(){s.removeEventListener("load",o,!1),s.removeEventListener("error",l,!1)}return s.addEventListener("load",o,!1),s.addEventListener("error",l,!1),"data:"!==e.slice(0,5)&&void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),r.manager.itemStart(e),s.src=e,s}},LI=class extends DI{constructor(e){super(e)}load(e,t,i,n){let r=new IA,a=new RI(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,(function(e){r.image=e,r.needsUpdate=!0,void 0!==t&&t(r)}),i,n),r}},BI=class extends jM{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;super(),this.isLight=!0,this.type="Light",this.color=new MA(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}},zI=class extends BI{constructor(e,t,i){super(e,i),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(jM.DEFAULT_UP),this.updateMatrix(),this.groundColor=new MA(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}},NI=new mM,FI=new FA,jI=new FA,VI=class{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new hA(512,512),this.map=null,this.mapPass=null,this.matrix=new mM,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new YT,this._frameExtents=new hA(1,1),this._viewportCount=1,this._viewports=[new RA(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,i=this.matrix;FI.setFromMatrixPosition(e.matrixWorld),t.position.copy(FI),jI.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(jI),t.updateMatrixWorld(),NI.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(NI),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(NI)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){let e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),(512!==this.mapSize.x||512!==this.mapSize.y)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}},UI=class extends VI{constructor(){super(new zT(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){let t=this.camera,i=2*$C*e.angle*this.focus,n=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;(i!==t.fov||n!==t.aspect||r!==t.far)&&(t.fov=i,t.aspect=n,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}},GI=class extends BI{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Math.PI/3,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2;super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(jM.DEFAULT_UP),this.updateMatrix(),this.target=new jM,this.distance=i,this.angle=n,this.penumbra=r,this.decay=a,this.map=null,this.shadow=new UI}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}},HI=new mM,WI=new FA,qI=new FA,XI=class extends VI{constructor(){super(new zT(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new hA(4,2),this._viewportCount=6,this._viewports=[new RA(2,1,1,1),new RA(0,1,1,1),new RA(3,1,1,1),new RA(1,1,1,1),new RA(3,0,1,1),new RA(1,0,1,1)],this._cubeDirections=[new FA(1,0,0),new FA(-1,0,0),new FA(0,0,1),new FA(0,0,-1),new FA(0,1,0),new FA(0,-1,0)],this._cubeUps=[new FA(0,1,0),new FA(0,1,0),new FA(0,1,0),new FA(0,1,0),new FA(0,0,1),new FA(0,0,-1)]}updateMatrices(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.camera,n=this.matrix,r=e.distance||i.far;r!==i.far&&(i.far=r,i.updateProjectionMatrix()),WI.setFromMatrixPosition(e.matrixWorld),i.position.copy(WI),qI.copy(i.position),qI.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(qI),i.updateMatrixWorld(),n.makeTranslation(-WI.x,-WI.y,-WI.z),HI.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(HI)}},YI=class extends BI{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2;super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=n,this.shadow=new XI}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}},QI=class extends VI{constructor(){super(new lP(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},ZI=class extends BI{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(jM.DEFAULT_UP),this.updateMatrix(),this.target=new jM,this.shadow=new QI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}},KI=class extends fT{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){let e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}},JI=class extends DI{constructor(e){super(e)}load(e,t,i,n){let r=this,a=new II(r.manager);a.setPath(r.path),a.setRequestHeader(r.requestHeader),a.setWithCredentials(r.withCredentials),a.load(e,(function(i){try{t(r.parse(JSON.parse(i)))}catch(g){n?n(g):console.error(g),r.manager.itemError(e)}}),i,n)}parse(e){let t={},i={};function n(e,n){if(void 0!==t[n])return t[n];let r=e.interleavedBuffers[n],a=function(e,t){if(void 0!==i[t])return i[t];let n=e.arrayBuffers[t],r=new Uint32Array(n).buffer;return i[t]=r,r}(e,r.buffer),s=mA(r.type,a),o=new kk(s,r.stride);return o.uuid=r.uuid,t[n]=o,o}let r=e.isInstancedBufferGeometry?new KI:new fT,a=e.data.index;if(void 0!==a){let e=mA(a.type,a.array);r.setIndex(new nT(e,1))}let s=e.data.attributes;for(let h in s){let t,i=s[h];if(i.isInterleavedBufferAttribute){let r=n(e.data,i.data);t=new Ik(r,i.itemSize,i.offset,i.normalized)}else{let e=mA(i.type,i.array);t=new(i.isInstancedBufferAttribute?Fk:nT)(e,i.itemSize,i.normalized)}void 0!==i.name&&(t.name=i.name),void 0!==i.usage&&t.setUsage(i.usage),void 0!==i.updateRange&&(t.updateRange.offset=i.updateRange.offset,t.updateRange.count=i.updateRange.count),r.setAttribute(h,t)}let o=e.data.morphAttributes;if(o)for(let h in o){let t=o[h],i=[];for(let r=0,a=t.length;r<a;r++){let a,s=t[r];if(s.isInterleavedBufferAttribute){let t=n(e.data,s.data);a=new Ik(t,s.itemSize,s.offset,s.normalized)}else{let e=mA(s.type,s.array);a=new nT(e,s.itemSize,s.normalized)}void 0!==s.name&&(a.name=s.name),i.push(a)}r.morphAttributes[h]=i}e.data.morphTargetsRelative&&(r.morphTargetsRelative=!0);let l=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==l)for(let h=0,u=l.length;h!==u;++h){let e=l[h];r.addGroup(e.start,e.count,e.materialIndex)}let c=e.data.boundingSphere;if(void 0!==c){let e=new FA;void 0!==c.center&&e.fromArray(c.center),r.boundingSphere=new sM(e,c.radius)}return e.name&&(r.name=e.name),e.userData&&(r.userData=e.userData),r}},$I=class{constructor(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=eR(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let t=eR();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}};function eR(){return(typeof performance>"u"?Date:performance).now()}var tR=class{constructor(e,t,i){let n,r,a;switch(this.binding=e,this.valueSize=i,t){case"quaternion":n=this._slerp,r=this._slerpAdditive,a=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*i),this._workIndex=5;break;case"string":case"bool":n=this._select,r=this._select,a=this._setAdditiveIdentityOther,this.buffer=new Array(5*i);break;default:n=this._lerp,r=this._lerpAdditive,a=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*i)}this._mixBufferRegion=n,this._mixBufferRegionAdditive=r,this._setIdentity=a,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){let i=this.buffer,n=this.valueSize,r=e*n+n,a=this.cumulativeWeight;if(0===a){for(let e=0;e!==n;++e)i[r+e]=i[e];a=t}else{a+=t;let e=t/a;this._mixBufferRegion(i,r,0,e,n)}this.cumulativeWeight=a}accumulateAdditive(e){let t=this.buffer,i=this.valueSize,n=i*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,n,0,e,i),this.cumulativeWeightAdditive+=e}apply(e){let t=this.valueSize,i=this.buffer,n=e*t+t,r=this.cumulativeWeight,a=this.cumulativeWeightAdditive,s=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,r<1){let e=t*this._origIndex;this._mixBufferRegion(i,n,e,1-r,t)}a>0&&this._mixBufferRegionAdditive(i,n,this._addIndex*t,1,t);for(let o=t,l=t+t;o!==l;++o)if(i[o]!==i[o+t]){s.setValue(i,n);break}}saveOriginalState(){let e=this.binding,t=this.buffer,i=this.valueSize,n=i*this._origIndex;e.getValue(t,n);for(let r=i,a=n;r!==a;++r)t[r]=t[n+r%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i<t;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){let e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[t+i]=this.buffer[e+i]}_select(e,t,i,n,r){if(n>=.5)for(let a=0;a!==r;++a)e[t+a]=e[i+a]}_slerp(e,t,i,n){NA.slerpFlat(e,t,e,t,e,i,n)}_slerpAdditive(e,t,i,n,r){let a=this._workIndex*r;NA.multiplyQuaternionsFlat(e,a,e,t,e,i),NA.slerpFlat(e,t,e,t,e,a,n)}_lerp(e,t,i,n,r){let a=1-n;for(let s=0;s!==r;++s){let r=t+s;e[r]=e[r]*a+e[i+s]*n}}_lerpAdditive(e,t,i,n,r){for(let a=0;a!==r;++a){let r=t+a;e[r]=e[r]+e[i+a]*n}}},iR="\\[\\]\\.:\\/",nR=new RegExp("["+iR+"]","g"),rR="[^"+iR+"]",aR="[^"+iR.replace("\\.","")+"]",sR=/((?:WC+[\/:])*)/.source.replace("WC",rR),oR=/(WCOD+)?/.source.replace("WCOD",aR),lR=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",rR),cR=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",rR),hR=new RegExp("^"+sR+oR+lR+cR+"$"),uR=["material","materials","bones","map"],dR=class{constructor(e,t,i){this.path=t,this.parsedPath=i||dR.parseTrackName(t),this.node=dR.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new dR.Composite(e,t,i):new dR(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(nR,"")}static parseTrackName(e){let t=hR.exec(e);if(null===t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},n=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){let e=i.nodeName.substring(n+1);-1!==uR.indexOf(e)&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=e)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){let i=e.skeleton.getBoneByName(t);if(void 0!==i)return i}if(e.children){let i=function(e){for(let n=0;n<e.length;n++){let r=e[n];if(r.name===t||r.uuid===t)return r;let a=i(r.children);if(a)return a}return null},n=i(e.children);if(n)return n}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){let i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)e[t++]=i[n]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){let i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=e[t++]}_setValue_array_setNeedsUpdate(e,t){let i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){let i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node,t=this.parsedPath,i=t.objectName,n=t.propertyName,r=t.propertyIndex;if(e||(e=dR.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(i){let n=t.objectIndex;switch(i){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===n){n=t;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.map)return void console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);e=e.material.map;break;default:if(void 0===e[i])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[i]}if(void 0!==n){if(void 0===e[n])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[n]}}let a=e[n];if(void 0===a){let i=t.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+i+"."+n+" but it wasn't found.",e)}let s=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?s=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(s=this.Versioning.MatrixWorldNeedsUpdate);let o=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===n){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[r]&&(r=e.morphTargetDictionary[r])}o=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=r}else void 0!==a.fromArray&&void 0!==a.toArray?(o=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(o=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=n;this.getValue=this.GetterByBindingType[o],this.setValue=this.SetterByBindingTypeAndVersioning[o][s]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};dR.Composite=class{constructor(e,t,i){let n=i||dR.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,n)}getValue(e,t){this.bind();let i=this._targetGroup.nCachedObjects_,n=this._bindings[i];void 0!==n&&n.getValue(e,t)}setValue(e,t){let i=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=i.length;n!==r;++n)i[n].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}},dR.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},dR.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},dR.prototype.GetterByBindingType=[dR.prototype._getValue_direct,dR.prototype._getValue_array,dR.prototype._getValue_arrayElement,dR.prototype._getValue_toArray],dR.prototype.SetterByBindingTypeAndVersioning=[[dR.prototype._setValue_direct,dR.prototype._setValue_direct_setNeedsUpdate,dR.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[dR.prototype._setValue_array,dR.prototype._setValue_array_setNeedsUpdate,dR.prototype._setValue_array_setMatrixWorldNeedsUpdate],[dR.prototype._setValue_arrayElement,dR.prototype._setValue_arrayElement_setNeedsUpdate,dR.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[dR.prototype._setValue_fromArray,dR.prototype._setValue_fromArray_setNeedsUpdate,dR.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var pR=class{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.blendMode;this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=n;let r=t.tracks,a=r.length,s=new Array(a),o={endingStart:IC,endingEnd:IC};for(let l=0;l!==a;++l){let e=r[l].createInterpolant(null);s[l]=e,e.settings=o}this._interpolantSettings=o,this._interpolants=s,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){let i=this._clip.duration,n=e._clip.duration,r=n/i,a=i/n;e.warp(1,r,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){let e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){let n=this._mixer,r=n.time,a=this.timeScale,s=this._timeScaleInterpolant;null===s&&(s=n._lendControlInterpolant(),this._timeScaleInterpolant=s);let o=s.parameterPositions,l=s.sampleValues;return o[0]=r,o[1]=r+i,l[0]=e/a,l[1]=t/a,this}stopWarping(){let e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,n){if(!this.enabled)return void this._updateWeight(e);let r=this._startTime;if(null!==r){let n=(e-r)*i;n<0||0===i?t=0:(this._startTime=null,t=i*n)}t*=this._updateTimeScale(e);let a=this._updateTime(t),s=this._updateWeight(e);if(s>0){let e=this._interpolants,t=this._propertyBindings;if(2501===this.blendMode)for(let i=0,n=e.length;i!==n;++i)e[i].evaluate(a),t[i].accumulateAdditive(s);else for(let i=0,r=e.length;i!==r;++i)e[i].evaluate(a),t[i].accumulate(n,s)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let i=this._weightInterpolant;if(null!==i){let n=i.evaluate(e)[0];t*=n,e>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let i=this._timeScaleInterpolant;if(null!==i){t*=i.evaluate(e)[0],e>i.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,i=this.loop,n=this.time+e,r=this._loopCount,a=i===PC;if(0===e)return-1===r?n:a&&1===(1&r)?t-n:n;if(2200===i){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(n>=t)n=t;else{if(!(n<0)){this.time=n;break e}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===r&&(e>=0?(r=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),n>=t||n<0){let i=Math.floor(n/t);n-=t*i,r+=Math.abs(i);let s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=e>0?t:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){let t=e<0;this._setEndings(t,!t,a)}else this._setEndings(!1,!1,a);this._loopCount=r,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i})}}else this.time=n;if(a&&1===(1&r))return t-n}return n}_setEndings(e,t,i){let n=this._interpolantSettings;i?(n.endingStart=RC,n.endingEnd=RC):(n.endingStart=e?this.zeroSlopeAtStart?RC:IC:LC,n.endingEnd=t?this.zeroSlopeAtEnd?RC:IC:LC)}_scheduleFading(e,t,i){let n=this._mixer,r=n.time,a=this._weightInterpolant;null===a&&(a=n._lendControlInterpolant(),this._weightInterpolant=a);let s=a.parameterPositions,o=a.sampleValues;return s[0]=r,o[0]=t,s[1]=r+e,o[1]=i,this}},fR=new Float32Array(1),mR=class extends QC{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let i=e._localRoot||this._root,n=e._clip.tracks,r=n.length,a=e._propertyBindings,s=e._interpolants,o=i.uuid,l=this._bindingsByRootAndName,c=l[o];void 0===c&&(c={},l[o]=c);for(let h=0;h!==r;++h){let e=n[h],r=e.name,l=c[r];if(void 0!==l)++l.referenceCount,a[h]=l;else{if(l=a[h],void 0!==l){null===l._cacheIndex&&(++l.referenceCount,this._addInactiveBinding(l,o,r));continue}let n=t&&t._propertyBindings[h].binding.parsedPath;l=new tR(dR.create(i,r,n),e.ValueTypeName,e.getValueSize()),++l.referenceCount,this._addInactiveBinding(l,o,r),a[h]=l}s[h].resultBuffer=l.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){let t=(e._localRoot||this._root).uuid,i=e._clip.uuid,n=this._actionsByClip[i];this._bindAction(e,n&&n.knownActions[0]),this._addInactiveAction(e,i,t)}let t=e._propertyBindings;for(let e=0,i=t.length;e!==i;++e){let i=t[e];0===i.useCount++&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let e=0,i=t.length;e!==i;++e){let i=t[e];0===--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return null!==t&&t<this._nActiveActions}_addInactiveAction(e,t,i){let n=this._actions,r=this._actionsByClip,a=r[t];if(void 0===a)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,r[t]=a;else{let t=a.knownActions;e._byClipCacheIndex=t.length,t.push(e)}e._cacheIndex=n.length,n.push(e),a.actionByRoot[i]=e}_removeInactiveAction(e){let t=this._actions,i=t[t.length-1],n=e._cacheIndex;i._cacheIndex=n,t[n]=i,t.pop(),e._cacheIndex=null;let r=e._clip.uuid,a=this._actionsByClip,s=a[r],o=s.knownActions,l=o[o.length-1],c=e._byClipCacheIndex;l._byClipCacheIndex=c,o[c]=l,o.pop(),e._byClipCacheIndex=null,delete s.actionByRoot[(e._localRoot||this._root).uuid],0===o.length&&delete a[r],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){let t=e._propertyBindings;for(let i=0,n=t.length;i!==n;++i){let e=t[i];0===--e.referenceCount&&this._removeInactiveBinding(e)}}_lendAction(e){let t=this._actions,i=e._cacheIndex,n=this._nActiveActions++,r=t[n];e._cacheIndex=n,t[n]=e,r._cacheIndex=i,t[i]=r}_takeBackAction(e){let t=this._actions,i=e._cacheIndex,n=--this._nActiveActions,r=t[n];e._cacheIndex=n,t[n]=e,r._cacheIndex=i,t[i]=r}_addInactiveBinding(e,t,i){let n=this._bindingsByRootAndName,r=this._bindings,a=n[t];void 0===a&&(a={},n[t]=a),a[i]=e,e._cacheIndex=r.length,r.push(e)}_removeInactiveBinding(e){let t=this._bindings,i=e.binding,n=i.rootNode.uuid,r=i.path,a=this._bindingsByRootAndName,s=a[n],o=t[t.length-1],l=e._cacheIndex;o._cacheIndex=l,t[l]=o,t.pop(),delete s[r],0===Object.keys(s).length&&delete a[n]}_lendBinding(e){let t=this._bindings,i=e._cacheIndex,n=this._nActiveBindings++,r=t[n];e._cacheIndex=n,t[n]=e,r._cacheIndex=i,t[i]=r}_takeBackBinding(e){let t=this._bindings,i=e._cacheIndex,n=--this._nActiveBindings,r=t[n];e._cacheIndex=n,t[n]=e,r._cacheIndex=i,t[i]=r}_lendControlInterpolant(){let e=this._controlInterpolants,t=this._nActiveControlInterpolants++,i=e[t];return void 0===i&&(i=new mI(new Float32Array(2),new Float32Array(2),1,fR),i.__cacheIndex=t,e[t]=i),i}_takeBackControlInterpolant(e){let t=this._controlInterpolants,i=e.__cacheIndex,n=--this._nActiveControlInterpolants,r=t[n];e.__cacheIndex=n,t[n]=e,r.__cacheIndex=i,t[i]=r}clipAction(e,t,i){let n=t||this._root,r=n.uuid,a="string"==typeof e?CI.findByName(n,e):e,s=null!==a?a.uuid:e,o=this._actionsByClip[s],l=null;if(void 0===i&&(i=null!==a?a.blendMode:BC),void 0!==o){let e=o.actionByRoot[r];if(void 0!==e&&e.blendMode===i)return e;l=o.knownActions[0],null===a&&(a=l._clip)}if(null===a)return null;let c=new pR(this,a,t,i);return this._bindAction(c,l),this._addInactiveAction(c,s,r),c}existingAction(e,t){let i=t||this._root,n=i.uuid,r="string"==typeof e?CI.findByName(i,e):e,a=r?r.uuid:e,s=this._actionsByClip[a];return void 0!==s&&s.actionByRoot[n]||null}stopAllAction(){let e=this._actions;for(let t=this._nActiveActions-1;t>=0;--t)e[t].stop();return this}update(e){e*=this.timeScale;let t=this._actions,i=this._nActiveActions,n=this.time+=e,r=Math.sign(e),a=this._accuIndex^=1;for(let l=0;l!==i;++l)t[l]._update(n,e,r,a);let s=this._bindings,o=this._nActiveBindings;for(let l=0;l!==o;++l)s[l].apply(a);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){let t=this._actions,i=e.uuid,n=this._actionsByClip,r=n[i];if(void 0!==r){let e=r.knownActions;for(let i=0,n=e.length;i!==n;++i){let n=e[i];this._deactivateAction(n);let r=n._cacheIndex,a=t[t.length-1];n._cacheIndex=null,n._byClipCacheIndex=null,a._cacheIndex=r,t[r]=a,t.pop(),this._removeInactiveBindingsForAction(n)}delete n[i]}}uncacheRoot(e){let t=e.uuid,i=this._actionsByClip;for(let r in i){let e=i[r].actionByRoot[t];void 0!==e&&(this._deactivateAction(e),this._removeInactiveAction(e))}let n=this._bindingsByRootAndName[t];if(void 0!==n)for(let r in n){let e=n[r];e.restoreOriginalState(),this._removeInactiveBinding(e)}}uncacheAction(e,t){let i=this.existingAction(e,t);null!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}},gR=class{constructor(e){this.value=e}clone(){return new gR(void 0===this.value.clone?this.value:this.value.clone())}},vR=class{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0;this.ray=new fM(e,t),this.near=i,this.far=n,this.camera=null,this.layers=new AM,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return bR(e,this,t,!(arguments.length>1&&void 0!==arguments[1])||arguments[1]),t.sort(yR),t}intersectObjects(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];for(let n=0,r=e.length;n<r;n++)bR(e[n],this,i,t);return i.sort(yR),i}};function yR(e,t){return e.distance-t.distance}function bR(e,t,i,n){if(e.layers.test(t.layers)&&e.raycast(t,i),!0===n){let n=e.children;for(let e=0,r=n.length;e<r;e++)bR(n[e],t,i,!0)}}var xR=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.radius=e,this.phi=t,this.theta=i,this}set(e,t,i){return this.radius=e,this.phi=t,this.theta=i,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+t*t+i*i),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,i),this.phi=Math.acos(tA(t/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}},wR=new hA,_R=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new hA(1/0,1/0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new hA(-1/0,-1/0);this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let i=wR.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return wR.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}},SR=new FA,ER=new FA,CR=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new FA,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new FA;this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){SR.subVectors(e,this.start),ER.subVectors(this.end,this.start);let i=ER.dot(ER),n=ER.dot(SR)/i;return t&&(n=tA(n,0,1)),n}closestPointToPoint(e,t,i){let n=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(n).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}},AR=new FA,MR=class extends jM{constructor(e,t){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";let i=new fT,n=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let a=0,s=1,o=32;a<o;a++,s++){let e=a/o*Math.PI*2,t=s/o*Math.PI*2;n.push(Math.cos(e),Math.sin(e),1,Math.cos(t),Math.sin(t),1)}i.setAttribute("position",new sT(n,3));let r=new qk({fog:!1,toneMapped:!1});this.cone=new tO(i,r),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1);let e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),AR.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(AR),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}},TR=class extends TT{constructor(e,t,i){super(new rI(t,4,2),new eT({wireframe:!0,fog:!1,toneMapped:!1})),this.light=e,this.color=i,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}},PR=new FA,DR=new FA,kR=new FA,OR=class extends jM{constructor(e,t,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="DirectionalLightHelper",void 0===t&&(t=1);let n=new fT;n.setAttribute("position",new sT([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));let r=new qk({fog:!1,toneMapped:!1});this.lightPlane=new Jk(n,r),this.add(this.lightPlane),n=new fT,n.setAttribute("position",new sT([0,0,0,0,0,1],3)),this.targetLine=new Jk(n,r),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),PR.setFromMatrixPosition(this.light.matrixWorld),DR.setFromMatrixPosition(this.light.target.matrixWorld),kR.subVectors(DR,PR),this.lightPlane.lookAt(DR),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(DR),this.targetLine.scale.z=kR.length()}},IR=new FA,RR=new BT,LR=class extends tO{constructor(e){let t=new fT,i=new qk({color:16777215,vertexColors:!0,toneMapped:!1}),n=[],r=[],a={};function s(e,t){o(e),o(t)}function o(e){n.push(0,0,0),r.push(0,0,0),void 0===a[e]&&(a[e]=[]),a[e].push(n.length/3-1)}s("n1","n2"),s("n2","n4"),s("n4","n3"),s("n3","n1"),s("f1","f2"),s("f2","f4"),s("f4","f3"),s("f3","f1"),s("n1","f1"),s("n2","f2"),s("n3","f3"),s("n4","f4"),s("p","n1"),s("p","n2"),s("p","n3"),s("p","n4"),s("u1","u2"),s("u2","u3"),s("u3","u1"),s("c","t"),s("p","c"),s("cn1","cn2"),s("cn3","cn4"),s("cf1","cf2"),s("cf3","cf4"),t.setAttribute("position",new sT(n,3)),t.setAttribute("color",new sT(r,3)),super(t,i),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update();let l=new MA(16755200),c=new MA(16711680),h=new MA(43775),u=new MA(16777215),d=new MA(3355443);this.setColors(l,c,h,u,d)}setColors(e,t,i,n,r){let a=this.geometry.getAttribute("color");a.setXYZ(0,e.r,e.g,e.b),a.setXYZ(1,e.r,e.g,e.b),a.setXYZ(2,e.r,e.g,e.b),a.setXYZ(3,e.r,e.g,e.b),a.setXYZ(4,e.r,e.g,e.b),a.setXYZ(5,e.r,e.g,e.b),a.setXYZ(6,e.r,e.g,e.b),a.setXYZ(7,e.r,e.g,e.b),a.setXYZ(8,e.r,e.g,e.b),a.setXYZ(9,e.r,e.g,e.b),a.setXYZ(10,e.r,e.g,e.b),a.setXYZ(11,e.r,e.g,e.b),a.setXYZ(12,e.r,e.g,e.b),a.setXYZ(13,e.r,e.g,e.b),a.setXYZ(14,e.r,e.g,e.b),a.setXYZ(15,e.r,e.g,e.b),a.setXYZ(16,e.r,e.g,e.b),a.setXYZ(17,e.r,e.g,e.b),a.setXYZ(18,e.r,e.g,e.b),a.setXYZ(19,e.r,e.g,e.b),a.setXYZ(20,e.r,e.g,e.b),a.setXYZ(21,e.r,e.g,e.b),a.setXYZ(22,e.r,e.g,e.b),a.setXYZ(23,e.r,e.g,e.b),a.setXYZ(24,t.r,t.g,t.b),a.setXYZ(25,t.r,t.g,t.b),a.setXYZ(26,t.r,t.g,t.b),a.setXYZ(27,t.r,t.g,t.b),a.setXYZ(28,t.r,t.g,t.b),a.setXYZ(29,t.r,t.g,t.b),a.setXYZ(30,t.r,t.g,t.b),a.setXYZ(31,t.r,t.g,t.b),a.setXYZ(32,i.r,i.g,i.b),a.setXYZ(33,i.r,i.g,i.b),a.setXYZ(34,i.r,i.g,i.b),a.setXYZ(35,i.r,i.g,i.b),a.setXYZ(36,i.r,i.g,i.b),a.setXYZ(37,i.r,i.g,i.b),a.setXYZ(38,n.r,n.g,n.b),a.setXYZ(39,n.r,n.g,n.b),a.setXYZ(40,r.r,r.g,r.b),a.setXYZ(41,r.r,r.g,r.b),a.setXYZ(42,r.r,r.g,r.b),a.setXYZ(43,r.r,r.g,r.b),a.setXYZ(44,r.r,r.g,r.b),a.setXYZ(45,r.r,r.g,r.b),a.setXYZ(46,r.r,r.g,r.b),a.setXYZ(47,r.r,r.g,r.b),a.setXYZ(48,r.r,r.g,r.b),a.setXYZ(49,r.r,r.g,r.b),a.needsUpdate=!0}update(){let e=this.geometry,t=this.pointMap;RR.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),BR("c",t,e,RR,0,0,-1),BR("t",t,e,RR,0,0,1),BR("n1",t,e,RR,-1,-1,-1),BR("n2",t,e,RR,1,-1,-1),BR("n3",t,e,RR,-1,1,-1),BR("n4",t,e,RR,1,1,-1),BR("f1",t,e,RR,-1,-1,1),BR("f2",t,e,RR,1,-1,1),BR("f3",t,e,RR,-1,1,1),BR("f4",t,e,RR,1,1,1),BR("u1",t,e,RR,.7,1.1,-1),BR("u2",t,e,RR,-.7,1.1,-1),BR("u3",t,e,RR,0,2,-1),BR("cf1",t,e,RR,-1,0,1),BR("cf2",t,e,RR,1,0,1),BR("cf3",t,e,RR,0,-1,1),BR("cf4",t,e,RR,0,1,1),BR("cn1",t,e,RR,-1,0,-1),BR("cn2",t,e,RR,1,0,-1),BR("cn3",t,e,RR,0,-1,-1),BR("cn4",t,e,RR,0,1,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}};function BR(e,t,i,n,r,a,s){IR.set(r,a,s).unproject(n);let o=t[e];if(void 0!==o){let e=i.getAttribute("position");for(let t=0,i=o.length;t<i;t++)e.setXYZ(o[t],IR.x,IR.y,IR.z)}}var zR=class extends tO{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16776960,i=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]),n=new fT;n.setIndex(new nT(i,1)),n.setAttribute("position",new sT([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(n,new qk({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){let t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}},NR=class extends tO{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=new fT;i.setAttribute("position",new sT(t,3)),i.setAttribute("color",new sT([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(i,new qk({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(e,t,i){let n=new MA,r=this.geometry.attributes.color.array;return n.set(e),n.toArray(r,0),n.toArray(r,3),n.set(t),n.toArray(r,6),n.toArray(r,9),n.set(i),n.toArray(r,12),n.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}},FR=function(){let e=new ArrayBuffer(4),t=new Float32Array(e),i=new Uint32Array(e),n=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){let e=l-127;e<-27?(n[l]=0,n[256|l]=32768,r[l]=24,r[256|l]=24):e<-14?(n[l]=1024>>-e-14,n[256|l]=1024>>-e-14|32768,r[l]=-e-1,r[256|l]=-e-1):e<=15?(n[l]=e+15<<10,n[256|l]=e+15<<10|32768,r[l]=13,r[256|l]=13):e<128?(n[l]=31744,n[256|l]=64512,r[l]=24,r[256|l]=24):(n[l]=31744,n[256|l]=64512,r[l]=13,r[256|l]=13)}let a=new Uint32Array(2048),s=new Uint32Array(64),o=new Uint32Array(64);for(let l=1;l<1024;++l){let e=l<<13,t=0;for(;0===(8388608&e);)e<<=1,t-=8388608;e&=-8388609,t+=947912704,a[l]=e|t}for(let l=1024;l<2048;++l)a[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)s[l]=l<<23;s[31]=1199570944,s[32]=2147483648;for(let l=33;l<63;++l)s[l]=2147483648+(l-32<<23);s[63]=3347054592;for(let l=1;l<64;++l)32!==l&&(o[l]=1024);return{floatView:t,uint32View:i,baseTable:n,shiftTable:r,mantissaTable:a,exponentTable:s,offsetTable:o}}();var jR=Object.freeze({__proto__:null,fromHalfFloat:function(e){let t=e>>10;return FR.uint32View[0]=FR.mantissaTable[FR.offsetTable[t]+(1023&e)]+FR.exponentTable[t],FR.floatView[0]},toHalfFloat:function(e){Math.abs(e)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=tA(e,-65504,65504),FR.floatView[0]=e;let t=FR.uint32View[0],i=t>>23&511;return FR.baseTable[i]+((8388607&t)>>FR.shiftTable[i])}});typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:yS}})),typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=yS);var VR=".",UR=Symbol("target"),GR=Symbol("unsubscribe");function HR(e){return e instanceof Date||e instanceof Set||e instanceof Map||e instanceof WeakSet||e instanceof WeakMap||ArrayBuffer.isView(e)}var WR=Array.isArray;function qR(e){return"symbol"==typeof e}var XR={after:(e,t)=>WR(e)?e.slice(t.length):""===t?e:e.slice(t.length+1),concat:(e,t)=>WR(e)?(e=[...e],t&&e.push(t),e):t&&void 0!==t.toString?(""!==e&&(e+=VR),qR(t)?e+t.toString():e+t):e,initial:e=>{if(WR(e))return e.slice(0,-1);if(""===e)return e;let t=e.lastIndexOf(VR);return-1===t?"":e.slice(0,t)},last:e=>{if(WR(e))return e[e.length-1]||"";if(""===e)return e;let t=e.lastIndexOf(VR);return-1===t?e:e.slice(t+1)},walk:(e,t)=>{if(WR(e))for(let i of e)t(i);else if(""!==e){let i=0,n=e.indexOf(VR);if(-1===n)t(e);else for(;i<e.length;)-1===n&&(n=e.length),t(e.slice(i,n)),i=n+1,n=e.indexOf(VR,i)}},get(e,t){return this.walk(t,(t=>{e&&(e=e[t])})),e}},YR=XR;function QR(e,t,i){return e.isUnsubscribed||t.ignoreSymbols&&qR(i)||t.ignoreUnderscores&&"_"===i.charAt(0)||"ignoreKeys"in t&&t.ignoreKeys.includes(i)}var ZR=class{constructor(e){this._equals=e,this._proxyCache=new WeakMap,this._pathCache=new WeakMap,this.isUnsubscribed=!1}_getDescriptorCache(){return void 0===this._descriptorCache&&(this._descriptorCache=new WeakMap),this._descriptorCache}_getProperties(e){let t=this._getDescriptorCache(),i=t.get(e);return void 0===i&&(i={},t.set(e,i)),i}_getOwnPropertyDescriptor(e,t){if(this.isUnsubscribed)return Reflect.getOwnPropertyDescriptor(e,t);let i=this._getProperties(e),n=i[t];return void 0===n&&(n=Reflect.getOwnPropertyDescriptor(e,t),i[t]=n),n}getProxy(e,t,i,n){if(this.isUnsubscribed)return e;let r=e[n],a=r||e;this._pathCache.set(a,t);let s=this._proxyCache.get(a);return void 0===s&&(s=void 0===r?new Proxy(e,i):e,this._proxyCache.set(a,s)),s}getPath(e){return this.isUnsubscribed?void 0:this._pathCache.get(e)}isDetached(e,t){return!Object.is(e,YR.get(t,this.getPath(e)))}defineProperty(e,t,i){return!!Reflect.defineProperty(e,t,i)&&(this.isUnsubscribed||(this._getProperties(e)[t]=i),!0)}setProperty(e,t,i,n,r){if(!this._equals(r,i)||!(t in e)){let r=this._getOwnPropertyDescriptor(e,t);return void 0!==r&&"set"in r?Reflect.set(e,t,i,n):Reflect.set(e,t,i)}return!0}deleteProperty(e,t,i){if(Reflect.deleteProperty(e,t)){if(!this.isUnsubscribed){let n=this._getDescriptorCache().get(e);n&&(delete n[t],this._pathCache.delete(i))}return!0}return!1}isSameDescriptor(e,t,i){let n=this._getOwnPropertyDescriptor(t,i);return void 0!==e&&void 0!==n&&Object.is(e.value,n.value)&&(e.writable||!1)===(n.writable||!1)&&(e.enumerable||!1)===(n.enumerable||!1)&&(e.configurable||!1)===(n.configurable||!1)&&e.get===n.get&&e.set===n.set}isGetInvariant(e,t){let i=this._getOwnPropertyDescriptor(e,t);return void 0!==i&&!0!==i.configurable&&!0!==i.writable}unsubscribe(){this._descriptorCache=null,this._pathCache=null,this._proxyCache=null,this.isUnsubscribed=!0}};function KR(e){return"[object Object]"===toString.call(e)}function JR(){return!0}function $R(e,t){return e.length!==t.length||e.some(((e,i)=>t[i]!==e))}var eL=new Set(["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),tL=new Set(["concat","includes","indexOf","join","keys","lastIndexOf"]),iL={push:JR,pop:JR,shift:JR,unshift:JR,copyWithin:$R,reverse:$R,sort:$R,splice:$R,flat:$R,fill:$R},nL=new Set([...eL,...tL,...Object.keys(iL)]);function rL(e,t){if(e.size!==t.size)return!0;for(let i of e)if(!t.has(i))return!0;return!1}var aL=["keys","values","entries"],sL=new Set(["has","toString"]),oL={add:rL,clear:rL,delete:rL,forEach:rL},lL=new Set([...sL,...Object.keys(oL),...aL]);function cL(e,t){if(e.size!==t.size)return!0;let i;for(let[n,r]of e)if(i=t.get(n),i!==r||void 0===i&&!t.has(n))return!0;return!1}var hL=new Set([...sL,"get"]),uL={set:cL,clear:cL,delete:cL,forEach:cL},dL=new Set([...hL,...Object.keys(uL),...aL]),pL=class{constructor(e,t,i,n){this._path=t,this._isChanged=!1,this._clonedCache=new Set,this._hasOnValidate=n,this._changes=n?[]:null,this.clone=void 0===t?e:this._shallowClone(e)}static isHandledMethod(e){return eL.has(e)}_shallowClone(e){let t=e;if(KR(e))t={...e};else if(WR(e))t=[...e];else if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set([...e].map((e=>this._shallowClone(e))));else if(e instanceof Map){t=new Map;for(let[i,n]of e.entries())t.set(i,this._shallowClone(n))}return this._clonedCache.add(t),t}preferredThisArg(e,t,i,n){return e?(WR(n)?this._onIsChanged=iL[t]:n instanceof Set?this._onIsChanged=oL[t]:n instanceof Map&&(this._onIsChanged=uL[t]),n):i}update(e,t,i){let n=YR.after(e,this._path);if("length"!==t){let e=this.clone;YR.walk(n,(t=>{e&&e[t]&&(this._clonedCache.has(e[t])||(e[t]=this._shallowClone(e[t])),e=e[t])})),this._hasOnValidate&&this._changes.push({path:n,property:t,previous:i}),e&&e[t]&&(e[t]=i)}this._isChanged=!0}undo(e){let t;for(let i=this._changes.length-1;-1!==i;i--)t=this._changes[i],YR.get(e,t.path)[t.property]=t.previous}isChanged(e){return void 0===this._onIsChanged?this._isChanged:this._onIsChanged(this.clone,e)}},fL=class extends pL{static isHandledMethod(e){return nL.has(e)}},mL=class extends pL{undo(e){e.setTime(this.clone.getTime())}isChanged(e,t){return!t(this.clone.valueOf(),e.valueOf())}},gL=class extends pL{static isHandledMethod(e){return lL.has(e)}undo(e){for(let t of this.clone)e.add(t);for(let t of e)this.clone.has(t)||e.delete(t)}},vL=class extends pL{static isHandledMethod(e){return dL.has(e)}undo(e){for(let[t,i]of this.clone.entries())e.set(t,i);for(let t of e.keys())this.clone.has(t)||e.delete(t)}},yL=class extends pL{constructor(e,t,i,n){super(void 0,t,i,n),this._arg1=i[0],this._weakValue=e.has(this._arg1)}isChanged(e){return this._weakValue!==e.has(this._arg1)}undo(e){this._weakValue&&!e.has(this._arg1)?e.add(this._arg1):e.delete(this._arg1)}},bL=class extends pL{constructor(e,t,i,n){super(void 0,t,i,n),this._weakKey=i[0],this._weakHas=e.has(this._weakKey),this._weakValue=e.get(this._weakKey)}isChanged(e){return this._weakValue!==e.get(this._weakKey)}undo(e){let t=e.has(this._weakKey);this._weakHas&&!t?e.set(this._weakKey,this._weakValue):!this._weakHas&&t?e.delete(this._weakKey):this._weakValue!==e.get(this._weakKey)&&e.set(this._weakKey,this._weakValue)}},xL=class{constructor(e){this._stack=[],this._hasOnValidate=e}static isHandledType(e){return KR(e)||WR(e)||HR(e)}static isHandledMethod(e,t){return KR(e)?pL.isHandledMethod(t):WR(e)?fL.isHandledMethod(t):e instanceof Set?gL.isHandledMethod(t):e instanceof Map?vL.isHandledMethod(t):HR(e)}get isCloning(){return this._stack.length>0}start(e,t,i){let n=pL;WR(e)?n=fL:e instanceof Date?n=mL:e instanceof Set?n=gL:e instanceof Map?n=vL:e instanceof WeakSet?n=yL:e instanceof WeakMap&&(n=bL),this._stack.push(new n(e,t,i,this._hasOnValidate))}update(e,t,i){this._stack[this._stack.length-1].update(e,t,i)}preferredThisArg(e,t,i){let{name:n}=e,r=xL.isHandledMethod(i,n);return this._stack[this._stack.length-1].preferredThisArg(r,n,t,i)}isChanged(e,t,i){return this._stack[this._stack.length-1].isChanged(e,t,i)}undo(e){void 0!==this._previousClone&&this._previousClone.undo(e)}stop(){return this._previousClone=this._stack.pop(),this._previousClone.clone}},wL={equals:Object.is,isShallow:!1,pathAsArray:!1,ignoreSymbols:!1,ignoreUnderscores:!1,ignoreDetached:!1,details:!1},_L=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i={...wL,...i};let n=Symbol("ProxyTarget"),{equals:r,isShallow:a,ignoreDetached:s,details:o}=i,l=new ZR(r),c="function"==typeof i.onValidate,h=new xL(c),u=(e,t,n,r,a)=>!c||h.isCloning||!0===i.onValidate(YR.concat(l.getPath(e),t),n,r,a),d=(t,n,r,a)=>{!QR(l,i,n)&&(!s||!l.isDetached(t,e))&&p(l.getPath(t),n,r,a)},p=(e,i,n,r,a)=>{h.isCloning?h.update(e,i,r):t(YR.concat(e,i),n,r,a)},f=e=>e&&(e[n]||e),m=(t,r,o,c)=>function(e){return("object"==typeof e?null===e:"function"!=typeof e)||e instanceof RegExp}(t)||"constructor"===o||a&&!xL.isHandledMethod(r,o)||QR(l,i,o)||l.isGetInvariant(r,o)||s&&l.isDetached(r,e)?t:(void 0===c&&(c=l.getPath(r)),l.getProxy(t,YR.concat(c,o),g,n)),g={get(e,t,i){if(qR(t)){if(t===n||t===UR)return e;if(t===GR&&!l.isUnsubscribed&&0===l.getPath(e).length)return l.unsubscribe(),e}let r=HR(e)?Reflect.get(e,t):Reflect.get(e,t,i);return m(r,e,t)},set(e,t,i,a){i=f(i);let s=e[n]||e,o=s[t];if(r(o,i)&&t in e)return!0;let c=u(e,t,i,o);return c&&l.setProperty(s,t,i,a,o)?(d(e,t,e[t],o),!0):!c},defineProperty(e,t,i){if(!l.isSameDescriptor(i,e,t)){let n=e[t];u(e,t,i.value,n)&&l.defineProperty(e,t,i,n)&&d(e,t,i.value,n)}return!0},deleteProperty(e,t){if(!Reflect.has(e,t))return!0;let i=Reflect.get(e,t),n=u(e,t,void 0,i);return n&&l.deleteProperty(e,t,i)?(d(e,t,void 0,i),!0):!n},apply(t,i,a){let s=i[n]||i;if(l.isUnsubscribed)return Reflect.apply(t,s,a);if((!1===o||!0!==o&&!o.includes(t.name))&&xL.isHandledType(s)){let n=YR.initial(l.getPath(t)),o=xL.isHandledMethod(s,t.name);h.start(s,n,a);let c=Reflect.apply(t,h.preferredThisArg(t,i,s),o?a.map((e=>f(e))):a),d=h.isChanged(s,r),v=h.stop();if(xL.isHandledType(c)&&o&&(i instanceof Map&&"get"===t.name&&(n=YR.concat(n,a[0])),c=l.getProxy(c,n,g)),d){let i={name:t.name,args:a,result:c},r=h.isCloning?YR.initial(n):n,o=h.isCloning?YR.last(n):"";u(YR.get(e,r),o,s,v,i)?p(r,o,s,v,i):h.undo(s)}return(i instanceof Map||i instanceof Set)&&function(e){return"object"==typeof e&&"function"==typeof e.next}(c)?function(e,t,i,n,r){let a=e.next;if("entries"===t.name)e.next=function(){let e=a.call(this);return!1===e.done&&(e.value[0]=r(e.value[0],t,e.value[0],n),e.value[1]=r(e.value[1],t,e.value[0],n)),e};else if("values"===t.name){let s=i[UR].keys();e.next=function(){let e=a.call(this);return!1===e.done&&(e.value=r(e.value,t,s.next().value,n)),e}}else e.next=function(){let e=a.call(this);return!1===e.done&&(e.value=r(e.value,t,e.value,n)),e};return e}(c,t,i,n,m):c}return Reflect.apply(t,i,a)}},v=l.getProxy(e,i.pathAsArray?[]:"",g);return t=t.bind(v),c&&(i.onValidate=i.onValidate.bind(v)),v};_L.target=e=>e&&e[UR]||e,_L.unsubscribe=e=>e[GR]||e;var SL=_L,EL="object"==typeof global&&global&&global.Object===Object&&global,CL="object"==typeof self&&self&&self.Object===Object&&self,AL=EL||CL||Function("return this")(),ML=AL.Symbol,TL=Object.prototype,PL=TL.hasOwnProperty,DL=TL.toString,kL=ML?ML.toStringTag:void 0;var OL=function(e){var t=PL.call(e,kL),i=e[kL];try{e[kL]=void 0;var n=!0}catch{}var r=DL.call(e);return n&&(t?e[kL]=i:delete e[kL]),r},IL=Object.prototype.toString;var RL=function(e){return IL.call(e)},LL=ML?ML.toStringTag:void 0;var BL=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":LL&&LL in Object(e)?OL(e):RL(e)};var zL=function(e){return null!=e&&"object"==typeof e};var NL=function(e){return"symbol"==typeof e||zL(e)&&"[object Symbol]"==BL(e)};var FL=function(e,t){for(var i=-1,n=null==e?0:e.length,r=Array(n);++i<n;)r[i]=t(e[i],i,e);return r},jL=Array.isArray,VL=ML?ML.prototype:void 0,UL=VL?VL.toString:void 0;var GL=function e(t){if("string"==typeof t)return t;if(jL(t))return FL(t,e)+"";if(NL(t))return UL?UL.call(t):"";var i=t+"";return"0"==i&&1/t==-Infinity?"-0":i},HL=/\s/;var WL=function(e){for(var t=e.length;t--&&HL.test(e.charAt(t)););return t},qL=/^\s+/;var XL=function(e){return e&&e.slice(0,WL(e)+1).replace(qL,"")};var YL=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},QL=/^[-+]0x[0-9a-f]+$/i,ZL=/^0b[01]+$/i,KL=/^0o[0-7]+$/i,JL=parseInt;var $L=function(e){if("number"==typeof e)return e;if(NL(e))return NaN;if(YL(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=YL(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=XL(e);var i=ZL.test(e);return i||KL.test(e)?JL(e.slice(2),i?2:8):QL.test(e)?NaN:+e};var eB=function(e){return e};var tB=function(e){if(!YL(e))return!1;var t=BL(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},iB=AL["__core-js_shared__"],nB=function(){var e=/[^.]+$/.exec(iB&&iB.keys&&iB.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var rB=function(e){return!!nB&&nB in e},aB=Function.prototype.toString;var sB=function(e){if(null!=e){try{return aB.call(e)}catch{}try{return e+""}catch{}}return""},oB=/^\[object .+?Constructor\]$/,lB=Function.prototype,cB=Object.prototype,hB=lB.toString,uB=cB.hasOwnProperty,dB=RegExp("^"+hB.call(uB).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var pB=function(e){return!(!YL(e)||rB(e))&&(tB(e)?dB:oB).test(sB(e))};var fB=function(e,t){return null===e||void 0===e?void 0:e[t]};var mB=function(e,t){var i=fB(e,t);return pB(i)?i:void 0},gB=mB(AL,"WeakMap"),vB=Object.create,yB=function(){function e(){}return function(t){if(!YL(t))return{};if(vB)return vB(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}(),bB=yB;var xB=function(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)};var wB=function(e,t){var i=-1,n=e.length;for(t||(t=Array(n));++i<n;)t[i]=e[i];return t},_B=Date.now;var SB=function(e){var t=0,i=0;return function(){var n=_B(),r=16-(n-i);if(i=n,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}};var EB=function(e){return function(){return e}},CB=function(){try{var e=mB(Object,"defineProperty");return e({},"",{}),e}catch{}}(),AB=CB,MB=AB?function(e,t){return AB(e,"toString",{configurable:!0,enumerable:!1,value:EB(t),writable:!0})}:eB,TB=SB(MB);var PB=function(e,t){for(var i=-1,n=null==e?0:e.length;++i<n&&!1!==t(e[i],i,e););return e},DB=/^(?:0|[1-9]\d*)$/;var kB=function(e,t){var i,n=typeof e;return!!(t=null!==(i=t)&&void 0!==i?i:9007199254740991)&&("number"==n||"symbol"!=n&&DB.test(e))&&e>-1&&e%1==0&&e<t};var OB=function(e,t,i){"__proto__"==t&&AB?AB(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i};var IB=function(e,t){return e===t||e!==e&&t!==t},RB=Object.prototype.hasOwnProperty;var LB=function(e,t,i){var n=e[t];(!RB.call(e,t)||!IB(n,i)||void 0===i&&!(t in e))&&OB(e,t,i)};var BB=function(e,t,i,n){var r=!i;i||(i={});for(var a=-1,s=t.length;++a<s;){var o=t[a],l=n?n(i[o],e[o],o,i,e):void 0;void 0===l&&(l=e[o]),r?OB(i,o,l):LB(i,o,l)}return i},zB=Math.max;var NB=function(e,t,i){return t=zB(void 0===t?e.length-1:t,0),function(){for(var n=arguments,r=-1,a=zB(n.length-t,0),s=Array(a);++r<a;)s[r]=n[t+r];r=-1;for(var o=Array(t+1);++r<t;)o[r]=n[r];return o[t]=i(s),xB(e,this,o)}};var FB=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var jB=function(e){return null!=e&&FB(e.length)&&!tB(e)},VB=Object.prototype;var UB=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||VB)};var GB=function(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n};var HB=function(e){return zL(e)&&"[object Arguments]"==BL(e)},WB=Object.prototype,qB=WB.hasOwnProperty,XB=WB.propertyIsEnumerable,YB=HB(function(){return arguments}())?HB:function(e){return zL(e)&&qB.call(e,"callee")&&!XB.call(e,"callee")},QB=YB;var ZB=function(){return!1},KB="object"==typeof exports&&exports&&!exports.nodeType&&exports,JB=KB&&"object"==typeof module&&module&&!module.nodeType&&module,$B=JB&&JB.exports===KB?AL.Buffer:void 0,ez=($B?$B.isBuffer:void 0)||ZB,tz={};tz["[object Float32Array]"]=tz["[object Float64Array]"]=tz["[object Int8Array]"]=tz["[object Int16Array]"]=tz["[object Int32Array]"]=tz["[object Uint8Array]"]=tz["[object Uint8ClampedArray]"]=tz["[object Uint16Array]"]=tz["[object Uint32Array]"]=!0,tz["[object Arguments]"]=tz["[object Array]"]=tz["[object ArrayBuffer]"]=tz["[object Boolean]"]=tz["[object DataView]"]=tz["[object Date]"]=tz["[object Error]"]=tz["[object Function]"]=tz["[object Map]"]=tz["[object Number]"]=tz["[object Object]"]=tz["[object RegExp]"]=tz["[object Set]"]=tz["[object String]"]=tz["[object WeakMap]"]=!1;var iz=function(e){return zL(e)&&FB(e.length)&&!!tz[BL(e)]};var nz=function(e){return function(t){return e(t)}},rz="object"==typeof exports&&exports&&!exports.nodeType&&exports,az=rz&&"object"==typeof module&&module&&!module.nodeType&&module,sz=az&&az.exports===rz&&EL.process,oz=function(){try{return az&&az.require&&az.require("util").types||sz&&sz.binding&&sz.binding("util")}catch{}}(),lz=oz&&oz.isTypedArray,cz=lz?nz(lz):iz,hz=Object.prototype.hasOwnProperty;var uz=function(e,t){var i=jL(e),n=!i&&QB(e),r=!i&&!n&&ez(e),a=!i&&!n&&!r&&cz(e),s=i||n||r||a,o=s?GB(e.length,String):[],l=o.length;for(var c in e)(t||hz.call(e,c))&&(!s||!("length"==c||r&&("offset"==c||"parent"==c)||a&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||kB(c,l)))&&o.push(c);return o};var dz=function(e,t){return function(i){return e(t(i))}},pz=dz(Object.keys,Object),fz=Object.prototype.hasOwnProperty;var mz=function(e){if(!UB(e))return pz(e);var t=[];for(var i in Object(e))fz.call(e,i)&&"constructor"!=i&&t.push(i);return t};var gz=function(e){return jB(e)?uz(e):mz(e)};var vz=function(e){var t=[];if(null!=e)for(var i in Object(e))t.push(i);return t},yz=Object.prototype.hasOwnProperty;var bz=function(e){if(!YL(e))return vz(e);var t=UB(e),i=[];for(var n in e)"constructor"==n&&(t||!yz.call(e,n))||i.push(n);return i};var xz=function(e){return jB(e)?uz(e,!0):bz(e)},wz=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_z=/^\w*$/;var Sz=function(e,t){if(jL(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!NL(e))||(_z.test(e)||!wz.test(e)||null!=t&&e in Object(t))},Ez=mB(Object,"create");var Cz=function(){this.__data__=Ez?Ez(null):{},this.size=0};var Az=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Mz=Object.prototype.hasOwnProperty;var Tz=function(e){var t=this.__data__;if(Ez){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return Mz.call(t,e)?t[e]:void 0},Pz=Object.prototype.hasOwnProperty;var Dz=function(e){var t=this.__data__;return Ez?void 0!==t[e]:Pz.call(t,e)};var kz=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=Ez&&void 0===t?"__lodash_hash_undefined__":t,this};function Oz(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}Oz.prototype.clear=Cz,Oz.prototype.delete=Az,Oz.prototype.get=Tz,Oz.prototype.has=Dz,Oz.prototype.set=kz;var Iz=Oz;var Rz=function(){this.__data__=[],this.size=0};var Lz=function(e,t){for(var i=e.length;i--;)if(IB(e[i][0],t))return i;return-1},Bz=Array.prototype.splice;var zz=function(e){var t=this.__data__,i=Lz(t,e);return!(i<0)&&(i==t.length-1?t.pop():Bz.call(t,i,1),--this.size,!0)};var Nz=function(e){var t=this.__data__,i=Lz(t,e);return i<0?void 0:t[i][1]};var Fz=function(e){return Lz(this.__data__,e)>-1};var jz=function(e,t){var i=this.__data__,n=Lz(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};function Vz(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}Vz.prototype.clear=Rz,Vz.prototype.delete=zz,Vz.prototype.get=Nz,Vz.prototype.has=Fz,Vz.prototype.set=jz;var Uz=Vz,Gz=mB(AL,"Map");var Hz=function(){this.size=0,this.__data__={hash:new Iz,map:new(Gz||Uz),string:new Iz}};var Wz=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var qz=function(e,t){var i=e.__data__;return Wz(t)?i["string"==typeof t?"string":"hash"]:i.map};var Xz=function(e){var t=qz(this,e).delete(e);return this.size-=t?1:0,t};var Yz=function(e){return qz(this,e).get(e)};var Qz=function(e){return qz(this,e).has(e)};var Zz=function(e,t){var i=qz(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this};function Kz(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}Kz.prototype.clear=Hz,Kz.prototype.delete=Xz,Kz.prototype.get=Yz,Kz.prototype.has=Qz,Kz.prototype.set=Zz;var Jz=Kz;function $z(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function(){var n=arguments,r=t?t.apply(this,n):n[0],a=i.cache;if(a.has(r))return a.get(r);var s=e.apply(this,n);return i.cache=a.set(r,s)||a,s};return i.cache=new($z.Cache||Jz),i}$z.Cache=Jz;var eN=$z;var tN=function(e){var t=eN(e,(function(e){return 500===i.size&&i.clear(),e})),i=t.cache;return t},iN=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nN=/\\(\\)?/g,rN=tN((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(iN,(function(e,i,n,r){t.push(n?r.replace(nN,"$1"):i||e)})),t})),aN=rN;var sN=function(e){return null==e?"":GL(e)};var oN=function(e,t){return jL(e)?e:Sz(e,t)?[e]:aN(sN(e))};var lN=function(e){if("string"==typeof e||NL(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};var cN=function(e,t){for(var i=0,n=(t=oN(t,e)).length;null!=e&&i<n;)e=e[lN(t[i++])];return i&&i==n?e:void 0};var hN=function(e,t){for(var i=-1,n=t.length,r=e.length;++i<n;)e[r+i]=t[i];return e},uN=ML?ML.isConcatSpreadable:void 0;var dN=function(e){return jL(e)||QB(e)||!!(uN&&e&&e[uN])};var pN=function e(t,i,n,r,a){var s=-1,o=t.length;for(n||(n=dN),a||(a=[]);++s<o;){var l=t[s];i>0&&n(l)?i>1?e(l,i-1,n,r,a):hN(a,l):r||(a[a.length]=l)}return a};var fN=function(e){return(null==e?0:e.length)?pN(e,1):[]};var mN=function(e){return TB(NB(e,void 0,fN),e+"")},gN=dz(Object.getPrototypeOf,Object),vN=Function.prototype,yN=Object.prototype,bN=vN.toString,xN=yN.hasOwnProperty,wN=bN.call(Object);var _N=function(e){if(!zL(e)||"[object Object]"!=BL(e))return!1;var t=gN(e);if(null===t)return!0;var i=xN.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&bN.call(i)==wN};var SN=function(e,t,i){var n=-1,r=e.length;t<0&&(t=-t>r?0:r+t),(i=i>r?r:i)<0&&(i+=r),r=t>i?0:i-t>>>0,t>>>=0;for(var a=Array(r);++n<r;)a[n]=e[n+t];return a};var EN=function(){this.__data__=new Uz,this.size=0};var CN=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i};var AN=function(e){return this.__data__.get(e)};var MN=function(e){return this.__data__.has(e)};var TN=function(e,t){var i=this.__data__;if(i instanceof Uz){var n=i.__data__;if(!Gz||n.length<199)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new Jz(n)}return i.set(e,t),this.size=i.size,this};function PN(e){var t=this.__data__=new Uz(e);this.size=t.size}PN.prototype.clear=EN,PN.prototype.delete=CN,PN.prototype.get=AN,PN.prototype.has=MN,PN.prototype.set=TN;var DN=PN;var kN=function(e,t){return e&&BB(t,gz(t),e)};var ON=function(e,t){return e&&BB(t,xz(t),e)},IN="object"==typeof exports&&exports&&!exports.nodeType&&exports,RN=IN&&"object"==typeof module&&module&&!module.nodeType&&module,LN=RN&&RN.exports===IN?AL.Buffer:void 0,BN=LN?LN.allocUnsafe:void 0;var zN=function(e,t){if(t)return e.slice();var i=e.length,n=BN?BN(i):new e.constructor(i);return e.copy(n),n};var NN=function(e,t){for(var i=-1,n=null==e?0:e.length,r=0,a=[];++i<n;){var s=e[i];t(s,i,e)&&(a[r++]=s)}return a};var FN=function(){return[]},jN=Object.prototype.propertyIsEnumerable,VN=Object.getOwnPropertySymbols,UN=VN?function(e){return null==e?[]:(e=Object(e),NN(VN(e),(function(t){return jN.call(e,t)})))}:FN,GN=UN;var HN=function(e,t){return BB(e,GN(e),t)},WN=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)hN(t,GN(e)),e=gN(e);return t}:FN,qN=WN;var XN=function(e,t){return BB(e,qN(e),t)};var YN=function(e,t,i){var n=t(e);return jL(e)?n:hN(n,i(e))};var QN=function(e){return YN(e,gz,GN)};var ZN=function(e){return YN(e,xz,qN)},KN=mB(AL,"DataView"),JN=mB(AL,"Promise"),$N=mB(AL,"Set"),eF="[object Map]",tF="[object Promise]",iF="[object Set]",nF="[object WeakMap]",rF="[object DataView]",aF=sB(KN),sF=sB(Gz),oF=sB(JN),lF=sB($N),cF=sB(gB),hF=BL;(KN&&hF(new KN(new ArrayBuffer(1)))!=rF||Gz&&hF(new Gz)!=eF||JN&&hF(JN.resolve())!=tF||$N&&hF(new $N)!=iF||gB&&hF(new gB)!=nF)&&(hF=function(e){var t=BL(e),i="[object Object]"==t?e.constructor:void 0,n=i?sB(i):"";if(n)switch(n){case aF:return rF;case sF:return eF;case oF:return tF;case lF:return iF;case cF:return nF}return t});var uF=hF,dF=Object.prototype.hasOwnProperty;var pF=function(e){var t=e.length,i=new e.constructor(t);return t&&"string"==typeof e[0]&&dF.call(e,"index")&&(i.index=e.index,i.input=e.input),i},fF=AL.Uint8Array;var mF=function(e){var t=new e.constructor(e.byteLength);return new fF(t).set(new fF(e)),t};var gF=function(e,t){var i=t?mF(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)},vF=/\w*$/;var yF=function(e){var t=new e.constructor(e.source,vF.exec(e));return t.lastIndex=e.lastIndex,t},bF=ML?ML.prototype:void 0,xF=bF?bF.valueOf:void 0;var wF=function(e){return xF?Object(xF.call(e)):{}};var _F=function(e,t){var i=t?mF(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)};var SF=function(e,t,i){var n=e.constructor;switch(t){case"[object ArrayBuffer]":return mF(e);case"[object Boolean]":case"[object Date]":return new n(+e);case"[object DataView]":return gF(e,i);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return _F(e,i);case"[object Map]":case"[object Set]":return new n;case"[object Number]":case"[object String]":return new n(e);case"[object RegExp]":return yF(e);case"[object Symbol]":return wF(e)}};var EF=function(e){return"function"!=typeof e.constructor||UB(e)?{}:bB(gN(e))};var CF=function(e){return zL(e)&&"[object Map]"==uF(e)},AF=oz&&oz.isMap,MF=AF?nz(AF):CF;var TF=function(e){return zL(e)&&"[object Set]"==uF(e)},PF=oz&&oz.isSet,DF=PF?nz(PF):TF,kF="[object Arguments]",OF="[object Function]",IF="[object Object]",RF={};RF[kF]=RF["[object Array]"]=RF["[object ArrayBuffer]"]=RF["[object DataView]"]=RF["[object Boolean]"]=RF["[object Date]"]=RF["[object Float32Array]"]=RF["[object Float64Array]"]=RF["[object Int8Array]"]=RF["[object Int16Array]"]=RF["[object Int32Array]"]=RF["[object Map]"]=RF["[object Number]"]=RF[IF]=RF["[object RegExp]"]=RF["[object Set]"]=RF["[object String]"]=RF["[object Symbol]"]=RF["[object Uint8Array]"]=RF["[object Uint8ClampedArray]"]=RF["[object Uint16Array]"]=RF["[object Uint32Array]"]=!0,RF["[object Error]"]=RF[OF]=RF["[object WeakMap]"]=!1;var LF=function e(t,i,n,r,a,s){var o,l=1&i,c=2&i,h=4&i;if(n&&(o=a?n(t,r,a,s):n(t)),void 0!==o)return o;if(!YL(t))return t;var u=jL(t);if(u){if(o=pF(t),!l)return wB(t,o)}else{var d=uF(t),p=d==OF||"[object GeneratorFunction]"==d;if(ez(t))return zN(t,l);if(d==IF||d==kF||p&&!a){if(o=c||p?{}:EF(t),!l)return c?XN(t,ON(o,t)):HN(t,kN(o,t))}else{if(!RF[d])return a?t:{};o=SF(t,d,l)}}s||(s=new DN);var f=s.get(t);if(f)return f;s.set(t,o),DF(t)?t.forEach((function(r){o.add(e(r,i,n,r,t,s))})):MF(t)&&t.forEach((function(r,a){o.set(a,e(r,i,n,a,t,s))}));var m=u?void 0:(h?c?ZN:QN:c?xz:gz)(t);return PB(m||t,(function(r,a){m&&(r=t[a=r]),LB(o,a,e(r,i,n,a,t,s))})),o};var BF=function(e){return LF(e,5)};var zF=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};var NF=function(e){return this.__data__.has(e)};function FF(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new Jz;++t<i;)this.add(e[t])}FF.prototype.add=FF.prototype.push=zF,FF.prototype.has=NF;var jF=FF;var VF=function(e,t){for(var i=-1,n=null==e?0:e.length;++i<n;)if(t(e[i],i,e))return!0;return!1};var UF=function(e,t){return e.has(t)};var GF=function(e,t,i,n,r,a){var s=1&i,o=e.length,l=t.length;if(o!=l&&!(s&&l>o))return!1;var c=a.get(e),h=a.get(t);if(c&&h)return c==t&&h==e;var u=-1,d=!0,p=2&i?new jF:void 0;for(a.set(e,t),a.set(t,e);++u<o;){var f=e[u],m=t[u];if(n)var g=s?n(m,f,u,t,e,a):n(f,m,u,e,t,a);if(void 0!==g){if(g)continue;d=!1;break}if(p){if(!VF(t,(function(e,t){if(!UF(p,t)&&(f===e||r(f,e,i,n,a)))return p.push(t)}))){d=!1;break}}else if(f!==m&&!r(f,m,i,n,a)){d=!1;break}}return a.delete(e),a.delete(t),d};var HF=function(e){var t=-1,i=Array(e.size);return e.forEach((function(e,n){i[++t]=[n,e]})),i};var WF=function(e){var t=-1,i=Array(e.size);return e.forEach((function(e){i[++t]=e})),i},qF=ML?ML.prototype:void 0,XF=qF?qF.valueOf:void 0;var YF=function(e,t,i,n,r,a,s){switch(i){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!a(new fF(e),new fF(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return IB(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var o=HF;case"[object Set]":var l=1&n;if(o||(o=WF),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;n|=2,s.set(e,t);var h=GF(o(e),o(t),n,r,a,s);return s.delete(e),h;case"[object Symbol]":if(XF)return XF.call(e)==XF.call(t)}return!1},QF=Object.prototype.hasOwnProperty;var ZF=function(e,t,i,n,r,a){var s=1&i,o=QN(e),l=o.length;if(l!=QN(t).length&&!s)return!1;for(var c=l;c--;){var h=o[c];if(!(s?h in t:QF.call(t,h)))return!1}var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var p=!0;a.set(e,t),a.set(t,e);for(var f=s;++c<l;){var m=e[h=o[c]],g=t[h];if(n)var v=s?n(g,m,h,t,e,a):n(m,g,h,e,t,a);if(!(void 0===v?m===g||r(m,g,i,n,a):v)){p=!1;break}f||(f="constructor"==h)}if(p&&!f){var y=e.constructor,b=t.constructor;y!=b&&"constructor"in e&&"constructor"in t&&!("function"==typeof y&&y instanceof y&&"function"==typeof b&&b instanceof b)&&(p=!1)}return a.delete(e),a.delete(t),p},KF="[object Arguments]",JF="[object Array]",$F="[object Object]",ej=Object.prototype.hasOwnProperty;var tj=function(e,t,i,n,r,a){var s=jL(e),o=jL(t),l=s?JF:uF(e),c=o?JF:uF(t),h=(l=l==KF?$F:l)==$F,u=(c=c==KF?$F:c)==$F,d=l==c;if(d&&ez(e)){if(!ez(t))return!1;s=!0,h=!1}if(d&&!h)return a||(a=new DN),s||cz(e)?GF(e,t,i,n,r,a):YF(e,t,l,i,n,r,a);if(!(1&i)){var p=h&&ej.call(e,"__wrapped__"),f=u&&ej.call(t,"__wrapped__");if(p||f){var m=p?e.value():e,g=f?t.value():t;return a||(a=new DN),r(m,g,i,n,a)}}return!!d&&(a||(a=new DN),ZF(e,t,i,n,r,a))};var ij=function e(t,i,n,r,a){return t===i||(null==t||null==i||!zL(t)&&!zL(i)?t!==t&&i!==i:tj(t,i,n,r,e,a))};var nj=function(e,t){return null!=e&&t in Object(e)};var rj=function(e,t,i){for(var n=-1,r=(t=oN(t,e)).length,a=!1;++n<r;){var s=lN(t[n]);if(!(a=null!=e&&i(e,s)))break;e=e[s]}return a||++n!=r?a:!!(r=null==e?0:e.length)&&FB(r)&&kB(s,r)&&(jL(e)||QB(e))};var aj=function(e,t){return null!=e&&rj(e,t,nj)},sj=function(){return AL.Date.now()},oj=Math.max,lj=Math.min;var cj=function(e,t,i){var n,r,a,s,o,l,c=0,h=!1,u=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var i=n,a=r;return n=r=void 0,c=t,s=e.apply(a,i)}function f(e){var i=e-l;return void 0===l||i>=t||i<0||u&&e-c>=a}function m(){var e=sj();if(f(e))return g(e);o=setTimeout(m,function(e){var i=t-(e-l);return u?lj(i,a-(e-c)):i}(e))}function g(e){return o=void 0,d&&n?p(e):(n=r=void 0,s)}function v(){var e=sj(),i=f(e);if(n=arguments,r=this,l=e,i){if(void 0===o)return function(e){return c=e,o=setTimeout(m,t),h?p(e):s}(l);if(u)return clearTimeout(o),o=setTimeout(m,t),p(l)}return void 0===o&&(o=setTimeout(m,t)),s}return t=$L(t)||0,YL(i)&&(h=!!i.leading,a=(u="maxWait"in i)?oj($L(i.maxWait)||0,t):a,d="trailing"in i?!!i.trailing:d),v.cancel=function(){void 0!==o&&clearTimeout(o),c=0,n=l=r=o=void 0},v.flush=function(){return void 0===o?s:g(sj())},v};var hj=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};var uj=function(e,t){return t.length<2?e:cN(e,SN(t,0,-1))};var dj=function(e,t){return ij(e,t)};var pj=function(e,t){return t=oN(t,e),null==(e=uj(e,t))||delete e[lN(hj(t))]};var fj=function(e){return _N(e)?void 0:e},mj=mN((function(e,t){var i={};if(null==e)return i;var n=!1;t=FL(t,(function(t){return t=oN(t,e),n||(n=t.length>1),t})),BB(e,ZN(e),i),n&&(i=LF(i,7,fj));for(var r=t.length;r--;)pj(i,t[r]);return i})),gj=mj;var vj=function(e,t,i,n){if(!YL(e))return e;for(var r=-1,a=(t=oN(t,e)).length,s=a-1,o=e;null!=o&&++r<a;){var l=lN(t[r]),c=i;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(r!=s){var h=o[l];void 0===(c=n?n(h,l,o):void 0)&&(c=YL(h)?h:kB(t[r+1])?[]:{})}LB(o,l,c),o=o[l]}return e};var yj=function(e,t,i){for(var n=-1,r=t.length,a={};++n<r;){var s=t[n],o=cN(e,s);i(o,s)&&vj(a,oN(s,e),o)}return a};var bj=function(e,t){return yj(e,t,(function(t,i){return aj(e,i)}))},xj=mN((function(e,t){return null==e?{}:bj(e,t)})),wj=xj;var _j=function(e,t,i){var n=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return YL(i)&&(n="leading"in i?!!i.leading:n,r="trailing"in i?!!i.trailing:r),cj(e,t,{leading:n,maxWait:t,trailing:r})};function Sj(e){for(let t of Object.keys(e))void 0===e[t]&&delete e[t];return e}function Ej(e,t){return Object.setPrototypeOf(e,t),e}!(typeof window>"u")&&window.navigator.userAgent.toLowerCase().includes(" electron/")&&(()=>{var e;if(typeof window>"u")return;let t=new URLSearchParams(window.location.search).get("desktop-app-version");t?window.localStorage.setItem("desktop-app-version",t):e=window.localStorage.getItem("desktop-app-version")})();var Cj=!(typeof window>"u")&&window.navigator.platform.toUpperCase().includes("MAC"),Aj=!(typeof window>"u")&&(/iPad|iPhone|iPod/.test(window.navigator.userAgent)||Cj&&"ontouchend"in document),Mj=!(typeof window>"u")&&window.navigator.userAgent.toLowerCase().indexOf("firefox")>-1,Tj=!(typeof window>"u")&&("ontouchstart"in window||navigator.maxTouchPoints>0),Pj=(()=>{if(typeof window>"u")return!1;let e=navigator.userAgent,t=navigator.vendor;return/Safari/i.test(e)&&/Apple Computer/.test(t)})(),Dj=Number((()=>{if(typeof window>"u")return null;let e=navigator.userAgent.match(/Version\/(\d+\.\d)/);return e&&e[1]})());function kj(e){return Array.isArray(e)?e:[e]}function Oj(e,t){let i=0;for(;i<e.length&&i<t.length;){if(e[i]<t[i])return-1;if(e[i]>t[i])return 1;i+=1}return i!==t.length?-1:i!==e.length?1:0}function Ij(e){return Cj?e.metaKey:e.ctrlKey}var Rj=[],Lj={},Bj={},zj={};function Nj(e){Rj.includes(e)||Rj.push(e)}function Fj(e){delete Lj[e.pointerId];for(let t=0;t<Rj.length;t++)if(Rj[t].pointerId===e.pointerId){Rj.splice(t,1);break}}function jj(e){if("touch"!==e.pointerType)return;let t=Lj[e.pointerId];void 0===t&&(t={x:0,y:0},Lj[e.pointerId]=t),t.x=e.pageX,t.y=e.pageY}function Vj(e){let t=e.pointerId===Rj[0].pointerId?Rj[1]:Rj[0];return Lj[t.pointerId]}function Uj(e){Bj[e.key]=!0,zj[e.key]=void 0===zj[e.key]?1:zj[e.key]+1}function Gj(e){if(Cj&&Bj.Meta)for(let t in Bj)Bj[t]=!1;else Bj[e.key]=!1;zj={}}var Hj,Wj,qj=new Promise((e=>{Hj=e}));function Xj(){if(Wj)return Wj;return Wj=async function(){let e=__webpack_require__.e(208).then(__webpack_require__.bind(__webpack_require__,208)),[t,i]=await Promise.all([e,fetch("".concat("https://unpkg.com/@splinetool/navmesh-wasm@1.0.53/build","/navmesh.wasm")).then((e=>e.arrayBuffer()))]),n=t.default,r=await n({wasmBinary:i});Hj(r)}(),Wj}var Yj,Qj,Zj=new Promise((e=>{Yj=e}));function Kj(){if(Qj)return Qj;return Qj=async function(){let e=await __webpack_require__.e(293).then(__webpack_require__.bind(__webpack_require__,293));await e.init(),Yj(e)}(),Qj}var Jj=class{modifyById(e,t){let i=this;if(void 0===i[e])throw new Error("not expected");{let n={...i,[e]:t};return Object.setPrototypeOf(n,Jj.prototype),n}}add(e,t){var i,n;return null!==(i=null===(n=this.runOp({type:1,id:e,data:t}))||void 0===n?void 0:n.data)&&void 0!==i?i:this}runOp(e){let t=this;if(1===e.type){let i,n=t[e.id];i=void 0===n?{type:2,id:e.id}:{type:1,id:e.id,data:n};let{id:r,data:a}=e,s={...t,[r]:a};return Object.setPrototypeOf(s,Jj.prototype),{data:s,actual:e,reverse:i}}if(2===e.type){let{id:i}=e,n=t[i];if(void 0===n)return null;{let r={...t};return Object.setPrototypeOf(r,Jj.prototype),delete r[i],{data:r,actual:e,reverse:{type:1,id:i,data:n}}}}return null}};function $j(e){if(void 0!==e.deepFreeze)return void e.deepFreeze(e);let t=Object.getOwnPropertyNames(e);for(let i of t){let t=e[i];t&&"object"==typeof t&&$j(t)}return Object.freeze(e)}var eV=class extends Error{};function tV(e){let t={...e};return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),t}function iV(e,t,i){if(void 0===e?void 0===t?(e=0,t=10):e=t-10:void 0===t&&(t=e+10),e>t){let i=e;e=t,t=i}let n=[],r=1/(i+1);for(let a=0;a<i;a++){let i=e+(t-e)*(a+.75+.5*Math.random())*r;n.push(i)}return n}function nV(e){return e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Float32Array||e instanceof Float64Array}function rV(e,t){for(let i of e)!0!==t(i.id,i.data)&&rV(i.children,t)}function aV(e,t){if(!0!==t(e.id,e.data))for(let i of e.children)aV(i,t)}var sV,oV=class extends Array{constructor(){super(...arguments),Object.setPrototypeOf(this,oV.prototype)}deepFreeze(){let e=0;for(;e<this.length;)$j(this[e]),e++}fillCaches0(e,t){this.objCaches.set(e.id,e),this.parentCaches.set(e.id,t);for(let i of e.children)this.fillCaches0(i,e.id)}fillCaches(){if(void 0===this.objCaches){this.objCaches=new Map,this.parentCaches=new Map;for(let e of this)this.fillCaches0(e,null)}}randomId(){this.fillCaches();let e=Array.from(this.objCaches.keys());if(0!==e.length)return e[Math.max(0,Math.floor(Math.random()*e.length)-1)]}nonExistOrDescendantOf(e,t){if(!this.has(e))return!0;for(;e;){let i=this.parent(e);if(i===t)return!0;e=i}return!1}rootAcestor(e){for(;e;){let t=this.parent(e);if(!t)return e;e=t}return e}isDescendantOf(e,t){for(;e;){let i=this.parent(e);if(i===t)return!0;e=i}return!1}data(e){var t;return null===(t=this.get(e))||void 0===t?void 0:t.data}has(e){return void 0!==this.childrenOf(e)}get(e){return this.fillCaches(),this.objCaches.get(e)}childrenOf(e){var t;return null===e?this:null===(t=this.get(e))||void 0===t?void 0:t.children}traverseFrom(e,t){if(null===e)this.traverse(t);else{let i=this.get(e);i&&aV(i,t)}}traverse(e){rV(this,e)}totalSize(){return this.fillCaches(),this.objCaches.size}parent(e){return this.fillCaches(),this.parentCaches.get(e)}childrenArray(e){return null===e?this:this.get(e).children}modifyById(e,t){if(void 0===this.get(e))throw new Error("not expected");{let i=this.parent(e),n=this.childrenArray(i),r=n.findIndex((t=>t.id===e));if(r<0)throw new Error("not expected");let a=n[r];return n=[...n],n[r]={...a,data:t},this.modifyArrayBy(i,n)}}modifyArrayBy(e,t){let i=e,n=t;for(;null!==i;){let e=n,t=i;if(i=this.parent(i),void 0===i)throw new Error;n=this.childrenArray(i);let r=n.findIndex((e=>e.id===t));if(r<0)throw new Error;n=[...n],n[r]={...n[r],children:e}}Object.setPrototypeOf(n,oV.prototype);let r=n;return r.fillCaches(),r}runOp(e){switch(e.type){case 7:return this.addOp(e);case 8:return this.deleteOp(e);case 9:return this.moveOp(e)}return null}checkDuplicatedIdRec(e){let{id:t,children:i}=e;if(void 0!==this.get(t))return!0;for(let n of i)if(this.checkDuplicatedIdRec(n))return!0;return!1}addOp(e){let{parent:t,fi:i,id:n,data:r,children:a}=e;if(null!==t&&void 0===this.get(t))return null;if(this.checkDuplicatedIdRec(e))return null;{let s=t,o=this.childrenArray(s),l={fi:i,id:n,data:r,children:a};return o=[...o,l],o.sort(((e,t)=>e.fi-t.fi)),e.localIndex=o.indexOf(l),{data:this.modifyArrayBy(s,o),actual:e,reverse:{type:8,id:n}}}}deleteOp(e){let{id:t}=e;if(null===this.get(t))return null;{let i=this.parent(t);if(void 0===i)return null;let n=this.childrenArray(i),r=n.findIndex((e=>e.id===t));e.localIndex=r,n=[...n];let a=n.splice(r,1)[0];return{data:this.modifyArrayBy(i,n),actual:e,reverse:{type:7,...a,parent:i}}}}moveOp(e){let{parent:t,fi:i,id:n}=e;if(null!==t&&void 0===this.get(t))return this.deleteOp({type:8,id:n});if(null!==t){let e=t;for(;null!==e;){if(void 0===e)throw new Error;if(e===n)throw new eV("cyclic tree");e=this.parent(e)}}let r=this.parent(n);if(void 0===r)return null;let a=r,s=this.childrenArray(r),o=s.findIndex((e=>e.id===n));s=[...s];let l=s.splice(o,1)[0],c=this.modifyArrayBy(r,s);r=t,s=c.childrenArray(r);let h=l.fi;return l={...l,fi:i},s=[...s,l],s.sort(((e,t)=>e.fi-t.fi)),e.localIndex=s.indexOf(l),c=c.modifyArrayBy(r,s),{data:c,actual:e,reverse:{type:9,parent:a,fi:h,id:n}}}previous(e,t){if(null===t){let t=this.childrenArray(e);return 0===t.length?null:t[t.length-1].id}let i=null;for(let n of this.childrenArray(e)){if(n.id===t)return i;i=n.id}return null}traverseSortNext(e){let t=this.parent(e);if(void 0!==t){let i=this.childrenArray(t),n=i.findIndex((t=>t.id===e))+1;if(n<i.length)return i[n].id;if(t)return this.traverseSortNext(t)}}sortNext(e){let t=this.childrenArray(e);return t.length>0?t[0].id:this.traverseSortNext(e)}traverseSortPrevious(e){let t=this.childrenArray(e);return t.length>0?this.traverseSortPrevious(t[t.length-1].id):e}sortPrevious(e){let t=this.parent(e);if(void 0!==t){let i=this.childrenArray(t),n=i.findIndex((t=>t.id===e))-1;return n>=0?this.traverseSortPrevious(i[n].id):t}}getAllSorted(e){let t=[];for(let i of e){let e=this.getWithSortKey(i.id);void 0!==e&&t.push({...i,...e})}t.sort(((e,t)=>function(e,t){let i=0;for(;i<e.length&&i<t.length;){if(e[i]<t[i])return-1;if(e[i]>t[i])return 1;i+=1}return i!==t.length?-1:i!==e.length?1:0}(e.sortKey,t.sortKey)));for(let i of t)delete i.sortKey;return t}getWithSortKey(e){var t=e;let i=[],n=this.get(t),r=n;if(void 0!==n){for(;t;)i.splice(0,0,n.fi),null!==(t=this.parent(t))&&(n=this.get(t));return{...r,sortKey:i}}}insertBeforeHelper(e,t,i){return this.insertAfterHelper(e,this.previous(e,t),i)}insertAfterHelper(e,t,i){let n=this.childrenArray(e);if(null===t){if(0===n.length)return iV(0,i,i);{let e=n[0].fi;return iV(e-i,e,i)}}{let r=this.get(t);if(void 0===r||this.parent(t)!==e)throw new Error("illegal args");let a=n.find((e=>e.fi>r.fi));if(void 0===a){let e=n[n.length-1].fi;return iV(e,e+i,i)}return iV(r.fi,a.fi,i)}}};(e=>{e.runOp=function(e,t){if(0!==t.type)return null;if(Array.isArray(e)){let i=t.props,n={},r=[...e],a=!1;if(i)for(let e of Object.keys(i)){let t=parseInt(e);if(isNaN(t))throw new Error("wrong index");n[e]=r[t],r[t]=i[e],a=!0}return a?{data:r,actual:t,reverse:{type:0,props:n}}:null}{let i=t.props,n={},r={...e},a=!1;if(i)for(let e of Object.keys(i)){n[e]=r[e];let t=i[e];void 0===t?delete r[e]:r[e]=t,a=!0}return a?{data:r,actual:t,reverse:{type:0,props:n}}:null}}})(sV||(sV={}));var lV=class extends Array{constructor(){super(...arguments),Object.setPrototypeOf(this,lV.prototype)}deepFreeze(){let e=0;for(;e<this.length;)$j(this[e]),e++}fillCaches0(e){this.objCaches.set(e.id,e)}fillCaches(){if(void 0===this.objCaches){this.objCaches=new Map,Object.getOwnPropertyDescriptor(this,"objCaches").enumerable=!1;for(let e of this)this.fillCaches0(e)}}randomId(){this.fillCaches();let e=Array.from(this.objCaches.keys());if(0!==e.length)return e[Math.max(0,Math.floor(Math.random()*e.length)-1)]}data(e){var t;return null===(t=this.get(e))||void 0===t?void 0:t.data}get(e){return this.fillCaches(),this.objCaches.get(e)}modifyById(e,t){if(void 0===this.get(e))throw new Error("not expected");{let i=this,n=i.findIndex((t=>t.id===e));if(n<0)throw new Error("not expected");let r=i[n];return i=[...i],i[n]={...r,data:t},this.modifyArrayBy(i)}}modifyArrayBy(e){Object.setPrototypeOf(e,lV.prototype);let t=e;return typeof process<"u"||t.fillCaches(),t}runOp(e){switch(e.type){case 4:return this.addOp(e);case 5:return this.deleteOp(e);case 6:return this.moveOp(e)}return null}addOp(e){let{fi:t,id:i,data:n}=e,r=this,a={fi:t,id:i,data:n};return r=[...r,a],r.sort(((e,t)=>e.fi-t.fi)),e.localIndex=r.indexOf(a),{data:this.modifyArrayBy(r),actual:e,reverse:{type:5,id:i}}}deleteOp(e){let{id:t}=e,i=this,n=i.findIndex((e=>e.id===t));if(-1===n)return null;e.localIndex=n,i=[...i];let r=i.splice(n,1)[0];return{data:this.modifyArrayBy(i),actual:e,reverse:{type:4,...r}}}moveOp(e){let{fi:t,id:i}=e,n=this;n=[...n];let r=n.findIndex((e=>e.id===i));if(-1===r)return null;let a=n[r].fi,s={...n[r],fi:t};return n[r]=s,n.sort(((e,t)=>e.fi-t.fi)),e.localIndex=n.indexOf(s),{data:this.modifyArrayBy(n),actual:e,reverse:{type:6,fi:a,id:i}}}previous(e){if(null===e)return 0===this.length?null:this[this.length-1].id;let t=null;for(let i of this){if(i.id===e)return t;t=i.id}return null}insertBeforeHelper(e,t){return this.insertAfterHelper(this.previous(e),t)}insertAfterHelper(e,t){let i=this;if(null===e){if(0===i.length)return iV(0,t,t);{let e=i[0].fi;return iV(e-t,e,t)}}{let n=this.get(e);if(void 0===n)throw new Error("illegal args");let r=i.find((e=>e.fi>n.fi));if(void 0===r){let e=i[i.length-1].fi;return iV(e,e+t,t)}return iV(n.fi,r.fi,t)}}};function cV(e){return e&&"object"==typeof e&&e instanceof fV}var hV,uV,dV,pV,fV=class{unusedFunOverridesTable(e){}runOp(e){let t=[],i=this,n=0,r={};for(;n<e.path.length;){if(t.push(i),i=void 0===i?void 0:i[e.path[n]],void 0!==i&&!cV(i))return null;n+=1}i=i?tV(i):new fV;for(let[a,s]of Object.entries(e.props)){let e=i[a];r[a]=e,void 0===s?delete i[a]:i[a]=s}for(;n>0;){if(0===Object.keys(i).length){let r=t[n-1];r&&(i=tV(r),delete i[e.path[n-1]])}else{let r=t[n-1];if(r){let t=tV(r);t[e.path[n-1]]=i,i=t}else{let t=new fV;t[e.path[n-1]]=i,i=t}}n-=1}return{data:Object.setPrototypeOf(i,fV.prototype),actual:e,reverse:{...e,props:r}}}};function mV(e,t){if(void 0===t)return;let i=!1,n=e.map((e=>{let n=e.id,r=gV(e.data,t[n]);if(i=i||void 0!==r,void 0===r&&(r=e.data),e.children){let a=mV(e.children,t);return void 0!==a?i=!0:a=e.children,{...e,id:n,data:r,children:a}}return{...e,id:n,data:r}}));return i?n:void 0}function gV(e,t){if(!cV(t))return t;if(e instanceof oV){let i=mV(e,t);return void 0!==i&&Object.setPrototypeOf(i,Object.getPrototypeOf(e)),i}if(e instanceof lV)return function(e,t){if(void 0===t)return;let i=!1,n=e.map((e=>{let n=e.id,r=gV(e.data,t[n]);return i=i||void 0!==r,void 0===r&&(r=e.data),{...e,id:n,data:r}}));return i?(Object.setPrototypeOf(n,Object.getPrototypeOf(e)),n):void 0}(e,t);if(Array.isArray(e)){let i=!1,n=e.map(((e,n)=>{let r=gV(e,t[n]);return i=i||void 0!==r,void 0===r&&(r=e),r}));return i?(Object.setPrototypeOf(n,Object.getPrototypeOf(e)),n):void 0}if(e instanceof fV)return vV(e,t);if(e&&"object"==typeof e){let i={},n=!1;for(let[r,a]of Object.entries(e)){let e=gV(a,t[r]);n=n||void 0!==e,void 0===e&&(e=a),i[r]=e}return n?(Object.setPrototypeOf(i,Object.getPrototypeOf(e)),i):void 0}}function vV(e,t){if(void 0===e)return t;if(void 0===t)return e;if(!cV(t))return t;if(!cV(e))return hV.apply(e,t);let i=new Set;for(let r of Object.keys(e))i.add(r);for(let r of Object.keys(t))i.add(r);let n=new fV;for(let r of i){let i=vV(void 0===e?void 0:e[r],void 0===t?void 0:t[r]);n[r]=i}return n}function yV(e,t){var i;let n={cur:[],result:[],len:0};return[e=null!==(i=_V(e,t,n))&&void 0!==i?i:e,n.result]}function bV(e,t){return null===e?null:(e.cur[e.len]=t,e.len+=1,e)}function xV(e){e&&(e.len-=1)}function wV(e,t,i){let n=!1,r=e.map((e=>{let r=e.id,a=t[r];if(void 0!==a&&"string"==typeof a&&(n=!0,r=a,null!==i))throw new Error("not supported");let s=_V(e.data,t,bV(i,r));xV(i),n=n||void 0!==s,void 0===s&&(s=e.data);let o=wV(e.children,t,i);return void 0!==o?n=!0:o=e.children,{...e,id:r,data:s,children:o}}));if(n)return r}function _V(e,t,i){if(e instanceof oV){let n=wV(e,t,i);return void 0!==n&&Object.setPrototypeOf(n,Object.getPrototypeOf(e)),n}if(e instanceof lV)return function(e,t,i){let n=!1,r=e.map((e=>{let r=e.id,a=t[r];if(void 0!==a&&"string"==typeof a&&(n=!0,r=a,null!==i))throw new Error("not supported");let s=_V(e.data,t,bV(i,r));return xV(i),n=n||void 0!==s,void 0===s&&(s=e.data),{...e,id:r,data:s}}));if(n)return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),r}(e,t,i);if(Array.isArray(e)){let n=!1,r=e.map(((e,r)=>{let a=_V(e,t,bV(i,r));return xV(i),n=n||void 0!==a,void 0===a&&(a=e),a}));return n?(Object.setPrototypeOf(r,Object.getPrototypeOf(e)),r):void 0}if(e&&"object"==typeof e&&!nV(e)){let n={},r=!1;for(let[a,s]of Object.entries(e))if("name"!==a){let e=t[a];if("string"==typeof e){if(null!==i)throw new Error("not supported");r=!0,a=e}let o=_V(s,t,bV(i,a));xV(i),r=r||void 0!==o,void 0===o&&(o=s),n[a]=o}else n[a]=s;return r?(Object.setPrototypeOf(n,Object.getPrototypeOf(e)),n):void 0}if("string"==typeof e){let n=t[e];return void 0!==n&&function(e){if(null===e)return null;e.result.push(e.cur.slice(0,e.len))}(i),n}}(e=>{e.apply=function(e,t){var i;return null!==(i=gV(e,t))&&void 0!==i?i:e},e.merge=function(e,t){return vV(e,t)},e.filterOp=function(e,t){let i=0,n=t.path,r=e;for(;i<n.length&&void 0!==r;){if(r=LV.zoomOnce(r,n[i]),void 0===r)return t;if(!cV(r))return;i+=1}if(void 0===r)return t;if(cV(r)){if(0===t.type){let e={...t.props};for(let t of Object.keys(r))delete e[t];return{...t,props:e}}if(1===t.type||4===t.type||7===t.type){let e=mV([t],r);return e?(console.log(e),e):t}return t}}})(hV||(hV={})),(e=>{e.replaceProps=function(e,t){let i=LV.zoom(t,e.path);if("object"==typeof i){let t={};for(let n of Object.keys(e.props))t[n]=i[n];return{...e,props:t}}return{...e,props:{}}}})(uV||(uV={})),(e=>{function t(e,t){let i=t.path;for(var n=[];;){let s;if(e instanceof fV&&0===t.type&&(s=e.runOp({...t,path:i.slice(n.length)}),null===s&&(s=void 0)),void 0===s&&n.length===i.length&&(s=e instanceof oV||e instanceof lV||e instanceof Jj?e.runOp(t):sV.runOp(e,t)),void 0!==s){if(null!==s){let e=s.data;for(let t=n.length-1;t>=0;t--){let r=i[t],a=n[t];if(a instanceof oV){if("number"==typeof r)throw new Error("illegal arg");e=a.modifyById(r,e)}else if(a instanceof lV){if("number"==typeof r)throw new Error("illegal arg");e=a.modifyById(r,e)}else if(a instanceof Jj){if("number"==typeof r)throw new Error("illegal arg");e=a.modifyById(r,e)}else if(a instanceof fV){let t={...a,[r]:e};e=Object.setPrototypeOf(t,fV.prototype)}else{if("object"!=typeof a)return null;if(Array.isArray(a)){if("string"==typeof r&&(r=parseInt(r),isNaN(r)))throw new Error("Invalid path");let t=e;e=[...a],e[r]=t}else e={...a,[r]:e}}}return{data:e,actual:{...s.actual,path:i},reverse:{...s.reverse,path:i}}}return null}let o,l=i[n.length];if(e instanceof oV){var r;if("number"==typeof l)throw new Error("");o=null===(r=e.get(l))||void 0===r?void 0:r.data}else if(e instanceof lV){var a;if("number"==typeof l)throw new Error("");o=null===(a=e.get(l))||void 0===a?void 0:a.data}else null!==e&&(o=e[l]);if(void 0===o)return null;n.push(e),e=o}}function i(e,t){for(let i=0;i<e.length&&i<t.length;i++)if(e[i]!==t[i])return!0;return!1}function n(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}e.drop=function(e,t){return{...e,path:e.path.slice(t)}},e.applySimple=function(e,i){var n,r;return null!==(n=null===(r=t(e,i))||void 0===r?void 0:r.data)&&void 0!==n?n:e},e.apply=t,e.pathDisjoint=i,e.pathEq=n,e.commutative=function(e,t){return i(e.path,t.path)},e.subsumed=function(e,t){return!(0!==e.type||0!==t.type||!n(e.path,t.path))&&Object.keys(e.props).every((e=>void 0!==t.props[e]))}})(dV||(dV={})),(e=>{function t(e,t){var i=e;let n=[],r=[];for(let a of t)try{if(3===a.type||5===a.type&&"variables"===a.path[a.path.length-1]){let e,t,s;if(3===a.type?(e=LV.zoom(i,[...a.path,a.id]),s=dV.apply(i,{...a,type:2})):(e=LV.zoom(i,[...a.path,a.id,"value"]),s=dV.apply(i,a)),null!==s){i=s.data;let[o,l]=yV(i,{[a.id]:e});i=o;for(let s=0;s<l.length;s++){let o=l[s],c=o.pop();if("number"==typeof c){let n=[c];for(let e=s+1;e<l.length;e++){let t=l[e],i=t[t.length-1];if("number"!=typeof i||!LV.equal(o,t.slice(0,t.length-1)))break;n.push(i),l.splice(e,1)}let r=LV.zoom(i,o);t=r.map(((e,t)=>n.includes(t)?a.id:e)),e=r,c=o.pop()}else{if("alphaOverride"===c||"alpha"===c){e/=100;let t=e,n=LV.zoom(i,o.slice(0,o.length-2)),r=n.layers.map((e=>e.id===o[o.length-1]?{...e,data:{...e.data,[c]:t}}:e));Object.setPrototypeOf(r,Object.getPrototypeOf(n.layers)),n.layers=r}t=a.id}n.push({type:0,path:o,props:{[c]:e}}),r.push({type:0,path:o,props:{[c]:t}})}r.push(s.reverse),n.push(s.actual)}}else{let e=dV.apply(i,a);null!==e&&(n.push(e.actual),i=e.data,r.push(e.reverse))}}catch(w){if(w instanceof eV)return null;throw w}return{data:i,actual:n,reverse:r.reverse()}}e.empty=function(){return[]},e.removePrefix=function(e,t){let i=[];for(let n of e){let[e,...r]=n.path;e===t&&i.push({...n,path:r})}return i},e.addPrefix=function(e,t){return e.map((e=>({...e,path:[t,...e.path]})))},e.concat=function(e,t){return[...e,...t]},e.compress=function(e,t){return[...e.filter((e=>!t.some((t=>dV.subsumed(e,t))))),...t]},e.commutative=function(e,t){return e.every((e=>t.every((t=>dV.commutative(e,t)))))},e.applyAll=function(e,i){for(let n of i){let i=t(e,n);null!==i&&(e=i.data)}return e},e.apply=t})(pV||(pV={}));var SV=Symbol(),EV=Symbol(),CV=Symbol(),AV=class{reportOp(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=this;if(null===t)return;n._current=t.data;let r=i;for(;!(n instanceof BV);){let e=n._path,t=n._current;if(""!==e&&r.splice(0,0,e),n=n._parent,null===n)return;n.update(e,t)}n.push(r,e,t.actual,t.reverse)}deleteChildren(e){if(this._children){let t=this._children[e];if(t){let i=t[CV];i&&i(),delete this._children[e]}}}},MV=class extends AV{constructor(e,t,i){super(),this._parent=e,this._path=t,this._current=i}update(e,t){if(Array.isArray(this._current)){if("string"==typeof e&&(e=parseInt(e),isNaN(e)))throw new Error("Invalid path");this._current=[...this._current],this._current[e]=t}else this._current={...this._current,[e]:t}}runOp(e){this.reportOp(e,sV.runOp(this._current,e),e.path)}},TV=class extends AV{constructor(e,t,i){super(),this._parent=e,this._path=t,this._current=i}update(e,t){this._current={...this._current,[e]:t},Object.setPrototypeOf(this._current,Jj.prototype)}runOp(e){this.reportOp(e,this._current.runOp(e))}},PV={get(e,t){if(t===CV)return()=>{e._parent=null};if(t===SV)return e._current;if(t===EV)return e;let{_current:i,_children:n}=e;if("push"===t&&Array.isArray(i))throw new Error("not supported to expand array");let r=void 0===n?void 0:n[t];if(void 0!==r)return r;let a=i[t],s=zV(e,t,a);return s!==a?(void 0===n&&(n={},e._children=n),n[t]=s,s):a},has:(e,t)=>t in e._current,ownKeys:e=>Reflect.ownKeys(e._current),defineProperty(){throw Error("not supported")},getPrototypeOf:e=>Object.getPrototypeOf(e._current),setPrototypeOf(){throw Error("not supported")},getOwnPropertyDescriptor(e,t){let i=e._current,n=Reflect.getOwnPropertyDescriptor(i,t);return n&&{writable:!0,configurable:!0,enumerable:n.enumerable,value:i[t]}}},DV={...PV,set(e,t,i){var n;let r={type:0,props:{[t]:null!==(n=jV(i))&&void 0!==n?n:i}};return e.deleteChildren(t),e.runOp(r),!0},deleteProperty(e,t){let i={type:0,props:{[t]:void 0}};return e.deleteChildren(t),e.runOp(i),!0}},kV={...PV,set(e,t,i){return void 0===i?this.deleteProperty(e,t):(e.deleteChildren(t),e.runOp({type:1,id:t,data:i})),!0},deleteProperty:(e,t)=>(e.runOp({type:2,id:t}),!0)},OV=class extends AV{constructor(e,t,i){super(),this._children={},this._parent=e,this._path=t,this._current=i,this[CV]=()=>{this._parent=null}}unproxy(){return this._current}update(e,t){this._current=this._current.modifyById(e,t)}runOp(e){this.reportOp(e,this._current.runOp(e))}randomId(){return this._current.randomId()}isDescendantOf(e,t){return this._current.isDescendantOf(e,t)}childrenOf(e){return this._current.childrenOf(e)}traverse(e){return this._current.traverse(e)}get(e){return this._current.get(e)}parent(e){return this._current.parent(e)}traverse(e){this._current.traverse(((t,i)=>{e(t,this.data(t))}))}data(e){var t;let{_current:i,_children:n}=this,r=void 0===n?void 0:n[e];if(void 0!==r)return r;let a=null===(t=i.get(e))||void 0===t?void 0:t.data,s=zV(this,e,a);return s!==a?(void 0===n&&(n={},this._children=n),n[e]=s,s):a}add(e,t,i,n,r){this.runOp({type:7,parent:e,fi:t,id:i,data:n,children:r})}move(e,t,i){this.runOp({type:9,parent:e,fi:t,id:i})}insertAfter(e,t,i){let n=this._current.insertAfterHelper(e,t,i.length);for(let r=0;r<i.length;r++){let t=i[r];this.add(e,n[r],t.id,t.data,t.children)}}insertBefore(e,t,i){let n=this._current.insertBeforeHelper(e,t,i.length);for(let r=0;r<i.length;r++){let t=i[r];this.add(e,n[r],t.id,t.data,t.children)}}moveAfter(e,t,i){let n=this._current.insertAfterHelper(e,t,i.length);for(let r=0;r<i.length;r++){let t=i[r];this.move(e,n[r],t)}}moveBefore(e,t,i){let n=this._current.insertBeforeHelper(e,t,i.length);for(let r=0;r<i.length;r++){let t=i[r];this.move(e,n[r],t)}}delete(e){this.deleteChildren(e),this.runOp({type:8,id:e})}sortNext(e){return this._current.sortNext(e)}sortPrevious(e){return this._current.sortPrevious(e)}getAllSorted(e){return this._current.getAllSorted(e)}},IV=class extends AV{constructor(e,t,i){super(),this._children={},this._parent=e,this._path=t,this._current=i,this[CV]=()=>{this._parent=null}}unproxy(){return this._current}get length(){return this._current.length}forEach(e){let t=this.length;for(let i=0;i<t;i++){let t=this._current[i].id,n=this._current[i].fi;e(this.data(this._current[i].id),t,n)}}find(e){let t=this.length;for(let i=0;i<t;i++){let t=this._current[i].id;if(e(this.data(t),t))return this.get(t)}}update(e,t){this._current=this._current.modifyById(e,t)}randomId(){return this._current.randomId()}get(e){return{...this._current.get(e),data:this.data(e)}}data(e){var t;let{_current:i,_children:n}=this,r=void 0===n?void 0:n[e];if(void 0!==r)return r;let a=null===(t=i.get(e))||void 0===t?void 0:t.data,s=zV(this,e,a);return s!==a?(void 0===n&&(n={},this._children=n),n[e]=s,s):a}runOp(e){this.reportOp(e,this._current.runOp(e))}add(e,t,i){this.runOp({type:4,fi:e,id:t,data:i})}move(e,t){this.runOp({type:6,fi:e,id:t})}insertAfter(e,t){let i=this._current.insertAfterHelper(e,t.length);for(let n=0;n<t.length;n++){let e=t[n];this.add(i[n],e.id,e.data)}}insertBefore(e,t){let i=this._current.insertBeforeHelper(e,t.length);for(let n=0;n<t.length;n++){let e=t[n];this.add(i[n],e.id,e.data)}}moveAfter(e,t){let i=this._current.insertAfterHelper(e,t.length);for(let n=0;n<t.length;n++){let e=t[n];this.move(i[n],e)}}moveBefore(e,t){let i=this._current.insertBeforeHelper(e,t.length);for(let n=0;n<t.length;n++){let e=t[n];this.move(i[n],e)}}delete(e){this.deleteChildren(e),this.runOp({type:5,id:e})}};function RV(e,t,i){if(e.length>0){let n=e[e.length-1];if(0===n.type&&0===t.type&&LV.equal(n.path,i))return void Object.assign(n.props,t.props)}e.push({...t,path:i})}var LV,BV=class extends AV{constructor(e){super(),this.ts=[],this.actual=[],this.reverse=[],this._current=e}update(e,t){if(""!==e)throw new Error("");this._current=t}push(e,t,i,n){RV(this.ts,t,e),RV(this.actual,i,e),RV(this.reverse,n,e)}result(){return{data:this._current,ts:this.ts,actual:this.actual,reverse:this.reverse.reverse()}}};function zV(e,t,i){return i instanceof oV?new OV(e,t,i):i instanceof lV?new IV(e,t,i):i instanceof Jj?new Proxy(new TV(e,t,i),kV):null!==i&&"object"==typeof i?nV(i)?i:new Proxy(new MV(e,t,i),DV):i}function NV(e){let t=new BV(e);return[zV(t,"",e),t]}function FV(e,t){let[i,n]=NV(e);return t(i),n.result()}function jV(e){return e instanceof OV||e instanceof IV?e._current:null!==e&&"object"==typeof e?e[SV]:e}function VV(e,t){let i=[];if(!(t.length<=e.length))return null;for(var n=0;n<t.length;){if("*"===t[n])i.push(e[n]);else if(e[n]!==t[n])return null;n+=1}return i}(e=>{function t(e,t){return(e instanceof oV||e instanceof OV)&&"string"==typeof t||(e instanceof lV||e instanceof IV)&&"string"==typeof t?e.data(t):"number"==typeof t&&Array.isArray(e)||"string"==typeof t&&"object"==typeof e&&null!==e?e[t]:void 0}function i(e,i){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;for(;n<i.length&&void 0!==e;)e=t(e,i[n]),n+=1;return e}e.equal=function(e,t){if(t.length!==e.length)return!1;for(var i=0;i<e.length;){if(e[i]!==t[i])return!1;i+=1}return!0},e.removeOverridden=function(e,t,n){let r=i(n,e);if(void 0!==r&&"object"==typeof r&&null!==r){let e={...t};return Object.keys(r).forEach((t=>{delete e[t]})),e}return t},e.zoomOnce=t,e.zoom=i})(LV||(LV={}));var UV,GV=class{},HV=class extends GV{constructor(e){super(),this.id=e}},WV=class extends GV{constructor(e){super(),this.data=e}};try{UV=new TextDecoder}catch{}var qV,XV,YV,QV,ZV,KV,JV,$V=0,eU=[],tU=eU,iU=0,nU={},rU=0,aU=0,sU=[],oU={useRecords:!1,mapsAsObjects:!0},lU=class{},cU=new lU;cU.name="MessagePack 0xC1";var hU=!1,uU=class{constructor(e){e&&(!1===e.useRecords&&void 0===e.mapsAsObjects&&(e.mapsAsObjects=!0),e.structures?e.structures.sharedLength=e.structures.length:e.getStructures&&((e.structures=[]).uninitialized=!0,e.structures.sharedLength=0)),Object.assign(this,e)}unpack(e,t){if(qV)return BU((()=>(zU(),this?this.unpack(e,t):uU.prototype.unpack.call(oU,e,t))));XV=t>-1?t:e.length,$V=0,iU=0,aU=0,QV=null,tU=eU,ZV=null,qV=e;try{JV=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(a){throw qV=null,e instanceof Uint8Array?a:new Error("Source must be a Uint8Array or Buffer but was a "+(e&&"object"==typeof e?e.constructor.name:typeof e))}if(this instanceof uU){if(nU=this,this.structures)return YV=this.structures,dU();(!YV||YV.length>0)&&(YV=[])}else nU=oU,(!YV||YV.length>0)&&(YV=[]);return dU()}unpackMultiple(e,t){let i,n=0;try{hU=!0;let r=e.length,a=this?this.unpack(e,r):jU.unpack(e,r);if(!t){for(i=[a];$V<r;)n=$V,i.push(dU());return i}for(t(a);$V<r;)if(n=$V,!1===t(dU()))return}catch(p){throw p.lastPosition=n,p.values=i,p}finally{hU=!1,zU()}}_mergeStructures(e,t){for(let i=0,n=(e=e||[]).length;i<n;i++){let t=e[i];t&&(t.isShared=!0,i>=32&&(t.highByte=i-32>>5))}e.sharedLength=e.length;for(let i in t||[])if(i>=0){let n=e[i],r=t[i];r&&(n&&((e.restoreStructures||(e.restoreStructures=[]))[i]=n),e[i]=r)}return this.structures=e}decode(e,t){return this.unpack(e,t)}};function dU(){try{if(!nU.trusted&&!hU){let e=YV.sharedLength||0;e<YV.length&&(YV.length=e)}let e=fU();if($V==XV)YV.restoreStructures&&pU(),YV=null,qV=null,KV&&(KV=null);else{if($V>XV){let e=new Error("Unexpected end of MessagePack data");throw e.incomplete=!0,e}if(!hU)throw new Error("Data read, but end of buffer not reached")}return e}catch(r){throw YV.restoreStructures&&pU(),zU(),(r instanceof RangeError||r.message.startsWith("Unexpected end of buffer"))&&(r.incomplete=!0),r}}function pU(){for(let e in YV.restoreStructures)YV[e]=YV.restoreStructures[e];YV.restoreStructures=null}function fU(){let e=qV[$V++];if(e<160){if(e<128){if(e<64)return e;{let t=YV[63&e]||nU.getStructures&&yU()[63&e];return t?(t.read||(t.read=gU(t,63&e)),t.read()):e}}if(e<144){if(e-=128,nU.mapsAsObjects){let t={};for(let i=0;i<e;i++)t[OU()]=fU();return t}{let t=new Map;for(let i=0;i<e;i++)t.set(fU(),fU());return t}}{e-=144;let t=new Array(e);for(let i=0;i<e;i++)t[i]=fU();return t}}if(e<192){let t=e-160;if(aU>=$V)return QV.slice($V-rU,($V+=t)-rU);if(0==aU&&XV<140){let e=t<16?TU(t):MU(t);if(null!=e)return e}return bU(t)}{let t;switch(e){case 192:return null;case 193:return ZV?(t=fU(),t>0?ZV[1].slice(ZV.position1,ZV.position1+=t):ZV[0].slice(ZV.position0,ZV.position0-=t)):cU;case 194:return!1;case 195:return!0;case 196:return PU(qV[$V++]);case 197:return t=JV.getUint16($V),$V+=2,PU(t);case 198:return t=JV.getUint32($V),$V+=4,PU(t);case 199:return DU(qV[$V++]);case 200:return t=JV.getUint16($V),$V+=2,DU(t);case 201:return t=JV.getUint32($V),$V+=4,DU(t);case 202:if(t=JV.getFloat32($V),nU.useFloat32>2){let e=NU[(127&qV[$V])<<1|qV[$V+1]>>7];return $V+=4,(e*t+(t>0?.5:-.5)>>0)/e}return $V+=4,t;case 203:return t=JV.getFloat64($V),$V+=8,t;case 204:return qV[$V++];case 205:return t=JV.getUint16($V),$V+=2,t;case 206:return t=JV.getUint32($V),$V+=4,t;case 207:return nU.int64AsNumber?(t=4294967296*JV.getUint32($V),t+=JV.getUint32($V+4)):t=JV.getBigUint64($V),$V+=8,t;case 208:return JV.getInt8($V++);case 209:return t=JV.getInt16($V),$V+=2,t;case 210:return t=JV.getInt32($V),$V+=4,t;case 211:return nU.int64AsNumber?(t=4294967296*JV.getInt32($V),t+=JV.getUint32($V+4)):t=JV.getBigInt64($V),$V+=8,t;case 212:if(t=qV[$V++],114==t)return IU(63&qV[$V++]);{let e=sU[t];if(e)return e.read?($V++,e.read(fU())):e.noBuffer?($V++,e()):e(qV.subarray($V,++$V));throw new Error("Unknown extension "+t)}case 213:return t=qV[$V],114==t?($V++,IU(63&qV[$V++],qV[$V++])):DU(2);case 214:return DU(4);case 215:return DU(8);case 216:return DU(16);case 217:return t=qV[$V++],aU>=$V?QV.slice($V-rU,($V+=t)-rU):xU(t);case 218:return t=JV.getUint16($V),aU>=($V+=2)?QV.slice($V-rU,($V+=t)-rU):wU(t);case 219:return t=JV.getUint32($V),aU>=($V+=4)?QV.slice($V-rU,($V+=t)-rU):_U(t);case 220:return t=JV.getUint16($V),$V+=2,EU(t);case 221:return t=JV.getUint32($V),$V+=4,EU(t);case 222:return t=JV.getUint16($V),$V+=2,CU(t);case 223:return t=JV.getUint32($V),$V+=4,CU(t);default:if(e>=224)return e-256;if(void 0===e){let e=new Error("Unexpected end of MessagePack data");throw e.incomplete=!0,e}throw new Error("Unknown MessagePack token "+e)}}}var mU=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function gU(e,t){function i(){if(i.count++>2){let i=e.read=new Function("r","return function(){return {"+e.map((e=>mU.test(e)?e+":r()":"["+JSON.stringify(e)+"]:r()")).join(",")+"}}")(fU);return 0===e.highByte&&(e.read=vU(t,e.read)),i()}let n={};for(let t=0,i=e.length;t<i;t++){n[e[t]]=fU()}return n}return i.count=0,0===e.highByte?vU(t,i):i}var vU=(e,t)=>function(){let i=qV[$V++];if(0===i)return t();let n=e<32?-(e+(i<<5)):e+(i<<5),r=YV[n]||yU()[n];if(!r)throw new Error("Record id is not defined for "+n);return r.read||(r.read=gU(r,e)),r.read()};function yU(){let e=BU((()=>(qV=null,nU.getStructures())));return YV=nU._mergeStructures(e,YV)}var bU=SU,xU=SU,wU=SU,_U=SU;function SU(e){let t;if(e<16&&(t=TU(e)))return t;if(e>64&&UV)return UV.decode(qV.subarray($V,$V+=e));let i=$V+e,n=[];for(t="";$V<i;){let e=qV[$V++];if(0===(128&e))n.push(e);else if(192===(224&e)){let t=63&qV[$V++];n.push((31&e)<<6|t)}else if(224===(240&e)){let t=63&qV[$V++],i=63&qV[$V++];n.push((31&e)<<12|t<<6|i)}else if(240===(248&e)){let t=(7&e)<<18|(63&qV[$V++])<<12|(63&qV[$V++])<<6|63&qV[$V++];t>65535&&(t-=65536,n.push(t>>>10&1023|55296),t=56320|1023&t),n.push(t)}else n.push(e);n.length>=4096&&(t+=AU.apply(String,n),n.length=0)}return n.length>0&&(t+=AU.apply(String,n)),t}function EU(e){let t=new Array(e);for(let i=0;i<e;i++)t[i]=fU();return t}function CU(e){if(nU.mapsAsObjects){let t={};for(let i=0;i<e;i++)t[OU()]=fU();return t}{let t=new Map;for(let i=0;i<e;i++)t.set(fU(),fU());return t}}var AU=String.fromCharCode;function MU(e){let t=$V,i=new Array(e);for(let n=0;n<e;n++){let e=qV[$V++];if((128&e)>0)return void($V=t);i[n]=e}return AU.apply(String,i)}function TU(e){if(e<4){if(e<2){if(0===e)return"";{let e=qV[$V++];return(128&e)>1?void($V-=1):AU(e)}}{let t=qV[$V++],i=qV[$V++];if((128&t)>0||(128&i)>0)return void($V-=2);if(e<3)return AU(t,i);let n=qV[$V++];return(128&n)>0?void($V-=3):AU(t,i,n)}}{let t=qV[$V++],i=qV[$V++],n=qV[$V++],r=qV[$V++];if((128&t)>0||(128&i)>0||(128&n)>0||(128&r)>0)return void($V-=4);if(e<6){if(4===e)return AU(t,i,n,r);{let e=qV[$V++];return(128&e)>0?void($V-=5):AU(t,i,n,r,e)}}if(e<8){let a=qV[$V++],s=qV[$V++];if((128&a)>0||(128&s)>0)return void($V-=6);if(e<7)return AU(t,i,n,r,a,s);let o=qV[$V++];return(128&o)>0?void($V-=7):AU(t,i,n,r,a,s,o)}{let a=qV[$V++],s=qV[$V++],o=qV[$V++],l=qV[$V++];if((128&a)>0||(128&s)>0||(128&o)>0||(128&l)>0)return void($V-=8);if(e<10){if(8===e)return AU(t,i,n,r,a,s,o,l);{let e=qV[$V++];return(128&e)>0?void($V-=9):AU(t,i,n,r,a,s,o,l,e)}}if(e<12){let c=qV[$V++],h=qV[$V++];if((128&c)>0||(128&h)>0)return void($V-=10);if(e<11)return AU(t,i,n,r,a,s,o,l,c,h);let u=qV[$V++];return(128&u)>0?void($V-=11):AU(t,i,n,r,a,s,o,l,c,h,u)}{let c=qV[$V++],h=qV[$V++],u=qV[$V++],d=qV[$V++];if((128&c)>0||(128&h)>0||(128&u)>0||(128&d)>0)return void($V-=12);if(e<14){if(12===e)return AU(t,i,n,r,a,s,o,l,c,h,u,d);{let e=qV[$V++];return(128&e)>0?void($V-=13):AU(t,i,n,r,a,s,o,l,c,h,u,d,e)}}{let p=qV[$V++],f=qV[$V++];if((128&p)>0||(128&f)>0)return void($V-=14);if(e<15)return AU(t,i,n,r,a,s,o,l,c,h,u,d,p,f);let m=qV[$V++];return(128&m)>0?void($V-=15):AU(t,i,n,r,a,s,o,l,c,h,u,d,p,f,m)}}}}}function PU(e){return nU.copyBuffers?Uint8Array.prototype.slice.call(qV,$V,$V+=e):qV.subarray($V,$V+=e)}function DU(e){let t=qV[$V++];if(sU[t])return sU[t](qV.subarray($V,$V+=e));throw new Error("Unknown extension type "+t)}var kU=new Array(4096);function OU(){let e=qV[$V++];if(!(e>=160&&e<192))return $V--,fU();if(e-=160,aU>=$V)return QV.slice($V-rU,($V+=e)-rU);if(!(0==aU&&XV<180))return bU(e);let t,i=4095&(e<<5^(e>1?JV.getUint16($V):e>0?qV[$V]:0)),n=kU[i],r=$V,a=$V+e-3,s=0;if(n&&n.bytes==e){for(;r<a;){if(t=JV.getUint32(r),t!=n[s++]){r=1879048192;break}r+=4}for(a+=3;r<a;)if(t=qV[r++],t!=n[s++]){r=1879048192;break}if(r===a)return $V=r,n.string;a-=3,r=$V}for(n=[],kU[i]=n,n.bytes=e;r<a;)t=JV.getUint32(r),n.push(t),r+=4;for(a+=3;r<a;)t=qV[r++],n.push(t);let o=e<16?TU(e):MU(e);return n.string=null!=o?o:bU(e)}var IU=(e,t)=>{var i=fU();let n=e;void 0!==t&&(e=e<32?-((t<<5)+e):(t<<5)+e,i.highByte=t);let r=YV[e];return r&&r.isShared&&((YV.restoreStructures||(YV.restoreStructures=[]))[e]=r),YV[e]=i,i.read=gU(i,n),i.read()},RU="object"==typeof self?self:global;sU[0]=()=>{},sU[0].noBuffer=!0,sU[101]=()=>{let e=fU();return(RU[e[0]]||Error)(e[1])},sU[105]=e=>{let t=JV.getUint32($V-4);KV||(KV=new Map);let i,n=qV[$V];i=n>=144&&n<160||220==n||221==n?[]:{};let r={target:i};KV.set(t,r);let a=fU();return r.used?Object.assign(i,a):(r.target=a,a)},sU[112]=e=>{let t=JV.getUint32($V-4),i=KV.get(t);return i.used=!0,i.target},sU[115]=()=>new Set(fU());var LU=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map((e=>e+"Array"));function BU(e){let t=XV,i=$V,n=iU,r=rU,a=aU,s=QV,o=tU,l=KV,c=ZV,h=new Uint8Array(qV.slice(0,XV)),u=YV,d=YV.slice(0,YV.length),p=nU,f=hU,m=e();return XV=t,$V=i,iU=n,rU=r,aU=a,QV=s,tU=o,KV=l,ZV=c,qV=h,hU=f,(YV=u).splice(0,YV.length,...d),nU=p,JV=new DataView(qV.buffer,qV.byteOffset,qV.byteLength),m}function zU(){qV=null,KV=null,YV=null}sU[116]=e=>{let t=e[0],i=LU[t];if(!i)throw new Error("Could not find typed array for code "+t);return new RU[i](Uint8Array.prototype.slice.call(e,1).buffer)},sU[120]=()=>{let e=fU();return new RegExp(e[0],e[1])},sU[98]=e=>{let t=(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3],i=$V;$V+=t-4,(ZV=[fU(),fU()]).position0=0,ZV.position1=0;let n=$V;$V=i;try{return fU()}finally{$V=n}},sU[255]=e=>4==e.length?new Date(1e3*(16777216*e[0]+(e[1]<<16)+(e[2]<<8)+e[3])):8==e.length?new Date(((e[0]<<22)+(e[1]<<14)+(e[2]<<6)+(e[3]>>2))/1e6+1e3*(4294967296*(3&e[3])+16777216*e[4]+(e[5]<<16)+(e[6]<<8)+e[7])):12==e.length?new Date(((e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3])/1e6+1e3*((128&e[4]?-281474976710656:0)+1099511627776*e[6]+4294967296*e[7]+16777216*e[8]+(e[9]<<16)+(e[10]<<8)+e[11])):new Date("invalid");var NU=new Array(147);for(let yne=0;yne<256;yne++)NU[yne]=+("1e"+Math.floor(45.15-.30103*yne));var FU,jU=new uU({useRecords:!1}),VU=(jU.unpack,jU.unpackMultiple,jU.unpack,new Float32Array(1));new Uint8Array(VU.buffer,0,4);try{FU=new TextEncoder}catch{}var UU,GU,HU,WU,qU,XU=typeof Buffer<"u",YU=XU?Buffer.allocUnsafeSlow:Uint8Array,QU=XU?Buffer:Uint8Array,ZU=XU?4294967296:2144337920,KU=0,JU=null,$U=/[\u0080-\uFFFF]/,eG=Symbol("record-id"),tG=class extends uU{constructor(e){super(e),this.offset=0;let t,i,n,r,a,s=0,o=QU.prototype.utf8Write?function(e,t,i){return HU.utf8Write(e,t,i)}:!(!FU||!FU.encodeInto)&&function(e,t){return FU.encodeInto(e,HU.subarray(t)).written},l=this;e||(e={});let c=e&&e.sequential,h=e.structures||e.saveStructures,u=e.maxSharedStructures;if(null==u&&(u=h?32:0),u>8160)throw new Error("Maximum maxSharedStructure is 8160");let d=e.maxOwnStructures;null==d&&(d=h?32:64),c&&!e.saveStructures&&(this.structures=[]);let p=u>32||d+u>64,f=u+64,m=u+d+64;if(m>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let g=[],v=0,y=0;this.pack=this.encode=function(e,o){if(HU||(HU=new YU(8192),WU=new DataView(HU.buffer,0,8192),KU=0),(qU=HU.length-10)-KU<2048?(HU=new YU(HU.length),WU=new DataView(HU.buffer,0,HU.length),qU=HU.length-10,KU=0):KU=KU+7&2147483640,t=KU,a=l.structuredClone?new Map:null,l.bundleStrings?(JU=["",""],HU[KU++]=214,HU[KU++]=98,JU.position=KU-t,KU+=4):JU=null,i=l.structures,i){i.uninitialized&&(i=l._mergeStructures(l.getStructures()));let e=i.sharedLength||0;if(e>u)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+i.sharedLength);if(!i.transitions){i.transitions=Object.create(null);for(let t=0;t<e;t++){let e=i[t];if(!e)continue;let n,r=i.transitions;for(let t=0,i=e.length;t<i;t++){let i=e[t];n=r[i],n||(n=r[i]=Object.create(null)),r=n}r[eG]=t+64}s=e}c||(i.nextId=e+64)}n&&(n=!1),r=i||[];try{if(b(e),JU){WU.setUint32(JU.position+t,KU-JU.position-t);let e=JU;JU=null,b(e[0]),b(e[1])}if(l.offset=KU,a&&a.idsToInsert){(KU+=6*a.idsToInsert.length)>qU&&w(KU),l.offset=KU;let e=function(e,t){let i,n=6*t.length,r=e.length-n;for(t.sort(((e,t)=>e.offset>t.offset?1:-1));i=t.pop();){let t=i.offset,a=i.id;e.copyWithin(t+n,t,r),n-=6;let s=t+n;e[s++]=214,e[s++]=105,e[s++]=a>>24,e[s++]=a>>16&255,e[s++]=a>>8&255,e[s++]=255&a,r=t}return e}(HU.subarray(t,KU),a.idsToInsert);return a=null,e}return o&pG?(HU.start=t,HU.end=KU,HU):HU.subarray(t,KU)}finally{if(i){if(y<10&&y++,v>1e4)i.transitions=null,y=0,v=0,g.length>0&&(g=[]);else if(g.length>0&&!c){for(let e=0,t=g.length;e<t;e++)g[e][eG]=0;g=[]}if(n&&l.saveStructures){let n=i.sharedLength||u;i.length>n&&(i=i.slice(0,n));let r=HU.subarray(t,KU);return!1===l.saveStructures(i,s)?(l._mergeStructures(l.getStructures()),l.pack(e)):(s=n,r)}}o&fG&&(KU=t)}};let b=e=>{KU>qU&&(HU=w(KU));var i,n=typeof e;if("string"===n){let t,n=e.length;if(JU&&n>=8&&n<4096){let t=$U.test(e);return JU[t?0:1]+=e,HU[KU++]=193,void b(t?-n:n)}t=n<32?1:n<256?2:n<65536?3:5;let r=3*n;if(KU+r>qU&&(HU=w(KU+r)),n<64||!o){let r,a,s,o=KU+t;for(r=0;r<n;r++)a=e.charCodeAt(r),a<128?HU[o++]=a:a<2048?(HU[o++]=a>>6|192,HU[o++]=63&a|128):55296===(64512&a)&&56320===(64512&(s=e.charCodeAt(r+1)))?(a=65536+((1023&a)<<10)+(1023&s),r++,HU[o++]=a>>18|240,HU[o++]=a>>12&63|128,HU[o++]=a>>6&63|128,HU[o++]=63&a|128):(HU[o++]=a>>12|224,HU[o++]=a>>6&63|128,HU[o++]=63&a|128);i=o-KU-t}else i=o(e,KU+t,r);i<32?HU[KU++]=160|i:i<256?(t<2&&HU.copyWithin(KU+2,KU+1,KU+1+i),HU[KU++]=217,HU[KU++]=i):i<65536?(t<3&&HU.copyWithin(KU+3,KU+2,KU+2+i),HU[KU++]=218,HU[KU++]=i>>8,HU[KU++]=255&i):(t<5&&HU.copyWithin(KU+5,KU+3,KU+3+i),HU[KU++]=219,WU.setUint32(KU,i),KU+=4),KU+=i}else if("number"===n)if(e>>>0===e)e<64?HU[KU++]=e:e<256?(HU[KU++]=204,HU[KU++]=e):e<65536?(HU[KU++]=205,HU[KU++]=e>>8,HU[KU++]=255&e):(HU[KU++]=206,WU.setUint32(KU,e),KU+=4);else if(e>>0===e)e>=-32?HU[KU++]=256+e:e>=-128?(HU[KU++]=208,HU[KU++]=e+256):e>=-32768?(HU[KU++]=209,WU.setInt16(KU,e),KU+=2):(HU[KU++]=210,WU.setInt32(KU,e),KU+=4);else{let t;if((t=this.useFloat32)>0&&e<4294967296&&e>=-2147483648){let i;if(HU[KU++]=202,WU.setFloat32(KU,e),t<4||(i=e*NU[(127&HU[KU])<<1|HU[KU+1]>>7])>>0===i)return void(KU+=4);KU--}HU[KU++]=203,WU.setFloat64(KU,e),KU+=8}else if("object"===n)if(e){if(a){let i=a.get(e);if(i){if(!i.id){let e=a.idsToInsert||(a.idsToInsert=[]);i.id=e.push(i)}return HU[KU++]=214,HU[KU++]=112,WU.setUint32(KU,i.id),void(KU+=4)}a.set(e,{offset:KU-t})}let n=e.constructor;if(n===Object)x(e,!0);else if(n===Array){(i=e.length)<16?HU[KU++]=144|i:i<65536?(HU[KU++]=220,HU[KU++]=i>>8,HU[KU++]=255&i):(HU[KU++]=221,WU.setUint32(KU,i),KU+=4);for(let t=0;t<i;t++)b(e[t])}else if(n===Map){(i=e.size)<16?HU[KU++]=128|i:i<65536?(HU[KU++]=222,HU[KU++]=i>>8,HU[KU++]=255&i):(HU[KU++]=223,WU.setUint32(KU,i),KU+=4);for(let[t,i]of e)b(t),b(i)}else{for(let t=0,i=UU.length;t<i;t++){if(e instanceof GU[t]){let i=UU[t];if(i.write)return i.type&&(HU[KU++]=212,HU[KU++]=i.type,HU[KU++]=0),void b(i.write.call(this,e));let n,r=HU,a=WU,s=KU;HU=null;try{n=i.pack.call(this,e,(e=>(HU=r,r=null,(KU+=e)>qU&&w(KU),{target:HU,targetView:WU,position:KU-e})),b)}finally{r&&(WU=a,KU=s,qU=(HU=r).length-10)}return void(n&&(n.length+KU>qU&&w(n.length+KU),KU=rG(n,HU,KU,i.type)))}}x(e,!e.hasOwnProperty)}}else HU[KU++]=192;else if("boolean"===n)HU[KU++]=e?195:194;else if("bigint"===n){if(e<BigInt(1)<<BigInt(63)&&e>=-(BigInt(1)<<BigInt(63)))HU[KU++]=211,WU.setBigInt64(KU,e);else if(e<BigInt(1)<<BigInt(64)&&e>0)HU[KU++]=207,WU.setBigUint64(KU,e);else{if(!this.largeBigIntToFloat)throw new RangeError(e+" was too large to fit in MessagePack 64-bit integer format, set largeBigIntToFloat to convert to float-64");HU[KU++]=203,WU.setFloat64(KU,Number(e))}KU+=8}else if("undefined"===n)this.encodeUndefinedAsNil?HU[KU++]=192:(HU[KU++]=212,HU[KU++]=0,HU[KU++]=0);else{if("function"!==n)throw new Error("Unknown type: "+n);b(this.writeFunction&&this.writeFunction())}},x=!1===this.useRecords?this.variableMapSize?e=>{let t,i=Object.keys(e),n=i.length;n<16?HU[KU++]=128|n:n<65536?(HU[KU++]=222,HU[KU++]=n>>8,HU[KU++]=255&n):(HU[KU++]=223,WU.setUint32(KU,n),KU+=4);for(let r=0;r<n;r++)b(t=i[r]),b(e[t])}:(e,i)=>{HU[KU++]=222;let n=KU-t;KU+=2;let r=0;for(let t in e)(i||e.hasOwnProperty(t))&&(b(t),b(e[t]),r++);HU[n+++t]=r>>8,HU[n+t]=255&r}:e=>{let t,i=Object.keys(e),a=r.transitions||(r.transitions=Object.create(null)),s=0;for(let n=0,r=i.length;n<r;n++){let e=i[n];t=a[e],t||(t=a[e]=Object.create(null),s++),a=t}let o=a[eG];if(o)o>=96&&p?(HU[KU++]=96+(31&(o-=96)),HU[KU++]=o>>5):HU[KU++]=o;else{o=r.nextId,o||(o=64),o<f&&this.shouldShareStructure&&!this.shouldShareStructure(i)?(o=r.nextOwnId,o<m||(o=f),r.nextOwnId=o+1):(o>=m&&(o=f),r.nextId=o+1);let e=i.highByte=o>=96&&p?o-96>>5:-1;a[eG]=o,r[o-64]=i,o<f?(i.isShared=!0,r.sharedLength=o-63,n=!0,e>=0?(HU[KU++]=96+(31&o),HU[KU++]=e):HU[KU++]=o):(e>=0?(HU[KU++]=213,HU[KU++]=114,HU[KU++]=96+(31&o),HU[KU++]=e):(HU[KU++]=212,HU[KU++]=114,HU[KU++]=o),s&&(v+=y*s),g.length>=d&&(g.shift()[eG]=0),g.push(a),b(i))}for(let n=0,r=i.length;n<r;n++)b(e[i[n]])},w=e=>{let i;if(e>16777216){if(e-t>ZU)throw new Error("Packed buffer would be larger than maximum buffer size");i=Math.min(ZU,4096*Math.round(Math.max((e-t)*(e>67108864?1.25:2),4194304)/4096))}else i=1+(Math.max(e-t<<2,HU.length-1)>>12)<<12;let n=new YU(i);return WU=new DataView(n.buffer,0,i),HU.copy?HU.copy(n,0,t,e):n.set(HU.slice(t,e)),KU-=t,t=0,qU=n.length-10,HU=n}}useBuffer(e){HU=e,WU=new DataView(HU.buffer,HU.byteOffset,HU.byteLength),KU=0}};function iG(e,t,i,n){let r=e.byteLength;if(r+1<256){var{target:a,position:s}=i(4+r);a[s++]=199,a[s++]=r+1}else if(r+1<65536){var{target:a,position:s}=i(5+r);a[s++]=200,a[s++]=r+1>>8,a[s++]=r+1&255}else{var{target:a,position:s,targetView:o}=i(7+r);a[s++]=201,o.setUint32(s,r+1),s+=4}a[s++]=116,a[s++]=t,a.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),s)}function nG(e,t){let i=e.byteLength;var n,r;if(i<256){var{target:n,position:r}=t(i+2);n[r++]=196,n[r++]=i}else if(i<65536){var{target:n,position:r}=t(i+3);n[r++]=197,n[r++]=i>>8,n[r++]=255&i}else{var{target:n,position:r,targetView:a}=t(i+5);n[r++]=198,a.setUint32(r,i),r+=4}n.set(e,r)}function rG(e,t,i,n){let r=e.length;switch(r){case 1:t[i++]=212;break;case 2:t[i++]=213;break;case 4:t[i++]=214;break;case 8:t[i++]=215;break;case 16:t[i++]=216;break;default:r<256?(t[i++]=199,t[i++]=r):r<65536?(t[i++]=200,t[i++]=r>>8,t[i++]=255&r):(t[i++]=201,t[i++]=r>>24,t[i++]=r>>16&255,t[i++]=r>>8&255,t[i++]=255&r)}return t[i++]=n,t.set(e,i),i+=r}function aG(e){if(e.Class){if(!e.pack&&!e.write)throw new Error("Extension has no pack or write function");if(e.pack&&!e.type)throw new Error("Extension has no type (numeric code to identify the extension)");GU.unshift(e.Class),UU.unshift(e)}!function(e){e.unpack?sU[e.type]=e.unpack:sU[e.type]=e}(e)}GU=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,lU],UU=[{pack(e,t,i){let n=e.getTime()/1e3;if((this.useTimestamp32||0===e.getMilliseconds())&&n>=0&&n<4294967296){let{target:e,targetView:i,position:r}=t(6);e[r++]=214,e[r++]=255,i.setUint32(r,n)}else if(n>0&&n<17179869184){let{target:i,targetView:r,position:a}=t(10);i[a++]=215,i[a++]=255,r.setUint32(a,4e6*e.getMilliseconds()+(n/1e3/4294967296>>0)),r.setUint32(a+4,n)}else if(isNaN(n)){if(this.onInvalidDate)return t(0),i(this.onInvalidDate());let{target:e,targetView:n,position:r}=t(3);e[r++]=212,e[r++]=255,e[r++]=255}else{let{target:i,targetView:r,position:a}=t(15);i[a++]=199,i[a++]=12,i[a++]=255,r.setUint32(a,1e6*e.getMilliseconds()),r.setBigInt64(a+4,BigInt(Math.floor(n)))}}},{pack(e,t,i){let n=Array.from(e),{target:r,position:a}=t(this.structuredClone?3:0);this.structuredClone&&(r[a++]=212,r[a++]=115,r[a++]=0),i(n)}},{pack(e,t,i){let{target:n,position:r}=t(this.structuredClone?3:0);this.structuredClone&&(n[r++]=212,n[r++]=101,n[r++]=0),i([e.name,e.message])}},{pack(e,t,i){let{target:n,position:r}=t(this.structuredClone?3:0);this.structuredClone&&(n[r++]=212,n[r++]=120,n[r++]=0),i([e.source,e.flags])}},{pack(e,t){this.structuredClone?iG(e,16,t):nG(XU?Buffer.from(e):new Uint8Array(e),t)}},{pack(e,t){let i=e.constructor;i!==QU&&this.structuredClone?iG(e,LU.indexOf(i.name),t):nG(e,t)}},{pack(e,t){let{target:i,position:n}=t(1);i[n]=193}}];var sG,oG,lG=new tG({useRecords:!1}),{NEVER:cG,ALWAYS:hG,DECIMAL_ROUND:uG,DECIMAL_FIT:dG}=(lG.pack,lG.pack,{NEVER:0,ALWAYS:1,DECIMAL_ROUND:3,DECIMAL_FIT:4}),pG=512,fG=1024,mG=new tG({structuredClone:!0});function gG(e){if(nV(e))return e;if(Array.isArray(e))return e.map(gG);if("object"==typeof e&&null!==e){let t={};for(let i of Object.keys(e).sort())t[i]=gG(e[i]);return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),t}return e}aG({Class:Jj.prototype.constructor,type:1,write:e=>({...e}),read:e=>(Object.setPrototypeOf(e,Jj.prototype),e)}),aG({Class:lV.prototype.constructor,type:2,write:e=>[...e],read:e=>(Object.setPrototypeOf(e,lV.prototype),e)}),aG({Class:oV.prototype.constructor,type:3,write:e=>[...e],read:e=>(Object.setPrototypeOf(e,oV.prototype),e)}),aG({Class:HV.prototype.constructor,type:4,write:e=>e.id,read:e=>new HV(e)}),aG({Class:WV.prototype.constructor,type:5,write:e=>e.data,read:e=>new WV(e)}),aG({Class:fV.prototype.constructor,type:6,write:e=>({...e}),read:e=>(Object.setPrototypeOf(e,fV.prototype),e)}),(e=>{function t(e){return mG.pack(e)}e.serialize=t,e.deserialize=function(e){return mG.unpack(e)},e.checksum=function(e){return function(e){var t=0;if(0===e.length)return t;for(let i=0;i<e.length;i++)t=(t<<5)-t+e[i],t&=t;return t}(t(gG(e))).toString()}})(sG||(sG={})),(e=>{e.toEventUIType=function(e){return"Conditional"===e.type?"Distance"===e.condition.type?"Distance":"StateChange":e.type},e.fromEventUIType=function(e){return"Distance"===e||"StateChange"===e?"Conditional":e}})(oG||(oG={}));var vG,yG,bG,xG,wG,_G,SG,EG,CG,AG,MG,TG,PG,DG,kG={LookAt:[],Follow:["Create"],DragDrop:["Transition","Animation","Audio","Particles","Create","SetVariable","DynamicVariablePlay","Conditional"],MouseHover:["Transition","Animation","Particles","Create","Destroy","SwitchCamera","SceneTransition","SetVariable","DynamicVariablePlay","Conditional"],Scroll:["Transition","Animation","Create","SetVariable","DynamicVariablePlay","Conditional"],Start:["Transition","Animation","Audio","Particles","Video","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional"],Conditional:["Transition","Animation","Audio","Particles","Video","Link","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional"],MouseDown:["Transition","Animation","Audio","Particles","Video","Link","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional"],MouseUp:["Transition","Animation","Audio","Particles","Video","Link","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional"],MousePress:["Transition","Animation","Audio","Particles","Video","Link","Create","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional"],KeyDown:["Transition","Animation","Audio","Particles","Video","Link","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional"],KeyUp:["Transition","Animation","Audio","Particles","Video","Link","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional"],KeyPress:["Transition","Animation","Audio","Particles","Video","Link","Create","SwitchCamera","Reset","SetVariable","DynamicVariablePlay","Conditional"],GameControl:["Transition","Animation","Audio","Particles","Create","Conditional"],Collision:["Transition","Animation","Audio","Particles","Video","Create","Destroy","Reset","SetVariable","DynamicVariablePlay","Conditional"],Trigger:["Transition","Audio","Particles","Video","Link","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional"],Resize:["Transition","Animation","Audio","Particles","Video","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional"],VariableChange:["Transition","Animation","Audio","Particles","Video","Link","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional"]};(e=>{e.is=function(e){return"MouseDown"===e.type||"MouseUp"===e.type||"MousePress"===e.type||"KeyDown"===e.type||"KeyUp"===e.type||"KeyPress"===e.type},e.defaultData=function(e){return"MouseDown"===e||"MouseUp"===e||"MousePress"===e?{type:e,mode:"Object",disabled:!1,runMode:"Once",actions:new lV}:{type:e,disabled:!1,key:void 0,runMode:"Once",actions:new lV}}})(vG||(vG={})),(e=>{e.propertyDefaultData=function(e){return{type:"Property",value:[null!==e&&void 0!==e?e:null,"position","x"]}},e.valueDefaultData={type:"Literal",value:0}})(yG||(yG={})),(e=>{e.comparisonDefaultData=function(e){return{type:"Comparison",operator:"==",lOperand:yG.propertyDefaultData(e),rOperand:{...yG.valueDefaultData}}},e.distanceDefaultData=function(e){return{type:"Distance",toObject:null!==e&&void 0!==e?e:null,fromObject:null!==e&&void 0!==e?e:null,distance:200}},e.stateDefaultData=function(e,t){return{type:"State",object:null!==e&&void 0!==e?e:null,state:null!==t&&void 0!==t?t:null}}})(bG||(bG={})),(e=>{e.is=function(e){return"Conditional"===e.type},e.defaultData=function(e){return{type:"Conditional",disabled:!1,inActions:new lV,outActions:new lV,condition:bG.distanceDefaultData(e)}}})(xG||(xG={})),(e=>{e.defaultData={type:"DragDrop",cursor:"hand",disabled:!1,dampingFactor:1,objects:[],snapTo:"center",snapSurfaceMode:"bbox",snapSurfaceOffset:0,dropOn:"all",autoOrient:!0,dropDestinations:[],plane:"adaptive",planeMode:"locked",referenceFrame:"global",limits:[-1/0,1/0,-1/0,1/0,-1/0,1/0],drop:!1,resetOnSnapFail:!1,snapSpeed:20,resetSpeed:20,dragDropActions:{drag:new lV,drop:new lV}}})(wG||(wG={})),(e=>{e.defaultData={type:"Follow",disabled:!1,maxDelta:0,dampingFactor:1,target:"cursor",plane:"custom",resetOnPointerLeave:!0,resetAfterDistanceLimit:!0,enabledTranslation:[!0,!0,!0],limitDistanceEnabled:!1,limitDistance:1e3,snapDelay:0,resetSpeed:5,actions:new lV}})(_G||(_G={})),(e=>{e.defaultData={type:"LookAt",disabled:!1,distance:1e3,dampingFactor:1,target:"cursor",tilt:"up",axis:"z",plane:"custom",resetOnPointerLeave:!0,resetAfterDistanceLimit:!0,enabledRotation:[!0,!0,!0],limitDistanceEnabled:!1,limitDistance:1e3,snapDelay:0,resetSpeed:5}})(SG||(SG={})),(e=>{e.is=function(e){return"MouseHover"===e.type},e.defaultData=function(){return{type:"MouseHover",disabled:!1,actions:new lV}}})(EG||(EG={})),(e=>{e.is=function(e){return"Scroll"===e.type},e.defaultData=function(){return{type:"Scroll",disabled:!1,steps:100,trigger:"load",startFrom:"enter",enterAnchor:"top",startOffset:0,endAfter:400,actions:new lV}}})(CG||(CG={})),(e=>{e.is=function(e){return"Start"===e.type},e.defaultData=function(){return{type:"Start",disabled:!1,actions:new lV}}})(AG||(AG={})),(e=>{e.is=function(e){return"Collision"===e.type},e.defaultData=function(){return{type:"Collision",disabled:!1,runMode:"Once",target:"character",actions:new lV}}})(MG||(MG={})),(e=>{e.is=function(e){return"Trigger"===e.type},e.defaultData=function(e,t){return{type:"Trigger",disabled:!1,runMode:"Once",target:"all",triggeringObjects:[],actions:new lV,triggerZone:"box",position:t.toArray(),rotation:[0,0,0],size:e.toArray(),radius:e.length()/2,helperVisible:!0}}})(TG||(TG={})),(e=>{e.defaultSizes={mobile:[480,480],tablet:[768,768],desktop:[1200,1200],custom:[769,1200]},e.is=function(e){return"Resize"===e.type},e.sizeToDevice=function(e){return"string"==typeof e?e:"custom"},e.deviceToSize=function(t){return"string"==typeof t?[...e.defaultSizes[t]]:[...t]},e.defaultData=function(){let t={size:"mobile",operator:"<",actions:new lV},i={size:"tablet",operator:"<",actions:new lV},n={size:[...e.defaultSizes.custom],operator:"<>",actions:new lV},r=new lV;return r.push({id:cA.generateUUID(),fi:0,data:t},{id:cA.generateUUID(),fi:1,data:i},{id:cA.generateUUID(),fi:2,data:n}),{type:"Resize",disabled:!1,orientation:"horizontal",breakpoints:r}},e.defaultBreakpointData=function(){return{size:[...e.defaultSizes.custom],operator:"<>",actions:new lV}}})(PG||(PG={})),(e=>{e.propertyPaths={Position:["position"],"Position X":["position","x"],"Position Y":["position","y"],"Position Z":["position","z"],Rotation:["rotation"],"Rotation X":["rotation","x"],"Rotation Y":["rotation","y"],"Rotation Z":["rotation","z"],Scale:["scale"],"Scale X":["scale","x"],"Scale Y":["scale","y"],"Scale Z":["scale","z"],Width:["width"],Height:["height"],Depth:["depth"],"Mouse Position X":["mouse","x"],"Mouse Position Y":["mouse","y"],"Mouse Pressed":["mouse","pressed"],"Screen Width":["mouse","width"],"Screen Height":["mouse","height"],"Hit Position X":["raycast","x"],"Hit Position Y":["raycast","y"],"Hit Position Z":["raycast","z"],"Hit Object Position X":["raycast","objX"],"Hit Object Position Y":["raycast","objY"],"Hit Object Position Z":["raycast","objZ"]},e.is=function(e){return"VariableChange"===e.type},e.defaultData=function(){return{disabled:!1,type:"VariableChange",actions:new lV,variableId:"",objectId:null,property:"Position X"}}})(DG||(DG={}));var OG,IG,RG,LG,BG,zG,NG,FG,jG,VG,UG,GG,HG,WG,qG="personal camera",XG="a218fcc3-276b-49b9-b485-49037fd14f5f",YG=5526619;function QG(e){return"string"==typeof e&&36===e.length&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)}(e=>{function t(e,t){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)}function i(e,i){return Math.sqrt(t(e,i))}function n(t,i,n){let r=e.sub(i,t),a=e.sub(n,t),s=e.dot(r,a)/e.dot(r,r),o=e.scalarMultiply(r,s);return e.add(t,o)}e.isEqual=function(e,t){return e[0]===t[0]&&e[1]===t[1]},e.lerp=function(e,t,i){return[e[0]+(t[0]-e[0])*i,e[1]+(t[1]-e[1])*i]},e.add=function(e,t){return[e[0]+t[0],e[1]+t[1]]},e.sub=function(e,t){return[e[0]-t[0],e[1]-t[1]]},e.multiply=function(e,t){return[e[0]*t[0],e[1]*t[1]]},e.divide=function(e,t){return[e[0]/t[0],e[1]/t[1]]},e.distanceSquared=t,e.distance=i,e.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]},e.scalarMultiply=function(e,t){return[e[0]*t,e[1]*t]},e.projectionOnto=n,e.projectionOntoDistance=function(e,t,r){return i(e,n(e,t,r))},e.center=function(e,t){return[.5*(e[0]+t[0]),.5*(e[1]+t[1])]}})(OG||(OG={})),(e=>{e.isEqual=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},e.add=function(e,t){return[e[0]+t[0],e[1]+t[1],e[2]+t[2]]},e.sub=function(e,t){return[e[0]-t[0],e[1]-t[1],e[2]-t[2]]},e.div=function(e,t){return[e[0]/t[0],e[1]/t[1],e[2]/t[2]]},e.mul=function(e,t){return[e[0]*t[0],e[1]*t[1],e[2]*t[2]]},e.dist=function(e,t){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])},e.lerp=function(e,t,i){return[e[0]+(t[0]-e[0])*i,e[1]+(t[1]-e[1])*i,e[2]+(t[2]-e[2])*i]}})(IG||(IG={})),(e=>{e.isEqual=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},e.lerp=function(e,t,i){return[e[0]+(t[0]-e[0])*i,e[1]+(t[1]-e[1])*i,e[2]+(t[2]-e[2])*i,e[3]+(t[3]-e[3])*i]}})(RG||(RG={})),(e=>{e.identity=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e.isEqual=function(e,t){for(let i=0;i<16;i++)if(e[i]!==t[i])return!1;return!0},e.simplify=function(t){return null!==t&&void 0!==t?t:e.identity},e.applyMatrix4=function(e,t){let i=t.slice(0);for(var n=0,r=t.length;n<r;n+=3){let r=e[3]*t[n]+e[7]*t[n+1]+e[11]*t[n+2]+e[15];i[n]=(e[0]*t[n]+e[4]*t[n+1]+e[8]*t[n+2]+e[12])/r,i[n+1]=(e[1]*t[n]+e[5]*t[n+1]+e[9]*t[n+2]+e[13])/r,i[n+2]=(e[2]*t[n]+e[6]*t[n+1]+e[10]*t[n+2]+e[14])/r}return i}})(LG||(LG={})),(e=>{e.isRGB=function(e){return"object"==typeof e&&"number"==typeof e.r&&"number"==typeof e.g&&"number"==typeof e.b},e.white={r:1,g:1,b:1},e.red={r:1,g:0,b:0},e.black={r:0,g:0,b:0},e.toRgb255a1=function(e){return{r:Math.round(255*e.r),g:Math.round(255*e.g),b:Math.round(255*e.b),a:1}},e.clone=function(e){return{r:e.r,g:e.g,b:e.b}},e.fromHex=function(e){return{r:((e=Math.floor(e))>>16&255)/255,g:(e>>8&255)/255,b:(255&e)/255}},e.toHex=function(e){return 65536*Math.round(255*e.r)+256*Math.round(255*e.g)+Math.round(255*e.b)},e.equals=function(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b},e.equalsFixed=function(e,t){return e.r.toFixed(2)===t.r.toFixed(2)&&e.g.toFixed(2)===t.g.toFixed(2)&&e.b.toFixed(2)===t.b.toFixed(2)},e.lerp=function(e,t,i){return{r:e.r+(t.r-e.r)*i,g:e.g+(t.g-e.g)*i,b:e.b+(t.b-e.b)*i}}})(BG||(BG={})),(e=>{e.white={...BG.white,a:1},e.transparent={...BG.white,a:0},e.from0to1=function(e){return{r:e[0],g:e[1],b:e[2],a:e[3]}},e.fromHexAndA=function(e,t){return{...BG.fromHex(e),a:t}},e.toRgb255a1=function(e){return{r:Math.round(255*e.r),g:Math.round(255*e.g),b:Math.round(255*e.b),a:e.a}},e.equals=function(e,t){return BG.equals(e,t)&&e.a===t.a},e.equalsFixed=function(e,t){return BG.equalsFixed(e,t)&&e.a.toFixed(2)===t.a.toFixed(2)},e.lerp=function(e,t,i){return{r:e.r+(t.r-e.r)*i,g:e.g+(t.g-e.g)*i,b:e.b+(t.b-e.b)*i,a:e.a+(t.a-e.a)*i}},e.toStyle=function(){let{r:t,g:i,b:n,a:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.white;return"rgba(".concat(255*t,", ").concat(255*i,", ").concat(255*n,", ").concat(r,")")}})(zG||(zG={})),(e=>{e.identity={position:[0,0,0],rotation:[0,0,0],scale:[1,1,1]}})(NG||(NG={})),(e=>{e.defaultData={mass:1,stiffness:80,damping:10,velocity:0}})(FG||(FG={})),(e=>{e.defaultData={control1:[.5,0],control2:[.5,1]}})(jG||(jG={})),(e=>{e.linear=[0,0,1,1],e.ease=[.25,.1,.25,1],e.easeIn=[.42,0,1,1],e.easeOut=[0,0,.58,1],e.easeInOut=[.42,0,.58,1]})(VG||(VG={})),(e=>{e.all=["PerspectiveCamera","OrthographicCamera"],e.is=function(t){return e.all.includes(t)}})(UG||(UG={})),(e=>{e.DefaultUp=[0,1,0],e.DefaultTargetOffset=1e3,e.defaultData={far:1e5,type:"OrthographicCamera",perspective:{near:70,fov:45,zoom:1},orthographic:{near:-1e5,zoom:1},up:e.DefaultUp,isUpVectorFlipped:!1,targetOffset:e.DefaultTargetOffset},e.getZoom=function(e){return"PerspectiveCamera"===e.type?e.perspective.zoom:e.orthographic.zoom}})(GG||(GG={})),(e=>{e.defaultData=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.1;return{disabled:!1,type:"linear",hideBase:!1,count:3,radial:{radius:2*Math.max(e[0],e[1]),start:0,end:360,alignment:!1,axis:"y",scale:[1,1,1],rotation:[0,0,0],position:[0,0,0]},toObject:{object:"",spreadType:"random",scale:[0,0,0],rotation:[0,0,0],position:[0,0,0],axis:"x",seed:0,count:99,align:"normal"},linear:{scale:[1,1,1],rotation:[0,0,0],position:[e[0]+e[0]*t,0,0]},grid:{count:[2,2,2],size:e.map((e=>e*(1+t))),useCenter:!0},randomness:!1,randomnessObject:{strength:100,scale:[0,0,0],rotation:[0,0,0],position:[0,0,0],movement:1,seed:0,freqScale:10,noiseType:"perlin"}}},e.merge=function(e,t){let i={...e};if(oH.forEach((n=>{var r;Object.assign(i,{[n]:null!==(r=t[n])&&void 0!==r?r:e[n]})})),i.radial={...e.radial},t.radial){let n=e.radial,r=t.radial;lH.forEach((e=>{var t;Object.assign(i.radial,{[e]:null!==(t=r[e])&&void 0!==t?t:n[e]})}))}if(i.linear={...e.linear},t.linear){let n=e.linear,r=t.linear;cH.forEach((e=>{var t;Object.assign(i.linear,{[e]:null!==(t=r[e])&&void 0!==t?t:n[e]})}))}if(i.grid={...e.grid},t.grid){let n=e.grid,r=t.grid;hH.forEach((e=>{var t;Object.assign(i.grid,{[e]:null!==(t=r[e])&&void 0!==t?t:n[e]})}))}if(i.toObject={...e.toObject},t.toObject){let n=e.toObject,r=t.toObject;uH.forEach((e=>{var t;Object.assign(i.toObject,{[e]:null!==(t=r[e])&&void 0!==t?t:n[e]})}))}if(i.randomnessObject={...e.randomnessObject},t.randomnessObject){let n=e.randomnessObject,r=t.randomnessObject;dH.forEach((e=>{var t;Object.assign(i.randomnessObject,{[e]:null!==(t=r[e])&&void 0!==t?t:n[e]})}))}return i}})(HG||(HG={})),(e=>{e.defaultData={radial:{},linear:{},grid:{},toObject:{},randomnessObject:{}};let t=["radial","linear","grid","toObject","randomnessObject"];e.toOps=function(e,i){let n=[];void 0!==e.count&&n.push({type:0,path:i,props:{count:e.count}});for(let r of t){let t=e[r];t&&Object.keys(t).length>0&&n.push({type:0,path:[...i,r],props:t})}return n}})(WG||(WG={}));var ZG,KG,JG,$G,eH,tH,iH,nH,rH,aH,sH,oH=["count"],lH=["radius","start","end","position","scale","rotation"],cH=["position","scale","rotation"],hH=["count","size"],uH=["count","position","scale","rotation"],dH=["strength","scale","rotation","position","movement","seed","freqScale"];(e=>{e.all=["PointLight","SpotLight","DirectionalLight","HemisphereLight"],e.is=function(t){return e.all.includes(t)}})(ZG||(ZG={})),(e=>{e.defaultData=function(e){return function(e){if("PointLight"===e)return{type:e,color:zG.white,intensity:1,distance:2e3,decay:1,shadows:!0,shadowResolution:1024,shadowRadius:1,penumbraSize:.5,depth:1e5};if("SpotLight"===e)return{type:e,color:zG.white,intensity:1,distance:2e3,decay:1,shadows:!0,penumbra:0,angle:30/180*Math.PI,depth:1e5,penumbraSize:.5,shadowResolution:1024,shadowRadius:1};if("DirectionalLight"===e)return{type:e,color:zG.white,intensity:1,shadows:!0,size:2e3,depth:1e5,penumbraSize:.5,shadowResolution:1024,shadowRadius:1};throw new Error("not implemented")}(e)}})(KG||(KG={})),(e=>{e.defaultShapeData={type:"PlaneEmitterShape",size:[100,100,100]},e.defaultCollisionData={colliderEntityId:null,collisionBounce:.75},e.defaultData={renderMaterial:{type:"particleMaterial",color:{r:1,g:.2,b:.545,a:1},color2:{r:.945,g:.714,b:.184,a:1},coloring:"gradient",ease:"linearFadeOut",easeSize:"linearFadeOut",transparent:!0,size:[40,40],texture:"pt_default_particle",spriteRotation:[0,0]},birthRatePerSec:50,gravity:1,noiseStrength:0,noiseScale:0,noiseSeed:1,noiseType:"curl",randomRotation:0,randomScale:.2,randomMass:.5,rootObjectType:"instancedMesh",life:1,direction:[0,0,0],directionMode:"axis",speed:10,shape:e.defaultShapeData,autoPlay:!0,emitTimeDelay:0,emitTimeCycle:"infinity",emitTimeLoopDelayStart:"end",emitTimeDuration:1,...e.defaultCollisionData}})(JG||(JG={})),(e=>{e.defaultData={enabled:"visibility",fusedBody:!0,rigidBody:"positioned",density:1,pointMass:0,gravityScale:1,friction:.5,damping:0,restitution:.2,colliderType:"convex",enabledRotation:[!0,!0,!0],enabledTranslation:[!0,!0,!0]}})($G||($G={})),(e=>{e.defaultData={castShadow:!0,receiveShadow:!0},e.equals=function(e,t){return e.castShadow===t.castShadow&&e.receiveShadow===t.receiveShadow}})(eH||(eH={})),(e=>{e.defaultData={flatShading:!1,wireframe:!1,side:0},e.equals=function(e,t){return e.flatShading===t.flatShading&&e.side===t.side&&e.wireframe===t.wireframe}})(tH||(tH={})),(e=>{e.defaultData={...tH.defaultData,...eH.defaultData}})(iH||(iH={})),(e=>{e.getMaterialData=function(e,t){let i=[];if("material"in e){var n,r;let a="string"==typeof e.material?null!==(n=t.materials[e.material])&&void 0!==n?n:null===(r=t.lib.materials[e.material])||void 0===r?void 0:r.asset:e.material;a&&i.push(a)}else if("materials"in e)for(let o of e.materials){var a,s;let e="string"==typeof o?null!==(a=t.materials[o])&&void 0!==a?a:null===(s=t.lib.materials[o])||void 0===s?void 0:s.asset:o;e&&i.push(e)}return i}})(nH||(nH={})),(e=>{e.defaultVideo={data:"",thumb:"/_assets/_videos/catThumb.png",type:"video",name:"Cat video"},e.maxSize=3e7})(rH||(rH={})),(e=>{e.is=function(e){return"texture"===e||"video"===e||"color"===e||"depth"===e||"normal"===e||"gradient"===e||"noise"===e||"fresnel"===e||"rainbow"===e||"toon"===e||"outline"===e||"particle"===e||"transmission"===e||"matcap"===e||"displace"===e||"pattern"===e||"light"===e}})(aH||(aH={})),(e=>{e.is=function(e){return"phong"===e||"toon"===e||"lambert"===e||"physical"===e}})(sH||(sH={}));var pH,fH,mH,gH,vH=["mode","gradientType","noiseType","displacementType","projection","cnormal","crop","axis","side"],yH=["wrapping","image","video","name","minFilter"];(e=>{e.patch=function(e,t){let{texture:i,...n}=t;if(Object.assign(e,n),i){let t=e.texture;t&&Object.assign(t,i)}},e.defaultData=function(e,t){return"light"===e&&t?function(e){let t={mode:0,isMask:!1,visible:!0,bumpMap:void 0,bumpMapIntensity:5,roughnessMap:void 0,alphaOverride:1};switch(e){case"phong":return{...t,category:"phong",specular:{r:.2,g:.2,b:.2},shininess:5,type:"light",visible:!0,mode:0,occlusion:!0,alpha:.6};case"toon":return{...t,category:"toon",specular:{r:.2,g:.2,b:.2},shininess:10,type:"light",alpha:1};case"lambert":return{...t,category:"lambert",emissive:{r:0,g:0,b:0},type:"light",alpha:1,visible:!0,mode:0,occlusion:!0};case"physical":return{...t,category:"physical",roughness:.2,metalness:.2,reflectivity:.2,type:"light",alpha:1,visible:!0,mode:0,occlusion:!0}}}(t):function(e){let t={alpha:1,mode:0,isMask:!1,visible:!0};switch(e){case"texture":return{...t,type:"texture",size:[128,128],blending:0,axis:"x",side:2,projection:0,texture:{image:"image_0",wrapping:1e3,repeat:[1,1],offset:[0,0],minFilter:1008},crop:!1};case"video":return{...t,type:"video",size:[128,128],blending:0,axis:"x",side:2,projection:0,texture:{video:rH.defaultVideo,wrapping:1001,repeat:[1,1],offset:[0,0],minFilter:1008},crop:!1};case"color":return{...t,type:"color",color:BG.fromHex(YG)};case"depth":return{...t,type:"depth",gradientType:1,smooth:!1,isVector:!0,isWorldSpace:!1,origin:[0,0,0],direction:[1,0,0],colors:[[1,1,1,1],[0,0,0,1]],steps:[0,1],near:50,far:200};case"normal":return{...t,type:"normal",cnormal:[1,1,1]};case"gradient":return{...t,type:"gradient",gradientType:0,smooth:!1,colors:[[0,0,0,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1]],steps:[0,1,1,1,1,1,1,1,1,1],num:2,angle:0,offset:[0,0],morph:[0,0]};case"noise":return{...t,type:"noise",size:[100,100,100],noiseType:0,scale:1,move:1,colorA:{...BG.fromHex(6710886),a:1},colorB:{...BG.fromHex(6710886),a:1},colorC:{...BG.fromHex(16777215),a:1},colorD:{...BG.fromHex(16777215),a:1},distortion:[1,1],fA:[1.7,9.2],fB:[8.3,2.8],voronoiStyle:0,highCut:1,lowCut:0,smoothness:.3,seed:0,quality:1};case"fresnel":return{...t,type:"fresnel",color:zG.fromHexAndA(16777215,1),bias:.1,scale:1,intensity:2,factor:1};case"rainbow":return{...t,type:"rainbow",filmThickness:30,movement:0,wavelengths:[0,0,0],noiseStrength:0,noiseScale:1,offset:[0,0,0]};case"toon":return{...t,type:"toon",positioning:2,colors:[[0,0,0,1],[.5,.5,.5,1],[.5,.5,.5,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1]],steps:[0,.475,.525,1,1,1,1,1,1,1],num:4,source:[0,1e3,0],isWorldSpace:!0,noiseStrength:0,noiseScale:1,shadowColor:zG.fromHexAndA(0,0),offset:[0,0,0]};case"outline":return{...t,type:"outline",outlineColor:zG.fromHexAndA(0,1),contourColor:zG.fromHexAndA(0,1),outlineWidth:2,contourWidth:5,outlineThreshold:.4,contourThreshold:0,outlineSmoothing:0,contourFrequency:10,contourDirection:[0,1,0],positionalLines:!1,compensation:!0};case"matcap":return{...t,type:"matcap",texture:{image:"matcap_0",wrapping:1001,repeat:[1,1],offset:[0,0],minFilter:1008}};case"transmission":return{...t,type:"transmission",thickness:10,ior:1.5,roughness:1};case"displace":return{visible:!0,type:"displace",displacementType:"noise",noiseType:0,scale:10,movement:1,offset:[0,0,0],intensity:8,voronoiStyle:0,smoothness:.3,seed:0,highCut:1,lowCut:0,quality:1};case"pattern":return{...t,type:"pattern",style:0,projection:0,axis:"y",blending:0,offset:[0,0],colorA:{...BG.fromHex(0),a:1},colorB:{...BG.fromHex(16777215),a:1},frequency:[10,10],size:.5,variation:0,smoothness:.5,zigzag:0,rotation:0,vertical:[0,1],horizontal:[0,1],sides:6}}}(e)}})(pH||(pH={})),(e=>{function t(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"layer1",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"layer2",n=new lV;return n.push({fi:0,data:pH.defaultData("light",e),id:t}),n.push({fi:1,data:pH.defaultData("color"),id:i}),{layers:n}}e.isMergable=function(e){return!e.layers.some((e=>"texture"===e.data.type&&0!==e.data.projection||"depth"===e.data.type&&!e.data.isWorldSpace||"noise"===e.data.type||"displace"===e.data.type))},e.getHash=function(e){let t="";return e.layers.forEach((e=>{Object.entries(e.data).forEach((e=>{let[i,n]=e;t+="".concat(i).concat(n),Array.isArray(n)?n.forEach((e=>t+="".concat(e))):"object"==typeof n?Object.values(n).forEach((e=>{t+="".concat("number"==typeof e?e.toFixed(4):e)})):t+="".concat(n)}))})),t},e.defaultEmptyData=function(){return{layers:new lV}},e.defaultData=function(){return t("phong",arguments.length>0&&void 0!==arguments[0]?arguments[0]:"layer1",arguments.length>1&&void 0!==arguments[1]?arguments[1]:"layer2")},e.withName=function(e,t){return{...e,name:t}},e.defaultTwoLayerData=t,e.defaultUIObjectMaterial=function(e){let t=pH.defaultData("texture");e&&Object.assign(t.texture,{image:e});let i=new lV;return i.push({fi:0,data:t,id:"layer1"}),i.push({fi:1,data:{...pH.defaultData("transmission"),alpha:1},id:"layer2"}),i.push({fi:2,data:{...pH.defaultData("light","lambert"),alpha:0},id:"layer3"}),{layers:i}},e.defaultTwoLayerTextureData=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"phong",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"layer1",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"layer2",r=pH.defaultData("texture");Object.assign(r.texture,{image:e});let a=new lV;return a.push({fi:0,data:r,id:i}),a.push({fi:1,data:pH.defaultData("light",t),id:n}),{layers:a}},e.defaultTwoLayerVideoTextureData=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"phong",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"layer1",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"layer2",r=pH.defaultData("video");Object.assign(r.texture,{video:e});let a=new lV;return a.push({fi:0,data:r,id:i}),a.push({fi:1,data:pH.defaultData("light",t),id:n}),{layers:a}}})(fH||(fH={})),(e=>{e.defaultData=function(){return{points:new lV,roundness:0,shapeHoles:[],isClosed:!1}}})(mH||(mH={})),(e=>{e.defaultData=function(){return{points:new lV,lastInsertionPlane:null,subdivisions:12,isClosed:!1}}})(gH||(gH={}));var bH,xH={type:"Ellipse",width:50,height:50,spikes:16,angle:360,innerRadius:0};(e=>{e.merge=function(e,t){let i={...e};return CH.forEach((n=>{var r;Object.assign(i,{[n]:null!==(r=t[n])&&void 0!==r?r:e[n]})})),i}})(bH||(bH={}));var wH,_H,SH,EH={shape:xH,depth:1,offset:0,bevel:50,bevelSides:6,angle:0,twist:0,startScale:1,endScale:1,capType:"flat"},CH=["depth","offset","angle","twist","startScale","endScale"];(e=>{e.is2DParametricMesh=function(e){return"PolygonGeometry"===e||"RectangleGeometry"===e||"StarGeometry"===e||"TriangleGeometry"===e||"EllipseGeometry"===e||"UIGeometry"===e},e.isParametricMesh=function(e){return"PolygonGeometry"===e||"PolygonGeometry"===e||"RectangleGeometry"===e||"StarGeometry"===e||"TriangleGeometry"===e||"EllipseGeometry"===e||"PathGeometry"===e||"VectorGeometry"===e||"ConeGeometry"===e||"CubeGeometry"===e||"CylinderGeometry"===e||"DodecahedronGeometry"===e||"HelixGeometry"===e||"IcosahedronGeometry"===e||"LatheGeometry"===e||"PyramidGeometry"===e||"SphereGeometry"===e||"PlaneGeometry"===e||"BackdropGeometry"===e||"TorusGeometry"===e||"TorusKnotGeometry"===e||"BooleanGeometry"===e||"TextGeometry"===e}})(wH||(wH={})),(e=>{e.merge=function(e,t){let i={...e};return Object.assign(i,t),"PathGeometry"===i.type&&"extrusion"in t&&t.extrusion&&(i.extrusion={...e.extrusion},Object.assign(i.extrusion,bH.merge(i.extrusion,t.extrusion))),i}})(_H||(_H={})),(e=>{e.defaultData=function(e){if("RectangleGeometry"===e)return{width:320,height:320,type:e,cornerRadius:[0,0,0,0],cornerType:0,depth:0,extrudeBevelSize:0,extrudeBevelSegments:1};if("UIGeometry"===e)return{type:e,frame:"",cornerRadius:[0,0,0,0],cornerType:0,width:1,height:1};if("PathGeometry"===e)return{type:e,width:1,height:1,depth:1,path:gH.defaultData(),extrusion:EH};if("VectorGeometry"===e)return{width:1,height:1,type:e,subdivisions:12,shape:mH.defaultData(),depth:0,extrudeBevelSize:0,extrudeBevelSegments:1};if("BooleanGeometry"===e)return{type:e,operation:2,width:0,height:0,depth:0,phongAngle:35};if("TextGeometry"===e)return{type:e,width:100,height:100,depth:0,horizontalAlign:1,verticalAlign:1,fontSize:16,lineHeight:1.2,letterSpacing:0,text:{textValue:""},textTransform:1,font:"Roboto_regular",extrudeBevelSize:0,extrudeBevelSegments:1};if("SphereGeometry"===e)return{type:"SphereGeometry",width:100,height:100,depth:100,widthSegments:64,heightSegments:64,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:180};throw new Error("not implemented")}})(SH||(SH={}));var AH,MH,TH,PH,DH,kH,OH,IH,RH,LH,BH,zH,NH,FH,jH,VH,UH,GH,HH,WH,qH,XH,YH,QH,ZH,KH,JH,$H,eW,tW,iW,nW,rW,aW,sW,oW,lW,cW,hW,uW,dW,pW=["width","height","depth"];function fW(e){e.layers.forEach((e=>{if("depth"===e.type&&void 0!==e.colorA){let t=e.colorA,i=e.colorB,n=[[t.r,t.g,t.b,t.a],[i.r,i.g,i.b,i.a]],r=[0,1];for(let e=2;e<10;e++)n.push(n[1]),r.push(1);let a={...wj(jV(e),"type","visible","isVector","isWorldSpace","origin","alpha","mode"),near:Math.max(0,e.near),far:Math.max(0,e.far),colors:n,steps:r,num:2,direction:[1,0,0],smooth:!1,gradientType:1};Object.assign(e,a)}else if("depth"===e.type&&1===e.gradientType&&(e.near<0||e.far<0)){let t={...jV(e),near:Math.max(e.near,0),far:Math.max(e.far,0)};Object.assign(e,t)}}))}function mW(e,t){Object.values(e.shared.materials).forEach((e=>t(e)))}function gW(e,t){e.scene.objects.traverse(((e,i)=>{"materials"in i?i.materials.forEach(((e,n)=>{void 0===e&&(i.materials[n]=fH.defaultData(),e=i.materials[n]),"string"!=typeof e&&t(e)})):"material"in i?"string"!=typeof i.material&&(void 0===i.material&&(i.material=fH.defaultData()),t(i.material)):"Mesh"===i.type&&(void 0===i.material&&(i.material=fH.defaultData()),t(i.material)),"overrides"in i&&Object.values(i.overrides).forEach((e=>{e.material&&"string"!=typeof e.material&&Object.getPrototypeOf(e.material)!==fV.prototype&&t(e.material)}))}))}function vW(e){void 0===e.layers&&Object.assign(e,fH.defaultTwoLayerData("lambert"))}function yW(e){!e.layers||e.layers.forEach((e=>{if("depth"===e.type&&10===e.colors.length){let t=[...e.colors];t.push(e.colors[9]);let i=[...e.steps];i.push(e.steps[9]);let n={...jV(e),colors:t,steps:i};Object.assign(e,n)}}))}function bW(e){e.scene.objects.traverse(((e,t)=>{"materials"in t?t.materials.forEach((e=>{"string"!=typeof e&&yW(e)})):"material"in t&&"string"!=typeof t.material&&yW(t.material)})),Object.values(e.shared.materials).forEach((e=>yW(e)))}function xW(e){e.layers&&e.layers.forEach((e=>{"depth"===e.type&&void 0!==e.num&&(e.colors=e.colors.slice(0,e.num),e.steps=e.steps.slice(0,e.num),delete e.num)}))}function wW(e){e.layers&&e.layers.forEach((e=>{(function(e){return"displace"!==e.type})(e)&&void 0===e.isMask&&(e.isMask=!1),("texture"===e.type||"video"===e.type)&&void 0===e.blending&&(e.blending=0),("noise"===e.type||"displace"===e.type&&"noise"===e.displacementType)&&(void 0===e.voronoiStyle&&(e.voronoiStyle=0),void 0===e.highCut&&(e.highCut=1),void 0===e.lowCut&&(e.lowCut=0),void 0===e.smoothness&&(e.smoothness=.3),void 0===e.seed&&(e.seed=0),void 0===e.quality&&(e.quality=1))}))}function _W(e){var t;let i=null===(t=e.layers.find((e=>"light"===e.type)))||void 0===t?void 0:t.data;if("basic"===(null===i||void 0===i?void 0:i.category)){let e=pH.defaultData("light","phong"),t=i;Object.assign(t,e),t.visible=!1}}function SW(e){mW(e,_W),gW(e,_W)}function EW(e){e.layers.forEach((e=>{"light"===e.type&&"toon"!==e.category&&void 0===e.occlusion&&(e.occlusion=!0)}))}function CW(e){e.layers&&e.layers.forEach((e=>{"light"===e.type&&void 0===e.bumpMapIntensity&&(e.bumpMapIntensity=5)}))}function AW(e,t){if(t<1&&(gW(e,fW),mW(e,fW),e.schema=1),t<2&&(function(e){Object.assign(e.scene.publish,{orbitControls:{...ZH.defaultData,...jV(e.scene.publish.orbitControls)}})}(e),e.schema=2),t<3&&(function(e){function t(e){if(e.layers)for(let t of Object.values(e.layers))if(t)for(let[e,i]of Object.entries(t))if((vH.includes(e)||"boolean"==typeof i)&&delete t[e],"texture"===e)for(let[t,n]of Object.entries(i))(yH.includes(t)||"boolean"==typeof n)&&delete i[t]}e.scene.objects.traverse(((e,i)=>{i.states.forEach((e=>{let i=e;i.material?t(i.material):i.materials&&i.materials.forEach((e=>{t(e)}))}))}))}(e),e.schema=3),t<4&&(function(e){e.scene.publish.withBackground=!0}(e),e.schema=4),t<5&&(function(e){e.scene.publish.settings.web={compress:!0,preload:!0,preset:1,logo:!0,hint:!1}}(e),e.schema=5),t<6&&(function(e){e.scene.objects.traverse(((e,t)=>{let i=t.cloner;i&&(i.radial.scale=i.radial.scale.map((e=>e+1)),i.linear.scale=i.linear.scale.map((e=>e+1)))}))}(e),e.schema=6),t<7&&(function(e){e.scene.objects.traverse(((e,t)=>{let i=t.geometry;i&&("DodecahedronGeometry"===i.type||"IcosahedronGeometry"===i.type)&&(i.detail=Math.round(i.detail))}))}(e),e.schema=7),t<8&&(e.schema=8),t<9&&(bW(e),e.schema=9),t<10&&(function(e){e.scene.objects.traverse(((e,t)=>{"Mesh"===t.type&&("BooleanGeometry"===t.geometry.type||"SubdivGeometry"===t.geometry.type)&&(t.geometry.phongAngle=35)}))}(e),e.schema=10),t<11&&(function(e){e.scene.environment.ambientLight.softShadows=!1,e.scene.environment.ambientLight.softShadowQuality="low",e.scene.objects.traverse(((e,t)=>{("DirectionalLight"===t.type||"SpotLight"===t.type)&&(t.shadowResolution=1024,t.shadowRadius=1,t.depth=1e5)})),e.shared.penumbraSize=new Array(5).fill(.5)}(e),e.schema=11),t<12&&(bW(e),e.schema=12),t<13&&(function(e){e.shared.audios=Ej({},Jj.prototype)}(e),e.schema=13),t<14&&(function(e){let t=e.shared.materials;Object.entries(t).forEach((e=>{let[i,n]=e;if(!n.layers){let e={name:"Untitled Material",layers:[{fi:0,data:{type:"light",category:"phong",alpha:.6,visible:!0,mode:0,specular:{r:.2,g:.2,b:.2},shininess:5},id:"layer1"},{fi:1,data:{type:"color",alpha:1,visible:!0,mode:0,color:{r:.2823529411764706,g:.2823529411764706,b:.30196078431372547}},id:"layer2"}]};Object.assign(t,{[i]:e})}}))}(e),e.schema=14),t<15&&(function(e){Object.entries(jV(e.shared.images)).filter((e=>!1===e[1].asset)).map((e=>e[0])).forEach((t=>{delete e.shared.images[t]})),Object.entries(jV(e.shared.audios)).filter((e=>!1===e[1].asset)).map((e=>e[0])).forEach((t=>{delete e.shared.audios[t]}))}(e),e.schema=15),t<16&&(function(e){e.scene.publish.settings.web.preload=!1}(e),e.schema=16),t<17&&(gW(e,xW),mW(e,xW),e.schema=17),t<18&&(gW(e,vW),mW(e,vW),e.schema=18),t<19&&(function(e){Object.assign(e.scene.publish.settings,{video:{...KH.defaultData.settings.video,...jV(e.scene.publish.settings.video)}})}(e),e.schema=19),t<20&&(function(e){e.shared.fonts=Ej({},Jj.prototype)}(e),function(e){let t=[];e.scene.objects.traverse(((i,n)=>{let r=n;if("TextFrame"===r.type){let n=fH.defaultTwoLayerData("phong"),a="string"==typeof r.color?e.shared.colors[r.color]:r.color;n.layers[1].data.color={r:a.r,g:a.g,b:a.b},n.layers[1].data.alpha=r.alpha;let s=function(e){return e.replace(".typeface","").replace(/optimer/gi,"open sans").replace("space_mono","space mono").replace(/alma_mono/gi,"varela round").replace(/droid_sans_mono/gi,"noto sans mono").replace(/droid_sans|gentilis|gnomon_(simple|foreground)|helvetiker/gi,"roboto").replace(/droid_serif/gi,"roboto slab").replace("_sans"," sans").replace("crimson_text","crimson text").replace("medium_medium","medium").replace("fatface_fatface","fatface").replace("100hairline","thin").replace("200thin","extralight").replace("300light","light").replace("500medium","medium").replace("600semi","semibold").replace("800heavy","extrabold").replace("900black","black").replace(/bodoni_(11|16|24|36|48|72|96)([^_])/gi,"bodoni_$1_$2").replace(/bodoni_(11|16|24|36|48|72|96)/gi,"bodoni moda").replace(/(thin|hairline)(_regular)?/gi,"100").replace(/(extra|ultra)light(_regular)?/gi,"200").replace(/light(_regular)?/gi,"300").replace(/_book|_normal|_roman/gi,"_regular").replace(/medium(_regular)?/gi,"500").replace(/(semi|demi)bold(_regular)?/gi,"600").replace(/(extra|ultra)bold(_regular)?/gi,"800").replace(/bold(_regular)?/gi,"700").replace(/(black|heavy|fatface)(_regular)?/gi,"900").replace(/([1-9]00)_italic/gi,"$1italic").replace(/regularitalic/gi,"italic").replace(/regularitalic/gi,"italic").split(" ").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" ")}(r.font);void 0===e.shared.fonts[s]&&(e.shared.fonts[s]={name:s});let o={name:r.name,...zH.defaultData,...UH.defaultData,flatShading:!1,wireframe:!1,geometry:{...SH.defaultData("TextGeometry"),width:r.width,height:r.height,font:s,depth:0,horizontalAlign:r.horizontalAlign,verticalAlign:r.verticalAlign,fontSize:1.40625*r.fontSize,lineHeight:r.lineHeight/1.40625,letterSpacing:r.letterSpacing-1,text:r.text,textTransform:r.textTransform,extrudeBevelSize:0,extrudeBevelSegments:1},material:n,states:jV(r.states),events:jV(r.events),visible:r.visible,raycastLock:r.raycastLock,position:r.position,rotation:r.rotation,scale:r.scale,hiddenMatrix:r.hiddenMatrix},l=jV(e.scene.objects).parent(i);e.scene.objects.insertAfter(null!==l&&void 0!==l?l:null,i,[{id:i+"new",data:o,children:[]}]),t.push(i)}})),t.forEach((t=>{e.scene.objects.delete(t)}))}(e),e.schema=20),t<21&&(function(e){let t={0:"MouseDown",1:"MouseUp",2:"MouseHover",5:"KeyDown",6:"KeyUp",7:"Start",9:"LookAt",10:"Follow",11:"Scroll",12:"Audio",13:"GameControl"};e.scene.objects.traverse(((e,i)=>{i.events.forEach((e=>{if(t[Number(e.type)])if(Object.assign(e,{type:t[Number(e.type)]}),"Audio"===e.type&&"audioEvent"in e&&(Object.assign(e,{playAudio:e.audioEvent}),delete e.audioEvent),"GameControl"===e.type)Object.assign(e,{gameActions:{idle:new lV,move:new lV,jump:new lV}});else{let t=new lV;Object.assign(e,{actions:t}),("MouseDown"===e.type||"MouseUp"===e.type||"KeyDown"===e.type||"KeyUp"===e.type)&&"url"in e&&t.push({fi:0,id:cA.generateUUID(),data:{type:"Link",url:e.url,delay:0}}),"targets"in e&&(e.targets.forEach(((e,i,n)=>{let r={easing:e.easing,duration:e.duration};6===e.easing?Object.assign(r,wj(e,"mass","stiffness","damping","velocity")):5===e.easing&&Object.assign(r,{control1:{...e.control1},control2:{...e.control2}});let a={repeat:e.repeat?-1:0,delay:e.delay,delayDirection:e.delayDirection,direction:e.cycle&&e.rewind?"pingpong-rewind":e.cycle?"pingpong":"normal"},s={state:e.state,...a,...r},o={allowSlerp:!0,type:"Transition",object:e.object,repeat:0,delay:0,delayDirection:void 0,direction:"normal",tweens:new lV({fi:0,id:cA.generateUUID(),data:{state:void 0,repeat:0,delay:0,delayDirection:void 0,direction:"normal",duration:0,easing:4}},{fi:1,id:cA.generateUUID(),data:s})};t.push({fi:n,id:i,data:o})})),delete e.targets)}}))}))}(e),function(e){e.scene.objects.traverse(((e,t)=>{function i(e,i){let n=new lV,r=[];if(t.events.forEach(((e,t,a)=>{if("Audio"===e.type&&e.trigger===i){let i;r.push(t),"play"===e.interaction?i={...wj(e,"interaction","audio","delay","volume","loop"),triggerAfter:"after"in e?e.after:void 0,toggle:"after"in e?e.toggle:void 0,type:"Audio"}:("pause"===e.interaction||"stop"===e.interaction)&&(i={...wj(e,"interaction","delay","object","playAudio"),type:"Audio"}),i&&n.push({fi:a,id:t,data:i})}})),r.forEach((e=>t.events.delete(e))),n.length){var a;let i=null===(a=t.events.find((t=>t.type===e)))||void 0===a?void 0:a.data;i?"actions"in i&&i.actions.insertBefore(null,n):t.events.insertBefore(null,[{id:cA.generateUUID(),data:{type:e,actions:n}}])}}i("Start","start"),i("MouseDown","mouseDown"),i("MouseUp","mouseUp"),i("KeyDown","keyDown"),i("KeyUp","keyUp")}))}(e),e.schema=21),t<22&&(SW(e),e.schema=22),t<23&&(function(e){e.scene.objects.traverse(((e,t)=>{"Mesh"===t.type&&"SubdivGeometry"===t.geometry.type&&(t.geometry.scaleBaked||(t.geometry.scaleBaked=[1,1,1]))}))}(e),e.schema=23),t<24&&(function(e){e.scene.objects.traverse(((e,t)=>{("Empty"===t.type||"Mesh"===t.type)&&t.cloner&&!t.cloner.randomnessObject&&!t.cloner.toObject&&!t.cloner.randomness&&(t.cloner={...t.cloner,toObject:{object:"",spreadType:"random",scale:[0,0,0],rotation:[0,0,0],position:[0,0,0],axis:"x",seed:0,count:99,align:"normal"},randomness:!1,randomnessObject:{strength:100,scale:[0,0,0],rotation:[0,0,0],position:[0,0,0],movement:1,seed:0,freqScale:10,noiseType:"perlin"}})}))}(e),e.schema=24),(t<25||void 0===e.shared.videos)&&(function(e){e.shared.videos=Ej({},Jj.prototype)}(e),t<25&&(e.schema=25)),t<26&&(function(e){e.scene.objects.traverse(((t,i)=>{let n=e.scene.objects.unproxy().parent(t);if(n){let t=jV(e.scene.objects.data(n));t&&"Mesh"===t.type&&"BooleanGeometry"===t.geometry.type&&"Mesh"===i.type&&(i.visible=!0!==jV(i).booleanExclude)}}))}(e),e.schema=26),t<27&&(function(e){e.scene.objects.traverse(((e,t)=>{if("Mesh"===t.type){let e=t;"NonParametricGeometry"===t.geometry.type?void 0!==e.material&&delete e.material:void 0!==e.materials&&delete e.materials}}))}(e),e.schema=27),t<28&&(SW(e),e.schema=28),t<29&&(function(e){function t(e){Object.setPrototypeOf(e,fV.prototype),e.texture&&Object.setPrototypeOf(e.texture,fV.prototype)}function i(e){Object.setPrototypeOf(e,fV.prototype);for(let i in e)t(e[i])}e.scene.objects.traverse(((e,t)=>{t.states.forEach((e=>{let t=e;if(t.material){let e=jV(t.material).layers;i(e),t.material.layers=e}if(t.materials)for(let n=0;n<t.materials.length;n++){let e=t.materials[n],r=jV(e).layers;i(r),e.layers=r}}))}))}(e),e.schema=29),t<30&&(function(e){e.scene.objects.traverse(((e,t)=>{"Mesh"===t.type&&"NonParametricGeometry"===t.geometry.type&&!("material"in t)&&!("materials"in t)&&(t.material=fH.defaultTwoLayerData("phong"))}))}(e),e.schema=30),t<31&&(function(e){void 0===e.scene.publish.orbitControls.autoZoom&&(e.scene.publish.orbitControls.autoZoom=!1),e.scene.objects.traverse(((e,t)=>{("OrthographicCamera"===t.type||"PerspectiveCamera"===t.type)&&(void 0===t.orthographic.autoZoom&&(t.orthographic.autoZoom=!1),void 0===t.orthographic.autoZoomFrustumSize&&(t.orthographic.autoZoomFrustumSize=790))}))}(e),e.schema=31),t<33&&(function(e){e.scene.objects.traverse(((e,t)=>{void 0===t.pathSnapping&&(t.pathSnapping={pathId:null,slide:0,offset:0,orientation:"tangential"}),void 0===t.pathSnapping.offset&&(t.pathSnapping.offset=0)}))}(e),e.schema=33),t<34&&(function(e){void 0===e.scene.publish.mouseEventTarget&&(e.scene.publish.mouseEventTarget="canvas"),void 0===e.scene.publish.settings.web.hint&&(e.scene.publish.settings.web.hint=!1)}(e),e.schema=34),t<35&&(function(e){let{video:t}=e.scene.publish.settings;"gif"===t.format&&t.fps>48&&(t.fps=15)}(e),e.schema=35),t<36&&(function(e){e.scene.objects.traverse(((e,t)=>{t.events.forEach((e=>{"GameControl"===e.type&&(e.resetYPosition=Math.abs(e.resetYPosition-t.position[1]))}))}))}(e),e.schema=36),t<37&&(function(e){let t=e.scene.environment.usePhysics;e.scene.objects.traverse(((e,i)=>{t&&null===i.physics?i.collision=!1:i.collision="visibility"}))}(e),e.schema=37),t<38&&(gW(e,wW),mW(e,wW),e.schema=38),t<39&&(function(e){e.scene.objects.traverse(((e,t)=>{t.events.forEach((e=>{"GameControl"===e.type&&(e.navmesh=dW.defaultDataThirdPerson.navmesh)}))}))}(e),e.schema=39),t<40&&(function(e){e.scene.styles||(e.scene.styles=eW.defaultData())}(e),e.schema=40),t<41&&(function(e){void 0===e.scene.environment.ambientLight.occlusion&&(e.scene.environment.ambientLight.occlusion=!1),void 0===e.scene.environment.ambientLight.aoFullRes&&(e.scene.environment.ambientLight.aoFullRes=!1),void 0===e.scene.environment.ambientLight.radius&&(e.scene.environment.ambientLight.radius=256),void 0===e.scene.environment.ambientLight.bias&&(e.scene.environment.ambientLight.bias=.5),void 0===e.scene.environment.ambientLight.aoColor&&(e.scene.environment.ambientLight.aoColor={r:.19607843137254902,g:.19607843137254902,b:.19607843137254902}),gW(e,EW),mW(e,EW)}(e),e.schema=41),t<42&&(function(e){e.scene.objects.traverse(((e,t)=>{t.events.forEach((e=>{"GameControl"===e.type&&Object.assign(e.gameActions,{run:new lV})}))}))}(e),e.schema=42),t<43&&(function(e){e.scene.objects.traverse(((e,t)=>{t.events.forEach((e=>{"GameControl"===e.type&&(e.keyAssignments=[...e.keyAssignments,["run","\u21e7"],["none","Ctrl"]])}))}))}(e),e.schema=43),t<99){var i;gW(e,CW),mW(e,CW),null===e.scene.publish.playCamera&&(e.scene.publish.playCamera=qG);let t=jV(e.scene.objects),n=e.scene.objects;e.scene.publish.playPage=XG,n.insertBefore(null,null,[{id:XG,data:{...XH.defaultData,backgroundColor:e.scene.backgroundColor,fog:e.scene.fog,postprocessing:e.scene.postprocessing,ao:wj(e.scene.environment.ambientLight,"occlusion","aoFullRes","radius","bias","aoColor"),publish:{playCamera:e.scene.publish.playCamera,gameControlObject:e.scene.publish.gameControlObject},shadow:wj(e.scene.environment.ambientLight,"softShadowQuality"),globalPhysics:{...kH.defaultData,...wj(e.scene.environment,"usePhysics","gravity")},camera:null!==(i=jV(e.scene.ownerCamera))&&void 0!==i?i:XH.defaultData.camera,name:"Scene"},children:[]}]);for(let e of t)e.id!==iW.TRASH_CAN_ID&&n.move(XG,e.fi,e.id);let r=0,a=0;e.shared.penumbraSize&&e.scene.objects.traverse(((t,i)=>{var n;"DirectionalLight"===i.type?(i.penumbraSize=e.shared.penumbraSize[Math.min(r,2)],r+=1):"SpotLight"===i.type&&(i.penumbraSize=e.shared.penumbraSize[3+Math.min(a,1)],a+=1),(void 0===i.physics||null===i.physics)&&"Instance"!==i.type&&(i.physics={},Object.assign(i.physics,$G.defaultData)),void 0!==i.physics&&null!==i.physics&&(i.physics.enabled=null!==(n=i.collision)&&void 0!==n?n:"visibility",delete i.collision)})),e.schema=99}}function MW(e){e.layers&&e.layers.forEach((e=>{"light"===e.type&&void 0===e.alphaOverride&&(e.alphaOverride=1)}))}(e=>{e.defaultData={enabled:!1,useBackgroundColor:!1,color:BG.white,near:.1,far:2e3}})(AH||(AH={})),(e=>{let t={opacity:1,blendFunction:13,enabled:!1};e.defaultData={enabled:!1,pixelation:{...t,blendFunction:16,granularity:15},bloom:{...t,blendFunction:16,intensity:1,blurScale:1,luminanceThreshold:.25,luminanceSmoothing:.025,kernelSize:3},chromaticAberration:{...t,offset:[2,2]},vignette:{...t,darkness:1,offset:0},hueSaturation:{...t,hue:3,saturation:0},brightnessContrast:{...t,brightness:.25,contrast:0},depthOfField:{...t,focalLength:2,focusDistance:2,bokehScale:2},noise:{...t,blendFunction:16}}})(MH||(MH={})),(e=>{e.defaultData={softShadowQuality:"low"}})(TH||(TH={})),(e=>{e.defaultData={enabled:!0,color:{r:.8274509803921568,g:.8274509803921568,b:.8274509803921568},intensity:.75}})(PH||(PH={})),(e=>{e.defaultData={occlusion:!1,aoFullRes:!1,radius:256,bias:.5,aoColor:{r:.19607843137254902,g:.19607843137254902,b:.19607843137254902}}})(DH||(DH={})),(e=>{e.defaultData={usePhysics:!1,gravity:-10}})(kH||(kH={})),(e=>{e.defaultData={playCamera:qG,gameControlObject:null}})(OH||(OH={})),(e=>{e.defaultData={backgroundColor:zG.fromHexAndA(2960946,1),postprocessing:MH.defaultData,fog:AH.defaultData,globalPhysics:kH.defaultData,ambient:PH.defaultData,ao:DH.defaultData,shadow:TH.defaultData,publish:OH.defaultData}})(IH||(IH={})),(e=>{e.defaultData={colliderType:"box",size:[100,100,100],colliderHelperVisible:!0,forceType:"collider",forceRange:"global",forceIntensity:.5,forceDambing:.95}})(RH||(RH={})),(e=>{e.isComponentRelated=function(e){return"Component"===e||"Instance"===e},e.isEmptyOrComponent=function(e){return"Empty"===e||"Instance"===e}})(LH||(LH={})),(e=>{e.identity={...NG.identity,hiddenMatrix:LG.identity},e.fromObject=function(e){return{position:e.position,rotation:e.rotation,scale:e.scale,hiddenMatrix:e.hiddenMatrix}},e.merge=function(e,t){return{position:(null===t||void 0===t?void 0:t.position)||e.position,rotation:(null===t||void 0===t?void 0:t.rotation)||e.rotation,scale:(null===t||void 0===t?void 0:t.scale)||e.scale,hiddenMatrix:(null===t||void 0===t?void 0:t.hiddenMatrix)||e.hiddenMatrix}},e.diff=function(e,t){return Sj({position:IG.isEqual(e.position,t.position)?void 0:t.position,rotation:IG.isEqual(e.rotation,t.rotation)?void 0:t.rotation,scale:IG.isEqual(e.scale,t.scale)?null:t.scale,hiddenMatrix:LG.isEqual(e.hiddenMatrix,t.hiddenMatrix)?void 0:t.hiddenMatrix})}})(BH||(BH={})),(e=>{e.defaultData={states:new lV,events:new lV,visible:!0,raycastLock:!1,physics:$G.defaultData,pathSnapping:{pathId:null,slide:0,offset:0,orientation:"tangential"},...BH.identity,cloner:null}})(zH||(zH={})),(e=>{e.defaultData={type:"Empty",...zH.defaultData}})(NH||(NH={})),(e=>{e.defaultData={type:"ParticleCollider",...RH.defaultData,...zH.defaultData}})(FH||(FH={})),(e=>{e.defaultData={type:"Component",...zH.defaultData}})(jH||(jH={})),(e=>{e.defaultData={type:"Particle",...zH.defaultData,...JG.defaultData}})(VH||(VH={})),(e=>{e.defaultData={type:"Mesh",...zH.defaultData,...iH.defaultData}})(UH||(UH={})),(e=>{e.defaultData={...zH.defaultData,...BH.identity,position:[0,0,GG.DefaultTargetOffset],...GG.defaultData}})(GH||(GH={})),(e=>{e.defaultData=function(e){return{...zH.defaultData,...KG.defaultData(e)}},e.defaultDirectionalLightData={...e.defaultData("DirectionalLight"),position:[200,300,300],name:"Directional Light",intensity:.7}})(HH||(HH={})),(e=>{function t(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;for(;i<t.length;){let n=e?e[t[i]]:void 0;if(t.length===i+1)return n;if(!n)return;e=n.descendants,i+=1}}e.resolveWithDes=t,e.resolve=function(e,i){let n=t(e,i,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0);if(n){let e=Object.keys(n);if(1===e.length&&"descendants"===e[0])return}return n}})(WH||(WH={})),(e=>{function t(e,t){return{...zH.defaultData,...t,component:e,overrides:new fV,physics:void 0,events:void 0,type:"Instance"}}e.rootOverrideProps=["physics","events"],e.compositeNonOptionalOverrideProps=["geometry"],e.compositeEntireOverrideOverrideProps=["material"],e.ofComponent=t,e.fromComponentData=function(e){let i=BH.fromObject(e.data);return t(e.id,i)}})(qH||(qH={})),(e=>{e.defaultData={type:"Page",...zH.defaultData,physics:{...$G.defaultData,fusedBody:!1},...IH.defaultData,camera:GH.defaultData},e.isUIPage=function(e){return void 0!==e.uiScene}})(XH||(XH={})),(e=>{e.defaultCamera={position:[0,0,1e3],scale:[1,1,1],rotation:[0,0,0],hiddenMatrix:LG.identity,name:"Play Camera",visible:!0,raycastLock:!1,physics:$G.defaultData,states:new lV,events:new lV,cloner:null,pathSnapping:{pathId:null,orientation:"tangential",slide:0,offset:0},...GG.defaultData},e.KeysByResetCategory={States:["states"],Events:["events"],Material:["material","materials"],Geometry:["geometry"],Position:["position"],Rotation:["rotation"],Scale:["scale"],Transform:["position","scale","rotation","hiddenMatrix"],Name:["name"],Visibility:["visible","raycastLock","flatShading","wireframe","side"],Shadows:["castShadow","receiveShadow"],Cloner:["cloner"],Physics:["physics"]},e.defaultMeshObject={name:"Rectangle",...zH.defaultData,...UH.defaultData,geometry:SH.defaultData("RectangleGeometry"),material:fH.defaultTwoLayerData("phong","layer1","layer2")},e.defaultBooleanObject={name:"Boolean",...zH.defaultData,...UH.defaultData,geometry:SH.defaultData("BooleanGeometry"),material:fH.defaultTwoLayerData("phong","layer1","layer2")},e.defaultTextObject={name:"Text",...zH.defaultData,...UH.defaultData,geometry:SH.defaultData("TextGeometry"),material:fH.defaultTwoLayerData("phong","layer1","layer2")}})(YH||(YH={})),(e=>{e.newEmpty=function(e,t){let i={name:t};return"Mesh"===e.type?(i.geometry={},"material"in e&&(i.material={layers:new fV}),"materials"in e&&(i.materials=e.materials.map((e=>({layers:new fV}))))):UG.is(e.type)&&(i.perspective={},i.orthographic={}),i},e.toOps=function(e,t){let i,n=[],r={orthographic:0,perspective:0,geometry:0};function a(e,t){for(let[i,r]of Object.entries(t.layers)){let{texture:t,...a}=r;if(void 0!==t&&Object.keys(t).length>0){let r={path:[...e,"layers",i,"texture"],props:t,type:0};n.push(r)}if(Object.keys(a).length>0){let t={path:[...e,"layers",i],props:a,type:0};n.push(t)}}}for(let[s,o]of Object.entries(t))if("name"!==s)if("cloner"===s)n.push(...WG.toOps(o,["cloner"]));else if("pathSnapping"===s)n.push({path:[s],props:{slide:o.slide,offset:o.offset},type:0});else if("material"===s)a(["material"],o);else if("materials"===s)for(let[e,t]of Object.entries(o))a(["materials",e],t);else if(0===r[s]){if("geometry"===s&&void 0!==o.extrusion){let e={path:[s,"extrusion"],props:o.extrusion,type:0};n.push(e),o={...o},delete o.extrusion}if(Object.keys(o).length>0){let e={path:[s],props:o,type:0};n.push(e)}}else void 0===i&&(i={path:[],props:{},type:0},n.push(i)),i.props[s]=o;return n},e.patch=function(e,t){var i,n,r,a,s,o,l,c;if(void 0===t)return e;let h={...e};if(Object.assign(h,BH.merge(h,t)),Object.assign(h,{pathSnapping:Object.assign({},h.pathSnapping,{slide:null!==(i=null!==(n=null===(r=t.pathSnapping)||void 0===r?void 0:r.slide)&&void 0!==n?n:null===(a=h.pathSnapping)||void 0===a?void 0:a.slide)&&void 0!==i?i:0,offset:null!==(s=null!==(o=null===(l=t.pathSnapping)||void 0===l?void 0:l.offset)&&void 0!==o?o:null===(c=h.pathSnapping)||void 0===c?void 0:c.offset)&&void 0!==s?s:0})}),UG.is(e.type)){var u,d;h.orthographic={...h.orthographic},h.perspective={...h.perspective};let e=t;void 0!==(null===(u=e.orthographic)||void 0===u?void 0:u.zoom)&&(h.orthographic.zoom=e.orthographic.zoom),void 0!==(null===(d=e.perspective)||void 0===d?void 0:d.zoom)&&(h.perspective.zoom=e.perspective.zoom),void 0!==e.isUpVectorFlipped&&(h.isUpVectorFlipped=e.isUpVectorFlipped),void 0!==e.targetOffset&&(h.targetOffset=e.targetOffset)}else if("Mesh"===e.type)"geometry"in t&&Object.assign(h,{geometry:_H.merge(h.geometry,t.geometry)}),(t.material||t.materials)&&(h=function(e,t){if(void 0===t)return e;let i={...e};return"material"in i&&"material"in t&&t.material&&(i.material=FV(i.material,(e=>{if("string"!=typeof e)for(let[i,n]of Object.entries(t.material.layers)){let t=e.layers.data(i);t&&pH.patch(t,n)}})).data),i.materials&&t.materials&&(i.materials=FV(i.materials,(e=>{for(let r=0;r<i.materials.length;r++){let i=t.materials[r];if("string"!=typeof i)for(let[t,a]of Object.entries(i.layers)){var n;let i=null===(n=e[r])||void 0===n||null===(n=n.layers)||void 0===n?void 0:n.data(t);i&&pH.patch(i,a)}}})).data),i}(h,t)),h.cloner&&"cloner"in t&&Object.assign(h,{cloner:HG.merge(h.cloner,t.cloner)});else if("Empty"===e.type)h.cloner&&"cloner"in t&&Object.assign(h,{cloner:HG.merge(h.cloner,t.cloner)});else if(ZG.is(e.type)){let e=t;void 0!==e.intensity&&(h.intensity=e.intensity),void 0!==e.color&&("string"==typeof e.color?h.color=e.color:h.color=BG.clone(e.color))}return h}})(QH||(QH={})),(e=>{e.defaultData={enablePan:!0,enableZoom:!0,enableRotate:!0,enableDamping:!0,rotationLimitsMode:0,rotationVerticalOffset:{min:Math.PI/4,max:Math.PI/4},rotationHorizontalOffset:{min:Math.PI/4,max:Math.PI/4},rotationSoftLimit:2,panLimitsMode:0,panVerticalOffset:{min:250,max:250},panHorizontalOffset:{min:250,max:250},panSoftLimit:2,zoomLimitsEnabled:!1,zoomLimits:{min:.1,max:2},autoRotate:!1,autoRotateSpeed:2,autoRotateClockwise:!0,hoverRotatePanMode:0,hoverRotatePanStrength:20,hoverRotateDamping:.125,isTouchZoom:!0,orbitTouches:2,panTouches:3,resetHoverEffectOnPointerLeave:!0}})(ZH||(ZH={})),(e=>{e.defaultData={orbitControls:ZH.defaultData,playPage:XG,withBackground:!0,preventScroll:!1,preventTouchScroll:!1,hideCursor:!1,mouseEventTarget:"canvas",joystickSizeAndXYOffset:Array(12).fill(0).map(((e,t)=>{let i=0,n=0;return t<5?n=-30:t<10&&(n=30),0===t||10===t||5===t?i=30:(4===t||11===t||9===t)&&(i=-30),[120,[i,n],"show"]})),settings:{image:{format:"jpg",ratio:1},video:{format:"mp4",imageFormat:"jpg",fps:30,mbps:80,ratio:Math.max(1,typeof window<"u"?Math.floor(window.devicePixelRatio):1),stopMode:"manual",duration:5e3},web:{logo:!0,compress:!0,preset:1,preload:!0,hint:!1}},stopRaycast:!0,hdTransmission:!1}})(KH||(KH={})),(e=>{e.defaultData={id:"basic",label:"Basic",style:"None",prompt:""}})(JH||(JH={})),(e=>{e.defaultData={weather:0,shadows:0,lightOrigin:0,temperature:0,sun:0,camera:0,environment:0,particles:0,nature:0,floor:0}})($H||($H={})),(e=>{e.defaultData=()=>({mode:"line-art-both",prompt:"",negativePrompt:"",style:{...JH.defaultData},isRandomSeed:!0,seed:e.generateSeed(),guessMode:!1,advanced:!1,steps:20,guidanceScale:7.5,controlNetScale:1,modifiers:$H.defaultData}),e.generateSeed=()=>Math.round(1e5*Math.random())})(eW||(eW={})),(e=>{e.physicsEnabled=function(e){return void 0!==e.find((e=>"Page"===e.data.type&&e.data.globalPhysics.usePhysics))},e.traverseModuleInstances=function(e,t,i){e.scene.objects.traverseFrom(t,((t,n)=>{if("Instance"===n.type){var r;let a=null===(r=kW.getComponentData(e,n.component))||void 0===r?void 0:r.data;a&&i(t,n,a.events)}else i(t,n,n.events)}))}})(tW||(tW={})),(e=>{function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{withLight:!0,withSquare:!0},t=[],i=YH.defaultMeshObject;!0===e.withLight&&t.push({fi:-1,data:HH.defaultDirectionalLightData,id:"830a2708-8ed9-49cf-a68e-085299899103",children:[]}),!0===e.withSquare&&t.push({fi:1,id:"7ba78968-2a55-48f2-b14c-5191da3e075e",data:i,children:[]});let n=new oV;return n.push({fi:1,id:XG,data:{...XH.defaultData,name:"Scene 1"},children:t}),n}function i(t){return{...e.defaultData,objects:Ej(t,oV.prototype)}}e.TRASH_CAN_ID="830a2708-8ed9-49cf-a68e-085299892222",e.defaultData={objects:t(),publish:KH.defaultData,styles:eW.defaultData()},e.emptyDataWithoutPage=function(){return{objects:new oV,publish:KH.defaultData,styles:eW.defaultData()}},e.emptyDataWithPage=function(e){return{objects:t(e),publish:KH.defaultData,styles:eW.defaultData()}},e.emptyData=function(){return{objects:new oV,publish:{...KH.defaultData},styles:eW.defaultData()}},e.withObjs=i,e.withObj=function(e,t){return i([{id:e,data:t,children:[],fi:0}])}})(iW||(iW={})),(e=>{e.defaultData={preset:"fullscreen",allowResponsive:!1,size:[512,512],coords:[0,0],sceneScale:1,color:{r:0,g:0,b:0,a:.5}}})(nW||(nW={})),(e=>{e.emptyImage={data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=",name:"empty"}})(rW||(rW={})),(e=>{function t(e){return void 0!==e.textValue}function i(e){return"boolean"==typeof e}e.isTextValue=t,e.isNumber=function(e){return"number"==typeof e},e.isBoolean=i,e.typeOfVariable=function(e){return t(e)?"string":i(e)?"boolean":"number"},e.getDisplayedValue=function(t){var i;return e.isTextValue(t)?Array.isArray(t.textValue)?t.textValue.map((e=>{var i;return e.toString().padStart(null!==(i=t.padding)&&void 0!==i?i:2,"0")})).join(null!==(i=t.deliminator)&&void 0!==i?i:":")+(void 0!==t.suffix?" "+t.suffix:""):t.textValue.toString():e.isBoolean(t)?t?"True":"False":e.isNumber(t)?parseFloat(t.toFixed(3)).toString():t.toString()}})(aW||(aW={})),(e=>{e.all=["images","videos","colors","audios","particles","fonts","materials","variables"]})(sW||(sW={})),(e=>{e.all=[...sW.all,"components"]})(oW||(oW={})),(e=>{e.defaultData=function(){return{images:new Jj,videos:new Jj,colors:new Jj,audios:new Jj,particles:new Jj,fonts:new Jj,materials:new Jj,components:new Jj,variables:new Jj}}})(lW||(lW={})),(e=>{e.defaultData=function(){return{images:new Jj,videos:new Jj,colors:new Jj,audios:new Jj,particles:new Jj,fonts:new Jj,materials:new Jj,components:new Jj,variables:new Jj}}})(cW||(cW={})),(e=>{e.defaultColors=function(){let e={"89b10010-844c-11ec-a8a3-0242ac120002":{r:.5,g:.5,b:.5,a:1,name:"Default Color"}};return Ej(e,Jj.prototype)},e.defaultImages=function(e){let t={};return null!==e&&void 0!==e&&e.withAITexture&&(t["a1b10010-844c-a8a3-11ec-0242ac2011ec"]={...rW.emptyImage,name:"AI generated image"}),Ej(t,Jj.prototype)},e.emptyData=function(){return{catelogs:new Jj,materials:new Jj,images:new Jj,videos:new Jj,colors:new Jj,audios:new Jj,particles:new Jj,fonts:new Jj,variables:new lV,lib:cW.defaultData()}},e.defaultVariables=function(e){switch(e){case"number":return{value:0,name:"Number"};case"boolean":return{value:!1,name:"Boolean"};case"string":return{value:{textValue:"String value"},name:"String"};case"time":let t=[0,0,0];return{name:"Time",value:{textValue:t,deliminator:":",padding:2,suffix:"AM"},dynamicVariableType:"time",format:"HH:mm:ss",format12h24h:"12ampm",timeZone:null,hasEnd:!1,endValue:{textValue:t,deliminator:":",padding:2,suffix:"AM"},autoStart:!0,repeat:!1};case"counter":return{name:"Counter",value:0,dynamicVariableType:"counter",updateInterval:1e3,increment:1,autoStart:!0,hasEnd:!0,endValue:60,repeat:!0,randomStart:!1,range:[0,100],decimals:0};case"random":return{name:"Random",value:0,dynamicVariableType:"random",updateInterval:1e3,increment:1,autoStart:!0,isStatic:!1,hasEnd:!0,endValue:60,repeat:!0,min:0,max:100,decimals:0};default:console.error("Unknown variable type",e)}},e.getFormattedTimerTime=function(e,t){if("HH:mm:ss"===t.format){let t=Math.floor(e/3600),i=Math.floor((e-3600*t)/60);return{textValue:[t,i,Math.round(e-3600*t-60*i)]}}if("mm:ss"===t.format){let t=Math.floor(e/60);return{textValue:[t,Math.round(e-60*t)]}}return e="number"===t.format?Math.round(e):Math.round(1e3*e)/1e3}})(hW||(hW={})),(e=>{e.list=["idle","move","jump","run"]})(uW||(uW={})),(e=>{e.defaultColliderData={type:"capsule",height:200,radius:50,position:[0,0,0],rotation:[0,0,0]},e.defaultDataThirdPerson={moveMode:"walk",forwardDirection:"+z",speedTranslate:1e3,speedRotate:100,runMultiplier:2,rotationMode:"normal",rotBy:"keys",rotByTouch:"drag",delayPos:[.3,.3],delayRot:[.3,.3],keyAssignments:[["moveNegZ","W"],["moveNegX","A"],["movePosZ","S"],["movePosX","D"],["rotPosX","\u25b2"],["rotPosY","\u25c0"],["rotNegX","\u25bc"],["rotNegY","\u25b6"],["jump","Space"],["run","\u21e7"],["none","Ctrl"]],touchControl:!0,joystickPosLoc:5,joystickRotLoc:11,jumpTouchButtonLoc:9,collider:e.defaultColliderData,colliderHelperVisible:!0,collisionEnabled:!0,jumpPower:100,resetYPosition:3e3,alignToGround:!1,autoOrientMove:!0,orientWith:"camera",orientMode:"radial",delayPosCamera:.3,delayRotCamera:.3,camera:"",cameraXAxis:"Limit",cameraYAxis:"Free",cameraRotXLimits:[0,Math.PI/2],cameraRotYLimits:[-Math.PI/2,Math.PI/2],gameActions:{idle:new lV,move:new lV,jump:new lV,run:new lV},navmesh:{enabled:!1,ch:6,cs:6,walkableClimb:5,walkableHeight:1,walkableRadius:0,zones:"all",objects:[],helperVisible:!0,destinationHelperRadius:0,destinationHelperColor:zG.fromHexAndA(3728051,1)}}})(dW||(dW={}));var TW=180/Math.PI;function PW(e){e.rotation=e.rotation.slice(0,3).map((e=>e*TW))}function DW(e){var t,i,n;PW(e),"Page"===e.type&&PW(e.camera),null===(t=e.states)||void 0===t||t.forEach((e=>{void 0===e.rotation||null===e.rotation||(e.rotation=e.rotation.slice(0,3).map((e=>e*TW)))}));let r=e.geometry;r&&"SphereGeometry"===r.type&&(r.thetaLength=(null!==(i=r.thetaLength)&&void 0!==i?i:180)*TW),r&&"TorusGeometry"===r.type&&(r.arc=r.arc*TW),r&&"PathGeometry"===r.type&&(r.extrusion.angle*=TW,r.extrusion.twist*=TW),"Mesh"===e.type&&"TextGeometry"===e.geometry.type&&(e.geometry.text={textValue:e.geometry.text}),Array.isArray(jV(e.events))&&(null===(n=e.events)||void 0===n||n.forEach((e=>{("MouseDown"===e.type||"MouseUp"===e.type||"MousePress"===e.type||"KeyDown"===e.type||"KeyUp"===e.type||"KeyPress"===e.type||"Collision"===e.type||"Trigger"===e.type)&&(e.runMode=e.toggle?"Toggle":"Repeat")})))}var kW,OW,IW,RW,LW,BW,zW,NW,FW,jW,VW,UW,GW,HW,WW,qW,XW,YW,QW=111;function ZW(e,t){t(e.data);for(let i of e.children)ZW(i,t)}function KW(e){var t;let i=null!==(t=e.schema)&&void 0!==t?t:104;i!==QW&&i<105&&(ZW(e.asset,DW),e.schema=105)}function JW(e){var t;let i=null!==(t=e.schema)&&void 0!==t?t:0;if(i!==QW){console.warn("updating from ",i,"to ",QW),AW(e,i),i<100&&(void 0===e.scene.publish.joystickSizeAndXYOffset&&(e.scene.publish.joystickSizeAndXYOffset=KH.defaultData.joystickSizeAndXYOffset),e.schema=100),i<101&&(gW(e,MW),mW(e,MW),e.schema=101),i<102&&(function(e){e.scene.objects.traverse(((e,t)=>{let i=t.geometry;i&&"PathGeometry"===i.type&&(i.extrusion.capType="flat",i.extrusion.bevel=50,i.extrusion.bevelSides=6,"Custom"===i.extrusion.shape.type&&(i.extrusion.shape.shapeQuality="low"))}))}(e),e.schema=102),i<104&&(e.shared.catelogs=new Jj,e.shared.lib=cW.defaultData(),e.schema=104),i<105&&(function(e){e.shared.variables=Ej({},Jj.prototype)}(e),e.scene.objects.traverse(((e,t)=>{DW(t)})),e.schema=105);for(let t of Object.values(e.shared.lib.components))KW(t);i<106&&(function(e){let t=jV(e.shared.variables);e.shared.variables=Ej(Object.entries(null!==t&&void 0!==t?t:{}).map(((e,t)=>{let[i,n]=e;return{fi:t,id:i,data:n}})),lV.prototype)}(e),e.schema=106),i<107&&(e.shared.lib.variables=cW.defaultData().variables,e.schema=107),i<109&&(function(e){e.shared.particles=Ej({},Jj.prototype),e.shared.lib&&(e.shared.lib.particles=cW.defaultData().particles)}(e),e.schema=109),i<110&&(function(e){e.scene.objects.traverse(((e,t)=>{"Particle"===t.type&&"number"==typeof t.renderMaterial.size&&Object.assign(t.renderMaterial,{size:[t.renderMaterial.size,t.renderMaterial.size]})}))}(e),e.schema=110),i<111&&(e.scene.objects.traverse(((e,t)=>{!function(e){var t;Array.isArray(jV(e.events))&&(null===(t=e.events)||void 0===t||t.forEach((e=>{"disabled"in e||(e.disabled=!1),("MouseDown"===e.type||"MouseUp"===e.type||"MousePress"===e.type)&&(e.mode=e.mode||"Object")})))}(t)})),e.schema=111)}}function $W(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=null!==e[0].index,n=new Set(Object.keys(e[0].attributes)),r=new Set(Object.keys(e[0].morphAttributes)),a={},s={},o=e[0].morphTargetsRelative,l=new fT,c=0;for(let h=0;h<e.length;++h){let u=e[h],d=0;if(i!==(null!==u.index))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let e in u.attributes){if(!n.has(e))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+'. All geometries must have compatible attributes; make sure "'+e+'" attribute exists among all geometries, or in none of them.'),null;void 0===a[e]&&(a[e]=[]),a[e].push(u.attributes[e]),d++}if(d!==n.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". Make sure all geometries have the same number of attributes."),null;if(o!==u.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let e in u.morphAttributes){if(!r.has(e))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+".  .morphAttributes must be consistent throughout all geometries."),null;void 0===s[e]&&(s[e]=[]),s[e].push(u.morphAttributes[e])}if(t){let e;if(i)e=u.index.count;else{if(void 0===u.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". The geometry must have either an index or a position attribute"),null;e=u.attributes.position.count}l.addGroup(c,e,h),c+=e}}if(i){let t=0,i=[];for(let n=0;n<e.length;++n){let r=e[n].index;for(let e=0;e<r.count;++e)i.push(r.getX(e)+t);t+=e[n].attributes.position.count}l.setIndex(i)}for(let h in a){let e=eq(a[h]);if(!e)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+h+" attribute."),null;l.setAttribute(h,e)}for(let h in s){let e=s[h][0].length;if(0===e)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[h]=[];for(let t=0;t<e;++t){let e=[];for(let n=0;n<s[h].length;++n)e.push(s[h][n][t]);let i=eq(e);if(!i)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+h+" morphAttribute."),null;l.morphAttributes[h].push(i)}}return l}function eq(e){let t,i,n,r=0;for(let o=0;o<e.length;++o){let a=e[o];if(a.isInterleavedBufferAttribute)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. InterleavedBufferAttributes are not supported."),null;if(void 0===t&&(t=a.array.constructor),t!==a.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(void 0===i&&(i=a.itemSize),i!==a.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(void 0===n&&(n=a.normalized),n!==a.normalized)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;r+=a.array.length}let a=new t(r),s=0;for(let o=0;o<e.length;++o)a.set(e[o].array,s),s+=e[o].array.length;return new nT(a,i,n)}(e=>{e.defaultData={schema:QW,scene:iW.defaultData,frames:(new Jj).add("72fc2993-2da3-4b6b-96ac-2879db3a28bd",nW.defaultData),shared:{...hW.emptyData(),colors:hW.defaultColors()}},e.emptyDataForImports=function(e){let t=iW.emptyDataWithPage(e);return{schema:QW,scene:t,frames:(new Jj).add("72fc2993-2da3-4b6b-96ac-2879db3a28bd",nW.defaultData),shared:{...hW.emptyData(),colors:hW.defaultColors(),images:hW.defaultImages(e)}}},e.emptyData=function(){return{schema:QW,scene:iW.emptyDataWithPage(),frames:(new Jj).add("72fc2993-2da3-4b6b-96ac-2879db3a28bd",nW.defaultData),shared:hW.emptyData()}},e.clipboard2dData=function(){return{schema:QW,scene:iW.emptyData(),frames:new Jj,shared:hW.emptyData()}},e.collabHelper={...pV,updateSchema(e){var t,i;return(null!==(t=e.schema)&&void 0!==t?t:0)<QW?FV(e,JW):(null!==(i=e.schema)&&void 0!==i?i:0)-QW}},e.updateSchemaDirectly=function(t){let i=e.collabHelper.updateSchema(t);return"number"==typeof i?0===i?t:null:i.data},e.withoutLib=function(e){return{...e,shared:{...e.shared,lib:cW.defaultData()}}},e.getComponentData=function(e,t){let i=e.scene.objects.get(t);if(i&&"Component"===i.data.type)return i;{let i=e.shared.lib.components[t];if(i)return i.asset}}})(kW||(kW={})),(e=>{e.is=function(e){return!0}})(OW||(OW={})),(e=>{e.defaultData={position:[0,0],scale:[1,1],rotation:0,shear:[0,0]},e.merge=function(e,t){var i,n,r,a;return{position:null!==(i=null===t||void 0===t?void 0:t.position)&&void 0!==i?i:e.position,rotation:null!==(n=null===t||void 0===t?void 0:t.rotation)&&void 0!==n?n:e.rotation,scale:null!==(r=null===t||void 0===t?void 0:t.scale)&&void 0!==r?r:e.scale,shear:null!==(a=null===t||void 0===t?void 0:t.shear)&&void 0!==a?a:e.shear}},e.diff=function(e,t){return Sj({position:OG.isEqual(e.position,t.position)?void 0:t.position,rotation:e.rotation===t.rotation?void 0:t.rotation,scale:OG.isEqual(e.scale,t.scale)?void 0:t.scale,shear:e.shear&&t.shear&&OG.isEqual(e.shear,t.shear)?void 0:t.shear})}})(IW||(IW={})),(e=>{e.defaultData={horizontalConstraint:0,verticalConstraint:0}})(RW||(RW={})),(e=>{e.defaultData={opacity:1,fill:{color:zG.fromHexAndA(YG,1),enabled:!0},stroke:{color:zG.from0to1([0,0,0,1]),thickness:1,enabled:!1,mode:"inside"},layerBlur:{radius:2,enabled:!1},backgroundBlur:{radius:2,enabled:!1},dropShadow:{offset:[10,10],blurRadius:10,color:zG.from0to1([0,0,0,1]),enabled:!1,spread:0},innerShadow:{offset:[10,10],blurRadius:10,color:zG.from0to1([0,0,0,1]),enabled:!1,spread:0}}})(LW||(LW={})),(e=>{e.newEmpty=function(e,t){return{name:t}},e.patch=function(e,t){if(void 0===t)return e;let i={...e};return Object.assign(i,IW.merge(i,t)),i=function(e,t){if(void 0===t)return e;let i={...e},n=["width","height","cornerRadius"];for(let r of n)r in i&&r in t&&void 0!==t[r]&&Object.assign(i,{[r]:t[r]});return i}(i,t),i=function(e,t){if(void 0===t)return e;let i={...e};return"fill"in i&&"fill"in t&&void 0!==t.fill&&Object.assign(i,{fill:{...i.fill,...t.fill}}),"stroke"in i&&"stroke"in t&&void 0!==t.stroke&&Object.assign(i,{stroke:{...i.stroke,...t.stroke}}),"layerBlur"in i&&"layerBlur"in t&&void 0!==t.layerBlur&&Object.assign(i,{layerBlur:{...i.layerBlur,...t.layerBlur}}),"backgroundBlur"in i&&"backgroundBlur"in t&&void 0!==t.backgroundBlur&&Object.assign(i,{backgroundBlur:{...i.backgroundBlur,...t.backgroundBlur}}),"dropShadow"in i&&"dropShadow"in t&&void 0!==t.dropShadow&&Object.assign(i,{dropShadow:{...i.dropShadow,...t.dropShadow}}),"innerShadow"in i&&"innerShadow"in t&&void 0!==t.innerShadow&&Object.assign(i,{innerShadow:{...i.innerShadow,...t.innerShadow}}),i}(i,t),i},e.toOps=function(e,t){let i,n=[];for(let[r,a]of Object.entries(t))"name"!==r&&(void 0===i&&(i={path:[],props:{},type:0},n.push(i)),i.props[r]=a);return n}})(BW||(BW={})),(e=>{e.defaultData={...IW.defaultData,...RW.defaultData,states:new lV,events:new lV,visible:!0,raycastLock:!1}})(zW||(zW={})),(e=>{e.defaultData={...zW.defaultData,...LW.defaultData}})(NW||(NW={})),(e=>{e.defaultData={cornerRadius:[0,0,0,0]}})(FW||(FW={})),(e=>{e.defaultData={...NW.defaultData,type:"ellipse2d",width:100,height:100,name:"Ellipse"}})(jW||(jW={})),(e=>{e.defaultData={...NW.defaultData,...FW.defaultData,type:"rectangle2d",width:100,height:100,name:"Rectangle"}})(VW||(VW={})),(e=>{e.defaultData={...NW.defaultData,type:"text2d",width:100,height:100,fontSize:12,lineHeight:1.2,letterSpacing:0,text:{textValue:"Hello world"},horizontalAlign:1,verticalAlign:1,textTransform:1,font:"Roboto_regular",name:"Text"}})(UW||(UW={})),(e=>{e.defaultData={...NW.defaultData,type:"path2d",path:"",name:"Path"}})(GW||(GW={})),(e=>{e.is=function(e){return"ellipse2d"===e.type||"rectangle2d"===e.type||"text2d"===e.type||"vector2d"===e.type||"path2d"===e.type}})(HW||(HW={})),(e=>{e.defaultData={...zW.defaultData,name:"Group",type:"group2d"}})(WW||(WW={})),(e=>{e.defaultData={...zW.defaultData,...FW.defaultData,...LW.defaultData,name:"Frame",type:"frame2d",clipped:!0,width:200,height:200,fill:{color:zG.fromHexAndA(4737101,1),enabled:!0},stroke:{color:zG.fromHexAndA(0,1),thickness:1,enabled:!1,mode:"inside"},backgroundBlur:{radius:2,enabled:!1},layerBlur:{radius:2,enabled:!1}}})(qW||(qW={})),(e=>{e.defaultData=function(e){switch(e){case"rectangle2d":case"vector2d":return{...VW.defaultData};case"ellipse2d":return{...jW.defaultData};case"text2d":return{...UW.defaultData};case"path2d":return{...GW.defaultData};case"frame2d":return{...qW.defaultData};case"group2d":return{...WW.defaultData}}},e.getPivot=function(e){return"width"in e&&"height"in e?["number"==typeof e.width?.5*e.width:0,"number"==typeof e.height?.5*e.height:0]:[0,0]},e.isResizeable=function(e){return"rectangle2d"===e.type||"ellipse2d"===e.type||"text2d"===e.type||"frame2d"===e.type},e.hasCorners=function(e){return"rectangle2d"===e.type||"frame2d"===e.type}})(XW||(XW={})),(e=>{e.defaultData={name:"UI",type:"scene2d",objects:new oV},e.emptyData=function(){return{type:"scene2d",objects:new oV}}})(YW||(YW={}));var tq=Math.pow(2,-24),iq=class{constructor(){}};function nq(e,t,i){return i.min.x=t[e],i.min.y=t[e+1],i.min.z=t[e+2],i.max.x=t[e+3],i.max.y=t[e+4],i.max.z=t[e+5],i}function rq(e){let t=-1,i=-1/0;for(let n=0;n<3;n++){let r=e[n+3]-e[n];r>i&&(i=r,t=n)}return t}function aq(e,t){t.set(e)}function sq(e,t,i){let n,r;for(let a=0;a<3;a++){let s=a+3;n=e[a],r=t[a],i[a]=n<r?n:r,n=e[s],r=t[s],i[s]=n>r?n:r}}function oq(e,t,i){for(let n=0;n<3;n++){let r=t[e+2*n],a=t[e+2*n+1],s=r-a,o=r+a;s<i[n]&&(i[n]=s),o>i[n+3]&&(i[n+3]=o)}}function lq(e){let t=e[3]-e[0],i=e[4]-e[1],n=e[5]-e[2];return 2*(t*i+i*n+n*t)}function cq(e,t,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=1/0,s=1/0,o=1/0,l=-1/0,c=-1/0,h=-1/0,u=1/0,d=1/0,p=1/0,f=-1/0,m=-1/0,g=-1/0,v=null!==r;for(let y=6*t,b=6*(t+i);y<b;y+=6){let t=e[y+0],i=e[y+1],n=t-i,r=t+i;n<a&&(a=n),r>l&&(l=r),v&&t<u&&(u=t),v&&t>f&&(f=t);let b=e[y+2],x=e[y+3],w=b-x,_=b+x;w<s&&(s=w),_>c&&(c=_),v&&b<d&&(d=b),v&&b>m&&(m=b);let S=e[y+4],E=e[y+5],C=S-E,A=S+E;C<o&&(o=C),A>h&&(h=A),v&&S<p&&(p=S),v&&S>g&&(g=S)}n[0]=a,n[1]=s,n[2]=o,n[3]=l,n[4]=c,n[5]=h,v&&(r[0]=u,r[1]=d,r[2]=p,r[3]=f,r[4]=m,r[5]=g)}var hq=32,uq=(e,t)=>e.candidate-t.candidate,dq=new Array(hq).fill().map((()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0}))),pq=new Float32Array(6);function fq(e,t){function i(e){d&&d(e/p)}function n(t,r,d){let p=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,m=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!f&&m>=l&&(f=!0,c&&(console.warn("MeshBVH: Max depth of ".concat(l," reached when generating BVH. Consider increasing maxDepth.")),console.warn(e))),d<=h||m>=l)return i(r+d),t.offset=r,t.count=d,t;let g=function(e,t,i,n,r,a){let s=-1,o=0;if(0===a)s=rq(t),-1!==s&&(o=(t[s]+t[s+3])/2);else if(1===a)s=rq(e),-1!==s&&(o=function(e,t,i,n){let r=0;for(let a=t,s=t+i;a<s;a++)r+=e[6*a+2*n];return r/i}(i,n,r,s));else if(2===a){let a=lq(e),l=1.25*r,c=6*n,h=6*(n+r);for(let e=0;e<3;e++){let n=t[e],u=(t[e+3]-n)/hq;if(r<hq/4){let t=[...dq];t.length=r;let n=0;for(let r=c;r<h;r+=6,n++){let a=t[n];a.candidate=i[r+2*e],a.count=0;let{bounds:s,leftCacheBounds:o,rightCacheBounds:l}=a;for(let e=0;e<3;e++)l[e]=1/0,l[e+3]=-1/0,o[e]=1/0,o[e+3]=-1/0,s[e]=1/0,s[e+3]=-1/0;oq(r,i,s)}t.sort(uq);let u=r;for(let e=0;e<u;e++){let i=t[e];for(;e+1<u&&t[e+1].candidate===i.candidate;)t.splice(e+1,1),u--}for(let r=c;r<h;r+=6){let n=i[r+2*e];for(let e=0;e<u;e++){let a=t[e];n>=a.candidate?oq(r,i,a.rightCacheBounds):(oq(r,i,a.leftCacheBounds),a.count++)}}for(let i=0;i<u;i++){let n=t[i],c=n.count,h=r-n.count,u=n.leftCacheBounds,d=n.rightCacheBounds,p=0;0!==c&&(p=lq(u)/a);let f=0;0!==h&&(f=lq(d)/a);let m=1+1.25*(p*c+f*h);m<l&&(s=e,l=m,o=n.candidate)}}else{for(let e=0;e<hq;e++){let t=dq[e];t.count=0,t.candidate=n+u+e*u;let i=t.bounds;for(let e=0;e<3;e++)i[e]=1/0,i[e+3]=-1/0}for(let r=c;r<h;r+=6){let t=~~((i[r+2*e]-n)/u);t>=hq&&(t=hq-1);let a=dq[t];a.count++,oq(r,i,a.bounds)}let t=dq[hq-1];aq(t.bounds,t.rightCacheBounds);for(let e=hq-2;e>=0;e--){let t=dq[e],i=dq[e+1];sq(t.bounds,i.rightCacheBounds,t.rightCacheBounds)}let d=0;for(let i=0;i<hq-1;i++){let t=dq[i],n=t.count,c=t.bounds,h=dq[i+1].rightCacheBounds;0!==n&&(0===d?aq(c,pq):sq(c,pq,pq)),d+=n;let u=0,p=0;0!==d&&(u=lq(pq)/a);let f=r-d;0!==f&&(p=lq(h)/a);let m=1+1.25*(u*d+p*f);m<l&&(s=e,l=m,o=t.candidate)}}}}else console.warn("MeshBVH: Invalid build strategy value ".concat(a," used."));return{axis:s,pos:o}}(t.boundingData,p,s,r,d,u);if(-1===g.axis)return i(r+d),t.offset=r,t.count=d,t;let v=function(e,t,i,n,r){let a=i,s=i+n-1,o=r.pos,l=2*r.axis;for(;;){for(;a<=s&&t[6*a+l]<o;)a++;for(;a<=s&&t[6*s+l]>=o;)s--;if(!(a<s))return a;for(let i=0;i<3;i++){let n=e[3*a+i];e[3*a+i]=e[3*s+i],e[3*s+i]=n;let r=t[6*a+2*i+0];t[6*a+2*i+0]=t[6*s+2*i+0],t[6*s+2*i+0]=r;let o=t[6*a+2*i+1];t[6*a+2*i+1]=t[6*s+2*i+1],t[6*s+2*i+1]=o}a++,s--}}(o,s,r,d,g);if(v===r||v===r+d)i(r+d),t.offset=r,t.count=d;else{t.splitAxis=g.axis;let e=new iq,i=r,o=v-r;t.left=e,e.boundingData=new Float32Array(6),cq(s,i,o,e.boundingData,a),n(e,i,o,a,m+1);let l=new iq,c=v,h=d-o;t.right=l,l.boundingData=new Float32Array(6),cq(s,c,h,l.boundingData,a),n(l,c,h,a,m+1)}return t}!function(e,t){if(!e.index){let i,n=e.attributes.position.count,r=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;i=n>65535?new Uint32Array(new r(4*n)):new Uint16Array(new r(2*n)),e.setIndex(new nT(i,1));for(let e=0;e<n;e++)i[e]=e}}(e,t);let r=new Float32Array(6),a=new Float32Array(6),s=function(e,t){let i=e.attributes.position,n=e.index.array,r=n.length/3,a=new Float32Array(6*r),s=i.normalized,o=i.array,l=i.offset||0,c=3;i.isInterleavedBufferAttribute&&(c=i.data.stride);let h=["getX","getY","getZ"];for(let u=0;u<r;u++){let e,r,d,p=3*u,f=6*u;s?(e=n[p+0],r=n[p+1],d=n[p+2]):(e=n[p+0]*c+l,r=n[p+1]*c+l,d=n[p+2]*c+l);for(let n=0;n<3;n++){let l,c,u;s?(l=i[h[n]](e),c=i[h[n]](r),u=i[h[n]](d)):(l=o[e+n],c=o[r+n],u=o[d+n]);let p=l;c<p&&(p=c),u<p&&(p=u);let m=l;c>m&&(m=c),u>m&&(m=u);let g=(m-p)/2,v=2*n;a[f+v+0]=p+g,a[f+v+1]=g+(Math.abs(p)+g)*tq,p<t[n]&&(t[n]=p),m>t[n+3]&&(t[n+3]=m)}}return a}(e,r),o=e.index.array,l=t.maxDepth,c=t.verbose,h=t.maxLeafTris,u=t.strategy,d=t.onProgress,p=e.index.count/3,f=!1,m=[],g=function(e){if(!e.groups||!e.groups.length)return[{offset:0,count:e.index.count/3}];let t=[],i=new Set;for(let r of e.groups)i.add(r.start),i.add(r.start+r.count);let n=Array.from(i.values()).sort(((e,t)=>e-t));for(let r=0;r<n.length-1;r++){let e=n[r],i=n[r+1];t.push({offset:e/3,count:(i-e)/3})}return t}(e);if(1===g.length){let e=g[0],t=new iq;t.boundingData=r,function(e,t,i,n){let r=1/0,a=1/0,s=1/0,o=-1/0,l=-1/0,c=-1/0;for(let h=6*t,u=6*(t+i);h<u;h+=6){let t=e[h+0];t<r&&(r=t),t>o&&(o=t);let i=e[h+2];i<a&&(a=i),i>l&&(l=i);let n=e[h+4];n<s&&(s=n),n>c&&(c=n)}n[0]=r,n[1]=a,n[2]=s,n[3]=o,n[4]=l,n[5]=c}(s,e.offset,e.count,a),n(t,e.offset,e.count,a),m.push(t)}else for(let v of g){let e=new iq;e.boundingData=new Float32Array(6),cq(s,v.offset,v.count,e.boundingData,a),n(e,v.offset,v.count,a),m.push(e)}return m}var mq=class{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(e,t){let i=1/0,n=-1/0;for(let r=0,a=e.length;r<a;r++){let a=e[r][t];i=a<i?a:i,n=a>n?a:n}this.min=i,this.max=n}setFromPoints(e,t){let i=1/0,n=-1/0;for(let r=0,a=t.length;r<a;r++){let a=t[r],s=e.dot(a);i=s<i?s:i,n=s>n?s:n}this.min=i,this.max=n}isSeparated(e){return this.min>e.max||e.min>this.max}};mq.prototype.setFromBox=function(){let e=new FA;return function(t,i){let n=i.min,r=i.max,a=1/0,s=-1/0;for(let o=0;o<=1;o++)for(let i=0;i<=1;i++)for(let l=0;l<=1;l++){e.x=n.x*o+r.x*(1-o),e.y=n.y*i+r.y*(1-i),e.z=n.z*l+r.z*(1-l);let c=t.dot(e);a=Math.min(c,a),s=Math.max(c,s)}this.min=a,this.max=s}}();!function(){let e=new mq}();var gq=function(){let e=new FA,t=new FA,i=new FA;return function(n,r,a){let s=n.start,o=e,l=r.start,c=t;i.subVectors(s,l),e.subVectors(n.end,n.start),t.subVectors(r.end,r.start);let h,u,d=i.dot(c),p=c.dot(o),f=c.dot(c),m=i.dot(o),g=o.dot(o)*f-p*p;h=0!==g?(d*p-m*f)/g:0,u=(d+h*p)/f,a.x=h,a.y=u}}(),vq=function(){let e=new hA,t=new FA,i=new FA;return function(n,r,a,s){gq(n,r,e);let o=e.x,l=e.y;if(o>=0&&o<=1&&l>=0&&l<=1)return n.at(o,a),void r.at(l,s);if(o>=0&&o<=1)return l<0?r.at(0,s):r.at(1,s),void n.closestPointToPoint(s,!0,a);if(l>=0&&l<=1)return o<0?n.at(0,a):n.at(1,a),void r.closestPointToPoint(a,!0,s);{let e,c;e=o<0?n.start:n.end,c=l<0?r.start:r.end;let h=t,u=i;return n.closestPointToPoint(c,!0,t),r.closestPointToPoint(e,!0,i),h.distanceToSquared(c)<=u.distanceToSquared(e)?(a.copy(h),void s.copy(c)):(a.copy(e),void s.copy(u))}}}(),yq=function(){let e=new FA,t=new FA,i=new WT,n=new CR;return function(r,a){let{radius:s,center:o}=r,{a:l,b:c,c:h}=a;if(n.start=l,n.end=c,n.closestPointToPoint(o,!0,e).distanceTo(o)<=s||(n.start=l,n.end=h,n.closestPointToPoint(o,!0,e).distanceTo(o)<=s)||(n.start=c,n.end=h,n.closestPointToPoint(o,!0,e).distanceTo(o)<=s))return!0;let u=a.getPlane(i);if(Math.abs(u.distanceToPoint(o))<=s){let e=u.projectPoint(o,t);if(a.containsPoint(e))return!0}return!1}}();function bq(e){return Math.abs(e)<1e-15}var xq=class extends KM{constructor(){super(...arguments),this.isExtendedTriangle=!0,this.satAxes=new Array(4).fill().map((()=>new FA)),this.satBounds=new Array(4).fill().map((()=>new mq)),this.points=[this.a,this.b,this.c],this.sphere=new sM,this.plane=new WT,this.needsUpdate=!0}intersectsSphere(e){return yq(e,this)}update(){let e=this.a,t=this.b,i=this.c,n=this.points,r=this.satAxes,a=this.satBounds,s=r[0],o=a[0];this.getNormal(s),o.setFromPoints(s,n);let l=r[1],c=a[1];l.subVectors(e,t),c.setFromPoints(l,n);let h=r[2],u=a[2];h.subVectors(t,i),u.setFromPoints(h,n);let d=r[3],p=a[3];d.subVectors(i,e),p.setFromPoints(d,n),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(s,e),this.needsUpdate=!1}};xq.prototype.closestPointToSegment=function(){let e=new FA,t=new FA,i=new CR;return function(n){let r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,{start:o,end:l}=n,c=this.points,h=1/0;for(let u=0;u<3;u++){let o=(u+1)%3;i.start.copy(c[u]),i.end.copy(c[o]),vq(i,n,e,t),r=e.distanceToSquared(t),r<h&&(h=r,a&&a.copy(e),s&&s.copy(t))}return this.closestPointToPoint(o,e),r=o.distanceToSquared(e),r<h&&(h=r,a&&a.copy(e),s&&s.copy(o)),this.closestPointToPoint(l,e),r=l.distanceToSquared(e),r<h&&(h=r,a&&a.copy(e),s&&s.copy(l)),Math.sqrt(h)}}(),xq.prototype.intersectsTriangle=function(){let e=new xq,t=new Array(3),i=new Array(3),n=new mq,r=new mq,a=new FA,s=new FA,o=new FA,l=new FA,c=new CR,h=new CR,u=new CR;return function(d){let p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,f=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.needsUpdate&&this.update(),d.isExtendedTriangle?d.needsUpdate&&d.update():(e.copy(d),e.update(),d=e);let m=this.plane,g=d.plane;if(Math.abs(m.normal.dot(g.normal))>1-1e-10){let e=this.satBounds,s=this.satAxes;i[0]=d.a,i[1]=d.b,i[2]=d.c;for(let t=0;t<4;t++){let r=e[t],a=s[t];if(n.setFromPoints(a,i),r.isSeparated(n))return!1}let o=d.satBounds,l=d.satAxes;t[0]=this.a,t[1]=this.b,t[2]=this.c;for(let i=0;i<4;i++){let e=o[i],r=l[i];if(n.setFromPoints(r,t),e.isSeparated(n))return!1}for(let c=0;c<4;c++){let e=s[c];for(let s=0;s<4;s++){let o=l[s];if(a.crossVectors(e,o),n.setFromPoints(a,t),r.setFromPoints(a,i),n.isSeparated(r))return!1}}return p&&(f||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),p.start.set(0,0,0),p.end.set(0,0,0)),!0}{let e=this.points,t=!1,i=0;for(let o=0;o<3;o++){let n=e[o],r=e[(o+1)%3];c.start.copy(n),c.end.copy(r),c.delta(s);let a=t?h.start:h.end,l=bq(g.distanceToPoint(n));if(bq(g.normal.dot(s))&&l){h.copy(c),i=2;break}if((g.intersectLine(c,a)||l)&&!bq(a.distanceTo(r))){if(i++,t)break;t=!0}}if(1===i&&d.containsPoint(h.end))return p&&(p.start.copy(h.end),p.end.copy(h.end)),!0;if(2!==i)return!1;let n=d.points,r=!1,a=0;for(let s=0;s<3;s++){let e=n[s],t=n[(s+1)%3];c.start.copy(e),c.end.copy(t),c.delta(o);let i=r?u.start:u.end,l=bq(m.distanceToPoint(e));if(bq(m.normal.dot(o))&&l){u.copy(c),a=2;break}if((m.intersectLine(c,i)||l)&&!bq(i.distanceTo(t))){if(a++,r)break;r=!0}}if(1===a&&this.containsPoint(u.end))return p&&(p.start.copy(u.end),p.end.copy(u.end)),!0;if(2!==a)return!1;if(h.delta(s),u.delta(o),s.dot(o)<0){let e=u.start;u.start=u.end,u.end=e}let f=h.start.dot(s),v=h.end.dot(s),y=u.start.dot(s),b=u.end.dot(s);return(f===b||y===v||v<y!==f<b)&&(p&&(l.subVectors(h.start,u.start),l.dot(s)>0?p.start.copy(h.start):p.start.copy(u.start),l.subVectors(h.end,u.end),l.dot(s)<0?p.end.copy(h.end):p.end.copy(u.end)),!0)}}}(),xq.prototype.distanceToPoint=function(){let e=new FA;return function(t){return this.closestPointToPoint(t,e),t.distanceTo(e)}}(),xq.prototype.distanceToTriangle=function(){let e=new FA,t=new FA,i=["a","b","c"],n=new CR,r=new CR;return function(a){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,l=s||o?n:null;if(this.intersectsTriangle(a,l))return(s||o)&&(s&&l.getCenter(s),o&&l.getCenter(o)),0;let c=1/0;for(let t=0;t<3;t++){let n,r=i[t],l=a[r];this.closestPointToPoint(l,e),n=l.distanceToSquared(e),n<c&&(c=n,s&&s.copy(e),o&&o.copy(l));let h=this[r];a.closestPointToPoint(h,e),n=h.distanceToSquared(e),n<c&&(c=n,s&&s.copy(h),o&&o.copy(e))}for(let h=0;h<3;h++){let l=i[h],u=i[(h+1)%3];n.set(this[l],this[u]);for(let h=0;h<3;h++){let l=i[h],u=i[(h+1)%3];r.set(a[l],a[u]),vq(n,r,e,t);let d=e.distanceToSquared(t);d<c&&(c=d,s&&s.copy(e),o&&o.copy(t))}}return Math.sqrt(c)}}();var wq=class{constructor(e,t,i){this.isOrientedBox=!0,this.min=new FA,this.max=new FA,this.matrix=new mM,this.invMatrix=new mM,this.points=new Array(8).fill().map((()=>new FA)),this.satAxes=new Array(3).fill().map((()=>new FA)),this.satBounds=new Array(3).fill().map((()=>new mq)),this.alignedSatBounds=new Array(3).fill().map((()=>new mq)),this.needsUpdate=!1,e&&this.min.copy(e),t&&this.max.copy(t),i&&this.matrix.copy(i)}set(e,t,i){this.min.copy(e),this.max.copy(t),this.matrix.copy(i),this.needsUpdate=!0}copy(e){this.min.copy(e.min),this.max.copy(e.max),this.matrix.copy(e.matrix),this.needsUpdate=!0}};wq.prototype.update=function(){let e=this.matrix,t=this.min,i=this.max,n=this.points;for(let l=0;l<=1;l++)for(let r=0;r<=1;r++)for(let a=0;a<=1;a++){let s=n[1*l|2*r|4*a];s.x=l?i.x:t.x,s.y=r?i.y:t.y,s.z=a?i.z:t.z,s.applyMatrix4(e)}let r=this.satBounds,a=this.satAxes,s=n[0];for(let l=0;l<3;l++){let e=a[l],t=r[l],i=n[1<<l];e.subVectors(s,i),t.setFromPoints(e,n)}let o=this.alignedSatBounds;o[0].setFromPointsField(n,"x"),o[1].setFromPointsField(n,"y"),o[2].setFromPointsField(n,"z"),this.invMatrix.copy(this.matrix).invert(),this.needsUpdate=!1},wq.prototype.intersectsBox=function(){let e=new mq;return function(t){this.needsUpdate&&this.update();let i=t.min,n=t.max,r=this.satBounds,a=this.satAxes,s=this.alignedSatBounds;if(e.min=i.x,e.max=n.x,s[0].isSeparated(e)||(e.min=i.y,e.max=n.y,s[1].isSeparated(e))||(e.min=i.z,e.max=n.z,s[2].isSeparated(e)))return!1;for(let o=0;o<3;o++){let i=a[o],n=r[o];if(e.setFromBox(i,t),n.isSeparated(e))return!1}return!0}}(),wq.prototype.intersectsTriangle=function(){let e=new xq,t=new Array(3),i=new mq,n=new mq,r=new FA;return function(a){this.needsUpdate&&this.update(),a.isExtendedTriangle?a.needsUpdate&&a.update():(e.copy(a),e.update(),a=e);let s=this.satBounds,o=this.satAxes;t[0]=a.a,t[1]=a.b,t[2]=a.c;for(let e=0;e<3;e++){let n=s[e],r=o[e];if(i.setFromPoints(r,t),n.isSeparated(i))return!1}let l=a.satBounds,c=a.satAxes,h=this.points;for(let e=0;e<3;e++){let t=l[e],n=c[e];if(i.setFromPoints(n,h),t.isSeparated(i))return!1}for(let e=0;e<3;e++){let a=o[e];for(let e=0;e<4;e++){let s=c[e];if(r.crossVectors(a,s),i.setFromPoints(r,t),n.setFromPoints(r,h),i.isSeparated(n))return!1}}return!0}}(),wq.prototype.closestPointToPoint=function(e,t){return this.needsUpdate&&this.update(),t.copy(e).applyMatrix4(this.invMatrix).clamp(this.min,this.max).applyMatrix4(this.matrix),t},wq.prototype.distanceToPoint=function(){let e=new FA;return function(t){return this.closestPointToPoint(t,e),t.distanceTo(e)}}(),wq.prototype.distanceToBox=function(){let e=["x","y","z"],t=new Array(12).fill().map((()=>new CR)),i=new Array(12).fill().map((()=>new CR)),n=new FA,r=new FA;return function(a){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(this.needsUpdate&&this.update(),this.intersectsBox(a))return(o||l)&&(a.getCenter(r),this.closestPointToPoint(r,n),a.closestPointToPoint(n,r),o&&o.copy(n),l&&l.copy(r)),0;let c=s*s,h=a.min,u=a.max,d=this.points,p=1/0;for(let e=0;e<8;e++){let t=d[e];r.copy(t).clamp(h,u);let i=t.distanceToSquared(r);if(i<p&&(p=i,o&&o.copy(t),l&&l.copy(r),i<c))return Math.sqrt(i)}let f=0;for(let n=0;n<3;n++)for(let r=0;r<=1;r++)for(let a=0;a<=1;a++){let s=(n+1)%3,o=(n+2)%3,l=1<<n|r<<s|a<<o,c=d[r<<s|a<<o],p=d[l];t[f].set(c,p);let m=e[n],g=e[s],v=e[o],y=i[f],b=y.start,x=y.end;b[m]=h[m],b[g]=r?h[g]:u[g],b[v]=a?h[v]:u[g],x[m]=u[m],x[g]=r?h[g]:u[g],x[v]=a?h[v]:u[g],f++}for(let e=0;e<=1;e++)for(let t=0;t<=1;t++)for(let i=0;i<=1;i++){r.x=e?u.x:h.x,r.y=t?u.y:h.y,r.z=i?u.z:h.z,this.closestPointToPoint(r,n);let a=r.distanceToSquared(n);if(a<p&&(p=a,o&&o.copy(n),l&&l.copy(r),a<c))return Math.sqrt(a)}for(let e=0;e<12;e++){let a=t[e];for(let e=0;e<12;e++){let t=i[e];vq(a,t,n,r);let s=n.distanceToSquared(r);if(s<p&&(p=s,o&&o.copy(n),l&&l.copy(r),s<c))return Math.sqrt(s)}}return Math.sqrt(p)}}();var _q=new FA,Sq=new FA,Eq=new FA,Cq=new hA,Aq=new hA,Mq=new hA,Tq=new FA,Pq=new FA,Dq=new FA,kq=new FA;function Oq(e,t,i,n,r,a,s,o,l){_q.fromBufferAttribute(t,a),Sq.fromBufferAttribute(t,s),Eq.fromBufferAttribute(t,o);let c=function(e,t,i,n,r,a){let s;return s=a===DS?e.intersectTriangle(n,i,t,!0,r):e.intersectTriangle(t,i,n,a!==kS,r),null===s?null:{distance:e.origin.distanceTo(r),point:r.clone()}}(e,_q,Sq,Eq,kq,l);if(c){n&&(Cq.fromBufferAttribute(n,a),Aq.fromBufferAttribute(n,s),Mq.fromBufferAttribute(n,o),c.uv=KM.getInterpolation(kq,_q,Sq,Eq,Cq,Aq,Mq,new hA)),r&&(Cq.fromBufferAttribute(r,a),Aq.fromBufferAttribute(r,s),Mq.fromBufferAttribute(r,o),c.uv1=KM.getInterpolation(kq,_q,Sq,Eq,Cq,Aq,Mq,new hA)),i&&(Tq.fromBufferAttribute(i,a),Pq.fromBufferAttribute(i,s),Dq.fromBufferAttribute(i,o),c.normal=KM.getInterpolation(kq,_q,Sq,Eq,Tq,Pq,Dq,new FA),c.normal.dot(e.direction)>0&&c.normal.multiplyScalar(-1));let t={a:a,b:s,c:o,normal:new FA,materialIndex:0};KM.getNormal(_q,Sq,Eq,t.normal),c.face=t,c.faceIndex=a}return c}function Iq(e,t,i,n,r){let a=3*n,s=e.index.getX(a),o=e.index.getX(a+1),l=e.index.getX(a+2),{position:c,normal:h,uv:u,uv1:d}=e.attributes,p=Oq(i,c,h,u,d,s,o,l,t);return p?(p.faceIndex=n,r&&r.push(p),p):null}function Rq(e,t,i,n){let r=e.a,a=e.b,s=e.c,o=t,l=t+1,c=t+2;i&&(o=i.getX(t),l=i.getX(t+1),c=i.getX(t+2)),r.x=n.getX(o),r.y=n.getY(o),r.z=n.getZ(o),a.x=n.getX(l),a.y=n.getY(l),a.z=n.getZ(l),s.x=n.getX(c),s.y=n.getY(c),s.z=n.getZ(c)}function Lq(e,t,i,n,r,a,s){let o=i.index,l=i.attributes.position;for(let c=e,h=t+e;c<h;c++)if(Rq(s,3*c,o,l),s.needsUpdate=!0,n(s,c,r,a))return!0;return!1}var Bq=class{constructor(e){this._getNewPrimitive=e,this._primitives=[]}getPrimitive(){let e=this._primitives;return 0===e.length?this._getNewPrimitive():e.pop()}releasePrimitive(e){this._primitives.push(e)}};function zq(e,t){return 65535===t[e+15]}function Nq(e,t){return t[e+6]}function Fq(e,t){return t[e+14]}function jq(e){return e+8}function Vq(e,t){return t[e+6]}var Uq=new UA,Gq=new FA,Hq=["x","y","z"];function Wq(e,t,i,n,r){let a=2*e,s=Kq,o=Jq,l=$q;if(zq(a,o)){!function(e,t,i,n,r,a){for(let s=n,o=n+r;s<o;s++)Iq(e,t,i,s,a)}(t,i,n,Nq(e,l),Fq(a,o),r)}else{let a=jq(e);Qq(a,s,n,Gq)&&Wq(a,t,i,n,r);let o=Vq(e,l);Qq(o,s,n,Gq)&&Wq(o,t,i,n,r)}}function qq(e,t,i,n){let r=2*e,a=Kq,s=Jq,o=$q;if(zq(r,s)){return function(e,t,i,n,r){let a=1/0,s=null;for(let o=n,l=n+r;o<l;o++){let n=Iq(e,t,i,o);n&&n.distance<a&&(s=n,a=n.distance)}return s}(t,i,n,Nq(e,o),Fq(r,s))}{let r,s,l=function(e,t){return t[e+7]}(e,o),c=Hq[l],h=n.direction[c]>=0;h?(r=jq(e),s=Vq(e,o)):(r=Vq(e,o),s=jq(e));let u=Qq(r,a,n,Gq)?qq(r,t,i,n):null;if(u){let e=u.point[c];if(h?e<=a[s+l]:e>=a[s+l+3])return u}let d=Qq(s,a,n,Gq)?qq(s,t,i,n):null;return u&&d?u.distance<=d.distance?u:d:u||d||null}}var Xq=function(){let e,t,i=[],n=new Bq((()=>new UA));return function(){e=n.getPrimitive(),t=n.getPrimitive(),i.push(e,t);let a=r(...arguments);n.releasePrimitive(e),n.releasePrimitive(t),i.pop(),i.pop();let s=i.length;return s>0&&(t=i[s-1],e=i[s-2]),a};function r(i,n,a,s){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;function h(e){let t=2*e,i=Jq,n=$q;for(;!zq(t,i);)t=2*(e=jq(e));return Nq(e,n)}function u(e){let t=2*e,i=Jq,n=$q;for(;!zq(t,i);)t=2*(e=Vq(e,n));return Nq(e,n)+Fq(t,i)}let d=2*i,p=Kq,f=Jq,m=$q;if(zq(d,f)){let t=Nq(i,m),n=Fq(d,f);return nq(i,p,e),s(t,n,!1,c,l+i,e)}{let d,g,v,y,b=jq(i),x=Vq(i,m),w=b,_=x;if(o&&(v=e,y=t,nq(w,p,v),nq(_,p,y),d=o(v),g=o(y),g<d)){w=x,_=b;let e=d;d=g,g=e,v=y}v||(v=e,nq(w,p,v));let S,E=a(v,zq(2*w,f),d,c+1,l+w);if(2===E){let e=h(w);S=s(e,u(w)-e,!0,c+1,l+w,v)}else S=E&&r(w,n,a,s,o,l,c+1);if(S)return!0;y=t,nq(_,p,y);let C,A=a(y,zq(2*_,f),g,c+1,l+_);if(2===A){let e=h(_);C=s(e,u(_)-e,!0,c+1,l+_,y)}else C=A&&r(_,n,a,s,o,l,c+1);return!!C}}}(),Yq=function(){let e=new xq,t=new xq,i=new mM,n=new wq,r=new wq;return function a(s,o,l,c){let h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,u=2*s,d=Kq,p=Jq,f=$q;if(null===h&&(l.boundingBox||l.computeBoundingBox(),n.set(l.boundingBox.min,l.boundingBox.max,c),h=n),!zq(u,p)){let e=s+8,t=f[s+6];return nq(e,d,Uq),!!(h.intersectsBox(Uq)&&a(e,o,l,c,h)||(nq(t,d,Uq),h.intersectsBox(Uq)&&a(t,o,l,c,h)))}{let n=o,a=n.index,h=n.attributes.position,m=l.index,g=l.attributes.position,v=Nq(s,f),y=Fq(u,p);if(i.copy(c).invert(),l.boundsTree)return nq(s,d,r),r.matrix.copy(i),r.needsUpdate=!0,l.boundsTree.shapecast({intersectsBounds:e=>r.intersectsBox(e),intersectsTriangle:e=>{e.a.applyMatrix4(c),e.b.applyMatrix4(c),e.c.applyMatrix4(c),e.needsUpdate=!0;for(let i=3*v,n=3*(y+v);i<n;i+=3)if(Rq(t,i,a,h),t.needsUpdate=!0,e.intersectsTriangle(t))return!0;return!1}});for(let r=3*v,s=y+3*v;r<s;r+=3){Rq(e,r,a,h),e.a.applyMatrix4(i),e.b.applyMatrix4(i),e.c.applyMatrix4(i),e.needsUpdate=!0;for(let i=0,n=m.count;i<n;i+=3)if(Rq(t,i,m,g),t.needsUpdate=!0,e.intersectsTriangle(t))return!0}}}}();function Qq(e,t,i,n){return nq(e,t,Uq),i.intersectBox(Uq,n)}var Zq,Kq,Jq,$q,eX=[];function tX(e){Zq&&eX.push(Zq),Zq=e,Kq=new Float32Array(e),Jq=new Uint16Array(e),$q=new Uint32Array(e)}function iX(){Zq=null,Kq=null,Jq=null,$q=null,eX.length&&tX(eX.pop())}var nX=Symbol("skip tree generation"),rX=new UA,aX=new UA,sX=new mM,oX=new wq,lX=new wq,cX=new FA,hX=new FA,uX=new FA,dX=new FA,pX=new FA,fX=new UA,mX=new Bq((()=>new xq)),gX=class{static serialize(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t.isBufferGeometry)return console.warn("MeshBVH.serialize: The arguments for the function have changed. See documentation for new signature."),gX.serialize(arguments[0],{cloneBuffers:void 0===arguments[2]||arguments[2]});t={cloneBuffers:!0,...t};let i,n=e.geometry,r=e._roots,a=n.getIndex();return i=t.cloneBuffers?{roots:r.map((e=>e.slice())),index:a.array.slice()}:{roots:r,index:a.array},i}static deserialize(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("boolean"==typeof i)return console.warn("MeshBVH.deserialize: The arguments for the function have changed. See documentation for new signature."),gX.deserialize(arguments[0],arguments[1],{setIndex:void 0===arguments[2]||arguments[2]});i={setIndex:!0,...i};let{index:n,roots:r}=e,a=new gX(t,{...i,[nX]:!0});if(a._roots=r,i.setIndex){let i=t.getIndex();if(null===i){let i=new nT(e.index,1,!1);t.setIndex(i)}else i.array!==n&&(i.array.set(n),i.needsUpdate=!0)}return a}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e.isBufferGeometry)throw new Error("MeshBVH: Only BufferGeometries are supported.");if(e.index&&e.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.");if(t=Object.assign({strategy:0,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,[nX]:!1},t),t.useSharedArrayBuffer&&typeof SharedArrayBuffer>"u")throw new Error("MeshBVH: SharedArrayBuffer is not available.");this._roots=null,t[nX]||(this._roots=function(e,t){let i,n,r,a=fq(e,t),s=[],o=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let h=0;h<a.length;h++){let e=a[h],t=new o(32*l(e));i=new Float32Array(t),n=new Uint32Array(t),r=new Uint16Array(t),c(0,e),s.push(t)}return s;function l(e){return e.count?1:1+l(e.left)+l(e.right)}function c(e,t){let a=e/4,s=e/2,o=!!t.count,l=t.boundingData;for(let n=0;n<6;n++)i[a+n]=l[n];if(o){let i=t.offset,o=t.count;return n[a+6]=i,r[s+14]=o,r[s+15]=65535,e+32}{let i,r=t.left,s=t.right,o=t.splitAxis;if(i=c(e+32,r),i/4>Math.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return n[a+6]=i/4,i=c(i,s),n[a+7]=o,i}}}(e,t),!e.boundingBox&&t.setBoundingBox&&(e.boundingBox=this.getBoundingBox(new UA))),this.geometry=e}refit(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;e&&Array.isArray(e)&&(e=new Set(e));let t,i,n,r,a=this.geometry,s=a.index.array,o=a.attributes.position,l=0,c=this._roots;for(let u=0,d=c.length;u<d;u++)t=c[u],i=new Uint32Array(t),n=new Uint16Array(t),r=new Float32Array(t),h(0,l),l+=t.byteLength;function h(t,a){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=2*t;if(65535===n[c+15]){let e=i[t+6],a=1/0,l=1/0,h=1/0,u=-1/0,d=-1/0,p=-1/0;for(let t=3*e,i=3*(e+n[c+14]);t<i;t++){let e=s[t],i=o.getX(e),n=o.getY(e),r=o.getZ(e);i<a&&(a=i),i>u&&(u=i),n<l&&(l=n),n>d&&(d=n),r<h&&(h=r),r>p&&(p=r)}return(r[t+0]!==a||r[t+1]!==l||r[t+2]!==h||r[t+3]!==u||r[t+4]!==d||r[t+5]!==p)&&(r[t+0]=a,r[t+1]=l,r[t+2]=h,r[t+3]=u,r[t+4]=d,r[t+5]=p,!0)}{let n=t+8,s=i[t+6],o=n+a,c=s+a,u=l,d=!1,p=!1;e?u||(d=e.has(o),p=e.has(c),u=!d&&!p):(d=!0,p=!0);let f=u||p,m=!1;(u||d)&&(m=h(n,a,u));let g=!1;f&&(g=h(s,a,u));let v=m||g;if(v)for(let e=0;e<3;e++){let i=n+e,a=s+e,o=r[i],l=r[i+3],c=r[a],h=r[a+3];r[t+e]=o<c?o:c,r[t+e+3]=l>h?l:h}return v}}}traverse(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this._roots[t],n=new Uint32Array(i),r=new Uint16Array(i);!function t(a){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=2*a,l=65535===r[o+15];if(l){let t=n[a+6],c=r[o+14];e(s,l,new Float32Array(i,4*a,6),t,c)}else{let r=a+8,o=n[a+6],c=n[a+7];e(s,l,new Float32Array(i,4*a,6),c)||(t(r,s+1),t(o,s+1))}}(0)}raycast(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:PS,i=this._roots,n=this.geometry,r=[],a=t.isMaterial,s=Array.isArray(t),o=n.groups,l=a?t.side:t;for(let c=0,h=i.length;c<h;c++){let a=s?t[o[c].materialIndex].side:l,h=r.length;if(tX(i[c]),Wq(0,n,a,e,r),iX(),s){let e=o[c].materialIndex;for(let t=h,i=r.length;t<i;t++)r[t].face.materialIndex=e}}return r}raycastFirst(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:PS,i=this._roots,n=this.geometry,r=t.isMaterial,a=Array.isArray(t),s=null,o=n.groups,l=r?t.side:t;for(let c=0,h=i.length;c<h;c++){let r=a?t[o[c].materialIndex].side:l;tX(i[c]);let h=qq(0,n,r,e);iX(),null!=h&&(null==s||h.distance<s.distance)&&(s=h,a&&(h.face.materialIndex=o[c].materialIndex))}return s}intersectsGeometry(e,t){let i=this.geometry,n=!1;for(let r of this._roots)if(tX(r),n=Yq(0,i,e,t),iX(),n)break;return n}shapecast(e,t,i){let n=this.geometry;if(e instanceof Function){if(t){let e=t;t=(t,i,n,r)=>{let a=3*i;return e(t,a,a+1,a+2,n,r)}}e={boundsTraverseOrder:i,intersectsBounds:e,intersectsTriangle:t,intersectsRange:null},console.warn("MeshBVH: Shapecast function signature has changed and now takes an object of callbacks as a second argument. See docs for new signature.")}let r=mX.getPrimitive(),{boundsTraverseOrder:a,intersectsBounds:s,intersectsRange:o,intersectsTriangle:l}=e;if(o&&l){let e=o;o=(t,i,a,s,o)=>!!e(t,i,a,s,o)||Lq(t,i,n,l,a,s,r)}else o||(o=l?(e,t,i,a)=>Lq(e,t,n,l,i,a,r):(e,t,i)=>i);let c=!1,h=0;for(let u of this._roots){if(tX(u),c=Xq(0,n,s,o,a,h),iX(),c)break;h+=u.byteLength}return mX.releasePrimitive(r),c}bvhcast(e,t,i){let{intersectsRanges:n,intersectsTriangles:r}=i,a=this.geometry.index,s=this.geometry.attributes.position,o=e.geometry.index,l=e.geometry.attributes.position;sX.copy(t).invert();let c=mX.getPrimitive(),h=mX.getPrimitive();if(r){let e=function(e,i,n,u,d,p,f,m){for(let g=n,v=n+u;g<v;g++){Rq(h,3*g,o,l),h.a.applyMatrix4(t),h.b.applyMatrix4(t),h.c.applyMatrix4(t),h.needsUpdate=!0;for(let t=e,n=e+i;t<n;t++)if(Rq(c,3*t,a,s),c.needsUpdate=!0,r(c,h,t,g,d,p,f,m))return!0}return!1};if(n){let t=n;n=function(i,n,r,a,s,o,l,c){return!!t(i,n,r,a,s,o,l,c)||e(i,n,r,a,s,o,l,c)}}else n=e}e.getBoundingBox(aX),aX.applyMatrix4(t);let u=this.shapecast({intersectsBounds:e=>aX.intersectsBox(e),intersectsRange:(t,i,r,a,s,o)=>(rX.copy(o),rX.applyMatrix4(sX),e.shapecast({intersectsBounds:e=>rX.intersectsBox(e),intersectsRange:(e,r,o,l,c)=>n(t,i,e,r,a,s,l,c)}))});return mX.releasePrimitive(c),mX.releasePrimitive(h),u}intersectsBox(e,t){return oX.set(e.min,e.max,t),oX.needsUpdate=!0,this.shapecast({intersectsBounds:e=>oX.intersectsBox(e),intersectsTriangle:e=>oX.intersectsTriangle(e)})}intersectsSphere(e){return this.shapecast({intersectsBounds:t=>e.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(e)})}closestPointToGeometry(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1/0;e.boundingBox||e.computeBoundingBox(),oX.set(e.boundingBox.min,e.boundingBox.max,t),oX.needsUpdate=!0;let s=this.geometry,o=s.attributes.position,l=s.index,c=e.attributes.position,h=e.index,u=mX.getPrimitive(),d=mX.getPrimitive(),p=hX,f=uX,m=null,g=null;n&&(m=dX,g=pX);let v=1/0,y=null,b=null;return sX.copy(t).invert(),lX.matrix.copy(sX),this.shapecast({boundsTraverseOrder:e=>oX.distanceToBox(e),intersectsBounds:(e,t,i)=>i<v&&i<a&&(t&&(lX.min.copy(e.min),lX.max.copy(e.max),lX.needsUpdate=!0),!0),intersectsRange:(i,n)=>{if(e.boundsTree)return e.boundsTree.shapecast({boundsTraverseOrder:e=>lX.distanceToBox(e),intersectsBounds:(e,t,i)=>i<v&&i<a,intersectsRange:(e,a)=>{for(let s=3*e,x=3*(e+a);s<x;s+=3){Rq(d,s,h,c),d.a.applyMatrix4(t),d.b.applyMatrix4(t),d.c.applyMatrix4(t),d.needsUpdate=!0;for(let e=3*i,t=3*(i+n);e<t;e+=3){Rq(u,e,l,o),u.needsUpdate=!0;let t=u.distanceToTriangle(d,p,m);if(t<v&&(f.copy(p),g&&g.copy(m),v=t,y=e/3,b=s/3),t<r)return!0}}}});for(let e=0,a=h?h.count:c.count;e<a;e+=3){Rq(d,e,h,c),d.a.applyMatrix4(t),d.b.applyMatrix4(t),d.c.applyMatrix4(t),d.needsUpdate=!0;for(let t=3*i,a=3*(i+n);t<a;t+=3){Rq(u,t,l,o),u.needsUpdate=!0;let i=u.distanceToTriangle(d,p,m);if(i<v&&(f.copy(p),g&&g.copy(m),v=i,y=t/3,b=e/3),i<r)return!0}}}}),mX.releasePrimitive(u),mX.releasePrimitive(d),v===1/0?null:(i.point?i.point.copy(f):i.point=f.clone(),i.distance=v,i.faceIndex=y,n&&(n.point?n.point.copy(g):n.point=g.clone(),n.point.applyMatrix4(sX),f.applyMatrix4(sX),n.distance=f.sub(n.point).length(),n.faceIndex=b),i)}closestPointToPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0,r=i*i,a=n*n,s=1/0,o=null;if(this.shapecast({boundsTraverseOrder:t=>(cX.copy(e).clamp(t.min,t.max),cX.distanceToSquared(e)),intersectsBounds:(e,t,i)=>i<s&&i<a,intersectsTriangle:(t,i)=>{t.closestPointToPoint(e,cX);let n=e.distanceToSquared(cX);return n<s&&(hX.copy(cX),s=n,o=i),n<r}}),s===1/0)return null;let l=Math.sqrt(s);return t.point?t.point.copy(hX):t.point=hX.clone(),t.distance=l,t.faceIndex=o,t}getBoundingBox(e){return e.makeEmpty(),this._roots.forEach((t=>{nq(0,new Float32Array(t),fX),e.union(fX)})),e}},vX=J_(eS()),yX=.5*(Math.sqrt(3)-1),bX=(3-Math.sqrt(3))/6,xX=1/6,wX=(Math.sqrt(5),Math.sqrt(5),e=>0|Math.floor(e)),_X=new Float64Array([1,1,-1,1,1,-1,-1,-1,1,0,-1,0,1,0,-1,0,0,1,0,-1,0,1,0,-1]),SX=new Float64Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]);function EX(){let e=CX(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Math.random),t=new Float64Array(e).map((e=>_X[e%12*2])),i=new Float64Array(e).map((e=>_X[e%12*2+1]));return function(n,r){let a,s,o=0,l=0,c=0,h=(n+r)*yX,u=wX(n+h),d=wX(r+h),p=(u+d)*bX,f=n-(u-p),m=r-(d-p);f>m?(a=1,s=0):(a=0,s=1);let g=f-a+bX,v=m-s+bX,y=f-1+2*bX,b=m-1+2*bX,x=255&u,w=255&d,_=.5-f*f-m*m;if(_>=0){let n=x+e[w];_*=_,o=_*_*(t[n]*f+i[n]*m)}let S=.5-g*g-v*v;if(S>=0){let n=x+a+e[w+s];S*=S,l=S*S*(t[n]*g+i[n]*v)}let E=.5-y*y-b*b;if(E>=0){let n=x+1+e[w+1];E*=E,c=E*E*(t[n]*y+i[n]*b)}return 70*(o+l+c)}}function CX(e){let t=new Uint8Array(512);for(let i=0;i<256;i++)t[i]=i;for(let i=0;i<255;i++){let n=i+~~(e()*(256-i)),r=t[i];t[i]=t[n],t[n]=r}for(let i=256;i<512;i++)t[i]=t[i-256];return t}var AX,MX=new KM,TX=class{constructor(e){this.weightAttribute=null;let t=e.geometry;if(!t.isBufferGeometry||3!==t.attributes.position.itemSize)throw new Error("THREE.MeshSurfaceSampler: Requires BufferGeometry triangle mesh.");t.index&&(t=t.toNonIndexed()),this.geometry=t,this.randomFunction=Math.random,this.positionAttribute=this.geometry.getAttribute("position"),this.distribution=null}build(){let e=this.positionAttribute,t=new Float32Array(e.count/3);for(let n=0;n<e.count;n+=3){let i=1;MX.a.fromBufferAttribute(e,n),MX.b.fromBufferAttribute(e,n+1),MX.c.fromBufferAttribute(e,n+2),i*=MX.getArea(),t[n/3]=i}this.distribution=new Float32Array(e.count/3);let i=0;for(let n=0;n<t.length;n++)i+=t[n],this.distribution[n]=i;return this}setRandomGenerator(e){return this.randomFunction=e,this}sample(e,t){if(this.distribution){let i=this.distribution[this.distribution.length-1],n=this.binarySearch(this.randomFunction()*i);return this.sampleFace(n,e,t)}}binarySearch(e){if(!this.distribution)return 0;let t=this.distribution,i=0,n=t.length-1,r=-1;for(;i<=n;){let a=Math.ceil((i+n)/2);if(0===a||t[a-1]<=e&&t[a]>e){r=a;break}e<t[a]?n=a-1:i=a+1}return r}sampleFace(e,t,i){let n=this.randomFunction(),r=this.randomFunction();return n+r>1&&(n=1-n,r=1-r),MX.a.fromBufferAttribute(this.positionAttribute,3*e),MX.b.fromBufferAttribute(this.positionAttribute,3*e+1),MX.c.fromBufferAttribute(this.positionAttribute,3*e+2),t.set(0,0,0).addScaledVector(MX.a,n).addScaledVector(MX.b,r).addScaledVector(MX.c,1-(n+r)),MX.getNormal(i),this}},PX=J_(tS()),DX=new mM,kX=new mM,OX=new mM;(e=>{e.is=function(e){return e&&e.__isSPEObject}})(AX||(AX={}));var IX,RX=e=>class extends e{constructor(){super(...arguments),this.previousModelViewMatrix=new mM,this.copyPreviousMatrix=!0,this.hiddenMatrix=new mM,this.matrixWorldRigid=new mM,this.shearScale=new mM,this.shearScaleInv=new mM}get __isSPEObject(){return!0}isDescendantOf(e){e instanceof jM&&(e=e.uuid);let t=this;for(;t.parent;){if(t.parent.uuid===e)return!0;t=t.parent}return!1}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);for(let t of this.children)t.updateMatrixWorld(e)}updateWorldMatrix(e,t){let i=this.parent;if(e&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),t)for(let n of this.children)n.updateWorldMatrix(!1,!0)}traverseChildren(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let i of this.children)AX.is(i)&&i.traverseObject(e,t+1)}traverseObject(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!0!==e(this,t))for(let i of this.children)AX.is(i)&&i.traverseObject(e,t+1)}updateMatrixWorldSVD(){let e=this.matrixWorld.elements,t=[[e[0],e[4],e[8]],[e[1],e[5],e[9]],[e[2],e[6],e[10]]],{u:i,v:n,q:r}=(0,PX.SVD)(t),a=DX.set(i[0][0],i[0][1],i[0][2],0,i[1][0],i[1][1],i[1][2],0,i[2][0],i[2][1],i[2][2],0,0,0,0,1),s=kX.set(n[0][0],n[0][1],n[0][2],0,n[1][0],n[1][1],n[1][2],0,n[2][0],n[2][1],n[2][2],0,0,0,0,1),o=OX.copy(s).transpose();this.shearScale.makeScale(r[0],r[1],r[2]).multiply(o).premultiply(s),this.shearScaleInv.copy(this.shearScale).invert(),this.matrixWorldRigid.multiplyMatrices(a,o).copyPosition(this.matrixWorld),r.every((e=>Math.abs(r[0]-e)<.01))?this.hasNonUniformScale=!1:this.hasNonUniformScale=!0}attach(e,t){this.updateWorldMatrix(!0,!1);let i=(new mM).copy(this.matrixWorld).invert();return null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),i.multiply(e.parent.matrixWorld)),"hiddenMatrix"in e&&e.hiddenMatrix instanceof mM?e.hiddenMatrix.premultiply(i):e.applyMatrix4(i),e.updateWorldMatrix(!1,!1),this.add(e),void 0!==t&&(this.children.pop(),this.children.splice(t,0,e)),this}copy(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return super.copy(e,t),this.hasNonUniformScale=e.hasNonUniformScale,this}onAfterRender(e,t,i,n,r,a){this.copyPreviousMatrix&&this.previousModelViewMatrix.copy(this.modelViewMatrix)}},LX=class extends(RX(jM)){},BX=class extends LX{constructor(e){super(),this.object=e,this.matrixAutoUpdate=!1,this.hasNonUniformScale=e.hasNonUniformScale}raycast(e,t){}expand(){let e=0,t=this.object.entityChildren(e);for(;t;){var i;let n=this.children[e];(null===(i=n)||void 0===i?void 0:i.object)!==t&&(n&&this.remove(n),n=new BX(t),this.add(n),this.children.splice(e,0,this.children.pop()),n.matrixWorldNeedsUpdate=!0,n.matrixAutoUpdate=!1,n.matrix=t.matrix,n.hiddenMatrix=t.hiddenMatrix),n.expand(),e+=1,t=this.object.entityChildren(e)}for(;this.children.length>e;)this.remove(this.children[e])}get visible(){var e;return void 0!==this.playModeVisible?this.playModeVisible:this.object.visible||this.object.dataPatched.visible&&!0===(null===(e=this.object.dataPatched.cloner)||void 0===e?void 0:e.hideBase)}set visible(e){}get castShadow(){return this.object.castShadow}set castShadow(e){}get receiveShadow(){return this.object.receiveShadow}set receiveShadow(e){}get isMesh(){return(e=>"Mesh"===e.type)(this.object)}get isLight(){return this.object.isLight}get layers(){return this.object.layers}set layers(e){}get isCamera(){return!1}get geometry(){if(this.object.geometry)return this.object.geometry}get material(){if(this.object.material)return this.object.material}},zX=new FA,NX=new FA,FX=new mM,jX=[new FA(-1,1,1),new FA(-1,-1,1),new FA(1,-1,1),new FA(1,1,1),new FA(-1,1,-1),new FA(-1,-1,-1),new FA(1,-1,-1),new FA(1,1,-1)],VX=[[0,3],[1,2],[5,6],[4,7],[0,1],[3,2],[7,6],[4,5],[0,4],[1,5],[2,6],[3,7]],UX=[[0,2],[7,5],[4,1],[3,6],[4,3],[1,6]],GX=(e,t,i)=>{e.updateEntityBoxSize(zX,NX),FX.copy(t).multiply(e.matrixWorld),0===NX.x&&0===NX.y&&0===NX.z?i.push(new FA(zX.x,zX.y,zX.z).applyMatrix4(FX)):jX.forEach((e=>{i.push(e.clone().multiply(NX).add(zX).applyMatrix4(FX))}))},HX=class extends UA{constructor(){super(...arguments),this.matrix=new mM,this.vertices=[],this.faces=[],this.edges=[],this.centerEdges=[]}copy(e){return super.copy(e),this.matrix.copy(e.matrix),this.vertices=e.vertices.map((e=>e.clone())),this.faces=e.faces.map((e=>e.clone())),this.edges=e.edges.map((e=>e.clone())),this.centerEdges=e.centerEdges.map((e=>e.clone())),this}setFromObjectSize(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.updateWorldMatrix(!1,t),this.makeEmpty(),this.matrix.copy(e.matrixWorld);let i=(new mM).copy(e.matrixWorld).invert();return this.expandByObjectSize(e,i,t)}expandByObjectSize(e,t){let i=[];return!0===(arguments.length>2&&void 0!==arguments[2]&&arguments[2])?e.traverseEntity((e=>{if(e.visible||e.cloner&&e.data.visible){if(!("geometry"in e))return void i.push(new FA);GX(e,t,i)}})):GX(e,t,i),this.setFromPoints(i)}getCenter(e){return(e=super.getCenter(e)).applyMatrix4(this.matrix),e}getPositionToCenter(e){return(e=super.getCenter(e)).applyMatrix4(FX.copy(this.matrix).setPosition(0,0,0)),e}computeVertices(){this.getSize(NX).multiplyScalar(.5),this.getCenter(zX),FX.copy(this.matrix).setPosition(zX),this.vertices=jX.map((e=>e.clone().multiply(NX).applyMatrix4(FX)))}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=VX.map((e=>{let[t,i]=e;return new CR(this.vertices[t],this.vertices[i])})),this.centerEdges=this.edges.map((e=>e.getCenter(new FA)))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=UX.map((e=>{let[t,i]=e;return this.vertices[t].clone().add(this.vertices[i]).multiplyScalar(.5)}))}},WX={Cloner:()=>{},changeEntityProptotype:()=>{},createEntity:()=>{}},qX=class extends wO{constructor(){super()}getPoints(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,i=[],n=this.getCurveLengths(),r=n[n.length-1]/n.length;for(let a=0,s=this.curves;a<s.length;a++){let o=s[a],l=0===a?n[a]:n[a]-n[a-1],c=Math.ceil(t*l/r),h=o.getPoints(c);for(let t=0;t<h.length;t++){let n=h[t];e&&e.equals(n)||(i.push(n),e=n)}}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}},XX=.001;function YX(e,t,i){return t.clone().sub(e).cross(t.clone().sub(i)).length()<=XX}function QX(e,t){let i=new FA(...e.position),n=new FA(...e.controlNext.position),r=new FA(...t.controlPrevious.position),a=new FA(...t.position);return YX(i,n,a)&&YX(i,r,a)}function ZX(e){let t=e.points.map((e=>new FA(...e.data.position))),i=[e.points[0]],n=new FA(...i[0].data.position);for(let h=0;h<e.points.length-1;h++)YX(n,t[h],t[h+1])||(i.push(e.points[h]),n=t[h]);i.push(e.points[e.points.length-1]);let r=e.isClosed,a=i.length-(r?0:1),s=i.length,o=[];for(let h=0;h<s;h++){let t=i[h].data,n=new FA(...t.position),a=new FA(...t.controlPrevious.position),l=new FA(...t.controlNext.position),c={position:n,baseRoundness:t.roundness,controlPrevious:a,controlNext:l};if(0===t.roundness||!e.isClosed&&(0===h||h===s-1)){o[h]={...c,removedLength:0};continue}let u=r&&h==s-1?0:h+1,d=i[r&&0==h?s-1:h-1].data,p=i[u].data,f=new FA(...d.position),m=new FA(...p.position),g=f.clone().sub(n).normalize(),v=m.clone().sub(n).normalize();Object.assign(c,{prevDir:g,nextDir:v});let y=QX(d,t),b=QX(t,p);if(y&&b){let e=g.clone().add(v).normalize(),i=e.clone().cross(g).length()/g.dot(e);o[h]={...c,tan:i,removedLength:t.roundness/i}}else o[h]={...c,removedLength:0}}for(let h=0;h<a;h++){let e=r&&h===s-1?0:h+1,t=o[h],i=o[e];if(0!==t.removedLength||0!==i.removedLength){let e=t.position.distanceTo(i.position);t.removedLength=Math.min(t.removedLength,e/2),i.removedLength=Math.min(i.removedLength,e/2)}}let l=[];for(let h=0;h<a;h++){let e=h,t=r&&h===s-1?0:h+1,n=o[e],a=o[t],c=null;if(QX(i[e].data,i[t].data)){let e=n.position.clone(),t=a.position.clone();(0!==n.removedLength||0!==a.removedLength)&&(n.nextDir&&e.add(n.nextDir.clone().setLength(n.removedLength)),a.prevDir&&t.add(a.prevDir.clone().setLength(a.removedLength))),e.distanceTo(t)>XX&&(c=new mO(e,e.clone().lerp(t,.3),t.clone().lerp(e,.3),t))}else n.position.distanceTo(a.position)>XX&&(c=new mO(n.position,n.controlNext,a.controlPrevious,a.position));l[2*h+1]=c}for(let h=0;h<s;h++){let e=o[h];if(0===e.removedLength){l[2*h]=null;continue}let t=e.position,i=e.prevDir.clone().multiplyScalar(e.removedLength).add(t),n=e.nextDir.clone().multiplyScalar(e.removedLength).add(t),r=e.tan*e.removedLength,a=e.prevDir.clone().add(e.nextDir).normalize(),s=i.clone().lerp(n,.5),c=i.distanceTo(n)/2,u=a.clone().multiplyScalar(Math.sqrt(Math.pow(r,2)-Math.pow(c,2))).add(s),d=a.clone().multiplyScalar(-r).add(u),p=t.distanceTo(d)/t.distanceTo(s),f=e.prevDir.clone().multiplyScalar(p*t.distanceTo(i)).add(t),m=f.clone().lerp(d,2),g=i.clone().lerp(f,4/3),v=n.clone().lerp(m,4/3);l[2*h]=new mO(i,g,v,n)}let c=new qX;return l.forEach((e=>{e&&c.add(e)})),c}(e=>{e.is=function(e){return e&&e.__isEntity}})(IX||(IX={}));var KX=e=>IX.is(e),JX={type:"completeState",isfromEntity:!0},$X=["x","y","z"],eY=new FA,tY=(new FA).set(0,1,0),iY=e=>class extends(RX(e)){constructor(){super(...arguments),this.raycastLock=!1,this.scaleLock=!1,this.disposed=!1,this.stateSelection=null,this.destroyedInAction=!1,this.instances=[],this.prevState=null,this.currentState=null,this.reversibleToState=null,this.currentTransitionEvent=null,this.previousAction=null,this._singleBBox=new HX,this._recursiveBBox=new HX,this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0,this._needApplyPathSnapping=!0,this.attachedPaths=new Set}get __isEntity(){return!0}entityChildren(e){let t=this.children[e];if(IX.is(t))return t}entityChildrenCount(){let e=this.children.length;for(;e--;)if(IX.is(this.children[e]))return e+1;return 0}get isConcreteEntity(){return"string"==typeof this.identity}get isVirtualEntity(){return"string"!=typeof this.identity}get isInstanceRoot(){return this.isConcreteEntity&&"Instance"===this.data.type}nearestInstanceSelfOrParent(){let e=this;for(;"Instance"!==e.data.type;){let t=e.parent;if(!IX.is(t))return;e=t}return e}forInstancesRec(e){this.instances.forEach((t=>{t.disposed||e(t),t.forInstancesRec(e)}))}super_Entity(e,t){"string"==typeof e&&(this.uuid=e),this.identity=e,this.data=t,this.matrixAutoUpdate=!1,this.dataPatched=this.data}changeSelectedState(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(0!==this.data.states.length||i){for(let e of this.data.states)QH.toOps(this.data,e.data).forEach((e=>{let i=uV.replaceProps(e,this.data);this.dataPatched=this.data,this.updateByPatchedOp(i,this.data,t)}));if(null!==e){let i=this.data.states.data(e);i&&(this.dataPatched=QH.patch(this.data,i),QH.toOps(this.data,i).forEach((e=>{this.updateByPatchedOp(e,this.dataPatched,t)})))}i&&this.updateTransformState(this.dataPatched,t),this.stateSelection=e,this.updatePathSnapping(this.dataPatched.pathSnapping)}}get singleBBox(){return this.singleBBoxNeedsUpdate&&(this.singleBBoxNeedsUpdate=!1,this._singleBBox.setFromObjectSize(this,!1),this._singleBBox.computeVertices(),this._singleBBox.computeEdges(),this._singleBBox.computeFaces()),this._singleBBox}get recursiveBBox(){return this.recursiveBBoxNeedsUpdate&&(this.recursiveBBoxNeedsUpdate=!1,this._recursiveBBox.setFromObjectSize(this,!0),this._recursiveBBox.computeVertices(),this._recursiveBBox.computeEdges(),this._recursiveBBox.computeFaces()),this._recursiveBBox}updateEntityBoxSize(e,t){e.setScalar(0),t.setScalar(0)}resetBBoxNeedsUpdateSelf(){this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0}resetBBoxNeedsUpdate(){this.resetBBoxNeedsUpdateSelf(),this.traverseAncestors((e=>{KX(e)&&e.resetBBoxNeedsUpdateSelf()})),this.traverseEntity((e=>{e.resetBBoxNeedsUpdateSelf()}))}find(e){let t;return this.traverseEntity((i=>{i.uuid===e&&(t=i)})),t}traverseSortNextHelper(){let e=this.parent;if(e){let t=e.children,i=t.indexOf(this)+1;if(IX.is(t[i]))return t[i];if(IX.is(e))return e.traverseSortNextHelper()}}sortNext(){let e=this.children;return this.children.length>0&&IX.is(this.children[0])?e[0]:this.traverseSortNextHelper()}goUp(e){let t=this;for(;e>0&&null!==t;)t=t.parent,e-=1;return t}hasAnccestorOrSelf(e){return this===e||this.hasAnccestor(e)}hasAnccestor(e){let t=this.parent;for(;t;){if(e===t)return!0;t=t.parent}return!1}countToAccestor(e){let t=0,i=this;for(;i!==e;){if(null===i)return-1;i=i.parent,t+=1}return t}forEachEntity(e){for(let t of this.children)KX(t)&&e(t)}traverseEntityAncestors(e){this.traverseAncestors((t=>{IX.is(t)&&e(t)}))}traverseConcreteEntity(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!0!==e(this,t))for(let i of this.children)KX(i)&&i.isConcreteEntity&&i.traverseEntity(e,t+1)}traverseEntity(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!0!==e(this,t))for(let i of this.children)KX(i)&&i.traverseEntity(e,t+1)}traverseVisibleEntity(e){e(this);for(let t of this.children)KX(t)&&t.visible&&t.traverseVisibleEntity(e)}updateMatrix(){super.updateMatrix(),this.cloner&&this.cloner.onObjUpdateMatrix(),this.dispatchEvent({type:"updateMatrix"})}updateMatrixWorld(e){super.updateMatrixWorld(e),this.dispatchEvent({type:"updateMatrixWorld"})}copy(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return super.copy(e,t),this.dataPatched=e.dataPatched,this.raycastLock=e.raycastLock,this.scaleLock=e.scaleLock,this.hiddenMatrix.copy(e.hiddenMatrix),this}hasEntityChild(){return this.children.some((e=>KX(e)))}isAncestorOf(e){if(this.uuid===e)return!1;let t=!1;return this.traverseEntity((i=>{i.uuid===e&&(t=!0)})),t}toObjectTransformState(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.updateWorldMatrix(!0,!1);let t={position:this.position.toArray(),rotation:[this.rotation.x*cA.RAD2DEG,this.rotation.y*cA.RAD2DEG,this.rotation.z*cA.RAD2DEG],scale:this.scale.toArray(),hiddenMatrix:this.hiddenMatrix.toArray()};return gj(t,e)}getTransformValues(e,t,i){return t[e].map(((t,n)=>{var r;return null!==(r=null===i||void 0===i?void 0:i.shared.getVariable(t,[this.uuid,e,$X[n]]))&&void 0!==r?r:t}))}updateTransformState(e,t){var i;let n=!1;return e.position&&(this.position.fromArray(this.getTransformValues("position",e,t)),n=!0),e.rotation&&(eY.fromArray(this.getTransformValues("rotation",e,t)).multiplyScalar(cA.DEG2RAD),this.rotation.setFromVector3(eY),n=!0),e.scale&&(this.scale.fromArray(this.getTransformValues("scale",e,t)),n=!0),void 0!==e.hiddenMatrix&&(n=!0,this.hiddenMatrix.fromArray(null!==(i=e.hiddenMatrix)&&void 0!==i?i:LG.identity)),n&&(this.updateMatrix(),this.resetBBoxNeedsUpdate(),this.invalidateClonerTransform(this),this.traverseEntityAncestors((e=>{e.invalidateClonerTransform(this)}))),e.position&&e.rotation&&e.scale&&void 0!==e.hiddenMatrix&&this.updateWorldMatrix(!1,!0),n}onVariableUpdate(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]?this.resetBBoxNeedsUpdate():(this.updateMatrix(),this.resetBBoxNeedsUpdate(),this.invalidateClonerTransform(this),this.traverseEntityAncestors((e=>{e.invalidateClonerTransform(this)})))}dispose(){this.disposed=!0,this.cloner&&(this.cloner.removeFromParent(),this.cloner=void 0)}disposeChildrenRecursively(){for(let e of this.children)IX.is(e)&&e.disposeRecursively()}disposeRecursively(){this.dispose(),this.children.forEach((e=>{IX.is(e)&&e.disposeRecursively()}))}toState(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t={name:this.name,visible:this.visible,raycastLock:this.raycastLock,...this.toObjectTransformState(e)};return gj(t,e)}updateByObjUpdateOp(e,t){void 0!==e&&this.updateByOp({type:0,props:e,path:[]},{...this.data,...e},t,!1)}updateByOp(e,t,i,n){let r=this.data;this.data=t;let a=e,s=VV(e.path,["states","*"]);if(null!==s){if(0===e.type){let[t]=s;if((null===this||void 0===this?void 0:this.stateSelection)===t){let t={...e.props};if(delete t.name,Object.values(e.props).some((e=>void 0===e))){let i=this.data;if(void 0!==i){let n=LV.zoom(i,e.path.slice(2));if(n)for(let i in e.props)void 0===e.props[i]&&i in n&&(t[i]=n[i])}}a={...e,props:t,path:e.path.slice(2)}}}}else if(0===e.type){let t=this.stateSelection?this.data.states.data(this.stateSelection):void 0;if(void 0!==t){if(void 0!==e.props.name&&t.name){let{name:e,...i}=t;t=i}if(void 0!==e.props.material&&"material"in t){let{material:e,...i}=t;t=i}let i=LV.removeOverridden(e.path,e.props,t);a={...e,props:i}}}if(this.updateByPatchedOpBase(a,QH.patch(this.data,this.stateSelection?this.data.states.data(this.stateSelection):void 0),i),VV(e.path,["overrides"])){let n=[],r=[...e.path];for(n.push(r[1]),r.splice(0,2);r.length>0&&"descendants"===r[0];)n.push(r[1]),r.splice(0,2);if(void 0===n[n.length-1]){if(0===e.type)for(let t of Object.keys(e.props)){n[n.length-1]=t;let r=i.scene.findInstance([this.uuid,...n]);r&&(r.overrideData=e.props[t],r.updateState(hV.apply(r.component.data,r.overrideData),i))}}else{let a=i.scene.findInstance([this.uuid,...n]);if(a){let s=LV.zoom(a.component.data,r);if(0===(e={...e,path:r}).type){let t=e.props;if(s)for(let[i,n]of Object.entries(e.props))void 0===n&&(t===e.props&&(t={...e.props}),t[i]=s[i]);e={...e,props:t}}a.overrideData=WH.resolve(t.overrides,n),a.updateByOp(e,dV.applySimple(a.data,e),i,!1)}}}else if(this.instances.length>0){let n;if(0===e.path.length&&0===e.type){let t;for(let i of qH.rootOverrideProps)i in e.props&&(void 0===t&&(t={}),t[i]=e.props[i]);t&&(n={...e,props:t})}else for(let t of qH.rootOverrideProps)if(VV(e.path,[t])){n=e;break}void 0!==n&&this.instances.forEach((e=>{if(e.isInstanceRoot){let t=hV.filterOp(e.overrideData,n);t&&e.updateByOp(t,dV.applySimple(e.data,t),i,!0)}})),this.instances.forEach((n=>{if(!n.isInstanceRoot){let a=hV.filterOp(n.overrideData,e);if(a){let s;s=r===n.data&&e===a?t:dV.applySimple(n.data,a),n.updateByOp(a,s,i,!0)}}}))}}updateByPatchedOpBase(e,t,i){if(this.dataPatched=t,0===e.path.length&&0===e.type)void 0!==e.props.type&&!UG.is(e.props.type)&&WX.changeEntityProptotype(this,t,i);else if(1===e.path.length&&"geometry"===e.path[0]&&0===e.type&&"type"in e.props){WX.changeEntityProptotype(this,t,i);for(let e of this.children)IX.is(e)&&e.updateVisible(i.scene)}this.updateByPatchedOp(e,t,i)}updateByPatchedOp(e,t,i){if(0===e.path.length&&0===e.type&&this.updateState(e.props,i),null!==VV(e.path,["pathSnapping"])&&this.updatePathSnapping(t.pathSnapping),null!==VV(e.path,["cloner"])){let n=dV.drop(e,1);0===n.path.length&&0===n.type&&!0===n.props.disabled?this.setFromClonerState(null,i):this.cloner?this.cloner.updateState(t.cloner,i.scene):(this.setFromClonerState(t.cloner,i),this.expandCloner(i.scene)),this.updateVisible(i.scene)}}updatePathSnapping(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dataPatched.pathSnapping;this._updatedPathSnapping=e,this._needApplyPathSnapping=!0}get updatedPathSnapping(){return this._updatedPathSnapping}applyPathSnapping(e){var t,i,n,r,a,s,o,l,c,h,u;let d=null!==(t=null===(i=this._updatedPathSnapping)||void 0===i?void 0:i.pathId)&&void 0!==t?t:this.dataPatched.pathSnapping.pathId,p=null!==(n=null!==(r=null===(a=this._updatedPathSnapping)||void 0===a?void 0:a.slide)&&void 0!==r?r:this.dataPatched.pathSnapping.slide)&&void 0!==n?n:0,f=null!==(s=null!==(o=null===(l=this._updatedPathSnapping)||void 0===l?void 0:l.offset)&&void 0!==o?o:this.dataPatched.pathSnapping.offset)&&void 0!==s?s:0,m=null!==(c=null===(h=this._updatedPathSnapping)||void 0===h?void 0:h.orientation)&&void 0!==c?c:this.dataPatched.pathSnapping.orientation;if(null===d)return;let g=e.find(d);if(!g||!1===this._needApplyPathSnapping)return;this._needApplyPathSnapping=!1;let v=g.data;if(v.geometry.path.points.length<=1)return;let y=ZX(v.geometry.path),b=(p+f)%1;p+f===1&&0===b&&(b=1);let x=y.getPointAt(b);if(null===x)return;let w=this.parent?null===(u=this.parent)||void 0===u?void 0:u.matrixWorld:new mM;g.updateMatrixWorld();let _=(new mM).multiplyMatrices(w.clone().invert(),g.matrixWorld);x.applyMatrix4(_);let S={position:x.toArray(),rotation:v.rotation};if("tangential"===m){let e=(new mM).extractRotation(g.matrixWorld),t=y.getTangentAt(b).applyMatrix4(e).add(x),i=(new mM).lookAt(x,t,tY),n=eY.setFromEuler((new CM).setFromRotationMatrix(i)).multiplyScalar(cA.RAD2DEG);S={...S,rotation:n.toArray()}}this.updateTransformState(S),this.traverseEntity((e=>{e._cameraType&&e.dispatchEvent(JX)}))}updateVisible(e){var t,i;if(this.visible=this.dataPatched.visible&&(!this.dataPatched.cloner||null!==(t=this.dataPatched.cloner.disabled)&&void 0!==t&&t||!0!==(null===(i=this.dataPatched.cloner)||void 0===i?void 0:i.hideBase)),!e)return;let n=!1;this.traverseEntity((e=>{if("Splat"===e.data.type)return n=!0,!0})),n&&e.reloadSplats()}updateState_Entity(e,t){void 0!==e.name&&(this.name=e.name),void 0!==e.raycastLock&&(this.raycastLock=e.raycastLock),void 0!==e.visible&&(this.updateVisible(null===t||void 0===t?void 0:t.scene),this.resetBBoxNeedsUpdate()),t&&"cloner"in e&&void 0!==e.cloner&&(this.setFromClonerState(e.cloner,t),this.updateVisible(t.scene)),this.updateTransformState(e,t)}get attachedSurfaceCloners(){return this.children.filter((e=>e instanceof WX.Cloner&&"toObject"===e.parameters.type))}setFromClonerState(e,t){this.disposed||(null===e||e.disabled?(this.cloner&&this.cloner.removeFromParent(),this.cloner=void 0):void 0===this.cloner?(this.cloner=new WX.Cloner(this,e),t.scene.addPendingExpandCloner(this)):this.cloner.updateState(e,t.scene))}expandCloner(e){!this.disposed&&this.cloner&&this.cloner.expandClones(e)}invalidateClonerTransform(e){this.cloner&&this.cloner.invalidateTransform(e)}requestRender(){this.dispatchEvent({type:"requestRender"})}},nY=class{static create(e){return this.build(this.normalizeInputs(e))}static normalizeInputs(e,t){var i,n,r,a,s;let o=Object.assign({},null!==(i=null===t||void 0===t?void 0:t.parameters)&&void 0!==i?i:{width:100,radialSegments:64,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:360,cornerRadius:8,cornerSegments:8,hollow:0},e.parameters);o.thetaLength=cA.clamp(o.thetaLength,0,360);let l=o.width/2,c=null!==(n=o.radiusTop)&&void 0!==n?n:l,h=null!==(r=o.radiusBottom)&&void 0!==r?r:l;return c===h?(c=l,h=l):c>h?(c=l,h=h*l/c):(c=c*l/h,h=l),{parameters:Object.assign(o,{width:Math.abs(o.width),height:Math.abs(null!==(a=o.height)&&void 0!==a?a:o.width),depth:Math.abs(null!==(s=o.depth)&&void 0!==s?s:o.width),radiusTop:c,radiusBottom:h})}}static build(e){let t,{width:i,depth:n,height:r,radialSegments:a,heightSegments:s,openEnded:o,thetaStart:l,thetaLength:c,radiusTop:h,radiusBottom:u,cornerRadius:d,cornerSegments:p,hollow:f}=e.parameters;return 0===c?(t=new fT,t.setAttribute("position",new sT([],3))):t=d||f?new sY(h,u,r,a,s,o,l,c*Math.PI/180,d,d,p,f):new EO(h,u,r,a,s,o,l,c*Math.PI/180),t.scale(1,1,n/i),Object.assign(t,{userData:{...e,type:"CylinderGeometry"}})}};function rY(e,t,i){i.x=e.x*t.x,i.y=e.y,i.z=e.x*t.y}function aY(e){return new hA(e.y,-e.x)}var sY=class extends fT{constructor(e,t,i,n,r,a,s,o,l,c,h,u){let d=arguments.length>12&&void 0!==arguments[12]&&arguments[12];super(),this.type="RoundedCylinderBufferGeometry",e=void 0!==e?e:1,t=void 0!==t?t:1,i=i||1,n=Math.floor(n)||8,r=Math.floor(r)||1,a=void 0!==a&&a,s=void 0!==s?s:0,o=void 0!==o?o:2*Math.PI,a&&(l=0,c=0);let p=[],f=[],m=[],g=[],v=0,y=i/2,b=new FA,x=new FA;d&&0==e&&(e=l),d&&0==t&&(t=c);let w=new hA(e,y),_=new hA(t,-y),S=null,E=null,C=null,A=null,M=w.clone().sub(_),T=0,P=0,D=0;u>0&&(T=Math.min(e,t)*(1-u),P=e-T,D=t-T);let k=w.clone();k.x-=T;let O=Math.PI-M.angle(),I=M.angle(),R=Math.tan(I/2),L=Math.tan(O/2),B=R+L,z=u?B:L,N=u?B:R;if(l=Math.min(l,(e-P)/z,M.length()/B),c=Math.min(c,(t-D)/N,M.length()/B),l>0){let e=l/R;S=w.clone().sub(new hA(e,l)),u&&(C=S.clone(),C.x-=T-B*l),w.sub(M.clone().setLength(e))}if(c>0){let e=c/L;E=_.clone().sub(new hA(e,-c)),_.add(M.clone().setLength(e)),u&&(A=E.clone(),A.x-=T-B*c,k.sub(M.clone().setLength(e)))}M=w.clone().sub(_);let F=M.length()<.5,j=[];for(let H=0;H<=n;H++){let h=[],d=H/n,p=d*o+s,y=new hA(Math.sin(p),Math.cos(p));if(A&&E?(V(h,d,y,O,c,A,-1,!0),V(h,d,y,I,c,E,-1,!1)):E?(U(h,y,E.x,0,-1),V(h,d,y,I,c,E,-1,!1)):a||U(h,y,t,D,-1),rY(aY(M).normalize(),y,b),!F)for(let e=0;e<=r;e++){let t=e/r;rY(M.clone().multiplyScalar(t).add(_),y,x),f.push(x.x,x.y,x.z),m.push(b.x,b.y,b.z),g.push(d,.5+x.y/i),h.push(v++)}if(C&&S?(V(h,d,y,O,l,S,1,!1),V(h,d,y,I,l,C,1,!0)):S?(V(h,d,y,O,l,S,1,!1),U(h,y,S.x,0,1)):a||U(h,y,e,P,1),u&&!F){rY(aY(M).multiplyScalar(-1).normalize(),y,b);for(let e=0;e<=r;e++){let t=e/r;rY(M.clone().multiplyScalar(-t).add(k),y,x),f.push(x.x,x.y,x.z),m.push(b.x,b.y,b.z),g.push(d,.5+x.y/i),h.push(v++)}}u&&!a&&h.push(h[0]),j.push(h)}for(let H=0;H<j.length-1;H++)for(let e=0;e<j[0].length-1;e++){if(a&&u&&e==r)continue;let t=j[H][e],i=j[H+1][e],n=j[H+1][e+1],s=j[H][e+1],o=f[3*n+0],l=f[3*n+2];p.push(t,i,s),(0!=o||0!=l)&&p.push(i,n,s)}function V(e,t,n,r,a,s,o,l){for(let c=0;c<h+1;c++){let u=c/h,d=o<0?u:1-u;l&&(d-=1),d*=r;let p=new hA(Math.sin(d),Math.cos(d)*o);rY(p.clone().multiplyScalar(a).add(s),n,x),f.push(x.x,x.y,x.z),rY(p,n,b),m.push(b.x,b.y,b.z),g.push(t,.5+x.y/i),e.push(v++)}}function U(e,t,i,n,r){let a=new FA,s=new hA,o=[i,n];r<0&&o.reverse();for(let l of o)s.set(l,y*r),rY(s,t,a),f.push(a.x,a.y,a.z),m.push(0,r,0),g.push(.5,.5),e.push(v++)}function G(i,n,r){let a=new hA(Math.sin(r),Math.cos(r)),s=new hA(-Math.cos(r),Math.sin(r)),o=new FA,l=i<0?(e,t,i)=>p.push(e,t,i):(e,t,i)=>p.push(e,i,t);rY(new hA((e+t+P+D)/4,0),a,o),f.push(o.x,o.y,o.z),m.push(s.x,0,s.y),g.push(.5,.5);let c=v++;for(let e of n){let t=f.slice(3*e,3*e+3);f.push(...t),m.push(s.x,0,s.y);let i=g.slice(2*e,2*e+2);g.push(...i),v++}for(let e=c+1;e<v-1;e++)l(c,e,e+1);l(c,v-1,c+1)}o<2*Math.PI&&(G(-1,j[0],s),G(1,j[j.length-1],s+o)),this.setIndex(p),this.setAttribute("position",new sT(f,3)),this.setAttribute("normal",new sT(m,3)),this.setAttribute("uv",new sT(g,2))}},oY=Math.PI/2,lY=class extends fT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:4;super(),this.type="BoxGeometry";let l=this;n=Math.floor(n),r=Math.floor(r),a=Math.floor(a),o=Math.floor(o),s=Math.min(s,e/2,t/2,i/2);let c=[],h=[],u=[],d=[],p=0,f=0;function m(e,t,i,n,r,a,o,m,g,v,y){let b=(a-2*s)/g,x=(o-2*s)/v,w=a/2-s,_=o/2-s,S=m/2,E=g+1,C=v+1,A=0,M=0,T=new FA;for(let s=0;s<C;s++){let a=s*x-_;for(let o=0;o<E;o++){let l=o*b-w;T[e]=l*n,T[t]=a*r,T[i]=S,h.push(T.x,T.y,T.z),T[e]=0,T[t]=0,T[i]=m>0?1:-1,u.push(T.x,T.y,T.z),d.push(o/g),d.push(1-s/v),A+=1}}for(let s=0;s<v;s++)for(let e=0;e<g;e++){let t=p+e+E*s,i=p+e+E*(s+1),n=p+(e+1)+E*(s+1),r=p+(e+1)+E*s;c.push(t,i,r),c.push(i,n,r),M+=6}l.addGroup(f,M,y),f+=M,p+=A}function g(e,t,i,n,r,a,m,g,v,y,b){let x=(m-2*s)/y,w=m/2-s,_=g/2-s,S=v/2,E=y+1,C=0,A=0,M=new FA,T=new FA;for(let l=0;l<o+1;l++){let c=l/o*oY,p=Math.sin(c)*s,f=(1-Math.cos(c))*s,m=Math.sin(c),g=Math.cos(c);M[t]=(_+p)*r,M[i]=(S-f)*a,T[e]=0,T[t]=m*Math.sign(M[t]),T[i]=g*Math.sign(M[i]);for(let t=0;t<E;t++){let i=t*x-w;M[e]=i*n,h.push(M.x,M.y,M.z),u.push(T.x,T.y,T.z),d.push(t/y),d.push(0),C+=1}}for(let s=0;s<o;s++)for(let e=0;e<y;e++){let t=p+e+E*s,i=p+e+E*(s+1),n=p+(e+1)+E*(s+1),r=p+(e+1)+E*s;c.push(t,i,r),c.push(i,n,r),A+=6}l.addGroup(f,A,b),f+=A,p+=C}function v(n,r,a){let l=new FA,f=new FA(e/2,t/2,i/2);f.subScalar(s);let m=[],g=n*r*a>0?(e,t,i)=>c.push(e,t,i):(e,t,i)=>c.push(e,i,t);for(let e=0;e<=o;e++){let t=[],i=oY*(1-e/o),c=Math.cos(i),g=Math.sin(i),v=0;for(let o=0;o<=e;o++){let i=Math.cos(v),o=Math.sin(v);l.x=c*i,l.y=g,l.z=c*o;let m=f.clone().addScaledVector(l,s);h.push(n*m.x,r*m.y,a*m.z),u.push(n*l.x,r*l.y,a*l.z),d.push(0,0),t.push(p++),v+=oY/e}m.push(t)}let v=m.length-1;for(let e=0;e<v;e++){let t=m[e],i=m[e+1],n=t.length-1;g(t[0],i[1],i[0]);for(let e=1;e<=n;e++)g(t[e-1],t[e],i[e]),g(t[e],i[e+1],i[e])}}m("z","y","x",-1,-1,i,t,e,a,r,0),m("z","y","x",1,-1,i,t,-e,a,r,1),m("x","z","y",1,1,e,i,t,n,a,2),m("x","z","y",1,-1,e,i,-t,n,a,3),m("x","y","z",1,-1,e,t,i,n,r,4),m("x","y","z",-1,-1,e,t,-i,n,r,5),s>0&&(g("z","y","x",-1,-1,1,i,t,e,a,0),g("z","y","x",1,-1,-1,i,t,e,a,1),g("z","y","x",-1,1,-1,i,t,e,a,1),g("z","y","x",1,1,1,i,t,e,a,0),g("x","y","z",-1,-1,-1,e,t,i,n,0),g("x","y","z",1,-1,1,e,t,i,n,1),g("x","y","z",-1,1,1,e,t,i,n,0),g("x","y","z",1,1,-1,e,t,i,n,1),g("y","x","z",-1,-1,1,t,e,i,r,0),g("y","x","z",1,-1,-1,t,e,i,r,1),g("y","x","z",1,1,1,t,e,i,r,1),g("y","x","z",-1,1,-1,t,e,i,r,0),v(1,1,1),v(-1,1,1),v(1,-1,1),v(-1,-1,1),v(1,1,-1),v(-1,1,-1),v(1,-1,-1),v(-1,-1,-1)),this.setIndex(c),this.setAttribute("position",new sT(h,3)),this.setAttribute("normal",new sT(u,3)),this.setAttribute("uv",new sT(d,2))}},cY=class extends fT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.2,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:4;super(),this.type="PolyhedronGeometryRound";let s=[],o=[],l=[];return function(){r=Math.min(.99999,r),0==r&&(a=0);let o={IcosahedronGeometry:5,DodecahedronGeometry:3,HexahedronGeometry:3,OctahedronGeometry:4,TetrahedronGeometry:3}[i],c=new FA,h=c.clone(),u=new KM,d=r*n,p=n-d,f=a+1,m=new FA,g=(e,t)=>m.subVectors(e,t).normalize(),v=(e,t)=>Array(e).fill(void 0).map(t),y=v(e.length/3,((t,i)=>(new FA).fromArray(e,3*i).setLength(n))),b=[],x=1e6;for(let e=0;e<y.length;e++){let i,n,r,a=y[e],s=[],o=1e10,l=-1;for(;-1!=(l=t.indexOf(e,l+1));){let e=l-l%3;i=t[e+(l+1)%3],n=t[e+(l+2)%3],r=a.distanceToSquared(y[i]),o=Math.min(o,r),s.push([i,n,r])}o+=1e-6;let c=[],h=0,u=s.length;for(let t=0;t<u;t++){var w;[i,n,r]=s[h];let t=1==(null===(w=b[i])||void 0===w?void 0:w.includes(e));r<=o&&c.push(i+ +t*x),h=s.findIndex((e=>e[0]==n))}b.push(c)}let _=[];{let e,t,i=0,n=0,r=3==o;for(let s=0;s<=a;s++){e=s*(s+1)/2,t=(s+1)*(s+2)/2;for(let o=0;o<a-s;o++)[i,n]=[e+o+s+2,t+o+s+3],_.push(e,t,...r?[n,e]:[i,t],n,i),[e,t]=[i,n];_.push(e,t,e+a+2)}}let S=c.clone(),E=c.clone(),C=c.clone(),A=c.clone(),M=c.clone(),T=[],P=v(y.length,(()=>v(o,(()=>c.clone()))));for(let e=0;e<y.length;e++){c.copy(y[e]).normalize(),S.copy(c).multiplyScalar(p);let t=b[e];for(let a=0;a<t.length;a++){let i=t[a],n=t[(a+1)%o];u.setFromPointsAndIndices(y,e,i%x,n%x),u.b.sub(u.a).setLength(1e10).add(u.a),u.c.sub(u.a).setLength(1e10).add(u.a),u.closestPointToPoint(S,P[e][a])}let i=[],n=[],r=[],v=new FA;0==a&&[...P[e]].reduce(((e,t)=>e.add(t)),v).multiplyScalar(1/o);for(let s=0;s<o;s++){let t=[],l=(s-1+o)%o,u=P[e][l],y=P[e][s];c.copy(u).sub(S),h.copy(y).sub(S);let b=S.angleTo(c),x=c.angleTo(h),w=Math.cos(b)*d;0==a?E.copy(v):E.copy(S).setLength(p+w),n.push(w);let _=[E,u,y];for(let e=0;e<2;e++){let n=_[e],r=_[e+1];A.subVectors(n,S),M.subVectors(r,S),C.crossVectors(A,M).normalize();for(let a=0;a<f;a++){let r=[b,x][e]*a/f;c.copy(A).applyAxisAngle(C,r).add(S),i.push(c.clone()),e&&(g(c,S),t.push([0==a?n:c.clone(),m.clone()]))}e&&(g(r,S),t.push([r,m.clone()]))}r.push(t)}T.push(r);let w=2*f,D=2;for(let e=0;e<o;e++){let t=w*e,r=w*((e+1)%o),a=[i[t]];for(let s=1;s<f;s++){A=i[t+s],M=i[r+s],a.push(A);for(let t=1,i=s-D+1;t<=i;t++)c.lerpVectors(A,M,t/(i+1)),c.sub(S).setLength(n[e]).add(S),a.push(c.clone());a.push(M)}for(let e=0;e<f;e++)a.push(i[e+f+t]);a.push(i[r+f]);let h=_.map((e=>a[e]));s.push(...h.map((e=>[e.x,e.y,e.z])).flat()),l.push(...h.map((e=>(g(e,S),[m.x,m.y,m.z]))).flat())}}let D=[];for(let e=0;e<b.length;e++)for(let t=0;t<o;t++){let i=b[e][t];if(i<x){let n=b[i].findIndex((t=>t%x==e)),r=T[e][t],a=T[i][n];for(let e=0;e<f;e++){let t=r[e],i=a[f-e],n=r[e+1];[t,i,n,n,i,a[f-(e+1)]].forEach((e=>{s.push(e[0].x,e[0].y,e[0].z),l.push(e[1].x,e[1].y,e[1].z)}))}D.push(r[0][0],a[f][0],r[f][0],a[0][0])}}for(;D.length;){let e,t,i,n;[e,t]=D.splice(0,2);let r=[e];for(;e!=t;)r.push(t),i=D.indexOf(t),n=i%2,t=D.splice(i-n,2)[1-n];m.subVectors(r[0],r[1]).cross(c.subVectors(r[0],r[2])).normalize();let a=m.dot(r[0])<0;a&&m.negate();for(let o=1;o<=r.length-2;o++)[r[o+ +a],r[o+1-+a],r[0]].forEach((e=>{s.push(e.x,e.y,e.z),l.push(m.x,m.y,m.z)}))}}(),function(){let e=new FA;for(let p=0;p<s.length;p+=3){e.x=s[p+0],e.y=s[p+1],e.z=s[p+2];let t=u(e)/2/Math.PI+.5,i=d(e)/Math.PI+.5;o.push(t,1-i)}let t=new FA,i=new FA,n=new FA,r=new FA,a=new hA,l=new hA,c=new hA,h=(e,t,i,n)=>{n<0&&1===e.x&&(o[t]=e.x-1),0===i.x&&0===i.z&&(o[t]=n/2/Math.PI+.5)};for(let p=0,f=0;p<s.length;p+=9,f+=6){t.set(s[p+0],s[p+1],s[p+2]),i.set(s[p+3],s[p+4],s[p+5]),n.set(s[p+6],s[p+7],s[p+8]),a.set(o[f+0],o[f+1]),l.set(o[f+2],o[f+3]),c.set(o[f+4],o[f+5]),r.copy(t).add(i).add(n).divideScalar(3);let e=u(r);h(a,f+0,t,e),h(l,f+2,i,e),h(c,f+4,n,e)}for(let s=0;s<o.length;s+=6){let e=o[s+0],t=o[s+2],i=o[s+4],n=Math.max(e,t,i),r=Math.min(e,t,i);n>.9&&r<.1&&(e<.2&&(o[s+0]+=1),t<.2&&(o[s+2]+=1),i<.2&&(o[s+4]+=1))}function u(e){return Math.atan2(e.z,-e.x)}function d(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}}(),this.setAttribute("position",new sT(s,3)),this.setAttribute("normal",new sT(l,3)),void this.setAttribute("uv",new sT(o,2))}static fromJSON(e){return new cY(e.vertices,e.indices,e.radius,e.corner,e.cornerSides)}},hY=class extends cY{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.2,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,n=(1+Math.sqrt(5))/2,r=1/n,a="DodecahedronGeometry";super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r],[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],a,e,t,i),this.type=a}static fromJSON(e){return new hY(e.radius,e.corner,e.cornerSides)}},uY=1e-12,dY=class{constructor(e){this.position=new hA,this.startPosition=new hA,this.uuid=cA.generateUUID(),this.position=e.clone()}start(){this.reset()}reset(){this.startPosition.copy(this.position)}applyOffset(e){this.position.copy(this.startPosition).add(e)}copy(e){return this.position.copy(e.position),this.startPosition.copy(e.startPosition),this}clone(){return new dY(this.position).copy(this)}toJSON(){return[this.position.x,this.position.y]}},pY=class extends dY{constructor(e){super(e.position),this.parent=e}copy(e){return super.copy(e),this}clone(){return new pY(this.parent).copy(this)}},fY=class extends dY{constructor(e,t){super(t),this.controls=[],this.roundness=0,this.areControlsDirectionsMirrored=!0,this.uuid=e,this.controls.push(new pY(this),new pY(this))}static create(e,t){let i=new fY(e,new hA(...t.position));return i.controls[0].position.set(...t.controlPrevious.position),i.controls[1].position.set(...t.controlNext.position),i.roundness=t.roundness,i.areControlsDirectionsMirrored=t.areControlsDirectionsMirrored,i}getOppositeControl(e){let t=this.controls.indexOf(e);return 0===t?this.controls[1]:1===t?this.controls[0]:null}applyOffsetToControls(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;for(let i=0,n=this.controls.length;i<n;i++){let n=this.controls[i];this.position.distanceTo(n.position)<=t?n.position.copy(this.position):n.applyOffset(e)}}controlsMoved(){return!(this.position.equals(this.controls[0].position)&&this.position.equals(this.controls[1].position))}copy(e){return super.copy(e),this.controls[0].copy(e.controls[0]),this.controls[1].copy(e.controls[1]),this.roundness=e.roundness,this.uuid=e.uuid,this}clone(){return new fY(this.uuid,this.position).copy(this)}toJSON(){return super.toJSON().concat(this.controls[0].toJSON(),this.controls[1].toJSON(),[this.roundness])}computeTangents(){var e,t;return[null===(e=this.curveBefore)||void 0===e?void 0:e.getTangentAt(1),null===(t=this.curveAfter)||void 0===t?void 0:t.getTangentAt(0)]}computeNormals(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new hA,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new hA,[i,n]=this.computeTangents();return i&&n&&(mY(i,e),mY(n,t)),[e,t]}computeTangent(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new hA,[t,i]=this.computeTangents();return t&&i&&e.copy(t).add(i).normalize(),e}computeNormal(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new hA,[t,i]=this.computeNormals();return e.copy(t).add(i).normalize(),e}};function mY(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new hA,i=e.length();return t.set(-e.y/i,e.x/i)}var gY=new hA,vY=new hA,yY=new hA,bY=new hA,xY=new hA,wY=new hA,_Y=new FA,SY=new FA;function EY(e){let t=new hA;t.addVectors(e.v0,gY.subVectors(e.v1,e.v0).multiplyScalar(2/3));let i=new hA;return i.addVectors(e.v2,vY.subVectors(e.v1,e.v2).multiplyScalar(2/3)),new fO(e.v0,t,i,e.v2)}function CY(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.EPSILON;return Math.abs(e-t)<i}function AY(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.EPSILON;return e.distanceTo(t)<i}function MY(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.EPSILON;return e.distanceTo(t)<i}function TY(e,t,i){let n=Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)),r=Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2)),a=Math.sqrt(Math.pow(i.x-e.x,2)+Math.pow(i.y-e.y,2));return Math.acos((r*r+n*n-a*a)/(2*r*n))}function PY(e,t,i){return LY(e,t)&&LY(t,i)&&DY(e.position,t.position,i.position)}function DY(e,t,i){return 0===gY.copy(t).sub(e).cross(vY.copy(i).sub(e))}function kY(e,t,i,n,r){let a=Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)),s=(e.y+t.y)/2,o=(e.x+t.x)/2,l=Math.sqrt(Math.pow(i,2)-Math.pow(a/2,2))*(e.y-t.y)/a,c=Math.sqrt(Math.pow(i,2)-Math.pow(a/2,2))*(t.x-e.x)/a;return n.set(o+l,s+c),r.set(o-l,s-c),[n,r]}function OY(e,t,i){return e.distanceTo(i)<t.distanceTo(i)?t:e}function IY(e,t,i,n,r,a){let s,o=t.x-e.x,l=t.y-e.y,c=i.x-e.x,h=i.y-e.y,u=Math.sqrt((o+c)*(o+c)+(l+h)*(l+h));return TY(t,e,i)>Math.PI&&(u*=-1),s=CY(h,l)?(l+h)*(n/u-.5)*8/3/(o-c):(o+c)*(n/u-.5)*8/3/(h-l),r.set(t.x-s*l,t.y+s*o),a.set(i.x+s*h,i.y-s*c),[r,a]}function RY(e,t){return e.position.equals(e.controls[1].position)&&t.position.equals(t.controls[0].position)}function LY(e,t){return DY(e.position,e.controls[1].position,t.position)&&DY(e.position,t.controls[0].position,t.position)}function BY(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=[];for(let r=0,a=e.length;r<a;r++){let a=e[r],s=0;if(i&&void 0!==a.roundedCurveCorner){let e=.5*zY(a.roundedCurveCorner,t);r>0&&(n[r-1]+=e),s+=e}void 0!==a.curveAfter&&(s+=zY(a.curveAfter,t)),n.push(s)}return e.length>0&&i&&void 0!==e[0].roundedCurveCorner&&(n[e.length-1]+=.5*zY(e[0].roundedCurveCorner,t)),n}function zY(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12;return e&&e instanceof aO?2*t:e&&(e instanceof gO||e instanceof vO)?1:e&&e instanceof bO?t*e.points.length:t}var NY,FY,jY=new hA,VY=new hA,UY=new hA,GY=new hA,HY=new hA,WY=new hA,qY=class extends TO{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;super(),this.points=[],this.shapeHoles=[],this.plane=new WT(new FA(0,0,-1)),this.subdivision=0,this.controlSnapDistance=4,this.pointIDs=0,this.isMesh2D=!1,this.isText=!1,this._roundness=0,this.isClosed=!1,this.useCubicForRoundedCorners=!0,this.uuid=cA.generateUUID(),this.needsUpdate=!1,this.roundedCurves=[],this._width=e,this._height=t}static createFromState(e,t,i){let n=new qY;return n.isClosed=e.isClosed,n.points=e.points.map((e=>fY.create(e.id,e.data))),"number"==typeof e.roundness&&(n.roundness=e.roundness),n.shapeHoles=e.shapeHoles.map((e=>qY.createFromState(e))),void 0!==t&&void 0!==i&&n.applySize(t,i),n.update(),n}get width(){return this._width}get height(){return this._height}get roundness(){return this._roundness}set roundness(e){if(this._roundness!==e){this._roundness=e;for(let t=0,i=this.points.length;t<i;t++)this.points[t].roundness=e;this.needsUpdate=!0}}getPointsIndexesByIds(e){return e.map((e=>this.getPointIndexById(e))).filter((e=>e>=0))}getPointIndexById(e){let t=this.points.length,i=this.points.findIndex((t=>t.uuid===e));if(i<0){let i=t;for(let t=0,n=this.shapeHoles.length;t<n;t++){let n=this.shapeHoles[t],r=n.points.length,a=n.getPointIndexById(e);if(!(a<0))return a+i;i+=r}}return i}getLineIndexById(e){return this.getPointIndexById(e)}getBezierPoint(e){if(e<=this.points.length-1)return this.points[e];if(this.shapeHoles.length>0){let t=this.points.length;for(let i=0,n=this.shapeHoles.length;i<n;i++){let n=this.shapeHoles[i],r=e-t;if(r<=n.points.length-1)return n.points[r];t+=n.points.length}}throw new Error("This shape does not have a point for this index: "+e)}getBezierPointIndex(e){let t=this.points.indexOf(e);if(t>=0)return t;if(t=this.points.length,this.shapeHoles.length>0)for(let i=0,n=this.shapeHoles.length;i<n;i++){let n=this.shapeHoles[i],r=n.points.indexOf(e);if(r>=0)return t+r;t+=n.points.length}return-1}getAllPoints(){let e=[].concat(...this.shapeHoles.map((e=>e.points)));return[...this.points,...e]}applySize(e,t){0===e&&(e=.001),0===t&&(t=.001),this._width=e,this._height=t}applyScale(e,t){let i=jY.set(e,t);for(let n=0,r=this.points.length;n<r;n++){let e=this.points[n];e.position.multiply(i),e.controls[0].position.multiply(i),e.controls[1].position.multiply(i)}for(let n=0,r=this.shapeHoles.length;n<r;n++)this.shapeHoles[n].applyScale(e,t);this._update()}createPoint(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:cA.generateUUID();t=e instanceof hA?e:new hA(e,i);let r=new fY(n,t);return r.roundness=this.roundness,r}addPoint(e){this.points.push(e),this.needsUpdate=!0}addPointAt(e,t){this.points.splice(t,0,e),this.needsUpdate=!0}getPointByUuid(e){for(let t=0,i=this.points.length;t<i;t++){let i=this.points[t];if(i.uuid===e)return i}for(let t=0,i=this.shapeHoles.length;t<i;t++){let i=this.shapeHoles[t].getPointByUuid(e);if(i)return i}}getFirstPoint(){return this.points[0]}getLastPoint(){return this.points[this.points.length-1]}removePoint(e){let t=this.points.indexOf(e);t>=0&&this.points.splice(t,1),this.needsUpdate=!0}removePointById(e){let t=this.points.find((t=>t.uuid===e));t&&this.removePoint(t)}update(){for(let e=0,t=this.shapeHoles.length;e<t;e++)this.shapeHoles[e].update();this._update()}extractShapePointsToBuffer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.subdivision=t,void 0===this.curveDivisions&&this.computeCurveDivisions(t);let n=i?this.roundedCurveDivisions:this.curveDivisions;return function(e,t){let i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:12,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=SY.set(0,0,0),s=0,o=[];for(let l=0;l<t.length;l++){let r=t[l],c=gY,h=zY(r,n);o.push(h);for(let t=0;t<=h;t++)if(r instanceof fO||r instanceof yO||r instanceof gO){if(r.getPoint(t/h,c),a.set(c.x,c.y,0),void 0!==i&&MY(i,a))continue;void 0===i&&(i=_Y),i.copy(a),e.setXYZ(s,a.x,a.y,a.z),s++}}r&&s>1&&!(e.getX(s-1)===e.getX(0)&&e.getY(s-1)===e.getY(0)&&e.getZ(s-1)===e.getZ(0))&&(e.setXYZ(s,e.getX(0),e.getY(0),e.getZ(0)),s++)}(e,i?this.roundedCurves:this.curves,t,this.autoClose),n.reduce(((e,t)=>e+t),0)+1}computeCurveDivisions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12;return this.curveDivisions=BY(this.points,e,!1),this.roundedCurveDivisions=BY(this.points,e,!0),this.curveDivisions}extractFilteredShapePointsToBuffer(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:12;return 2*function(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:12,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=SY.set(0,0,0),s=0,o=[];for(let c=0;c<t.length;c++){if(!1===i[c])continue;let r,h=t[c],u=gY,d=zY(h,n);o.push(d);for(let t=0;t<=d;t++)if(h instanceof fO||h instanceof yO||h instanceof gO){var l;if(h.getPoint(t/d,u),a.set(u.x,u.y,0),null!==(l=r)&&void 0!==l&&l.equals(a))continue;void 0===r?r=_Y:(e.setXYZ(s,r.x,r.y,r.z),s++,e.setXYZ(s,a.x,a.y,a.z),s++),r.copy(a)}}return r&&s>1&&!(e.getX(s-1)===e.getX(0)&&e.getY(s-1)===e.getY(0)&&e.getZ(s-1)===e.getZ(0))&&(e.setXYZ(s,e.getX(0),e.getY(0),e.getZ(0)),s++),o}(e,this.curves,t,i,this.autoClose).reduce(((e,t)=>e+t),0)}extractShapePointsToFlatArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12;return this.subdivision=t,void 0===this.curveDivisions&&this.computeCurveDivisions(t),function(e,t){let i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:12,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=0;for(let s=0;s<t.length;s++){let r=t[s],o=zY(r,n),l=gY;for(let t=0;t<=o;t++)if(r instanceof fO||r instanceof yO||r instanceof gO){if(r.getPoint(t/o,l),void 0!==i&&AY(i,l,uY))continue;void 0===i&&(i=vY),i.copy(l),e.push(l.x,l.y),a++}}return CY(e[0],e[e.length-2],uY)&&CY(e[1],e[e.length-1],uY)&&(e.pop(),e.pop()),r&&a>1&&!(CY(e[a-1],e[1],uY)&&CY(e[a-2],e[0],uY))&&(e.push(e[0],e[1]),a++),e}(e,this.roundedCurves,t,this.autoClose)}getCurveIndexFromVertexId(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=0;void 0===this.curveDivisions&&this.computeCurveDivisions(this.subdivision);let n=t?this.roundedCurveDivisions:this.curveDivisions,r=0;t&&void 0!==this.points[0].roundedCurveCorner&&(r=.5*zY(this.points[0].roundedCurveCorner,this.subdivision));let a=e-r;a<0&&(a+=n.reduce(((e,t)=>e+t),0));for(let s=0,o=n.length;s<o;s++){let e=n[s];if(a<i+e)return[s,(a-i+1)/e];i+=e}return[0,1]}getCurveT(e,t,i){let n=this.points[e],r=this.points[e>=this.points.length-1?0:e+1],a=this.curveDivisions,s=a[e];if(RY(n,r)){let e=n.position.distanceTo(r.position);return n.position.distanceTo(jY.set(i.x,i.y))/e}let o=0;for(let l=0;l<e;l++)o+=a[l];return(t-o)/s}dispose(){}_applyCurveForPoint(e,t){RY(t,e)?this.lineTo(e.position.x,e.position.y):this.bezierCurveTo(t.controls[1].position.x,t.controls[1].position.y,e.controls[0].position.x,e.controls[0].position.y,e.position.x,e.position.y);let i=this.curves[this.curves.length-1];e.curveBefore=i,t.curveAfter=i;let n=i.clone();e.roundedCurveBefore=n,t.roundedCurveAfter=n,e.roundedCurveCorner=void 0,this.roundedCurves.push(n)}_update(){if(this.curves=[],this.roundedCurves=[],!this.points.length)return;for(let n=0,r=this.points.length;n<r;n++){let e=this.points[n];if(0===n)this.moveTo(e.position.x,e.position.y);else{let t=this.points[n-1];this._applyCurveForPoint(e,t)}}let e=this.getLastPoint();if(null!==e&&void 0!==e&&e.curveAfter&&(e.curveAfter=void 0),this.isClosed){let e=this.points[0],t=this.points[this.points.length-1];this._applyCurveForPoint(e,t)}if(this.points.length>2){let e=0;for(let n=0,r=this.points.length;n<r;n++){var t,i;let r=this.points[n],a=null!==(t=this.points[n-1])&&void 0!==t?t:this.points[this.points.length-1],s=null!==(i=this.points[n+1])&&void 0!==i?i:this.points[0],o=r.roundness,l=a&&s&&PY(a,r,s);if(!r.controlsMoved()&&o>0&&!l){let t=r.curveBefore,i=r.curveAfter;if(void 0===t||void 0===i)continue;let a,s=r.roundedCurveBefore,l=r.roundedCurveAfter,c=t.getLength(),h=i.getLength(),u=Math.min(o,.499*c),d=Math.min(o,.499*h),p=Math.min(u,d),f=1-p/c,m=p/h,g=t.getPointAt(f,jY),v=i.getPointAt(m,VY);if(this._subSplitCurve(t,s,f,g,void 0),this._subSplitCurve(i,l,m,void 0,v),this.useCubicForRoundedCorners){let e=TY(g,r.position,v)/2,t=Math.tan(e)*g.distanceTo(r.position),[i,n]=kY(g,v,t,UY,GY),s=OY(i,n,r.position),[o,l]=IY(s,g,v,t,HY,WY);a=new fO(g.clone(),o.clone(),l.clone(),v.clone())}else a=new yO(g.clone(),r.position.clone(),v.clone());r.roundedCurveCorner=a,this.roundedCurves.splice(n+e,0,a),e++}}}}_subSplitCurve(e,t,i,n,r){if(!(e instanceof gO)){let a=e,s=t,o=a.getUtoTmapping(i,0),l=function(e,t,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.5,a=gY.subVectors(t,e).multiplyScalar(r).add(e),s=vY.subVectors(i,t).multiplyScalar(r).add(t),o=yY.subVectors(n,i).multiplyScalar(r).add(i),l=a,c=bY.subVectors(s,a).multiplyScalar(r).add(a),h=xY.subVectors(o,s).multiplyScalar(r).add(s),u=o,d=wY.subVectors(h,c).multiplyScalar(r).add(c);return[e.x,e.y,l.x,l.y,c.x,c.y,d.x,d.y,h.x,h.y,u.x,u.y,n.x,n.y]}(a.v0,a.v1,a.v2,a.v3,o);return void 0!==n&&(s.v0.set(l[0],l[1]),s.v1.set(l[2],l[3]),s.v2.set(l[4],l[5]),s.v3.set(l[6],l[7])),void 0!==r&&(s.v0.set(l[6],l[7]),s.v1.set(l[8],l[9]),s.v2.set(l[10],l[11]),s.v3.set(l[12],l[13])),s}return void 0!==n&&t.v2.copy(n),void 0!==r&&t.v1.copy(r),t}clone(){let e=new qY(this._width,this._height);return e.points=this.points.map((e=>e.clone())),e.isClosed=this.isClosed,e.roundness=this.roundness,e.isMesh2D=this.isMesh2D,e.shapeHoles=this.shapeHoles.map((e=>e.clone())),e}toJSON(){return{points:this.points.reduce(((e,t)=>e.concat(t.toJSON())),[]),shapeHoles:this.shapeHoles.map((e=>e.toJSON())),isClosed:this.isClosed,roundness:this.roundness}}fromJSON(e){var t;this.points=[],this.pointIDs=0;let i=e.points.length/7;for(let n=0;n<i;n++){let t=7*n,i=e.points[t+0],r=e.points[t+1],a=e.points[t+2],s=e.points[t+3],o=e.points[t+4],l=e.points[t+5],c=e.points[t+6],h=new fY(cA.generateUUID(),new hA(i,r));h.controls[0].position.set(a,s),h.controls[1].position.set(o,l),h.roundness=c,this.points.push(h)}return this.shapeHoles=null!==(t=e.shapeHoles)&&void 0!==t&&t.length?e.shapeHoles.map((e=>{let t=new qY;return t.fromJSON(e),t})):[],this.isClosed=e.isClosed,this._roundness=e.roundness,this._update(),this}fromShape(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.isText=t;let i=(e,t)=>{t instanceof fO&&t.v3.equals(e.position)&&e.controls[0].position.copy(t.v2)};return this.points=(e=>{let t,n,r=[];for(t=0,n=e.length;t<n;t++)e[t]instanceof yO&&(e[t]=EY(e[t]));for(t=0,n=e.length;t<n;t++){let n,a=e[t],s=t>0?e[t-1]:null;a instanceof fO?(n=this.createPoint(a.v0),n.controls[1].position.copy(a.v1)):a instanceof gO&&(n=this.createPoint(a.v1)),void 0!==n&&(null!==s&&i(n,s),r.push(n))}let a=e[e.length-1],s=!1;return a instanceof fO?a.v3.equals(r[0].position)&&(r[0].controls[0].position.copy(a.v2),s=!0):a instanceof gO&&a.v2.equals(r[0].position)&&(s=!0),this.isClosed=s,r})(e.curves),e instanceof TO&&(this.shapeHoles=e.holes.map((e=>{let t=new qY;return t.fromShape(e),t}))),this.update(),this}updatePoint(e,t){let i=this.getPointByUuid(e);i&&(void 0!==t.position&&i.position.fromArray(t.position),void 0!==t.roundness&&(i.roundness=t.roundness),void 0!==t.areControlsDirectionsMirrored&&(i.areControlsDirectionsMirrored=t.areControlsDirectionsMirrored),this.needsUpdate=!0)}updatePreviousControl(e,t){var i;let n=null===(i=this.getPointByUuid(e))||void 0===i?void 0:i.controls[0];n&&(t.position&&n.position.fromArray(t.position),this.needsUpdate=!0)}updateNextControl(e,t){var i;let n=null===(i=this.getPointByUuid(e))||void 0===i?void 0:i.controls[1];n&&(t.position&&n.position.fromArray(t.position),this.needsUpdate=!0)}},XY=2*Math.PI;function YY(e,t,i,n,r){let{x:a,y:s}=e;return{x:a*t+n,y:s*i+r}}function QY(e,t){let i=1.5707963267948966===t?.551915024494:-1.5707963267948966===t?-.551915024494:1.3333333333333333*Math.tan(t/4),n=Math.cos(e),r=Math.sin(e),a=Math.cos(e+t),s=Math.sin(e+t);return[{x:n-r*i,y:r+n*i},{x:a+s*i,y:s-a*i},{x:a,y:s}]}function ZY(e,t,i,n){let r=e*n-t*i<0?-1:1,a=Math.min(1,Math.max(-1,e*i+t*n));return r*Math.acos(a)}function KY(e){let{px:t,py:i,cx:n,cy:r,rx:a,ry:s,largeArcFlag:o,sweepFlag:l}=e,c=[];if(0===a||0===s)return[];let h=(t-n)/2,u=(i-r)/2;if(0===h&&0===u)return[];a=Math.abs(a),s=Math.abs(s);let d=Math.pow(h,2)/Math.pow(a,2)+Math.pow(u,2)/Math.pow(s,2);d>1&&(a*=Math.sqrt(d),s*=Math.sqrt(d));let p=function(e,t,i,n,r,a,s,o,l,c){let h=Math.pow(r,2),u=Math.pow(a,2),d=Math.pow(s,2),p=Math.pow(o,2),f=h*u-h*p-u*d;f<0&&(f=0),f/=h*p+u*d,f=Math.sqrt(f)*(l===c?-1:1);let m=f*r/a*o,g=f*-a/r*s,v=m+(e+i)/2,y=g+(t+n)/2,b=(s-m)/r,x=(o-g)/a,w=(-s-m)/r,_=(-o-g)/a,S=ZY(1,0,b,x),E=ZY(b,x,w,_);return!c&&E>0&&(E-=XY),c&&E<0&&(E+=XY),{centerx:v,centery:y,ang1:S,ang2:E}}(t,i,n,r,a,s,h,u,o,l),{ang1:f,ang2:m}=p,{centerx:g,centery:v}=p,y=Math.abs(m)/(XY/4);Math.abs(1-y)<1e-7&&(y=1);let b=Math.max(Math.ceil(y),1);m/=b;for(let x=0;x<b;x++)c.push(QY(f,m)),f+=m;return c.map((e=>{let{x:t,y:i}=YY(e[0],a,s,g,v),{x:n,y:r}=YY(e[1],a,s,g,v),{x:o,y:l}=YY(e[2],a,s,g,v);return{x1:t,y1:i,x2:n,y2:r,x:o,y:l}}))}function JY(e,t){if(!e)throw t||"Assertion Failed!"}!function(e){e[e.ODD=0]="ODD",e[e.NONZERO=1]="NONZERO",e[e.POSITIVE=2]="POSITIVE",e[e.NEGATIVE=3]="NEGATIVE",e[e.ABS_GEQ_TWO=4]="ABS_GEQ_TWO"}(NY||(NY={})),function(e){e[e.POLYGONS=0]="POLYGONS",e[e.CONNECTED_POLYGONS=1]="CONNECTED_POLYGONS",e[e.BOUNDARY_CONTOURS=2]="BOUNDARY_CONTOURS"}(FY||(FY={}));var $Y=function(){function e(){}return e.vertEq=function(e,t){return e.s===t.s&&e.t===t.t},e.vertLeq=function(e,t){return e.s<t.s||e.s===t.s&&e.t<=t.t},e.transLeq=function(e,t){return e.t<t.t||e.t===t.t&&e.s<=t.s},e.edgeGoesLeft=function(t){return e.vertLeq(t.Dst,t.Org)},e.edgeGoesRight=function(t){return e.vertLeq(t.Org,t.Dst)},e.vertL1dist=function(e,t){return Math.abs(e.s-t.s)+Math.abs(e.t-t.t)},e.edgeEval=function(t,i,n){JY(e.vertLeq(t,i)&&e.vertLeq(i,n));var r=i.s-t.s,a=n.s-i.s;return r+a>0?r<a?i.t-t.t+(t.t-n.t)*(r/(r+a)):i.t-n.t+(n.t-t.t)*(a/(r+a)):0},e.edgeSign=function(t,i,n){JY(e.vertLeq(t,i)&&e.vertLeq(i,n));var r=i.s-t.s,a=n.s-i.s;return r+a>0?(i.t-n.t)*r+(i.t-t.t)*a:0},e.transEval=function(t,i,n){JY(e.transLeq(t,i)&&e.transLeq(i,n));var r=i.t-t.t,a=n.t-i.t;return r+a>0?r<a?i.s-t.s+(t.s-n.s)*(r/(r+a)):i.s-n.s+(n.s-t.s)*(a/(r+a)):0},e.transSign=function(t,i,n){JY(e.transLeq(t,i)&&e.transLeq(i,n));var r=i.t-t.t,a=n.t-i.t;return r+a>0?(i.s-n.s)*r+(i.s-t.s)*a:0},e.vertCCW=function(e,t,i){return e.s*(t.t-i.t)+t.s*(i.t-e.t)+i.s*(e.t-t.t)>=0},e.interpolate=function(e,t,i,n){return(e=e<0?0:e)<=(i=i<0?0:i)?0===i?(t+n)/2:t+e/(e+i)*(n-t):n+i/(e+i)*(t-n)},e.intersect=function(t,i,n,r,a){var s,o,l;e.vertLeq(t,i)||(l=t,t=i,i=l),e.vertLeq(n,r)||(l=n,n=r,r=l),e.vertLeq(t,n)||(l=t,t=n,n=l,l=i,i=r,r=l),e.vertLeq(n,i)?e.vertLeq(i,r)?((s=e.edgeEval(t,n,i))+(o=e.edgeEval(n,i,r))<0&&(s=-s,o=-o),a.s=e.interpolate(s,n.s,o,i.s)):((s=e.edgeSign(t,n,i))+(o=-e.edgeSign(t,r,i))<0&&(s=-s,o=-o),a.s=e.interpolate(s,n.s,o,r.s)):a.s=(n.s+i.s)/2,e.transLeq(t,i)||(l=t,t=i,i=l),e.transLeq(n,r)||(l=n,n=r,r=l),e.transLeq(t,n)||(l=t,t=n,n=l,l=i,i=r,r=l),e.transLeq(n,i)?e.transLeq(i,r)?((s=e.transEval(t,n,i))+(o=e.transEval(n,i,r))<0&&(s=-s,o=-o),a.t=e.interpolate(s,n.t,o,i.t)):((s=e.transSign(t,n,i))+(o=-e.transSign(t,r,i))<0&&(s=-s,o=-o),a.t=e.interpolate(s,n.t,o,r.t)):a.t=(n.t+i.t)/2},e}(),eQ=function(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1},tQ=function(){function e(e){this.side=e,this.next=null,this.Org=null,this.Sym=null,this.Onext=null,this.Lnext=null,this.Lface=null,this.activeRegion=null,this.winding=0}return Object.defineProperty(e.prototype,"Rface",{get:function(){return this.Sym.Lface},set:function(e){this.Sym.Lface=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Dst",{get:function(){return this.Sym.Org},set:function(e){this.Sym.Org=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Oprev",{get:function(){return this.Sym.Lnext},set:function(e){this.Sym.Lnext=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Lprev",{get:function(){return this.Onext.Sym},set:function(e){this.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Dprev",{get:function(){return this.Lnext.Sym},set:function(e){this.Lnext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Rprev",{get:function(){return this.Sym.Onext},set:function(e){this.Sym.Onext=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Dnext",{get:function(){return this.Sym.Onext.Sym},set:function(e){this.Sym.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Rnext",{get:function(){return this.Sym.Lnext.Sym},set:function(e){this.Sym.Lnext.Sym=e},enumerable:!0,configurable:!0}),e}(),iQ=function(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0},nQ=function(){function e(){var e=new iQ,t=new eQ,i=new tQ(0),n=new tQ(1);e.next=e.prev=e,e.anEdge=null,t.next=t.prev=t,i.next=i,i.Sym=n,n.next=n,n.Sym=i,this.vHead=e,this.fHead=t,this.eHead=i,this.eHeadSym=n}return e.prototype.makeEdge_=function(e){var t=new tQ(0),i=new tQ(1);e.Sym.side<e.side&&(e=e.Sym);var n=e.Sym.next;return i.next=n,n.Sym.next=t,t.next=e,e.Sym.next=i,t.Sym=i,t.Onext=t,t.Lnext=i,t.Org=null,t.Lface=null,t.winding=0,t.activeRegion=null,i.Sym=t,i.Onext=i,i.Lnext=t,i.Org=null,i.Lface=null,i.winding=0,i.activeRegion=null,t},e.prototype.splice_=function(e,t){var i=e.Onext,n=t.Onext;i.Sym.Lnext=t,n.Sym.Lnext=e,e.Onext=n,t.Onext=i},e.prototype.makeVertex_=function(e,t,i){var n=e;JY(n,"Vertex can't be null!");var r=i.prev;n.prev=r,r.next=n,n.next=i,i.prev=n,n.anEdge=t;var a=t;do{a.Org=n,a=a.Onext}while(a!==t)},e.prototype.makeFace_=function(e,t,i){var n=e;JY(n,"Face can't be null");var r=i.prev;n.prev=r,r.next=n,n.next=i,i.prev=n,n.anEdge=t,n.trail=null,n.marked=!1,n.inside=i.inside;var a=t;do{a.Lface=n,a=a.Lnext}while(a!==t)},e.prototype.killEdge_=function(e){e.Sym.side<e.side&&(e=e.Sym);var t=e.next,i=e.Sym.next;t.Sym.next=i,i.Sym.next=t},e.prototype.killVertex_=function(e,t){var i=e.anEdge,n=i;do{n.Org=t,n=n.Onext}while(n!==i);var r=e.prev,a=e.next;a.prev=r,r.next=a},e.prototype.killFace_=function(e,t){var i=e.anEdge,n=i;do{n.Lface=t,n=n.Lnext}while(n!==i);var r=e.prev,a=e.next;a.prev=r,r.next=a},e.prototype.makeEdge=function(){var e=new iQ,t=new iQ,i=new eQ,n=this.makeEdge_(this.eHead);return this.makeVertex_(e,n,this.vHead),this.makeVertex_(t,n.Sym,this.vHead),this.makeFace_(i,n,this.fHead),n},e.prototype.splice=function(e,t){var i=!1,n=!1;if(e!==t){if(t.Org!==e.Org&&(n=!0,this.killVertex_(t.Org,e.Org)),t.Lface!==e.Lface&&(i=!0,this.killFace_(t.Lface,e.Lface)),this.splice_(t,e),!n){var r=new iQ;this.makeVertex_(r,t,e.Org),e.Org.anEdge=e}if(!i){var a=new eQ;this.makeFace_(a,t,e.Lface),e.Lface.anEdge=e}}},e.prototype.delete=function(e){var t=e.Sym,i=!1;if(e.Lface!==e.Rface&&(i=!0,this.killFace_(e.Lface,e.Rface)),e.Onext===e)this.killVertex_(e.Org,null);else if(e.Rface.anEdge=e.Oprev,e.Org.anEdge=e.Onext,this.splice_(e,e.Oprev),!i){var n=new eQ;this.makeFace_(n,e,e.Lface)}t.Onext===t?(this.killVertex_(t.Org,null),this.killFace_(t.Lface,null)):(e.Lface.anEdge=t.Oprev,t.Org.anEdge=t.Onext,this.splice_(t,t.Oprev)),this.killEdge_(e)},e.prototype.addEdgeVertex=function(e){var t=this.makeEdge_(e),i=t.Sym;this.splice_(t,e.Lnext),t.Org=e.Dst;var n=new iQ;return this.makeVertex_(n,i,t.Org),t.Lface=i.Lface=e.Lface,t},e.prototype.splitEdge=function(e){var t=this.addEdgeVertex(e).Sym;return this.splice_(e.Sym,e.Sym.Oprev),this.splice_(e.Sym,t),e.Dst=t.Org,t.Dst.anEdge=t.Sym,t.Rface=e.Rface,t.winding=e.winding,t.Sym.winding=e.Sym.winding,t.idx=e.idx,t.Sym.idx=e.Sym.idx,t},e.prototype.connect=function(e,t){var i=!1,n=this.makeEdge_(e),r=n.Sym;if(t.Lface!==e.Lface&&(i=!0,this.killFace_(t.Lface,e.Lface)),this.splice_(n,e.Lnext),this.splice_(r,t),n.Org=e.Dst,r.Org=t.Org,n.Lface=r.Lface=e.Lface,e.Lface.anEdge=r,!i){var a=new eQ;this.makeFace_(a,n,e.Lface)}return n},e.prototype.zapFace=function(e){var t,i,n,r,a,s=e.anEdge;i=s.Lnext;do{i=(t=i).Lnext,t.Lface=null,null===t.Rface&&(t.Onext===t?this.killVertex_(t.Org,null):(t.Org.anEdge=t.Onext,this.splice_(t,t.Oprev)),(n=t.Sym).Onext===n?this.killVertex_(n.Org,null):(n.Org.anEdge=n.Onext,this.splice_(n,n.Oprev)),this.killEdge_(t))}while(t!=s);r=e.prev,(a=e.next).prev=r,r.next=a},e.prototype.countFaceVerts_=function(e){var t=e.anEdge,i=0;do{i++,t=t.Lnext}while(t!==e.anEdge);return i},e.prototype.mergeConvexFaces=function(e){var t,i,n,r,a;for(t=this.fHead.next;t!==this.fHead;t=t.next)if(t.inside)for(a=(i=t.anEdge).Org;n=i.Lnext,(r=i.Sym)&&r.Lface&&r.Lface.inside&&(this.countFaceVerts_(t)+this.countFaceVerts_(r.Lface)-2<=e&&$Y.vertCCW(i.Lprev.Org,i.Org,r.Lnext.Lnext.Org)&&$Y.vertCCW(r.Lprev.Org,r.Org,i.Lnext.Lnext.Org)&&(n=r.Lnext,this.delete(r),i=null,r=null)),!i||i.Lnext.Org!==a;)i=n;return!0},e.prototype.check=function(){var e,t,i,n,r,a,s=this.fHead,o=this.vHead,l=this.eHead;for(t=s,t=s;(e=t.next)!==s;t=e){JY(e.prev===t),r=e.anEdge;do{JY(r.Sym!==r),JY(r.Sym.Sym===r),JY(r.Lnext.Onext.Sym===r),JY(r.Onext.Sym.Lnext===r),JY(r.Lface===e),r=r.Lnext}while(r!==e.anEdge)}for(JY(e.prev===t&&null===e.anEdge),n=o,n=o;(i=n.next)!==o;n=i){JY(i.prev===n),r=i.anEdge;do{JY(r.Sym!==r),JY(r.Sym.Sym===r),JY(r.Lnext.Onext.Sym===r),JY(r.Onext.Sym.Lnext===r),JY(r.Org===i),r=r.Onext}while(r!==i.anEdge)}for(JY(i.prev===n&&null===i.anEdge),a=l,a=l;(r=a.next)!==l;a=r)JY(r.Sym.next===a.Sym),JY(r.Sym!==r),JY(r.Sym.Sym===r),JY(null!==r.Org),JY(null!==r.Dst),JY(r.Lnext.Onext.Sym===r),JY(r.Onext.Sym.Lnext===r);JY(r.Sym.next===a.Sym&&r.Sym===this.eHeadSym&&r.Sym.Sym===r&&null===r.Org&&null===r.Dst&&null===r.Lface&&null===r.Rface)},e}(),rQ=function(){this.handle=null},aQ=function(){this.key=null,this.node=0},sQ=function(){function e(e,t){this.leq=t,this.max=0,this.nodes=[],this.handles=[],this.initialized=!1,this.freeList=0,this.size=0,this.max=e,this.nodes=[],this.handles=[];for(var i=0;i<e+1;i++)this.nodes[i]=new rQ,this.handles[i]=new aQ;this.initialized=!1,this.nodes[1].handle=1,this.handles[1].key=null}return e.prototype.floatDown_=function(e){var t,i,n,r=this.nodes,a=this.handles;for(t=r[e].handle;;){if((n=e<<1)<this.size&&this.leq(a[r[n+1].handle].key,a[r[n].handle].key)&&++n,JY(n<=this.max),i=r[n].handle,n>this.size||this.leq(a[t].key,a[i].key)){r[e].handle=t,a[t].node=e;break}r[e].handle=i,a[i].node=e,e=n}},e.prototype.floatUp_=function(e){var t,i,n,r=this.nodes,a=this.handles;for(t=r[e].handle;;){if(i=r[n=e>>1].handle,0===n||this.leq(a[i].key,a[t].key)){r[e].handle=t,a[t].node=e;break}r[e].handle=i,a[i].node=e,e=n}},e.prototype.init=function(){for(var e=this.size;e>=1;--e)this.floatDown_(e);this.initialized=!0},e.prototype.min=function(){return this.handles[this.nodes[1].handle].key},e.prototype.insert=function(e){var t,i;if(2*(t=++this.size)>this.max){var n,r;for(this.max*=2,r=this.nodes.length,this.nodes.length=this.max+1,n=r;n<this.nodes.length;n++)this.nodes[n]=new rQ;for(r=this.handles.length,this.handles.length=this.max+1,n=r;n<this.handles.length;n++)this.handles[n]=new aQ}return 0===this.freeList?i=t:(i=this.freeList,this.freeList=this.handles[i].node),this.nodes[t].handle=i,this.handles[i].node=t,this.handles[i].key=e,this.initialized&&this.floatUp_(t),i},e.prototype.extractMin=function(){var e=this.nodes,t=this.handles,i=e[1].handle,n=t[i].key;return this.size>0&&(e[1].handle=e[this.size].handle,t[e[1].handle].node=1,t[i].key=null,t[i].node=this.freeList,this.freeList=i,--this.size,this.size>0&&this.floatDown_(1)),n},e.prototype.delete=function(e){var t,i=this.nodes,n=this.handles;JY(e>=1&&e<=this.max&&null!==n[e].key),i[t=n[e].node].handle=i[this.size].handle,n[i[t].handle].node=t,--this.size,t<=this.size&&(t<=1||this.leq(n[i[t>>1].handle].key,n[i[t].handle].key)?this.floatDown_(t):this.floatUp_(t)),n[e].key=null,n[e].node=this.freeList,this.freeList=e},e}(),oQ=function(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1},lQ=function(){this.key=null,this.next=null,this.prev=null},cQ=function(){function e(e,t){this.frame=e,this.leq=t,this.head=new lQ,this.head.next=this.head,this.head.prev=this.head}return e.prototype.min=function(){return this.head.next},e.prototype.max=function(){return this.head.prev},e.prototype.insert=function(e){return this.insertBefore(this.head,e)},e.prototype.search=function(e){var t=this.head;do{t=t.next}while(null!==t.key&&!this.leq(this.frame,e,t.key));return t},e.prototype.insertBefore=function(e,t){do{e=e.prev}while(null!==e.key&&!this.leq(this.frame,e.key,t));var i=new lQ;return i.key=t,i.next=e.next,e.next.prev=i,i.prev=e,e.next=i,i},e.prototype.delete=function(e){e.next.prev=e.prev,e.prev.next=e.next},e}(),hQ=function(){function e(){}return e.regionBelow=function(e){return e.nodeUp.prev.key},e.regionAbove=function(e){return e.nodeUp.next.key},e.debugEvent=function(e){},e.addWinding=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},e.edgeLeq=function(e,t,i){var n=e.event,r=t.eUp,a=i.eUp;return r.Dst===n?a.Dst===n?$Y.vertLeq(r.Org,a.Org)?$Y.edgeSign(a.Dst,r.Org,a.Org)<=0:$Y.edgeSign(r.Dst,a.Org,r.Org)>=0:$Y.edgeSign(a.Dst,n,a.Org)<=0:a.Dst===n?$Y.edgeSign(r.Dst,n,r.Org)>=0:$Y.edgeEval(r.Dst,n,r.Org)>=$Y.edgeEval(a.Dst,n,a.Org)},e.deleteRegion=function(e,t){t.fixUpperEdge&&JY(0===t.eUp.winding),t.eUp.activeRegion=null,e.dict.delete(t.nodeUp)},e.fixUpperEdge=function(e,t,i){JY(t.fixUpperEdge),e.mesh.delete(t.eUp),t.fixUpperEdge=!1,t.eUp=i,i.activeRegion=t},e.topLeftRegion=function(t,i){var n,r=i.eUp.Org;do{i=e.regionAbove(i)}while(i.eUp.Org===r);if(i.fixUpperEdge){if(null===(n=t.mesh.connect(e.regionBelow(i).eUp.Sym,i.eUp.Lnext)))return null;e.fixUpperEdge(t,i,n),i=e.regionAbove(i)}return i},e.topRightRegion=function(t){var i=t.eUp.Dst;do{t=e.regionAbove(t)}while(t.eUp.Dst===i);return t},e.addRegionBelow=function(e,t,i){var n=new oQ;return n.eUp=i,n.nodeUp=e.dict.insertBefore(t.nodeUp,n),n.fixUpperEdge=!1,n.sentinel=!1,n.dirty=!1,i.activeRegion=n,n},e.isWindingInside=function(e,t){switch(e.windingRule){case NY.ODD:return 0!==(1&t);case NY.NONZERO:return 0!==t;case NY.POSITIVE:return t>0;case NY.NEGATIVE:return t<0;case NY.ABS_GEQ_TWO:return t>=2||t<=-2}throw new Error("Invalid winding rulle")},e.computeWinding=function(t,i){i.windingNumber=e.regionAbove(i).windingNumber+i.eUp.winding,i.inside=e.isWindingInside(t,i.windingNumber)},e.finishRegion=function(t,i){var n=i.eUp,r=n.Lface;r.inside=i.inside,r.anEdge=n,e.deleteRegion(t,i)},e.finishLeftRegions=function(t,i,n){for(var r,a=null,s=i,o=i.eUp;s!==n;){if(s.fixUpperEdge=!1,(r=(a=e.regionBelow(s)).eUp).Org!=o.Org){if(!a.fixUpperEdge){e.finishRegion(t,s);break}r=t.mesh.connect(o.Lprev,r.Sym),e.fixUpperEdge(t,a,r)}o.Onext!==r&&(t.mesh.splice(r.Oprev,r),t.mesh.splice(o,r)),e.finishRegion(t,s),o=a.eUp,s=a}return o},e.addRightEdges=function(t,i,n,r,a,s){var o,l,c,h,u=!0;c=n;do{JY($Y.vertLeq(c.Org,c.Dst)),e.addRegionBelow(t,i,c.Sym),c=c.Onext}while(c!==r);for(null===a&&(a=e.regionBelow(i).eUp.Rprev),l=i,h=a;(c=(o=e.regionBelow(l)).eUp.Sym).Org===h.Org;)c.Onext!==h&&(t.mesh.splice(c.Oprev,c),t.mesh.splice(h.Oprev,c)),o.windingNumber=l.windingNumber-c.winding,o.inside=e.isWindingInside(t,o.windingNumber),l.dirty=!0,!u&&e.checkForRightSplice(t,l)&&(e.addWinding(c,h),e.deleteRegion(t,l),t.mesh.delete(h)),u=!1,l=o,h=c;l.dirty=!0,JY(l.windingNumber-c.winding===o.windingNumber),s&&e.walkDirtyRegions(t,l)},e.spliceMergeVertices=function(e,t,i){e.mesh.splice(t,i)},e.vertexWeights=function(e,t,i){var n=$Y.vertL1dist(t,e),r=$Y.vertL1dist(i,e),a=.5*r/(n+r),s=.5*n/(n+r);e.coords[0]+=a*t.coords[0]+s*i.coords[0],e.coords[1]+=a*t.coords[1]+s*i.coords[1],e.coords[2]+=a*t.coords[2]+s*i.coords[2]},e.getIntersectData=function(t,i,n,r,a,s){i.coords[0]=i.coords[1]=i.coords[2]=0,i.idx=-1,e.vertexWeights(i,n,r),e.vertexWeights(i,a,s)},e.checkForRightSplice=function(t,i){var n=e.regionBelow(i),r=i.eUp,a=n.eUp;if($Y.vertLeq(r.Org,a.Org)){if($Y.edgeSign(a.Dst,r.Org,a.Org)>0)return!1;$Y.vertEq(r.Org,a.Org)?r.Org!==a.Org&&(t.pq.delete(r.Org.pqHandle),e.spliceMergeVertices(t,a.Oprev,r)):(t.mesh.splitEdge(a.Sym),t.mesh.splice(r,a.Oprev),i.dirty=n.dirty=!0)}else{if($Y.edgeSign(r.Dst,a.Org,r.Org)<0)return!1;e.regionAbove(i).dirty=i.dirty=!0,t.mesh.splitEdge(r.Sym),t.mesh.splice(a.Oprev,r)}return!0},e.checkForLeftSplice=function(t,i){var n,r=e.regionBelow(i),a=i.eUp,s=r.eUp;if(JY(!$Y.vertEq(a.Dst,s.Dst)),$Y.vertLeq(a.Dst,s.Dst)){if($Y.edgeSign(a.Dst,s.Dst,a.Org)<0)return!1;e.regionAbove(i).dirty=i.dirty=!0,n=t.mesh.splitEdge(a),t.mesh.splice(s.Sym,n),n.Lface.inside=i.inside}else{if($Y.edgeSign(s.Dst,a.Dst,s.Org)>0)return!1;i.dirty=r.dirty=!0,n=t.mesh.splitEdge(s),t.mesh.splice(a.Lnext,s.Sym),n.Rface.inside=i.inside}return!0},e.checkForIntersect=function(t,i){var n,r,a=e.regionBelow(i),s=i.eUp,o=a.eUp,l=s.Org,c=o.Org,h=s.Dst,u=o.Dst,d=new iQ;if(JY(!$Y.vertEq(u,h)),JY($Y.edgeSign(h,t.event,l)<=0),JY($Y.edgeSign(u,t.event,c)>=0),JY(l!==t.event&&c!==t.event),JY(!i.fixUpperEdge&&!a.fixUpperEdge),l===c||Math.min(l.t,h.t)>Math.max(c.t,u.t))return!1;if($Y.vertLeq(l,c)){if($Y.edgeSign(u,l,c)>0)return!1}else if($Y.edgeSign(h,c,l)<0)return!1;return e.debugEvent(t),$Y.intersect(h,l,u,c,d),JY(Math.min(l.t,h.t)<=d.t),JY(d.t<=Math.max(c.t,u.t)),JY(Math.min(u.s,h.s)<=d.s),JY(d.s<=Math.max(c.s,l.s)),$Y.vertLeq(d,t.event)&&(d.s=t.event.s,d.t=t.event.t),n=$Y.vertLeq(l,c)?l:c,$Y.vertLeq(n,d)&&(d.s=n.s,d.t=n.t),$Y.vertEq(d,l)||$Y.vertEq(d,c)?(e.checkForRightSplice(t,i),!1):!$Y.vertEq(h,t.event)&&$Y.edgeSign(h,t.event,d)>=0||!$Y.vertEq(u,t.event)&&$Y.edgeSign(u,t.event,d)<=0?u===t.event?(t.mesh.splitEdge(s.Sym),t.mesh.splice(o.Sym,s),i=e.topLeftRegion(t,i),s=e.regionBelow(i).eUp,e.finishLeftRegions(t,e.regionBelow(i),a),e.addRightEdges(t,i,s.Oprev,s,s,!0),!0):h===t.event?(t.mesh.splitEdge(o.Sym),t.mesh.splice(s.Lnext,o.Oprev),a=i,i=e.topRightRegion(i),r=e.regionBelow(i).eUp.Rprev,a.eUp=o.Oprev,o=e.finishLeftRegions(t,a,null),e.addRightEdges(t,i,o.Onext,s.Rprev,r,!0),!0):($Y.edgeSign(h,t.event,d)>=0&&(e.regionAbove(i).dirty=i.dirty=!0,t.mesh.splitEdge(s.Sym),s.Org.s=t.event.s,s.Org.t=t.event.t),$Y.edgeSign(u,t.event,d)<=0&&(i.dirty=a.dirty=!0,t.mesh.splitEdge(o.Sym),o.Org.s=t.event.s,o.Org.t=t.event.t),!1):(t.mesh.splitEdge(s.Sym),t.mesh.splitEdge(o.Sym),t.mesh.splice(o.Oprev,s),s.Org.s=d.s,s.Org.t=d.t,s.Org.pqHandle=t.pq.insert(s.Org),e.getIntersectData(t,s.Org,l,h,c,u),e.regionAbove(i).dirty=i.dirty=a.dirty=!0,!1)},e.walkDirtyRegions=function(t,i){for(var n,r,a=e.regionBelow(i);;){for(;a.dirty;)i=a,a=e.regionBelow(a);if(!i.dirty&&(a=i,null===(i=e.regionAbove(i))||!i.dirty))return;if(i.dirty=!1,n=i.eUp,r=a.eUp,n.Dst!==r.Dst&&e.checkForLeftSplice(t,i)&&(a.fixUpperEdge?(e.deleteRegion(t,a),t.mesh.delete(r),r=(a=e.regionBelow(i)).eUp):i.fixUpperEdge&&(e.deleteRegion(t,i),t.mesh.delete(n),n=(i=e.regionAbove(a)).eUp)),n.Org!==r.Org)if(n.Dst===r.Dst||i.fixUpperEdge||a.fixUpperEdge||n.Dst!==t.event&&r.Dst!==t.event)e.checkForRightSplice(t,i);else if(e.checkForIntersect(t,i))return;n.Org===r.Org&&n.Dst===r.Dst&&(e.addWinding(r,n),e.deleteRegion(t,i),t.mesh.delete(n),i=e.regionAbove(a))}},e.connectRightVertex=function(t,i,n){var r,a=n.Onext,s=e.regionBelow(i),o=i.eUp,l=s.eUp,c=!1;o.Dst!==l.Dst&&e.checkForIntersect(t,i),$Y.vertEq(o.Org,t.event)&&(t.mesh.splice(a.Oprev,o),i=e.topLeftRegion(t,i),a=e.regionBelow(i).eUp,e.finishLeftRegions(t,e.regionBelow(i),s),c=!0),$Y.vertEq(l.Org,t.event)&&(t.mesh.splice(n,l.Oprev),n=e.finishLeftRegions(t,s,null),c=!0),c?e.addRightEdges(t,i,n.Onext,a,a,!0):(r=$Y.vertLeq(l.Org,o.Org)?l.Oprev:o,r=t.mesh.connect(n.Lprev,r),e.addRightEdges(t,i,r,r.Onext,r.Onext,!1),r.Sym.activeRegion.fixUpperEdge=!0,e.walkDirtyRegions(t,i))},e.connectLeftDegenerate=function(t,i,n){var r,a,s,o,l;return r=i.eUp,$Y.vertEq(r.Org,n)?(JY(!1),void e.spliceMergeVertices(t,r,n.anEdge)):$Y.vertEq(r.Dst,n)?(JY(!1),i=e.topRightRegion(i),a=o=(s=(l=e.regionBelow(i)).eUp.Sym).Onext,l.fixUpperEdge&&(JY(a!==s),e.deleteRegion(t,l),t.mesh.delete(s),s=a.Oprev),t.mesh.splice(n.anEdge,s),$Y.edgeGoesLeft(a)||(a=null),void e.addRightEdges(t,i,s.Onext,o,a,!0)):(t.mesh.splitEdge(r.Sym),i.fixUpperEdge&&(t.mesh.delete(r.Onext),i.fixUpperEdge=!1),t.mesh.splice(n.anEdge,r),void e.sweepEvent(t,n))},e.connectLeftVertex=function(t,i){var n,r,a,s,o,l,c=new oQ;if(c.eUp=i.anEdge.Sym,n=t.dict.search(c).key,r=e.regionBelow(n)){if(s=n.eUp,o=r.eUp,0===$Y.edgeSign(s.Dst,i,s.Org))return void e.connectLeftDegenerate(t,n,i);if(a=$Y.vertLeq(o.Dst,s.Dst)?n:r,n.inside||a.fixUpperEdge){if(a===n)l=t.mesh.connect(i.anEdge.Sym,s.Lnext);else l=t.mesh.connect(o.Dnext,i.anEdge).Sym;a.fixUpperEdge?e.fixUpperEdge(t,a,l):e.computeWinding(t,e.addRegionBelow(t,n,l)),e.sweepEvent(t,i)}else e.addRightEdges(t,n,i.anEdge,i.anEdge,null,!0)}},e.sweepEvent=function(t,i){t.event=i,e.debugEvent(t);for(var n=i.anEdge;null===n.activeRegion;)if((n=n.Onext)===i.anEdge)return void e.connectLeftVertex(t,i);var r=e.topLeftRegion(t,n.activeRegion);JY(null!==r);var a=e.regionBelow(r),s=a.eUp,o=e.finishLeftRegions(t,a,null);o.Onext===s?e.connectRightVertex(t,r,o):e.addRightEdges(t,r,o.Onext,s,s,!0)},e.addSentinel=function(e,t,i,n){var r=new oQ,a=e.mesh.makeEdge();a.Org.s=i,a.Org.t=n,a.Dst.s=t,a.Dst.t=n,e.event=a.Dst,r.eUp=a,r.windingNumber=0,r.inside=!1,r.fixUpperEdge=!1,r.sentinel=!0,r.dirty=!1,r.nodeUp=e.dict.insert(r)},e.initEdgeDict=function(t){t.dict=new cQ(t,e.edgeLeq);var i=t.bmax[0]-t.bmin[0],n=t.bmax[1]-t.bmin[1],r=t.bmin[0]-i,a=t.bmax[0]+i,s=t.bmin[1]-n,o=t.bmax[1]+n;e.addSentinel(t,r,a,s),e.addSentinel(t,r,a,o)},e.doneEdgeDict=function(t){for(var i,n=0;null!==(i=t.dict.min().key);)i.sentinel||(JY(i.fixUpperEdge),JY(1===++n)),JY(0===i.windingNumber),e.deleteRegion(t,i)},e.removeDegenerateEdges=function(t){var i,n,r,a=t.mesh.eHead;for(i=a.next;i!==a;i=n)n=i.next,r=i.Lnext,$Y.vertEq(i.Org,i.Dst)&&i.Lnext.Lnext!==i&&(e.spliceMergeVertices(t,r,i),t.mesh.delete(i),r=(i=r).Lnext),r.Lnext===i&&(r!==i&&((r===n||r===n.Sym)&&(n=n.next),t.mesh.delete(r)),(i===n||i===n.Sym)&&(n=n.next),t.mesh.delete(i))},e.initPriorityQ=function(e){var t,i,n,r=0;for(i=(n=e.mesh.vHead).next;i!==n;i=i.next)r++;for(r+=8,t=e.pq=new sQ(r,$Y.vertLeq),i=(n=e.mesh.vHead).next;i!==n;i=i.next)i.pqHandle=t.insert(i);return i===n&&(t.init(),!0)},e.donePriorityQ=function(e){e.pq=null},e.removeDegenerateFaces=function(t,i){var n,r,a;for(n=i.fHead.next;n!==i.fHead;n=r)r=n.next,JY((a=n.anEdge).Lnext!==a),a.Lnext.Lnext===a&&(e.addWinding(a.Onext,a),t.mesh.delete(a));return!0},e.computeInterior=function(t,i){var n,r;if(void 0===i&&(i=!0),e.removeDegenerateEdges(t),!e.initPriorityQ(t))return!1;for(e.initEdgeDict(t);null!==(n=t.pq.extractMin());){for(;null!==(r=t.pq.min())&&$Y.vertEq(r,n);)r=t.pq.extractMin(),e.spliceMergeVertices(t,n.anEdge,r.anEdge);e.sweepEvent(t,n)}return t.event=t.dict.min().key.eUp.Org,e.debugEvent(t),e.doneEdgeDict(t),e.donePriorityQ(t),!!e.removeDegenerateFaces(t,t.mesh)&&(i&&t.mesh.check(),!0)},e}(),uQ=function(){function e(){this.mesh=new nQ,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=NY.ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0}return e.prototype.dot_=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},e.prototype.normalize_=function(e){var t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2];if(!t)throw"Zero-size vector!";t=Math.sqrt(t),e[0]/=t,e[1]/=t,e[2]/=t},e.prototype.longAxis_=function(e){var t=0;return Math.abs(e[1])>Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t},e.prototype.computeNormal_=function(e){var t,i,n,r,a,s,o=[0,0,0],l=[0,0,0],c=[0,0,0],h=[0,0,0],u=[0,0,0],d=[null,null,null],p=[null,null,null],f=this.mesh.vHead;t=f.next;for(var m=0;m<3;++m)r=t.coords[m],l[m]=r,p[m]=t,o[m]=r,d[m]=t;for(t=f.next;t!==f;t=t.next)for(var g=0;g<3;++g)(r=t.coords[g])<l[g]&&(l[g]=r,p[g]=t),r>o[g]&&(o[g]=r,d[g]=t);var v=0;if(o[1]-l[1]>o[0]-l[0]&&(v=1),o[2]-l[2]>o[v]-l[v]&&(v=2),l[v]>=o[v])return e[0]=0,e[1]=0,void(e[2]=1);for(s=0,i=p[v],n=d[v],c[0]=i.coords[0]-n.coords[0],c[1]=i.coords[1]-n.coords[1],c[2]=i.coords[2]-n.coords[2],t=f.next;t!==f;t=t.next)h[0]=t.coords[0]-n.coords[0],h[1]=t.coords[1]-n.coords[1],h[2]=t.coords[2]-n.coords[2],u[0]=c[1]*h[2]-c[2]*h[1],u[1]=c[2]*h[0]-c[0]*h[2],u[2]=c[0]*h[1]-c[1]*h[0],(a=u[0]*u[0]+u[1]*u[1]+u[2]*u[2])>s&&(s=a,e[0]=u[0],e[1]=u[1],e[2]=u[2]);s<=0&&(e[0]=e[1]=e[2]=0,e[this.longAxis_(c)]=1)},e.prototype.checkOrientation_=function(){for(var e,t,i=this.mesh.fHead,n=this.mesh.vHead,r=0,a=i.next;a!==i;a=a.next)if(!((t=a.anEdge).winding<=0))do{r+=(t.Org.s-t.Dst.s)*(t.Org.t+t.Dst.t),t=t.Lnext}while(t!==a.anEdge);if(r<0){for(e=n.next;e!==n;e=e.next)e.t=-e.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2]}},e.prototype.projectPolygon_=function(){var e,t,i=this.mesh.vHead,n=[0,0,0],r=!1;n[0]=this.normal[0],n[1]=this.normal[1],n[2]=this.normal[2],!n[0]&&!n[1]&&!n[2]&&(this.computeNormal_(n),r=!0),e=this.sUnit,t=this.tUnit;var a=this.longAxis_(n);e[a]=0,e[(a+1)%3]=1,e[(a+2)%3]=0,t[a]=0,t[(a+1)%3]=0,t[(a+2)%3]=n[a]>0?1:-1;for(var s=i.next;s!==i;s=s.next)s.s=this.dot_(s.coords,e),s.t=this.dot_(s.coords,t);r&&this.checkOrientation_();for(var o=!0,l=i.next;l!==i;l=l.next)o?(this.bmin[0]=this.bmax[0]=l.s,this.bmin[1]=this.bmax[1]=l.t,o=!1):(l.s<this.bmin[0]&&(this.bmin[0]=l.s),l.s>this.bmax[0]&&(this.bmax[0]=l.s),l.t<this.bmin[1]&&(this.bmin[1]=l.t),l.t>this.bmax[1]&&(this.bmax[1]=l.t))},e.prototype.addWinding_=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},e.prototype.tessellateMonoRegion_=function(e,t){var i,n;if((i=t.anEdge).Lnext===i||i.Lnext.Lnext===i)throw"Mono region invalid";for(;$Y.vertLeq(i.Dst,i.Org);i=i.Lprev);for(;$Y.vertLeq(i.Org,i.Dst);i=i.Lnext);n=i.Lprev;for(;i.Lnext!==n;)if($Y.vertLeq(i.Dst,n.Org)){for(;n.Lnext!==i&&($Y.edgeGoesLeft(n.Lnext)||$Y.edgeSign(n.Org,n.Dst,n.Lnext.Dst)<=0);)n=e.connect(n.Lnext,n).Sym;n=n.Lprev}else{for(;n.Lnext!==i&&($Y.edgeGoesRight(i.Lprev)||$Y.edgeSign(i.Dst,i.Org,i.Lprev.Org)>=0);)i=e.connect(i,i.Lprev).Sym;i=i.Lnext}if(n.Lnext===i)throw"Mono region invalid";for(;n.Lnext.Lnext!==i;)n=e.connect(n.Lnext,n).Sym;return!0},e.prototype.tessellateInterior_=function(e){for(var t,i=e.fHead.next;i!==e.fHead;i=t)if(t=i.next,i.inside&&!this.tessellateMonoRegion_(e,i))return!1;return!0},e.prototype.discardExterior_=function(e){for(var t,i=e.fHead.next;i!==e.fHead;i=t)t=i.next,i.inside||e.zapFace(i)},e.prototype.setWindingNumber_=function(e,t,i){for(var n,r=e.eHead.next;r!==e.eHead;r=n)n=r.next,r.Rface.inside!==r.Lface.inside?r.winding=r.Lface.inside?t:-t:i?e.delete(r):r.winding=0},e.prototype.getNeighbourFace_=function(e){return e.Rface&&e.Rface.inside?e.Rface.n:-1},e.prototype.outputPolymesh_=function(e,t,i,n){var r,a,s=0,o=0;i>3&&e.mergeConvexFaces(i);for(var l=e.vHead.next;l!==e.vHead;l=l.next)l.n=-1;for(var c=e.fHead.next;c!==e.fHead;c=c.next)if(c.n=-1,c.inside){r=c.anEdge,a=0;do{-1===(l=r.Org).n&&(l.n=o,o++),a++,r=r.Lnext}while(r!==c.anEdge);if(a>i)throw"Face vertex greater that support polygon";c.n=s,++s}this.elementCount=s,t===FY.CONNECTED_POLYGONS&&(s*=2),this.elements=[],this.elements.length=s*i,this.vertexCount=o,this.vertices=[],this.vertices.length=o*n,this.vertexIndices=[],this.vertexIndices.length=o;for(l=e.vHead.next;l!==e.vHead;l=l.next)if(-1!==l.n){var h=l.n*n;this.vertices[h+0]=l.coords[0],this.vertices[h+1]=l.coords[1],n>2&&(this.vertices[h+2]=l.coords[2]),this.vertexIndices[l.n]=l.idx}var u=0;for(c=e.fHead.next;c!==e.fHead;c=c.next)if(c.inside){r=c.anEdge,a=0;do{l=r.Org;this.elements[u++]=l.n,a++,r=r.Lnext}while(r!==c.anEdge);for(var d=a;d<i;++d)this.elements[u++]=-1;if(t===FY.CONNECTED_POLYGONS){r=c.anEdge;do{this.elements[u++]=this.getNeighbourFace_(r),r=r.Lnext}while(r!==c.anEdge);for(var p=a;p<i;++p)this.elements[u++]=-1}}},e.prototype.outputContours_=function(e,t){var i,n,r=0,a=0;this.vertexCount=0,this.elementCount=0;for(var s=e.fHead.next;s!==e.fHead;s=s.next)if(s.inside){n=i=s.anEdge;do{this.vertexCount++,i=i.Lnext}while(i!==n);this.elementCount++}this.elements=[],this.elements.length=2*this.elementCount,this.vertices=[],this.vertices.length=this.vertexCount*t,this.vertexIndices=[],this.vertexIndices.length=this.vertexCount;var o=0,l=0,c=0;r=0;for(s=e.fHead.next;s!==e.fHead;s=s.next)if(s.inside){a=0,n=i=s.anEdge;do{this.vertices[o++]=i.Org.coords[0],this.vertices[o++]=i.Org.coords[1],t>2&&(this.vertices[o++]=i.Org.coords[2]),this.vertexIndices[l++]=this.vertexIdCallback?this.vertexIdCallback(i):i.Org.idx,a++,i=i.Lnext}while(i!==n);this.elements[c++]=r,this.elements[c++]=a,r+=a}},e.prototype.addContour=function(e,t){null===this.mesh&&(this.mesh=new nQ),e<2&&(e=2),e>3&&(e=3);for(var i=null,n=0;n<t.length;n+=e)null===i?(i=this.mesh.makeEdge(),this.mesh.splice(i,i.Sym)):(this.mesh.splitEdge(i),i=i.Lnext),i.Org.coords[0]=t[n+0],i.Org.coords[1]=t[n+1],i.Org.coords[2]=e>2?t[n+2]:0,i.Org.idx=this.vertexIndexCounter++,this.edgeCreateCallback&&this.edgeCreateCallback(i),i.winding=1,i.Sym.winding=-1},e.prototype.tesselate=function(e,t,i,n,r,a){if(void 0===e&&(e=NY.ODD),void 0===t&&(t=FY.POLYGONS),void 0===a&&(a=!0),this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,r&&(this.normal[0]=r[0],this.normal[1]=r[1],this.normal[2]=r[2]),this.windingRule=e,n<2&&(n=2),n>3&&(n=3),!this.mesh)return!1;this.projectPolygon_(),hQ.computeInterior(this,a);var s=this.mesh;return t===FY.BOUNDARY_CONTOURS?this.setWindingNumber_(s,1,!0):this.tessellateInterior_(s),a&&s.check(),t===FY.BOUNDARY_CONTOURS?this.outputContours_(s,n):this.outputPolymesh_(s,t,i,n),!0},e}();function dQ(e){var t=e.windingRule,i=void 0===t?NY.ODD:t,n=e.elementType,r=void 0===n?FY.POLYGONS:n,a=e.polySize,s=void 0===a?3:a,o=e.vertexSize,l=void 0===o?2:o,c=e.normal,h=void 0===c?[0,0,1]:c,u=e.contours,d=void 0===u?[]:u,p=e.strict,f=void 0===p||p,m=e.debug,g=void 0!==m&&m;if(!d&&f)throw new Error("Contours can't be empty");if(d){var v=new uQ;e.edgeCreateCallback&&(v.edgeCreateCallback=e.edgeCreateCallback),e.vertexIdCallback&&(v.vertexIdCallback=e.vertexIdCallback);for(var y=0;y<d.length;y++)v.addContour(l||2,d[y]);return v.tesselate(i,r,s,l,h,f),{vertices:v.vertices,vertexIndices:v.vertexIndices,vertexCount:v.vertexCount,elements:v.elements,elementCount:v.elementCount,mesh:g?v.mesh:void 0}}}NY.ODD,NY.NONZERO,NY.POSITIVE,NY.NEGATIVE,NY.ABS_GEQ_TWO,FY.POLYGONS,FY.CONNECTED_POLYGONS,FY.BOUNDARY_CONTOURS;var pQ=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:256,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.capacity=e,this.size=0,this.debug=t,this.debug&&console.log("allocating with cap ".concat(e));let i=e*pQ.eSize;this.buffer=new ArrayBuffer(i);let n=Float32Array.BYTES_PER_ELEMENT,r=0;this.positions=new Float32Array(this.buffer,r*n,3*e),r+=3*e,this.normals=new Float32Array(this.buffer,r*n,3*e),r+=3*e,this.uvs=new Float32Array(this.buffer,r*n,2*e)}realloc(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e<this.size)throw Error("cannot shrink buffer");if(e<=this.capacity&&!t)return;this.debug&&console.log("resizing from ".concat(this.capacity," \u2192 ").concat(e));let i=e*pQ.eSize,n=new ArrayBuffer(i),r=Float32Array.BYTES_PER_ELEMENT,a=0,s=new Float32Array(n,a*r,3*e);a+=3*e;let o=new Float32Array(n,a*r,3*e);a+=3*e;let l=new Float32Array(n,a*r,2*e);t?(s.set(this.positions.subarray(0,3*this.size)),o.set(this.normals.subarray(0,3*this.size)),l.set(this.uvs.subarray(0,2*this.size))):(s.set(this.positions),o.set(this.normals),l.set(this.uvs)),this.buffer=n,this.positions=s,this.normals=o,this.uvs=l,this.capacity=e}get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=this.size+e;if(t>this.capacity){let e=this.capacity;for(;t>e;)e*=2;this.realloc(e)}let i=this.size;return this.size=t,i}reserve(e){let t=this.size+e;t>this.capacity&&this.realloc(t)}shrink(){this.debug&&console.log("shrinking ".concat(this.capacity," \u2192 ").concat(this.size)),this.realloc(this.size,!0)}},fQ=pQ;fQ.eSize=8*Float32Array.BYTES_PER_ELEMENT;var mQ=J_(nS()),gQ={vertices:[160,160,-160,160,-160,-160,160,-160],vertexIndices:[1,0,3,2],vertexCount:4,elements:[0,4],elementCount:1,mesh:void 0},vQ={vertices:[],vertexIndices:[],vertexCount:0,elements:[],elementCount:0,mesh:void 0},yQ={vertices:[-160,160,160,-160,160,160,-160,-160],vertexIndices:[1,3,0,2],vertexCount:4,elements:[0,1,2,1,0,3],elementCount:2,mesh:void 0},bQ=(e,t)=>i=>{let[n,r]=i;return r<n&&(r+=t),(e>=n?e:e+t)<=r},xQ=class extends fT{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:12,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:3,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:NY.ODD,s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];super(),this.forPathBevel=s,this.type="ShapeGeometry",this.vertexCache={},this._shape=e,this._depth=t,this._curveSegments=n,this._bevelSegmentsInput=r;let o,l,c,h=this._shape.extractShapePointsToFlatArray([],n),u=this._shape.shapeHoles.map((e=>{let t=e.extractShapePointsToFlatArray([],n),i=[];for(let n=t.length-1;n>=1;n-=2){let e=t[n-1],r=t[n-0];i.push(e,r)}return i})),d=[],p=[];for(let C=0;C<h.length;C+=2)p.push([h[C],h[C+1]]);d.push(p);for(let C=0;C<u.length;C++){let e=u[C],t=[];for(let i=0;i<e.length;i+=2)t.push([e[i],e[i+1]]);d.push(t)}o=e.isText?.1*(new _R).setFromPoints(e.points.map((e=>e.position))).getSize(new hA).length():0===d[0].length?i:(0,mQ.default)(d).distance,i<=0?(this._bevel=0,this._bevelSegments=0):(this._bevel=Math.min(i,o,t/2),this._bevelSegments=Math.floor(r));try{l=dQ({windingRule:a,elementType:FY.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[h]})}catch{l=gQ}try{c=dQ({windingRule:NY.ODD,elementType:FY.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[...u]})}catch{c=vQ}if(!l)throw new Error("error generating geometry");let f=l.elementCount;if(c){l.elementCount+=c.elementCount;for(let e=0;e<c.elements.length;e++){let t=c.elements[e],i=e%2===0?l.vertexCount:0;l.elements.push(t+i)}for(let e=0;e<c.vertexIndices.length;e++){let t=c.vertexIndices[e],i=l.vertexCount;l.vertexIndices.push(t+i)}for(let e=0;e<c.vertices.length;e++){let t=c.vertices[e];l.vertices.push(t)}}let m=1/0,g=-1/0,v=1/0,y=-1/0;for(let C=0,A=l.vertexCount;C<A;C++){let e=2*C,t=l.vertices[e+0],i=l.vertices[e+1];t<m&&(m=t),t>g&&(g=t),i<v&&(v=i),i>y&&(y=i)}this._minX=m,this._minY=v,this._width=g-m,this._height=y-v,this._buffer=new fQ(this._computeBufferEstimatedSize(l));let b=[],x=[];for(let C=l.elementCount-1;C>=0;C--){let e=C>=f,t=2*C,i=l.elements[t+0],r=l.elements[t+1],a=i+r,c={start:i,count:r,normals:[],continuous:[],concave:[]},h=i,d=a-1,p=i+1,m=this._shape.roundedCurves.length;do{let t=h-i,n=l.vertices[2*d+0],s=l.vertices[2*d+1],o=l.vertices[2*h+0],u=l.vertices[2*h+1],f=l.vertices[2*p+0],g=l.vertices[2*p+1],v=o-n,y=u-s,b=Math.sqrt(v*v+y*y);v/=b,y/=b;let x=o-f,w=u-g,_=Math.sqrt(x*x+w*w);x/=_,w/=_,c.normals[2*t+0]=-w,c.normals[2*t+1]=x,c.concave[t]=v*w-y*x>0;let S=l.vertexIndices[h];if(Array.isArray(S))c.continuous[t]=!1;else{let[e,i]=this._shape.getCurveIndexFromVertexId(S-1,!0);if(i>0&&i<1)c.continuous[t]=!0;else{let n=1===i?e+1:e-1;n=(n+m)%m;let r=1===i?0:1,a=this._shape.roundedCurves[e].getTangent(i),s=this._shape.roundedCurves[n].getTangent(r);c.continuous[t]=a.dot(s)>.95}}e&&(c.normals[2*t+0]*=-1,c.normals[2*t+1]*=-1),[d,h,p]=[h,p,p+1],p>=a&&(p-=r)}while(p!==i+1);let g=[];g.push({bevelI:0,angle:0,size:0,boundary:{vertices:l.vertices.slice(2*i,2*a),vertexCount:r,vertexIndices:new Array(r).fill(!0).map(((e,t)=>[t,t])),elements:[0,r],elementCount:1,mesh:null},reverseMap:[],insetPoints:l.vertices.slice(2*i,2*a)});let v=0;for(let s=1;s<=this._bevelSegments;s++){let t=s/this._bevelSegments*Math.PI/2,i=(1-Math.cos(t))*this._bevel,a=[],o=[],h=[],u=[],d=0;for(let s=0;s<r;s++){let t=2*s,p=(s-1+r)%r*2,f=l.vertices[2*c.start+t+0],m=l.vertices[2*c.start+t+1],g=-c.normals[p+0]*i,v=-c.normals[p+1]*i,y=-c.normals[t+0]*i,b=-c.normals[t+1]*i;if(c.concave[s]||!c.concave[s]&&e){let t=Math.atan2(v,g),r=Math.atan2(b,y);r>t&&(r-=2*Math.PI);let o=r-t;if(c.continuous[s]||e){let n=t+o/2,r=Math.cos(n)*i,l=Math.sin(n)*i;a[2*d+0]=f+r*(e?-1:1),a[2*d+1]=m+l*(e?-1:1),u[d]=s,d++}else{let e=Math.max(1,Math.floor(n/4*Math.abs(o)/Math.PI));for(let n=0;n<=e;n++){let r=t+o*(n/e),l=Math.cos(r)*i,c=Math.sin(r)*i;a[2*d+0]=f+l,a[2*d+1]=m+c,u[d]=s,d++}}}else a[2*d+0]=f+g,a[2*d+1]=m+v,u[d]=s,o[s]=d,d++,a[2*d+0]=f,a[2*d+1]=m,u[d]=s,d++,a[2*d+0]=f+y,a[2*d+1]=m+b,u[d]=s,h[s]=d,d++}let p=dQ({windingRule:NY.POSITIVE,elementType:FY.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[a],edgeCreateCallback:e=>{let t=e.Org.idx,i=u[t],n=u[(t+1)%u.length];e.idx=[i,n],e.Sym.idx=[n,i]},vertexIdCallback:e=>{let t=e.Lprev.idx;return[t?t[1]:0,e.idx?e.idx[0]:0]}});if(!p)throw console.log("Error"),new Error("error generating bevel geometry for ".concat(s,"'th loop"));if(!p.vertexCount){let e=(s-1)/this._bevelSegments*Math.PI/2;v=(1-Math.sin(e))*this._bevel;break}for(let e=0;e<p.vertexIndices.length;e++){let[t,i]=p.vertexIndices[e];if(t===i)continue;let n=i;i<t&&(n+=r);for(let a=t;a<n;a++){let n=a%r,s=(a+1)%r;if(!c.continuous[n]||!c.continuous[s]){p.vertexIndices[e]=[t,n],p.vertexIndices.splice(e+1,0,[s,i]),p.vertices.splice(2*(e+1),0,p.vertices[2*e],p.vertices[2*e+1]);break}}}g.push({bevelI:s,angle:t,size:i,boundary:p,reverseMap:u,insetPoints:a})}let y=(e,t,i)=>{let n=0,r=e.boundary.vertexIndices.length;for(;n<r&&i(e.boundary.vertexIndices[t]);)t=(t+1)%r,n++;return n},w=b.length;for(let n=1;n<g.length;n++){let e=g[n-1],t=g[n],i=e.boundary.vertexIndices.length,a=t.boundary.vertexIndices.length;if(!i||!a)break;let o=c.concave.length,l=0,h=bQ(l,r);for(;!e.boundary.vertexIndices.filter(h).length||!t.boundary.vertexIndices.filter(h).length;)l++,h=bQ(l,r);let u=e.boundary.vertexIndices.findIndex(h),d=t.boundary.vertexIndices.findIndex(h);do{u=(u+1)%i}while(h(e.boundary.vertexIndices[u]));do{d=(d+1)%a}while(h(t.boundary.vertexIndices[d]));l=(l+1)%r;let p,f,m=l,v=0,x=this._buildBevelVert(c,e,(u-1+i)%i,void 0,v),w=this._buildBevelVert(c,t,(d-1+a)%a,void 0,v),_=!1;do{v=(l||o)/o,h=bQ(l,r);let n=y(e,u,h),m=y(t,d,h),g=_;if(_=!1,n&&!m){for(let t=0;t<n;t++)p=this._buildBevelVert(c,e,(u+t)%i,t/(n-1),v),b.push(x.topN,p.topP,w.topN),!1===s&&b.push(p.bottomP,x.bottomN,w.bottomN),x=p;_=!0}else if(!n&&m)for(let e=0;e<m;e++)f=this._buildBevelVert(c,t,(d+e)%a,e/(m-1),v),b.push(w.topN,x.topP,f.topP),!1===s&&b.push(x.bottomP,w.bottomN,f.bottomP),w=f;else if(n&&m)if(p=this._buildBevelVert(c,e,u,0,v),f=this._buildBevelVert(c,t,d,0,v),g?(b.push(x.topN,f.topP,w.topN),b.push(x.topN,p.topP,f.topP),!1===s&&(b.push(f.bottomP,x.bottomN,w.bottomN),b.push(f.bottomP,p.bottomP,x.bottomN))):(b.push(w.topN,x.topN,p.topP),b.push(w.topN,p.topP,f.topP),!1===s&&(b.push(p.bottomP,x.bottomN,w.bottomN),b.push(p.bottomP,w.bottomN,f.bottomP))),x=p,w=f,n===m)for(let r=1;r<n;r++)p=this._buildBevelVert(c,e,(u+r)%i,r/(n-1),v),f=this._buildBevelVert(c,t,(d+r)%a,r/(m-1),v),b.push(x.topN,p.topP,w.topN),b.push(w.topN,p.topP,f.topP),!1===s&&(b.push(p.bottomP,x.bottomN,w.bottomN),b.push(p.bottomP,w.bottomN,f.bottomP)),x=p,w=f;else if(n>m){let r=n/m,o=0;for(let l=1;l<n;l++)p=this._buildBevelVert(c,e,(u+l)%i,l/(n-1),v),b.push(x.topN,p.topP,w.topN),!1===s&&b.push(p.bottomP,x.bottomN,w.bottomN),x=p,l>(o+1)*r&&(o++,f=this._buildBevelVert(c,t,(d+o)%a,o/(m-1),v),b.push(w.topN,p.topP,f.topP),!1===s&&b.push(p.bottomP,w.bottomN,f.bottomP),w=f)}else{let r=m/n,o=0;for(let l=1;l<m;l++)f=this._buildBevelVert(c,t,(d+l)%a,l/(m-1),v),b.push(w.topN,p.topP,f.topP),!1===s&&b.push(p.bottomP,w.bottomN,f.bottomP),w=f,l>(o+1)*r&&(o++,p=this._buildBevelVert(c,e,(u+o)%i,o/(n-1),v),b.push(x.topN,p.topP,w.topN),!1===s&&b.push(p.bottomP,x.bottomN,w.bottomN),x=p)}u=(u+n)%i,d=(d+m)%a,l=(l+1)%o}while(l!==m)}if(!1===s&&this._depth>2*this._bevel&&this._buildWall(g,c,b),e){let e=[];for(let t=b.length-1;t>=w+2;t-=3){let i=b[t-2],n=b[t-1],r=b[t-0];e.push(r,n,i)}b.splice(w,b.length-w,...e)}if(e){let e=[];for(let t=g[g.length-1].boundary.vertices.length-1;t>=1;t-=2){let i=g[g.length-1].boundary.vertices[t-1],n=g[g.length-1].boundary.vertices[t-0];e.push(i,n)}x.push(e)}if(!e){let e,t=g[g.length-1];try{e=dQ({windingRule:g.length>1?NY.POSITIVE:NY.ODD,elementType:FY.POLYGONS,vertexSize:2,strict:!0,contours:[t.insetPoints,...x]})}catch{e=yQ}if(!e)throw new Error("Error generating geometry for surface");0===u.length&&this._bevel<o&&Object.assign(this,{useNgonForTopBottomFaceDuringBake:!0});for(let i=0;i<3*e.elementCount;i+=3){let t=this._buildSurfaceVert(e,e.elements[i+0],v),n=this._buildSurfaceVert(e,e.elements[i+1],v),r=this._buildSurfaceVert(e,e.elements[i+2],v);b.push(t.top,n.top,r.top),!1===s&&b.push(r.bottom,n.bottom,t.bottom)}}this.vertexCache={}}this._buffer.shrink();let w=new nT(Uint32Array.from(b),1),_=new nT(this._buffer.positions,3),S=new nT(this._buffer.normals,3),E=new nT(this._buffer.uvs,2);_.needsUpdate=!0,S.needsUpdate=!0,E.needsUpdate=!0,w.needsUpdate=!0,this.setAttribute("position",_),this.setAttribute("normal",S),this.setAttribute("uv",E),this.setIndex(w)}_computeBufferEstimatedSize(e){return 2*e.vertexCount*(2+this._bevelSegments)}_buildWall(e,t,i){let n=e[0];for(let r=0,a=n.boundary.vertexCount;r<a;r++){let e=this._buildBevelVert(t,n,r),s=this._buildBevelVert(t,n,(r+1)%a);i.push(s.topP,e.topN,e.bottomN),i.push(s.topP,e.bottomN,s.bottomP)}}_buildSurfaceVert(e,t,i){let n=t.toString();if(n in this.vertexCache)return this.vertexCache[n];let r=e.vertices[2*t+0],a=e.vertices[2*t+1],s=(r-this._minX)/this._width,o=(a-this._minY)/this._height;this.forPathBevel&&(o=1);let l=this._buffer.get(this.forPathBevel?1:2),c=3*l,h=2*l,u={top:l+0,bottom:l+1};return this._buffer.positions[c+0]=r,this._buffer.positions[c+1]=a,this._buffer.positions[c+2]=this.forPathBevel?this._bevel:this._depth-i,this._buffer.normals[c+0]=0,this._buffer.normals[c+1]=0,this._buffer.normals[c+2]=1,this._buffer.uvs[h+0]=s,this._buffer.uvs[h+1]=o,!1===this.forPathBevel&&(this._buffer.positions[c+3]=r,this._buffer.positions[c+4]=a,this._buffer.positions[c+5]=i,this._buffer.normals[c+3]=0,this._buffer.normals[c+4]=0,this._buffer.normals[c+5]=-1,this._buffer.uvs[h+2]=s,this._buffer.uvs[h+3]=o),this.vertexCache[n]=u,u}_buildBevelVert(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4?arguments[4]:void 0,a="".concat(t.bevelI,":").concat(i);if(a in this.vertexCache&&0!==r&&1!==r&&(!r||r===this.vertexCache[a].pathBevelUCoord))return this.vertexCache[a];let s,o,l,c,[h,u]=t.boundary.vertexIndices[i];h!==u?(o=h,s=u,c=!1,l=e.continuous[o]&&e.continuous[s]):(s=h,o=(s-1+e.count)%e.count,c=e.concave[s]&&t.bevelI>0,l=e.continuous[s]||c);let d=Math.cos(t.angle),p=Math.sin(t.angle),f=2*i,m=2*s,g=2*o,v=t.boundary.vertices[f+0],y=t.boundary.vertices[f+1],b=(1-p)*this._bevel,x=(v-this._minX)/this._width,w=(y-this._minY)/this._height;this.forPathBevel&&(void 0!==r&&(x=r),w=1);let _=e.normals[m+0],S=e.normals[m+1],E=e.normals[g+0],C=e.normals[g+1];if(c){_+=(E-_)*(1-n),S+=(C-S)*(1-n);let e=Math.sqrt(_*_+S*S);_/=e,S/=e}let A=this.forPathBevel?this._buffer.get(l?1:2):this._buffer.get(l?2:4),M=3*A,T=2*A,P={i:i,fi:s,topP:A+0,topN:A+0,bottomP:A+1,bottomN:A+1,pathBevelUCoord:r};return this._buffer.positions[M+0]=v,this._buffer.positions[M+1]=y,this._buffer.positions[M+2]=(this.forPathBevel?this._bevel:this._depth)-b,this._buffer.normals[M+0]=_*d,this._buffer.normals[M+1]=S*d,this._buffer.normals[M+2]=p,this._buffer.uvs[T+0]=x,this._buffer.uvs[T+1]=w,!1===this.forPathBevel&&(this._buffer.positions[M+3]=v,this._buffer.positions[M+4]=y,this._buffer.positions[M+5]=b,this._buffer.normals[M+3]=_*d,this._buffer.normals[M+4]=S*d,this._buffer.normals[M+5]=-p,this._buffer.uvs[T+2]=w,this._buffer.uvs[T+3]=x),l||(this.forPathBevel?(A+=1,M+=3,T+=2):(A+=2,M+=6,T+=4),P.topP=A+0,P.bottomP=A+1,this._buffer.positions[M+0]=v,this._buffer.positions[M+1]=y,this._buffer.positions[M+2]=(this.forPathBevel?this._bevel:this._depth)-b,this._buffer.normals[M+0]=E*d,this._buffer.normals[M+1]=C*d,this._buffer.normals[M+2]=p,this._buffer.uvs[T+0]=x,this._buffer.uvs[T+1]=w,!1===this.forPathBevel&&(this._buffer.positions[M+3]=v,this._buffer.positions[M+4]=y,this._buffer.positions[M+5]=b,this._buffer.normals[M+3]=E*d,this._buffer.normals[M+4]=C*d,this._buffer.normals[M+5]=-p,this._buffer.uvs[T+2]=w,this._buffer.uvs[T+3]=x)),this.vertexCache[a]=P,P}clone(){let e=new xQ(this._shape,this._depth,this._bevel,this._curveSegments,this._bevelSegmentsInput);return e.userData=BF(this.userData),e}},wQ=class extends fT{constructor(e){var t,i,n,r,a,s;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(),this.type="ShapeGeometry",this.windingRule=NY.ODD,this.elementType=FY.POLYGONS,this.polySize=3,this.vertexSize=2,this.strict=!0,this._shape=e,this._curveSegments=o,this._triangulationOptions=Object.assign({windingRule:NY.ODD,elementType:FY.POLYGONS,polySize:3,vertexSize:2,strict:!0},l);let c,h,u,d=this._shape.extractShapePointsToFlatArray([],this._curveSegments),p=this._shape.shapeHoles.map((e=>e.extractShapePointsToFlatArray([],this._curveSegments))),f=!0,m=!0;for(let y=0,b=d.length/2;y<b;y++){let e=2*y,t=d[e+0],i=d[e+1];if(void 0!==h&&t!==h&&(f=!1),void 0!==u&&i!==u&&(m=!1),h=t,u=i,!f&&!m)break}if(!f&&!m)try{c=dQ({contours:[d,...p],windingRule:this._triangulationOptions.windingRule,elementType:this._triangulationOptions.elementType,polySize:this._triangulationOptions.polySize,vertexSize:this._triangulationOptions.vertexSize,strict:this._triangulationOptions.strict})}catch{c=gQ}let g=null!==(t=null===(i=c)||void 0===i?void 0:i.vertexCount)&&void 0!==t?t:1,v=null!==(n=null===(r=c)||void 0===r?void 0:r.elementCount)&&void 0!==n?n:1;if(this._positionAttribute=new nT(new Float32Array(3*g),3),this._normalAttribute=new nT(new Float32Array(3*g),3),this._uvAttribute=new nT(new Float32Array(2*g),2),this._indexAttribute=new nT(new Uint32Array(3*v),1),c){let e=1/0,t=-1/0,i=1/0,n=-1/0;for(let s=0,o=g;s<o;s++){let r=2*s,a=c.vertices[r+0],o=c.vertices[r+1];a<e&&(e=a),a>t&&(t=a),o<i&&(i=o),o>n&&(n=o)}let r=t-e,a=n-i;for(let s=0,o=g;s<o;s++){let t=2*s,n=c.vertices[t+0],o=c.vertices[t+1],l=(n-e)/r,h=(o-i)/a;this._positionAttribute.setXYZ(s,n,o,0),this._normalAttribute.setXYZ(s,0,0,1),this._uvAttribute.setXY(s,l,h)}for(let s=0,o=v;s<o;s++){let e=3*s,t=c.elements[e+0],i=c.elements[e+1],n=c.elements[e+2];this._indexAttribute.setX(e+0,t),this._indexAttribute.setX(e+1,i),this._indexAttribute.setX(e+2,n)}}this.setAttribute("position",this._positionAttribute),this.setAttribute("normal",this._normalAttribute),this.setAttribute("uv",this._uvAttribute),this.setIndex(this._indexAttribute),this.setDrawRange(0,3*(null!==(a=null===(s=c)||void 0===s?void 0:s.elementCount)&&void 0!==a?a:1))}clone(){let e=new wQ(this._shape,this._curveSegments);return e.userData=BF(this.userData),e}},_Q=class extends xQ{constructor(e,t){super(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:12,arguments.length>4&&void 0!==arguments[4]?arguments[4]:3,arguments.length>5&&void 0!==arguments[5]?arguments[5]:NY.ODD),this.type="ShapeGeometry"}_computeBufferEstimatedSize(e){return 2*e.vertexCount*(2+this._bevelSegments)}_buildWall(e,t,i){let n=e[0];for(let r=0,a=n.boundary.vertexCount;r<a;r++){let e=this._buildBevelVert(t,n,r),s=this._buildBevelVert(t,n,(r+1)%a);i.push(s.topP,e.topN,e.bottomN),i.push(s.topP,e.bottomN,s.bottomP)}}clone(){let e=new _Q(this._shape,this._depth,this._bevel,this._curveSegments,this._bevelSegmentsInput);return e.userData=BF(this.userData),e}},SQ=class{static create(e){return this.build(this.normalizeInputs(e))}static normalizeInputs(e,t){var i,n,r,a,s,o,l,c,h;let u=Object.assign({},null!==(i=null===t||void 0===t?void 0:t.parameters)&&void 0!==i?i:{width:100,subdivisions:40,roundness:0,extrudeBevelSize:0,extrudeBevelSegments:3,windingRule:NY.ODD},e.parameters),d=Math.abs(u.width),p=Math.abs(null!==(n=u.height)&&void 0!==n?n:u.width),f=Math.abs(null!==(r=u.depth)&&void 0!==r?r:0),m=null!==(a=e.shape)&&void 0!==a?a:null===t||void 0===t?void 0:t.shape,g=null!==(s=null===(o=m)||void 0===o?void 0:o.roundness)&&void 0!==s?s:u.roundness;void 0!==m&&(m instanceof qY?(m.width!==d||m.height!==p)&&m.applySize(d,p):m=new qY(d,p).fromJSON(m),void 0!==(null===(l=e.parameters)||void 0===l?void 0:l.roundness)&&(null===(c=e.parameters)||void 0===c?void 0:c.roundness)>0&&m.update());let v=null!==(h=m)&&void 0!==h?h:new qY(d,p);return{parameters:Object.assign(u,{width:d,height:p,depth:f,roundness:g}),shape:v}}static build(e){let t,{depth:i,extrudeBevelSize:n,extrudeBevelSegments:r,subdivisions:a,roundness:s,windingRule:o}=e.parameters;return e.shape.roundness=s,t=i<=0?new wQ(e.shape,a,{windingRule:o}):new _Q(e.shape,i,n,a,r,o),Object.assign(t,{userData:{...e,type:"VectorGeometry"}})}},EQ=2*Math.PI,CQ=class{static create(e){return this.build(this.normalizeInputs(e))}static normalizeInputs(e,t){var i,n,r;let a=Object.assign({},null!==(i=null===t||void 0===t?void 0:t.parameters)&&void 0!==i?i:{width:100,depth:0,spikes:64,angle:360,innerRadius:0,extrudeBevelSize:0,extrudeBevelSegments:1},e.parameters);return a.angle=cA.clamp(a.angle,0,360),{shape:e.shape&&e.shape instanceof qY?e.shape:new qY,parameters:Object.assign(a,{width:Math.abs(a.width),height:Math.abs(null!==(n=a.height)&&void 0!==n?n:a.width),depth:Math.abs(null!==(r=a.depth)&&void 0!==r?r:0)})}}static build(e){let t,{width:i,height:n,spikes:r,angle:a,innerRadius:s,depth:o,extrudeBevelSize:l,extrudeBevelSegments:c}=e.parameters,h=e.shape,u=function(e,t,i,n,r,a){if(n>=EQ)return r>30||r%4===0?(function(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=.5522847498,o=t*s,l=i*s;e.addPoint(TQ(r-t,a,r-t,a-l,r-t,a+l)),e.addPoint(TQ(r,a+i,r-o,a+i,r+o,a+i)),e.addPoint(TQ(r+t,a,r+t,a+l,r+t,a-l)),e.addPoint(TQ(r,a-i,r+o,a-i,r-o,a-i)),n>0&&DQ(e,t,i,n)}(e,t,i,a),Math.round(r/4)):AQ(e,n,r,t,i,a);n=Math.max(n,.001);let s={x:0,y:i},o=n+.5*Math.PI,l={x:Math.cos(o)*t,y:Math.sin(o)*i},c=KY({px:s.x,py:s.y,cx:l.x,cy:l.y,rx:t,ry:i,largeArcFlag:n>Math.PI,sweepFlag:!0});return r>30||r%c.length===0?function(e,t,i,n,r,a,s,o){let l=Math.round(r/n.length);e.addPoint(MQ(t,i));for(let c=0,h=n.length;c<h;c++){let t=n[c],i=e.points[c],r=MQ(t.x,t.y);i.controls[1].position.set(t.x1,t.y1),r.controls[0].position.set(t.x2,t.y2),e.addPoint(r)}return o>0?PQ(e,a,s,o):e.addPoint(MQ(0,0)),l}(e,s.x,s.y,c,r,t,i,a):AQ(e,n,r,t,i,a)}(h,.5*i,.5*n,a*Math.PI/180,r,s);return h.isClosed=!0,h.update(),0===a?(t=new fT,t.setAttribute("position",new sT([],3))):t=SQ.create({shape:h,parameters:{subdivisions:u,depth:o,extrudeBevelSize:l,extrudeBevelSegments:c}}),Object.assign(t,{userData:{...e,type:"EllipseGeometry"}})}};function AQ(e,t,i,n,r,a){let s=-t/i;for(let o=0;o<=i;o++){let t=s*o,i=Math.sin(t)*n,a=Math.cos(t)*r;e.addPoint(MQ(i,a))}return t<EQ?a>0?PQ(e,n,r,a):e.addPoint(MQ(0,0)):(e.removePoint(e.points[e.points.length-1]),a>0&&DQ(e,n,r,a)),1}function MQ(e,t){return new fY(cA.generateUUID(),new hA(e,t))}function TQ(e,t,i,n,r,a){let s=MQ(e,t);return s.controls[0].position.set(i,n),s.controls[1].position.set(r,a),s}function PQ(e,t,i,n){kQ(e,t,i,n).forEach((t=>e.addPoint(t)))}function DQ(e,t,i,n){let r=kQ(e,t,i,n),a=new qY;r.forEach((e=>a.addPoint(e))),a.isClosed=!0,e.shapeHoles.push(a)}function kQ(e,t,i,n){let r=n*t/100,a=r*(Math.abs(i)/Math.abs(t)),s=new hA(r/t,a/i),o=e.points.map((e=>{let t=e.clone();return t.uuid=cA.generateUUID(),t})).reverse();return o.forEach((e=>{e.position.multiply(s);let t=e.controls[0].position.clone().multiply(s),i=e.controls[1].position.clone().multiply(s);e.controls[0].position.copy(i),e.controls[1].position.copy(t)})),o}var OQ=new aT([0,0,0],1),IQ=class extends fT{constructor(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1,s=arguments.length>9&&void 0!==arguments[9]?arguments[9]:1,o=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,l=arguments.length>11&&void 0!==arguments[11]?arguments[11]:1;if(super(),0===n)return;let c=e&&1===n;c&&(l=0),o>100&&(o=100),0===o&&(l=0);let h,u,d,p,f,m,g,v,y=()=>new FA,b=new FA,x=y(),w=y(),_=y(),S=y(),E=y(),C=y(),A=y(),M=y(),T=y(),P=y(),D=y(),k=t-2*a+.001,O=k/n,I=Math.ceil(r*n),R=I+1,L=k/I,B=-k/2,z=s+1,N=2*Math.PI/s,F=Math.PI/2/l,j=Math.min((1-o/100)*a,a-.01),V=a-j,U=0,G=2*l+2,H=z*G/2,W=H+z*R,q=Math.max(0,z*(R+G)),[X,Y,Q]=[3,3,2].map((e=>Array(q*e).fill(0))),Z=[],K=i-a;function J(t,i){let n=Math.PI/2;m=i*L,v=2*Math.PI*(m%O)/O+n,m+=B,g=Math.sin(v)*K,f=Math.cos(v)*K,e?t.set(f,g,m):t.set(f,m,g)}J(b,-1e-10),J(x,0),S.copy(b),J(b,1);let $=b.distanceTo(x),ee=c?0:V+j,te=$*I+2*ee,ie=j,ne=te-ee;for(let oe=0;oe<=I;oe++){J(w,oe),D.subVectors(w,S).normalize(),S.copy(w),T.copy(w).setComponent(+e+1,0).normalize(),P.crossVectors(D,T).normalize();let t=0===oe,i=oe===I,n=t?3*Math.PI/2:F,r=t?ie:ne,o=t?z:W,h=t?0:q-z,u=D.clone().multiplyScalar(t?-V:V).add(w),d=D.clone().multiplyScalar(t?-1:1).normalize();for(let e=0;e<z;e++){let p=e*N;if(E.addVectors(b.copy(T).multiplyScalar(a*Math.cos(p)),x.copy(P).multiplyScalar(a*Math.sin(p))),C.copy(E).normalize(),t||i){c||(U=h+e,[0,1,2].forEach((e=>{X[3*U+e]=u.getComponent(e),Y[3*U+e]=d.getComponent(e)})),Q[2*U]=+i,Q[2*U+1]=e/s),x.copy(C).multiplyScalar(j),_.addVectors(w,x);for(let i=0;i<l;i++){let a=i*F+n;A.addVectors(b.copy(D).multiplyScalar(V*Math.sin(a)),x.copy(C).multiplyScalar(V*Math.cos(a))),M.copy(A).normalize(),x.addVectors(_,A),A.normalize(),U=o+i*z+e,[0,1,2].forEach((e=>{X[3*U+e]=x.getComponent(e),Y[3*U+e]=M.getComponent(e)}));let l=+t+Math.sin(a);Q[2*U]=(r+V*l)/te,Q[2*U+1]=e/s}}x.addVectors(w,E),U=H+oe*z+e,[0,1,2].forEach((e=>{X[3*U+e]=x.getComponent(e),Y[3*U+e]=C.getComponent(e)})),Q[2*U]=(ee+oe*$)/te,Q[2*U+1]=e/s}}let re=R+2*l+2,[ae,se]=[+c,re-1];for(let oe=ae;oe<=se-1;oe++){let e=c&&oe===se-1;for(let t=0;t<z-1;t++)h=oe*z+t,u=h+1,d=(e?t:h)+z,p=(e?t+1:u)+z,0===oe?Z.push(u,p,d):oe===re-2?Z.push(h,u,d):Z.push(h,u,d,u,p,d)}this.setIndex(Z),this.setAttribute("position",new sT(X,3)),this.setAttribute("normal",new sT(Y,3)),this.setAttribute("uv",new sT(Q,2))}getClosedTorusIndicesForBooleanOrSubdiv(){let e,t,i,n,r=this.userData.parameters,a=Math.ceil(r.tubularSegments),s=r.radialSegments+1,o=Array.from(this.getIndex().array),l=6*(a-1)*r.radialSegments,c=a,h=c===a;for(let u=0;u<r.radialSegments;u++)e=c*s+u,t=e+1,i=(h?u:e)+s,n=(h?u+1:t)+s,o[l++]=e,o[l++]=t,o[l++]=i,o[l++]=t,o[l++]=n,o[l++]=i;return o.length=l,OQ.array=o,OQ.count=o.length,OQ}},RQ=class extends cY{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.2,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,n=(1+Math.sqrt(5))/2,r="IcosahedronGeometry";super([-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],r,e,t,i),this.type=r}static fromJSON(e){return new RQ(e.radius,e.corner,e.cornerSides)}},LQ=new mM,BQ=new jM,zQ=new FA,NQ=class extends QC{constructor(){super(),this.uuid=cA.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}applyMatrix4(e){let t=(new uA).getNormalMatrix(e);for(let i=0,n=this.vertices.length;i<n;i++)this.vertices[i].applyMatrix4(e);for(let i=0,n=this.faces.length;i<n;i++){let e=this.faces[i];e.normal.applyMatrix3(t).normalize();for(let i=0,n=e.vertexNormals.length;i<n;i++)e.vertexNormals[i].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this}rotateX(e){return LQ.makeRotationX(e),this.applyMatrix4(LQ),this}rotateY(e){return LQ.makeRotationY(e),this.applyMatrix4(LQ),this}rotateZ(e){return LQ.makeRotationZ(e),this.applyMatrix4(LQ),this}translate(e,t,i){return LQ.makeTranslation(e,t,i),this.applyMatrix4(LQ),this}scale(e,t,i){return LQ.makeScale(e,t,i),this.applyMatrix4(LQ),this}lookAt(e){return BQ.lookAt(e),BQ.updateMatrix(),this.applyMatrix4(BQ.matrix),this}fromBufferGeometry(e){let t=this,i=null!==e.index?e.index:void 0,n=e.attributes;if(void 0===n.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;let r=n.position,a=n.normal,s=n.color,o=n.uv,l=n.uv2;void 0!==l&&(this.faceVertexUvs[1]=[]);for(let u=0;u<r.count;u++)t.vertices.push((new FA).fromBufferAttribute(r,u)),void 0!==s&&t.colors.push((new MA).fromBufferAttribute(s,u));function c(e,i,n,r){let c=void 0===s?[]:[t.colors[e].clone(),t.colors[i].clone(),t.colors[n].clone()],h=void 0===a?[]:[(new FA).fromBufferAttribute(a,e),(new FA).fromBufferAttribute(a,i),(new FA).fromBufferAttribute(a,n)],u=new jQ(e,i,n,h,c,r);t.faces.push(u),void 0!==o&&t.faceVertexUvs[0].push([(new hA).fromBufferAttribute(o,e),(new hA).fromBufferAttribute(o,i),(new hA).fromBufferAttribute(o,n)]),void 0!==l&&t.faceVertexUvs[1].push([(new hA).fromBufferAttribute(l,e),(new hA).fromBufferAttribute(l,i),(new hA).fromBufferAttribute(l,n)])}let h=e.groups;if(h.length>0)for(let u=0;u<h.length;u++){let e=h[u],t=e.start;for(let n=t,r=t+e.count;n<r;n+=3)void 0!==i?c(i.getX(n),i.getX(n+1),i.getX(n+2),e.materialIndex):c(n,n+1,n+2,e.materialIndex)}else if(void 0!==i)for(let u=0;u<i.count;u+=3)c(i.getX(u),i.getX(u+1),i.getX(u+2));else for(let u=0;u<r.count;u+=3)c(u,u+1,u+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(zQ).negate(),this.translate(zQ.x,zQ.y,zQ.z),this}normalize(){this.computeBoundingSphere();let e=this.boundingSphere.center,t=this.boundingSphere.radius,i=0===t?1:1/t,n=new mM;return n.set(i,0,0,-i*e.x,0,i,0,-i*e.y,0,0,i,-i*e.z,0,0,0,1),this.applyMatrix4(n),this}computeFaceNormals(){let e=new FA,t=new FA;for(let i=0,n=this.faces.length;i<n;i++){let n=this.faces[i],r=this.vertices[n.a],a=this.vertices[n.b],s=this.vertices[n.c];e.subVectors(s,a),t.subVectors(r,a),e.cross(t),e.normalize(),n.normal.copy(e)}}computeVertexNormals(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=new Array(this.vertices.length);for(let i=0,n=this.vertices.length;i<n;i++)t[i]=new FA;if(e){let e=new FA,i=new FA;for(let n=0,r=this.faces.length;n<r;n++){let r=this.faces[n],a=this.vertices[r.a],s=this.vertices[r.b],o=this.vertices[r.c];e.subVectors(o,s),i.subVectors(a,s),e.cross(i),t[r.a].add(e),t[r.b].add(e),t[r.c].add(e)}}else{this.computeFaceNormals();for(let e=0,i=this.faces.length;e<i;e++){let i=this.faces[e];t[i.a].add(i.normal),t[i.b].add(i.normal),t[i.c].add(i.normal)}}for(let i=0,n=this.vertices.length;i<n;i++)t[i].normalize();for(let i=0,n=this.faces.length;i<n;i++){let e=this.faces[i],n=e.vertexNormals;3===n.length?(n[0].copy(t[e.a]),n[1].copy(t[e.b]),n[2].copy(t[e.c])):(n[0]=t[e.a].clone(),n[1]=t[e.b].clone(),n[2]=t[e.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)}computeFlatVertexNormals(){this.computeFaceNormals();for(let e=0,t=this.faces.length;e<t;e++){let t=this.faces[e],i=t.vertexNormals;3===i.length?(i[0].copy(t.normal),i[1].copy(t.normal),i[2].copy(t.normal)):(i[0]=t.normal.clone(),i[1]=t.normal.clone(),i[2]=t.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)}computeMorphNormals(){for(let t=0,i=this.faces.length;t<i;t++){let e=this.faces[t];e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]);for(let t=0,i=e.vertexNormals.length;t<i;t++)e.__originalVertexNormals[t]?e.__originalVertexNormals[t].copy(e.vertexNormals[t]):e.__originalVertexNormals[t]=e.vertexNormals[t].clone()}let e=new NQ;e.faces=this.faces;for(let t=0,i=this.morphTargets.length;t<i;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];let e=this.morphNormals[t].faceNormals,i=this.morphNormals[t].vertexNormals;for(let t=0,n=this.faces.length;t<n;t++){let t=new FA,n={a:new FA,b:new FA,c:new FA};e.push(t),i.push(n)}}let i=this.morphNormals[t];e.vertices=this.morphTargets[t].vertices,e.computeFaceNormals(),e.computeVertexNormals();for(let e=0,t=this.faces.length;e<t;e++){let t=this.faces[e],n=i.faceNormals[e],r=i.vertexNormals[e];n.copy(t.normal),r.a.copy(t.vertexNormals[0]),r.b.copy(t.vertexNormals[1]),r.c.copy(t.vertexNormals[2])}}for(let t=0,i=this.faces.length;t<i;t++){let e=this.faces[t];e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals}}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new UA),this.boundingBox.setFromPoints(this.vertices)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new sM),this.boundingSphere.setFromPoints(this.vertices)}merge(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!e||!e.isGeometry)return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e);let n,r=this.vertices.length,a=this.vertices,s=e.vertices,o=this.faces,l=e.faces,c=this.colors,h=e.colors;void 0!==t&&(n=(new uA).getNormalMatrix(t));for(let u=0,d=s.length;u<d;u++){let e=s[u].clone();void 0!==t&&e.applyMatrix4(t),a.push(e)}for(let u=0,d=h.length;u<d;u++)c.push(h[u].clone());for(let u=0,d=l.length;u<d;u++){let e,t,a=l[u],s=a.vertexNormals,c=a.vertexColors,h=new jQ(a.a+r,a.b+r,a.c+r);h.normal.copy(a.normal),void 0!==n&&h.normal.applyMatrix3(n).normalize();for(let i=0,r=s.length;i<r;i++)e=s[i].clone(),void 0!==n&&e.applyMatrix3(n).normalize(),h.vertexNormals.push(e);h.color.copy(a.color);for(let i=0,n=c.length;i<n;i++)t=c[i],h.vertexColors.push(t.clone());h.materialIndex=a.materialIndex+i,o.push(h)}for(let u=0,d=e.faceVertexUvs.length;u<d;u++){let t=e.faceVertexUvs[u];void 0===this.faceVertexUvs[u]&&(this.faceVertexUvs[u]=[]);for(let e=0,i=t.length;e<i;e++){let i=t[e],n=[];for(let e=0,t=i.length;e<t;e++)n.push(i[e].clone());this.faceVertexUvs[u].push(n)}}}mergeMesh(e){e&&e.isMesh?(e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e)}mergeVertices(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4,t={},i=[],n=[],r=Math.pow(10,e);for(let o=0,l=this.vertices.length;o<l;o++){let e=this.vertices[o],a=Math.round(e.x*r)+"_"+Math.round(e.y*r)+"_"+Math.round(e.z*r);void 0===t[a]?(t[a]=o,i.push(this.vertices[o]),n[o]=i.length-1):n[o]=n[t[a]]}let a=[];for(let o=0,l=this.faces.length;o<l;o++){let e=this.faces[o];e.a=n[e.a],e.b=n[e.b],e.c=n[e.c];let t=[e.a,e.b,e.c];for(let i=0;i<3;i++)if(t[i]===t[(i+1)%3]){a.push(o);break}}for(let o=a.length-1;o>=0;o--){let e=a[o];this.faces.splice(e,1);for(let t=0,i=this.faceVertexUvs.length;t<i;t++)this.faceVertexUvs[t].splice(e,1)}let s=this.vertices.length-i.length;return this.vertices=i,s}setFromPoints(e){this.vertices=[];for(let t=0,i=e.length;t<i;t++){let i=e[t];this.vertices.push(new FA(i.x,i.y,i.z||0))}return this}sortFacesByMaterialIndex(){let e=this.faces,t=e.length;for(let s=0;s<t;s++)e[s]._id=s;e.sort((function(e,t){return e.materialIndex-t.materialIndex}));let i,n,r=this.faceVertexUvs[0],a=this.faceVertexUvs[1];r&&r.length===t&&(i=[]),a&&a.length===t&&(n=[]);for(let s=0;s<t;s++){let t=e[s]._id;i&&i.push(r[t]),n&&n.push(a[t])}i&&(this.faceVertexUvs[0]=i),n&&(this.faceVertexUvs[1]=n)}toJSON(){let e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){let t=this.parameters;for(let i in t)void 0!==t[i]&&(e[i]=t[i]);return e}let t=[];for(let p=0;p<this.vertices.length;p++){let e=this.vertices[p];t.push(e.x,e.y,e.z)}let i=[],n=[],r={},a=[],s={},o=[],l={};for(let p=0;p<this.faces.length;p++){let e=this.faces[p],t=!0,n=!1,r=void 0!==this.faceVertexUvs[0][p],a=e.normal.length()>0,s=e.vertexNormals.length>0,o=1!==e.color.r||1!==e.color.g||1!==e.color.b,l=e.vertexColors.length>0,f=0;if(f=c(f,0,0),f=c(f,1,t),f=c(f,2,n),f=c(f,3,r),f=c(f,4,a),f=c(f,5,s),f=c(f,6,o),f=c(f,7,l),i.push(f),i.push(e.a,e.b,e.c),i.push(e.materialIndex),r){let e=this.faceVertexUvs[0][p];i.push(d(e[0]),d(e[1]),d(e[2]))}if(a&&i.push(h(e.normal)),s){let t=e.vertexNormals;i.push(h(t[0]),h(t[1]),h(t[2]))}if(o&&i.push(u(e.color)),l){let t=e.vertexColors;i.push(u(t[0]),u(t[1]),u(t[2]))}}function c(e,t,i){return i?e|1<<t:e&~(1<<t)}function h(e){let t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==r[t]||(r[t]=n.length/3,n.push(e.x,e.y,e.z)),r[t]}function u(e){let t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==s[t]||(s[t]=a.length,a.push(e.getHex())),s[t]}function d(e){let t=e.x.toString()+e.y.toString();return void 0!==l[t]||(l[t]=o.length/2,o.push(e.x,e.y)),l[t]}return e.data={},e.data.vertices=t,e.data.normals=n,a.length>0&&(e.data.colors=a),o.length>0&&(e.data.uvs=[o]),e.data.faces=i,e}clone(){return(new NQ).copy(this)}copy(e){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=e.name;let t=e.vertices;for(let u=0,d=t.length;u<d;u++)this.vertices.push(t[u].clone());let i=e.colors;for(let u=0,d=i.length;u<d;u++)this.colors.push(i[u].clone());let n=e.faces;for(let u=0,d=n.length;u<d;u++)this.faces.push(n[u].clone());for(let u=0,d=e.faceVertexUvs.length;u<d;u++){let t=e.faceVertexUvs[u];void 0===this.faceVertexUvs[u]&&(this.faceVertexUvs[u]=[]);for(let e=0,i=t.length;e<i;e++){let i=t[e],n=[];for(let e=0,t=i.length;e<t;e++){let t=i[e];n.push(t.clone())}this.faceVertexUvs[u].push(n)}}let r=e.morphTargets;for(let u=0,d=r.length;u<d;u++){let e={};if(e.name=r[u].name,void 0!==r[u].vertices){e.vertices=[];for(let t=0,i=r[u].vertices.length;t<i;t++)e.vertices.push(r[u].vertices[t].clone())}if(void 0!==r[u].normals){e.normals=[];for(let t=0,i=r[u].normals.length;t<i;t++)e.normals.push(r[u].normals[t].clone())}this.morphTargets.push(e)}let a=e.morphNormals;for(let u=0,d=a.length;u<d;u++){let e={};if(void 0!==a[u].vertexNormals){e.vertexNormals=[];for(let t=0,i=a[u].vertexNormals.length;t<i;t++){let i=a[u].vertexNormals[t],n={};n.a=i.a.clone(),n.b=i.b.clone(),n.c=i.c.clone(),e.vertexNormals.push(n)}}if(void 0!==a[u].faceNormals){e.faceNormals=[];for(let t=0,i=a[u].faceNormals.length;t<i;t++)e.faceNormals.push(a[u].faceNormals[t].clone())}this.morphNormals.push(e)}let s=e.skinWeights;for(let u=0,d=s.length;u<d;u++)this.skinWeights.push(s[u].clone());let o=e.skinIndices;for(let u=0,d=o.length;u<d;u++)this.skinIndices.push(o[u].clone());let l=e.lineDistances;for(let u=0,d=l.length;u<d;u++)this.lineDistances.push(l[u]);let c=e.boundingBox;null!==c&&(this.boundingBox=c.clone());let h=e.boundingSphere;return null!==h&&(this.boundingSphere=h.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this}toBufferGeometry(){let e=(new FQ).fromGeometry(this),t=new fT,i=new Float32Array(3*e.vertices.length);if(t.setAttribute("position",HQ.call(new nT(i,3),e.vertices)),e.normals.length>0){let i=new Float32Array(3*e.normals.length);t.setAttribute("normal",HQ.call(new nT(i,3),e.normals))}if(e.colors.length>0){let i=new Float32Array(3*e.colors.length);t.setAttribute("color",UQ.call(new nT(i,3),e.colors))}if(e.uvs.length>0){let i=new Float32Array(2*e.uvs.length);t.setAttribute("uv",GQ.call(new nT(i,2),e.uvs))}if(e.uvs2.length>0){let i=new Float32Array(2*e.uvs2.length);t.setAttribute("uv2",GQ.call(new nT(i,2),e.uvs2))}t.groups=e.groups;for(let n in e.morphTargets){let i=[],r=e.morphTargets[n];for(let e=0,t=r.length;e<t;e++){let t=r[e],n=new sT(3*t.data.length,3);n.name=t.name,i.push(HQ.call(n,t.data))}t.morphAttributes[n]=i}if(e.skinIndices.length>0){let i=new sT(4*e.skinIndices.length,4);t.setAttribute("skinIndex",WQ.call(i,e.skinIndices))}if(e.skinWeights.length>0){let i=new sT(4*e.skinWeights.length,4);t.setAttribute("skinWeight",WQ.call(i,e.skinWeights))}return null!==e.boundingSphere&&(t.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(t.boundingBox=e.boundingBox.clone()),t}computeTangents(){console.error("THREE.Geometry: .computeTangents() has been removed.")}computeLineDistances(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}applyMatrix(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}dispose(){this.dispatchEvent({type:"dispose"})}static createBufferGeometryFromObject(e){let t=new fT,i=e.geometry;if(e.isPoints||e.isLine){let e=new sT(3*i.vertices.length,3),n=new sT(3*i.colors.length,3);if(t.setAttribute("position",HQ.call(e,i.vertices)),t.setAttribute("color",UQ.call(n,i.colors)),i.lineDistances&&i.lineDistances.length===i.vertices.length){let e=new sT(i.lineDistances.length,1);t.setAttribute("lineDistance",VQ.call(e,i.lineDistances))}null!==i.boundingSphere&&(t.boundingSphere=i.boundingSphere.clone()),null!==i.boundingBox&&(t.boundingBox=i.boundingBox.clone())}else e.isMesh&&(t=i.toBufferGeometry());return t}};NQ.prototype.isGeometry=!0;var FQ=class{constructor(){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}computeGroups(e){let t,i,n,r=[],a=e.faces;for(i=0;i<a.length;i++){let e=a[i];e.materialIndex!==n&&(n=e.materialIndex,void 0!==t&&(t.count=3*i-t.start,r.push(t)),t={start:3*i,materialIndex:n})}void 0!==t&&(t.count=3*i-t.start,r.push(t)),this.groups=r}fromGeometry(e){let t,i=e.faces,n=e.vertices,r=e.faceVertexUvs,a=r[0]&&r[0].length>0,s=r[1]&&r[1].length>0,o=e.morphTargets,l=o.length;if(l>0){t=[];for(let e=0;e<l;e++)t[e]={name:o[e].name,data:[]};this.morphTargets.position=t}let c,h=e.morphNormals,u=h.length;if(u>0){c=[];for(let e=0;e<u;e++)c[e]={name:h[e].name,data:[]};this.morphTargets.normal=c}let d=e.skinIndices,p=e.skinWeights,f=d.length===n.length,m=p.length===n.length;n.length>0&&0===i.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let g=0;g<i.length;g++){let e=i[g];this.vertices.push(n[e.a],n[e.b],n[e.c]);let v=e.vertexNormals;if(3===v.length)this.normals.push(v[0],v[1],v[2]);else{let t=e.normal;this.normals.push(t,t,t)}let y=e.vertexColors;if(3===y.length)this.colors.push(y[0],y[1],y[2]);else{let t=e.color;this.colors.push(t,t,t)}if(!0===a){let e=r[0][g];void 0!==e?this.uvs.push(e[0],e[1],e[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",g),this.uvs.push(new hA,new hA,new hA))}if(!0===s){let e=r[1][g];void 0!==e?this.uvs2.push(e[0],e[1],e[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",g),this.uvs2.push(new hA,new hA,new hA))}for(let i=0;i<l;i++){let n=o[i].vertices;t[i].data.push(n[e.a],n[e.b],n[e.c])}for(let t=0;t<u;t++){let e=h[t].vertexNormals[g];c[t].data.push(e.a,e.b,e.c)}f&&this.skinIndices.push(d[e.a],d[e.b],d[e.c]),m&&this.skinWeights.push(p[e.a],p[e.b],p[e.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this}},jQ=class{constructor(e,t,i,n,r){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.a=e,this.b=t,this.c=i,this.normal=n&&n.isVector3?n:new FA,this.vertexNormals=Array.isArray(n)?n:[],this.color=r&&r.isColor?r:new MA,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=a}clone(){return(new this.constructor).copy(this)}copy(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(let t=0,i=e.vertexNormals.length;t<i;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(let t=0,i=e.vertexColors.length;t<i;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}};function VQ(e){return this.array.set(e),this}function UQ(e){let t=this.array,i=0;for(let n=0,r=e.length;n<r;n++){let r=e[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",n),r=new MA),t[i++]=r.r,t[i++]=r.g,t[i++]=r.b}return this}function GQ(e){let t=this.array,i=0;for(let n=0,r=e.length;n<r;n++){let r=e[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",n),r=new hA),t[i++]=r.x,t[i++]=r.y}return this}function HQ(e){let t=this.array,i=0;for(let n=0,r=e.length;n<r;n++){let r=e[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",n),r=new FA),t[i++]=r.x,t[i++]=r.y,t[i++]=r.z}return this}function WQ(e){let t=this.array,i=0;for(let n=0,r=e.length;n<r;n++){let r=e[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",n),r=new RA),t[i++]=r.x,t[i++]=r.y,t[i++]=r.z,t[i++]=r.w}return this}var qQ=["a","b","c"];function XQ(e,t){switch(t){case"c":return e.c;case"b":return e.b;default:return e.a}}function YQ(e,t,i){let n=Math.min(e,t)+"_"+Math.max(e,t);return i.get(n)}function QQ(e,t,i,n,r,a){let s,o=Math.min(e,t),l=Math.max(e,t),c=o+"_"+l;if(n.has(c))s=n.get(c);else{s={a:i[o],b:i[l],newEdge:null,faces:[]},n.set(c,s)}s.faces.push(r),a[e].edges.push(s),a[t].edges.push(s)}function ZQ(e,t,i,n,r){e.push(new jQ(t,i,n,void 0,void 0,r))}function KQ(e,t){return Math.abs(t-e)/2+Math.min(e,t)}function JQ(e,t,i,n){e.push([t.clone(),i.clone(),n.clone()])}var $Q=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.subdivisions=e}modify(e){(e=e instanceof fT?(new NQ).fromBufferGeometry(e):e.clone()).mergeVertices();let t=this.subdivisions;for(;t-- >0;)this._smooth(e);return e.computeFaceNormals(),e.computeVertexNormals(),e}_smooth(e){let t,i,n,r,a,s=new FA,o=e.vertices,l=e.faces,c=e.faceVertexUvs[0],h=void 0!==c&&c.length>0,u=[],d=new Map;!function(e,t,i,n){let r,a,s;for(r=0,a=e.length;r<a;r++)i[r]={edges:[]};for(r=0,a=t.length;r<a;r++)s=t[r],QQ(s.a,s.b,e,n,s,i),QQ(s.b,s.c,e,n,s,i),QQ(s.c,s.a,e,n,s,i)}(o,l,u,d);let p,f,m,g,v,y,b,x=[];for(let G of Array.from(d.keys())){for(f=d.get(G),m=new FA,v=3/8,y=1/8,b=f.faces.length,2!=b&&(v=.5,y=0),m.addVectors(f.a,f.b).multiplyScalar(v),s.set(0,0,0),r=0;r<b;r++){for(g=f.faces[r],a=0;a<3&&(p=o[XQ(g,qQ[a])],p===f.a||p===f.b);a++);p&&s.add(p)}s.multiplyScalar(y),m.add(s),f.newEdge=x.length,x.push(m)}let w,_,S,E,C,A,M,T=[];for(i=0,n=o.length;i<n;i++){for(A=o[i],C=u[i].edges,t=C.length,3==t?w=3/16:t>3&&(w=3/(8*t)),_=1-t*Number(w),S=w,t<=2&&(2==t&&(_=3/4,S=1/8)),M=A.clone().multiplyScalar(_),s.set(0,0,0),r=0;r<t;r++)E=C[r],p=E.a!==A?E.a:E.b,s.add(p);s.multiplyScalar(Number(S)),M.add(s),T.push(M)}let P,D,k,O,I,R,L,B=T.concat(x),z=T.length,N=[],F=[],j=new hA,V=new hA,U=new hA;for(i=0,n=l.length;i<n;i++)g=l[i],P=Number(YQ(g.a,g.b,d).newEdge)+z,D=Number(YQ(g.b,g.c,d).newEdge)+z,k=Number(YQ(g.c,g.a,d).newEdge)+z,ZQ(N,P,D,k,g.materialIndex),ZQ(N,g.a,P,k,g.materialIndex),ZQ(N,g.b,D,P,g.materialIndex),ZQ(N,g.c,k,D,g.materialIndex),h&&(O=c[i],I=O[0],R=O[1],L=O[2],j.set(KQ(I.x,R.x),KQ(I.y,R.y)),V.set(KQ(R.x,L.x),KQ(R.y,L.y)),U.set(KQ(I.x,L.x),KQ(I.y,L.y)),JQ(F,j,V,U),JQ(F,I,j,U),JQ(F,R,V,j),JQ(F,L,U,V));e.vertices=B,e.faces=N,h&&(e.faceVertexUvs[0]=F)}},eZ=new FA,tZ=class{static create(e){return this.build(this.normalizeInputs(e))}static normalizeInputs(e,t){var i,n,r;let a=Object.assign({},null!==(i=null===t||void 0===t?void 0:t.parameters)&&void 0!==i?i:{width:100,depth:0,spikes:5,cornerRadius:0,extrudeBevelSize:0,extrudeBevelSegments:3},e.parameters);return{shape:e.shape&&e.shape instanceof qY?e.shape:new qY,parameters:Object.assign(a,{width:Math.abs(a.width),height:Math.abs(null!==(n=a.height)&&void 0!==n?n:a.width),depth:Math.abs(null!==(r=a.depth)&&void 0!==r?r:0)})}}static build(e){let{width:t,height:i,spikes:n,cornerRadius:r,depth:a,extrudeBevelSize:s,extrudeBevelSegments:o}=e.parameters,l=e.shape,c=.5*t,h=.5*i,u=2*Math.PI/n;for(let p=0;p<n;p++){let e=u*p,t=0+Math.sin(e)*c,i=0+Math.cos(e)*h;l.addPoint(l.createPoint(t,i))}l.isClosed=!0;for(let p=0,f=l.points.length;p<f;p++)l.points[p].roundness=r;l.roundness=r,l.update();let d=SQ.create({shape:l,parameters:{roundness:r,depth:a,extrudeBevelSize:s,extrudeBevelSegments:o}});return Object.assign(d,{userData:{...e,type:"PolygonGeometry"}})}};function iZ(e,t,i){i.x=e.x*t.x,i.y=e.y,i.z=e.x*t.y}function nZ(e,t,i,n,r,a){let s=t.clone().sub(e),o=i.clone().sub(e),l=s.angleTo(o);if(s.normalize(),o.normalize(),n===r){let t=s.add(o).normalize();a.copy(e).addScaledVector(t,n/Math.sin(l/2))}else{let t=s.angleTo(o);a.copy(e),a.addScaledVector(s,r/Math.sin(t)),a.addScaledVector(o,n/Math.sin(t))}}function rZ(e,t,i){let n=e.clone().sub(t),r=i.clone().sub(t);return n.projectOnVector(r),n.add(t)}var aZ=class extends fT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.5,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:4;super(),i=Math.floor(Math.max(3,i)),n=Math.floor(n),s=Math.floor(s);let o,l=[],c=[],h=[],u=[],d=0,p=t/2,f=Math.PI/i,m=e*Math.cos(Math.PI/i),g=2*Math.PI/i,v=(i-2)*Math.PI/i,y=Math.PI-v,b=new FA(0,-p,0),x=new FA(0,p,0),w=new hA(e,-p),_=new hA(m,-p),S=new hA(0,x.y).sub(_),E=new hA(0,x.y).sub(w),C=new hA(S.y,-S.x).normalize(),A=new hA(E.y,-E.x).normalize(),M=e*Math.cos(Math.PI/i)*Math.tan((Math.PI-S.angle())/2)-1e-8;a=Math.min(a,M);{let e=new FA(C.x,C.y,0),t=new FA(Math.cos(g)*e.x,e.y,Math.sin(g)*e.x);o=e.angleTo(t)}let T=a/Math.tan((Math.PI-S.angle())/2),P=a/Math.tan((Math.PI-o)/2),D=new FA;if(!r){c.push(b.x,b.y,b.z),h.push(0,-1,0),u.push(0,0);let e=d++,t=[],n=w.clone(),r=T/Math.cos(Math.PI/i);n.x-=r;for(let a=0;a<i;a++){let e=a/i*Math.PI*2+f;iZ(n,new hA(Math.sin(e),Math.cos(e)),D),c.push(D.x,D.y,D.z),h.push(0,-1,0),u.push(0,0),t.push(d++)}for(let i=0;i<t.length;i++)l.push(t[i],e,t[(i+1)%t.length])}let k=[];{let e=new FA,t=new FA,n=new FA,r=new FA,p=new FA,m=new FA;for(let g=0;g<i;g++){let v=g/i*Math.PI*2+f,y=(g+.5)/i*Math.PI*2+f,_=(g+1)/i*Math.PI*2+f,E=new hA(Math.sin(v),Math.cos(v)),M=new hA(Math.sin(y),Math.cos(y)),D=new hA(Math.sin(_),Math.cos(_));iZ(w,E,t),iZ(w,D,n),iZ(C,M,e),nZ(x,t,n,P,P,r),c.push(r.x,r.y,r.z),nZ(t,x,n,P,T,p),c.push(p.x,p.y,p.z),nZ(n,t,x,T,P,m),c.push(m.x,m.y,m.z),h.push(e.x,e.y,e.z),h.push(e.x,e.y,e.z),h.push(e.x,e.y,e.z),u.push(0,0),u.push(0,0),u.push(0,0);let R=d++,L=d++,B=d++;if(l.push(R,L,B),a>0){{let e=t.clone().add(n).multiplyScalar(.5),i=x.clone().sub(e).normalize(),r=b.clone().sub(e).normalize().add(i).normalize().multiplyScalar(-1);O(e,m.clone().sub(p),r,S.angle())}let f,g;{let e=new FA;iZ(A,D,e);let t=m.clone().add(r).multiplyScalar(.5);t=rZ(t,n,x);let i=m.clone().sub(r);[f,g]=O(t,i,e,o,r.y)}{let e=f,t=e.clone().setY(0).normalize(),i=new FA(0,-1,0),n=t.clone().cross(i);I(e,t,i,n)}k.concat(g);{let t=S.angle(),n=Math.PI-t,r=x.clone();r.y-=a/Math.sin(t-Math.PI/2);let o=new FA,p=[];for(let l=0;l<s;l++){let t=[],f=Math.PI/2-n*l/s,m=Math.cos(f),g=Math.sin(f),v=y;for(let n=0;n<=l;n++){let n=Math.cos(v),s=Math.sin(v);e.x=m*s,e.y=g,e.z=m*n,o.copy(r).addScaledVector(e,a),c.push(o.x,o.y,o.z),h.push(e.x,e.y,e.z),u.push(0,0),t.push(d++),v+=2*Math.PI/l/i}p.push(t)}g.reverse(),p.push(g);let f=p.length-1;for(let e=0;e<f;e++){let t=p[e],i=p[e+1],n=t.length-1;l.push(i[1],t[0],i[0]);for(let e=1;e<=n;e++)l.push(t[e],t[e-1],i[e]),l.push(i[e+1],t[e],i[e])}}}}}function O(e,t,i,n,r){let o=-n/2,p=(Math.PI-n)/2,f=t.clone().normalize().cross(i);e.addScaledVector(i,-a/Math.sin(p));let m=new FA,g=new FA,v=d,y=[];for(let l=0;l<=s;l++){let p=o+l/s*n;g.set(0,0,0),g.addScaledVector(f,Math.sin(p)),g.addScaledVector(i,Math.cos(p));for(let i=0;i<=1;i++){let n=i/1-.5;if(m.copy(e),m.addScaledVector(t,n),m.addScaledVector(g,a),null!=r){let e=Math.max(0,m.y-r);m.addScaledVector(t,-e/t.y)}c.push(m.x,m.y,m.z),h.push(g.x,g.y,g.z),u.push(0,0),0===i&&y.push(d),d++}}for(let a=0;a<s;a++)for(let e=0;e<1;e++){let t=v+e+2*a,i=t+2,n=i+1,r=t+1;l.push(t,i,r),l.push(i,n,r)}return[e.clone().addScaledVector(t,.5),y]}function I(e,t,i,n){let r=Math.PI/2,o=E.angle()-r,p=[],f=new FA,m=new FA;for(let l=0;l<=s;l++){let g=[],v=l/s;for(let s=0;s<=l;s++){let p=((l?s/l:0)-.5)*y,b=Math.cos(p),x=Math.sin(p),w=(r+Math.atan(Math.tan(o)*b))*v,_=Math.cos(w),S=Math.sin(w);f.set(0,0,0),f.addScaledVector(t,S*b),f.addScaledVector(i,_),f.addScaledVector(n,S*x),m.copy(e).addScaledVector(f,a),c.push(m.x,m.y,m.z),h.push(f.x,f.y,f.z),u.push(0,0),g.push(d++)}p.push(g)}let g=p.length-1;for(let a=0;a<g;a++){let e=p[a],t=p[a+1],i=e.length-1;l.push(e[0],t[1],t[0]);for(let n=1;n<=i;n++)l.push(e[n-1],e[n],t[n]),l.push(e[n],t[n+1],t[n])}}this.setIndex(l),this.setAttribute("position",new sT(c,3)),this.setAttribute("normal",new sT(h,3)),this.setAttribute("uv",new sT(u,2))}},sZ=class{static create(e){return this.build(this.normalizeInputs(e))}static normalizeInputs(e,t){var i,n,r,a;let s=Object.assign({},null!==(i=null===t||void 0===t?void 0:t.parameters)&&void 0!==i?i:{width:100,depth:0,cornerRadius:[0,0,0,0],cornerType:1,extrudeBevelSize:0,extrudeBevelSegments:1},e.parameters),o=Object.assign(null!==(n=null===t||void 0===t?void 0:t.ui)&&void 0!==n?n:{enabledIndieCorners:!1},e.ui);return{shape:e.shape&&e.shape instanceof qY?e.shape:new qY,parameters:Object.assign(s,{width:Math.abs(s.width),height:Math.abs(null!==(r=s.height)&&void 0!==r?r:s.width),depth:Math.abs(null!==(a=s.depth)&&void 0!==a?a:0)}),ui:o}}static build(e){let t=e.shape,{width:i,height:n,cornerRadius:r,cornerType:a,depth:s,extrudeBevelSize:o,extrudeBevelSegments:l}=e.parameters,c={x:.5*i,y:.5*n},h={x:-c.x,y:-c.y},u={x:c.x,y:c.y};function d(e,t,r){return t>i&&r>n?Math.min(e*i/t,e*n/r):t>i?e*i/t:r>n?e*n/r:e}let p=[];p[0]=0===r[0]?0:d(r[0],r[0]+r[3],r[0]+r[1]),p[1]=0===r[1]?0:d(r[1],r[1]+r[2],r[1]+r[0]),p[2]=0===r[2]?0:d(r[2],r[2]+r[1],r[2]+r[3]),p[3]=0===r[3]?0:d(r[3],r[3]+r[0],r[3]+r[2]);let f=h.x,m=u.x,g=u.y,v=h.y;t.addPoint(t.createPoint(f,g)),t.addPoint(t.createPoint(m,g)),t.addPoint(t.createPoint(m,v)),t.addPoint(t.createPoint(f,v)),t.isClosed=!0;let y=!0;for(let x=0,w=t.points.length;x<w;x++)t.points[x].roundness=p[x],x>0&&p[x]!==p[x-1]&&(y=!1);y&&(t.roundness=p[0]),t.useCubicForRoundedCorners=1!==a,t.update();let b=SQ.create({shape:t,parameters:{depth:s,extrudeBevelSize:o,extrudeBevelSegments:l}});return Object.assign(b,{userData:{...e,type:"RectangleGeometry"}})}},oZ=class extends fT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:90,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:10,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:24;super(),this.type="BackdropGeometry";let s=[],o=[],l=[],c=.001;0==r&&(a=1),a=Math.max(1,Math.floor(a)),r=Math.min(r,100),n=Math.min(180-c,n),n*=Math.PI/180;let h=[],u=Math.PI/2,d=function(){return new FA(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)},p=d(),f=d(),[m,g,v]=[t/2,e/2,i/2],y=-g,b=+g,[x,w,_]=[d(y,-m,+v),d(y,-m,-v),d(y,+m,-v)],S=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Math.sin(e-Math.PI/(+t+1))},E=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Math.cos(e-Math.PI/(+t+1))};_.y=Math.sin(n)*t-m;let C=Math.cos(n)*t-v,A=x.z-c;n<=u?(_.z=Math.min(C,A),_.z==A&&(_.y-=(C-A)/Math.tan(u-n))):w.z=Math.min(w.z-C-v,x.z-c),p.subVectors(x,w),f.subVectors(_,w);let M=Math.min(p.length(),f.length())*r/100,T=M*Math.tan(n/2),P=M/Math.cos(n/2),D=p.clone().normalize().add(f.normalize()).setLength(P).add(w);p.set(0,S(n,!0),E(n,!0)),h.push([_,p.clone()]);let k=(Math.PI-n)/a;for(let U=0;U<=a;U++){let e=u+n+U*k;p.set(0,Math.sin(e)*T,Math.cos(e)*T),p.add(D),f.set(0,S(e),E(e)),h.push([p.clone(),f.clone()])}h.push([x,d(0,1,0)]);let O=Math.sin(k/2)*T*2,I=h.length-1,R=h[0][0].distanceTo(h[1][0]),L=R+O*a+h[I-1][0].distanceTo(h[I][0]);h[0].push(1);for(let U=0;U<=a;U++)h[U+1].push(1-(R+U*O)/L);h[I].push(0);let B,z,N,[F,j,V]=h[0];for(let U=1;U<h.length;U++)[B,z,N]=h[U],s.push(y,F.y,F.z,y,B.y,B.z,b,F.y,F.z,b,F.y,F.z,y,B.y,B.z,b,B.y,B.z),o.push(0,j.y,j.z,0,z.y,z.z,0,j.y,j.z,0,j.y,j.z,0,z.y,z.z,0,z.y,z.z),l.push(0,V,0,N,1,V,1,V,0,N,1,N),[F,j,V]=[B,z,N];this.setAttribute("position",new sT(s,3)),this.setAttribute("normal",new sT(o,3)),this.setAttribute("uv",new sT(l,2))}},lZ=class{static create(e){return this.build(this.normalizeInputs(e))}static normalizeInputs(e,t){var i,n,r;let a=Object.assign({},null!==(i=null===t||void 0===t?void 0:t.parameters)&&void 0!==i?i:{width:100,depth:0,innerRadiusPercent:38.19,spikes:5,cornerRadius:0,angle:360,extrudeBevelSize:0,extrudeBevelSegments:1},e.parameters);return{shape:e.shape&&e.shape instanceof qY?e.shape:new qY,parameters:Object.assign(a,{width:Math.abs(a.width),height:Math.abs(null!==(n=a.height)&&void 0!==n?n:a.width),depth:Math.abs(null!==(r=a.depth)&&void 0!==r?r:0)})}}static build(e){let{width:t,height:i,innerRadiusPercent:n,spikes:r,cornerRadius:a,angle:s,depth:o,extrudeBevelSize:l,extrudeBevelSegments:c}=e.parameters,h=e.shape,u=.5*t,d=.5*i,p=s*Math.PI/360/r,f=Math.PI/2*3*-1,m=u*n/100,g=d*n/100;if(3===r&&50===n){p=2*Math.PI/r;for(let e=0;e<r;e++){let t=p*e,i=0+Math.sin(t)*u,n=0+Math.cos(t)*d;h.addPoint(h.createPoint(i,n))}}else for(let y=0;y<r;y++){let e=0+Math.cos(f)*u,t=0+Math.sin(f)*d;h.addPoint(h.createPoint(e,t)),f+=p,e=0+Math.cos(f)*m,t=0+Math.sin(f)*g,h.addPoint(h.createPoint(e,t)),f+=p}h.isClosed=!0;for(let y=0,b=h.points.length;y<b;y++)h.points[y].roundness=a;h.roundness=a,h.update();let v=SQ.create({shape:h,parameters:{roundness:a,depth:o,extrudeBevelSize:l,extrudeBevelSegments:c}});return Object.assign(v,{userData:{...e,type:"StarGeometry"}})}};var cZ=class{static get version(){return"1.3.8"}static toString(){return"JavaScript Expression Parser (JSEP) v"+cZ.version}static addUnaryOp(e){return cZ.max_unop_len=Math.max(e.length,cZ.max_unop_len),cZ.unary_ops[e]=1,cZ}static addBinaryOp(e,t,i){return cZ.max_binop_len=Math.max(e.length,cZ.max_binop_len),cZ.binary_ops[e]=t,i?cZ.right_associative.add(e):cZ.right_associative.delete(e),cZ}static addIdentifierChar(e){return cZ.additional_identifier_chars.add(e),cZ}static addLiteral(e,t){return cZ.literals[e]=t,cZ}static removeUnaryOp(e){return delete cZ.unary_ops[e],e.length===cZ.max_unop_len&&(cZ.max_unop_len=cZ.getMaxKeyLen(cZ.unary_ops)),cZ}static removeAllUnaryOps(){return cZ.unary_ops={},cZ.max_unop_len=0,cZ}static removeIdentifierChar(e){return cZ.additional_identifier_chars.delete(e),cZ}static removeBinaryOp(e){return delete cZ.binary_ops[e],e.length===cZ.max_binop_len&&(cZ.max_binop_len=cZ.getMaxKeyLen(cZ.binary_ops)),cZ.right_associative.delete(e),cZ}static removeAllBinaryOps(){return cZ.binary_ops={},cZ.max_binop_len=0,cZ}static removeLiteral(e){return delete cZ.literals[e],cZ}static removeAllLiterals(){return cZ.literals={},cZ}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(e){return new cZ(e).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map((e=>e.length)))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(e){return cZ.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!cZ.binary_ops[String.fromCharCode(e)]||cZ.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return cZ.isIdentifierStart(e)||cZ.isDecimalDigit(e)}throwError(e){let t=new Error(e+" at character "+this.index);throw t.index=this.index,t.description=e,t}runHook(e,t){if(cZ.hooks[e]){let i={context:this,node:t};return cZ.hooks.run(e,i),i.node}return t}searchHook(e){if(cZ.hooks[e]){let t={context:this};return cZ.hooks[e].find((function(e){return e.call(t.context,t),t.node})),t.node}}gobbleSpaces(){let e=this.code;for(;e===cZ.SPACE_CODE||e===cZ.TAB_CODE||e===cZ.LF_CODE||e===cZ.CR_CODE;)e=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let e=this.gobbleExpressions(),t=1===e.length?e[0]:{type:cZ.COMPOUND,body:e};return this.runHook("after-all",t)}gobbleExpressions(e){let t,i,n=[];for(;this.index<this.expr.length;)if(t=this.code,t===cZ.SEMCOL_CODE||t===cZ.COMMA_CODE)this.index++;else if(i=this.gobbleExpression())n.push(i);else if(this.index<this.expr.length){if(t===e)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){let e=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",e)}gobbleBinaryOp(){this.gobbleSpaces();let e=this.expr.substr(this.index,cZ.max_binop_len),t=e.length;for(;t>0;){if(cZ.binary_ops.hasOwnProperty(e)&&(!cZ.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!cZ.isIdentifierPart(this.expr.charCodeAt(this.index+e.length))))return this.index+=t,e;e=e.substr(0,--t)}return!1}gobbleBinaryExpression(){let e,t,i,n,r,a,s,o,l;if(a=this.gobbleToken(),!a||(t=this.gobbleBinaryOp(),!t))return a;for(r={value:t,prec:cZ.binaryPrecedence(t),right_a:cZ.right_associative.has(t)},s=this.gobbleToken(),s||this.throwError("Expected expression after "+t),n=[a,r,s];t=this.gobbleBinaryOp();){if(i=cZ.binaryPrecedence(t),0===i){this.index-=t.length;break}r={value:t,prec:i,right_a:cZ.right_associative.has(t)},l=t;let o=e=>r.right_a&&e.right_a?i>e.prec:i<=e.prec;for(;n.length>2&&o(n[n.length-2]);)s=n.pop(),t=n.pop().value,a=n.pop(),e={type:cZ.BINARY_EXP,operator:t,left:a,right:s},n.push(e);e=this.gobbleToken(),e||this.throwError("Expected expression after "+l),n.push(r,e)}for(o=n.length-1,e=n[o];o>1;)e={type:cZ.BINARY_EXP,operator:n[o-1].value,left:n[o-2],right:e},o-=2;return e}gobbleToken(){let e,t,i,n;if(this.gobbleSpaces(),n=this.searchHook("gobble-token"),n)return this.runHook("after-token",n);if(e=this.code,cZ.isDecimalDigit(e)||e===cZ.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===cZ.SQUOTE_CODE||e===cZ.DQUOTE_CODE)n=this.gobbleStringLiteral();else if(e===cZ.OBRACK_CODE)n=this.gobbleArray();else{for(t=this.expr.substr(this.index,cZ.max_unop_len),i=t.length;i>0;){if(cZ.unary_ops.hasOwnProperty(t)&&(!cZ.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!cZ.isIdentifierPart(this.expr.charCodeAt(this.index+t.length)))){this.index+=i;let e=this.gobbleToken();return e||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:cZ.UNARY_EXP,operator:t,argument:e,prefix:!0})}t=t.substr(0,--i)}cZ.isIdentifierStart(e)?(n=this.gobbleIdentifier(),cZ.literals.hasOwnProperty(n.name)?n={type:cZ.LITERAL,value:cZ.literals[n.name],raw:n.name}:n.name===cZ.this_str&&(n={type:cZ.THIS_EXP})):e===cZ.OPAREN_CODE&&(n=this.gobbleGroup())}return n?(n=this.gobbleTokenProperty(n),this.runHook("after-token",n)):this.runHook("after-token",!1)}gobbleTokenProperty(e){this.gobbleSpaces();let t=this.code;for(;t===cZ.PERIOD_CODE||t===cZ.OBRACK_CODE||t===cZ.OPAREN_CODE||t===cZ.QUMARK_CODE;){let i;if(t===cZ.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==cZ.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),t=this.code}this.index++,t===cZ.OBRACK_CODE?(e={type:cZ.MEMBER_EXP,computed:!0,object:e,property:this.gobbleExpression()},this.gobbleSpaces(),t=this.code,t!==cZ.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):t===cZ.OPAREN_CODE?e={type:cZ.CALL_EXP,arguments:this.gobbleArguments(cZ.CPAREN_CODE),callee:e}:(t===cZ.PERIOD_CODE||i)&&(i&&this.index--,this.gobbleSpaces(),e={type:cZ.MEMBER_EXP,computed:!1,object:e,property:this.gobbleIdentifier()}),i&&(e.optional=!0),this.gobbleSpaces(),t=this.code}return e}gobbleNumericLiteral(){let e,t,i="";for(;cZ.isDecimalDigit(this.code);)i+=this.expr.charAt(this.index++);if(this.code===cZ.PERIOD_CODE)for(i+=this.expr.charAt(this.index++);cZ.isDecimalDigit(this.code);)i+=this.expr.charAt(this.index++);if(e=this.char,"e"===e||"E"===e){for(i+=this.expr.charAt(this.index++),e=this.char,("+"===e||"-"===e)&&(i+=this.expr.charAt(this.index++));cZ.isDecimalDigit(this.code);)i+=this.expr.charAt(this.index++);cZ.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+i+this.char+")")}return t=this.code,cZ.isIdentifierStart(t)?this.throwError("Variable names cannot start with a number ("+i+this.char+")"):(t===cZ.PERIOD_CODE||1===i.length&&i.charCodeAt(0)===cZ.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:cZ.LITERAL,value:parseFloat(i),raw:i}}gobbleStringLiteral(){let e="",t=this.index,i=this.expr.charAt(this.index++),n=!1;for(;this.index<this.expr.length;){let t=this.expr.charAt(this.index++);if(t===i){n=!0;break}if("\\"===t)switch(t=this.expr.charAt(this.index++),t){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=t}else e+=t}return n||this.throwError('Unclosed quote after "'+e+'"'),{type:cZ.LITERAL,value:e,raw:this.expr.substring(t,this.index)}}gobbleIdentifier(){let e=this.code,t=this.index;for(cZ.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(e=this.code,cZ.isIdentifierPart(e));)this.index++;return{type:cZ.IDENTIFIER,name:this.expr.slice(t,this.index)}}gobbleArguments(e){let t=[],i=!1,n=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let r=this.code;if(r===e){i=!0,this.index++,e===cZ.CPAREN_CODE&&n&&n>=t.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}if(r===cZ.COMMA_CODE){if(this.index++,n++,n!==t.length)if(e===cZ.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===cZ.CBRACK_CODE)for(let e=t.length;e<n;e++)t.push(null)}else if(t.length!==n&&0!==n)this.throwError("Expected comma");else{let e=this.gobbleExpression();(!e||e.type===cZ.COMPOUND)&&this.throwError("Expected comma"),t.push(e)}}return i||this.throwError("Expected "+String.fromCharCode(e)),t}gobbleGroup(){this.index++;let e=this.gobbleExpressions(cZ.CPAREN_CODE);if(this.code===cZ.CPAREN_CODE)return this.index++,1===e.length?e[0]:!!e.length&&{type:cZ.SEQUENCE_EXP,expressions:e};this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:cZ.ARRAY_EXP,elements:this.gobbleArguments(cZ.CBRACK_CODE)}}},hZ=new class{add(e,t,i){if("string"!=typeof arguments[0])for(let n in arguments[0])this.add(n,arguments[0][n],arguments[1]);else(Array.isArray(e)?e:[e]).forEach((function(e){this[e]=this[e]||[],t&&this[e][i?"unshift":"push"](t)}),this)}run(e,t){this[e]=this[e]||[],this[e].forEach((function(e){e.call(t&&t.context?t.context:t,t)}))}};Object.assign(cZ,{hooks:hZ,plugins:new class{constructor(e){this.jsep=e,this.registered={}}register(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];t.forEach((e=>{if("object"!=typeof e||!e.name||!e.init)throw new Error("Invalid JSEP plugin format");this.registered[e.name]||(e.init(this.jsep),this.registered[e.name]=e)}))}}(cZ),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},right_associative:new Set,additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),cZ.max_unop_len=cZ.getMaxKeyLen(cZ.unary_ops),cZ.max_binop_len=cZ.getMaxKeyLen(cZ.binary_ops);var uZ=e=>new cZ(e).parse();Object.getOwnPropertyNames(cZ).forEach((e=>{void 0===uZ[e]&&"prototype"!==e&&(uZ[e]=cZ[e])})),uZ.Jsep=cZ;var dZ={name:"ternary",init(e){e.hooks.add("after-expression",(function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let i=t.node,n=this.gobbleExpression();if(n||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let r=this.gobbleExpression();if(r||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:i,consequent:n,alternate:r},i.operator&&e.binary_ops[i.operator]<=.9){let n=i;for(;n.right.operator&&e.binary_ops[n.right.operator]<=.9;)n=n.right;t.node.test=n.right,n.right=t.node,t.node=i}}else this.throwError("Expected :")}}))}};uZ.plugins.register(dZ);var pZ=["+","-","*","/","(",")","==","!=",">","<",">=","<=","and","or","!","%","^",","],fZ=["0","1","2","3","4","5","6","7","8","9","."],mZ=["sin","cos","tan","asin","acos","atan","atan2","sqrt","abs","log","exp","floor","ceil","round","min","max","random"];function gZ(e){return"string"==typeof e&&(!isNaN(e)&&!isNaN(parseFloat(e)))}function vZ(e,t){let i,n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number",a="";for(let s=0;s<e.length;s++){let i=e[s];if("id"in i){let n=e[s-1];if(s>0&&"id"in n)return void console.error("Two variables in a row",e);let o=t.getVariable(i.id),l=aW.getDisplayedValue(o);"number"===r&&aW.isTextValue(o)&&Array.isArray(o.textValue)&&1===o.textValue.length?l=parseFloat(l).toString():"boolean"===r&&aW.isBoolean(o)?l=o?"true":"false":"boolean"===r&&aW.isTextValue(o)&&!Array.isArray(o.textValue)&&(l='"'+l+'"'),a+=l}else"string"!==r?"and"!==i.name?"or"!==i.name?"True"!==i.name?"False"!==i.name?"boolean"!==r||gZ(i.name)||fZ.includes(i.name)||pZ.includes(i.name)||mZ.includes(i.name.replace(/\($/g,""))?a+=i.name:a+='"'+i.name+'"':a+="false":a+="true":a+="||":a+="&&":('"'!==i.name&&"+"!==i.name&&(a+=i.name),"+"===i.name&&"\\"===a[a.length-1]&&(a=a.slice(0,-1)+i.name))}if("string"===r)return a;if(0===e.length){if("number"===r)return 0;if("boolean"===r)return!1}try{i=uZ(a)}catch(l){return void console.error(a,l)}try{n=yZ(i)}catch(l){console.error(a,i,l)}return n}function yZ(e){switch(e.type){case"BinaryExpression":switch(e.operator){case"==":return Number(yZ(e.left)===yZ(e.right));case"!=":return Number(yZ(e.left)!==yZ(e.right));case">":return Number(yZ(e.left)>yZ(e.right));case">=":return Number(yZ(e.left)>=yZ(e.right));case"<":return Number(yZ(e.left)<yZ(e.right));case"<=":return Number(yZ(e.left)<=yZ(e.right));case"+":return yZ(e.left)+yZ(e.right);case"-":return yZ(e.left)-yZ(e.right);case"*":return yZ(e.left)*yZ(e.right);case"/":return yZ(e.left)/yZ(e.right);case"%":return yZ(e.left)%yZ(e.right);case"&&":return yZ(e.left)&&yZ(e.right);case"||":return yZ(e.left)||yZ(e.right);case"^":return Math.pow(yZ(e.left),yZ(e.right));default:throw new Error("Unknown operator: "+e.operator)}case"UnaryExpression":switch(e.operator){case"-":return-yZ(e.argument);case"!":return Number(!yZ(e.argument));default:throw new Error("Unknown operator: "+e.operator)}case"Identifier":throw new Error("Unknown identifier: "+e.name);case"Literal":return e.value;case"CallExpression":if("Identifier"===e.callee.type){if("random"===e.callee.name){let t=0,i=1;if(e.arguments.length>=1)try{t=yZ(e.arguments[0])}catch(a){console.warn(a)}if(e.arguments.length>=2)try{i=yZ(e.arguments[1])}catch(a){console.warn(a)}return t=Math.min(i,t),i=Math.max(i,t),t+Math.random()*(i-t)}return Math[e.callee.name].apply(null,e.arguments.map(yZ))}throw new Error("Unknown node");default:throw new Error("Unknown node type: "+e.type)}}uZ.addBinaryOp("^",11,!0);var bZ=new mM,xZ=new mM;var wZ=class extends fT{constructor(e){super(),this.type="PathExtrusionGeometry",this.inputs=e,this.build()}_isGeometryClosed(){return this.inputs.path.isClosed&&1===this.inputs.parameters.extrusion.depth}_isOpenEnded(){let e=this.inputs.parameters.extrusion;return!(this.inputs.path.isClosed&&1===e.depth)||!function(e,t){let i=2*Math.PI;return(e%i+i)%i===(t%i+i)%i}(e.twist,0)||e.startScale!==e.endScale}build(){let e=this._extractPathPoints();if(e.length<2)return;let t=this._computeBasisMatrices(e),{depth:i,offset:n}=this.inputs.parameters.extrusion;i=Math.max(0,Math.min(i,1)),n=Math.max(0,Math.min(n,1));let r=this.inputs.path.isClosed?e.length:e.length-1,a=Math.floor(n*r),s=this.inputs.path.isClosed?Math.ceil((i+n)*r):Math.ceil(Math.min(1,i+n)*r),o=Math.min(Math.max(2,s-a+1),r+2),l=[],c=[];for(let I=0;I<o;I++){let i=this.inputs.path.isClosed?(I+a)%e.length:Math.min(I+a,e.length-1);l.push(e[i].clone()),c.push(t[i].clone())}let h=(e,t,i)=>{l[e]=l[e].clone().lerp(l[t],i),c[e]=function(e,t,i){let n=[new FA,new FA,new FA],r=[new FA,new FA,new FA];return e.extractBasis(n[0],n[1],n[2]),t.extractBasis(r[0],r[1],r[2]),n.forEach(((e,t)=>{let n=r[t],a=cA.lerp(e.length(),n.length(),i);e.lerp(n,i).setLength(a)})),(new mM).makeBasis(n[0],n[1],n[2])}(c[e],c[t],i)},u=0,d=n*r%1;(!this.inputs.path.isClosed||i<=1)&&(d||0===n)&&(u=d,h(0,1,u));let p=0,f=(n+i)*r%1;if((this.inputs.path.isClosed&&i<=1||!this.inputs.path.isClosed&&n+i<1)&&f&&(p=f,h(l.length-1,l.length-2,1-p)),0===i){let e=l.length-1;l[e].copy(l[0]),c[e].copy(c[0])}this._applyPathModifiers(c,u,p);let{bevel:m,bevelSides:g}=this.inputs.parameters.extrusion,v=m>0?this.inputs.parameters.extrusion.capType:"flat",y=5;"Custom"===this.inputs.parameters.extrusion.shape.type&&(y="low"===this.inputs.parameters.extrusion.shape.shapeQuality?5:12);let b,{regions:x,infos:w,vertices:_}=this._computeShapePoints(y),S=0;"round"===v&&(b=new xQ(this.inputs.shapeData,2*m,m,y,g,void 0,!0),S=b.getAttribute("position").count);let E=0,C=0;w.sort(((e,t)=>e.start-t.start)),w.forEach((e=>{e.verticesStart=E,e.verticesCount=e.continuous.reduce(((e,t,i)=>e+(0!==i&&t?1:2)),0),C+=e.verticesCount,E=C}));let A,M=C*o,T=0;if(this._isOpenEnded()&&"flat"===v){try{A=dQ({windingRule:NY.ODD,elementType:FY.POLYGONS,polySize:3,vertexSize:2,strict:!0,contours:x})}catch{A=yQ}T=A.vertexCount}let P=M+2*T+2*S,D=M+2*T,k={positions:new Float32Array(3*P),normals:new Float32Array(3*P),uvs:new Float32Array(2*P)},O=[];if(w.forEach((e=>{this._extrudeRegion(e,_,c,l,k,O,this._isGeometryClosed()&&!this._isOpenEnded())})),A&&(this._closeEnd(A,M,O,k,c[0],l[0],!1),this._closeEnd(A,M+T,O,k,c[c.length-1],l[l.length-1],!0)),b){k.positions.set(b.getAttribute("position").array,3*D),k.normals.set(b.getAttribute("normal").array,3*D),k.uvs.set(b.getAttribute("uv").array,2*D);let e=O.length;O.push(...b.getIndex().array.map((e=>e+D))),D+=S,k.positions.set(b.getAttribute("position").array,3*D),k.normals.set(b.getAttribute("normal").array,3*D),k.uvs.set(b.getAttribute("uv").array,2*D);let t=O.length;O.push(...b.getIndex().array.map((e=>e+D))),this.setAttribute("position",new nT(k.positions,3)),this.setAttribute("normal",new nT(k.normals,3)),this.setAttribute("uv",new nT(k.uvs,2)),this.setIndex(O);let i=bZ;i.copy(c[c.length-1]).setPosition(l[l.length-1]),this.applyMatrix4OnRange(i,D,P),i.copy(c[0]).setPosition(l[0]).multiply(xZ.makeScale(1,1,-1)),this.applyMatrix4OnRange(i,D-S,D),this.reverseIndicesOnRange(e,t)}else this.setAttribute("position",new nT(k.positions,3)),this.setAttribute("normal",new nT(k.normals,3)),this.setAttribute("uv",new nT(k.uvs,2)),this.setIndex(O)}_extractPathPoints(){let e=ZX(this.inputs.path).getPoints(this.inputs.path.subdivisions);if(e.length<2)return[];let t=[e[0]];return e.forEach((e=>{t[t.length-1].distanceToSquared(e)>.001&&t.push(e)})),this.inputs.path.isClosed&&t[t.length-1].distanceTo(t[0])<.001&&t.pop(),t}_computeBasisMatrices(e){let t=[],i=e.length,n=this.inputs.path.isClosed,r=new FA,a=new FA,s=new FA,o=new FA,l=new FA(0,1,0);for(let f=0;f<i;f++){let c,h,u=e[f];c=0===f?n?e[e.length-2]:u.clone().multiplyScalar(2).sub(e[1]):e[f-1],h=f===i-1?n?e[1]:u.clone().multiplyScalar(2).sub(e[f-1]):e[f+1];let d=u.clone().sub(c).normalize(),p=h.clone().sub(u).normalize(),m=d.clone().add(p).normalize();s.copy(m),0===f&&(m.equals(l)||m.clone().negate().equals(l))&&l.set(0,0,1);let g=l.clone().cross(m).normalize(),v=m.clone().cross(g).normalize();l.copy(v),o.copy(g),0===f&&(r.copy(v),a.copy(m));let y=(new mM).makeBasis(g,v,m);t.push(y)}let c=n?a:s,h=n?r:new FA(0,1,0),u=c.clone().cross(o).normalize(),d=Math.acos(h.dot(u));if(isNaN(d))return t;let p=h.clone().cross(u);c.dot(p)>0&&(d*=-1);for(let f=1;f<t.length;f++){let e=(new mM).makeRotationZ(d*f/t.length);t[f].multiply(e)}return t}_applyPathModifiers(e,t,i){let n=e.length,{angle:r,twist:a,startScale:s,endScale:o}=this.inputs.parameters.extrusion,l=new mM,c=new mM;return e.forEach(((e,h)=>{let u=0===h?0:h===n-1?1:(h-t)/(n-(0===i?0:1)-(t+(1-i)));l.makeRotationZ(cA.lerp(r,r+a,u)*cA.DEG2RAD);let d=cA.lerp(s,o,u);c.makeScale(d,d,d),e.multiply(l).multiply(c)})),e}_computeShapePoints(){let e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NY.ODD,r=this.inputs.shapeData,a=r.extractShapePointsToFlatArray([],i),s=r.shapeHoles.map((e=>{let t=e.extractShapePointsToFlatArray([],i),n=[];for(let i=t.length-1;i>=1;i-=2){let e=t[i-1],r=t[i-0];n.push(e,r)}return n}));try{e=dQ({windingRule:n,elementType:FY.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[a]})}catch{e=gQ}try{t=dQ({windingRule:NY.ODD,elementType:FY.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[...s]})}catch{t=vQ}if(!e)throw new Error("error generating geometry");let o=e.elementCount;if(t){e.elementCount+=t.elementCount;for(let i=0;i<t.elements.length;i++){let n=t.elements[i],r=i%2===0?e.vertexCount:0;e.elements.push(n+r)}for(let i=0;i<t.vertexIndices.length;i++){let n=t.vertexIndices[i],r=e.vertexCount;e.vertexIndices.push(n+r)}for(let i=0;i<t.vertices.length;i++){let n=t.vertices[i];e.vertices.push(n)}}let l=1/0,c=-1/0,h=1/0,u=-1/0;for(let p=0,f=e.vertexCount;p<f;p++){let t=2*p,i=e.vertices[t+0],n=e.vertices[t+1];i<l&&(l=i),i>c&&(c=i),n<h&&(h=n),n>u&&(u=n)}let d=[];for(let p=e.elementCount-1;p>=0;p--){let t=p>=o,i=2*p,n=e.elements[i+0],a=e.elements[i+1],s=n+a,l={start:n,count:a,normals:[],isHole:t,continuous:[],verticesStart:0,verticesCount:0};d.push(l);let c=n,h=s-1,u=n+1,f=r.roundedCurves.length;do{let i=c-n,o=e.vertices[2*h+0],d=e.vertices[2*h+1],p=e.vertices[2*c+0],m=e.vertices[2*c+1],g=e.vertices[2*u+0],v=e.vertices[2*u+1],y=p-o,b=m-d,x=Math.sqrt(y*y+b*b);y/=x,b/=x;let w=p-g,_=m-v,S=Math.sqrt(w*w+_*_);w/=S,_/=S,l.normals[2*i+0]=-_,l.normals[2*i+1]=w;let E=e.vertexIndices[c];if(Array.isArray(E))l.continuous[i]=!1;else{let[e,t]=r.getCurveIndexFromVertexId(E-1,!0);if(t>0&&t<1)l.continuous[i]=!0;else{let n=1===t?e+1:e-1;n=(n+f)%f;let a=1===t?0:1,s=r.roundedCurves[e].getTangent(t),o=r.roundedCurves[n].getTangent(a);l.continuous[i]=s.dot(o)>.95}}t&&(l.normals[2*i+0]*=-1,l.normals[2*i+1]*=-1),[h,c,u]=[c,u,u+1],u>=s&&(u-=a)}while(u!==n+1)}return{regions:[a,...s],infos:d,vertices:e.vertices}}_insertVertex(e,t,i,n,r){let a=2*t,s=3*t;e.positions[s+0]=i.x,e.positions[s+1]=i.y,e.positions[s+2]=i.z,e.normals[s+0]=n.x,e.normals[s+1]=n.y,e.normals[s+2]=n.z,e.uvs[a+0]=r.x,e.uvs[a+1]=r.y}_extrudeRegion(e,t,i,n,r,a,s){let o=new FA,l=new FA,c=new FA,h=new FA,u=new hA;i.forEach(((a,s)=>{let d=n[s],p=e.verticesStart*i.length+e.verticesCount*s;for(let n=0;n<e.count;n++){let f=2*(e.start+n);if(o.set(t[f+0],t[f+1],0),c.copy(o).applyMatrix4(a).add(d),e.continuous[n])h.set(e.normals[2*n+0],e.normals[2*n+1],0);else{let i=0===n?2*(e.start+e.count-1):f-2;l.set(t[i+0],t[i+1],0),h.copy(o).sub(l),h.set(-h.y,h.x,0),e.isHole||h.negate()}if(h.applyMatrix4(a).normalize(),u.set(0===n?1:n/e.count,s/(i.length-1)),this._insertVertex(r,p,c,h,u),p++,!e.continuous[n]||0===n){if(0===n)h.set(e.normals[2*n+0],e.normals[2*n+1],0),u.set(0,s/(i.length-1));else{let i=n===e.count-1?2*e.start:f+2;l.set(t[i+0],t[i+1],0),h.copy(l).sub(o),h.set(-h.y,h.x,0),e.isHole||h.negate()}h.applyMatrix4(a).normalize(),this._insertVertex(r,p,c,h,u),p++}}}));let d=i.length-1;for(let p=0;p<d;p++){let t=e.verticesStart*i.length+e.verticesCount*p,n=e.verticesStart*i.length+e.verticesCount*(p+1),r=0;for(let i=0;i<e.count;i++){(!e.continuous[i]||0===i)&&r++;let s=i===e.count-1?0:r+1,o=t+r,l=t+s,c=n+s,h=n+r;e.isHole?a.push(o,c,l,o,h,c):a.push(o,l,c,o,c,h),r++}}}_closeEnd(e,t,i,n,r,a,s){let o=e.vertexCount,l=new FA(0,0,s?-1:1).applyMatrix4(r),c=new FA,h=new hA;for(let d=0;d<o;d++){let i=2*d;c.set(e.vertices[i+0],e.vertices[i+1],0).applyMatrix4(r).add(a),this._insertVertex(n,t+d,c,l,h)}let u=e.elements;for(let d=0;d<e.elementCount;d++){let e=3*d,n=u[e+0]+t,r=u[e+(s?1:2)]+t,a=u[e+(s?2:1)]+t;i.push(n,r,a)}}applyMatrix4OnRange(e,t,i){let n,r,a,s,o=e.elements,l=(new uA).getNormalMatrix(e).elements,c=this.attributes.position,h=this.attributes.normal;if(!c||!h)return;let u=c.array,d=h.array,p=c.itemSize;for(let f=t*p,m=i*p;f<m;f+=p)n=u[f+0],r=u[f+1],a=u[f+2],s=1/(o[3]*n+o[7]*r+o[11]*a+o[15]),u[f+0]=(o[0]*n+o[4]*r+o[8]*a+o[12])*s,u[f+1]=(o[1]*n+o[5]*r+o[9]*a+o[13])*s,u[f+2]=(o[2]*n+o[6]*r+o[10]*a+o[14])*s,n=d[f+0],r=d[f+1],a=d[f+2],d[f+0]=l[0]*n+l[3]*r+l[6]*a,d[f+1]=l[1]*n+l[4]*r+l[7]*a,d[f+2]=l[2]*n+l[5]*r+l[8]*a;c.needsUpdate=!0,h.needsUpdate=!0}reverseIndicesOnRange(e,t){let i=this.index;if(i){for(let n=e;n<t;n+=3){let e=i.getX(n),t=i.getX(n+1),r=i.getX(n+2);i.setXYZ(n,r,t,e)}i.needsUpdate=!0}}};function _Z(){let e=new fT;return e.setAttribute("position",new nT(new Float32Array([]),3)),e.setIndex(new nT(new Uint16Array([]),1)),e}var SZ=_Z().attributes,EZ=class extends fT{constructor(e,t){super(),this.charWidths=[],this.charCoords=[],this.wrappedText=[],this.isLowResolution=!1,this.vectorShapes=[],Object.assign(this.attributes,SZ),this.userData={parameters:e,type:"TextGeometry"};let i=t.getFont(e.font);null!==i&&void 0!==i&&i.isLoaded?(this.font=i,this.update(e)):this.updateFont(e.font,t).then((()=>{this.update(e),null===t||void 0===t||t.requestRender()}))}async updateFont(e,t){let i=t.getFont(e);i&&(this.font=i,await i.loadingPromise)}update(e){let t=this.font;if(this.userData={parameters:e,type:"TextGeometry"},null===t||void 0===t||!t.isLoaded)return void console.warn("Cannot update text because its font is not loaded");let{width:i,height:n,depth:r,extrudeBevelSize:a,extrudeBevelSegments:s,text:o,textTransform:l}=e,c=aW.getDisplayedValue(o),h=function(e,t,i){let n=[""],r="";for(let a of i)r+=a," "===a||"\n"===a?(n[n.length-1]+=r,r="","\n"===a&&n.push("")):t.getTextWidth(n[n.length-1]+r,e)>e.width&&(n[n.length-1].length&&n.push(""),t.getTextWidth(n[n.length-1]+r,e)>e.width&&(1===r.length?(n[n.length-1]+=r,r=""):(n[n.length-1]+=r.slice(0,-1),r=r[r.length-1],n.push(""))));return n[n.length-1]+=r,n}(e,t,2===l?c.toUpperCase():3===l?c.toLowerCase():c),{shapes:u,charWidths:d,charCoords:p}=t.generateShapes(h,e),f=.5*("number"==typeof i?i:1),m=.5*("number"==typeof n?n:1),g=u.map((e=>(new qY).fromShape(e,!0)));this.vectorShapes=g;let v=g.map((e=>SQ.create({shape:e,parameters:{depth:r,extrudeBevelSegments:s,extrudeBevelSize:a,windingRule:r<=0?NY.NONZERO:NY.ODD,subdivisions:this.isLowResolution&&r>0?1:12}}))),y=v.length?$W(v):_Z();y.translate(-f,m,0),this.dispose(),this.wrappedText=h,this.charCoords=p,this.charWidths=d,this.deleteAttribute("extrudeNormal"),Object.entries(y.attributes).forEach((e=>{let[t,i]=e;this.setAttribute(t,i)})),this.setIndex(y.index),this.computeBoundingSphere()}clone(){let e=Ej(new fT,EZ.prototype);return e.copy(this),console.log("CloneGeometry",this,e),e}copy(e){return Object.entries(e.attributes).forEach((e=>{let[t,i]=e;this.setAttribute(t,i)})),this.setIndex(e.index),this.userData={parameters:{...e.userData.parameters},type:"TextGeometry"},this}async setText(e){this.font&&await this.font.loadingPromise,await this.update({...this.userData.parameters,text:e})}get text(){var e;return null!==(e=this.userData.parameters.text)&&void 0!==e?e:""}};var CZ,AZ,MZ=new Promise((e=>{CZ=e})),TZ=!1;function PZ(){if(!TZ)return AZ||(AZ=async function(){let e=__webpack_require__.e(917).then(__webpack_require__.bind(__webpack_require__,917)),[t,i]=await Promise.all([e,fetch("".concat("https://unpkg.com/@splinetool/modelling-wasm@1.0.53/build","/process.wasm")).then((e=>e.arrayBuffer()))]),n=t.default,r=await n({wasmBinary:i});CZ(r),TZ=!0}(),AZ)}var DZ=["font"];function kZ(e,t,i,n){var r;let a,s,o;"PathGeometry"===e.type?(s=JSON.parse(JSON.stringify(e)),o=[[],["extrusion"]]):(s={...e},o=[[]]);for(let c of o){let e=s;for(let t of c)e=e[t];for(a in e){let i=e[a];QG(i)&&!DZ.includes(a)&&(e[a]=t.getVariable(i,[n.uuid,"geometry",...c,a]),QG(e[a])&&(e[a]=1))}}let l,h={parameters:s,type:s.type};if("PathGeometry"===s.type)h.path=s.path;else if("VectorGeometry"===s.type){let e=qY.createFromState(s.shape,s.width,s.height);h.shape=e}else if("NonParametricGeometry"===s.type)s.data.groups&&null!==(r=s.data.groups)&&void 0!==r&&r.forEach((e=>{var t;return e.materialIndex=Math.max(null!==(t=e.materialIndex)&&void 0!==t?t:0,0)})),h.geometry=(new JI).parse(s);else{if("SubdivGeometry"===s.type){let t=new jZ(s,i);return t.data=e,t}if("TextGeometry"===s.type)return new EZ(s,t);if("UIGeometry"===s.type)return sZ.create({parameters:{width:s.width,height:s.height,cornerRadius:s.cornerRadius,cornerType:s.cornerType}})}try{l=hK(h)}catch(c){console.error(c)}if(!l){let e=qY.createFromState(mH.defaultData(),100,100);h.shape=e,l=hK(h)}return l}var OZ=new mM;function IZ(e,t,i,n){let r,a,s,o=e.position.array,l=e.normal.array,c=OZ.makeScale(t,i,n).invert().elements;for(var h=0,u=o.length;h<u;h+=3)o[h]*=t,o[h+1]*=i,o[h+2]*=n,r=l[h],a=l[h+1],s=l[h+2],l[h]=c[0]*r+c[4]*a+c[8]*s,l[h+1]=c[1]*r+c[5]*a+c[9]*s,l[h+2]=c[2]*r+c[6]*a+c[10]*s;e.position.needsUpdate=!0,e.normal.needsUpdate=!0}var RZ,LZ=new UA,BZ=new FA;MZ.then((e=>{RZ=e}));var zZ=new Float32Array([10,10,0,-10,10,0,-10,-10,0,10,-10,0]),NZ=new Uint32Array([0,1,2,3]),FZ=new Uint8Array([4]),jZ=class extends fT{constructor(e,t){super(),this.data=e,this.flatShading=t,this.subdivPointer=0,this.rebuild(),this.freeSubdivPointer()}mutateDirectlyScaleBaked(e,t){this.freeSubdivPointer();let i=this.data.scaleBaked,n=IG.div(t,i);this.subdividedGeometry&&IZ(this.subdividedGeometry.attributes,...n),this.originalGeometry&&IZ(this.originalGeometry.attributes,...n),this.data=e;let r=this.userData.parameters;this.userData.parameters={width:r.width*n[0],height:r.height*n[1],depth:r.depth*n[2]},this.originalGeometry.boundingSphere.center.multiply(BZ.fromArray(n));let a=BZ.set(r.width,r.height,r.depth).length();this.originalGeometry.boundingSphere.radius=a/2}ensureSubdivPointer(){return 0===this.subdivPointer&&this.rebuild(),this.subdivPointer}rebuild(){var e,t;let i,n,r;try{({originalGeometry:i,subdividedGeometry:n,subdivPointer:r}=jZ.build(this.data,void 0,!this.flatShading,void 0))}catch{i=new DT(100,100,100),r=0}this.subdivPointer=r,this.originalGeometry=i,this.subdividedGeometry=null!==(e=n)&&void 0!==e?e:void 0;let a=null!==(t=this.subdividedGeometry)&&void 0!==t?t:this.originalGeometry;Object.assign(this,a),this.calcBoundingBox()}freeSubdivPointer(){this.subdivPointer&&(jZ.freeSubdivPointer(this.subdivPointer),this.subdivPointer=0)}dispose(){super.dispose(),this.freeSubdivPointer()}calcBoundingBox(){let e=this.originalGeometry;null===e.boundingSphere&&(e.boundingSphere=new sM,this.subdividedGeometry&&(this.subdividedGeometry.boundingSphere=e.boundingSphere));let t=e.attributes.position,i=e.boundingSphere.center;LZ.setFromBufferAttribute(t),LZ.getCenter(i),e.boundingSphere.radius=i.distanceTo(LZ.max),isNaN(e.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this),LZ.getSize(BZ);let n={width:BZ.x,height:BZ.y,depth:BZ.z};return this.userData.parameters=n,n}static build(e,t,i,n){var r;let a,s,o,l=null!==(r=null===e||void 0===e?void 0:e.phongAngle)&&void 0!==r?r:35;!1===i&&(l=-1),t&&(RZ.free_bvh(t),RZ.free_subdivision_surface(t));try{a=jZ.allocate(e,n)}catch(d){console.error(d,e),a=jZ.allocate({positionWASM:zZ,indexWASM:NZ,verticesPerFaceWASM:FZ},n)}if(RZ.set_destination_refinement_level(a,0),s=jZ.buildLevel(a,!0,l),e.subdivisions>0)try{RZ.set_destination_refinement_level(a,e.subdivisions),o=jZ.buildLevel(a,!1,l)}catch{try{RZ.set_destination_refinement_level(a,e.subdivisions-1),o=jZ.buildLevel(a,!1,l)}catch{o=null}}else o=null;return{subdivPointer:a,originalGeometry:s,subdividedGeometry:o}}static primitiveToQuads(e,t,i){e.widthSegments>16&&(e.widthSegments=16),e.heightSegments>16&&(e.heightSegments=16),e.depthSegments>16&&(e.depthSegments=16),e.radialSegments>16&&(e.radialSegments=16),"DodecahedronGeometry"===e.type&&(e.detail=0);let n,r,a,s,o,l,c=void 0!==e.shape||void 0!==e.path?t.geometry:kZ(e,i,!1);if(n="TorusGeometry"===e.type&&e.arc===2*Math.PI?c.getClosedTorusIndicesForBooleanOrSubdiv():c.getIndex(),({positions:r,triIndices:o}=UZ(c.getAttribute("position"),n)),"CylinderGeometry"===e.type&&0===e.cornerRadius&&0===e.hollow&&!1===e.openEnded){let t=e.radialSegments*e.heightSegments*3*2;l=[t,t+3*e.radialSegments]}return({indices:a,verticesPerFace:s}=XZ(r,o,c,l)),{positions:r,indices:a,verticesPerFace:s}}static allocate(e,t){var i;let n,r,a,s=[],o=[];e.positionWASM&&e.positionWASM.length>0?(n=e.positionWASM,r=e.indexWASM,a=e.verticesPerFaceWASM):(n=zZ,r=NZ,a=FZ);let l,c=n.length,h=r.length,u=a.length,d=n.length+s.length+o.length,p=r.length+a.length,f=d*Float32Array.BYTES_PER_ELEMENT+p*Uint32Array.BYTES_PER_ELEMENT,m=d*Float32Array.BYTES_PER_ELEMENT,g=(Uint32Array.BYTES_PER_ELEMENT,RZ._malloc(f)),v=new Float32Array(RZ.HEAPF32.buffer,g,d),y=new Uint32Array(RZ.HEAPU32.buffer,g+m,p);v.set(n,0),v.set(s,n.length),v.set(o,n.length+s.length),y.set(r,0),y.set(a,r.length),null!==e&&void 0!==e&&null!==(i=e.scaleBaked)&&void 0!==i&&i.some((e=>1!==e))&&(l=(new mM).makeScale(...e.scaleBaked)),t&&(l?l.premultiply(t):l=t);let b=l?RZ.alloc_subdivision_surface2(g,c,g+m,h,g+m+r.length*Uint32Array.BYTES_PER_ELEMENT,u,l.elements):RZ.alloc_subdivision_surface(g,c,g+m,h,g+m+r.length*Uint32Array.BYTES_PER_ELEMENT,u);return RZ._free(g),b}static buildLevel(e,t,i,n,r){let a=r?RZ.get_mesh_data2(e,t?RZ.Level.CONTROL:RZ.Level.REFINED,i,r.elements):RZ.get_mesh_data(e,t?RZ.Level.CONTROL:RZ.Level.REFINED,i),s=RZ.HEAPU32.subarray(a>>2,8+(a>>2)),o=s.subarray(4,8),l=0,c=RZ.HEAPU32[s[l]>>2],h=RZ.HEAPF32.subarray(c>>2,(c>>2)+o[l]);l++;let u=RZ.HEAPU32[s[l]>>2],d=RZ.HEAPF32.subarray(u>>2,(u>>2)+o[l]);l++;let p=RZ.HEAPU32[s[l]>>2],f=RZ.HEAPU32.subarray(p>>2,(p>>2)+o[l]);l++;let m=RZ.HEAPU32[s[l]>>2],g=RZ.HEAPU32.subarray(m>>2,(m>>2)+o[l]);if(l++,void 0===n){let e=new fT;if(e.setIndex(new aT(g,1)),e.setAttribute("position",new sT(h,3)),e.setAttribute("normal",new sT(d,3)),t){e.setAttribute("faceMap",new aT(f,1));let t=new Float32Array(d.length/3*4).fill(0);e.setAttribute("color",new nT(t,4))}return RZ.free_mesh_data(a),e.userData.type="SubdivGeometry",e}n.getAttribute("position").copyArray(h),n.getAttribute("normal").copyArray(d),n.attributes.position.needsUpdate=!0,n.attributes.normal.needsUpdate=!0,RZ.free_mesh_data(a)}static freeSubdivPointer(e){RZ.free_bvh(e),RZ.free_subdivision_surface(e)}static buildControlCageWireframe(e,t,i){let n=RZ.get_wireframe_data_for_base_level(e),r=RZ.HEAPU32.subarray(n>>2,4+(n>>2)),a=r.subarray(2,4),s=0,o=RZ.HEAPU32[r[s]>>2],l=RZ.HEAPF32.subarray(o>>2,(o>>2)+a[s]);s++;let c=RZ.HEAPU32[r[s]>>2],h=RZ.HEAPU32.subarray(c>>2,(c>>2)+a[s]);if(void 0===t){let e=new fT;e.setAttribute("position",new sT(l,3));let t=new Float32Array(l.length);for(let n=0,r=l.length;n<r;)t[n++]=i.r,t[n++]=i.g,t[n++]=i.b;return e.setAttribute("color",new nT(t,3)),e.setIndex(new aT(h,1)),RZ.free_wireframe_data_for_base_level(n),e}t.getAttribute("position").copyArray(l),t.attributes.position.needsUpdate=!0,RZ.free_wireframe_data_for_base_level(n)}static updateCollabMesh(e,t,i){let n=0===t;n||RZ.set_destination_refinement_level(e,t);let r=i?RZ.get_topological_data2(e,n?RZ.Level.CONTROL:RZ.Level.REFINED,i.elements):RZ.get_topological_data(e,n?RZ.Level.CONTROL:RZ.Level.REFINED),a=RZ.HEAPU32.subarray(r>>2,6+(r>>2)),s=a.subarray(3,6),o=0,l=RZ.HEAPU32[a[o]>>2],c=new Float32Array(RZ.HEAPF32.subarray(l>>2,(l>>2)+s[o]));o++;let h=RZ.HEAPU32[a[o]>>2],u=new Uint32Array(RZ.HEAPU32.subarray(h>>2,(h>>2)+s[o]));o++;let d=RZ.HEAPU32[a[o]>>2],p=new Uint8Array(RZ.HEAPU32.subarray(d>>2,(d>>2)+s[o]));return RZ.free_topological_data(r),{positions:c,indices:u,verticesPerFace:p}}},VZ=["getX","getY","getZ"];function UZ(e,t){let i={},n=t?t.count:e.count,r=0,a=[],s=[];for(let l=0;l<n;l++){let n=t?t.getX(l):l,o="";for(let t=0;t<3;t++)o+="".concat(~~(1e4*e[VZ[t]](n)),",");if(o in i)a.push(i[o]);else{for(let t=0;t<3;t++)s.push(e[VZ[t]](n));i[o]=r,a.push(r),r++}}let o=[];for(let l=0;l<a.length;l+=3)a[l]===a[l+1]||a[l]===a[l+2]||a[l+1]===a[l+2]||o.push(a[l],a[l+1],a[l+2]);return{positions:s,triIndices:o}}var GZ=new FA,HZ=new FA,WZ=new FA,qZ=new FA;function XZ(e,t,i,n){let r=[],a=[];if(void 0!==i.userData.shape&&0===i.userData.parameters.depth&&0===i.userData.shape.shapeHoles.length){let t=i.userData.shape.extractShapePointsToFlatArray([]),n=i.userData.parameters.spikes;if("EllipseGeometry"===i.userData.type&&n<=24&&n%4===0&&i.userData.parameters.angle>=360){let e=t.length/2/n;t=t.filter(((t,i)=>Math.floor(i/2)%e===0))}let s=0;for(let e=0;e<t.length;e+=2)s+=(t[e]-t[(0===e?t.length:e)-2])*(t[e+1]+t[(0===e?t.length:e)-1]);e.length=0;let o=0;if(s<0)for(let i=0;i<t.length;i+=2)e.push(t[i],t[i+1],0),r.push(o++);else for(let i=t.length-2;i>=0;i-=2)e.push(t[i],t[i+1],0),r.push(o++);return a.push(o),{indices:r,verticesPerFace:a}}let s=new Float32Array([i.userData.parameters.depth])[0],o=0;for(;o<t.length;){if(i.useNgonForTopBottomFaceDuringBake){let i=0;if((e[3*t[o]+2]===s||0===e[3*t[o]+2])&&i++,(e[3*t[o+1]+2]===s||0===e[3*t[o+1]+2])&&i++,(e[3*t[o+2]+2]===s||0===e[3*t[o+2]+2])&&i++,3===i)break}if(t[o+1]===t[o+3]&&t[o+2]===t[o+5]||t[o+0]===t[o+3]&&t[o+2]===t[o+4]){GZ.set(e[3*t[o]],e[3*t[o]+1],e[3*t[o]+2]),HZ.set(e[3*t[o+1]],e[3*t[o+1]+1],e[3*t[o+1]+2]),WZ.set(e[3*t[o+4]],e[3*t[o+4]+1],e[3*t[o+4]+2]),qZ.set(e[3*t[o+5]],e[3*t[o+5]+1],e[3*t[o+5]+2]),HZ.sub(GZ).normalize(),WZ.sub(GZ).normalize(),qZ.sub(GZ).normalize();let i=HZ.cross(WZ).dot(qZ);Math.abs(i)>.005||n&&n.some(((e,t)=>t%2!==1&&(o>=n[t]&&o<n[t+1])))?(r.push(t[o],t[o+1],t[o+2]),a.push(3),o+=3):(r.push(t[o],t[o+1],t[o+4],t[o+5]),a.push(4),o+=6)}else r.push(t[o],t[o+1],t[o+2]),a.push(3),o+=3}if(i.useNgonForTopBottomFaceDuringBake){let t=[],n=[],o=0;for(let i=0,r=0;i<e.length;i+=3,r++)0===e[i+2]&&(t.push(r),o++),e[i+2]===s&&n.push(r);if(0===i.userData.parameters.extrudeBevelSize){let e=n[0];n[0]=n[1],n[1]=e}t.reverse(),r.push(...t,...n),a.push(o,o)}return{indices:r,verticesPerFace:a}}var YZ={};((e,t)=>{for(var i in t)q_(e,i,{get:t[i],enumerable:!0})})(YZ,{calcBoolean:()=>rK,calcBooleanTopological:()=>nK,freeMeshSet:()=>lK,getMeshSet:()=>aK,hasOpenEdges:()=>sK,transformMeshSet:()=>oK});var QZ,ZZ,KZ,JZ,$Z=new Promise((e=>{QZ=e}));function eK(){if(ZZ)return ZZ;return ZZ=async function(){let e=__webpack_require__.e(516).then(__webpack_require__.bind(__webpack_require__,516)),[t,i]=await Promise.all([e,fetch("".concat("https://unpkg.com/@splinetool/boolean-wasm@1.0.53/build","/boolean.wasm")).then((e=>e.arrayBuffer()))]),n=t.default,r=await n({wasmBinary:i});QZ(r)}(),ZZ}function tK(e){let t=e.length,i=t*Uint32Array.BYTES_PER_ELEMENT,n=t*Float32Array.BYTES_PER_ELEMENT,r=Number.isInteger(e[0])?i:n,a=KZ._malloc(r);return(Number.isInteger(e[0])?new Uint32Array(KZ.HEAPU32.buffer,a,t):new Float32Array(KZ.HEAPF32.buffer,a,t)).set(e,0),a}function iK(e){switch(e){case 0:return KZ.OP.UNION;case 1:return KZ.OP.INTERSECTION;case 2:return KZ.OP.A_MINUS_B;case 3:return KZ.OP.B_MINUS_A;case 4:return KZ.OP.SYMMETRIC_DIFFERENCE;case 5:return KZ.OP.ALL;default:throw new Error("Unknown boolean operation "+e)}}function nK(e,t){void 0===JZ&&(JZ=KZ.init_csg());let i=tK(e),n=KZ.csg_calc_topological(JZ,i,e.length,iK(t));KZ._free(i);let r=KZ.HEAPU32.subarray(n>>2,6+(n>>2)),a=r.subarray(3,6),s=0,o=KZ.HEAPU32[r[s]>>2],l=new Float32Array(KZ.HEAPF32.subarray(o>>2,(o>>2)+a[s]));s++;let c=KZ.HEAPU32[r[s]>>2],h=new Uint32Array(KZ.HEAPU32.subarray(c>>2,(c>>2)+a[s]));s++;let u=KZ.HEAPU32[r[s]>>2],d=new Uint8Array(KZ.HEAPU32.subarray(u>>2,(u>>2)+a[s]));return KZ.free_mesh_data(n),{positions:l,indices:h,verticesPerFace:d}}function rK(e,t,i,n){void 0===JZ&&(JZ=KZ.init_csg());let r=tK(e),a=KZ.csg_calc(JZ,r,e.length,n,iK(t));KZ._free(r);let s=KZ.HEAPU32.subarray(a>>2,5+(a>>2)),o=s.subarray(2,5),l=0,c=KZ.HEAPU32[s[l]>>2],h=KZ.HEAPF32.subarray(c>>2,(c>>2)+o[l]);l++;let u=KZ.HEAPU32[s[l]>>2],d=KZ.HEAPF32.subarray(u>>2,(u>>2)+o[l]);l++;let p=o[l];i.setAttribute("position",new sT(h,3)),i.setAttribute("normal",new sT(d,3));let f=KZ.HEAPF32.subarray(5+(a>>2),5+(a>>2)+6);return null===i.boundingSphere&&(i.boundingSphere=new sM),i.boundingSphere.center.set(f[0],f[1],f[2]),i.boundingSphere.radius=(f[3]**2+f[4]**2+f[5]**2)**.5,i.userData.parameters={width:2*f[3],height:2*f[4],depth:2*f[5]},KZ.free_mesh_data(a),p}function aK(e,t,i){if(void 0===KZ)return-1;let n,r,a;if(t&&void 0!==e.userData.positions){let t=e.userData;a=t.verticesPerFace.length,n=t.positions,r=Array(t.verticesPerFace.reduce(((e,t)=>e+t),0)+a);for(let e=0,i=0,n=0;e<t.verticesPerFace.length;e++){r[n++]=t.verticesPerFace[e];for(let a=0;a<t.verticesPerFace[e];a++)r[n++]=t.indices[i++]}}else({positions:n,faceIndices:r,nFaces:a}=function(e,t,i){let n,r;r="TorusGeometry"===e.userData.parameters.type&&e.userData.parameters.arc===2*Math.PI?e.getClosedTorusIndicesForBooleanOrSubdiv():e.getIndex();let a,{positions:s,triIndices:o}=UZ(e.getAttribute("position"),r);if(t&&i){let{indices:t,verticesPerFace:i}=XZ(s,o,e);a=i.length,n=[];for(let e=0,r=0;e<a;e++){n.push(i[e]);for(let a=0;a<i[e];a++)n.push(t[r++])}}else{let e=o.length;n=Array(e+e/3),a=0;for(let t=0,i=0;i<n.length;)n[i++]=3,a++,n[i++]=o[t++],n[i++]=o[t++],n[i++]=o[t++]}return{positions:s,faceIndices:n,nFaces:a}}(e,t,i));let s=n.length,o=r.length,l=n.length,c=r.length,h=l*Float32Array.BYTES_PER_ELEMENT+c*Uint32Array.BYTES_PER_ELEMENT,u=l*Float32Array.BYTES_PER_ELEMENT,d=(Uint32Array.BYTES_PER_ELEMENT,KZ._malloc(h)),p=new Float32Array(KZ.HEAPF32.buffer,d,l),f=new Uint32Array(KZ.HEAPU32.buffer,d+u,c);p.set(n,0),f.set(r,0);let m=KZ.get_csg_mesh(d,s,d+u,o,a);return KZ._free(d),m}function sK(e){return KZ.has_open_edges(e)}function oK(e,t){KZ.transform_csg_mesh(e,t.elements)}function lK(e){KZ.free_csg_mesh(e)}$Z.then((e=>KZ=e));var cK={ConeGeometry:class{static create(e){return this.build(this.normalizeInputs(e))}static normalizeInputs(e,t){var i,n,r;let a=Object.assign({},null!==(i=null===t||void 0===t?void 0:t.parameters)&&void 0!==i?i:{width:100,radialSegments:32,heightSegments:8,openEnded:!1,thetaStart:0,thetaLength:360,cornerRadiusTop:8,cornerRadiusBottom:8,cornerSegments:8},e.parameters);return a.thetaLength=cA.clamp(a.thetaLength,0,360),{parameters:Object.assign(a,{width:Math.abs(a.width),height:Math.abs(null!==(n=a.height)&&void 0!==n?n:a.width),depth:Math.abs(null!==(r=a.depth)&&void 0!==r?r:a.width)})}}static build(e){let t,{width:i,depth:n,height:r,radialSegments:a,heightSegments:s,openEnded:o,thetaStart:l,thetaLength:c,cornerRadiusTop:h,cornerRadiusBottom:u,cornerSegments:d}=e.parameters;return 0===c?(t=new fT,t.setAttribute("position",new sT([],3))):t=h>0||u>0||c<360?new sY(0,i/2,r,a,s,o,l,c*Math.PI/180,h,u,d,0,!0):new CO(i/2,r,a,s,o),t.scale(1,1,n/i),Object.assign(t,{userData:{...e,type:"ConeGeometry"}})}},CubeGeometry:class{static create(e){return this.build(this.normalizeInputs(e))}static normalizeInputs(e,t){var i,n,r;let a=Object.assign({},null!==(i=null===t||void 0===t?void 0:t.parameters)&&void 0!==i?i:{width:100,widthSegments:1,heightSegments:1,depthSegments:1,cornerRadius:8,cornerSegments:8},e.parameters);return{parameters:Object.assign(a,{width:Math.abs(a.width),height:Math.abs(null!==(n=a.height)&&void 0!==n?n:a.width),depth:Math.abs(null!==(r=a.depth)&&void 0!==r?r:a.width)})}}static build(e){let t,{width:i,height:n,depth:r,widthSegments:a,heightSegments:s,depthSegments:o,cornerRadius:l,cornerSegments:c}=e.parameters;return t=0==l?new DT(i,n,r,a,s,o):new lY(i,n,r,a,s,o,l,c),Object.assign(t,{userData:{...e,type:"CubeGeometry"}})}},CylinderGeometry:nY,DodecahedronGeometry:class{static create(e){return this.build(this.normalizeInputs(e))}static normalizeInputs(e,t){var i,n,r;let a=Object.assign({},null!==(i=null===t||void 0===t?void 0:t.parameters)&&void 0!==i?i:{width:100,detail:0,corner:0,cornerSides:4},e.parameters);return{parameters:Object.assign(a,{width:Math.abs(a.width),height:Math.abs(null!==(n=a.height)&&void 0!==n?n:a.width),depth:Math.abs(null!==(r=a.depth)&&void 0!==r?r:a.width)})}}static build(e){let{width:t,height:i,depth:n,detail:r,corner:a,cornerSides:s}=e.parameters,o=0===r&&0!==a?new hY(.5*t,a,s):new MO(.5*t,r);return o.scale(1,i/t,n/t),Object.assign(o,{userData:{...e,type:"DodecahedronGeometry"}})}},EllipseGeometry:CQ,HelixGeometry:class{static create(e){return this.build(this.normalizeInputs(e))}static normalizeInputs(e,t){var i,n,r;let a=Object.assign({},null!==(i=null===t||void 0===t?void 0:t.parameters)&&void 0!==i?i:{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},e.parameters),s=Math.abs(a.width),o=Math.abs(null!==(n=a.height)&&void 0!==n?n:s),l=Math.abs(null!==(r=a.depth)&&void 0!==r?r:s),c=Math.abs(Math.min(s,l))/2;return{parameters:Object.assign(a,{width:s,height:o,depth:l,radius:c,segments:Math.round(a.segments),pathSegments:Math.round(a.pathSegments),cornerSegments:Math.round(a.cornerSegments)})}}static build(e){let{width:t,height:i,depth:n,radius:r,revolutions:a,segments:s,pathRadius:o,pathType:l,pathSegments:c,cornerRadius:h,cornerSegments:u}=e.parameters,d=new IQ(!1,t,i,n,r,a,s,o,l,c,h,u);return Object.assign(d,{userData:{...e,type:"HelixGeometry"}})}},IcosahedronGeometry:class{static create(e){return this.build(this.normalizeInputs(e))}static normalizeInputs(e,t){var i,n,r;let a=Object.assign({},null!==(i=null===t||void 0===t?void 0:t.parameters)&&void 0!==i?i:{width:100,detail:0,corner:0,cornerSides:4},e.parameters);return{parameters:Object.assign(a,{width:Math.abs(a.width),height:Math.abs(null!==(n=a.height)&&void 0!==n?n:a.width),depth:Math.abs(null!==(r=a.depth)&&void 0!==r?r:a.width)})}}static build(e){let{width:t,height:i,depth:n,detail:r,corner:a,cornerSides:s}=e.parameters,o=0===r&&0!==a?new RQ(.5*t,a,s):new nI(.5*t,r);return o.scale(1,i/t,n/t),Object.assign(o,{userData:{...e,type:"IcosahedronGeometry"}})}},LatheGeometry:class{static create(e){return this.build(this.normalizeInputs(e))}static normalizeInputs(e,t){var i,n,r,a,s;(null!==(i=null===(n=e.parameters)||void 0===n?void 0:n.points)&&void 0!==i?i:[]).forEach((e=>{Array.isArray(e)&&(e.x=e[0],e.y=e[1])}));let o=Object.assign({},null!==(r=null===t||void 0===t?void 0:t.parameters)&&void 0!==r?r:{width:100,segments:64,verticalSegments:64,points:[{x:0,y:-50,id:0},{x:50,y:-50,id:1},{x:50,y:50,id:2},{x:0,y:50,id:3}]},e.parameters);return{parameters:Object.assign(o,{width:Math.abs(o.width),height:Math.abs(null!==(a=o.height)&&void 0!==a?a:o.width),depth:Math.abs(null!==(s=o.depth)&&void 0!==s?s:o.width)})}}static build(e){let{points:t,segments:i,verticalSegments:n}=e.parameters,r=new TO;r.moveTo(t[0].x,t[0].y),r.bezierCurveTo(t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y);let a=new SO(r.extractPoints(n).shape,i);return a.rotateZ(Math.PI),Object.assign(a,{userData:{...e,type:"LatheGeometry"}})}},NonParametricGeometry:class{static create(e){return this.build(this.normalizeInputs(e))}static normalizeInputs(e,t){var i,n;let r,a=null!==(i=null!==(n=e.geometry)&&void 0!==n?n:null===t||void 0===t?void 0:t.geometry)&&void 0!==i?i:(new fT).copy(new DT(100,100,100));void 0===t?(a.computeBoundingBox(),a.boundingBox.getSize(eZ),r={width:eZ.x,height:eZ.y,depth:eZ.z,subdivisions:0}):r=t.parameters;let s={...r,...e.parameters};return{parameters:{width:Math.abs(s.width),height:Math.abs(s.height),depth:Math.abs(s.depth),subdivisions:Math.abs(s.subdivisions)},geometry:a}}static build(e){var t;let{width:i,height:n,depth:r,subdivisions:a}=e.parameters,s=null!==(t=e.geometry)&&void 0!==t?t:(new fT).copy(new DT(100,100,100)),o=s.userData.parameters;void 0===o?(s.computeBoundingBox(),s.boundingBox.getSize(eZ)):eZ.set(o.width,o.height,o.depth),(i!==eZ.x||n!==eZ.y||r!==eZ.z)&&s.scale(0===eZ.x?1:i/eZ.x,0===eZ.y?1:n/eZ.y,0===eZ.z?1:r/eZ.z);let l=s.originalGeometry;try{a>0?(void 0===l||(null===o||void 0===o?void 0:o.subdivisions)!==a)&&(void 0===l&&(l=s),s=new $Q(a).modify(l).toBufferGeometry()):(void 0!==l&&(s=l),l=void 0,void 0===s.getAttribute("normal")&&s.computeVertexNormals())}catch{void 0!==l&&(s=l),l=void 0,void 0===s.getAttribute("normal")&&s.computeVertexNormals()}return void 0!==l&&Object.assign(s,{originalGeometry:l}),delete e.geometry,Object.assign(s,{userData:{...e,type:"NonParametricGeometry"}})}static loadFromUrl(e,t,i){new JI(i).load(e,(e=>{let i=this.normalizeInputs({geometry:e});e.boundingBox.getSize(eZ);let n=100/eZ.x;Object.assign(i.parameters,{width:100,height:eZ.y*n,depth:eZ.z*n}),t(this.build(i))}))}},PolygonGeometry:tZ,PyramidGeometry:class{static create(e){return this.build(this.normalizeInputs(e))}static normalizeInputs(e,t){var i,n,r;let a=Object.assign({},null!==(i=null===t||void 0===t?void 0:t.parameters)&&void 0!==i?i:{width:100,radialSegments:4,heightSegments:1,cornerRadius:0,cornerSegments:8,openEnded:!1},e.parameters);return{parameters:Object.assign(a,{width:Math.abs(a.width),height:Math.abs(null!==(n=a.height)&&void 0!==n?n:a.width),depth:Math.abs(null!==(r=a.depth)&&void 0!==r?r:a.width)})}}static build(e){let{width:t,height:i,depth:n,radialSegments:r,heightSegments:a,openEnded:s,cornerRadius:o,cornerSegments:l}=e.parameters,c=new aZ(.5*t,i,r,a,s,o,l);return c.scale(1,1,n/t),Object.assign(c,{userData:{...e,type:"PyramidGeometry"}})}},RectangleGeometry:sZ,SphereGeometry:class{static create(e){return this.build(this.normalizeInputs(e))}static normalizeInputs(e,t){var i,n,r;let a=Object.assign({},null!==(i=null===t||void 0===t?void 0:t.parameters)&&void 0!==i?i:{width:100,widthSegments:64,heightSegments:64,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:180},e.parameters);return a.thetaLength=cA.clamp(a.thetaLength,0,180),{parameters:Object.assign(a,{width:Math.abs(a.width),height:Math.abs(null!==(n=a.height)&&void 0!==n?n:a.width),depth:Math.abs(null!==(r=a.depth)&&void 0!==r?r:a.width)})}}static build(e){let t,{width:i=100,height:n=i,depth:r=i,widthSegments:a=64,heightSegments:s=64,phiStart:o,phiLength:l,thetaStart:c,thetaLength:h}=e.parameters;return 0===h?(t=new fT,t.setAttribute("position",new sT([],3))):t=new rI(.5*i,a,s,o,l,c,h*cA.DEG2RAD),t.scale(1,n/i,r/i),Object.assign(t,{userData:{...e,type:"SphereGeometry"}})}},PlaneGeometry:class{static create(e){return this.build(this.normalizeInputs(e))}static normalizeInputs(e,t){var i,n;let r=Object.assign({},null!==(i=null===t||void 0===t?void 0:t.parameters)&&void 0!==i?i:{width:100,depth:0,widthSegments:8,heightSegments:8},e.parameters);return{parameters:Object.assign(r,{width:Math.abs(r.width),height:Math.abs(null!==(n=r.height)&&void 0!==n?n:r.width),depth:0})}}static build(e){let{width:t=100,height:i=t,widthSegments:n=8,heightSegments:r=8}=e.parameters,a=new KT(t,i,n,r);return a.scale(1,1,1),Object.assign(a,{userData:{...e,type:"PlaneGeometry"}})}},BackdropGeometry:class{static create(e){return this.build(this.normalizeInputs(e))}static normalizeInputs(e,t){var i,n,r;let a=Object.assign({},null!==(i=null===t||void 0===t?void 0:t.parameters)&&void 0!==i?i:{width:100,angle:90,cornerRadius:24,cornerSegments:8},e.parameters);return{parameters:Object.assign(a,{width:Math.abs(a.width),height:Math.abs(null!==(n=a.height)&&void 0!==n?n:a.width),depth:Math.abs(null!==(r=a.depth)&&void 0!==r?r:a.width)})}}static build(e){let{width:t,height:i,depth:n,angle:r,cornerRadius:a,cornerSegments:s}=e.parameters,o=new oZ(t,i,n,r,a,s);return Object.assign(o,{userData:{...e,type:"BackdropGeometry"}})}},StarGeometry:lZ,TextFrameGeometry:class{static create(e){return this.build(this.normalizeInputs(e))}static normalizeInputs(e,t){var i,n,r;let a=Object.assign({},null!==(i=null===t||void 0===t?void 0:t.parameters)&&void 0!==i?i:{width:100,depth:0},e.parameters);return{parameters:Object.assign(a,{width:Math.abs(a.width),height:Math.abs(null!==(n=a.height)&&void 0!==n?n:a.width),depth:Math.abs(null!==(r=a.depth)&&void 0!==r?r:0)})}}static build(e){let{width:t,height:i}=e.parameters,n=new KT(t,i);return Object.assign(n,{userData:{...e,type:"TextFrameGeometry"}})}},TorusGeometry:class{static create(e){return this.build(this.normalizeInputs(e))}static normalizeInputs(e,t){var i,n,r;let a=Object.assign({},null!==(i=null===t||void 0===t?void 0:t.parameters)&&void 0!==i?i:{width:100,radialSegments:32,tubularSegments:64,arc:360,cornerRadius:30,cornerSegments:8},e.parameters),s=Math.abs(a.width),o=Math.abs(null!==(n=a.height)&&void 0!==n?n:a.width),l=Math.round(Math.abs(null!==(r=a.depth)&&void 0!==r?r:.25*a.width));return{parameters:Object.assign(a,{width:s,height:o,depth:l})}}static build(e){let{width:t,height:i,depth:n,radialSegments:r,tubularSegments:a,arc:s,cornerRadius:o,cornerSegments:l}=e.parameters,c=function(e,t,i,n,r,a,s,o,l,c,h){[t,i]=[i,t],s=t/2;let u=cA.clamp(r/360,0,1);if(0===u){let e=new fT;return e.setAttribute("position",new sT([],3)),e}return 1===u&&(c=0),new IQ(!0,e,t,i,n,u,a,s,o,l,c,h)}(t,i,n,.5*t,s,a,0,0,r,o,l);return c.scale(1,i/t,1),Object.assign(c,{userData:{...e,type:"TorusGeometry"}})}},TorusKnotGeometry:class{static create(e){return this.build(this.normalizeInputs(e))}static normalizeInputs(e,t){var i,n,r,a;let s=Object.assign({},null!==(i=null===t||void 0===t?void 0:t.parameters)&&void 0!==i?i:{width:100,tubularSegments:64,radialSegments:32,p:2,q:3},e.parameters);return{parameters:Object.assign(s,{width:Math.abs(s.width),height:Math.abs(null!==(n=s.height)&&void 0!==n?n:s.width),depth:Math.abs(null!==(r=s.depth)&&void 0!==r?r:s.width),tube:null!==(a=s.tube)&&void 0!==a?a:.125*s.width})}}static build(e){let{width:t,tube:i,tubularSegments:n,radialSegments:r,p:a,q:s}=e.parameters,o=.5*t;o!==i&&(o-=i);let l=new sI(o,i,n,r,a,s);return Object.assign(l,{userData:{...e,type:"TorusKnotGeometry"}})}},TriangleGeometry:class{static create(e){return this.build(this.normalizeInputs(e))}static normalizeInputs(e,t){var i,n,r;let a=Object.assign({},null!==(i=null===t||void 0===t?void 0:t.parameters)&&void 0!==i?i:{width:100,depth:0,spikes:5,cornerRadius:0,extrudeBevelSize:0,extrudeBevelSegments:1,isRect:!1},e.parameters);return{shape:e.shape&&e.shape instanceof qY?e.shape:new qY,parameters:Object.assign(a,{width:Math.abs(a.width),height:Math.abs(null!==(n=a.height)&&void 0!==n?n:a.width*(a.isRect?1:Math.sqrt(3)/2)),depth:Math.abs(null!==(r=a.depth)&&void 0!==r?r:0)})}}static build(e){let{width:t=100,height:i,cornerRadius:n,depth:r,extrudeBevelSize:a,extrudeBevelSegments:s,isRect:o}=e.parameters,l=e.shape,c=.5*t,h=.5*i;o?(l.addPoint(l.createPoint(-c,h)),l.addPoint(l.createPoint(c,-h)),l.addPoint(l.createPoint(-c,-h))):(l.addPoint(l.createPoint(0,h)),l.addPoint(l.createPoint(c,-h)),l.addPoint(l.createPoint(-c,-h))),l.isClosed=!0;for(let d=0,p=l.points.length;d<p;d++)l.points[d].roundness=n;l.roundness=n,l.update();let u=SQ.create({shape:l,parameters:{roundness:n,depth:r,extrudeBevelSize:a,extrudeBevelSegments:s}});return Object.assign(u,{userData:{...e,type:"TriangleGeometry"}})}},PathGeometry:class{static create(e){return this.build(this.normalizeInputs(e))}static normalizeInputs(e,t){var i,n,r,a,s;let o=Object.assign({},null!==(i=null===t||void 0===t?void 0:t.parameters)&&void 0!==i?i:{width:100,height:100,depth:1,subdivisions:12,roundness:0,extrudeBevelSize:0,extrudeBevelSegments:3},e.parameters),l=Math.abs(o.width),c=Math.abs(null!==(n=o.height)&&void 0!==n?n:o.width),h=Math.abs(null!==(r=o.depth)&&void 0!==r?r:0),u=null!==(a=null===t||void 0===t?void 0:t.shapeData)&&void 0!==a?a:CQ.create({parameters:xH}).userData.shape;return{path:null!==(s=e.path)&&void 0!==s?s:gH.defaultData(),parameters:Object.assign(o,{width:l,height:c,depth:h,extrusion:{...EH,...o.extrusion}}),shapeData:u}}static build(e){if(e.path.points.length>=2){let t=new wZ(e);return Object.assign(t,{userData:{...e,type:"PathGeometry"}})}return Object.assign(new fT,{userData:{...e,type:"PathGeometry"}})}},VectorGeometry:SQ},hK=e=>cK[e.type].create(e);function uK(e){return null!==e&&"booleanOp"in e}var dK=class extends(iY(TT)){constructor(){super(...arguments),this.booleanMeshSetAddress=-1,this.booleanWasTransformed=!1,this.booleanMatrixInvOld=new mM}updateVisible(e){super.updateVisible(e),this.visible=!uK(this.parent)&&this.visible,uK(this.parent)&&this.parent.invalidateDownstreamBooleanData()}freeBooleanPointer(){-1!==this.booleanMeshSetAddress&&(YZ.freeMeshSet(this.booleanMeshSetAddress),this.booleanMeshSetAddress=-1)}invalidateDownstreamBooleanData(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?this.booleanWasTransformed=!0:this.freeBooleanPointer(),uK(this.parent)?this.parent.invalidateDownstreamBooleanData():this}invalidateUpstreamBooleanData(){this.freeBooleanPointer();for(let e of this.children)e instanceof dK&&(e.freeBooleanPointer(),uK(e)&&e.invalidateUpstreamBooleanData())}updateTransformState(e,t){let i=super.updateTransformState(e,t);return i&&uK(this.parent)&&this.invalidateDownstreamBooleanData(!0),i}onVariableUpdate(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super.onVariableUpdate(e),uK(this.parent)&&this.invalidateDownstreamBooleanData(!0)}},pK=new UA;function fK(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.count,n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,a=1/0,s=1/0,o=1/0,l=-1/0,c=-1/0,h=-1/0;for(let u=t;u<i;u++){let t=e.getX(u),i=e.getY(u),n=e.getZ(u);t<a&&(a=t),i<s&&(s=i),n<o&&(o=n),t>l&&(l=t),i>c&&(c=i),n>h&&(h=n)}pK.min.set(a,s,o),pK.max.set(l,c,h),pK.getCenter(n),pK.getSize(r).multiplyScalar(.5)}var mK=new fT,gK=new eT,vK=class extends dK{constructor(e,t){super(mK,gK),this.super_Entity(e,t)}updateState(e,t){this.updateState_Entity(e,t)}updateEntityBoxSize(e,t){let i=this.geometry.getAttribute("position");void 0!==i?fK(i,this.geometry.drawRange.start,this.geometry.drawRange.count<1/0?this.geometry.drawRange.count:i.count,e,t):super.updateEntityBoxSize(e,t)}},yK=class{constructor(e){var t;e=null!==(t=e)&&void 0!==t?t:{},this.name=e.name,this.type=e.type,this.node=e.node,this.size=e.size,this.needsUpdate=e.needsUpdate}get value(){return this.node.value}set value(e){this.node.value=e}},bK=class{constructor(e){this.hashProperties=void 0,this.isNode=!0,this.shortcuts={},this.uuid=cA.generateUUID(),this.type=e,this.name=""}analyze(e,t){var i;t=null!==(i=t)&&void 0!==i?i:{},e.analyzing=!0,this.build(e.addFlow(t.slot,t.cache,t.context),"v4"),e.clearVertexNodeCode(),e.clearFragmentNodeCode(),e.removeFlow(),e.analyzing=!1}analyzeAndFlow(e,t,i){var n;return i=null!==(n=i)&&void 0!==n?n:{},this.analyze(e,i),this.flow(e,t,i)}flow(e,t,i){var n;i=null!==(n=i)&&void 0!==n?n:{},e.addFlow(i.slot,i.cache,i.context);let r={result:this.build(e,t),code:e.clearNodeCode(),extra:e.context.extra};return e.removeFlow(),r}build(e,t,i){var n;t=null!==(n=t)&&void 0!==n?n:this.getType(e,t);let r=e.getNodeData(null!==i&&void 0!==i?i:this);return e.analyzing&&this.appendDepsNode(e,r,t),-1===e.nodes.indexOf(this)&&e.nodes.push(this),void 0!==this.updateFrame&&-1===e.updaters.indexOf(this)&&e.updaters.push(this),this.generate(e,t,i)}updateFrame(e){}generateReadonly(e,t,i,n,r,a){return""}generate(e,t,i,n,r){return""}parse(e,t,i,n){}appendDepsNode(e,t,i){t.deps=(t.deps||0)+1;let n=e.getTypeLength(i);(n>(t.outputMax||0)||this.getType(e,i))&&(t.outputMax=n,t.output=i)}setName(e){this.name=e}getName(){return this.name}getType(e,t){return"sampler2D"===t||"samplerCube"===t?t:this.type}getHash(){let e,t,i="{";for(e in this)t=this[e],t instanceof bK&&(i+='"'+e+'":'+t.getHash()+",");if(this.hashProperties)for(let n=0;n<this.hashProperties.length;n++)e=this.hashProperties[n],t=this[e],i+='"'+e+'":"'+String(t)+'",';return i+='"id":"'+this.uuid+'"}',i}},xK=new class{constructor(){this.nodes={},this.keywords={}}add(e){this.nodes[e.name]=e}addKeyword(e,t,i){i=void 0===i||i,this.keywords[e]={callback:t,cache:i}}remove(e){delete this.nodes[e.name]}removeKeyword(e){delete this.keywords[e]}get(e){return this.nodes[e]}getKeyword(e,t){return this.keywords[e].callback(t)}getKeywordData(e){return this.keywords[e]}contains(e){return void 0!==this.nodes[e]}containsKeyword(e){return void 0!==this.keywords[e]}},wK=class extends bK{constructor(e,t){var i;super(e),this.scope="",t=null!==(i=t)&&void 0!==i?i:{},this.shared=void 0===t.shared||t.shared,this.unique=void 0!==t.unique&&t.unique}build(e,t,i,n){var r;if(t=null!==(r=t)&&void 0!==r?r:this.getType(e),this.getShared(e,t)){var a;let r=this.getUnique(e,t);r&&void 0===this.uuid&&(this.uuid=cA.generateUUID()),i=e.getUUID(null!==(a=i)&&void 0!==a?a:this.getUUID(),!r);let s=e.getNodeData(i),o=s.output||this.getType(e);if(e.analyzing)return(s.deps||0)>0||this.getLabel()?(this.appendDepsNode(e,s,t),this.generate(e,t,i)):super.build(e,t,i);if(r)return s.name=s.name||super.build(e,t,i),s.name;if(!this.getLabel()&&(!this.getShared(e,o)||e.context.ignoreCache||1===s.deps))return super.build(e,t,i);i=this.getUUID(!1);let l=this.getTemp(e,i);if(l)return e.format(l,o,t);{l=super.generate(e,t,i,s.output,n);let r=this.generate(e,o,i);return e.addNodeCode(l+" = "+r+";"),e.format(l,o,t)}}return super.build(e,t,i)}getShared(e,t){return"sampler2D"!==t&&"samplerCube"!==t&&this.shared}getUnique(e,t){return this.unique}setLabel(e){return this.label=e,this}getLabel(){return this.label}getUUID(e){let t=this.uuid;return"string"==typeof this.scope&&(t=this.scope+"-"+t),t}getTemp(e,t){t=t||this.uuid;let i=e.getVars()[t];return i?i.name:void 0}generate(e,t,i,n,r){var a;return this.getShared(e,t)||console.error("TempNode is not shared"),i=null!==(a=i)&&void 0!==a?a:this.uuid,e.getTempVar(i,null!==n&&void 0!==n?n:this.getType(e),r,this.getLabel()).name}},_K=class extends wK{constructor(e,t){var i;(t=null!==(i=t)&&void 0!==i?i:{}).shared=void 0!==t.shared&&t.shared,super(e,t),this.readonly=!1}setReadonly(e){return this.readonly=e,this.hashProperties=this.readonly?["value"]:void 0,this}getReadonly(){return this.readonly}generate(e,t,i,n,r,a){var s,o;i=e.getUUID(null!==(s=i)&&void 0!==s?s:this.getUUID()),n=null!==(o=n)&&void 0!==o?o:this.getType(e);let l=e.getNodeData(i);return this.getReadonly()&&void 0!==this.generateReadonly?this.generateReadonly(e,t,i,n,r,a):e.isShader("vertex")?(l.vertex||(l.vertex=e.createVertexUniform(n,this,r,a,this.getLabel())),e.format(l.vertex.name,n,t)):(l.fragment||(l.fragment=e.createFragmentUniform(n,this,r,a,this.getLabel())),e.format(l.fragment.name,n,t))}},SK=class extends _K{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;super("v2"),this.nodeType="Vector2",this.value=e instanceof hA?e:new hA(e,t)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}generateReadonly(e,t,i,n,r,a){return e.format("vec2("+this.value.x+", "+this.value.y+")",n,t)}},EK=class extends _K{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;super("v3"),this.nodeType="Vector3",this.value=e instanceof FA?e:new FA(e,t,i)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}generateReadonly(e,t,i,n,r,a){return e.format("vec3("+this.value.x+", "+this.value.y+", "+this.value.z+")",n,t)}},CK=class extends MA{constructor(e,t,i,n){super(e,t,i),this.isColorA=!0,this.a=n}setRGBA(e,t,i,n){super.setRGB(e,t,i),this.a=n}copy(e){return super.copy(e),this.a="a"in e?e.a:1,this}clone(){return new this.constructor(this.r,this.g,this.b,this.a)}equals(e){return super.equals(e)&&this.a===e.a}setStyle(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"srgb";if("transparent"===e)return this.setRGBA(0,0,0,0),this;if(t=/^((?:rgb|hsl)a?)\(([^)]*)\)/.exec(e)){let n,r=t[1],a=t[2];switch(r){case"rgb":case"rgba":if(n=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.a="rgba"===r?parseFloat(n[4]):1,super.setStyle(e,i);break;case"hsl":case"hsla":if(n=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)%\s*,\s*(\d*\.?\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.a="hsla"===r?parseFloat(n[4]):1,super.setStyle(e,i)}}return super.setStyle(e,i)}get x(){return this.r}get y(){return this.g}get z(){return this.b}get w(){return this.a}set x(e){this.r=e}set y(e){this.g=e}set z(e){this.b=e}set w(e){this.a=e}},AK=class extends _K{constructor(e){super("v4"),this.nodeType="Vector4",this.value=e instanceof CK?e:new CK(e.r,e.g,e.b,e.a)}generateReadonly(e,t,i,n,r,a){return e.format("vec4("+this.value.r+", "+this.value.g+", "+this.value.b+", "+this.value.a+")",n,t)}},MK=/^\s*([a-z_0-9]+)\s([a-z_0-9]+)\s*\((.*?)\)/i,TK=/[a-z_0-9]+/gi,PK=class extends wK{constructor(e,t,i,n,r){super(r),this.src="",this.nodeType="Function",this.useKeywords=!0,this.includes=[],this.extensions={},this.keywords={},this.isMethod=void 0===r,this.isInterface=!1,this.parse(e,t,i,n)}getShared(e,t){return!this.isMethod}getType(e){return e.getTypeByFormat(this.type)}getInputByName(e){if(this.inputs){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}}getIncludeByName(e){if(this.includes){let t=this.includes.length;for(;t--;)if(this.includes[t].name===e)return this.includes[t]}}generate(e,t,i,n,r){let a,s=0,o=this.src;if(this.includes)for(let c=0;c<this.includes.length;c++)e.include(this.includes[c],this);for(let c in this.extensions)e.extensions[c]=!0;let l=[];for(;a=TK.exec(this.src);)l.push(a);for(let c=0;c<l.length;c++){let t=l[c],i=t[0],n=!this.isMethod||!this.getInputByName(i),r=i;if(this.keywords[i]||this.useKeywords&&n&&xK.containsKeyword(i)){let t=this.keywords[i];if(!t){let n=xK.getKeywordData(i);n.cache&&(t=e.keywords[i]),t=t||xK.getKeyword(i,e),n.cache&&(e.keywords[i]=t)}r=t.build(e)}i!==r&&"."!==o[t.index+s-1]&&(o=o.substring(0,t.index+s)+r+o.substring(t.index+i.length+s),s+=r.length-i.length),void 0===this.getIncludeByName(r)&&xK.contains(r)&&e.include(xK.get(r))}return"source"===t?o:this.isMethod?(this.isInterface||e.include(this,void 0,o),this.name):e.format("( "+o+" )",this.getType(e),t)}parse(e,t,i,n){if(this.src=e||"",this.includes=null!==t&&void 0!==t?t:[],this.extensions=null!==i&&void 0!==i?i:{},this.keywords=null!==n&&void 0!==n?n:{},this.isMethod){let e=MK.exec(this.src);if(this.inputs=[],e&&4==e.length){this.type=e[1],this.name=e[2];let t=e[3].match(TK);if(t){let e=0;for(;e<t.length;){let i,n=t[e++];"in"===n||"out"===n||"inout"===n?i=t[e++]:(i=n,n="");let r=t[e++];this.inputs.push({name:r,type:i,qualifier:n})}}this.isInterface=-1===this.src.indexOf("{")}else this.type="",this.name=""}}},DK=/^([a-z_0-9]+)\s([a-z_0-9]+)\s?\=?\s?(.*?)(\;|$)/i,kK=class extends wK{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;super(),this.src="",this.useDefine=!1,this.nodeType="Const",this.parse(e||kK.PI,void 0,void 0,void 0,t)}getType(e){return e.getTypeByFormat(this.type)}parse(e,t,i,n,r){this.src=e||"";let a,s,o="",l=DK.exec(e);this.useDefine=null!==r&&void 0!==r?r:"#"===this.src.charAt(0),l&&l.length>1?(s=l[1],a=l[2],o=l[3]):(a=this.src,s="f"),this.name=a,this.type=s,this.value=o}build(e,t){if("source"===t){if(this.value)return this.useDefine?"#define "+this.name+" "+this.value:"const "+this.type+" "+this.name+" = "+this.value+";";if(this.useDefine)return this.src}return e.include(this),e.format(this.name,this.getType(e),t)}generate(e,t,i,n,r){return e.format(this.name,this.getType(e),t)}},OK=kK;OK.PI="PI",OK.PI2="PI2",OK.RECIPROCAL_PI="RECIPROCAL_PI",OK.RECIPROCAL_PI2="RECIPROCAL_PI2",OK.LOG2="LOG2",OK.EPSILON="EPSILON";var IK=new RegExp("^structs*([a-z_0-9]+)s*{s*((.|\n)*?)}","gim"),RK=new RegExp("s*(w*?)s*(w*?)(=|;)","gim"),LK=class extends wK{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";super(),this.inputs=[],this.src="",this.nodeType="Struct",this.parse(e)}getType(e){return e.getTypeByFormat(this.name)}getInputByName(e){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}generate(e,t,i,n,r){return"source"===t?this.src+";":e.format("( "+this.src+" )",this.getType(e),t)}parse(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.src=e,this.inputs=[];let t=IK.exec(e);if(t){let e,i=t[2];for(;e=RK.exec(i);)this.inputs.push({type:e[1],name:e[2]});this.name=t[1]}else this.name="";this.type=this.name}},BK=class extends wK{constructor(e){super("v2",{shared:!1}),this.nodeType="UV",this.index=null!==e&&void 0!==e?e:0}generate(e,t){e.requires.uv[this.index]=!0;let i=this.index>0?this.index+1:"",n=e.isShader("vertex")?"uv"+i:"vUv"+i;return e.format(n,this.getType(e),t)}};xK.addKeyword("uv",(function(){return new BK})),xK.addKeyword("uv2",(function(){return new BK(1)}));var zK=class extends wK{constructor(e,t){super("v4"),this.nodeType="ColorSpace",this.input=e,this.method=null!==t&&void 0!==t?t:zK.LINEAR_TO_LINEAR,this.hashProperties=["method"]}static getEncodingComponents(e){switch(e){case zC:return["Linear"];case NC:return["sRGB"];default:return[]}}generate(e,t){var i;let n=this.input.build(e,"v4"),r=this.getType(e),a=zK.Nodes[this.method],s=e.include(a);if(s===zK.LINEAR_TO_LINEAR)return e.format(n,r,t);if(2===(null===(i=a.inputs)||void 0===i?void 0:i.length)){let i=this.factor.build(e,"f");return e.format(s+"( "+n+", "+i+" )",r,t)}return e.format(s+"( "+n+" )",r,t)}fromEncoding(e){let t=zK.getEncodingComponents(e);this.method="LinearTo"+t[0],this.factor=t[1]}fromDecoding(e){let t=zK.getEncodingComponents(e);this.method=t[0]+"ToLinear",this.factor=t[1]}},NK=zK;NK.Nodes={LinearToLinear:new PK(["vec4 LinearToLinear( in vec4 value ) {","\treturn value;","}"].join("\n")),sRGBToLinear:new PK(["vec4 sRGBToLinear( in vec4 value ) {","\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 );","}"].join("\n")),LinearTosRGB:new PK(["vec4 LinearTosRGB( in vec4 value ) {","\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 );","}"].join("\n"))},NK.LINEAR_TO_LINEAR="LinearToLinear",NK.SRGB_TO_LINEAR="sRGBToLinear",NK.LINEAR_TO_SRGB="LinearTosRGB";var FK=class extends PK{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",arguments.length>4?arguments[4]:void 0,arguments.length>3?arguments[3]:void 0,arguments.length>2?arguments[2]:void 0,arguments.length>1?arguments[1]:void 0),this.nodeType="Expression"}},jK=class extends _K{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new IA,t=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;super("v4",{shared:!0}),this.nodeType="Texture",this.value=e,this.uv=null!==t&&void 0!==t?t:new BK,this.bias=i,this.project=void 0!==n&&n}getTexture(e,t){return super.generate(e,t,this.value.uuid,"t")}generate(e,t){var i;if("sampler2D"===t)return this.getTexture(e,t);let n,r,a=this.getTexture(e,t),s=this.uv.build(e,this.project?"v4":"v2"),o=this.bias?this.bias.build(e,"f"):void 0;void 0===o&&e.context.bias&&(o=e.context.bias.setTexture(this).build(e,"f")),n=this.project?"texture2DProj":o?"tex2DBias":"tex2D",r=o?n+"( "+a+", "+s+", "+o+" )":n+"( "+a+", "+s+" )";let l={include:e.isShader("vertex"),ignoreCache:!0},c=this.getType(e);return e.addContext(l),this.colorSpace=null!==(i=this.colorSpace)&&void 0!==i?i:new NK(new FK("",c)),this.colorSpace.fromDecoding(e.getTextureEncodingFromMap(this.value)),this.colorSpace.input.parse(r),r=this.colorSpace.build(e,c),e.removeContext(),e.format(r,c,t)}},VK=class extends _K{constructor(e){super("f"),this.nodeType="Float",this.value=null!==e&&void 0!==e?e:0}generateReadonly(e,t,i,n,r,a){return e.format(this.value+(this.value%1?"":".0"),n,t)}},UK=class extends wK{constructor(e,t){super(),this.inputs=[],this.nodeType="FunctionCall",this.value=e,this.inputs=null!==t&&void 0!==t?t:[]}getFunction(){return this.value}getType(e){return this.value.getType(e)}generate(e,t,i,n,r){n=this.getType(e);let a=this.value,s=a.build(e,t)+"( ",o=[];if(a.inputs){for(let t=0;t<a.inputs.length;t++){let i=a.inputs[t],n=this.inputs[t]||this.inputs[i.name];o.push(n.build(e,e.getTypeByFormat(i.type)))}s+=o.join(", ")+" )"}return e.format(s,n,t)}},GK=class extends wK{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:GK.ADD;super(),this.nodeType="Operator",this.type=e.type,this.a=e,this.b=t,this.op=i}getType(e){let t=this.a.getType(e),i=this.b.getType(e);return e.isTypeMatrix(t)?"v4":e.getTypeLength(i)>e.getTypeLength(t)?i:t}generate(e,t){let i=this.getType(e);this.type=i;let n=this.a.build(e,i),r=this.b.build(e,i);return e.format("( "+n+" "+this.op+" "+r+" )",i,t)}},HK=GK;HK.ADD="+",HK.SUB="-",HK.MUL="*",HK.DIV="/";var WK=class extends wK{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:WK.ABS,i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;super(),this.nodeType="Math",this.a=e,"string"!=typeof t?this.b=t:n=t,"string"!=typeof i?this.c=i:n=i,this.method=n,this.hashProperties=["method"]}getNumInputs(e){switch(this.method){case WK.MIX:case WK.CLAMP:case WK.REFRACT:case WK.SMOOTHSTEP:case WK.FACEFORWARD:return 3;case WK.MIN:case WK.MAX:case WK.MOD:case WK.STEP:case WK.REFLECT:case WK.DISTANCE:case WK.DOT:case WK.CROSS:case WK.POW:return 2;default:return 1}}getInputType(e){let t=e.getTypeLength(this.a.getType(e)),i=this.b?e.getTypeLength(this.b.getType(e)):0,n=this.c?e.getTypeLength(this.c.getType(e)):0;return t>i&&t>n?this.a.getType(e):i>n?this.b.getType(e):this.c.getType(e)}getType(e){switch(this.method){case WK.LENGTH:case WK.DISTANCE:case WK.DOT:return"f";case WK.CROSS:return"v3"}return this.getInputType(e)}generate(e,t){let i,n,r,a=this.a?e.getTypeLength(this.a.getType(e)):0,s=this.b?e.getTypeLength(this.b.getType(e)):0,o=this.c?e.getTypeLength(this.c.getType(e)):0,l=this.getInputType(e),c=this.getType(e);switch(this.type=c,this.method){case WK.NEGATE:return e.format("( -"+this.a.build(e,l)+" )",l,t);case WK.INVERT:return e.format("( 1.0 - "+this.a.build(e,l)+" )",l,t);case WK.CROSS:i=this.a.build(e,"v3"),n=this.b.build(e,"v3");break;case WK.STEP:i=this.a.build(e,1===a?"f":l),n=this.b.build(e,l);break;case WK.MIN:case WK.MAX:case WK.MOD:i=this.a.build(e,l),n=this.b.build(e,1===s?"f":l);break;case WK.REFRACT:i=this.a.build(e,l),n=this.b.build(e,l),r=this.c.build(e,"f");break;case WK.MIX:i=this.a.build(e,l),n=this.b.build(e,l),r=this.c.build(e,1===o?"f":l);break;default:i=this.a.build(e,l),this.b&&(n=this.b.build(e,l)),this.c&&(r=this.c.build(e,l))}let h=[];h.push(i),n&&h.push(n),r&&h.push(r);let u=this.getNumInputs(e);if(h.length!==u)throw Error('Arguments not match used in "'.concat(this.method,'". Require ').concat(u,", currently ").concat(h.length,"."));return e.format(this.method+"( "+h.join(", ")+" )",c,t)}},qK=WK;qK.RAD="radians",qK.DEG="degrees",qK.EXP="exp",qK.EXP2="exp2",qK.LOG="log",qK.LOG2="log2",qK.SQRT="sqrt",qK.INV_SQRT="inversesqrt",qK.FLOOR="floor",qK.CEIL="ceil",qK.NORMALIZE="normalize",qK.FRACT="fract",qK.SATURATE="saturate",qK.SIN="sin",qK.COS="cos",qK.TAN="tan",qK.ASIN="asin",qK.ACOS="acos",qK.ARCTAN="atan",qK.ABS="abs",qK.SIGN="sign",qK.LENGTH="length",qK.NEGATE="negate",qK.INVERT="invert",qK.MIN="min",qK.MAX="max",qK.MOD="mod",qK.STEP="step",qK.REFLECT="reflect",qK.DISTANCE="distance",qK.DOT="dot",qK.CROSS="cross",qK.POW="pow",qK.MIX="mix",qK.CLAMP="clamp",qK.REFRACT="refract",qK.SMOOTHSTEP="smoothstep",qK.FACEFORWARD="faceforward";var XK=class extends wK{constructor(e,t,i){super("v4"),this.nodeType="TextureCubeUV",this.value=e,this.uv=t,this.bias=i}bilinearCubeUV(e,t,i,n){var r,a,s,o;let l=new UK(XK.Nodes.bilinearCubeUV,[t,i,n]);this.colorSpaceTL=null!==(r=this.colorSpaceTL)&&void 0!==r?r:new NK(new FK("","v4")),this.colorSpaceTL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTL.input.parse(l.build(e)+".tl"),this.colorSpaceTR=null!==(a=this.colorSpaceTR)&&void 0!==a?a:new NK(new FK("","v4")),this.colorSpaceTR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTR.input.parse(l.build(e)+".tr"),this.colorSpaceBL=null!==(s=this.colorSpaceBL)&&void 0!==s?s:new NK(new FK("","v4")),this.colorSpaceBL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBL.input.parse(l.build(e)+".bl"),this.colorSpaceBR=null!==(o=this.colorSpaceBR)&&void 0!==o?o:new NK(new FK("","v4")),this.colorSpaceBR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBR.input.parse(l.build(e)+".br");let c={include:e.isShader("vertex"),ignoreCache:!0};e.addContext(c),this.colorSpaceTLExp=new FK(this.colorSpaceTL.build(e,"v4"),"v4"),this.colorSpaceTRExp=new FK(this.colorSpaceTR.build(e,"v4"),"v4"),this.colorSpaceBLExp=new FK(this.colorSpaceBL.build(e,"v4"),"v4"),this.colorSpaceBRExp=new FK(this.colorSpaceBR.build(e,"v4"),"v4"),e.removeContext();let h=new FK("mix( mix( cubeUV_TL, cubeUV_TR, cubeUV.f.x ), mix( cubeUV_BL, cubeUV_BR, cubeUV.f.x ), cubeUV.f.y )","v4");return h.keywords.cubeUV_TL=this.colorSpaceTLExp,h.keywords.cubeUV_TR=this.colorSpaceTRExp,h.keywords.cubeUV_BL=this.colorSpaceBLExp,h.keywords.cubeUV_BR=this.colorSpaceBRExp,h.keywords.cubeUV=l,h}generate(e,t){if(e.isShader("fragment")){let i=this.uv,n=this.bias||e.context.roughness,r=new UK(XK.Nodes.roughnessToMip,[n]),a=new qK(r,XK.Nodes.m0,XK.Nodes.cubeUV_maxMipLevel,qK.CLAMP),s=new qK(a,qK.FLOOR),o=new qK(a,qK.FRACT),l=this.bilinearCubeUV(e,this.value,i,s),c=this.bilinearCubeUV(e,this.value,i,new HK(s,new VK(1).setReadonly(!0),HK.ADD)),h=new qK(l,c,o,qK.MIX);return e.format(h.build(e),"v4",t)}return console.warn("TextureCubeUVNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t)}},YK=XK;YK.Nodes=function(){let e=new LK("struct TextureCubeUVData {\n\t\t\tvec4 tl;\n\t\t\tvec4 tr;\n\t\t\tvec4 br;\n\t\t\tvec4 bl;\n\t\t\tvec2 f;\n\t\t}"),t=new OK("float cubeUV_maxMipLevel 8.0",!0),i=new OK("float cubeUV_minMipLevel 4.0",!0),n=new OK("float cubeUV_maxTileSize 256.0",!0),r=new OK("float cubeUV_minTileSize 16.0",!0),a=new PK("float getFace(vec3 direction) {\n\t\t\t\tvec3 absDirection = abs(direction);\n\t\t\t\tfloat face = -1.0;\n\t\t\t\tif (absDirection.x > absDirection.z) {\n\t\t\t\t\tif (absDirection.x > absDirection.y)\n\t\t\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\t\t\telse\n\t\t\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t\t\t} else {\n\t\t\t\t\tif (absDirection.z > absDirection.y)\n\t\t\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\t\t\telse\n\t\t\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t\t\t}\n\t\t\t\treturn face;\n\t\t}");a.useKeywords=!1;let s=new PK("vec2 getUV(vec3 direction, float face) {\n\t\t\t\tvec2 uv;\n\t\t\t\tif (face == 0.0) {\n\t\t\t\t\tuv = vec2(direction.z, direction.y) / abs(direction.x); // pos x\n\t\t\t\t} else if (face == 1.0) {\n\t\t\t\t\tuv = vec2(-direction.x, -direction.z) / abs(direction.y); // pos y\n\t\t\t\t} else if (face == 2.0) {\n\t\t\t\t\tuv = vec2(-direction.x, direction.y) / abs(direction.z); // pos z\n\t\t\t\t} else if (face == 3.0) {\n\t\t\t\t\tuv = vec2(-direction.z, direction.y) / abs(direction.x); // neg x\n\t\t\t\t} else if (face == 4.0) {\n\t\t\t\t\tuv = vec2(-direction.x, direction.z) / abs(direction.y); // neg y\n\t\t\t\t} else {\n\t\t\t\t\tuv = vec2(direction.x, direction.y) / abs(direction.z); // neg z\n\t\t\t\t}\n\t\t\t\treturn 0.5 * (uv + 1.0);\n\t\t}");s.useKeywords=!1;let o=new PK("TextureCubeUVData bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) {\n\t\t\tfloat face = getFace(direction);\n\t\t\tfloat filterInt = max(cubeUV_minMipLevel - mipInt, 0.0);\n\t\t\tmipInt = max(mipInt, cubeUV_minMipLevel);\n\t\t\tfloat faceSize = exp2(mipInt);\n\t\t\tfloat texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);\n\t\t\tvec2 uv = getUV(direction, face) * (faceSize - 1.0);\n\t\t\tvec2 f = fract(uv);\n\t\t\tuv += 0.5 - f;\n\t\t\tif (face > 2.0) {\n\t\t\t\tuv.y += faceSize;\n\t\t\t\tface -= 3.0;\n\t\t\t}\n\t\t\tuv.x += face * faceSize;\n\t\t\tif(mipInt < cubeUV_maxMipLevel){\n\t\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t\t}\n\t\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\t\tuv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);\n\t\t\tuv *= texelSize;\n\t\t\tvec4 tl = texture2D(envMap, uv);\n\t\t\tuv.x += texelSize;\n\t\t\tvec4 tr = texture2D(envMap, uv);\n\t\t\tuv.y += texelSize;\n\t\t\tvec4 br = texture2D(envMap, uv);\n\t\t\tuv.x -= texelSize;\n\t\t\tvec4 bl = texture2D(envMap, uv);\n\t\t\treturn TextureCubeUVData( tl, tr, br, bl, f );\n\t\t}",[e,a,s,t,i,n,r]);o.useKeywords=!1;let l=new OK("float r0 1.0",!0),c=new OK("float v0 0.339",!0),h=new OK("float m0 -2.0",!0),u=new OK("float r1 0.8",!0),d=new OK("float v1 0.276",!0),p=new OK("float m1 -1.0",!0),f=new OK("float r4 0.4",!0),m=new OK("float v4 0.046",!0),g=new OK("float m4 2.0",!0),v=new OK("float r5 0.305",!0),y=new OK("float v5 0.016",!0),b=new OK("float m5 3.0",!0),x=new OK("float r6 0.21",!0),w=new OK("float v6 0.0038",!0),_=new OK("float m6 4.0",!0);return{bilinearCubeUV:o,roughnessToMip:new PK("float roughnessToMip(float roughness) {\n\t\t\tfloat mip = 0.0;\n\t\t\tif (roughness >= r1) {\n\t\t\t\tmip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0;\n\t\t\t} else if (roughness >= r4) {\n\t\t\t\tmip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1;\n\t\t\t} else if (roughness >= r5) {\n\t\t\t\tmip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4;\n\t\t\t} else if (roughness >= r6) {\n\t\t\t\tmip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5;\n\t\t\t} else {\n\t\t\t\tmip = -2.0 * log2(1.16 * roughness);// 1.16 = 1.79^0.25\n\t\t\t}\n\t\t\treturn mip;\n\t\t}",[l,c,h,u,d,p,f,m,g,v,y,b,x,w,_]),m0:h,cubeUV_maxMipLevel:t}}();var QK=class extends wK{constructor(e){super("v3"),this.nodeType="Normal",this.scope=null!==e&&void 0!==e?e:QK.VIEW}getShared(){return this.scope===QK.WORLD}build(e,t,i,n){let r=e.context[this.scope+"Normal"];return r?r.build(e,t,i,n):super.build(e,t,i)}generate(e,t,i,n,r){let a;switch(this.scope){case QK.VIEW:a=e.isShader("vertex")?"transformedNormal":"geometryNormal";break;case QK.LOCAL:e.isShader("vertex")?a="objectNormal":(e.requires.normal=!0,a="vObjectNormal");break;case QK.WORLD:e.isShader("vertex")?a="inverseTransformDirection( transformedNormal, viewMatrix ).xyz":(e.requires.worldNormal=!0,a="vWNormal")}return e.format(a,this.getType(e),t)}},ZK=QK;ZK.LOCAL="local",ZK.WORLD="world",ZK.VIEW="view",ZK.NORMAL="normal",xK.addKeyword("viewNormal",(function(){return new ZK(ZK.VIEW)})),xK.addKeyword("localNormal",(function(){return new ZK(ZK.NORMAL)})),xK.addKeyword("worldNormal",(function(){return new ZK(ZK.WORLD)}));var KK=class extends wK{constructor(e){super("v3"),this.nodeType="Position",this.scope=null!==e&&void 0!==e?e:KK.LOCAL}getType(){return this.scope===KK.PROJECTION?"v4":this.type}getShader(){switch(this.scope){case KK.LOCAL:case KK.WORLD:return!1}return!0}generate(e,t,i,n,r){let a;switch(this.scope){case KK.LOCAL:e.isShader("vertex")?a="transformed":(e.requires.position=!0,a="vPosition");break;case KK.WORLD:if(e.isShader("vertex"))return"( modelMatrix * vec4( transformed, 1.0 ) ).xyz";e.requires.worldPosition=!0,a="vWPosition";break;case KK.VIEW:a=e.isShader("vertex")?"-mvPosition.xyz":"vViewPosition";break;case KK.PROJECTION:a=e.isShader("vertex")?"( projectionMatrix * modelViewMatrix * vec4( position, 1.0 ) )":"vec4( 0.0 )"}return e.format(a,this.getType(),t)}},JK=KK;JK.LOCAL="local",JK.WORLD="world",JK.VIEW="view",JK.PROJECTION="projection",xK.addKeyword("position",(function(){return new JK})),xK.addKeyword("worldPosition",(function(){return new JK(JK.WORLD)})),xK.addKeyword("viewPosition",(function(){return new JK(JK.VIEW)}));var $K=class extends wK{constructor(e){super("v3"),this.nodeType="Reflect",this.scope=null!==e&&void 0!==e?e:$K.CUBE}getUnique(e){return!e.context.viewNormal}getType(){return this.scope===$K.SPHERE?"v2":this.type}generate(e,t){let i=this.getUnique(e);if(e.isShader("fragment")){let n;switch(this.scope){case $K.VECTOR:{let t=new ZK(ZK.VIEW),r=e.context.roughness,a=t.build(e,"v3"),s=new JK(JK.VIEW).build(e,"v3"),o=r?r.build(e,"f"):void 0,l="reflect( -normalize( ".concat(s," ), ").concat(a," )");o&&(l="normalize( mix( ".concat(l,", ").concat(a,", ").concat(o," * ").concat(o," ) )"));let c="inverseTransformDirection( ".concat(l,", viewMatrix )");i?(e.addNodeCode("vec3 reflectVec = ".concat(c,";")),n="reflectVec"):n=c;break}case $K.CUBE:{let t=new $K($K.VECTOR).build(e,"v3"),r="vec3( -"+t+".x, "+t+".yz )";i?(e.addNodeCode("vec3 reflectCubeVec = ".concat(r,";")),n="reflectCubeVec"):n=r;break}case $K.SPHERE:{let t="normalize( ( viewMatrix * vec4( "+new $K($K.VECTOR).build(e,"v3")+", 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) ).xy * 0.5 + 0.5";i?(e.addNodeCode("vec2 reflectSphereVec = ".concat(t,";")),n="reflectSphereVec"):n=t;break}}return e.format(n,this.getType(),t)}return console.warn("ReflectNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.type,t)}},eJ=$K;eJ.CUBE="cube",eJ.SPHERE="sphere",eJ.VECTOR="vector";var tJ=class extends wK{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new jK,t=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;super("v4"),this.nodeType="TextureCube",this.value=e,this.radianceNode=new YK(this.value,null!==t&&void 0!==t?t:new eJ(eJ.VECTOR),i),this.irradianceNode=new YK(this.value,new ZK(ZK.WORLD),new VK(1).setReadonly(!0))}generate(e,t){return e.isShader("fragment")?(e.require("irradiance"),e.context.bias&&e.context.bias.setTexture(this.value),("irradiance"===e.slot?this.irradianceNode:this.radianceNode).build(e,t)):(console.warn("TextureCubeNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t))}},iJ=class extends _K{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new jT,t=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;super("v4",{shared:!0}),this.nodeType="CubeTexture",this.value=e,this.uv=null!==t&&void 0!==t?t:new eJ,this.bias=i}getTexture(e,t){return super.generate(e,t,this.value.uuid,"tc")}generate(e,t){var i,n;if("samplerCube"===t)return this.getTexture(e,t);let r,a=this.getTexture(e,t),s=null===(i=this.uv)||void 0===i?void 0:i.build(e,"v3"),o=this.bias?this.bias.build(e,"f"):void 0;void 0===o&&e.context.bias&&(o=e.context.bias.setTexture(this).build(e,"f")),r=o?"texCubeBias( "+a+", "+s+", "+o+" )":"texCube( "+a+", "+s+" )";let l={include:e.isShader("vertex"),ignoreCache:!0},c=this.getType(e);return e.addContext(l),this.colorSpace=null!==(n=this.colorSpace)&&void 0!==n?n:new NK(new FK("",c)),this.colorSpace.fromDecoding(e.getTextureEncodingFromMap(this.value)),this.colorSpace.input.parse(r),r=this.colorSpace.build(e,c),e.removeContext(),e.format(r,c,t)}},nJ=["x","y","z","w"],rJ=["float","vec2","vec3","vec4"],aJ={float:"f",vec2:"v2",vec3:"v3",vec4:"v4",mat4:"v4",int:"i",bool:"b","float[]":"f[]","vec4[]":"v4[]"},sJ={t:"sampler2D",tc:"samplerCube",b:"bool",i:"int",f:"float",c:"vec3",v2:"vec2",v3:"vec3",v4:"vec4",m3:"mat3",m4:"mat4","f[]":"float[]","v4[]":"vec4[]"},oJ=class{constructor(){this.includes={consts:{},functions:{},structs:{}},this.cache="",this.slot="",this.shader="",this.context={},this.needsJitter=!0,this.getIncludesCode=function(){function e(e,t){return e.deps.length-t.deps.length}return function(t,i){let n=this.getIncludes(t,i);if(!n)return"";let r="";n=n.sort(e);for(let e=0;e<n.length;e++)n[e].src&&(r+=n[e].src+"\n");return r}}(),this.slots=[],this.caches=[],this.contexts=[],this.keywords={},this.nodeData={},this.fragmentVariables={},this.fragmentParsVariables={},this.vertexParsVariables={},this.requires={uv:[],color:[],transparent:!1,irradiance:!1,position:!1,worldPosition:!1,normal:!1,worldNormal:!1,vWorldViewDir:!1,modelMatrix:!1,viewMatrix:!1,projectionMatrix:!1},this.includes={consts:[],functions:[],structs:[]},this.attributes={},this.prefixCode=["#ifdef TEXTURE_LOD_EXT","\t#define texCube(a, b) textureCube(a, b)","\t#define texCubeBias(a, b, c) textureCubeLodEXT(a, b, c)","\t#define tex2D(a, b) texture2D(a, b)","\t#define tex2DBias(a, b, c) texture2DLodEXT(a, b, c)","#else","\t#define texCube(a, b) textureCube(a, b)","\t#define texCubeBias(a, b, c) textureCube(a, b, c)","\t#define tex2D(a, b) texture2D(a, b)","\t#define tex2DBias(a, b, c) texture2D(a, b, c)","#endif","\n\t\t\t// NOTE: Include Spline's blending modes. This could be part of BlendNode\n\t\t\t#define SPE_BLENDING_NORMAL 0\n\t\t\t#define SPE_BLENDING_MULTIPLY 1\n\t\t\t#define SPE_BLENDING_SCREEN 2\n\t\t\t#define SPE_BLENDING_OVERLAY 3\n\n\t\t\tvec3 spe_normalBlend( vec3 a, vec3 b, float alpha ) {\n\t\t\t\treturn mix( a, b, alpha );\n\t\t\t}\n\n\t\t\tvec3 spe_multiplyBlend( vec3 a, vec3 b, float alpha ) {\n\t\t\t\treturn mix( a, a * b, alpha );\n\t\t\t}\n\n\t\t\tvec3 spe_screenBlend( vec3 a, vec3 b, float alpha ) {\n\t\t\t\tvec3 tmp = 1.0 - ( 1.0 - a ) * ( 1.0 - b );\n\t\t\t\treturn mix( a, tmp, alpha );\n\t\t\t}\n\n\t\t\tvec3 spe_overlayBlend( vec3 a, vec3 b, float alpha ) {\n\t\t\t\tvec3 tmp = mix( 1. - 2. * (1. - a) * (1. - b), 2. * a * b, step( a, vec3(.5) ) );\n\t\t\t\treturn clamp( mix( a, tmp, alpha ), 0.0, 1.0 );\n\t\t\t}\n\n\t\t\tvec3 spe_blend( vec3 a, vec3 b, float alpha, int mode ) {\n\t\t\t\tif ( mode == SPE_BLENDING_NORMAL ) return spe_normalBlend( a, b, alpha );\n\t\t\t\telse if ( mode == SPE_BLENDING_MULTIPLY ) return spe_multiplyBlend( a, b, alpha );\n\t\t\t\telse if ( mode == SPE_BLENDING_SCREEN ) return spe_screenBlend( a, b, alpha );\n\t\t\t\telse if ( mode == SPE_BLENDING_OVERLAY ) return spe_overlayBlend( a, b, alpha );\n\t\t\t\treturn vec3( 1.0 );\n\t\t\t}\n\t\t\t","#include <packing>","#include <common>"].join("\n"),this.parsCode={vertex:["float neighbor_offset = 0.0001;",""].join("\n"),fragment:["float accumAlpha = 0.0;","void accumulateAlpha(float alpha) {\n\t\t\t\t\taccumAlpha += (1.0 - accumAlpha) * alpha;\n\t\t\t\t}",""].join("\n")},this.code={vertex:"",fragment:""},this.nodeCode={vertex:"",fragment:""},this.resultCode={vertex:"",fragment:""},this.finalCode={vertex:"",fragment:""},this.inputs={uniforms:{list:[],vertex:[],fragment:[]},arrayUniforms:{list:[],vertex:[],fragment:[]},vars:{varying:[],vertex:[],fragment:[]}},this.defines={},this.uniforms={},this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.updaters=[],this.nodes=[],this.analyzing=!1}build(e,t){this.addVertexParsCode("\nuniform int frameIndex;\nuniform vec2 resolution;\nuniform mat4 previousModelViewMatrix;\nuniform mat4 previousProjectionMatrix;\n\nvarying vec4 vCurrentPosition;\nvarying vec4 vPreviousPosition;\n"),this.addFragmentParsCode("\nlayout(location = 1) out vec4 gVelocity;\n\nuniform int frameIndex;\nuniform vec2 resolution;\n\nvarying vec4 vCurrentPosition;\nvarying vec4 vPreviousPosition;\n\nconst vec2 haltonSequence[16] = vec2[16](\nvec2( 0.000000,-0.333334),\nvec2(-0.500000, 0.333334),\nvec2( 0.500000,-0.777778),\nvec2(-0.750000,-0.111112),\nvec2( 0.250000, 0.555556),\nvec2(-0.250000,-0.555556),\nvec2( 0.750000, 0.111112),\nvec2(-0.875000, 0.777778),\nvec2(0.125000, -0.925926),\nvec2(-0.375000, -0.259260),\nvec2(0.625000, 0.407408),\nvec2(-0.625000, -0.703704),\nvec2(0.375000, -0.037038),\nvec2(-0.125000, 0.629630),\nvec2(0.875000, -0.481482),\nvec2(-0.937500, 0.185186));\n\nvec2 vogelDiskSample(int sampleIndex, int sampleCount, float angle) {\n  const float goldenAngle = 2.399963f; // radians\n  float r = sqrt(float(sampleIndex) + 0.5f) / sqrt(float(sampleCount));\n  float theta = float(sampleIndex) * goldenAngle + angle;\n  float sine = sin(theta);\n  float cosine = cos(theta);\n  return vec2(cosine, sine) * r;\n}\n\n// Derived from the interleaved gradient function from Jimenez 2014 http:goo.gl/eomGso\nfloat getNoiseInterleavedGradient(vec2 screenPos) {\n    vec3 magic = vec3(0.06711056f, 0.00583715f, 52.9829189f);\n    return fract(magic.z * fract(dot(screenPos, magic.xy)));\n}\n\n"),this.buildShader("vertex",e),this.buildShader("fragment",t);for(let i=0;i<this.requires.uv.length;i++)if(this.requires.uv[i]){let e=i>0?i+1:"";this.addVaryCode("varying vec2 vUv"+e+";"),i>0&&this.addVertexParsCode("attribute vec2 uv"+e+";"),this.addVertexFinalCode("vUv"+e+" = uv"+e+";")}return this.requires.color[0]&&(this.addVaryCode("varying vec4 vColor;"),this.addVertexParsCode("attribute vec4 color;"),this.addVertexFinalCode("vColor = color;")),this.requires.color[1]&&(this.addVaryCode("varying vec4 vColor2;"),this.addVertexParsCode("attribute vec4 color2;"),this.addVertexFinalCode("vColor2 = color2;")),this.requires.position&&(this.addVaryCode("varying vec3 vPosition;"),this.addVertexFinalCode("vPosition = transformed;")),this.requires.worldPosition,this.requires.normal&&(this.addVaryCode("varying vec3 vObjectNormal;"),this.addVertexFinalCode("vObjectNormal = normal;")),this.requires.modelMatrix&&this.addFragmentParsCode("uniform mat4 modelMatrix;"),this.requires.viewMatrix&&this.addFragmentParsCode("uniform mat4 viewMatrix;"),this.requires.projectionMatrix&&this.addFragmentParsCode("uniform mat4 projectionMatrix;"),this.requires.worldNormal&&(this.addVaryCode("varying vec3 vWNormal;"),this.addVertexFinalCode("vWNormal = inverseTransformDirection( transformedNormal, viewMatrix ).xyz;")),this.requires.vWorldViewDir&&(this.addVaryCode("varying vec3 vWorldViewDir;"),this.addVertexFinalCode("vWorldViewDir = isPerspectiveMatrix( projectionMatrix ) ?  ( (modelMatrix * vec4(position, 1.0)).xyz - cameraPosition ) : vec3( -viewMatrix[0][2], -viewMatrix[1][2], -viewMatrix[2][2] );")),this.needsJitter&&(this.addVertexFinalCode("\n// TODO: This could be generated CPU side and passed to the shader every frame\nconst vec2 haltonSequence[16] = vec2[16](\nvec2( 0.000000,-0.333334),\nvec2(-0.500000, 0.333334),\nvec2( 0.500000,-0.777778),\nvec2(-0.750000,-0.111112),\nvec2( 0.250000, 0.555556),\nvec2(-0.250000,-0.555556),\nvec2( 0.750000, 0.111112),\nvec2(-0.875000, 0.777778),\nvec2(0.125000, -0.925926),\nvec2(-0.375000, -0.259260),\nvec2(0.625000, 0.407408),\nvec2(-0.625000, -0.703704),\nvec2(0.375000, -0.037038),\nvec2(-0.125000, 0.629630),\nvec2(0.875000, -0.481482),\nvec2(-0.937500, 0.185186));\n\n// TODO: Pass correct view size\nvec2 offset = haltonSequence[frameIndex];\noffset.x /= resolution.x;\noffset.y /= resolution.y;\n\nvec4 currentPosition = gl_Position;\nvec4 currentPositionJittered = currentPosition + (vec4(offset.x, offset.y, 0.0, 0.0) * currentPosition.w);\n\n// We want to calculate the velocity with unjittered positions\n// so that things that are not moving get a velocity = 0\nvCurrentPosition = currentPosition;\nvPreviousPosition = previousProjectionMatrix * previousModelViewMatrix * vec4(transformed, 1.0);\n#ifdef OUTLINE_COMPENSATION\nvPreviousPosition.xy += OUTLINE_COMPENSATION;\n#endif\ngl_Position = currentPositionJittered;\n\n"),this.addFragmentFinalCode("\nvec2 oldPos = vPreviousPosition.xy;\n    oldPos /= vPreviousPosition.w;\n    oldPos.xy = (oldPos.xy+1.)/2.0;\n\nvec2 newPos = vCurrentPosition.xy;\n    newPos /= vCurrentPosition.w;\n    newPos.xy = (newPos.xy+1.)/2.0;\n\nvec2 velocity = (newPos - oldPos);\n\n// Discard fully transparent pixels \nif (gl_FragColor.a <= 0.0) discard;\n\ngVelocity = vec4(velocity, 0.0, 1.0);\n")),this}buildShader(e,t){this.resultCode[e]=t.build(this.setShader(e),"v4")}setMaterial(e,t){return this.defines={},this}addFlow(e,t,i){return this.addSlot(e).addCache(t).addContext(i)}removeFlow(){return this.removeSlot().removeCache().removeContext()}addCache(e){return this.cache=null!==e&&void 0!==e?e:"",this.caches.push(this.cache),this}removeCache(){return this.caches.pop(),this.cache=this.caches[this.caches.length-1]||"",this}addContext(e){return this.context=Object.assign({},this.context,e),this.context.extra=this.context.extra||{},this.contexts.push(this.context),this}removeContext(){return this.contexts.pop(),this.context=this.contexts[this.contexts.length-1]||{},this}addSlot(e){return this.slot=e||"",this.slots.push(this.slot),this}removeSlot(){return this.slots.pop(),this.slot=this.slots[this.slots.length-1]||"",this}addFragmentVariable(e,t){void 0===this.fragmentVariables[e]&&(this.addFragmentCode("".concat(t," ").concat(e,";")),this.fragmentVariables[e]="")}addFragmentParsVariable(e,t){void 0===this.fragmentParsVariables[e]&&(this.addFragmentParsCode("".concat(t," ").concat(e,";")),this.fragmentParsVariables[e]="")}addVertexParsVariable(e,t){void 0===this.vertexParsVariables[e]&&(this.addVertexParsCode("".concat(t," ").concat(e,";")),this.vertexParsVariables[e]="")}addVertexCode(e){this.addCode(e,"vertex")}addFragmentCode(e){this.addCode(e,"fragment")}addCode(e,t){this.code[null!==t&&void 0!==t?t:this.shader]+=e+"\n"}addVertexNodeCode(e){this.addNodeCode(e,"vertex")}addFragmentNodeCode(e){this.addNodeCode(e,"fragment")}addNodeCode(e,t){this.nodeCode[null!==t&&void 0!==t?t:this.shader]+=e+"\n"}clearNodeCode(e){var t;e=null!==(t=e)&&void 0!==t?t:this.shader;let i=this.nodeCode[e];return this.nodeCode[e]="",i}clearVertexNodeCode(){return this.clearNodeCode("vertex")}clearFragmentNodeCode(){return this.clearNodeCode("fragment")}addVertexFinalCode(e){this.addFinalCode(e,"vertex")}addFragmentFinalCode(e){this.addFinalCode(e,"fragment")}addFinalCode(e,t){this.finalCode[null!==t&&void 0!==t?t:this.shader]+=e+"\n"}addVertexParsCode(e){this.addParsCode(e,"vertex")}addFragmentParsCode(e){this.addParsCode(e,"fragment")}addParsCode(e,t){this.parsCode[null!==t&&void 0!==t?t:this.shader]+=e+"\n"}addVaryCode(e){this.addVertexParsCode(e),this.addFragmentParsCode(e)}isCache(e){return-1!==this.caches.indexOf(e)}isSlot(e){return-1!==this.slots.indexOf(e)}define(e,t){this.defines[e]=void 0===t?1:t}require(e){this.requires[e]=!0}isDefined(e){return void 0!==this.defines[e]}getVar(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"varying",r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"V",a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",s=this.getVars(n),o=s[e];if(!o){let n=s.length;o={name:i||"node"+r+n+(a?"_"+a:""),type:t},s.push(o),s[e]=o}return o}getTempVar(e,t,i,n){return this.getVar(e,t,i,this.shader,"T",n)}getAttribute(e,t){if(!this.attributes[e]){let i=this.getVar(e,t);this.addVertexParsCode("attribute "+t+" "+e+";"),this.addVertexFinalCode(i.name+" = "+e+";"),this.attributes[e]={varying:i,name:e,type:t}}return this.attributes[e]}getCode(e){return[this.prefixCode,this.parsCode[e],this.getVarListCode(this.getVars("varying"),"varying"),this.getVarListCode(this.inputs.uniforms[e],"uniform"),this.getVarListCode(this.inputs.arrayUniforms[e],"uniform"),this.getIncludesCode("consts",e),this.getIncludesCode("structs",e),this.getIncludesCode("functions",e),"void main() {",this.getVarListCode(this.getVars(e)),this.code[e],this.resultCode[e],this.finalCode[e],"}"].join("\n")}getVarListCode(e,t){var i;t=null!==(i=t)&&void 0!==i?i:"";let n="";for(let r=0,a=e.length;r<a;++r){let i=e[r],a=i.type,s=i.name,o=i.size,l=this.getFormatByType(a);if(void 0===l)throw new Error("Node pars "+l+" not found.");l.includes("[]")?n+=t+" "+l.substring(0,l.length-2)+" "+s+"[".concat(o,"];\n"):n+=t+" "+l+" "+s+";\n"}return n}getVars(e){return this.inputs.vars[null!==e&&void 0!==e?e:this.shader]}getNodeData(e){let t=e instanceof bK?e.uuid:e;return this.nodeData[t]=this.nodeData[t]||{}}createUniform(e,t,i,n,r,a){if(t.includes("[]")){let s=this.inputs.arrayUniforms,o=s.list.length,l=new yK({type:t,size:i.size,name:n||"nodeUA"+o+(a?"_"+a:""),node:i,needsUpdate:r});return s.list.push(l),s[e].push(l),s[e][l.name]=l,this.uniforms[l.name]=l,l}{let s=this.inputs.uniforms,o=s.list.length,l=new yK({type:t,name:n||"nodeU"+o+(a?"_"+a:""),node:i,needsUpdate:r});return s.list.push(l),s[e].push(l),s[e][l.name]=l,this.uniforms[l.name]=l,l}}createVertexUniform(e,t,i,n,r){return this.createUniform("vertex",e,t,i,n,r)}createFragmentUniform(e,t,i,n,r){return this.createUniform("fragment",e,t,i,n,r)}include(e,t,i){let n;if(e="string"==typeof e?xK.get(e):e,!1===this.context.include)return e.name;e instanceof PK?n=this.includes.functions:e instanceof OK?n=this.includes.consts:e instanceof LK&&(n=this.includes.structs);let r=n[this.shader]=n[this.shader]||[];if(e){var a;let n=r[e.name];if(n||(n=r[e.name]={node:e,deps:[]},r.push(n),n.src=e.build(this,"source")),e instanceof PK&&t&&r[t.name]&&-1===r[t.name].deps.indexOf(e)&&(r[t.name].deps.push(e),null!==(a=e.includes)&&void 0!==a&&a.length)){let i=0;do{this.include(e.includes[i++],t)}while(i<e.includes.length)}return i&&(n.src=i),e.name}throw new Error("Include not found.")}colorToVectorProperties(e){return e.replace("r","x").replace("g","y").replace("b","z").replace("a","w")}colorToVector(e){return e.replace(/c/g,"v3")}getIncludes(e,t){return this.includes[e][t||this.shader]}getConstructorFromLength(e){return rJ[e-1]}isTypeMatrix(e){return/^m/.test(e)}getTypeLength(e){return"f"===e?1:parseInt(this.colorToVector(e).substr(1))}getTypeFromLength(e){return 1===e?"f":"v"+e}findNode(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];for(let n=0;n<arguments.length;n++){let e=t[n];if(null!==e&&void 0!==e&&e.isNode)return e}}resolve(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];for(let n=0;n<arguments.length;n++){let e=t[n];if(void 0!==e){if(e.isNode)return e;if(e.isTexture)switch(e.mapping){case vE:case yE:return new iJ(e);case wE:return new tJ(new jK(e));default:return new jK(e)}else{if(e.isVector2)return new SK(e);if(e.isVector3)return new EK(e);if(e.isVector4)return new AK(e)}}}}format(e,t,i){switch(this.colorToVector(i+" <- "+t)){case"f <- v2":case"f <- v3":case"f <- v4":return e+".x";case"f <- i":case"f <- b":return"float( "+e+" )";case"v2 <- f":return"vec2( "+e+" )";case"v2 <- v3":case"v2 <- v4":return e+".xy";case"v2 <- i":case"v2 <- b":case"v3 <- i":case"v3 <- b":return"vec2( float( "+e+" ) )";case"v3 <- f":return"vec3( "+e+" )";case"v3 <- v2":return"vec3( "+e+", 0.0 )";case"v3 <- v4":return e+".xyz";case"v4 <- f":return"vec4( "+e+" )";case"v4 <- v2":return"vec4( "+e+", 0.0, 1.0 )";case"v4 <- v3":return"vec4( "+e+", 1.0 )";case"v4 <- i":case"v4 <- b":return"vec4( float( "+e+" ) )";case"i <- f":case"i <- b":return"int( "+e+" )";case"i <- v2":case"i <- v3":case"i <- v4":return"int( "+e+".x )";case"b <- f":return"( "+e+" != 0.0 )";case"b <- v2":return"( "+e+" != vec2( 0.0 ) )";case"b <- v3":return"( "+e+" != vec3( 0.0 ) )";case"b <- v4":return"( "+e+" != vec4( 0.0 ) )";case"b <- i":return"( "+e+" != 0 )"}return e}getTypeByFormat(e){return aJ[e]||e}getFormatByType(e){return sJ[e]||e}getUUID(e,t){return(t=void 0===t||t)&&this.cache&&(e=this.cache+"-"+e),e}getElementByIndex(e){return nJ[e]}getIndexByElement(e){return nJ.indexOf(e)}isShader(e){return this.shader===e}setShader(e){return this.shader=e,this}mergeDefines(e){for(let t in e)this.defines[t]=e[t];return this.defines}mergeUniform(e){for(let t in e)this.uniforms[t]=e[t];return this.uniforms}getTextureEncodingFromMap(e){let t;return e?e.isTexture&&(t=e.encoding):t=zC,t===zC&&this.context.gamma&&(t=NC),t}},lJ=class extends _K{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;super("c"),this.nodeType="Color",this.value=e instanceof CK?e:new CK(e||0,t,i,n)}setRGBA(e){this.value.setRGBA(e.r,e.g,e.b,e.a)}generate(e,t,i,n,r,a){var s,o;i=e.getUUID(null!==(s=i)&&void 0!==s?s:this.getUUID()),n=null!==(o=n)&&void 0!==o?o:this.getType(e);let l=e.getNodeData(i),c=this.getReadonly()&&void 0!==this.generateReadonly;if(this.alpha){let t=this.alpha.build(e,"f");e.addFragmentNodeCode("accumAlpha += ( 1.0 - accumAlpha ) * ".concat(t,";"))}return c?this.generateReadonly(e,t,i,n,r,a):e.isShader("vertex")?(l.vertex||(l.vertex=e.createVertexUniform(n,this,r,a,this.getLabel())),e.format(l.vertex.name,n,t)):(l.fragment||(l.fragment=e.createFragmentUniform(n,this,r,a,this.getLabel())),e.format(l.fragment.name,n,t))}generateReadonly(e,t,i,n,r,a){return e.format("vec3("+this.value.r+", "+this.value.g+", "+this.value.b+")",n,t)}},cJ=class extends _K{constructor(e){super("i"),this.nodeType="Int",this.value=Math.floor(null!==e&&void 0!==e?e:0)}generateReadonly(e,t,i,n,r,a){return e.format(this.value.toString(),n,t)}},hJ=class extends _K{constructor(e){super("b"),this.nodeType="Bool",this.value=null!==e&&void 0!==e&&e}generateReadonly(e,t,i,n){return e.format(this.value?"true":"false",n,t)}},uJ=class extends _K{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0;super("f[]"),this.nodeType="FloatArray",this.size=e,this.value=Array.isArray(t)?t:"number"==typeof t?new Array(e).fill(t):new Array(e).fill(0)}},dJ=class extends _K{},pJ=class extends dJ{constructor(e){super("v3"),this.image=e,this._value=new FA}get value(){var e,t;return this._value.x=this.image.isVideo?null!==(e=this.image.img.videoWidth)&&void 0!==e?e:0:this.image.img.width,this._value.y=this.image.isVideo?null!==(t=this.image.img.videoHeight)&&void 0!==t?t:0:this.image.img.height,this._value}},fJ=class extends dJ{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1008;super("t"),this.image=e,this.wrap=t,this.minFilter=i}get value(){return this.image.getTexture(this.wrap,this.minFilter)}},mJ=class extends _K{constructor(e){super("m3"),this.nodeType="Matrix3",this.value=null!==e&&void 0!==e?e:new uA}generateReadonly(e,t,i,n,r,a){return e.format("mat3("+this.value.elements.join(", ")+")",n,t)}get elements(){return this.value.elements}set elements(e){this.value.fromArray(e)}},gJ=class extends _K{constructor(e){super("m4"),this.nodeType="Matrix4",this.value=null!==e&&void 0!==e?e:new mM}generateReadonly(e,t,i,n,r,a){return e.format("mat4("+this.value.elements.join(", ")+")",n,t)}get elements(){return this.value.elements}set elements(e){this.value.fromArray(e)}};function vJ(e,t,i){e.setUvTransform(i[0],i[1],t[0],t[1],0,0,0)}var yJ=class extends mJ{constructor(e,t){super(new uA),this.repeat=e,this.offset=t,vJ(this.value,e,t)}updateMatrix(){vJ(this.value,this.repeat,this.offset)}},bJ=class extends _K{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0;super("v4[]"),this.nodeType="Vector4Array",this.size=e,this.value=Array.isArray(t)?t:t instanceof RA?new Array(e).fill(t):new Array(e).fill(new RA(0))}},xJ=class extends wK{constructor(e,t,i,n){super("v3"),this.nodeType="Blend",this.a=e,this.b=t,this.alpha=i,this.mode=n}generate(e,t){if(e.isShader("fragment")){let i=[];return i.push(this.a.build(e,"c")),i.push(this.b.build(e,"c")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),e.format("spe_blend("+i.join(",")+")",this.getType(e),t)}return console.warn("BlendNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}},wJ=class extends wK{constructor(e,t){super("v3"),this.nodeType="CustomColor",this.color=e,this.alpha=t,this.calpha="g".concat(this.uuid.toString().replace(/-/g,""),"_calpha")}generate(e,t){if(e.isShader("fragment")){let i=e.include(wJ.Nodes.customColor);e.addFragmentVariable(this.calpha,"float");let n=[];return n.push(this.color.build(e,"v3")),n.push(this.mask?"luminance(".concat(this.mask.build(e,"v3"),")"):"1.0"),n.push(this.alpha.build(e,"f")),n.push(this.calpha),e.format(i+"("+n.join(",")+")",this.getType(e),t)}return console.warn("CustomColorNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}},_J=wJ;_J.Nodes={customColor:new PK("vec3 customColor(vec3 color, float mask, float alpha, out float calpha) {\n\t\t\t\tfloat lalpha = alpha * mask;\n\t\t\t\tcalpha =  lalpha / clamp(lalpha + accumAlpha, 0.00001, 1.0);\n\t\t\t\taccumAlpha += (1.0 - accumAlpha) * lalpha;\n\n\t\t\t\treturn color;\n\t\t\t}")};var SJ=class extends wK{constructor(e,t){super("v3"),this.nodeType="CustomNormal",this.cnormal=e,this.alpha=t,this.calpha="g".concat(this.uuid.toString().replace(/-/g,""),"_calpha")}generate(e,t){if(e.isShader("fragment")){let i=e.include(SJ.Nodes.customNormal);e.addFragmentVariable(this.calpha,"float");let n=[];return n.push(this.cnormal.build(e,"v3")),n.push("normal"),n.push(this.mask?"luminance(".concat(this.mask.flow(e,"v3").result,")"):"1.0"),n.push(this.alpha.build(e,"f")),n.push(this.calpha),e.format(i+"("+n.join(",")+")",this.getType(e),t)}return console.warn("CustomNormalNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}},EJ=SJ;EJ.Nodes={customNormal:new PK("vec3 customNormal(vec3 cnormal, vec3 norm, float mask, float alpha, out float calpha) {\n\t\t\t\tvec3 normal = packNormalToRGB( norm ).rgb;\n\t\t\t\tnormal *= step( vec3(0.5), cnormal );\n\n\t\t\t\tfloat lalpha = alpha * mask;\n\t\t\t\tcalpha =  lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 );\n\t\t\t\taccumAlpha += ( 1.0 - accumAlpha ) * lalpha;\n\n\t\t\t\treturn normal;\n\t\t\t}")};var CJ=class extends wK{constructor(e,t,i,n,r,a,s,o,l,c,h,u){super("v3"),this.nodeType="CustomTexture",this.texture=e,this.textureSize=t,this.crop=i,this.projection=n,this.axis=r,this.side=a,this.size=s,this.blending=o,this.mat=l,this.isMask=u,this.alpha=c,this.mode=h,this.calpha="g".concat(this.uuid.toString().replace(/-/g,""),"_calpha")}generate(e,t){e.require("position"),e.require("normal"),e.require("uv"),e.requires.uv=[!0],e.extensions.shaderTextureLOD=!0,e.extensions.derivatives=!0;let i,n="g".concat(this.uuid.toString().replace(/-/g,""));switch(this.projection.value){case 3:i=e.include(CJ.Nodes.cylindrical);break;case 2:i=e.include(CJ.Nodes.spherical);break;case 1:let t=["vec3(1.0, 0.0, 0.0)","vec3(0.0, 1.0, 0.0)","vec3(0.0, 0.0, 1.0)"][this.axis.value],r=["zy","xz","xy"][this.axis.value],a=new PK("\n\t\tvec3 ".concat(n,"_planarTexture(vec3 normal, sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float blending, bool isMask, float mask, float alpha, int mode, out float calpha, out vec2 writeUv) {\n\t\t\t\tvec2 projected = (1. + (position.").concat(r,")) / 2.;\n\t\t\t\tvec2 uvs = ( mat * vec3( (projected * 2. - 1.) / (size * .5), 1. ) / 2. + 0.5 ).xy;\n\t\t\t\twriteUv = uvs;\n\n\t\t\t\tvec4 tmp = texture2D( tex, uvs );\n\n\t\t\t\tvec3 col = tmp.rgb;\n\t\t\t\tfloat lalpha = alpha * tmp.a;\n\t\t\t\t").concat(2===this.side.value?"":"lalpha *= step(0.0, ".concat(1===this.side.value?"-1.0 * ":"","dot(vObjectNormal, ").concat(t,"));"),"\n\n\t\t\t\tif ( crop > 0.5 ) {\n\t\t\t\t\tif ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 )  {\n\t\t\t\t\t\tlalpha = 0.0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tlalpha *= mask;\n\n\t\t\t\tcalpha =  lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 );\n\t\t\t\taccumAlpha += (1.0 - accumAlpha) * lalpha * (1.0 - float(isMask));\n\n\t\t\t\treturn col;\n\t\t\t}"));i=e.include(a);break;case 4:i=e.include(CJ.Nodes.triplanar);break;default:i=e.include(CJ.Nodes.uv)}e.addFragmentVariable(this.calpha,"float");let r=[];if(r.push("normal"),r.push(this.texture.generate(e,"t")),r.push(this.textureSize.build(e,"v2")),r.push(this.crop.build(e,"f")),r.push(this.mat.build(e,"mat3")),r.push(this.size.build(e,"v2")),r.push(this.blending.build(e,"f")),r.push(this.isMask.build(e,"b")),r.push(this.mask?"luminance(".concat(this.mask.flow(e,"v3").result,")"):"1.0"),r.push(this.alpha.build(e,"f")),r.push(this.mode.build(e,"i")),r.push(this.calpha),4===this.projection.value){let t="".concat(n,"_writeUvs"),i=t+"0",a=t+"1",s=t+"2",o="".concat(n,"_triplanarWeights");e.addFragmentVariable(i,"vec2"),e.addFragmentVariable(a,"vec2"),e.addFragmentVariable(s,"vec2"),e.addFragmentVariable(o,"vec3"),r.push(i),r.push(a),r.push(s),r.push(o)}else{let t="".concat(n,"_writeUvs");e.addFragmentVariable(t,"vec2"),r.push(t)}return e.format(i+"("+r.join(",")+")",this.getType(e),t)}},AJ=CJ;AJ.Nodes={cylindrical:new PK("\nvec3 cylindricalTexture(vec3 normal, sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float blending, bool isMask, float mask, float alpha, int mode, out float calpha, out vec2 writeUv) {\n                vec3 posN = normalize(position);\n                float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415);\n                float scaledHeight = position.y / (size.y * 0.5);\n                float v =  (scaledHeight / 2.) + .5;\n\n                vec2 calculatedUv = vec2(u,v);\n\t\t\t\tvec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy;\n\t\t\t\twriteUv = uvs;\n\n                vec2 df = fwidth(uvs);\n               \tif(df.x > 0.5) df.x = 0.;\n\n\t\t\t\t#ifdef GL_EXT_shader_texture_lod\n                vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y)));\n\t\t\t\t#else\n                vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y)));\n\t\t\t\t#endif\n\n\t\t\t\tvec3 col = tmp.rgb;\n\t\t\t\tfloat lalpha = alpha * tmp.a;\n\t\t\t\tif ( crop > 0.5 ) {\n\t\t\t\t\tif ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 )  {\n\t\t\t\t\t\tlalpha = 0.0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlalpha *= mask;\n\t\t\t\t\n\t\t\t\tcalpha =  lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 );\n\t\t\t\taccumAlpha += (1.0 - accumAlpha) * lalpha * (1.0 - float(isMask));\n\n\t\t\t\treturn col;\n\t\t\t}\n"),spherical:new PK("\nvec3 sphericalTexture(vec3 normal, sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float blending, bool isMask, float mask, float alpha, int mode, out float calpha, out vec2 writeUv) {\n                vec3 posN = normalize(vPosition);\n                float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415);\n                float v = 0.5 + asin(posN.y) / 3.1415;\n\n                vec2 calculatedUv = vec2(u,v);\n\t\t\t\tvec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy;\n\t\t\t\twriteUv = uvs;\n\n                vec2 df = fwidth(uvs);\n               \tif(df.x > 0.5) df.x = 0.;\n\t\t\t\t#ifdef GL_EXT_shader_texture_lod\n                vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y)));\n\t\t\t\t#else\n                vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y)));\n\t\t\t\t#endif\n\n\t\t\t\tvec3 col = tmp.rgb;\n\t\t\t\tfloat lalpha = alpha * tmp.a;\n\t\t\t\tif ( crop > 0.5 ) {\n\t\t\t\t\tif ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 )  {\n\t\t\t\t\t\tlalpha = 0.0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlalpha *= mask;\n\n\t\t\t\tcalpha =  lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 );\n\t\t\t\taccumAlpha += (1.0 - accumAlpha) * lalpha * (1.0 - float(isMask));\n\n\t\t\t\treturn col;\n\t\t\t}\n"),uv:new PK("vec3 uvTexture(vec3 normal, sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float blending, bool isMask, float mask, float alpha, int mode, out float calpha, out vec2 writeUv) {\n\t\t\t\tvec2 uvs = ( mat * vec3( vUv * 2. - 1., 1. ) / 2. + 0.5 ).xy;\n\t\t\t\twriteUv = uvs;\n\n\t\t\t\tvec4 tmp = texture2D( tex, uvs );\n\n\t\t\t\tvec3 col = tmp.rgb;\n\n\t\t\t\tfloat lalpha = alpha * tmp.a;\n\t\t\t\tif ( crop > 0.5 ) {\n\t\t\t\t\tif ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 )  {\n\t\t\t\t\t\tlalpha = 0.0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tlalpha *= mask;\n\n\t\t\t\tcalpha =  lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 );\n\t\t\t\taccumAlpha += (1.0 - accumAlpha) * lalpha * (1.0 - float(isMask));\n\n\t\t\t\treturn col;\n\t\t\t}"),triplanar:new PK("vec3 triplanarTexture(vec3 normal, sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float blending, bool isMask, float mask, float alpha, int mode, out float calpha, out vec2 writeUvs0, out vec2 writeUvs1, out vec2 writeUvs2, out vec3 writeWeights) {\n\t\t\t\tvec3 p = position;\n\t\t\t\tvec2 uv0 = (1.0 + p.xy) / 2.0;     \n\t\t\t\tvec2 uv1 = (1.0 + p.zy) / 2.0;\t\t\n\t\t\t\tvec2 uv2 = (1.0 + p.xz) / 2.0;\t\t\n\t\n\t\t\t\tuv0 = (mat * vec3((uv0 * 2.0 - 1.0) / (size * 0.5), 1.0) / 2.0 + 0.5).xy;\n\t\t\t\tuv1 = (mat * vec3((uv1 * 2.0 - 1.0) / (size * 0.5), 1.0) / 2.0 + 0.5).xy;\n\t\t\t\tuv2 = (mat * vec3((uv2 * 2.0 - 1.0) / (size * 0.5), 1.0) / 2.0 + 0.5).xy;\n\n\t\t\t\t// Range from 3 to 128 seems to be good\n\t\t\t\tfloat exponent = (1.0 - blending) * 125.0 + 3.0;\n\n\t\t\t\tvec3 n = vObjectNormal;\n\t\t\t\tvec3 weights = abs(normalize(n));\n\t\t\t\tweights = pow(weights, vec3(exponent));\n\t\t\t\tweights /= dot(weights, vec3(1.0));\n\n\t\t\t\t// Write out all sets of UVs that we generated\n\t\t\t\twriteUvs0 = uv0;\n\t\t\t\twriteUvs1 = uv1;\n\t\t\t\twriteUvs2 = uv2;\n\t\t\t\twriteWeights = weights;\n\n\t\t\t\t// Derivatives for LOD\n\t\t\t\tvec2 df0 = fwidth(uv0);\n\t\t\t\tvec2 df1 = fwidth(uv1);\n\t\t\t\tvec2 df2 = fwidth(uv2);\n\t\t\t\tif (df0.x > 0.5) df0.x = 0.0;\n\t\t\t\tif (df1.x > 0.5) df1.x = 0.0;\n\t\t\t\tif (df2.x > 0.5) df2.x = 0.0;\n\n\t\t\t\t#ifdef GL_EXT_shader_texture_lod\n                \tvec4 tmp = \n\t\t\t\t\t\ttexture2DLodEXT(tex, uv0, log2(max(df0.x, df0.y)*min(textureSize.x, textureSize.y))) * weights.z + \n\t\t\t\t\t\ttexture2DLodEXT(tex, uv1, log2(max(df1.x, df1.y)*min(textureSize.x, textureSize.y))) * weights.x + \n\t\t\t\t\t\ttexture2DLodEXT(tex, uv2, log2(max(df2.x, df2.y)*min(textureSize.x, textureSize.y))) * weights.y;\n\t\t\t\t#else\n                \tvec4 tmp = \n\t\t\t\t\t\ttextureLod(tex, uv0, log2(max(df0.x, df0.y)*min(textureSize.x, textureSize.y))) * weights.z + \n\t\t\t\t\t\ttextureLod(tex, uv1, log2(max(df1.x, df1.y)*min(textureSize.x, textureSize.y))) * weights.x + \n\t\t\t\t\t\ttextureLod(tex, uv2, log2(max(df2.x, df2.y)*min(textureSize.x, textureSize.y))) * weights.y;\n\t\t\t\t#endif\n\n\t\t\t\tvec3 col = tmp.rgb;\n\t\t\t\tfloat lalpha = alpha * tmp.a;\n\n\t\t\t\t// Apply cropping across all 3 planes\n\t\t\t\tif ( crop > 0.5 ) {\n\t\t\t\t\tif ( uv0.x < 0.0 || uv0.x > 1.0 || uv0.y < 0.0 || uv0.y > 1.0 )  {\n\t\t\t\t\t\tlalpha = 0.0;\n\t\t\t\t\t}\n\t\t\t\t\tif ( uv1.x < 0.0 || uv1.x > 1.0 || uv1.y < 0.0 || uv1.y > 1.0 )  {\n\t\t\t\t\t\tlalpha = 0.0;\n\t\t\t\t\t}\n\t\t\t\t\tif ( uv2.x < 0.0 || uv2.x > 1.0 || uv2.y < 0.0 || uv2.y > 1.0 )  {\n\t\t\t\t\t\tlalpha = 0.0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlalpha *= mask;\n\t\t\t\tcalpha =  lalpha / clamp(lalpha + accumAlpha, 0.00001, 1.0);\n\t\t\t\taccumAlpha += (1.0 - accumAlpha) * lalpha * (1.0 - float(isMask));\n\n\t\t\t\treturn col;//n * 0.5 + 0.5;\n\t\t\t}\t\t\t\n\t\t\t")};var MJ=class extends wK{constructor(e,t,i,n,r,a,s,o,l,c,h,u){super("v3"),this.nodeType="Depth",this.gradientType=e,this.smooth=t,this.near=i,this.far=n,this.isVector=r,this.isWorldSpace=a,this.origin=s,this.direction=o,this.colors=l,this.steps=c,this.isMask=u,this.alpha=h,this.calpha="g".concat(this.uuid.toString().replace(/-/g,""),"_calpha")}generate(e,t){let i="g".concat(this.uuid.toString().replace(/-/g,"")),n=new PK("vec3 ".concat(i,"_sdepth(float near, float far, vec3 origin, vec3 direction, vec4 colors[").concat(i,"_MAX_COLORS], float steps[").concat(i,"_MAX_COLORS], bool isMask, float mask, float alpha, out float calpha) {\n               vec4 color = colors[0];\n               #ifdef ").concat(i,"_IS_VECTOR\n                   #ifdef ").concat(i,"_LINEAR\n                       #ifdef ").concat(i,"_WORLDSPACE\n                       float depth = vectorLinearWorldSpaceDepth(direction, origin, near, far);\n                       #else\n                       float depth = vectorLinearObjectSpaceDepth(direction, origin, near, far);\n                       #endif\n                   #else\n                       #ifdef ").concat(i,"_WORLDSPACE\n                           float depth = vectorSphericalWorldSpaceDepth(origin, near, far);\n                       #else\n                           float depth = vectorSphericalObjectSpaceDepth(origin, near, far);\n                       #endif\n                   #endif\n               #else\n                   float dist = length(vWPosition - cameraPosition);\n\t\t\t       float depth = ( dist - near ) / ( far - near );\n               #endif\n\n\n              float p;\n              #ifdef ").concat(i,"_SMOOTH\n\t\t\t\tfor ( int i = 1; i < ").concat(i,"_MAX_COLORS; i++ ) {\n\t\t\t\t\t\tp = clamp( ( depth - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 );\n\t\t\t\t\t\tcolor = mix(color, colors[i], smoothstep(0.0, 1.0, p));\n\t\t\t\t\t}\n              #else\n                for ( int i = 1; i < ").concat(i,"_MAX_COLORS; i++ ) {\n                   p = clamp(( depth - steps[i - 1] ) / ( steps[i] - steps[i - 1] ), 0.0, 1.0);\n                   color = mix(color, colors[i], p);\n                 }\n              #endif\n\n               float lalpha = alpha * color.a * mask;\n               calpha = mix(lalpha / clamp(lalpha + accumAlpha, 0.00001, 1.0), lalpha, float(isMask));\n\t\t\t   accumAlpha += (1.0 - accumAlpha) * lalpha * (1.0 - float(isMask));\n\t\t\t   \n               return color.rgb;\n\t\t\t}"),[MJ.Nodes.vectorLinearWorldSpaceDepth,MJ.Nodes.vectorLinearObjectSpaceDepth,MJ.Nodes.vectorSphericalObjectSpaceDepth,MJ.Nodes.vectorSphericalWorldSpaceDepth]);if(e.isShader("fragment")){e.define("".concat(i,"_MAX_COLORS"),this.colors.value.length),this.smooth.value&&e.define("".concat(i,"_SMOOTH")),this.isVector.value>.5&&e.define("".concat(i,"_IS_VECTOR")),0===this.gradientType.value&&e.define("".concat(i,"_LINEAR")),this.isWorldSpace.value>.5&&e.define("".concat(i,"_WORLDSPACE")),e.require("worldPosition"),e.addFragmentVariable(this.calpha,"float");let r=e.include(n),a=[];return a.push(this.near.build(e,"f")),a.push(this.far.build(e,"f")),a.push(this.origin.build(e,"v3")),a.push(this.direction.build(e,"v3")),a.push(this.colors.build(e,"v4[]")),a.push(this.steps.build(e,"f[]")),a.push(this.isMask.build(e,"b")),a.push(this.mask?"luminance(".concat(this.mask.flow(e,"v3").result,")"):"1.0"),a.push(this.alpha.build(e,"f")),a.push(this.calpha),e.format(r+"("+a.join(",")+")",this.getType(e),t)}return console.warn("DepthNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}},TJ=MJ;TJ.Nodes={vectorLinearWorldSpaceDepth:new PK("float vectorLinearWorldSpaceDepth(vec3 direction, vec3 origin, float near, float far) {\n               vec3 n = normalize(direction);\n               float dist = (n.x*(vWPosition.x - origin.x) + n.y*(vWPosition.y - origin.y) + n.z*(vWPosition.z - origin.z));\n               return ( dist - near ) / ( far - near );\n            }"),vectorLinearObjectSpaceDepth:new PK("float vectorLinearObjectSpaceDepth(vec3 direction, vec3 origin, float near, float far) {\n               vec3 n = normalize(direction);\n               float dist = (n.x*(position.x - origin.x) + n.y*(position.y - origin.y) + n.z*(position.z - origin.z));\n               return ( dist - near ) / ( far - near );\n            }"),vectorSphericalWorldSpaceDepth:new PK("float vectorSphericalWorldSpaceDepth(vec3 origin, float near, float far) {\n               float dist = length(vWPosition - origin);\n               return ( dist - near ) / ( far - near );\n            }"),vectorSphericalObjectSpaceDepth:new PK("float vectorSphericalObjectSpaceDepth(vec3 origin, float near, float far) {\n               float dist = length(position - origin);\n               return ( dist - near ) / ( far - near );\n            }")};var PJ=class extends wK{constructor(e,t,i,n,r,a,s,o){super("v3"),this.nodeType="Fresnel",this.color=e,this.bias=t,this.scale=i,this.intensity=n,this.factor=r,this.isMask=o,this.alpha=a,this.mode=s,this.calpha="g".concat(this.uuid.toString().replace(/-/g,""),"_calpha")}generate(e,t){if(e.require("vWorldViewDir"),e.require("worldNormal"),e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let i=new PK("vec3 fresnel(vec3 color, float bias, float scale, float intensity, float factor, bool isMask, float mask, float alpha, int mode, out float calpha) {\n\t\t\t\t\tfloat fresnel = bias + scale * pow( abs( factor + dot( normalize( vWorldViewDir ), normalize( vWNormal ) ) ), intensity );\n\n\t\t\t\t\tfloat lalpha = clamp(fresnel, 0.0, 1.0) * alpha * mask;\n\t\t\t\t\tcalpha = mix(lalpha / clamp(lalpha + accumAlpha, 0.00001, 1.0), lalpha, float(isMask));\n\t\t\t\t\taccumAlpha += (1.0 - accumAlpha) * lalpha * (1.0 - float(isMask));\n\n\t\t\t\t\treturn color;\n\t\t\t\t}"),n=e.include(i),r=[];return r.push(this.color.build(e,"c")),r.push(this.bias.build(e,"f")),r.push(this.scale.build(e,"f")),r.push(this.intensity.build(e,"f")),r.push(this.factor.build(e,"f")),r.push(this.isMask.build(e,"b")),r.push(this.mask?"luminance(".concat(this.mask.flow(e,"v3").result,")"):"1.0"),r.push(this.alpha.build(e,"f")),r.push(this.mode.build(e,"i")),r.push(this.calpha),e.format(n+"("+r.join(",")+")",this.getType(e),t)}return console.warn("FresnelNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}},DJ=class extends wK{constructor(e,t,i,n,r,a,s,o,l){super("v3"),this.nodeType="Gradient",this.gradientType=e,this.smooth=t,this.colors=i,this.steps=n,this.offset=r,this.morph=a,this.angle=s,this.isMask=l,this.alpha=o,this.calpha="g".concat(this.uuid.toString().replace(/-/g,""),"_calpha")}generate(e,t){if(e.isShader("fragment")){e.define("GRAD_MAX",10),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let i=e.include(DJ.Nodes.gradient),n=[];return n.push(this.gradientType.build(e,"i")),n.push(this.smooth.build(e,"b")),n.push(this.colors.build(e,"v4[]")),n.push(this.steps.build(e,"f[]")),n.push(this.offset.build(e,"v2")),n.push(this.morph.build(e,"v2")),n.push(this.angle.build(e,"f")),n.push(this.isMask.build(e,"b")),n.push(this.mask?"luminance(".concat(this.mask.flow(e,"v3").result,")"):"1.0"),n.push(this.alpha.build(e,"f")),n.push(this.calpha),e.format(i+"("+n.join(",")+")",this.getType(e),t)}return console.warn("GradientNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}},kJ=DJ;kJ.Nodes={gradient:new PK("vec3 gradient(int gradientType, bool smoothed, vec4 colors[GRAD_MAX], float steps[GRAD_MAX], vec2 offset, vec2 morph, float angle, bool isMask, float mask, float alpha, out float calpha) {\n\t\t\t\tvec4 color = colors[0];\n\t\t\t\tvec2 m = morph / vUv.xy;\n\t\t\t\tvec2 rot = vec2( 0.5 + m.x, m.y );\n\t\t\t\tvec2 dt = vec2(\n\t\t\t\t\tcos( angle ) * rot.x - sin( angle ) * rot.y,\n\t\t\t\t\tsin( angle ) * rot.x + cos( angle ) * rot.y\n\t\t\t\t);\n\t\t\t\tvec2 pt = ( vUv - 0.5 + offset ) / 2.0 + dt / 2.0;\n\t\t\t\tfloat t = dot( pt, dt ) / dot( dt, dt );\n\t\t\t\tif ( gradientType == 1 ) {\n\t\t\t\t\tt = distance (\n\t\t\t\t\t\t( vUv + morph ) * 3.0,\n\t\t\t\t\t\t( vUv + offset ) + 1.0\n\t\t\t\t\t) + angle;\n\t\t\t\t} else if ( gradientType == 2 ) {\n\t\t\t\t\tfloat polar = atan(\n\t\t\t\t\t\tvUv.x + morph.x - 0.5 + offset.x,\n\t\t\t\t\t\tvUv.y + morph.y - 0.5 + offset.y\n\t\t\t\t\t) * -1.0;\n\t\t\t\t\tt = fract( ( angle / PI / -2.0 ) + 0.5 * ( polar / PI ) );\n\t\t\t\t}\n\n\t\t\t\tfloat p;\n\t\t\t\tif (smoothed) {\n\t\t\t\t\tfor ( int i = 1; i < GRAD_MAX; i++ ) {\n\t\t\t\t\t\tp = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 );\n\t\t\t\t\t\tcolor = mix(color, colors[i], smoothstep(0.0, 1.0, p));\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tfor ( int i = 1; i < GRAD_MAX; i++ ) {\n\t\t\t\t\t\tp = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 );\n\t\t\t\t\t\tcolor = mix(color, colors[i], p);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfloat lalpha = alpha * color.a * mask;\n\t\t\t\tcalpha = mix(lalpha / clamp(lalpha + accumAlpha, 0.00001, 1.0), lalpha, float(isMask));\n\t\t\t\taccumAlpha += (1.0 - accumAlpha) * lalpha * (1.0 - float(isMask));\n\t\t\t\t\n\t\t\t\treturn color.xyz;\n\t\t\t}")};var OJ=class extends wK{constructor(e,t,i,n){super("v3"),this.nodeType="Matcap",this.texture=e,this.isMask=n,this.alpha=t,this.mode=i,this.calpha="g".concat(this.uuid.toString().replace(/-/g,""),"_calpha")}generate(e,t){if(e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let i=e.include(OJ.Nodes.matcap);e.require("normal"),e.requires.normal=!0;let n=[];return n.push(this.texture.generate(e,"t")),n.push("normal"),n.push(this.isMask.build(e,"b")),n.push(this.mask?"luminance(".concat(this.mask.flow(e,"v3").result,")"):"1.0"),n.push(this.alpha.build(e,"f")),n.push(this.mode.build(e,"i")),n.push(this.calpha),e.format(i+"("+n.join(",")+")",this.getType(e),t)}return console.warn("MatcapNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}},IJ=OJ;IJ.Nodes={matcap:new PK("vec3 matcap(sampler2D matcapTex, vec3 normal, bool isMask, float mask, float alpha, int mode, out float calpha) {\n\t\t\t\t\tvec3 viewDir = normalize( vViewPosition );\n\t\t\t\t\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\t\t\t\t\tvec3 y = cross( viewDir, x );\n\t\t\t\t\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; // 0.495 to remove artifacts caused by undersized matcap disks\n\t\t\t\t\tvec4 matcapColor = texture2D( matcapTex, uv );\n\n\t\t\t\t\tfloat lalpha = alpha * mask;\n\t\t\t\t\tcalpha = mix(lalpha / clamp(lalpha + accumAlpha, 0.00001, 1.0), lalpha, float(isMask));\n\t\t\t\t\taccumAlpha += (1.0 - accumAlpha) * lalpha * (1.0 - float(isMask));\n\t\t\t\t\t\n\t\t\t\t\treturn matcapColor.rgb;\n            \t}")};var RJ=(e=>(e.SIMPLEX="simplex3d",e.SIMPLEX_FRACTAL="simplex3dFractal",e.ASHIMA="simplexAshima",e.FBM="fbm",e.PERLIN="perlin",e.VORONOI="voronoi",e))(RJ||{}),LJ=function(){let e=new PK("vec3 random3(vec3 c) {\n\t\t\tfloat j = 4096.0*sin(dot(c,vec3(17.0, 59.4, 15.0)));\n\t\t\tvec3 r;\n\t\t\tr.z = fract(512.0*j);\n\t\t\tj *= .125;\n\t\t\tr.x = fract(512.0*j);\n\t\t\tj *= .125;\n\t\t\tr.y = fract(512.0*j);\n\t\t\treturn r-0.5;\n\t\t}"),t=new PK("float simplex3d(vec3 p) {\n\t\t\t vec3 s = floor(p + dot(p, vec3(F3)));\n\t\t\t vec3 x = p - s + dot(s, vec3(G3));\n\t\t\t \n\t\t\t vec3 e = step(vec3(0.0), x - x.yzx);\n\t\t\t vec3 i1 = e*(1.0 - e.zxy);\n\t\t\t vec3 i2 = 1.0 - e.zxy*(1.0 - e);\n\t\t\t\t\n\t\t\t vec3 x1 = x - i1 + G3;\n\t\t\t vec3 x2 = x - i2 + 2.0*G3;\n\t\t\t vec3 x3 = x - 1.0 + 3.0*G3;\n\t\t\t \n\t\t\t vec4 w, d;\n\t\t\t \n\t\t\t w.x = dot(x, x);\n\t\t\t w.y = dot(x1, x1);\n\t\t\t w.z = dot(x2, x2);\n\t\t\t w.w = dot(x3, x3);\n\t\t\t \n\t\t\t w = max(0.6 - w, 0.0);\n\t\t\t \n\t\t\t d.x = dot(random3(s), x);\n\t\t\t d.y = dot(random3(s + i1), x1);\n\t\t\t d.z = dot(random3(s + i2), x2);\n\t\t\t d.w = dot(random3(s + 1.0), x3);\n\t\t\t \n\t\t\t w *= w;\n\t\t\t w *= w;\n\t\t\t d *= w;\n\t\t\t \n\t\t\t return dot(d, vec4(52.0));\n\t\t}",[e]);t.keywords.F3=new OK("float F3 0.3333333"),t.keywords.G3=new OK("float G3 0.1666667");let i=new PK("float simplex3dFractal(vec3 m) {\n\t\t\tmat3 rot1 = mat3(-0.37, 0.36, 0.85,-0.14,-0.93, 0.34,0.92, 0.01,0.4);\n\t\t\tmat3 rot2 = mat3(-0.55,-0.39, 0.74, 0.33,-0.91,-0.24,0.77, 0.12,0.63);\n\t\t\tmat3 rot3 = mat3(-0.71, 0.52,-0.47,-0.08,-0.72,-0.68,-0.7,-0.45,0.56);\n\t\t\treturn 0.5333333 * simplex3d(m * rot1)\n\t\t\t\t + 0.2666667 * simplex3d(2.0 * m * rot2)\n\t\t\t\t + 0.1333333 * simplex3d(4.0 * m * rot3)\n\t\t\t\t + 0.0666667 * simplex3d(8.0 * m);\n\t\t}",[t]),n=new PK("vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}"),r=new PK("vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}"),a=new PK("float simplexAshima(vec3 v) {\n\t\t  const vec2  C = vec2(1.0/6.0, 1.0/3.0) ;\n\t\t  const vec4  D = vec4(0.0, 0.5, 1.0, 2.0);\n\t\t  vec3 i  = floor(v + dot(v, C.yyy) );\n\t\t  vec3 x0 =   v - i + dot(i, C.xxx) ;\n\t\t  vec3 g = step(x0.yzx, x0.xyz);\n\t\t  vec3 l = 1.0 - g;\n\t\t  vec3 i1 = min( g.xyz, l.zxy );\n\t\t  vec3 i2 = max( g.xyz, l.zxy );\n\t\t  vec3 x1 = x0 - i1 + 1.0 * C.xxx;\n\t\t  vec3 x2 = x0 - i2 + 2.0 * C.xxx;\n\t\t  vec3 x3 = x0 - 1. + 3.0 * C.xxx;\n\t\t  i = mod(i, 289.0 ); \n\t\t  vec4 p = permute( permute( permute( \n\t\t\t\t\t i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n\t\t\t\t   + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) \n\t\t\t\t   + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\t\t  float n_ = 1.0/7.0; // N=7\n\t\t  vec3  ns = n_ * D.wyz - D.xzx;\n\t\t  vec4 j = p - 49.0 * floor(p * ns.z *ns.z);  //  mod(p,N*N)\n\t\t  vec4 x_ = floor(j * ns.z);\n\t\t  vec4 y_ = floor(j - 7.0 * x_ );    // mod(j,N)\n\t\t  vec4 x = x_ *ns.x + ns.yyyy;\n\t\t  vec4 y = y_ *ns.x + ns.yyyy;\n\t\t  vec4 h = 1.0 - abs(x) - abs(y);\n\t\t  vec4 b0 = vec4( x.xy, y.xy );\n\t\t  vec4 b1 = vec4( x.zw, y.zw );\n\t\t  vec4 s0 = floor(b0)*2.0 + 1.0;\n\t\t  vec4 s1 = floor(b1)*2.0 + 1.0;\n\t\t  vec4 sh = -step(h, vec4(0.0));\n\t\t  vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n\t\t  vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\t\t  vec3 p0 = vec3(a0.xy,h.x);\n\t\t  vec3 p1 = vec3(a0.zw,h.y);\n\t\t  vec3 p2 = vec3(a1.xy,h.z);\n\t\t  vec3 p3 = vec3(a1.zw,h.w);\n\t\t  vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n\t\t  p0 *= norm.x;\n\t\t  p1 *= norm.y;\n\t\t  p2 *= norm.z;\n\t\t  p3 *= norm.w;\n\t\t  vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n\t\t  m = m * m;\n\t\t  return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), \n\t\t\t\t\t\t\t\t\t\tdot(p2,x2), dot(p3,x3) ) );\n\t\t}",[n,r]),s=new PK("vec4 mod289(vec4 x){return x - floor(x * (1.0 / 289.0)) * 289.0;}"),o=new PK("vec4 perm(vec4 x){return mod289(((x * 34.0) + 1.0) * x);}",[s]),l=new PK("float noise(vec3 p){\n\t\t\tvec3 a = floor(p);\n\t\t\tvec3 d = p - a;\n\t\t\td = d * d * (3.0 - 2.0 * d);\n\t\t\tvec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0);\n\t\t\tvec4 k1 = perm(b.xyxy);\n\t\t\tvec4 k2 = perm(k1.xyxy + b.zzww);\n\t\t\tvec4 c = k2 + a.zzzz;\n\t\t\tvec4 k3 = perm(c);\n\t\t\tvec4 k4 = perm(c + 1.0);\n\t\t\tvec4 o1 = fract(k3 * (1.0 / 41.0));\n\t\t\tvec4 o2 = fract(k4 * (1.0 / 41.0));\n\t\t\tvec4 o3 = o2 * d.z + o1 * (1.0 - d.z);\n\t\t\tvec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x);\n\t\t\treturn o4.y * d.y + o4.x * (1.0 - d.y);\n\t\t}",[o]),c=new PK("float fbm(vec3 x) {\n\t\t\tfloat v = 0.0;\n\t\t\tfloat a = 0.5;\n\t\t\tvec3 shift = vec3(100);\n\t\t\tfor (int i = 0; i < NUM_OCTAVES; ++i) {\n\t\t\t\tv += a * noise(x);\n\t\t\t\tx = x * 2.0 + shift;\n\t\t\t\ta *= 0.5;\n\t\t\t}\n\t\t\treturn v;\n\t\t}",[l]);c.keywords.NUM_OCTAVES=new OK("int NUM_OCTAVES ".concat(5));let h=new PK("vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}"),u=new PK("float perlin(vec3 P){\n\t\t  vec3 Pi0 = floor(P);\n\t\t  vec3 Pi1 = Pi0 + vec3(1.0);\n\t\t  Pi0 = mod(Pi0, 289.0);\n\t\t  Pi1 = mod(Pi1, 289.0);\n\t\t  vec3 Pf0 = fract(P);\n\t\t  vec3 Pf1 = Pf0 - vec3(1.0);\n\t\t  vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n\t\t  vec4 iy = vec4(Pi0.yy, Pi1.yy);\n\t\t  vec4 iz0 = Pi0.zzzz;\n\t\t  vec4 iz1 = Pi1.zzzz;\n\t\t  vec4 ixy = permute(permute(ix) + iy);\n\t\t  vec4 ixy0 = permute(ixy + iz0);\n\t\t  vec4 ixy1 = permute(ixy + iz1);\n\t\t  vec4 gx0 = ixy0 / 7.0;\n\t\t  vec4 gy0 = fract(floor(gx0) / 7.0) - 0.5;\n\t\t  gx0 = fract(gx0);\n\t\t  vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n\t\t  vec4 sz0 = step(gz0, vec4(0.0));\n\t\t  gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n\t\t  gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\t\t  vec4 gx1 = ixy1 / 7.0;\n\t\t  vec4 gy1 = fract(floor(gx1) / 7.0) - 0.5;\n\t\t  gx1 = fract(gx1);\n\t\t  vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n\t\t  vec4 sz1 = step(gz1, vec4(0.0));\n\t\t  gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n\t\t  gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\t\t  vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n\t\t  vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n\t\t  vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n\t\t  vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n\t\t  vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n\t\t  vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n\t\t  vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n\t\t  vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\t\t  vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n\t\t  g000 *= norm0.x;\n\t\t  g010 *= norm0.y;\n\t\t  g100 *= norm0.z;\n\t\t  g110 *= norm0.w;\n\t\t  vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n\t\t  g001 *= norm1.x;\n\t\t  g011 *= norm1.y;\n\t\t  g101 *= norm1.z;\n\t\t  g111 *= norm1.w;\n\t\t  float n000 = dot(g000, Pf0);\n\t\t  float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n\t\t  float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n\t\t  float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n\t\t  float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n\t\t  float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n\t\t  float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n\t\t  float n111 = dot(g111, Pf1);\n\t\t  vec3 fade_xyz = fade(Pf0);\n\t\t  vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n\t\t  vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n\t\t  float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); \n\t\t  return 2.2 * n_xyz;\n\t\t}",[n,r,h]),d=new PK("float hashwithoutsine13(vec3 p3)\n\t\t{\n\t\t\tp3  = fract(p3 * .1031);\n\t\t\tp3 += dot(p3, p3.yzx + 33.33);\n\t\t\treturn fract((p3.x + p3.y) * p3.z);\n\t\t}"),p=new PK("vec3 hashwithoutsine33(vec3 p3)\n\t\t{\n\t\t\tp3 = fract(p3 * vec3(.1031, .1030, .0973));\n\t\t\tp3 += dot(p3, p3.yxz+33.33);\n\t\t\treturn fract((p3.xxy + p3.yxx)*p3.zyx);\n\t\t}"),f=new PK("float metric(in vec3 p)\n\t\t{\n\t\t\t// L2 \n\t\t\treturn length(p);\n\n\t\t\t// Chebyshev \n\t\t\t// vec3 a = abs(p);\n\t\t\t// return max(a.x, max(a.y, a.z));\n\t\t}"),m=new PK("float smin( float a, float b, float k )\n\t\t{\n\t\t\tfloat h = smoothstep(0.0, 1.0, 0.5 + 0.5 * (b - a) / k);\n\t\t\tfloat correction = k * h * (1.0 - h);\n\t\t\treturn mix(b, a, h) - correction;\n\t\t}"),g=new PK("float smax( float a, float b, float k )\n\t\t{\n\t\t\tfloat h = smoothstep(1.0, 0.0, 0.5 + 0.5 * (a - b) / k);\n\t\t\tfloat correction = k * h * (1.0 - h);\n\t\t\treturn mix(a, b, h) + correction;\n\t\t}"),v=new PK("float remap(float value, float input_min, float input_max, float output_min, float output_max) {\n\t\t\t// Compute width of each interval\n\t\t\tfloat input_width = input_max - input_min;\n\t\t\tfloat output_width = output_max - output_min;\n\t\t\n\t\t\t// Convert input range into a 0-1 range \n\t\t\tfloat scaled = (value - input_min) / input_width;\n\t\t\n\t\t\t// Convert the 0-1 range into a value in output range\n\t\t\treturn output_min + (scaled * output_width);\n\t\t}");return{simplex:t,simplexFractal:i,simplexAshima:a,fbm:c,perlin:u,voronoi:new PK('float voronoi(in vec3 x, in int style, in float smoothness, in float seed, in int quality) \n\t\t{\n\t\t\t// Integer and fractional parts of this point\'s coordinates\n\t\t\tivec3 p = ivec3(floor(x));\n\t\t\tvec3 f = fract(x);\n\n\t\t\t// Different variables that we will use to construct noise:\n\t\t\t//\n\t\t\t// f1: distance to the closest feature point\n\t\t\t// f2: distance to the second closest feature point\n\t\t\t// e: distance to the closest edge (cell boundary)\n\t\t\t//\n\t\t\t// We also compute "smooth" versions of all of the above quantites, essentially\n\t\t\t// replacing "hard" minimums with "smooth" minimums (described by IQ)\n\t\t\tfloat f1_smooth = 8.0;\n\t\t\tfloat f1 = 8.0;\n\t\t\tfloat f2_smooth = 8.0;\n\t\t\tfloat f2 = 8.0;\n\t\t\tfloat e_smooth = 8.0;\n\t\t\tfloat e = 8.0;\n\n\t\t\t// Variables stored from closest cell\n\t\t\tivec3 mb;\n\t\t\tvec3 mr; \n\n\t\t\tint steps = quality;\n\t\t\t\n\t\t\tfor (int x = -steps; x <= steps; x++) \n\t\t\tfor (int y = -steps; y <= steps; y++)\n\t\t\tfor (int z = -steps; z <= steps; z++)\n\t\t\t{\n\t\t\t\tivec3 b = ivec3(x, y, z);\n\t\t\t\tvec3 r = vec3(b) + hashwithoutsine33(vec3(p + b) + seed) - f;\n\t\t\t\tfloat d = length(r);\n\t\t\t\t\n\t\t\t\tf1_smooth = smin(d, f1_smooth, smoothness);\n\n\t\t\t\t// Store un-smoothed distances too \n\t\t\t\tif (d < f1) \n\t\t\t\t{\n\t\t\t\t\tf2 = f1;\n\t\t\t\t\tf1 = d;\n\n\t\t\t\t\tmb = ivec3(x, y, z);\n\t\t\t\t\tmr = r;\n\t\t\t\t} \n\t\t\t\telse if (d < f2) \n\t\t\t\t{\n\t\t\t\t\tf2 = d;\n\t\t\t\t}\n\t\t\t}\t\n\t\t\t\n\t\t\tfloat id = hashwithoutsine13(vec3(p + mb) + seed);\n\n\t\t\t// Second pass for edge distance  \n\t\t\tfor (int x = -steps; x <= steps; x++) \n\t\t\tfor (int y = -steps; y <= steps; y++)\n\t\t\tfor (int z = -steps; z <= steps; z++)\n\t\t\t{\n\t\t\t\t// Start search at the cell that contains the closest point to "x" (found in 1st pass)\n\t\t\t\tivec3 b = mb + ivec3(x, y, z);\n\t\t\t\tvec3 r = vec3(b) + hashwithoutsine33(vec3(p + b) + seed) - f;\n\t\t\t\tfloat d1 = dot(0.5 * (mr + r), (r - mr)); \t\t\t\t// IQ normalizes "r - mr" but that breaks things for the smooth version?\n\t\t\t\tfloat d2 = dot(0.5 * (mr + r), normalize(r - mr));\n\n\t\t\t\te_smooth = smin(d1, e_smooth, smoothness);\n\n\t\t\t\te = min(e, d2);\n\n\t\t\t\t// Also compute a smooth version of F2 in this pass\n\t\t\t\t{\n\t\t\t\t\tivec3 b = ivec3(x, y, z);\n\t\t\t\t\tif (b != mb) \n\t\t\t\t\t{\n\t\t\t\t\t\tvec3 r = vec3(b) + hashwithoutsine33(vec3(p + b) + seed) - f;\n\t\t\t\t\t\tfloat d = length(r);\n\n\t\t\t\t\t\tf2_smooth = smin(d, f2_smooth, smoothness);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Different visualization modes \n\t\t\tif (style == 0) \n\t\t\t{\n\t\t\t\treturn f1_smooth;\n\t\t\t}\n\t\t\tif (style == 1) \n\t\t\t{\n\t\t\t\treturn f2_smooth;\n\t\t\t}\n\t\t\tif (style == 2) \n\t\t\t{\n\t\t\t\treturn f2_smooth - f1_smooth;\n\t\t\t\t\n\t\t\t\t// "Pebbles" also cool\n\t\t\t\t//return step(0.2, f2_smooth - f1_smooth);\n\t\t\t}\n\t\t\tif (style == 3) \n\t\t\t{\n\t\t\t\t// This one is really good for rock / stone effects\n\t\t\t\tfloat a = f1; \n\t\t\t\tfloat b = f2;\n\t\t\t\tfloat k = 3.0;\n\t\t\t\tfloat h = max(k - abs(a - b), 0.0) / k;\n\t\t\t\tfloat final = min(a, b) - h * h * k * (1.0 / 4.0);\n\t\t\t\treturn final;\n\t\t\t}\n\t\t\tif (style == 4) \n\t\t\t{\n\t\t\t\t// Some random adjustments to make this style stand out more \n\t\t\t\treturn exp(5.0 * e_smooth);\n\t\t\t}\n\t\t\tif (style == 5) \n\t\t\t{\n\t\t\t\treturn pow(f1_smooth, 3.0);\n\t\t\t}\n\t\t\tif (style == 6) \n\t\t\t{\t\t\t\t\n\t\t\t\tconst float eps = 0.0125;\n\n\t\t\t\t// Thicker lines as the user increases the smoothness slider\n\t\t\t\tfloat thickness = smoothness * 0.25 + eps;\n\n\t\t\t\t// Blurrier lines as the user increases the smoothness slider\n\t\t\t\tfloat blur = pow(smoothness, 3.0) * 0.25 + eps;\n\n\t\t\t\treturn smoothstep(\n\t\t\t\t\tthickness - thickness * blur, \n\t\t\t\t\tthickness + thickness * blur, \n\t\t\t\t\te\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (style == 7) \n\t\t\t{\n\t\t\t\treturn hashwithoutsine13(vec3(p + mb) + seed);\n\t\t\t}\n\t\t}\n\t',[d,p,f,m,g,v])}}(),BJ=class extends wK{constructor(e,t,i,n,r,a,s,o,l,c,h,u,d,p,f,m,g,v,y){super("v3"),this.nodeType="Noise",this.scale=e,this.size=t,this.move=i,this.fA=n,this.fB=r,this.distortion=a,this.colorA=s,this.colorB=o,this.colorC=l,this.colorD=c,this.noiseType=u,this.voronoiStyle=p,this.highCut=f,this.lowCut=m,this.smoothness=g,this.seed=v,this.quality=y,this.isMask=d,this.alpha=h,this.calpha="g".concat(this.uuid.toString().replace(/-/g,""),"_calpha")}generate(e,t,i,n,r){e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let a=Object.values(RJ)[this.noiseType.value],s="voronoi"==a?"\n\t\tfloat v = ".concat(a,'(st + move, voronoiStyle, smoothness, seed, quality);\n\n\t\t// Apply clipping to colors\n\t\tv = remap(v, lowCut, highCut, 0.0, 1.0);\n\t\tv = smax(v, 0.0, smoothness * 0.25);\n\t\tv = smin(v, 1.0, smoothness * 0.25);\n\n\t\t// Note that the voronoi mode only uses colors "A" and "C" from the UI \n\t\tvec4 color = mix(colorA, colorC, v); \n\t\t'):"\n\t\tvec3 q = vec3(".concat(a,"(st),\n\t\t\t\t\t   ").concat(a,"(st + vec3(1.0)),\n\t\t\t\t\t   ").concat(a,"(st + vec3(1.0)));\n\t\tvec3 r = vec3(").concat(a,"(st + vec3(distortion, 1.0) * q + vec3(fA, 1.0) + move),\n\t\t\t\t\t  ").concat(a,"(st + vec3(distortion, 1.0) * q + vec3(fB, 1.0) + move), \n\t\t\t\t\t  ").concat(a,"(st * q));\n\t\tfloat f = ").concat(a,"(st + r);\n\t\tvec4 color;\n\t\tcolor = mix(colorA, colorB, clamp((f * f) * 4.0, 0.0, 1.0));\n\t\tcolor = mix(color, colorC, clamp(length(q), 0.0, 1.0));\n\t\tcolor = mix(color, colorD, clamp(length(r.x), 0.0, 1.0));\n\t\t"),o=new PK("vec3 ".concat(a,"customNoise(float scale, vec3 size, float move, vec2 fA, vec2 fB, vec2 distortion, vec4 colorA, vec4 colorB, vec4 colorC, vec4 colorD, int voronoiStyle, float highCut, float lowCut, float smoothness, float seed, int quality, bool isMask, float mask, float alpha, out float calpha) \n\t\t\t{\n                // Prevent scale of zero \n\t\t\t\tscale = max(abs(scale), 0.001);\n\n\t\t\t\tvec3 st = position / size;\n\t\t\t\tst /= scale;\n\n\t\t\t\t").concat(s,"\n\n\t\t\t\tfloat lalpha = alpha * color.a * mask;\n\t\t\t\tcalpha = mix(lalpha / clamp(lalpha + accumAlpha, 0.00001, 1.0), lalpha, float(isMask));\n\t\t\t\taccumAlpha += (1.0 - accumAlpha) * lalpha * (1.0 - float(isMask));\n\n\t\t\t\treturn clamp(color, 0.0, 1.0).rgb;\n\t\t\t}"),[LJ.simplex,LJ.simplexFractal,LJ.simplexAshima,LJ.fbm,LJ.perlin,LJ.voronoi]),l=e.include(o),c=[];return c.push(this.scale.build(e,"f")),c.push(this.size.build(e,"v3")),c.push(this.move.build(e,"f")),c.push(this.fA.build(e,"v2")),c.push(this.fB.build(e,"v2")),c.push(this.distortion.build(e,"v2")),c.push(this.colorA.build(e,"v4")),c.push(this.colorB.build(e,"v4")),c.push(this.colorC.build(e,"v4")),c.push(this.colorD.build(e,"v4")),c.push(this.voronoiStyle.build(e,"i")),c.push(this.highCut.build(e,"f")),c.push(this.lowCut.build(e,"f")),c.push(this.smoothness.build(e,"f")),c.push(this.seed.build(e,"f")),c.push(this.quality.build(e,"i")),c.push(this.isMask.build(e,"b")),c.push(this.mask?"luminance(".concat(this.mask.flow(e,"v3").result,")"):"1.0"),c.push(this.alpha.build(e,"f")),c.push(this.calpha),e.format(l+"("+c.join(",")+")",this.getType(e),t)}};BJ.numOctaves=5;var zJ=class extends wK{constructor(e,t,i,n,r,a,s,o,l,c,h,u,d,p,f,m){super("v3"),this.nodeType="Outline",this.firstTime=!0,this.outlineColor=e,this.contourColor=t,this.outlineWidth=i,this.contourWidth=n,this.contourThreshold=r,this.outlineThreshold=a,this.contourFrequency=s,this.outlineSmoothing=o,this.contourDirection=l,this.positionalLines=c,this.compensation=h,this.resolution=u,this.normalMap=d,this.depthMap=p,this.pixelRatio=f,this.alpha=m,this.calpha="g".concat(this.uuid.toString().replace(/-/g,""),"_calpha")}generate(e,t){let i="g".concat(this.uuid.toString().replace(/-/g,""));if(e.require("vWorldViewDir"),e.require("worldNormal"),e.extensions.derivatives=!0,this.compensation.value&&e.define("OUTLINE_COMPENSATION","".concat(i,"_offset")),this.firstTime){let t=this.outlineWidth.build(e,"f"),n=this.resolution.build(e,"v2"),r=this.compensation.build(e,"b"),a=this.pixelRatio.build(e,"f");e.addVertexParsVariable("randomColor","attribute vec3"),e.addVertexParsVariable("extrudeNormal","attribute vec3"),e.addVertexParsVariable(t,"uniform float"),e.addVertexParsVariable(n,"uniform vec2"),e.addVertexParsVariable(r,"uniform bool"),e.addVertexParsVariable(a,"uniform float"),e.addVertexParsVariable("vID","flat out float"),e.addFragmentParsVariable("vID","flat in float"),e.addVertexFinalCode("\n                vID = randomColor.r;\n                vec2 ".concat(i,"_offset = vec2(0.0);\n                if (").concat(r,") {\n                    vec4 ").concat(i,"_clipPosition = projectionMatrix * (modelViewMatrix * vec4(position, 1.0));\n                    // NOTE: For certain shapes, like spheres, we get incorrect extrusion when the\n                    // normals face the camera directly. So we hackily fix this by offsetting the normal\n                    // by a tiny amount.\n                    vec3 ").concat(i,"_clipNormal = mat3(projectionMatrix) * (mat3(modelViewMatrix) * extrudeNormal) + 0.0000001;\n                    ").concat(i,"_offset = normalize(").concat(i,"_clipNormal.xy) / ").concat(n," * (").concat(t," / 2.0) * ").concat(i,"_clipPosition.w * 2.0 * ").concat(a,";\n                    ").concat(i,"_clipPosition.xy += ").concat(i,"_offset;\n                    // TODO(MAX): To handle multiple outline layers, we only want to extrude\n                    // if this offset is the biggest of all the potential offsets\n                    gl_Position = ").concat(i,"_clipPosition;\n                }\n            "))}if(e.isShader("fragment")){e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let i=e.include(zJ.Nodes.outline),n=[];return n.push(this.outlineColor.build(e,"c")),n.push(this.contourColor.build(e,"c")),n.push(this.outlineWidth.build(e,"f")),n.push(this.contourWidth.build(e,"f")),n.push(this.contourThreshold.build(e,"f")),n.push(this.outlineThreshold.build(e,"f")),n.push(this.contourFrequency.build(e,"f")),n.push(this.outlineSmoothing.build(e,"f")),n.push(this.contourDirection.build(e,"v3")),n.push(this.positionalLines.build(e,"b")),n.push(this.resolution.build(e,"v2")),n.push(this.normalMap.getTexture(e,"t")),n.push(this.depthMap.getTexture(e,"t")),n.push(this.pixelRatio.build(e,"f")),n.push(this.compensation.build(e,"b")),n.push(this.mask?"luminance(".concat(this.mask.flow(e,"v3").result,")"):"1.0"),n.push(this.alpha.build(e,"f")),n.push(this.calpha),this.firstTime=!this.firstTime,e.format(i+"("+n.join(",")+")",this.getType(e),t)}return console.warn("OutlineNode is not compatible with "+e.shader+" shader."),""}},NJ=zJ;NJ.Nodes=function(){let e=new PK("\nfloat sobelSample(sampler2D t, sampler2D d, vec2 uv, vec2 resolution, float outlineWidth, float pixelRatio)\n{\n    vec2 halton = haltonSequence[frameIndex];\n    float temporalOffset = getNoiseInterleavedGradient(gl_FragCoord.xy + halton);\n    float temporalAngle  = temporalOffset * PI2;\n\n    vec2 texelSize = (vec2(1.0) / resolution);\n    vec2 offsetSize = texelSize * outlineWidth * pixelRatio;\n\n    vec2 uvSamples[9];\n    vec4 normalSamples[9];\n\n\tuvSamples[0] = uv + vec2( -offsetSize.x, -offsetSize.y) + (vogelDiskSample(0, 9, temporalAngle) * texelSize);\n\tuvSamples[1] = uv + vec2(0.0, -offsetSize.y) + (vogelDiskSample(1, 9, temporalAngle) * texelSize);\n\tuvSamples[2] = uv + vec2(  offsetSize.x, -offsetSize.y) + (vogelDiskSample(2, 9, temporalAngle) * texelSize);\n\tuvSamples[3] = uv + vec2( -offsetSize.x, 0.0) + (vogelDiskSample(3, 9, temporalAngle) * texelSize);\n\tuvSamples[4] = uv;\n\tuvSamples[5] = uv + vec2(  offsetSize.x, 0.0) + (vogelDiskSample(5, 9, temporalAngle) * texelSize);\n\tuvSamples[6] = uv + vec2( -offsetSize.x, offsetSize.y) + (vogelDiskSample(6, 9, temporalAngle) * texelSize);\n\tuvSamples[7] = uv + vec2(0.0, offsetSize.y) + (vogelDiskSample(7, 9, temporalAngle) * texelSize);\n\tuvSamples[8] = uv + vec2(  offsetSize.x, offsetSize.y) + (vogelDiskSample(8, 9, temporalAngle) * texelSize);\n\n\n    normalSamples[0] = texture2D(t, uvSamples[0]);\n    normalSamples[1] = texture2D(t, uvSamples[1]);\n    normalSamples[2] = texture2D(t, uvSamples[2]);\n    normalSamples[3] = texture2D(t, uvSamples[3]);\n    normalSamples[4] = texture2D(t, uvSamples[4]);\n    normalSamples[5] = texture2D(t, uvSamples[5]);\n    normalSamples[6] = texture2D(t, uvSamples[6]);\n    normalSamples[7] = texture2D(t, uvSamples[7]);\n    normalSamples[8] = texture2D(t, uvSamples[8]);\n\n    float depthBias = 0.0001;\n    // TODO(MAX): Can we somehow reduce the number of conditionals here with MATH?!\n    if (normalSamples[0].a != vID && normalSamples[0].a != 0.0) {\n        float depthAtSample = texture2D(d, uvSamples[0]).r + depthBias;\n        if (gl_FragCoord.z > depthAtSample) {\n           return 0.0;\n        }\n    }\n\n    if (normalSamples[1].a != vID && normalSamples[1].a != 0.0) {\n        float depthAtSample = texture2D(d, uvSamples[1]).r + depthBias;\n        if (gl_FragCoord.z > depthAtSample) {\n           return 0.0;\n        }\n    }\n\n    if (normalSamples[2].a != vID && normalSamples[2].a != 0.0) {\n        float depthAtSample = texture2D(d, uvSamples[2]).r + depthBias;\n        if (gl_FragCoord.z > depthAtSample) {\n           return 0.0;\n        }\n    }\n\n    if (normalSamples[3].a != vID && normalSamples[3].a != 0.0) {\n        float depthAtSample = texture2D(d, uvSamples[3]).r + depthBias;\n        if (gl_FragCoord.z > depthAtSample) {\n           return 0.0;\n        }\n    }\n\n\n    if (normalSamples[4].a != vID && normalSamples[4].a != 0.0) {\n        float depthAtSample = texture2D(d, uvSamples[4]).r + depthBias;\n        if (gl_FragCoord.z > depthAtSample) {\n           return 0.0;\n        }\n    }\n\n    if (normalSamples[5].a != vID && normalSamples[5].a != 0.0) {\n        float depthAtSample = texture2D(d, uvSamples[5]).r + depthBias;\n        if (gl_FragCoord.z > depthAtSample) {\n           return 0.0;\n        }\n    }\n\n    if (normalSamples[6].a != vID && normalSamples[6].a != 0.0) {\n        float depthAtSample = texture2D(d, uvSamples[6]).r + depthBias;\n        if (gl_FragCoord.z > depthAtSample) {\n           return 0.0;\n        }\n    }\n\n    if (normalSamples[7].a != vID && normalSamples[7].a != 0.0) {\n        float depthAtSample = texture2D(d, uvSamples[7]).r + depthBias;\n        if (gl_FragCoord.z > depthAtSample) {\n           return 0.0;\n        }\n    }\n\n    if (normalSamples[8].a != vID && normalSamples[8].a != 0.0) {\n        float depthAtSample = texture2D(d, uvSamples[8]).r + depthBias;\n        if (gl_FragCoord.z > depthAtSample) {\n           return 0.0;\n        }\n    }\n\n    vec3 sobel_edge_h = normalSamples[2].rgb + (2.0*normalSamples[5].rgb) + normalSamples[8].rgb - (normalSamples[0].rgb + (2.0*normalSamples[3].rgb) + normalSamples[6].rgb);\n  \tvec3 sobel_edge_v = normalSamples[0].rgb + (2.0*normalSamples[1].rgb) + normalSamples[2].rgb - (normalSamples[6].rgb + (2.0*normalSamples[7].rgb) + normalSamples[8].rgb);\n\n    float edgeNormal = sqrt(dot(sobel_edge_h, sobel_edge_h) + dot(sobel_edge_v, sobel_edge_v));\n    return edgeNormal;\n}\n");return{outline:new PK("vec3 outline(vec3 outlineColor, vec3 contourColor, float outlineWidth, float contourWidth, float outlineThreshold, float contourThreshold, float outlineSmoothing, float contourFrequency, vec3 contourDirection, bool positionalLines, vec2 resolution, sampler2D normalMap, sampler2D depthMap, float pixelRatio, bool compensation, float mask, float alpha, out float calpha) {\n                vec3 result = outlineColor;\n                float resultAlpha = 0.0;\n\n                vec3 N = normalize(vWNormal);\n                vec2 nuv = (gl_FragCoord.xy / resolution);\n                float sobelSample = compensation ? sobelSample(normalMap, depthMap, nuv, resolution, outlineWidth / 2., pixelRatio) : sobelSample(normalMap, depthMap, nuv, resolution, outlineWidth, pixelRatio);\n                resultAlpha = smoothstep(outlineThreshold - outlineSmoothing, outlineThreshold + outlineSmoothing, sobelSample);\n\n                //resultAlpha = 1.0;\n                //result = vec3(sobelSample);\n\n                float t = 1.0 - contourThreshold;\n                if(positionalLines) {\n                    vec3 NDir = position * contourDirection;\n                    float NT = NDir.x + NDir.y + NDir.z;\n                    float f  = fract(NT * contourFrequency * 0.01);\n                    float df = fwidth(NT * contourFrequency);\n\n                    float g = smoothstep(df * (contourWidth * 0.01), df * (contourWidth * 0.01 * 2.0), f);\n                    if (g < 1.0 && resultAlpha == 0.0) {\n                        result = contourColor;\n                        resultAlpha = 1.0;\n                    }\n                 }\n                 else {\n                    vec3 NDir = N * contourDirection;\n                    float NT = NDir.x + NDir.y + NDir.z;\n                    float df = fwidth(NT * contourThreshold);\n                    float f = sin(NT * 1.0 * contourFrequency);\n                    float g = smoothstep(0.0, df * contourWidth, 1.0 - f);\n\n                    if (df > (t * 0.5) && g < 1.0 && resultAlpha == 0.0) {\n                        result = contourColor;\n                        resultAlpha = 1.0 - g;\n                    }\n                 }\n\n                 float lalpha = alpha * resultAlpha * mask;\n                 calpha =  lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 );\n                 accumAlpha += ( 1.0 - accumAlpha ) * lalpha;\n\t\t\t\t \n                 return result;\n             }",[e])}}();var FJ=class extends wK{constructor(e,t,i,n,r,a,s,o,l,c,h,u,d,p,f,m,g,v){super("v3"),this.nodeType="Pattern",this.style=e,this.projection=t,this.axis=i,this.blending=n,this.offset=r,this.colorA=a,this.colorB=s,this.frequency=o,this.size=l,this.variation=c,this.smoothness=h,this.zigzag=u,this.rotation=d,this.vertical=p,this.horizontal=f,this.sides=m,this.isMask=v,this.alpha=g,this.calpha="g".concat(this.uuid.toString().replace(/-/g,""),"_calpha")}generate(e,t){if(e.isShader("fragment")){let i;switch(e.require("position"),e.require("uv"),e.requires.uv=[!0],e.require("normal"),e.requires.normal=!0,e.addFragmentVariable(this.calpha,"float"),this.style.value){case 0:default:i="circle";break;case 1:i="ring";break;case 2:i="polygon";break;case 3:i="xcross";break;case 4:i="diamond";break;case 5:i="checkerboard";break;case 6:i="line";break;case 7:i="wave"}let n="g".concat(this.uuid.toString().replace(/-/g,"")),r=new PK("float hashwithoutsine12(vec2 p)\n\t\t\t\t{\n\t\t\t\t\tvec3 p3 = fract(vec3(p.xyx) * .1031);\n\t\t\t\t\tp3 += dot(p3, p3.yzx + 33.33);\n\t\t\t\t\treturn fract((p3.x + p3.y) * p3.z);\n\t\t\t\t}"),a=new PK("vec2 rotate_uv(in vec2 uv, float a, bool repeat) \n\t\t\t\t{\n\t\t\t\t\tconst float mid = 0.5;\n\t\t\t\t\tfloat radians = a * (PI / 180.0);\n\t\t\t\t\tvec2 rotated = vec2(\n\t\t\t\t\t\tcos(radians) * (uv.x - mid) + sin(radians) * (uv.y - mid) + mid,\n\t\t\t\t\t\tcos(radians) * (uv.y - mid) - sin(radians) * (uv.x - mid) + mid\n\t\t\t\t\t);\n\t\t\t\t\treturn repeat ? fract(rotated): rotated;\n\t\t\t\t}"),s="";if(4===this.projection.value){let e=2===this.style.value?"".concat(i,"(uv0, frequency, size, variation, smoothness_remapped, zigzag, rotation, sides)"):"".concat(i,"(uv0, frequency, size, variation, smoothness_remapped, zigzag, rotation)"),t=2===this.style.value?"".concat(i,"(uv1, frequency, size, variation, smoothness_remapped, zigzag, rotation, sides)"):"".concat(i,"(uv1, frequency, size, variation, smoothness_remapped, zigzag, rotation)"),n=2===this.style.value?"".concat(i,"(uv2, frequency, size, variation, smoothness_remapped, zigzag, rotation, sides)"):"".concat(i,"(uv2, frequency, size, variation, smoothness_remapped, zigzag, rotation)");s="\n\t\t\t\tvec3 p = position;\n\t\t\t\tfloat factor = 0.0125;\n\t\t\t\tvec2 uv0 = fract(p.xy * factor);\n\t\t\t\tvec2 uv1 = fract(p.zy * factor);\n\t\t\t\tvec2 uv2 = fract(p.xz * factor);\n\t\t\t\t\n\t\t\t\tuv0 = rotate_uv(uv0 + offset, rotation, true);\n\t\t\t\tuv1 = rotate_uv(uv1 + offset, rotation, true);\n\t\t\t\tuv2 = rotate_uv(uv2 + offset, rotation, true);\n\t\n\t\t\t\tfloat d0 = ".concat(e,";\n\t\t\t\tfloat d1 = ").concat(t,";\n\t\t\t\tfloat d2 = ").concat(n,";\n\t\t\t\t\n\t\t\t\t// Range from 3 to 128 seems to be good\n\t\t\t\tfloat exponent = (1.0 - blending) * 125.0 + 3.0;\n\n\t\t\t\tvec3 n = vObjectNormal;\n\t\t\t\tvec3 weights = abs(normalize(n));\n\t\t\t\tweights = pow(weights, vec3(exponent));\n\t\t\t\tweights /= dot(weights, vec3(1.0));\n\t\t\t\td0 *= weights.z;\n\t\t\t\td1 *= weights.x;\n\t\t\t\td2 *= weights.y;\n\t\t\t\tfloat draw = d0 + d1 + d2;\n\t\n\t\t\t\tvec2 custom_uv = uv0 * weights.z + uv1 * weights.x + uv2 * weights.y;\n\t\t\t\t")}else{let e=2===this.style.value?"".concat(i,"(custom_uv, frequency, size, variation, smoothness_remapped, zigzag, rotation, sides)"):"".concat(i,"(custom_uv, frequency, size, variation, smoothness_remapped, zigzag, rotation)"),t="";0===this.axis.value?t="float radius = length(p);\n\t\t\t\t\tfloat theta = atan(p.y, p.z);\n\t\t\t\t\tfloat phi = acos(p.x / radius);":1===this.axis.value?t="float radius = length(p);\n\t\t\t\t\tfloat theta = atan(p.x, p.z);\n\t\t\t\t\tfloat phi = acos(p.y / radius);":(this.axis.value,t="float radius = length(p);\n\t\t\t\t\tfloat theta = atan(p.y, p.x);\n\t\t\t\t\tfloat phi = acos(p.z / radius);");let n="";switch(this.projection.value){case 0:n="custom_uv = vUv.st;";break;case 1:case 3:default:break;case 2:n="\n\t\t\t\t\t\t\tvec3 p = position;\n\t\t\t\t\t\t\t".concat(t,"\n\t\t\t\t\t\t\tcustom_uv = vec2(theta, phi);\n\t\t\t\t\t\t\tcustom_uv /= PI;\n\t\t\t\t\t\t\t")}s="\n\t\t\t\tvec2 custom_uv;\n\t\t\t\t".concat(n,"\n\t\n\t\t\t\tcustom_uv += offset;\n\t\t\t\tcustom_uv = fract(custom_uv);\n\t\t\t\tcustom_uv = rotate_uv(custom_uv, rotation, true);\n\t\n\t\t\t\tfloat draw = ").concat(e,";\n\t\t\t\t")}let o=new PK("vec3 ".concat(n,"_pattern(vec3 normal, float blending, int style, vec2 offset, vec4 colorA, vec4 colorB, vec2 frequency, float size, float variation, float smoothness, float zigzag, float rotation, vec2 vertical, vec2 horizontal, int sides, bool isMask, float mask, float alpha, out float calpha) {\n\t\t\t\t\tconst float TWO_PI = PI * 2.0;\n\t\t\t\t\tfloat smoothness_remapped = pow(smoothness, 5.0);\t\n\n\t\t\t\t\t").concat(s,"\n\n\t\t\t\t\t// Construct final output color\n\t\t\t\t\tvec4 color = mix(colorA, colorB, draw);\n\t\t\t\t\tcolor.a = clamp(color.a, 0.0, 1.0);\n\n\t\t\t\t\t// Apply cuts\n\t\t\t\t\tcolor.a *= \n\t\t\t\t\t\tstep(vertical.x, custom_uv.y) * \n\t\t\t\t\t\tstep(custom_uv.y, vertical.y);\n\t\t\t\t\tcolor.a *= \n\t\t\t\t\t\tstep(horizontal.x, abs(custom_uv.x)) * \n\t\t\t\t\t\tstep(abs(custom_uv.x), horizontal.y);\n\n\t\t\t\t\t// Accumulate alpha \n\t\t\t\t\tfloat lalpha = alpha * clamp(color.a, 0.0, 1.0) * mask;\n\t\t\t\t\tcalpha = mix(lalpha / clamp(lalpha + accumAlpha, 0.00001, 1.0), lalpha, float(isMask));\n\t\t\t\t\taccumAlpha += (1.0 - accumAlpha) * lalpha * (1.0 - float(isMask));\n\n\t\t\t\t\treturn clamp(color, 0.0, 1.0).rgb;\n\t\t\t\t}"),[a,r,FJ.DrawFunctions.circle,FJ.DrawFunctions.ring,FJ.DrawFunctions.polygon,FJ.DrawFunctions.cross,FJ.DrawFunctions.diamond,FJ.DrawFunctions.checkerboard,FJ.DrawFunctions.line,FJ.DrawFunctions.wave]),l=e.include(o),c=[];return c.push("normal"),c.push(this.blending.build(e,"f")),c.push(this.style.build(e,"i")),c.push(this.offset.build(e,"v2")),c.push(this.colorA.build(e,"v4")),c.push(this.colorB.build(e,"v4")),c.push(this.frequency.build(e,"v2")),c.push(this.size.build(e,"f")),c.push(this.variation.build(e,"f")),c.push(this.smoothness.build(e,"f")),c.push(this.zigzag.build(e,"f")),c.push(this.rotation.build(e,"f")),c.push(this.vertical.build(e,"v2")),c.push(this.horizontal.build(e,"v2")),c.push(this.sides.build(e,"i")),c.push(this.isMask.build(e,"b")),c.push(this.mask?"luminance(".concat(this.mask.flow(e,"v3").result,")"):"1.0"),c.push(this.alpha.build(e,"f")),c.push(this.calpha),e.format(l+"("+c.join(",")+")",this.getType(e),t)}return console.warn("PatterNode is not compatible with "+e.shader+" shader."),e.format("vec3(0.0)",this.getType(e),t)}},jJ=FJ;jJ.DrawFunctions=function(){let e=new PK("float hashwithoutsine12(vec2 p) {\n\t\t\t\tvec3 p3 = fract(vec3(p.xyx) * 0.1031);\n\t\t\t\tp3 += dot(p3, p3.yzx + 33.33);\n\t\t\t\treturn fract((p3.x + p3.y) * p3.z);\n\t\t\t}"),t=new PK("vec2 tile_and_center(in vec2 uv, in vec2 frequency, in float variation, in float zigzag, in float rotation) {\n                // Create tiles in UV-space\n                uv *= frequency;\n\n                // Integer coords\n                vec2 i = floor(uv);\n\n                // Offset every other row based on zigzag param, then compute fractional coords\n                float row_offset = mod(i.y, 2.0);\n                uv.x += row_offset * zigzag;\n                vec2 f = fract(uv);\n\n\t\t\t\t// Rotate the tile itself:\n\t\t\t\t// const float mid = 0.5;\n\t\t\t\t// f = vec2(\n\t\t\t\t// \tcos(rotation) * (f.x - mid) + sin(rotation) * (f.y - mid) + mid,\n\t\t\t\t// \tcos(rotation) * (f.y - mid) - sin(rotation) * (f.x - mid) + mid\n\t\t\t\t// );\n\t\t\t\t// f = fract(f);\n\n                f = f * 2.0 - 1.0;\n\n\t\t\t\t// Recompute integer coords after shifting - then, random value per tile \n\t\t\t\ti = floor(uv);\n\t\t\t\tfloat rand = (hashwithoutsine12(i) * 5.0 + 1.0);\n\t\t\t\tfloat jitter = mix(1.0, rand, variation);\n\t\t\t\tf *= jitter;\n\n                return f;\n            }",[e]);return{tileAndCenter:t,circle:new PK("float circle(in vec2 uv, in vec2 frequency, in float size, in float variation, in float smoothness, in float zigzag, in float rotation) {\n                vec2 f = tile_and_center(uv, frequency, variation, zigzag, rotation);\n                return smoothstep(\n                    -smoothness, \n                     smoothness, \n                     length(f) - size\n                );\n            }",[t]),ring:new PK("float ring(in vec2 uv, in vec2 frequency, in float size, in float variation, in float smoothness, in float zigzag, in float rotation) {\n                vec2 f = tile_and_center(uv, frequency, variation, zigzag, rotation);\n\n\t\t\t\tfloat d = length(f);\n                const float inner_width = 0.5;\n\n                float outer = smoothstep(-smoothness, smoothness, d - size);\n                float inner = smoothstep(-smoothness, smoothness, d - size * inner_width);\n\t\t\t\treturn outer + (1.0 - inner);   \n            }",[t]),polygon:new PK("float sdf_ngon(in vec2 p, in float r, in int n) {\n                float an = (PI * 2.0) / float(n);\n                float he = r * tan(0.5 * an);\n                \n                // Rotate to first sector\n                p = -p.yx; \n                float bn = an * floor((atan(p.y, p.x) + 0.5 * an) / an);\n                vec2  cs = vec2(cos(bn), sin(bn));\n                p = mat2(cs.x, -cs.y, cs.y, cs.x)*p;\n            \n                // Side of polygon\n                return length(p - vec2(r, clamp(p.y, -he, he))) * sign(p.x - r);\n            }\n            \n            float polygon(in vec2 uv, in vec2 frequency, in float size, in float variation, in float smoothness, in float zigzag, in float rotation, in int sides) {\n                vec2 f = tile_and_center(uv, frequency, variation, zigzag, rotation);\n                return smoothstep(-smoothness, smoothness, sdf_ngon(f, size, sides));\n            }",[t]),cross:new PK("float sdf_cross(in vec2 p, in vec2 b, float r ) {\n                p = abs(p); \n\t\t\t\tp = (p.y > p.x) ? p.yx : p.xy;\n                vec2  q = p - b;\n                float k = max(q.y, q.x);\n                vec2  w = (k > 0.0) ? q : vec2(b.y - p.x, -k);\n                return sign(k) * length(max(w, 0.0)) + r;\n            }\n            \n            // Avoid namespace conflicts \n            float xcross(in vec2 uv, in vec2 frequency, in float size, in float variation, in float smoothness, in float zigzag, in float rotation) {\n                vec2 f = tile_and_center(uv, frequency, variation, zigzag, rotation);\n                return smoothstep(-smoothness, smoothness, sdf_cross(f, vec2(size, size * 0.25), smoothness));\n            }",[t]),diamond:new PK("float ndot(vec2 a, vec2 b) { \n                return a.x*b.x - a.y*b.y; \n            }\n            \n            float sdf_diamond(in vec2 p, in vec2 b) {\n                p = abs(p);\n                float h = clamp(ndot(b - 2.0 * p, b) / dot(b, b), -1.0, 1.0);\n                float d = length(p - 0.5 * b * vec2(1.0 - h, 1.0 + h));\n                return d * sign(p.x * b.y + p.y * b.x - b.x * b.y);\n            }\n\n            float diamond(in vec2 uv, in vec2 frequency, in float size, in float variation, in float smoothness, in float zigzag, in float rotation) {\n                vec2 f = tile_and_center(uv, frequency, variation, zigzag, rotation);\n\t            return smoothstep(-smoothness, smoothness, sdf_diamond(f, vec2(size)));\n            }",[t]),checkerboard:new PK("float checkerboard(in vec2 uv, in vec2 frequency, in float size, in float variation, in float smoothness, in float zigzag, in float rotation) {\n                uv *= frequency;\n                vec2 i = floor(uv);\n\n                float offset = mod(i.y, 2.0);\n\n                uv.x += offset + zigzag * offset;\n                float x = floor(uv.x);\n                \n                return mod(x, 2.0);\n            }"),line:new PK("float line(in vec2 uv, in vec2 frequency, in float size, in float variation, in float smoothness, in float zigzag, in float rotation) {\n                vec2 f = tile_and_center(uv, frequency, 0.0, zigzag, rotation);\n\t\t\t\t\n\t\t\t\t// Different approach for variation param here\n\t\t\t\tfloat row = floor(uv * frequency).y;\n\t\t\t\tfloat rand = hashwithoutsine12(vec2(row));\n\t\t\t\tfloat s = mix(size, size * rand, variation);\n\n\t\t\t\treturn smoothstep(\n\t\t\t\t\ts - smoothness, \n\t\t\t\t\ts + smoothness, \n\t\t\t\t\tabs(f.y)\n\t\t\t\t);\n            }",[t]),wave:new PK("// Uses bisection \n            float udf_cos(in vec2 p, in float a, in float b, in float c, in float d) {\n                // Convert all data to a primitive cosine wave\n                p = c * (p - vec2(d, a));\n                \n                const float TWO_PI = PI * 2.0;\n\n                // Reduce to principal half cycle\n                p.x = mod(p.x, TWO_PI); \n                if (p.x > PI) {\n                    p.x = TWO_PI - p.x;\n                }\n            \n                // Find zero of derivative (minimize distance)\n                float xa = 0.0;\n                float xb = TWO_PI;\n\n                // 24 bit precision\n                for (int i = 0; i < 24; i++) {\n                    float x = 0.5 * (xa + xb);\n                    float y = x - p.x + b * c * sin(x) * (p.y - b * c * cos(x));\n                    if (y < 0.0) xa = x; \n                    else xb = x;\n                }\n                float x = 0.5 * (xa + xb);\n                \n                // Compute distance    \n                vec2 q = vec2(x, b * c * cos(x));\n                return length(p - q) / c;\n            }\n\n            float wave(in vec2 uv, in vec2 frequency, in float size, in float variation, in float smoothness, in float zigzag, in float rotation) {\n                float repeat = frequency.x;\n                uv *= repeat;\n                vec2 i = floor(uv);\n                float row_offset = mod(i.y, 2.0);\n                uv.x += row_offset * zigzag;\n                vec2 f = vec2(uv.x, fract(uv.y));\n\n                // Generalized cosine: y(x) = a + b * cos(cx + d)\n                const float amplitude = 0.125;\n                float wave_frequency = frequency.y * 0.1;\n                float distance_estimate = udf_cos(f, 0.50, amplitude, wave_frequency * (2.0 * PI), 0.0);\n\n\t\t\t\t// Different approach for variation param here\n\t\t\t\tfloat rand = hashwithoutsine12(vec2(i.y));\n\t\t\t\tfloat s = mix(size, size * rand, variation);\n\n                return smoothstep(-smoothness, smoothness, distance_estimate - s * 0.5);\n            }")}}();var VJ=class extends wK{constructor(e,t,i,n,r,a,s,o){super("v3"),this.nodeType="Rainbow",this.filmThickness=e,this.movement=t,this.wavelengths=i,this.noiseStrength=n,this.noiseScale=r,this.offset=a,this.isMask=o,this.alpha=s,this.calpha="g".concat(this.uuid.toString().replace(/-/g,""),"_calpha")}generate(e,t){if(e.require("vWorldViewDir"),e.require("worldNormal"),e.isShader("fragment")){e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let i=e.include(VJ.Nodes.rainbow),n=[];return n.push(this.filmThickness.build(e,"f")),n.push(this.movement.build(e,"f")),n.push(this.wavelengths.build(e,"v3")),n.push(this.noiseStrength.build(e,"f")),n.push(this.noiseScale.build(e,"f")),n.push(this.offset.build(e,"v3")),n.push(this.isMask.build(e,"b")),n.push(this.mask?"luminance(".concat(this.mask.flow(e,"v3").result,")"):"1.0"),n.push(this.alpha.build(e,"f")),n.push(this.calpha),e.format(i+"("+n.join(",")+")",this.getType(e),t)}return console.warn("RainbowNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}},UJ=VJ;UJ.Nodes=function(){let e=new PK("vec3 attenuation(vec3 wavelengths, float filmThickness, float movement, float noiseStrength, float noiseScale, vec3 offset) {\n                 vec3 st = position / noiseScale;\n\t\t\t\t vec3 q = vec3(simplex3d(st),\n\t\t\t\t\t\t\t  simplex3d(st + vec3(1.0)),\n\t\t\t\t\t\t\t  simplex3d(st + vec3(1.0)));\n\n\t\t\t\t vec3 r = vec3(simplex3d(st + vec3(1.4, 1.3, 1.0) * q + vec3(1.7, 9.2, 1.0)),\n\t\t\t\t\t\t\t  simplex3d(st + vec3(2.0, 1.2, 1.0) * q + vec3(8.3, 2.8, 1.0)),\n\t\t\t\t\t\t\t  simplex3d(st * q));\n\n                 float noise = simplex3d(st + r);\n\n                 return .5 + .5 * cos((((filmThickness + (noise * noiseStrength)) / (vec3(wavelengths.r * 1.0, wavelengths.g * 0.8, wavelengths.b * 0.6) + 1.0)) * dot(normalize(vWorldViewDir + (offset * -0.001)), normalize(vWNormal))) + movement);\n             }",[LJ.simplex]);return{rainbow:new PK("vec3 rainbow(float filmThickness, float movement, vec3 wavelengths, float noiseStrength, float noiseScale, vec3 offset, bool isMask, float mask, float alpha, out float calpha) {\n\t\t\t\tvec3 res = clamp(attenuation(wavelengths, filmThickness, movement, noiseStrength, noiseScale, offset), 0.0, 2.0);\n\n\t\t\t\tfloat rainbowContribution = clamp(res.r + res.g + res.b, 0.0, 1.0);\n\n\t\t\t\tfloat lalpha = alpha * rainbowContribution * mask;\n\t\t\t\tcalpha = mix(lalpha / clamp(lalpha + accumAlpha, 0.00001, 1.0), lalpha, float(isMask));\n\t\t\t\taccumAlpha += (1.0 - accumAlpha) * lalpha * (1.0 - float(isMask));\n\n\t\t\t\treturn res;\n             }",[e])}}();var GJ=class extends wK{constructor(e,t,i,n,r,a,s,o,l,c){super("v3"),this.nodeType="Toon",this.positioning=e,this.colors=t,this.steps=i,this.source=n,this.isWorldSpace=r,this.noiseStrength=a,this.noiseScale=s,this.shadowColor=o,this.offset=l,this.alpha=c,this.calpha="g".concat(this.uuid.toString().replace(/-/g,""),"_calpha")}generate(e,t){if(e.require("worldNormal"),e.require("worldPosition"),e.isShader("fragment")){e.define("COLORS_MAX",10),e.addFragmentVariable(this.calpha,"float");let i=e.include(GJ.Nodes.toon),n=[];return n.push(this.positioning.build(e,"i")),n.push(this.colors.build(e,"v4[]")),n.push(this.steps.build(e,"f[]")),n.push(this.source.build(e,"v3")),n.push(this.isWorldSpace.build(e,"b")),n.push(this.noiseStrength.build(e,"f")),n.push(this.noiseScale.build(e,"f")),n.push(this.shadowColor.build(e,"v4")),n.push(this.offset.build(e,"v3")),n.push(this.mask?"luminance(".concat(this.mask.flow(e,"v3").result,")"):"1.0"),n.push(this.alpha.build(e,"f")),n.push(this.calpha),e.format(i+"("+n.join(",")+")",this.getType(e),t)}return console.warn("ToonNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}},HJ=GJ;HJ.Nodes=function(){let e=new PK("float rand(float n) {\n\t\t\t\treturn fract(sin(n) * 43758.5453123);\n\t\t\t}"),t=new PK("float hash1(float p) { \n\t\t\t\tp = fract(p * 0.011); \n\t\t\t\tp *= p + 7.5; \n\t\t\t\tp *= p + p; \n\t\t\t\treturn fract(p); \n\t\t\t}"),i=new PK("float valueNoise(vec3 x) {\n\t\t\t\tconst vec3 step = vec3(110, 241, 171);\n\t\t\t\n\t\t\t\tvec3 i = floor(x);\n\t\t\t\tvec3 f = fract(x);\n\t\t\t \n\t\t\t\t// For performance, compute the base input to a 1D hash from the integer part of the argument and the \n\t\t\t\t// incremental change to the 1D based on the 3D -> 1D wrapping\n\t\t\t\tfloat n = dot(i, step);\n\t\t\t\n\t\t\t\tvec3 u = f * f * (3.0 - 2.0 * f);\n\t\t\t\treturn mix(mix(mix( hash1(n + dot(step, vec3(0, 0, 0))), hash1(n + dot(step, vec3(1, 0, 0))), u.x),\n\t\t\t\t\t\t\t   mix( hash1(n + dot(step, vec3(0, 1, 0))), hash1(n + dot(step, vec3(1, 1, 0))), u.x), u.y),\n\t\t\t\t\t\t   mix(mix( hash1(n + dot(step, vec3(0, 0, 1))), hash1(n + dot(step, vec3(1, 0, 1))), u.x),\n\t\t\t\t\t\t\t   mix( hash1(n + dot(step, vec3(0, 1, 1))), hash1(n + dot(step, vec3(1, 1, 1))), u.x), u.y), u.z);\n\t\t\t}",[t]),n=new PK("vec3 hash3(vec3 x) {\n\t\t\t\tx = vec3(dot(x,vec3(127.1, 311.7, 74.7)),\n\t\t\t\t\t\t dot(x,vec3(269.5, 183.3, 246.1)),\n\t\t\t\t\t\t dot(x,vec3(113.5, 271.9, 124.6)));\n\t\t\t\n\t\t\t\treturn fract(sin(x)*43758.5453123);\n\t\t\t}"),r=new PK('vec3 voronoiNoise(in vec3 x)\n\t\t\t{\n\t\t\t\tvec3 p = floor(x);\n\t\t\t\tvec3 f = fract(x);\n\n\t\t\t\tfloat id = 0.0;\n\t\t\t\tvec2 res = vec2(100.0);\n\n\t\t\t\tfor(int k=-1; k<=1; k++)\n\t\t\t\tfor(int j=-1; j<=1; j++)\n\t\t\t\tfor(int i=-1; i<=1; i++)\n\t\t\t\t{\n\t\t\t\t\tvec3 b = vec3(float(i), float(j), float(k));\n\n\t\t\t\t\t// Comment out the "+ hash(p + b);" part below to get "square" cells\n\t\t\t\t\tvec3 r = vec3(b) - f + hash3(p + b);\n\t\t\t\t\tfloat d = dot(r, r);\n\n\t\t\t\t\tif (d < res.x)\n\t\t\t\t\t{\n\t\t\t\t\t\tid = dot(p + b, vec3(1.0, 57.0, 113.0));\n\t\t\t\t\t\tres = vec2(d, res.x);\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse if (d < res.y)\n\t\t\t\t\t{\n\t\t\t\t\t\tres.y = d;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn vec3(sqrt(res), abs(id));\n\t\t\t}\n\t\t\t',[n]);return{toon:new PK('vec3 toon(int positioning, vec4 colors[COLORS_MAX], float steps[COLORS_MAX], vec3 source, bool isWorldSpace, float noiseStrength, float noiseScale, vec4 shadowColor, vec3 offset, float mask, float alpha, out float calpha) {\n\t\t\t\tfloat t = 0.0;\n\t\t\t\tfloat shadow = 1.0;\n\n\t\t\t\tif (positioning == 0) {\n\n\t\t\t\t\t// Can\'t do this mode if lighting is "none"\n\t\t\t\t\t#if (defined(PHONG) || defined(LAMBERT) || defined(STANDARD))\n\n\t\t\t\t\t\t// Algorithm from Chapter 10 of Graphics Shaders\n\t\t\t\t\t\tconst vec3 weights = vec3(0.2125, 0.7154, 0.0721);\n\t\t\t\t\t\tvec3 lpos;\n\t\t\t\t\t\tvec3 l;\n\t\t\t\t\t\tfloat dproduct;\n\n\t\t\t\t\t\t#if (NUM_POINT_LIGHTS > 0)\n\n\t\t\t\t\t\t\t#if defined(USE_SHADOWMAP) && (NUM_POINT_LIGHT_SHADOWS > 0)\n\t\t\t\t\t\t\t\tPointLightShadow pointLightShadow;\n\t\t\t\t\t\t\t#endif \n\n\t\t\t\t\t\t\t#pragma unroll_loop_start\n\t\t\t\t\t\t\tfor (int i = 0; i < NUM_POINT_LIGHTS; i++) {\n\t\t\t\t\t\t\t\t// Light positions are in view-space for some reason?\n\t\t\t\t\t\t\t\tlpos = (inverse(viewMatrix) * vec4(pointLights[UNROLLED_LOOP_INDEX].position, 1.0)).xyz;\n\t\t\t\t\t\t\t\tl = normalize(lpos - worldPosition);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tdproduct = dot(l, normalize(worldNormal)) * 0.5 + 0.5;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// TODO: we want to use "intensity" but it isn\'t available in the shader code\n\t\t\t\t\t\t\t\t//dproduct += dot(pointLights[UNROLLED_LOOP_INDEX].color, weights);\n\n\t\t\t\t\t\t\t\tt = max(t, dproduct);\n\n\t\t\t\t\t\t\t\t// Accumulate shadow contribution\n\t\t\t\t\t\t\t\t#if defined(USE_SHADOWMAP) && (UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS)\n\t\t\t\t\t\t\t\t\tpointLightShadow = pointLightShadows[UNROLLED_LOOP_INDEX];\n\t\t\t\t\t\t\t\t\tshadow *= getPointShadow( \n\t\t\t\t\t\t\t\t\t\t\tpointShadowMap[UNROLLED_LOOP_INDEX], \n\t\t\t\t\t\t\t\t\t\t\tpointLightShadow.shadowMapSize, \n\t\t\t\t\t\t\t\t\t\t\tpointLightShadow.shadowBias, \n\t\t\t\t\t\t\t\t\t\t\tpointLightShadow.shadowRadius,\n\t\t\t\t\t\t\t\t\t\t\tvPointShadowCoord[UNROLLED_LOOP_INDEX], \n\t\t\t\t\t\t\t\t\t\t\tpointLightShadow.shadowCameraNear, \n\t\t\t\t\t\t\t\t\t\t\tpointLightShadow.shadowCameraFar);\n\t\t\t\t\t\t\t\t#endif\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t#pragma unroll_loop_end\n\n\t\t\t\t\t\t#endif\n\n\t\t\t\t\t\t#if NUM_DIR_LIGHTS > 0 \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t#if defined(USE_SHADOWMAP) && (NUM_DIR_LIGHT_SHADOWS > 0)\n\t\t\t\t\t\t\t\tDirectionalLightShadow directionalLightShadow;\n\t\t\t\t\t\t\t#endif \n\n\t\t\t\t\t\t\t#pragma unroll_loop_start\n\t\t\t\t\t\t\tfor (int i = 0; i < NUM_DIR_LIGHTS; i++) {\n\t\t\t\t\t\t\t\t// Use the direction vector for directional lights instead\n\t\t\t\t\t\t\t\tl = (inverse(viewMatrix) * vec4(directionalLights[UNROLLED_LOOP_INDEX].direction, 0.0)).xyz;\n\t\t\n\t\t\t\t\t\t\t\tdproduct = dot(l, normalize(worldNormal)) * 0.5 + 0.5;\n\t\t\t\t\t\t\t\tt = max(t, dproduct);\n\n\t\t\t\t\t\t\t\t// Accumulate shadow contribution\n\t\t\t\t\t\t\t\t#if defined(USE_SHADOWMAP) && (UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS)\n\t\t\t\t\t\t\t\t\tdirectionalLightShadow = directionalLightShadows[UNROLLED_LOOP_INDEX];\n\t\t\t\t\t\t\t\t\tshadow *= getShadow( \n\t\t\t\t\t\t\t\t\t\tUNROLLED_LOOP_INDEX,\n\t\t\t\t\t\t\t\t\t\tdirectionalShadowMap[UNROLLED_LOOP_INDEX], \n\t\t\t\t\t\t\t\t\t\tdirectionalLightShadow.shadowMapSize, \n\t\t\t\t\t\t\t\t\t\tdirectionalLightShadow.shadowBias, \n\t\t\t\t\t\t\t\t\t\tdirectionalLightShadow.shadowRadius, \n\t\t\t\t\t\t\t\t\t\tvDirectionalShadowCoord[UNROLLED_LOOP_INDEX]);\n\t\t\t\t\t\t\t\t#endif\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t#pragma unroll_loop_end\n\n\t\t\t\t\t\t#endif\n\n\t\t\t\t\t\t#if NUM_SPOT_LIGHTS > 0 \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t#if defined(USE_SHADOWMAP) && (NUM_SPOT_LIGHT_SHADOWS > 0)\n\t\t\t\t\t\t\t\tSpotLightShadow spotLightShadow;\n\t\t\t\t\t\t\t#endif \n\n\t\t\t\t\t\t\t#pragma unroll_loop_start\n\t\t\t\t\t\t\tfor (int i = 0; i < NUM_SPOT_LIGHTS; i++) {\n\t\t\t\t\t\t\t\tlpos = (inverse(viewMatrix) * vec4(spotLights[UNROLLED_LOOP_INDEX].position, 1.0)).xyz;\n\t\t\t\t\t\t\t\tl = normalize(lpos - worldPosition);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tdproduct = dot(l, normalize(worldNormal)) * 0.5 + 0.5;\n\t\t\t\t\t\t\t\tt = max(t, dproduct);\n\n\t\t\t\t\t\t\t\t// Accumulate shadow contribution\n\t\t\t\t\t\t\t\t#if defined(USE_SHADOWMAP) && (UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS)\n\t\t\t\t\t\t\t\t\tspotLightShadow = spotLightShadows[UNROLLED_LOOP_INDEX];\n\t\t\t\t\t\t\t\t\tshadow *= getShadow(\n\t\t\t\t\t\t\t\t\t\tUNROLLED_LOOP_INDEX,\n\t\t\t\t\t\t\t\t\t\tspotShadowMap[UNROLLED_LOOP_INDEX], \n\t\t\t\t\t\t\t\t\t\tspotLightShadow.shadowMapSize, \n\t\t\t\t\t\t\t\t\t\tspotLightShadow.shadowBias, \n\t\t\t\t\t\t\t\t\t\tspotLightShadow.shadowRadius, \n\t\t\t\t\t\t\t\t\t\tvSpotLightCoord[UNROLLED_LOOP_INDEX]);\n\t\t\t\t\t\t\t\t#endif\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t#pragma unroll_loop_end\n\n\t\t\t\t\t\t#endif\n\n\t\t\t\t\t\tt = clamp(t, 0.0, 1.0);\n\t\t\t\t\n\t\t\t\t\t#endif\n\n\t\t\t\t} else if (positioning == 1) {\n\t\t\t\t\t\n\t\t\t\t\tvec3 origin = mix(position, worldPosition, float(isWorldSpace));\n\t\t\t\t\tvec3 direction = normalize(source - origin);\n\t\t\t\t\tt = dot(direction, normalize(worldNormal)) * 0.5 + 0.5;\t\n\n\t\t\t\t} else {\n\n\t\t\t\t\tvec3 origin = worldPosition;\n\t\t\t\t\tvec3 source = cameraPosition - offset;\n\t\t\t\t\tvec3 direction = normalize(source - origin);\n\t\t\t\t\tt = dot(direction, normalize(worldNormal)) * 0.5 + 0.5;\t\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\tif (noiseStrength > 0.0) {\n\t\t\t\t\t// Distort with noise\n\t\t\t\t\tvec3 st = position / noiseScale;\n\t\t\t\t\t\n\t\t\t\t\t// Voronoi "smooth" noise\n\t\t\t\t\tfloat noise = 1.0 - voronoiNoise(st).x;\n\n\t\t\t\t\t// Voronoi cellular noise\n\t\t\t\t\t//float noise = 1.0 - rand(voronoiNoise(st).z);\n\n\t\t\t\t\t// Position warp noise\n\t\t\t\t\t// vec3 offset = vec3(\n\t\t\t\t\t// \tsimplex3d(st),\n\t\t\t\t\t// \tsimplex3d(st + vec3(111.1, 143.89, 217.19)),\n\t\t\t\t\t// \tsimplex3d(st + vec3(171.1, 247.89, 117.23))\n\t\t\t\t\t// );\n\t\t\t\t\t// st += offset;\n\t\t\t\t\t// float noise = valueNoise(st);\n\n\t\t\t\t\tt += noise * noiseStrength;\n\t\t\t\t}\n\n\t\t\t\tt = clamp(t, 0.0, 1.0);\n\n\t\t\t\t// Compute ramp color\n\t\t\t\tfloat p;\n\t\t\t\tvec4 color = colors[0];\n\t\t\t\tfor (int i = 1; i < COLORS_MAX; i++) {\n\t\t\t\t\tp = clamp((t - steps[i-1]) / (steps[i] - steps[i-1]), 0.0, 1.0);\n\t\t\t\t\tcolor = mix(color, colors[i], smoothstep(0.0, 1.0, p));\n\t\t\t\t}\n\n\t\t\t\t// Incorporate custom shadow color\n\t\t\t\tif (positioning == 0) {\n\n\t\t\t\t\tvec3 blendedShadow = mix(color.rgb, shadowColor.rgb, shadowColor.a);\n\t\t\t\t\tcolor.rgb = mix(blendedShadow, color.rgb, shadow);\n\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t// Accumulate alpha as usual\n\t\t\t\tfloat lalpha = alpha * color.a * mask;\n\t\t\t\tcalpha =  lalpha / clamp(lalpha + accumAlpha, 0.00001, 1.0);\n\t\t\t\taccumAlpha += (1.0 - accumAlpha) * lalpha;\n\n\t\t\t\treturn color.xyz;\n\n            }',[LJ.simplex,e,i,r])}}();var WJ={textureBicubic:new PK("float w0( float a ) {\n            return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n        }\n    \n        float w1( float a ) {\n            return ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );\n        }\n    \n        float w2( float a ){\n            return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n        }\n    \n        float w3( float a ) {\n            return ( 1.0 / 6.0 ) * ( a * a * a );\n        }\n    \n        // g0 and g1 are the two amplitude functions\n        float g0( float a ) {\n            return w0( a ) + w1( a );\n        }\n    \n        float g1( float a ) {\n            return w2( a ) + w3( a );\n        }\n    \n        // h0 and h1 are the two offset functions\n        float h0( float a ) {\n            return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n        }\n    \n        float h1( float a ) {\n            return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n        }\n    \n        vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n            uv = uv * texelSize.zw + 0.5;\n    \n            vec2 iuv = floor( uv );\n            vec2 fuv = fract( uv );\n    \n            float g0x = g0( fuv.x );\n            float g1x = g1( fuv.x );\n            float h0x = h0( fuv.x );\n            float h1x = h1( fuv.x );\n            float h0y = h0( fuv.y );\n            float h1y = h1( fuv.y );\n    \n            vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n            vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n            vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n            vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n    \n            return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + \n                   g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n        }\n\n        vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n            vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n            vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n            vec2 fLodSizeInv = 1.0 / fLodSize;\n            vec2 cLodSizeInv = 1.0 / cLodSize;\n            vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n            vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n            return mix( fSample, cSample, fract( lod ) );\n        }")};var qJ=class extends wK{constructor(e,t,i,n,r,a,s,o){super("v3"),this.nodeType="Transmission",this.thickness=e,this.ior=t,this.roughness=i,this.transmissionSamplerSize=n,this.transmissionSamplerMap=r,this.transmissionDepthMap=a,this.aspectRatio=s,this.alpha=o,this.calpha="g".concat(this.uuid.toString().replace(/-/g,""),"_calpha")}generate(e,t){if(e.extensions.shaderTextureLOD=!0,e.extensions.derivatives=!0,e.isShader("fragment")){e.define("NUM_SAMPLES",6),e.define("BLUR_SLOD",Math.pow(2,KJ.transmissionLod.value)),e.require("worldPosition"),e.requires.worldNormal=!0,e.requires.modelMatrix=!0,e.requires.projectionMatrix=!0,e.addFragmentVariable(this.calpha,"float");let i=e.include(qJ.Nodes.transmission),n=[];return n.push(this.thickness.build(e,"f")),n.push(this.ior.build(e,"f")),n.push(this.roughness.build(e,"f")),n.push(this.transmissionSamplerSize.build(e,"v2")),n.push(this.transmissionSamplerMap.getTexture(e,"t")),n.push(this.transmissionDepthMap.getTexture(e,"t")),n.push(this.aspectRatio.build(e,"v2")),n.push("normal"),n.push(this.mask?"luminance(".concat(this.mask.flow(e,"v3").result,")"):"1.0"),n.push(this.alpha.build(e,"f")),n.push(this.calpha),e.format(i+"("+n.join(",")+")",this.getType(e),t)}return console.warn("TransmissionNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}},XJ=qJ;XJ.Nodes=function(){let e=new PK("vec3 blur(sampler2D sp, vec2 U, vec2 scale, float lod, sampler2D dm, vec2 unrefractedU, vec2 aspectRatio) {\n                // Slightly modified version of this:\n                // https://www.shadertoy.com/view/ltScRG\n\n\t\t\t\t// Special case for blur == 0.0\n\t\t\t\tif (lod == 0.0) {\n\t\t\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\t\treturn texture2DLodEXT( sp, U, 0.0).rgb;\n\t\t\t\t\t#else\n\t\t\t\t\treturn textureLod( sp, U, 0.0).rgb;\n\t\t\t\t\t#endif\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvec2 texelSize = vec2(1.0) / resolution;\n                vec2 halton = haltonSequence[frameIndex];\n                float temporalOffset = getNoiseInterleavedGradient(gl_FragCoord.xy + halton);\n                float temporalAngle  = temporalOffset * PI2;\n\t\t\t\tvec3 res = vec3(0.0);\n                vec2 uv = vec2(0.0);\n                vec2 offset = vec2(0.0);\n                vec2 vogelSample = vec2(0.0);\n                for (int i = 0; i < NUM_SAMPLES; i++) {\n                    vogelSample =  vogelDiskSample(i, NUM_SAMPLES, temporalAngle) * texelSize;\n                    offset = vogelSample * scale * (lod * 10.0); // TODO: used to be hardcoded to 20\n                    uv = U + offset;\n                    float opaqueDepth = unpackRGBAToDepth(textureLod(dm, uv, lod));\n                    if (opaqueDepth != 0.0 && opaqueDepth < gl_FragCoord.z) {\n                        uv = unrefractedU;\n                        lod = lod > 4.0 ? lod : lod / 2.0;\n                    }\n                    res += textureLod(sp, uv, lod).rgb;\n                }\n                return res / float(NUM_SAMPLES);\n            }"),t=new PK("vec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) {\n\t\t        // Direction of refracted light.\n\t\t        vec3 refractionVector = refract( -v,  n, 1.0 / ior );\n\t\t        \n\t\t\t\t// Compute rotation-independant scaling of the model matrix.\n\t\t        vec3 modelScale;\n\t\t        modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\t        modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\t        modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\n\t\t        // The thickness is specified in local space\n\t\t        return normalize( refractionVector ) * thickness * modelScale;\n\t        }"),i=new PK("float applyIorToRoughness( float roughness, float ior ) {\n\t\t\t\t// Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and\n\t\t\t\t// an IOR of 1.5 results in the default amount of microfacet refraction.\n\t\t\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t\t\t}"),n=new PK('vec3 getTransmissionSample( vec2 fragCoord, float roughness, float ior, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 unrefractedCoords, vec2 aspectRatio) {\n\t\t\t\t// Threejs exports do not pass a depth map to this shader, so we have to fallback to the "Threejs method of blurring" - see\n\t\t\t\t// also the code in convertTransmission.ts, which runs during export\n\t\t\t\t#ifdef IS_THREEJS_EXPORT\n\t\t\t\t\tfloat lod = log2(transmissionSamplerSize.x) * applyIorToRoughness(roughness / 5.0, ior);\n\t\t\t\t\treturn textureBicubic(transmissionSamplerMap, fragCoord.xy, lod).rgb;\n\t\t\t\t#else\n\t\t\t\t\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t\t\t\tfloat lod = applyIorToRoughness(roughness, ior);\n\t\t\t\t\treturn blur(transmissionSamplerMap, fragCoord, vec2(lod), min(framebufferLod / 5.5, 8.5), transmissionDepthMap, unrefractedCoords, aspectRatio);\n\t\t\t\t#endif\n\t\t\t}',[WJ.textureBicubic,i,e]),r=new PK("vec3 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\n\t\t\t\t// Project refracted vector on the framebuffer, while mapping to normalized device coordinates.\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix *  vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\n\t\t\t\tvec4 ndcPosUnrefracted = projMatrix * viewMatrix * vec4(position, 1.0 );\n\t\t\t\tvec2 unrefractedCoords = ndcPosUnrefracted.xy / ndcPosUnrefracted.w;\n\t\t\t\tunrefractedCoords += 1.0;\n\t\t\t\tunrefractedCoords /= 2.0;\n\n\t\t\t\t// Sample framebuffer to get pixel the refracted ray hits.\n\t\t\t\treturn getTransmissionSample( refractionCoords, roughness, ior, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, unrefractedCoords, aspectRatio );\n    \t\t}",[n,t]);return{transmission:new PK("vec3 transmission(float thickness, float ior, float roughness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio, vec3 normal, float mask, float alpha, out float calpha) {\n                vec3 v = vec3(0.);\n                if (isOrthographic) {\n                    v = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n                } else {\n                    v = normalize(vWPosition - cameraPosition);\n                }\n                vec3 transmission = getIBLVolumeRefraction(vWNormal, -v, roughness,  vWPosition, modelMatrix, viewMatrix, projectionMatrix, ior, thickness, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, aspectRatio );\n                \n\t\t\t\tfloat lalpha = alpha * mask;\n\t\t\t\tcalpha =  lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 );\n\t\t\t\taccumAlpha += ( 1.0 - accumAlpha ) * alpha;\n\n\t\t\t\treturn transmission;\n            }",[r])}}();var YJ=(e=>(e.NOISE="noise",e.MAP="map",e))(YJ||{}),QJ=class extends wK{constructor(e,t,i,n,r,a,s,o,l,c,h){super("v3"),this.displacementTypeIndex=new cJ(0),this.nodeType="VertexDisplacement",this.intensity=e,this.movementOrTexture=t,"map"===Object.values(YJ)[this.displacementTypeIndex.value]&&(this.mat=new mJ(this.movementOrTexture.value.matrix)),this.cropOrOffset=i,this.scale=c,this.noiseFunctionIndex=h,this.voronoiStyle=n,this.smoothness=r,this.seed=a,this.highCut=s,this.lowCut=o,this.quality=l}generate(e,t){if(e.isShader("vertex")){e.define("USE_LAYER_DISPLACE");let i,n=[];switch(n.push("displaced_position"),n.push("displaced_normal"),Object.values(YJ)[this.displacementTypeIndex.value]){case"map":i=e.include(QJ.Nodes.map),n.push(this.movementOrTexture.getTexture(e,"t")),n.push("uv"),n.push(this.cropOrOffset.build(e,"f")),this.mat&&n.push(this.mat.build(e,"mat3"));break;case"noise":{let t=Object.values(RJ)[this.noiseFunctionIndex.value],r=new PK("vec3 orthogonal(vec3 v) {\n\t\t\t\t\t\t\treturn normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y));\n\t\t\t\t\t\t}"),a="voronoi"==t?"\n\t\t\t\t\tfloat v = ".concat(t,"((p + offset) * scale * 0.001 + neighbour_offset + (movement * 0.1), voronoiStyle, smoothness, seed, quality);\n\t\t\t\t\tv = remap(v, lowCut, highCut, 0.0, 1.0);\n\t\t\t\t\tv = smax(v, 0.0, smoothness * 0.25);\n\t\t\t\t\tv = smin(v, 1.0, smoothness * 0.25);\n\n\t\t\t\t\treturn p + n * v * intensity;\n\t\t\t\t\t"):"\n\t\t\t\t\treturn p + n * ".concat(t,"((p + offset) * scale * 0.001 + neighbour_offset + (movement * 0.1)) * intensity;\n\t\t\t\t\t"),s=new PK("vec3 distorted(vec3 p, vec3 n, float scale, float intensity, vec3 offset, float neighbour_offset, float movement, int voronoiStyle, float smoothness, float seed, float highCut, float lowCut, int quality) {\n\t\t\t\t\t\t\t".concat(a,"\n\t\t\t\t\t\t}"),[LJ.simplex,LJ.simplexFractal,LJ.simplexAshima,LJ.fbm,LJ.perlin,LJ.voronoi]),o=new PK("vec3 vertexDisplacementNoise(vec3 position, vec3 normal, float scale, vec3 offset, float movement, int voronoiStyle, float smoothness, float seed, float highCut, float lowCut, int quality, float intensity, out vec3 displaced_normal) {\n\t\t\t\t\t\t\tvec3 displaced_position = distorted(position, normal, scale, intensity, offset, neighbor_offset, movement, voronoiStyle, smoothness, seed, highCut, lowCut, quality);\n\t\t\t\t\t\t\tvec3 tangent1 = orthogonal(normal);\n\t\t\t\t\t\t\tvec3 tangent2 = normalize(cross(normal, tangent1));\n\n                            // TODO(Max): The distance to the neighbors was originally scaled by 0.1.\n                            // This caused some small oval/circular visual artifacts in the lighting.\n                            // For now, simply using neighbors further away betters the problem,\n                            // but we should figure out the underlying cause when we have some time.\n                            // Maybe its related to how we calculate the tangent and bitangent?\n\t\t\t\t\t\t\tvec3 nearby1 = position + tangent1;\n\t\t\t\t\t\t\tvec3 nearby2 = position + tangent2;\n\t\t\t\t\t\t\tvec3 distorted1 = distorted(nearby1, normal, scale, intensity, offset, neighbor_offset, movement, voronoiStyle, smoothness, seed, highCut, lowCut, quality);\n\t\t\t\t\t\t\tvec3 distorted2 = distorted(nearby2, normal, scale, intensity, offset, neighbor_offset, movement, voronoiStyle, smoothness, seed, highCut, lowCut, quality);\n\t\t\t\t\t\t\tdisplaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position));\n\t\t\t\t\t\t\treturn displaced_position;\n\t\t\t\t\t\t}",[s,r]);i=e.include(o),n.push(this.scale.build(e,"f")),n.push(this.cropOrOffset.build(e,"v3")),n.push(this.movementOrTexture.build(e,"f")),n.push(this.voronoiStyle.build(e,"i")),n.push(this.smoothness.build(e,"f")),n.push(this.seed.build(e,"f")),n.push(this.highCut.build(e,"f")),n.push(this.lowCut.build(e,"f")),n.push(this.quality.build(e,"i"));break}}return n.push(this.intensity.build(e,"f")),n.push("displaced_normal"),e.format(i+"("+n.join(",")+")",this.getType(e),t)}return console.warn("VertexDisplacementNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}},ZJ=QJ;ZJ.Nodes=function(){let e=new PK("vec3 orthogonal(vec3 v) {\n\t\t\t\treturn normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y));\n\t\t\t}"),t=new PK("float displacementMapTexture(sampler2D tex, float crop, vec2 uv, mat3 mat, vec2 offset) {\n\t\t\t\tvec2 uvs = (mat * vec3(uv * 2.0 - 1.0, 1.0) / 2.0 + 0.5).xy + offset;\n\t\t\t\tvec4 tmp = texture2D(tex, uvs);\n\t\t\t\tvec3 col = tmp.rgb;\n\t\t\t\tif (crop > 0.5) {\n\t\t\t\t\tif ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 )  {\n\t\t\t\t\t\treturn 0.0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn col.r;\n\t\t\t}");return{map:new PK("vec3 vertexDisplacementMap(vec3 position, vec3 normal, sampler2D tex, vec2 uv, float crop, mat3 mat, float intensity, out vec3 displaced_normal) {\n\t\t\t\tvec3 displaced_position = position + normal * displacementMapTexture(tex, crop, uv, mat, vec2(0.0)) * intensity;\n\t\t\t\tvec3 tangent1 = normalize(orthogonal(normal));\n\t\t\t\tvec3 tangent2 = normalize(cross(normal, tangent1));\n\t\t\t\tvec3 nearby1 = position + tangent1 * 0.1;\n\t\t\t\tvec3 nearby2 = position + tangent2 * 0.1;\n\t\t\t\tvec3 distorted1 = nearby1 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity;\n\t\t\t\tvec3 distorted2 = nearby2 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity;\n\t\t\t\tdisplaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position));\n\t\t\t\treturn displaced_position;\n\t\t\t}",[e,t])}}();var KJ={normalRenderTarget:new jK,normalRenderTargetDepth:new jK,transmissionRenderTarget:new jK,aspectRatio:new SK,transmissionSize:new SK(2048,2048),transmissionRenderTargetDepth:new jK,aoRenderTarget:new jK,aoEnabled:new hJ,pixelRatioNode:new VK(1),resolution:new SK,penumbraSize:new uJ(5,.5),frameIndex:new cJ(0),transmissionLod:new cJ(2)};for(let yne of Object.values(KJ))yne.isRenderGlobal=!0;var JJ,$J={skiaWasmUrl:"https://unpkg.com/@splinetool/ui-wasm@1.0.53/build/ui.wasm"},e$=class extends bK{constructor(){super("basic"),this.nodeType="Basic",this.color=new lJ(YG),this.shadingAlpha=new VK(1),this.shadingBlend=new cJ(0),this.previousModelViewMatrix=new gJ,this.previouseProjectionMatrix=new gJ}get category(){return"phong"}generate(e){let t;if(e.isShader("vertex")){let i=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform({frameIndex:KJ.frameIndex}),e.mergeUniform({resolution:KJ.resolution}),e.mergeUniform({previousModelViewMatrix:this.previousModelViewMatrix}),e.mergeUniform({previousProjectionMatrix:this.previouseProjectionMatrix}),e.mergeUniform(RT.merge([$T.fog])),e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vWPosition;","#include <fog_pars_vertex>","#include <normal_pars_vertex>"].join("\n"));let n=["#include <beginnormal_vertex>","\n\t\t\t\t#if !defined( USE_LAYER_DISPLACE )\n\t\t\t\t\t#include <defaultnormal_vertex>\n\t\t\t\t#endif\n\n\t\t\t\tvec3 displaced_position = position;\n\t\t\t\tvec3 displaced_normal = normal;\n\n\t\t\t\t#if defined( USE_LAYER_DISPLACE )\n\t\t\t\t\tvec3 transformed;\n\t\t\t\t\tvec3 transformedNormal;\n\t\t\t\t#endif\n\t\t\t\t","#include <normal_vertex>","\n\t\t\t\t#if !defined( USE_LAYER_DISPLACE )\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t#endif /* !USE_LAYER_DISPLACE */\n\t\t\t\t"];i&&n.push(i.code,i.result?"displaced_position = "+i.result+";":""),n.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED","\tvNormal = transformedNormal;","#endif"),n.push("#include <project_vertex>","#include <fog_vertex>","#include <clipping_planes_vertex>","\tvViewPosition = - mvPosition.xyz;","#include <worldpos_vertex>"),n.push("vWPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz;"),t=n.join("\n")}else{void 0===this.color&&(this.color=new lJ(YG)),this.color.analyze(e,{slot:"color"}),this.alpha&&this.alpha.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"});let i=this.color.flow(e,"c",{slot:"color"}),n=this.alpha?this.alpha.flow(e,"f"):void 0,r=this.alphaOverride?this.alphaOverride.flow(e,"f"):void 0,a=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0;e.requires.transparent=void 0!==n,e.addParsCode(["varying vec3 vWPosition;","#include <fog_pars_fragment>","#include <dithering_pars_fragment>","varying vec3 vViewPosition;","#include <normal_pars_fragment>"].join("\n"));let s=["#include <normal_fragment_begin>",i.code];n&&s.push(n.code,"#ifdef ALPHATEST"," if ( "+n.result+" <= ALPHATEST ) discard;","#endif"),a?s.push(a.code,"vec3 outgoingLight = ".concat(i.result,";"),"vec3 finalColor = spe_blend(outgoingLight, ".concat(a.result,", 1.0, SPE_BLENDING_NORMAL);")):s.push("vec3 finalColor = ".concat(i.result,";"));let o="1.0";this.mask&&(this.mask.analyze(e),o="luminance(".concat(this.mask.flow(e,"v3").result,")")),n?s.push("gl_FragColor = vec4( finalColor, accumAlpha * ".concat(n.result," * ").concat(o," );")):s.push("gl_FragColor = vec4("+i.result+", 1.0 );"),r&&s.push("gl_FragColor.a *= ".concat(r.result,";")),s.push("#include <fog_fragment>","#include <dithering_fragment>"),t=s.join("\n")}return t}},t$=class extends bK{constructor(){super("lambert"),this.nodeType="Lambert",this.color=new lJ(YG),this.emissive=new lJ(0),this.emissiveIntensity=new VK(1),this.previousModelViewMatrix=new gJ,this.previouseProjectionMatrix=new gJ,this.shadingAlpha=new VK(1),this.shadingBlend=new cJ(0),this.occlusion=new hJ(!0)}get category(){return"lambert"}build(e){let t;if(e.define("LAMBERT"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let i=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform({frameIndex:KJ.frameIndex}),e.mergeUniform({resolution:KJ.resolution}),e.mergeUniform({previousModelViewMatrix:this.previousModelViewMatrix}),e.mergeUniform({previousProjectionMatrix:this.previouseProjectionMatrix}),e.mergeUniform(RT.merge([$T.fog,$T.lights])),e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vWPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED","   #define DOUBLE_SIDED","#endif","#ifdef DOUBLE_SIDED","\tvarying vec3 vLightBack;","\tvarying vec3 vIndirectBack;","#endif","#include <bsdfs>","#include <lights_pars_begin>","#include <color_pars_vertex>","#include <fog_pars_vertex>","#include <normal_pars_vertex>","#include <shadowmap_pars_vertex>","#include <clipping_planes_pars_vertex>"].join("\n"));let n=["#include <beginnormal_vertex>","\n\t\t\t\t#ifndef USE_LAYER_DISPLACE\n\t\t\t\t\t#include <defaultnormal_vertex>\n\t\t\t\t#endif\n\n\t\t\t\tvec3 displaced_position = position;\n\t\t\t\tvec3 displaced_normal = normal;\n\n\t\t\t\t#ifdef USE_LAYER_DISPLACE\n\t\t\t\t\tvec3 transformed;\n\t\t\t\t\tvec3 transformedNormal;\n\t\t\t\t#endif\n\t\t\t\t","#include <normal_vertex>","\n\t\t\t\t#ifndef USE_LAYER_DISPLACE\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t#endif\n\t\t\t\t"];i&&n.push(i.code,i.result?"displaced_position = "+i.result+";":""),n.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED","    vNormal = transformedNormal;","#endif"),n.push("\t#include <project_vertex>","\t#include <clipping_planes_vertex>","\tvViewPosition = - mvPosition.xyz;","\t#include <worldpos_vertex>","\n\t\t\t\t\tvec3 diffuse = vec3( 1.0 );\n\t\t\t\t\tGeometricContext geometry;\n\t\t\t\t\tgeometry.position = mvPosition.xyz;\n\t\t\t\t\tgeometry.normal = normalize( transformedNormal );\n\t\t\t\t\tgeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\n\t\t\t\t"),n.push("\n\t\t\t\t\tGeometricContext backGeometry;\n\t\t\t\t\tbackGeometry.position = geometry.position;\n\t\t\t\t\tbackGeometry.normal = -geometry.normal;\n\t\t\t\t\tbackGeometry.viewDir = geometry.viewDir;\n\t\t\t\t\tvLightFront = vec3( 0.0 );\n\t\t\t\t\tvIndirectFront = vec3( 0.0 );\n\t\t\t\t\t#ifdef DOUBLE_SIDED\n\t\t\t\t\t\tvLightBack = vec3( 0.0 );\n\t\t\t\t\t\tvIndirectBack = vec3( 0.0 );\n\t\t\t\t\t#endif\n\t\t\t\t\tIncidentLight directLight;\n\t\t\t\t\tfloat dotNL;\n\t\t\t\t\tvec3 directLightColor_Diffuse;\n\t\t\t\t\tvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\n\t\t\t\t\tvIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t\t\t\t\t#ifdef DOUBLE_SIDED\n\t\t\t\t\t\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\t\t\t\t\t\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );\n\t\t\t\t\t#endif\n\t\t\t\t\t#if NUM_POINT_LIGHTS > 0\n\t\t\t\t\t\t#pragma unroll_loop_start\n\t\t\t\t\t\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\t\t\t\t\t\tgetPointLightInfo( pointLights[ i ], geometry, directLight );\n\t\t\t\t\t\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\t\t\t\t\t\tdirectLightColor_Diffuse = directLight.color;\n\t\t\t\t\t\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t\t\t\t\t\t#ifdef DOUBLE_SIDED\n\t\t\t\t\t\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t\t\t\t\t\t#endif\n\t\t\t\t\t\t}\n\t\t\t\t\t\t#pragma unroll_loop_end\n\t\t\t\t\t#endif\n\t\t\t\t\t#if NUM_SPOT_LIGHTS > 0\n\t\t\t\t\t\t#pragma unroll_loop_start\n\t\t\t\t\t\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\t\t\t\t\t\tgetSpotLightInfo( spotLights[ i ], geometry, directLight );\n\t\t\t\t\t\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\t\t\t\t\t\tdirectLightColor_Diffuse = directLight.color;\n\t\t\t\t\t\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t\t\t\t\t\t#ifdef DOUBLE_SIDED\n\t\t\t\t\t\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t\t\t\t\t\t#endif\n\t\t\t\t\t\t}\n\t\t\t\t\t\t#pragma unroll_loop_end\n\t\t\t\t\t#endif\n\t\t\t\t\t#if NUM_DIR_LIGHTS > 0\n\t\t\t\t\t\t#pragma unroll_loop_start\n\t\t\t\t\t\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\t\t\t\t\t\tgetDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\n\t\t\t\t\t\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\t\t\t\t\t\tdirectLightColor_Diffuse = directLight.color;\n\t\t\t\t\t\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t\t\t\t\t\t#ifdef DOUBLE_SIDED\n\t\t\t\t\t\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t\t\t\t\t\t#endif\n\t\t\t\t\t\t}\n\t\t\t\t\t\t#pragma unroll_loop_end\n\t\t\t\t\t#endif\n\t\t\t\t\t#if NUM_HEMI_LIGHTS > 0\n\t\t\t\t\t\t#pragma unroll_loop_start\n\t\t\t\t\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\t\t\t\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t\t\t\t\t\t#ifdef DOUBLE_SIDED\n\t\t\t\t\t\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );\n\t\t\t\t\t\t\t#endif\n\t\t\t\t\t\t}\n\t\t\t\t\t\t#pragma unroll_loop_end\n\t\t\t\t\t#endif\n\t\t\t\t","\t#include <shadowmap_vertex>","\t#include <fog_vertex>"),n.push("vWPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz;"),t=n.join("\n")}else{e.mergeUniform({penumbraSize:KJ.penumbraSize}),e.mergeUniform({frameIndex:KJ.frameIndex}),e.mergeUniform({aoMap:KJ.aoRenderTarget}),e.mergeUniform({aoEnabled:KJ.aoEnabled}),void 0===this.color&&(this.color=new lJ(YG)),this.color.analyze(e,{slot:"color"}),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let i=this.color.flow(e,"c",{slot:"color"}),n=this.emissive.flow(e,"c",{slot:"emissive"}),r=this.emissiveIntensity.flow(e,"f",{slot:"emissive"}),a=this.occlusion.flow(e,"b",{slot:"occlusion"}),s=this.shadingAlpha.flow(e,"f"),o=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0,h=this.alphaOverride?this.alphaOverride.flow(e,"f"):void 0;e.requires.transparent=void 0!==c,e.addParsCode(["uniform float penumbraSize[".concat(5,"];"),"uniform sampler2D aoMap;","uniform bool aoEnabled;","varying vec3 vViewPosition;","varying vec3 vWPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED","   #define DOUBLE_SIDED","#endif","#include <normal_pars_fragment>","#ifdef DOUBLE_SIDED","\tvarying vec3 vLightBack;","\tvarying vec3 vIndirectBack;","#endif","#include <bsdfs>","#include <lights_pars_begin>","#include <fog_pars_fragment>","#include <shadowmap_pars_fragment>","#include <shadowmask_pars_fragment>","#include <clipping_planes_pars_fragment>","#include <dithering_pars_fragment>"].join("\n"));let u=["#include <normal_fragment_begin>","\n\t\t\t\t// NOTE: gl_FrontFacing alternative using face normal estimation.\n\t\t\t\tvec3 viewdx = dFdx(vViewPosition);\n\t\t\t\tvec3 viewdy = dFdy(vViewPosition);\n\t\t\t\tvec3 faceNormal = normalize(cross(viewdx, viewdy));\n\t\t\t\tbool isFrontFacing = (dot(normal, faceNormal) >= 0.0);\n\t\t\t\t","#include <clipping_planes_fragment>"];u.push(i.code,"vec3 diffuseColor = "+i.result+";","ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("#ifdef DOUBLE_SIDED","\treflectedLight.indirectDiffuse += ( isFrontFacing ) ? vIndirectFront : vIndirectBack;","#else","\treflectedLight.indirectDiffuse += vIndirectFront;","#endif","#include <lightmap_fragment>","reflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );","#ifdef DOUBLE_SIDED","\treflectedLight.directDiffuse = ( isFrontFacing ) ? vLightFront : vLightBack;","#else","\treflectedLight.directDiffuse = vLightFront;","#endif","reflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();"),n&&u.push(n.code,"reflectedLight.directDiffuse += "+n.result+" * "+r.result+";"),u.push("vec3 ao = aoEnabled && "+a.result+" ? tex2D(aoMap, gl_FragCoord.xy / resolution).rgb : vec3(1.0);","vec3 outgoingLight = (reflectedLight.directDiffuse + reflectedLight.indirectDiffuse) ;");let d="1.0";this.mask&&(this.mask.analyze(e),d="luminance(".concat(this.mask.flow(e,"v3").result,")")),u.push("\n\t\t\t\tif (outgoingLight != diffuseColor) {\n\t\t\t\t\tfloat lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 );\n\t\t\t\t\taccumAlpha += ( 1.0 - accumAlpha ) * ".concat(s.result," * ").concat(d," * lightAccu;\n\t\t\t\t\toutgoingLight = spe_blend( diffuseColor, outgoingLight, ").concat(s.result," * ").concat(d,", ").concat(o.result," );\n\n\t\t\t\t\toutgoingLight *= ao;\n\t\t\t\t}\n\t\t\t\t")),l&&u.push(l.code,"outgoingLight = spe_blend(outgoingLight, ".concat(l.result,", 1.0, SPE_BLENDING_NORMAL);")),c?u.push("gl_FragColor = vec4( outgoingLight, accumAlpha * ".concat(c.result," );")):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),h&&u.push("gl_FragColor.a *= ".concat(h.result,";")),u.push("#include <encodings_fragment>","#include <fog_fragment>","#include <dithering_fragment>"),t=u.join("\n")}return t}},i$={dHdxy:new PK("vec2 dHdxy(sampler2D bumpMap, vec2 bumpMapUv, float bumpScale) {\n\n            // Gradient of UVs w.r.t. X coordinate (in screen-space)\n            vec2 dSTdx = dFdx(bumpMapUv);\n\n            // Gradient of UVs w.r.t. Y coordinate (in screen-space)\n            vec2 dSTdy = dFdy(bumpMapUv);\n            \n            // Forward differencing\n            float Hll = bumpScale * luminance(texture(bumpMap, bumpMapUv).rgb);\n            float dBx = bumpScale * luminance(texture(bumpMap, bumpMapUv + dSTdx).rgb) - Hll;\n            float dBy = bumpScale * luminance(texture(bumpMap, bumpMapUv + dSTdy).rgb) - Hll;\n            \n            return vec2( dBx, dBy );\n        }"),perturbNormalArb:new PK("vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n            vec3 vSigmaX = dFdx( surf_pos.xyz );\n            vec3 vSigmaY = dFdy( surf_pos.xyz );\n            vec3 vN = surf_norm; // normalized\n            \n            vN = normalize(vN);\n\n            vec3 R1 = cross( vSigmaY, vN );\n            vec3 R2 = cross( vN, vSigmaX );\n\n            R1 = normalize(R1);\n            R2 = normalize(R2);\n    \n            float fDet = dot( vSigmaX, R1 ) * faceDirection;\n    \n            vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n            return normalize( abs( fDet ) * vN - vGrad );\n        }")},n$=class extends bK{constructor(){super("phong"),this.nodeType="Phong",this.color=new lJ(YG),this.specular=new lJ(1118481),this.shininess=new VK(30),this.previousModelViewMatrix=new gJ,this.previouseProjectionMatrix=new gJ,this.shadingAlpha=new VK(1),this.shadingBlend=new cJ(0),this.occlusion=new hJ(!0)}get category(){return"phong"}build(e){let t;if(e.define("PHONG"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let i=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform({frameIndex:KJ.frameIndex}),e.mergeUniform({resolution:KJ.resolution}),e.mergeUniform({previousModelViewMatrix:this.previousModelViewMatrix}),e.mergeUniform({previousProjectionMatrix:this.previouseProjectionMatrix}),e.mergeUniform(RT.merge([$T.fog,$T.lights])),e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vWPosition;","#include <fog_pars_vertex>","#include <skinning_pars_vertex>","#include <normal_pars_vertex>","#include <shadowmap_pars_vertex>","#include <clipping_planes_pars_vertex>"].join("\n"));let n=["#include <beginnormal_vertex>","\n\t\t\t\t#include <skinbase_vertex>\n\t\t\t\t#include <skinnormal_vertex>\n\t\t\t\t#ifndef USE_LAYER_DISPLACE\n\t\t\t\t\t#include <defaultnormal_vertex>\n\t\t\t\t#endif\n\n\n\t\t\t\tvec3 displaced_position = position;\n\t\t\t\tvec3 displaced_normal = objectNormal;\n\n\t\t\t\t#ifdef USE_LAYER_DISPLACE\n\t\t\t\t\tvec3 transformed;\n\t\t\t\t\tvec3 transformedNormal;\n\t\t\t\t#endif\n\t\t\t\t","#include <normal_vertex>","\n\t\t\t\t#ifndef USE_LAYER_DISPLACE\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t#endif\n\t\t\t\t"];i&&n.push(i.code,i.result?"displaced_position = "+i.result+";":""),n.push("transformed = displaced_position;","#include <skinning_vertex>","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED","    vNormal = transformedNormal;","#endif"),n.push("\t#include <project_vertex>","\t#include <clipping_planes_vertex>","\tvViewPosition = - mvPosition.xyz;","\t#include <worldpos_vertex>","\t#include <shadowmap_vertex>","\t#include <fog_vertex>"),n.push("vWPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz;"),t=n.join("\n")}else{e.mergeUniform({penumbraSize:KJ.penumbraSize}),e.mergeUniform({frameIndex:KJ.frameIndex}),e.mergeUniform({aoMap:KJ.aoRenderTarget}),e.mergeUniform({aoEnabled:KJ.aoEnabled}),void 0===this.color&&(this.color=new lJ(YG)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e);let i=this.occlusion.flow(e,"b",{slot:"occlusion"});this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),r=this.specular.flow(e,"c"),a=this.shininess.flow(e,"f"),s=this.shadingAlpha.flow(e,"f"),o=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0,h=this.alphaOverride?this.alphaOverride.flow(e,"f"):void 0;e.requires.transparent=void 0!==c,e.addParsCode(["varying vec3 vWPosition;","uniform vec3 emissive;","uniform float penumbraSize[".concat(5,"];"),"uniform sampler2D aoMap;","uniform bool aoEnabled;","#include <normal_pars_fragment>","#include <fog_pars_fragment>","#include <bsdfs>","#include <lights_pars_begin>","#include <lights_phong_pars_fragment>","#include <shadowmap_pars_fragment>","#include <dithering_pars_fragment>"].join("\n"));let u=["#include <normal_fragment_begin>","\n\t\t\t\t// NOTE: gl_FrontFacing alternative using face normal estimation.\n\t\t\t\tvec3 viewdx = dFdx(vViewPosition);\n\t\t\t\tvec3 viewdy = dFdy(vViewPosition);\n\t\t\t\tvec3 faceNormal = normalize(cross(viewdx,viewdy));\n\t\t\t\tif (dot(normal, faceNormal) < 0.0) {\n\t\t\t\t\tnormal *= -1.0;\n\t\t\t\t}\n\t\t\t\t","\tBlinnPhongMaterial material;"];if(this.bumpMap){e.include(i$.dHdxy),e.include(i$.perturbNormalArb);let t=this.bumpMap.texture.flow(e,"t"),i=this.bumpMap.flow(e,"v3"),n=this.bumpMapIntensity?this.bumpMapIntensity.flow(e,"f").result:"1.0",r="";r=4===this.bumpMap.projection.value?"\n\t\t\t\t\tvec3 bumpNormal = vec3(0.0);\n\t\t\t\t\t{\n\t\t\t\t\t\tvec2 uv0 = g".concat(this.bumpMap.uuid.toString().replace(/-/g,""),"_writeUvs0;\n\t\t\t\t\t\tvec2 uv1 = g").concat(this.bumpMap.uuid.toString().replace(/-/g,""),"_writeUvs1;\n\t\t\t\t\t\tvec2 uv2 = g").concat(this.bumpMap.uuid.toString().replace(/-/g,""),"_writeUvs2;\n\t\t\t\t\t\tvec3 weights = g").concat(this.bumpMap.uuid.toString().replace(/-/g,""),"_triplanarWeights;\n\n\t\t\t\t\t\tvec2 grad0 = dHdxy(").concat(t.result,", uv0, ").concat(n,");\n\t\t\t\t\t\tvec3 n0 = perturbNormalArb(-vViewPosition, normal, grad0, faceDirection);\n\n\t\t\t\t\t\tvec2 grad1 = dHdxy(").concat(t.result,", uv1, ").concat(n,");\n\t\t\t\t\t\tvec3 n1 = perturbNormalArb(-vViewPosition, normal, grad1, faceDirection);\n\n\t\t\t\t\t\tvec2 grad2 = dHdxy(").concat(t.result,", uv2, ").concat(n,");\n\t\t\t\t\t\tvec3 n2 = perturbNormalArb(-vViewPosition, normal, grad2, faceDirection);\n\t\t\t\t\t\t\n\t\t\t\t\t\tbumpNormal = n0 * weights.z + n1 * weights.x + n2 * weights.y;\n\t\t\t\t\t\tbumpNormal = normalize(bumpNormal);\n\t\t\t\t\t}\n\n\t\t\t\t\tnormal = bumpNormal;\n\t\t\t\t\t"):"\n\t\t\t\t\tvec2 bumpMapCachedUv = g".concat(this.bumpMap.uuid.toString().replace(/-/g,""),"_writeUvs;\n\t\t\t\t\tvec2 grad = dHdxy(").concat(t.result,", bumpMapCachedUv, ").concat(n,");\n\t\t\t\t\tnormal = perturbNormalArb( - vViewPosition, normal, grad, faceDirection );\n\t\t\t\t\t"),u.push("// Call the Texture Layer's function once here so that it writes out its procedural UV coordinates\n\t\t\t\t\t".concat(i.result,";\n\t\t\t\t\t").concat(r,"\n\t\t\t\t\t"))}u.push(n.code,"\tvec3 diffuseColor = "+n.result+";","\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );","\tvec3 totalEmissiveRadiance = emissive;",r.code,"\tvec3 specular = "+r.result+";",a.code,"\tfloat shininess = max( 0.0001, "+a.result+" );","\tfloat specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include <lights_fragment_begin>","#include <lights_fragment_end>"),u.push("vec3 ao = aoEnabled && "+i.result+" ? tex2D(aoMap, gl_FragCoord.xy / resolution).rgb : vec3(1.0);","vec3 outgoingLight = ((reflectedLight.directDiffuse + reflectedLight.indirectDiffuse)) + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;");let d="1.0";this.mask&&(this.mask.analyze(e),d="luminance(".concat(this.mask.flow(e,"v3").result,")")),u.push("\n\t\t\t\tif (outgoingLight != diffuseColor) {\n\t\t\t\t\tfloat lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 );\n\t\t\t\t\taccumAlpha += ( 1.0 - accumAlpha ) * ".concat(s.result," * ").concat(d," * lightAccu;\n\t\t\t\t\toutgoingLight = spe_blend( diffuseColor, outgoingLight, ").concat(s.result," * ").concat(d,", ").concat(o.result," );\n\t\t\t\t\t\n\t\t\t\t\toutgoingLight *= ao;\n\t\t\t\t}\n\t\t\t\t")),l&&u.push(l.code,"outgoingLight = spe_blend(outgoingLight, ".concat(l.result,", 1.0, SPE_BLENDING_NORMAL);")),c?u.push("gl_FragColor = vec4( outgoingLight, accumAlpha * ".concat(c.result,");")):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),h&&u.push("gl_FragColor.a *= ".concat(h.result,";")),u.push("#include <encodings_fragment>","#include <fog_fragment>","#include <dithering_fragment>"),t=u.join("\n")}return t}},r$=class extends bK{constructor(){super("standard"),this.nodeType="Standard",this.color=new lJ(YG),this.roughness=new VK(.3),this.metalness=new VK(0),this.reflectivity=new VK(.5),this.previousModelViewMatrix=new gJ,this.previouseProjectionMatrix=new gJ,this.shadingAlpha=new VK(1),this.shadingBlend=new cJ(0),this.occlusion=new hJ(!0)}get category(){return"physical"}build(e){let t;if(e.define("STANDARD"),e.requires.lights=!0,e.extensions.derivatives=!0,e.extensions.shaderTextureLOD=!0,e.isShader("vertex")){let i=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform({frameIndex:KJ.frameIndex}),e.mergeUniform({resolution:KJ.resolution}),e.mergeUniform({previousModelViewMatrix:this.previousModelViewMatrix}),e.mergeUniform({previousProjectionMatrix:this.previouseProjectionMatrix}),e.mergeUniform(RT.merge([$T.fog,$T.lights])),$T.LTC_1&&(e.uniforms.ltc_1={value:void 0},e.uniforms.ltc_2={value:void 0}),e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vWPosition;","#include <fog_pars_vertex>","#include <normal_pars_vertex>","#include <shadowmap_pars_vertex>","#include <clipping_planes_pars_vertex>"].join("\n"));let n=["#include <beginnormal_vertex>","\n\t\t\t\t#if !defined( USE_LAYER_DISPLACE )\n\t\t\t\t\t#include <defaultnormal_vertex>\n\t\t\t\t#endif\n\n\t\t\t\tvec3 displaced_position = position;\n\t\t\t\tvec3 displaced_normal = normal;\n\n\t\t\t\t#if defined( USE_LAYER_DISPLACE )\n\t\t\t\t\tvec3 transformed;\n\t\t\t\t\tvec3 transformedNormal;\n\t\t\t\t#endif\n\t\t\t\t","#include <normal_vertex>","\n\t\t\t\t#if !defined( USE_LAYER_DISPLACE )\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t#endif /* !USE_LAYER_DISPLACE */\n\t\t\t\t"];i&&n.push(i.code,i.result?"displaced_position = "+i.result+";":""),n.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED","    vNormal = transformedNormal;","#endif"),n.push("#include <project_vertex>","#include <fog_vertex>","#include <clipping_planes_vertex>","\tvViewPosition = - mvPosition.xyz;","#include <worldpos_vertex>","#include <shadowmap_vertex>"),n.push("vWPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz;"),t=n.join("\n")}else{e.mergeUniform({penumbraSize:KJ.penumbraSize}),e.mergeUniform({frameIndex:KJ.frameIndex}),e.mergeUniform({aoMap:KJ.aoRenderTarget}),e.mergeUniform({aoEnabled:KJ.aoEnabled});let i={gamma:!0};void 0===this.color&&(this.color=new lJ(YG)),this.color.analyze(e,{slot:"color",context:i}),this.roughness.analyze(e),this.metalness.analyze(e);let n=this.occlusion.flow(e,"b",{slot:"occlusion"});this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e),this.reflectivity&&this.reflectivity.analyze(e);let r=this.color.flow(e,"c",{slot:"color",context:i}),a=this.roughness.flow(e,"f"),s=this.metalness.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),l=this.shadingBlend.flow(e,"i"),c=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,h=this.alpha?this.alpha.flow(e,"f"):void 0,u=this.alphaOverride?this.alphaOverride.flow(e,"f"):void 0,d=this.reflectivity?this.reflectivity.flow(e,"f"):void 0;e.requires.transparent=void 0!==h,e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vWPosition;","uniform float penumbraSize[".concat(5,"];"),"uniform sampler2D aoMap;","uniform bool aoEnabled;","#include <normal_pars_fragment>","#include <dithering_pars_fragment>","#include <fog_pars_fragment>","#include <bsdfs>","#include <lights_pars_begin>","#include <lights_physical_pars_fragment>","#include <shadowmap_pars_fragment>"].join("\n"));let p=["#include <clipping_planes_fragment>","\t#include <normal_fragment_begin>","\n\t\t\t\t// NOTE: gl_FrontFacing alternative using face normal estimation.\n\t\t\t\tvec3 viewdx = dFdx(vViewPosition);\n\t\t\t\tvec3 viewdy = dFdy(vViewPosition);\n\t\t\t\tvec3 faceNormal = normalize(cross(viewdx,viewdy));\n\t\t\t\tif (dot(normal, faceNormal) < 0.0) {\n\t\t\t\t\tnormal *= -1.0;\n\t\t\t\t}\n\t\t\t\t","\tPhysicalMaterial material;","\tmaterial.diffuseColor = vec3( 1.0 );"];if(this.bumpMap){e.include(i$.dHdxy),e.include(i$.perturbNormalArb);let t=this.bumpMap.texture.flow(e,"t"),i=this.bumpMap.flow(e,"v3"),n=this.bumpMapIntensity?this.bumpMapIntensity.flow(e,"f").result:"1.0",r="";r=4===this.bumpMap.projection.value?"\n\t\t\t\t\tvec3 bumpNormal = vec3(0.0);\n\t\t\t\t\t{\n\t\t\t\t\t\tvec2 uv0 = g".concat(this.bumpMap.uuid.toString().replace(/-/g,""),"_writeUvs0;\n\t\t\t\t\t\tvec2 uv1 = g").concat(this.bumpMap.uuid.toString().replace(/-/g,""),"_writeUvs1;\n\t\t\t\t\t\tvec2 uv2 = g").concat(this.bumpMap.uuid.toString().replace(/-/g,""),"_writeUvs2;\n\t\t\t\t\t\tvec3 weights = g").concat(this.bumpMap.uuid.toString().replace(/-/g,""),"_triplanarWeights;\n\n\t\t\t\t\t\tvec2 grad0 = dHdxy(").concat(t.result,", uv0, ").concat(n,");\n\t\t\t\t\t\tvec3 n0 = perturbNormalArb(-vViewPosition, normal, grad0, faceDirection);\n\n\t\t\t\t\t\tvec2 grad1 = dHdxy(").concat(t.result,", uv1, ").concat(n,");\n\t\t\t\t\t\tvec3 n1 = perturbNormalArb(-vViewPosition, normal, grad1, faceDirection);\n\n\t\t\t\t\t\tvec2 grad2 = dHdxy(").concat(t.result,", uv2, ").concat(n,");\n\t\t\t\t\t\tvec3 n2 = perturbNormalArb(-vViewPosition, normal, grad2, faceDirection);\n\t\t\t\t\t\t\n\t\t\t\t\t\tbumpNormal = n0 * weights.z + n1 * weights.x + n2 * weights.y;\n\t\t\t\t\t\tbumpNormal = normalize(bumpNormal);\n\t\t\t\t\t}\n\n\t\t\t\t\tnormal = bumpNormal;\n\t\t\t\t\t"):"\n\t\t\t\t\tvec2 bumpMapCachedUv = g".concat(this.bumpMap.uuid.toString().replace(/-/g,""),"_writeUvs;\n\t\t\t\t\tvec2 grad = dHdxy(").concat(t.result,", bumpMapCachedUv, ").concat(n,");\n\t\t\t\t\tnormal = perturbNormalArb( - vViewPosition, normal, grad, faceDirection );\n\t\t\t\t\t"),p.push("// Call the Texture Layer's function once here so that it writes out its procedural UV coordinates\n\t\t\t\t\t".concat(i.result,";\n\t\t\t\t\t").concat(r,"\n\t\t\t\t\t"))}if(p.push(r.code,"\tvec3 diffuseColor = "+r.result+";","\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",s.code,"\tfloat metalnessFactor = "+s.result+";"),this.roughnessMap){let t=this.roughnessMap.texture.flow(e,"t"),i=this.roughnessMap.flow(e,"v3"),n="";n=4===this.roughnessMap.projection.value?"\n\t\t\t\t\tfloat roughnessChange = 1.0;\n\t\t\t\t\t{\n\t\t\t\t\t\tvec2 uv0 = g".concat(this.roughnessMap.uuid.toString().replace(/-/g,""),"_writeUvs0;\n\t\t\t\t\t\tvec2 uv1 = g").concat(this.roughnessMap.uuid.toString().replace(/-/g,""),"_writeUvs1;\n\t\t\t\t\t\tvec2 uv2 = g").concat(this.roughnessMap.uuid.toString().replace(/-/g,""),"_writeUvs2;\n\t\t\t\t\t\tvec3 weights = g").concat(this.roughnessMap.uuid.toString().replace(/-/g,""),"_triplanarWeights;\n\n\t\t\t\t\t\tfloat r0 = luminance(texture(").concat(t.result,", uv0).rgb) * roughnessScale;\n\t\t\t\t\t\tfloat r1 = luminance(texture(").concat(t.result,", uv1).rgb) * roughnessScale;\n\t\t\t\t\t\tfloat r2 = luminance(texture(").concat(t.result,", uv2).rgb) * roughnessScale;\n\n\t\t\t\t\t\troughnessChange = (r0 * weights.z + r1 * weights.x + r2 * weights.y);\n\t\t\t\t\t}\n\t\t\t\t\tfloat roughnessFactor = roughnessChange * ").concat(a.result,";\n\t\t\t\t\t"):"\n\t\t\t\t\tvec2 roughnessMapCachedUv = g".concat(this.roughnessMap.uuid.toString().replace(/-/g,""),"_writeUvs;\n\n\t\t\t\t\tvec4 vals = texture(").concat(t.result,",  roughnessMapCachedUv);\n\t\t\t\t\tfloat roughnessFactor = luminance(vals.rgb) * ").concat(a.result,";\n\t\t\t\t\t"),p.push("// Call the Texture Layer's function once here so that it writes out its procedural UV coordinates\n\t\t\t\t\t".concat(i.result,";\n\n\t\t\t\t\tconst float roughnessScale = 1.0;\n\n\t\t\t\t\t").concat(n,"\n\t\t\t\t"))}else p.push(a.code,"\tfloat roughnessFactor = "+a.result+";");h&&p.push(h.code,"#ifdef ALPHATEST","\tif ( "+h.result+" <= ALPHATEST ) discard;","#endif"),p.push("vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );"),p.push("material.diffuseColor = diffuseColor * ( 1.0 - metalnessFactor );","material.roughness = max( roughnessFactor, 0.0525 );","material.roughness += geometryRoughness;","material.roughness = min( material.roughness, 1.0 );","material.roughness = clamp( roughnessFactor, 0.04, 1.0 );"),d?p.push(d.code,"material.specularColor = mix( vec3( 0.16 * pow2( "+d.result+" ) ), diffuseColor, metalnessFactor );"):p.push("material.specularColor = mix( vec3( 0.04 ), diffuseColor, metalnessFactor );"),p.push("#include <lights_fragment_begin>"),p.push("#include <lights_fragment_end>"),p.push("vec3 ao = aoEnabled && "+n.result+" ? tex2D(aoMap, gl_FragCoord.xy / resolution).rgb : vec3(1.0);","vec3 outgoingLight = ((reflectedLight.directDiffuse + reflectedLight.indirectDiffuse)) + reflectedLight.directSpecular + reflectedLight.indirectSpecular;");let f="1.0";this.mask&&(this.mask.analyze(e),f="luminance(".concat(this.mask.flow(e,"v3").result,")")),p.push("\n\t\t\t\tif (outgoingLight != diffuseColor) {\n\t\t\t\t\tfloat lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 );\n\t\t\t\t\taccumAlpha += ( 1.0 - accumAlpha ) * ".concat(o.result," * ").concat(f," * lightAccu;\n\t\t\t\t\toutgoingLight = spe_blend( diffuseColor, outgoingLight, ").concat(o.result," * ").concat(f,", ").concat(l.result," );\n\t\t\t\t\t\n\t\t\t\t\toutgoingLight *= ao;\n\t\t\t\t}\n\t\t\t\t")),c&&p.push(c.code,"outgoingLight = spe_blend(outgoingLight, ".concat(c.result,", 1.0, SPE_BLENDING_NORMAL);")),h?p.push("gl_FragColor = vec4( outgoingLight, accumAlpha * ".concat(h.result," );")):p.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u&&p.push("gl_FragColor.a *= ".concat(u.result,";")),p.push("#include <encodings_fragment>","#include <fog_fragment>","#include <dithering_fragment>"),t=p.join("\n")}return t}},a$=class extends bK{constructor(){super("toon"),this.nodeType="Toon",this.color=new lJ(YG),this.specular=new lJ(1118481),this.shininess=new VK(30),this.previousModelViewMatrix=new gJ,this.previouseProjectionMatrix=new gJ,this.shadingAlpha=new VK(1),this.shadingBlend=new cJ(0)}get category(){return"toon"}build(e){let t;if(e.define("TOON"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let i=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform({frameIndex:KJ.frameIndex}),e.mergeUniform({resolution:KJ.resolution}),e.mergeUniform({previousModelViewMatrix:this.previousModelViewMatrix}),e.mergeUniform({previousProjectionMatrix:this.previouseProjectionMatrix}),e.mergeUniform(RT.merge([$T.fog,$T.lights])),e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vWPosition;","#include <fog_pars_vertex>","#include <normal_pars_vertex>","#include <shadowmap_pars_vertex>","#include <clipping_planes_pars_vertex>"].join("\n"));let n=["#include <beginnormal_vertex>","\n\t\t\t\t#ifndef USE_LAYER_DISPLACE\n\t\t\t\t\t#include <defaultnormal_vertex>\n\t\t\t\t#endif\n\n\t\t\t\tvec3 displaced_position = position;\n\t\t\t\tvec3 displaced_normal = normal;\n\n\t\t\t\t#ifdef USE_LAYER_DISPLACE\n\t\t\t\t\tvec3 transformed;\n\t\t\t\t\tvec3 transformedNormal;\n\t\t\t\t#endif\n\t\t\t\t","#include <normal_vertex>","\n\t\t\t\t#ifndef USE_LAYER_DISPLACE\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t#endif\n\t\t\t\t"];i&&n.push(i.code,i.result?"displaced_position = "+i.result+";":""),n.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED","    vNormal = transformedNormal;","#endif"),n.push("\t#include <project_vertex>","\t#include <fog_vertex>","\t#include <clipping_planes_vertex>","\tvViewPosition = - mvPosition.xyz;","\t#include <worldpos_vertex>","\t#include <shadowmap_vertex>","\t#include <fog_vertex>"),n.push("vWPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz;"),t=n.join("\n")}else{e.mergeUniform({penumbraSize:KJ.penumbraSize}),e.mergeUniform({frameIndex:KJ.frameIndex}),e.mergeUniform({aoMap:KJ.aoRenderTarget}),e.mergeUniform({aoEnabled:KJ.aoEnabled}),void 0===this.color&&(this.color=new lJ(YG)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let i=this.color.flow(e,"c",{slot:"color"}),n=this.specular.flow(e,"c"),r=this.shininess.flow(e,"f"),a=this.shadingAlpha.flow(e,"f"),s=this.shadingBlend.flow(e,"i"),o=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,l=this.alpha?this.alpha.flow(e,"f"):void 0,c=this.alphaOverride?this.alphaOverride.flow(e,"f"):void 0;e.requires.transparent=void 0!==l,e.addParsCode(["uniform float penumbraSize[".concat(5,"];"),"uniform sampler2D aoMap;","uniform bool aoEnabled;","varying vec3 vWPosition;","#include <normal_pars_fragment>","#include <gradientmap_pars_fragment>","#include <fog_pars_fragment>","#include <bsdfs>","#include <lights_pars_begin>","#include <dithering_pars_fragment>","\n\t\t\t\t\tvarying vec3 vViewPosition;\n\t\t\t\t\tstruct ToonMaterial {\n\t\t\t\t\t\tvec3\tdiffuseColor;\n\t\t\t\t\t\tvec3\tspecularColor;\n\t\t\t\t\t\tfloat\tspecularShininess;\n\t\t\t\t\t\tfloat\tspecularStrength;\n\t\t\t\t\t};\n\t\t\t\t\tvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\t\t\t\t\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t\t\t\n\t\t\t\t\t\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\t\t\t\t\t\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n\t\t\t\t\t}\n\t\t\t\t\tvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\t\t\t\t\t\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\t\t\t\t\t}\n\t\t\t\t\t#define RE_Direct\t\t\t\tRE_Direct_Toon\n\t\t\t\t\t#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n\t\t\t\t\t#define Material_LightProbeLOD( material )\t(0)\n\t\t\t\t\t","#include <shadowmap_pars_fragment>","#include <bumpmap_pars_fragment>","#include <normalmap_pars_fragment>"].join("\n"));let h=["#include <normal_fragment_begin>","\n\t\t\t\t// NOTE: gl_FrontFacing alternative using face normal estimation.\n\t\t\t\tvec3 viewdx = dFdx(vViewPosition);\n\t\t\t\tvec3 viewdy = dFdy(vViewPosition);\n\t\t\t\tvec3 faceNormal = normalize(cross(viewdx,viewdy));\n\t\t\t\tif (dot(normal, faceNormal) < 0.0) {\n\t\t\t\t\tnormal *= -1.0;\n\t\t\t\t}\n\t\t\t\t","\tToonMaterial material;"];if(this.bumpMap){e.include(i$.dHdxy),e.include(i$.perturbNormalArb);let t=this.bumpMap.texture.flow(e,"t"),i=this.bumpMap.flow(e,"v3"),n=this.bumpMapIntensity?this.bumpMapIntensity.flow(e,"f").result:"1.0",r="";r=4===this.bumpMap.projection.value?"\n\t\t\t\t\tvec3 bumpNormal = vec3(0.0);\n\t\t\t\t\t{\n\t\t\t\t\t\tvec2 uv0 = g".concat(this.bumpMap.uuid.toString().replace(/-/g,""),"_writeUvs0;\n\t\t\t\t\t\tvec2 uv1 = g").concat(this.bumpMap.uuid.toString().replace(/-/g,""),"_writeUvs1;\n\t\t\t\t\t\tvec2 uv2 = g").concat(this.bumpMap.uuid.toString().replace(/-/g,""),"_writeUvs2;\n\t\t\t\t\t\tvec3 weights = g").concat(this.bumpMap.uuid.toString().replace(/-/g,""),"_triplanarWeights;\n\n\t\t\t\t\t\tvec2 grad0 = dHdxy(").concat(t.result,", uv0, ").concat(n,");\n\t\t\t\t\t\tvec3 n0 = perturbNormalArb(-vViewPosition, normal, grad0, faceDirection);\n\n\t\t\t\t\t\tvec2 grad1 = dHdxy(").concat(t.result,", uv1, ").concat(n,");\n\t\t\t\t\t\tvec3 n1 = perturbNormalArb(-vViewPosition, normal, grad1, faceDirection);\n\n\t\t\t\t\t\tvec2 grad2 = dHdxy(").concat(t.result,", uv2, ").concat(n,");\n\t\t\t\t\t\tvec3 n2 = perturbNormalArb(-vViewPosition, normal, grad2, faceDirection);\n\t\t\t\t\t\t\n\t\t\t\t\t\tbumpNormal = n0 * weights.z + n1 * weights.x + n2 * weights.y;\n\t\t\t\t\t\tbumpNormal = normalize(bumpNormal);\n\t\t\t\t\t}\n\n\t\t\t\t\tnormal = bumpNormal;\n\t\t\t\t\t"):"\n\t\t\t\t\tvec2 bumpMapCachedUv = g".concat(this.bumpMap.uuid.toString().replace(/-/g,""),"_writeUvs;\n\t\t\t\t\tvec2 grad = dHdxy(").concat(t.result,", bumpMapCachedUv, ").concat(n,");\n\t\t\t\t\tnormal = perturbNormalArb( - vViewPosition, normal, grad, faceDirection );\n\t\t\t\t\t"),h.push("// Call the Texture Layer's function once here so that it writes out its procedural UV coordinates\n\t\t\t\t\t".concat(i.result,";\n\t\t\t\t\t").concat(r,"\n\t\t\t\t\t"))}h.push(i.code,"\tvec3 diffuseColor = "+i.result+";","\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",n.code,"\tvec3 specular = "+n.result+";",r.code,"\tfloat shininess = max( 0.0001, "+r.result+" );","\tfloat specularStrength = 1.0;"),l&&h.push(l.code,"#ifdef ALPHATEST","if ( "+l.result+" <= ALPHATEST ) discard;","#endif"),h.push("material.diffuseColor = diffuseColor;"),h.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include <lights_fragment_begin>","#include <lights_fragment_end>"),h.push("vec3 ao = aoEnabled ? tex2D(aoMap, gl_FragCoord.xy / resolution).rgb : vec3(1.0);","vec3 outgoingLight = ((reflectedLight.directDiffuse + reflectedLight.indirectDiffuse) * ao) + reflectedLight.directSpecular;");let u="1.0";this.mask&&(this.mask.analyze(e),u="luminance(".concat(this.mask.flow(e,"v3").result,")")),h.push("\n\t\t\t\tif (outgoingLight != diffuseColor) {\n\t\t\t\t\tfloat lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 );\n\t\t\t\t\taccumAlpha += ( 1.0 - accumAlpha ) * ".concat(a.result," * ").concat(u," * lightAccu;\n\t\t\t\t\toutgoingLight = spe_blend( diffuseColor, outgoingLight, ").concat(a.result," * ").concat(u,", ").concat(s.result," );\n\t\t\t\t}\n\t\t\t\t")),o&&h.push(o.code,"outgoingLight = spe_blend(outgoingLight, ".concat(o.result,", 1.0, SPE_BLENDING_NORMAL);")),l?h.push("gl_FragColor = vec4( outgoingLight, accumAlpha * ".concat(l.result," );")):h.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),c&&h.push("gl_FragColor.a *= ".concat(c.result,";")),h.push("#include <encodings_fragment>","#include <fog_fragment>","#include <dithering_fragment>"),t=h.join("\n")}return t}},s$=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4;this.timeout=e,this.cache=new Map,this.head={data:null,time:0,src:null,next:null,prev:null},this.tail={data:null,time:1/0,src:null,next:null,prev:null},this.hasClean=!1,this.head.next=this.tail,this.tail.prev=this.head}log(){}remove(e){let t=this.cache.get(e);t&&(this.dispose(e,t.data),this.cache.delete(e),t.prev.next=t.next,t.next.prev=t.prev)}scheduleCleanup(){this.hasClean||(this.log("scheduled cleanup"),this.hasClean=!0,setTimeout((()=>{this.hasClean=!1,this.log("cleaning");let e=Date.now(),t=this.head.next;for(;t.time<e-this.timeout;)this.dispose(t.src,t.data),this.cache.delete(t.src),t=t.next,t.prev=this.head,this.head.next=t;this.head.next!==this.tail?this.scheduleCleanup():this.log("no more cleanup")}),this.timeout+1e3))}has(e){var t;return null===(t=this.cache.get(e))||void 0===t?void 0:t.data}load(e){let t=Date.now(),i=this.cache.get(e);return void 0===i?(i={data:this.create(e),src:e,time:t,next:null,prev:null},this.cache.set(e,i)):(i.time=t,i.prev.next=i.next,i.next.prev=i.prev),i.prev=this.tail.prev,i.next=this.tail,this.tail.prev.next=i,this.tail.prev=i,this.scheduleCleanup(),i.data}},o$=class extends s${create(e){return URL.createObjectURL(new Blob([e]))}dispose(e,t){URL.revokeObjectURL(t)}};var l$=class{constructor(e,t){this.data=e,this.cache=t,this.refCount=0}deref(){this.refCount,this.refCount-=1,0===this.refCount&&(this.cache.remove(this),this.dispose())}dispose(){this.refCount,0}},c$=class{constructor(){this.cache=new Map}remove(e){this.cache.delete(e.data),0}load(e){let t=this.cache.get(e);return void 0===t&&(t=this.create(e),this.cache.set(e,t)),t.refCount+=1,t}},h$=class extends l${constructor(e,t){super(e,t.imageHolderCache),this.data=e,this.shared=t,this.loaded=!1,this.isVideo=!1,this.isCanvas=!1,this._cache={1e3:{},1001:{},1002:{}},this.isVideo="video"===e.type,this.isCanvas="CANVAS"===e.nodeName,this.updateSrc(this.isCanvas?e:e.data)}async updateSrc(e){if(typeof document>"u")return;this.disposeTextures(),this.loaded=!1;let t=()=>{this.loaded=!0;for(let e of Object.values(this._cache))for(let t of Object.values(e))t&&(t.image=this.img,t.needsUpdate=!0);this.shared.requestRender()};if(this.isCanvas)this.img=e,this.loaded=!0;else if(this.isVideo){if(this.img=document.createElement("video"),this.img.preload="auto",this.img.playsInline=!0,this.img.currentTime=.01,"string"!=typeof e){var i=new FileReader;let t;i.readAsDataURL(new Blob([e],{type:"video/mp4"})),await new Promise((e=>{i.onloadend=i=>{var n;t=null===(n=i.target)||void 0===n?void 0:n.result,e(null)}})),this.img.src=t}else this.img.src=e;this.img.onloadeddata=()=>{t()}}else this.img=new Image,this.img.src=function(e){return"string"==typeof e?e:(JJ||(JJ=new o$),JJ.load(e))}(e),this.img.onload=t}getTexture(e){var t;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1008,n=null===(t=this._cache[e])||void 0===t?void 0:t[i];if(n)return n;{let t;return this.isCanvas&&(t=new nO(this.img,void 0,e,e,void 0,i)),t=this.isVideo?new iO(this.img,void 0,e,e):new IA(this.img,void 0,e,e,void 0,i),this.loaded&&(t.needsUpdate=!0),void 0===this._cache[e]&&(this._cache[e]={}),this._cache[e][i]=t,t}}setNeedsUpdate(e){for(let t of Object.values(this._cache))for(let i of Object.values(t))i&&(i.needsUpdate=e)}disposeTextures(){for(let[e,t]of Object.entries(this._cache))for(let[i,n]of Object.entries(t))null!==n&&void 0!==n&&n.dispose(),this._cache[e][i]=void 0}dispose(){super.dispose(),this.disposeTextures()}},u$=class extends h${};function d$(e,t){var i=function(e){if(!f$[e]){var t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),i="06/25/2014, 00:00:00"===t||"\u200e06\u200e/\u200e25\u200e/\u200e2014\u200e \u200e00\u200e:\u200e00\u200e:\u200e00"===t;f$[e]=i?new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return f$[e]}(t);return i.formatToParts?function(e,t){try{for(var i=e.formatToParts(t),n=[],r=0;r<i.length;r++){var a=p$[i[r].type];a>=0&&(n[a]=parseInt(i[r].value,10))}return n}catch(l){if(l instanceof RangeError)return[NaN];throw l}}(i,e):function(e,t){var i=e.format(t).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(i);return[n[3],n[1],n[2],n[4],n[5],n[6]]}(i,e)}var p$={year:0,month:1,day:2,hour:3,minute:4,second:5};var f$={};function m$(e,t,i,n,r,a,s){var o=new Date(0);return o.setUTCFullYear(e,t,i),o.setUTCHours(n,r,a,s),o}var g$=36e5,v$=6e4,y$={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function b$(e,t,i){var n,r,a;if(!e||(n=y$.timezoneZ.exec(e)))return 0;if(n=y$.timezoneHH.exec(e))return w$(a=parseInt(n[1],10))?-a*g$:NaN;if(n=y$.timezoneHHMM.exec(e)){a=parseInt(n[1],10);var s=parseInt(n[2],10);return w$(a,s)?(r=Math.abs(a)*g$+s*v$,a>0?-r:r):NaN}if(function(e){if(_$[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),_$[e]=!0,!0}catch{return!1}}(e)){t=new Date(t||Date.now());var o=i?t:function(e){return m$(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}(t),l=x$(o,e),c=i?l:function(e,t,i){var n=e.getTime(),r=n-t,a=x$(new Date(r),i);if(t===a)return t;r-=a-t;var s=x$(new Date(r),i);return a===s?a:Math.max(a,s)}(t,l,e);return-c}return NaN}function x$(e,t){var i=d$(e,t),n=m$(i[0],i[1]-1,i[2],i[3]%24,i[4],i[5],0).getTime(),r=e.getTime(),a=r%1e3;return n-(r-=a>=0?a:1e3+a)}function w$(e,t){return-23<=e&&e<=23&&(null==t||0<=t&&t<=59)}var _$={};var S$=J_(rS(),1),E$=J_(aS(),1),C$=36e5,A$=6e4,M$=2,T$={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/};function P$(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(null===e)return new Date(NaN);var i=t||{},n=null==i.additionalDigits?M$:(0,S$.default)(i.additionalDigits);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))return new Date(e.getTime());if("number"==typeof e||"[object Number]"===Object.prototype.toString.call(e))return new Date(e);if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var r=function(e){var t,i={},n=T$.dateTimePattern.exec(e);if(n?(i.date=n[1],t=n[3]):(n=T$.datePattern.exec(e),n?(i.date=n[1],t=n[2]):(i.date=null,t=e)),t){var r=T$.timeZone.exec(t);r?(i.time=t.replace(r[1],""),i.timeZone=r[1].trim()):i.time=t}return i}(e),a=function(e,t){var i,n=T$.YYY[t],r=T$.YYYYY[t];if(i=T$.YYYY.exec(e)||r.exec(e),i){var a=i[1];return{year:parseInt(a,10),restDateString:e.slice(a.length)}}if(i=T$.YY.exec(e)||n.exec(e),i){var s=i[1];return{year:100*parseInt(s,10),restDateString:e.slice(s.length)}}return{year:null}}(r.date,n),s=a.year,o=function(e,t){if(null===t)return null;var i,n,r,a;if(0===e.length)return n=new Date(0),n.setUTCFullYear(t),n;if(i=T$.MM.exec(e),i)return n=new Date(0),r=parseInt(i[1],10)-1,R$(t,r)?(n.setUTCFullYear(t,r),n):new Date(NaN);if(i=T$.DDD.exec(e),i){n=new Date(0);var s=parseInt(i[1],10);return function(e,t){if(t<1)return!1;var i=I$(e);return!(i&&t>366||!i&&t>365)}(t,s)?(n.setUTCFullYear(t,0,s),n):new Date(NaN)}if(i=T$.MMDD.exec(e),i){n=new Date(0),r=parseInt(i[1],10)-1;var o=parseInt(i[2],10);return R$(t,r,o)?(n.setUTCFullYear(t,r,o),n):new Date(NaN)}if(i=T$.Www.exec(e),i)return a=parseInt(i[1],10)-1,L$(t,a)?D$(t,a):new Date(NaN);if(i=T$.WwwD.exec(e),i){a=parseInt(i[1],10)-1;var l=parseInt(i[2],10)-1;return L$(t,a,l)?D$(t,a,l):new Date(NaN)}return null}(a.restDateString,s);if(isNaN(o))return new Date(NaN);if(o){var l,c=o.getTime(),h=0;if(r.time&&(h=function(e){var t,i,n;if(t=T$.HH.exec(e),t)return i=parseFloat(t[1].replace(",",".")),B$(i)?i%24*C$:NaN;if(t=T$.HHMM.exec(e),t)return i=parseInt(t[1],10),n=parseFloat(t[2].replace(",",".")),B$(i,n)?i%24*C$+n*A$:NaN;if(t=T$.HHMMSS.exec(e),t){i=parseInt(t[1],10),n=parseInt(t[2],10);var r=parseFloat(t[3].replace(",","."));return B$(i,n,r)?i%24*C$+n*A$+1e3*r:NaN}return null}(r.time),isNaN(h)))return new Date(NaN);if(r.timeZone||i.timeZone){if(l=b$(r.timeZone||i.timeZone,new Date(c+h)),isNaN(l))return new Date(NaN)}else l=(0,E$.default)(new Date(c+h)),l=(0,E$.default)(new Date(c+h+l));return new Date(c+h+l)}return new Date(NaN)}function D$(e,t,i){t=t||0,i=i||0;var n=new Date(0);n.setUTCFullYear(e,0,4);var r=7*t+i+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+r),n}var k$=[31,28,31,30,31,30,31,31,30,31,30,31],O$=[31,29,31,30,31,30,31,31,30,31,30,31];function I$(e){return e%400===0||e%4===0&&e%100!==0}function R$(e,t,i){if(t<0||t>11)return!1;if(null!=i){if(i<1)return!1;var n=I$(e);if(n&&i>O$[t]||!n&&i>k$[t])return!1}return!0}function L$(e,t,i){return!(t<0||t>52||null!=i&&(i<0||i>6))}function B$(e,t,i){return!(null!=e&&(e<0||e>=25)||null!=t&&(t<0||t>=60)||null!=i&&(i<0||i>=60))}function z$(e,t){return t.color(e)}function N$(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=arguments.length>1?arguments[1]:void 0,i=t.format,n=e.getSeconds(),r=e;t&&null!==t.timeZone&&(r=function(e,t,i){var n=P$(e,i),r=b$(t,n,!0),a=new Date(n.getTime()-r),s=new Date(0);return s.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),s.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),s}(new Date,t.timeZone));let a,s=r.getHours(),o=r.getMinutes();"12ampm"===t.format12h24h&&(a=s>=12?"PM":"AM");let l,c,h=s;switch("24"!==t.format12h24h&&(h=s%12,0===h&&(h=12)),i){case"HH:mm:ss":l=[h,o,n];break;case"HH:mm":l=[h,o];break;case"HH":l=[h],a=void 0;break;case"mm":l=[o],a=void 0;break;case"ss":l=[n],a=void 0;break;case"year":c=r.getFullYear();break;case"month":c=r.getMonth()+1;break;case"dayOfYear":c=Math.floor((r.getTime()-new Date(r.getFullYear(),0,0).getTime())/864e5);break;case"dayOfMonth":c=r.getDate();break;case"secondOfDay":c=60*s*60+60*o+n;break;default:console.error("Unknown time format",i),c=0}return void 0!==l?{textValue:l,suffix:a}:c}function F$(e,t){switch(e.type){case"fresnel":return function(e,t){let{bias:i,scale:n,intensity:r,factor:a,color:s}=e;return{...V$(e,t),color:z$(s,t),bias:i,scale:n,intensity:r,factor:a}}(e,t);case"gradient":return function(e,t){let{gradientType:i,smooth:n,colors:r,steps:a,angle:s,offset:o,morph:l}=e;return{...V$(e,t),gradientType:i,smooth:n,colors:r.map((e=>new RA(e[0],e[1],e[2],e[3]))),num:r.length,steps:a,offset:new hA(...o),morph:new hA(...l),angle:s}}(e,t);case"depth":return function(e,t){let{gradientType:i,near:n,far:r,isVector:a,isWorldSpace:s,origin:o,direction:l,colors:c,steps:h,smooth:u}=e;return{...V$(e,t),gradientType:i,near:n,far:r,isVector:a,isWorldSpace:s,origin:new FA(...o),direction:l?new FA(...l):new FA(1,0,0),colors:c.map((e=>void 0!==e?new RA(e[0],e[1],e[2],e[3]):new RA(0,0,0,0))),steps:h.slice(0,c.length),smooth:u}}(e,t);case"normal":return function(e,t){let{cnormal:i}=e;return{...V$(e,t),cnormal:new FA(i[0],i[1],i[2])}}(e,t);case"noise":return function(e,t){return{...V$(e,t),scale:e.scale,move:e.move,fA:new hA(...e.fA),fB:new hA(...e.fB),size:new FA(...e.size),distortion:new hA(...e.distortion),colorA:z$(e.colorA,t),colorB:z$(e.colorB,t),colorC:z$(e.colorC,t),colorD:z$(e.colorD,t),noiseType:e.noiseType,voronoiStyle:e.voronoiStyle,highCut:e.highCut,lowCut:e.lowCut,smoothness:e.smoothness,seed:e.seed,quality:e.quality}}(e,t);case"rainbow":return function(e,t){return{...V$(e,t),filmThickness:e.filmThickness,movement:e.movement,wavelengths:new FA(...e.wavelengths),noiseStrength:e.noiseStrength,noiseScale:e.noiseScale,offset:new FA(...e.offset)}}(e,t);case"toon":return function(e,t){return{...V$(e,t),positioning:e.positioning,colors:e.colors.map((e=>new RA(e[0],e[1],e[2],e[3]))),num:e.colors.length,steps:e.steps,source:new FA(...e.source),isWorldSpace:e.isWorldSpace,noiseStrength:e.noiseStrength,noiseScale:e.noiseScale,shadowColor:z$(e.shadowColor,t),offset:new FA(...e.offset)}}(e,t);case"outline":return function(e,t){return{...V$(e,t),outlineColor:z$(e.outlineColor,t),contourColor:z$(e.contourColor,t),outlineWidth:e.outlineWidth,contourWidth:e.contourWidth,outlineThreshold:e.outlineThreshold,contourThreshold:e.contourThreshold,outlineSmoothing:e.outlineSmoothing,contourFrequency:e.contourFrequency,contourDirection:new FA(...e.contourDirection),positionalLines:e.positionalLines,compensation:e.compensation}}(e,t);case"transmission":return function(e,t){return{...V$(e,t),thickness:e.thickness,ior:e.ior,roughness:e.roughness}}(e,t);case"color":return function(e,t){return{...V$(e,t),color:z$(e.color,t)}}(e,t);case"pattern":return function(e,t){return{...V$(e,t),style:e.style,projection:e.projection,axis:e.axis,blending:e.blending,offset:new hA(...e.offset),colorA:z$(e.colorA,t),colorB:z$(e.colorB,t),frequency:new hA(...e.frequency),size:e.size,variation:e.variation,smoothness:e.smoothness,zigzag:e.zigzag,rotation:e.rotation,vertical:new hA(...e.vertical),horizontal:new hA(...e.horizontal),sides:e.sides}}(e,t)}}function j$(e){return{type:e.type}}function V$(e,t){var i;let{alpha:n,mode:r,isMask:a}=e,s="string"==typeof n?(null!==(i=Number(t.getVariable(n)))&&void 0!==i?i:100)/100:n;return{...j$(e),alpha:s,mode:r,isMask:a}}var U$=class extends CK{},G$={noise:["noiseType"],texture:["projection","axis","side"],video:["projection","axis","side"],displace:["noiseType"],light:["roughnessMap","bumpMap"],depth:["smooth","isWorldSpace","gradientType","isVector"],pattern:["style","projection","axis"]},H$={depth:["colors"]};function W$(e,t,i){if("isMask"===t)return!0;let n=G$[e.type],r=H$[e.type];if(void 0!==r){let n=e.color;if(r.includes(t)){var a;let e=null===(a=n[t])||void 0===a||null===(a=a.value)||void 0===a?void 0:a.length;if(void 0!==e&&e!==i.length)return!0}}return void 0!==n&&n.includes(t)}function q$(e,t,i){let n=i.uniforms["f".concat(i.id,"_texture")];if(!n)return!1;let r=e;if("image"in r){let e=r.image,i=t.image(e),a=n;a.image instanceof u$||a.image.deref(),a.image=i}if("video"in r){let e=r.video,i=t.video(e),a=n;a.image instanceof u$||a.image.deref(),a.image=i}if("wrapping"in r){n.wrap=r.wrapping}if("minFilter"in r){n.minFilter=r.minFilter}if("repeat"in r||"offset"in r){let e="mat",t=i.uniforms["f".concat(i.id,"_").concat(e)];"repeat"in r&&(t.repeat=r.repeat),"offset"in r&&(t.offset=r.offset),t.updateMatrix()}return!1}var X$=(e,t,i)=>{var n,r;return null!==(n=Math.max(0,Math.min(1,Number(null!==(r=t.getVariable("number"==typeof e?100*e:e,i))&&void 0!==r?r:100)/100)))&&void 0!==n?n:1},Y$=class{constructor(e,t,i,n,r){this.id=e,this.uuid=t,this.data=i,this.uniforms={};for(let a in n)this.uniforms["f".concat(this.id,"_").concat(a)]=n[a];for(let a in i)$$(a,this,i,r)}get type(){return this.data.type}static create(e,t,i,n){if("light"===i.type)return K$.createLigherLayer(e,t,i,n);if("texture"===i.type||"video"===i.type){var r,a,s,o,l,c,h,u;let d="texture"===i.type?null!==(r=n.canvas(i.texture.image))&&void 0!==r?r:n.image(i.texture.image):n.video(i.texture.video),p=new fJ(d,i.texture.wrapping,null!==(a=i.texture.minFilter)&&void 0!==a?a:1008),f=new pJ(d),m=new yJ(i.texture.repeat,i.texture.offset),g=new VK(i.crop?1:0),v=new cJ(null!==(s=i.projection)&&void 0!==s?s:0),y=new cJ(null!==(o=["x","y","z"].indexOf(i.axis))&&void 0!==o?o:0),b=new cJ(null!==(l=i.side)&&void 0!==l?l:0),x=new SK(i.size?new hA(i.size[0],i.size[1]):new hA(100,100)),w=new VK(null!==(c=i.blending)&&void 0!==c?c:0),_=new VK(X$(i.alpha,n)),S=new cJ(null!==(h=i.mode)&&void 0!==h?h:0),E=new hJ(null!==(u=i.isMask)&&void 0!==u&&u),C=new AJ(p,f,g,v,y,b,x,w,m,_,S,E),A=new FK(C.calpha,"f");return new Q$(e,t,i,{texture:p,textureSize:f,crop:g,projection:v,axis:y,side:b,size:x,blending:w,mat:m,alpha:_,mode:S,isMask:E},C,S,A,E,n)}if("matcap"===i.type){var d,p,f;let r=n.image(i.texture.image),a=new fJ(r,i.texture.wrapping,null!==(d=i.texture.minFilter)&&void 0!==d?d:1008),s=new VK(X$(i.alpha,n)),o=new cJ(null!==(p=i.mode)&&void 0!==p?p:0),l=new hJ(null!==(f=i.isMask)&&void 0!==f&&f),c=new IJ(a,s,o,l),h=new FK(c.calpha,"f");return new Q$(e,t,i,{texture:a,alpha:s,mode:o,isMask:l},c,o,h,l,n)}if("displace"===i.type){if("noise"===i.displacementType){var m,g,v,y,b,x,w,_,S,E;let r=new EK(new FA(...i.offset)),a=new VK(null!==(m=i.scale)&&void 0!==m?m:10),s=new VK(null!==(g=i.intensity)&&void 0!==g?g:8),o=new VK(null!==(v=i.movement)&&void 0!==v?v:1),l=new cJ(null!==(y=i.noiseType)&&void 0!==y?y:0),c=new cJ(null!==(b=i.voronoiStyle)&&void 0!==b?b:0),h=new VK(null!==(x=i.smoothness)&&void 0!==x?x:.5),u=new VK(null!==(w=i.seed)&&void 0!==w?w:0),d=new VK(null!==(_=i.highCut)&&void 0!==_?_:1),p=new VK(null!==(S=i.lowCut)&&void 0!==S?S:0),f=new cJ(null!==(E=i.quality)&&void 0!==E?E:1),C=new ZJ(s,o,r,c,h,u,d,p,f,a,l);return new Z$(e,t,i,{offset:r,scale:a,intensity:s,movement:o,noiseType:l,voronoiStyle:c,smoothness:h,seed:u,highCut:d,lowCut:p,quality:f},C,n)}throw new Error}return function(e,t,i,n){let r=F$(i,n);return function(e,t,i,n,r){switch(e.type){case"color":{var a;let s=new lJ(null!==(a=n.color)&&void 0!==a?a:YG),o=J$(n),l=new _J(s,o.alpha),c=new FK(l.calpha,"f");return new Q$(t,i,e,{color:s,...o},l,o.mode,c,o.isMask,r)}case"fresnel":{var s,o,l,c,h;let a=new lJ(null!==(s=n.color)&&void 0!==s?s:16777215),u=new VK(null!==(o=n.bias)&&void 0!==o?o:.1),d=new VK(null!==(l=n.scale)&&void 0!==l?l:1),p=new VK(null!==(c=n.intensity)&&void 0!==c?c:2),f=new VK(null!==(h=n.factor)&&void 0!==h?h:1),m=J$(n),g=new PJ(a,u,d,p,f,m.alpha,m.mode,m.isMask),v=new FK(g.calpha,"f");return new Q$(t,i,e,{color:a,bias:u,scale:d,intensity:p,factor:f,...m},g,m.mode,v,m.isMask,r)}case"rainbow":{var u,d,p,f,m,g;let a=new VK(null!==(u=n.filmThickness)&&void 0!==u?u:30),s=new VK(null!==(d=n.movement)&&void 0!==d?d:0),o=new EK(null!==(p=n.wavelengths)&&void 0!==p?p:new FA(0,0,0)),l=new VK(null!==(f=n.noiseStrength)&&void 0!==f?f:0),c=new VK(null!==(m=n.noiseScale)&&void 0!==m?m:1),h=new EK(null!==(g=n.offset)&&void 0!==g?g:new FA(0,0,0)),v=J$(n),y=new UJ(a,s,o,l,c,h,v.alpha,v.isMask),b=new FK(y.calpha,"f");return new Q$(t,i,e,{filmThickness:a,movement:s,wavelengths:o,noiseStrength:l,noiseScale:c,offset:h,...v},y,v.mode,b,v.isMask,r)}case"transmission":{var v,y,b;let a=new VK(null!==(v=n.thickness)&&void 0!==v?v:10),s=new VK(null!==(y=n.ior)&&void 0!==y?y:1.5),o=new VK(null!==(b=n.roughness)&&void 0!==b?b:.5),l=KJ.transmissionSize,c=KJ.transmissionRenderTarget,h=KJ.transmissionRenderTargetDepth,u=window.innerWidth,d=window.innerHeight,p=u>=d?new SK(d/u,1):new SK(1,u/d),f=J$(n),m=new XJ(a,s,o,l,c,h,p,f.alpha),g=new FK(m.calpha,"f");return new Q$(t,i,e,{thickness:a,ior:s,roughness:o,aspectRatio:p,...f},m,f.mode,g,f.isMask,r)}case"toon":{var x,w,_,S,E,C;let a,s,o=new cJ(null!==(x=n.positioning)&&void 0!==x?x:0);n.colors?a=new bJ(n.colors.length,n.colors):(a=new bJ(10,new RA(0,0,0,1)),a.value[1]=new RA(1,1,1,1)),n.steps?s=new uJ(n.steps.length,n.steps):(s=new uJ(10,1),s.value[0]=0);let l=new EK(null!==(w=n.source)&&void 0!==w?w:new FA(0,0,0)),c=new hJ(null===(_=n.isWorldSpace)||void 0===_||_),h=new VK(null!==(S=n.noiseStrength)&&void 0!==S?S:0),u=new VK(null!==(E=n.noiseScale)&&void 0!==E?E:1),d=new AK(n.shadowColor),p=new EK(null!==(C=n.offset)&&void 0!==C?C:new FA(0,0,0)),f=J$(n),m=new HJ(o,a,s,l,c,h,u,d,p,f.alpha),g=new FK(m.calpha,"f");return new Q$(t,i,e,{positioning:o,colors:a,steps:s,source:l,isWorldSpace:c,noiseStrength:h,noiseScale:u,shadowColor:d,offset:p,...f},m,f.mode,g,f.isMask,r)}case"outline":{var A,M,T,P,D,k,O,I,R,L,B;let a=new lJ(null!==(A=n.outlineColor)&&void 0!==A?A:16777215),s=new lJ(null!==(M=n.contourColor)&&void 0!==M?M:16777215),o=new VK(null!==(T=n.outlineWidth)&&void 0!==T?T:.1),l=new VK(null!==(P=n.contourWidth)&&void 0!==P?P:.1),c=new VK(null!==(D=n.outlineThreshold)&&void 0!==D?D:.1),h=new VK(null!==(k=n.contourThreshold)&&void 0!==k?k:.1),u=new VK(null!==(O=n.outlineSmoothing)&&void 0!==O?O:.1),d=new VK(null!==(I=n.contourFrequency)&&void 0!==I?I:.1),p=new EK(null!==(R=n.contourDirection)&&void 0!==R?R:new FA(0,1,0)),f=new hJ(null!==(L=n.positionalLines)&&void 0!==L&&L),m=new hJ(null===(B=n.compensation)||void 0===B||B),g=KJ.normalRenderTarget,v=KJ.normalRenderTargetDepth,y=KJ.pixelRatioNode,b=KJ.resolution,x=J$(n),w=new NJ(a,s,o,l,c,h,u,d,p,f,m,b,g,v,y,x.alpha),_=new FK(w.calpha,"f");return new Q$(t,i,e,{outlineColor:a,contourColor:s,outlineWidth:o,contourWidth:l,outlineThreshold:c,contourThreshold:h,outlineSmoothing:u,contourFrequency:d,contourDirection:p,positionalLines:f,compensation:m,...x},w,x.mode,_,x.isMask,r)}case"depth":{var z,N,F,j,V,U,G,H;let a,s,o=new cJ(null!==(z=n.gradientType)&&void 0!==z?z:0),l=new hJ(null!==(N=n.smooth)&&void 0!==N&&N),c=new VK(null!==(F=n.near)&&void 0!==F?F:50),h=new VK(null!==(j=n.far)&&void 0!==j?j:200),u=new VK(null!==(V=n.isVector)&&void 0!==V?V:1),d=new VK(null!==(U=n.isWorldSpace)&&void 0!==U?U:0),p=new EK(null!==(G=n.origin)&&void 0!==G?G:new FA),f=new EK(null!==(H=n.direction)&&void 0!==H?H:new FA);n.colors?a=new bJ(n.colors.length,n.colors):(a=new bJ(2,new RA(0,0,0,1)),a.value[1]=new RA(1,1,1,1)),n.steps?s=new uJ(n.steps.length,n.steps):(s=new uJ(2,1),s.value[0]=0);let m=J$(n),g=new TJ(o,l,c,h,u,d,p,f,a,s,m.alpha,m.isMask),v=new FK(g.calpha,"f");return new Q$(t,i,e,{gradientType:o,smooth:l,near:c,far:h,isVector:u,isWorldSpace:d,origin:p,direction:f,colors:a,steps:s,...m},g,m.mode,v,m.isMask,r)}case"noise":{var W,q,X,Y,Q,Z,K,J,$,ee,te,ie,ne;let a=new VK(null!==(W=n.scale)&&void 0!==W?W:1),s=new EK(null!==(q=n.size)&&void 0!==q?q:new FA(100,100,100)),o=new VK(null!==(X=n.move)&&void 0!==X?X:1),l=new SK(null!==(Y=n.fA)&&void 0!==Y?Y:new hA(1.7,9.2)),c=new SK(null!==(Q=n.fB)&&void 0!==Q?Q:new hA(8.3,2.8)),h=new SK(null!==(Z=n.distortion)&&void 0!==Z?Z:new hA(1,1)),u=new AK(n.colorA),d=new AK(n.colorB),p=new AK(n.colorC),f=new AK(n.colorD),m=new cJ(null!==(K=n.noiseType)&&void 0!==K?K:0),g=new cJ(null!==(J=n.voronoiStyle)&&void 0!==J?J:0),v=new VK(null!==($=n.highCut)&&void 0!==$?$:1),y=new VK(null!==(ee=n.lowCut)&&void 0!==ee?ee:0),b=new VK(null!==(te=n.smoothness)&&void 0!==te?te:.5),x=new VK(null!==(ie=n.seed)&&void 0!==ie?ie:.5),w=new cJ(null!==(ne=n.quality)&&void 0!==ne?ne:1),_=J$(n),S=new BJ(a,s,o,l,c,h,u,d,p,f,_.alpha,m,_.isMask,g,v,y,b,x,w),E=new FK(S.calpha,"f");return new Q$(t,i,e,{scale:a,size:s,move:o,fA:l,fB:c,distortion:h,colorA:u,colorB:d,colorC:p,colorD:f,noiseType:m,..._,voronoiStyle:g,highCut:v,lowCut:y,smoothness:b,seed:x,quality:w},S,_.mode,E,_.isMask,r)}case"normal":{var re;let a=new EK(null!==(re=n.cnormal)&&void 0!==re?re:new FA(1,1,1)),s=J$(n),o=new EJ(a,s.alpha),l=new FK(o.calpha,"f");return new Q$(t,i,e,{cnormal:a,...s},o,s.mode,l,s.isMask,r)}case"gradient":{var ae,se,oe,le,ce;let a,s,o=new cJ(null!==(ae=n.gradientType)&&void 0!==ae?ae:0),l=new hJ(null!==(se=n.smooth)&&void 0!==se&&se);n.colors?a=new bJ(n.colors.length,n.colors):(a=new bJ(10,new RA(0,0,0,1)),a.value[1]=new RA(1,1,1,1)),n.steps?s=new uJ(n.steps.length,n.steps):(s=new uJ(10,1),s.value[0]=0);let c=new SK(null!==(oe=n.offset)&&void 0!==oe?oe:new hA(0,0)),h=new SK(null!==(le=n.morph)&&void 0!==le?le:new hA(0,0)),u=new VK(null!==(ce=n.angle)&&void 0!==ce?ce:0),d=J$(n),p=new kJ(o,l,a,s,c,h,u,d.alpha,d.isMask),f=new FK(p.calpha,"f");return new Q$(t,i,e,{gradientType:o,smooth:l,colors:a,steps:s,offset:c,morph:h,angle:u,...d},p,d.mode,f,d.isMask,r)}case"pattern":{var he,ue,de,pe,fe,me,ge,ve,ye,be,xe,we,_e,Se;let a=new cJ(null!==(he=n.style)&&void 0!==he?he:0),s=new cJ(null!==(ue=n.projection)&&void 0!==ue?ue:0),o=new cJ(null!==(de=["x","y","z"].indexOf(n.axis))&&void 0!==de?de:0),l=new VK(null!==(pe=n.blending)&&void 0!==pe?pe:0),c=new SK(null!==(fe=n.offset)&&void 0!==fe?fe:new hA(0,0)),h=new AK(n.colorA),u=new AK(n.colorB),d=new SK(null!==(me=n.frequency)&&void 0!==me?me:new hA(10,10)),p=new VK(null!==(ge=n.size)&&void 0!==ge?ge:.5),f=new VK(null!==(ve=n.variation)&&void 0!==ve?ve:0),m=new VK(null!==(ye=n.smoothness)&&void 0!==ye?ye:.5),g=new VK(null!==(be=n.zigzag)&&void 0!==be?be:0),v=new VK(null!==(xe=n.rotation)&&void 0!==xe?xe:0),y=new SK(null!==(we=n.vertical)&&void 0!==we?we:new hA(0,1)),b=new SK(null!==(_e=n.horizontal)&&void 0!==_e?_e:new hA(0,1)),x=new cJ(null!==(Se=n.sides)&&void 0!==Se?Se:6),w=J$(n),_=new jJ(a,s,o,l,c,h,u,d,p,f,m,g,v,y,b,x,w.alpha,w.isMask),S=new FK(_.calpha,"f");return new Q$(t,i,e,{style:a,projection:s,axis:o,blending:l,offset:c,colorA:h,colorB:u,frequency:d,size:p,variation:f,smoothness:m,zigzag:g,rotation:v,vertical:y,horizontal:b,sides:x,...w},_,w.mode,S,w.isMask,r)}default:{let a=new lJ(1,0,0,1),s=J$(n),o=new _J(a,s.alpha),l=new FK(o.calpha,"f");return new Q$(t,i,e,{color:a,...s},o,s.mode,l,s.isMask,r)}}}(i,e,t,r,n)}(e,t,i,n)}updateByOp(e,t,i){let n=e;if(void 0===n.path[0]){if(0===n.type)return"type"in n.props||"category"in n.props||"visible"in n.props?(i.scene.markNeedsUpdateRendererDirty(),!0):function(e,t,i,n){let r=!1;for(let[a,s]of Object.entries(e)){if("bumpMap"===a||"roughnessMap"===a){r=!0;continue}if(!a||void 0===s)continue;if($$(a,i,n,t)){"visible"===a&&"light"===i.type&&(r=!0);continue}i.visible=n.visible;let e=i.uniforms["f".concat(i.id,"_").concat(a)];if(e&&!(e instanceof dJ))switch(r=r||W$(i,a,s),e.constructor){case lJ:if("string"==typeof s){let i=t.getColor(s);i&&(e.value=i);break}{let t=s;e.value instanceof U$?e.value=new CK(t.r,t.g,t.b,t.a):e.setRGBA(t);break}case AK:if("string"==typeof s){let i=t.getColor(s);i&&(e.value=i);break}{let t=s;e.value instanceof U$?e.value=new CK(t.r,t.g,t.b,t.a):e.value.setRGBA(t.r,t.g,t.b,t.a);break}case SK:{let t=s;e.value.setX(t[0]),e.value.setY(t[1]);break}case EK:{let t=s;e.value.setX(t[0]),e.value.setY(t[1]),e.value.setZ(t[2]);break}case jK:q$(s,t,i);break;case bJ:e.value=s.map((e=>new RA(...e)));break;default:e.value=s}}return r}(n.props,i.shared,this,t)}else if("texture"===n.path[0])return!("texture"in t)&&!("video"in t)||q$(n.props,i.shared,this);return!1}dispose(){if(function(e){let t=e instanceof Y$?e.type:e;return"texture"===t||"video"===t||"displace_map"===t||"matcap"===t}(this)){let e=this.uniforms["f".concat(this.id,"_texture")];if(!e)return!1;let t=e;t.image instanceof u$||t.image.deref()}}hasValueByKey(e){return void 0!==this.uniforms[e]}hasValue(e){return this.hasValueByKey("f".concat(this.id,"_").concat(e))}setValue(e,t){let i="f".concat(this.id,"_").concat(e);this.hasValueByKey(i)&&void 0!==t&&(this.uniforms[i].value=t)}getNode(e){let t="f".concat(this.id,"_").concat(e);if(this.hasValueByKey(t))return this.uniforms[t]}getValue(e){let t="f".concat(this.id,"_").concat(e);if(this.hasValueByKey(t))return this.uniforms[t].value}getName(e){let t=/f\d+_(.*)/.exec(e);if(t&&t.length>1)return t[1];console.log("Layer.getName: error ".concat(e))}getNames(){let e=[];for(let t in this.uniforms){let i=this.getName(t);i&&e.push(i)}return e}},Q$=class extends Y${constructor(e,t,i,n,r,a,s,o,l){super(e,t,i,n,l),this.params=n,this.color=r,this.mode=a,this.alpha=s,this.isMask=o}},Z$=class extends Y${constructor(e,t,i,n,r,a){super(e,t,i,n,a),this.position=r}},K$=class extends Y${constructor(e,t,i,n,r,a){super(e,t,i,r,a),this.node=n}static createLigherLayer(e,t,i,n){let r,a,s=new VK(X$(i.alpha,n)),o=new cJ(i.mode),l=new VK(i.bumpMapIntensity),c=new VK(X$(i.alphaOverride,n));if(i.visible)if("lambert"===i.category){var h,u;r=new t$;let e=new lJ(null!==(h=n.color(i.emissive))&&void 0!==h?h:0),t=new hJ(null===(u=i.occlusion)||void 0===u||u);a={emissive:e,occlusion:t},r.emissive=e,r.occlusion=t}else if("toon"===i.category){var d,p;r=new a$;let e=new VK(null!==(d=i.shininess)&&void 0!==d?d:30),t=new lJ(null!==(p=n.color(i.specular))&&void 0!==p?p:1118481);a={shininess:e,specular:t},r.shininess=e,r.specular=t}else if("physical"===i.category){var f,m,g,v;r=new r$;let e=new VK(null!==(f=i.roughness)&&void 0!==f?f:.3),t=new VK(null!==(m=i.metalness)&&void 0!==m?m:0),n=new VK(null!==(g=i.reflectivity)&&void 0!==g?g:.5),s=new hJ(null===(v=i.occlusion)||void 0===v||v);a={roughness:e,metalness:t,reflectivity:n,occlusion:s},r.roughness=e,r.metalness=t,r.reflectivity=n,r.occlusion=s}else{var y,b,x;r=new n$;let e=new VK(null!==(y=i.shininess)&&void 0!==y?y:30),t=new lJ(void 0!==i.specular&&null!==(b=n.color(i.specular))&&void 0!==b?b:1118481),s=new hJ(null===(x=i.occlusion)||void 0===x||x);a={shininess:e,specular:t,occlusion:s},r.shininess=e,r.specular=t,r.occlusion=s}else r=new e$,a={};return r.alpha=new VK(1),r.shadingAlpha=s,r.shadingBlend=o,r.bumpMapIntensity=l,r.alphaOverride=c,a.alpha=r.shadingAlpha,a.mode=r.shadingBlend,a.bumpMapIntensity=r.bumpMapIntensity,a.alphaOverride=r.alphaOverride,new K$(e,t,i,r,a,n)}get category(){return this.node.category}};function J$(e){var t,i,n;return{alpha:new VK(null!==(t=e.alpha)&&void 0!==t?t:1),mode:new cJ(null!==(i=e.mode)&&void 0!==i?i:0),isMask:new hJ(null!==(n=e.isMask)&&void 0!==n&&n)}}function $$(e,t,i,n){if("displace"===i.type&&("intensity"===e||"visible"===e)){let e=t.uniforms["f".concat(t.id,"_intensity")];return e?(e.value=i.intensity*(i.visible?1:0),e):void 0}if("displace"!==i.type&&("alpha"===e||"visible"===e)){let r=t.uniforms["f".concat(t.id,"_alpha")];if(!r)return;if(r.value=X$(i.alpha,n)*(i.visible?1:0),"outline"===i.type&&"visible"===e){let e=t.uniforms["f".concat(t.id,"_compensation")];e&&(e.value=i.compensation&&i.visible)}return r}}function e0(e,t){let i=0,n=e.layers.find((e=>"light"===e.data.type));if(n){let e=n.data,i=Number(t.getVariable(e.alphaOverride));if(("string"==typeof e.alphaOverride?i/100:e.alphaOverride)<1)return!0}for(let a of e.layers){if("displace"!==a.data.type&&a.data.isMask)return!0;if("displace"!==a.data.type&&"alpha"in a.data&&"light"!==a.data.type&&"fresnel"!==a.data.type&&"texture"!==a.data.type&&"matcap"!==a.data.type&&"rainbow"!==a.data.type&&"outline"!==a.data.type&&"pattern"!==a.data.type){var r;let e=a.data.visible?a.data.alpha:0;if("string"==typeof e&&(e=Math.max(0,Math.min(1,Number(null!==(r=t.getVariable(e))&&void 0!==r?r:100)/100))),1===e&&"depth"===a.data.type||"gradient"===a.data.type){for(let t of a.data.colors)if(t[3]<1){e=t[3];break}}else if(1===e&&"noise"===a.data.type){let i=t.color(a.data.colorA).a,n=t.color(a.data.colorB).a,r=t.color(a.data.colorC).a,s=t.color(a.data.colorD).a,o=Math.min(i,Math.min(n,Math.min(r,s)));o<1&&(e=o)}i+=(1-i)*e}}return i<1}var t0=class extends LT{constructor(){super(void 0),this.flatShading=!1,this.needsJitter=!0,this.cacheKey="",this.fog=!0,this.dithering=!0,this.vertexColors=!0,this.transparent=!0}customProgramCacheKey(){return this.cacheKey}},i0=class extends t0{constructor(e,t,i,n){super(),this.flatShading=e,this.side=t,this.wireframe=i,this.root=n}updateAfterBuild(){let e=this.root;this.lights=e.lights,this.vertexShader=e.vertexShader,this.fragmentShader=e.fragmentShader,this.defines=e.defines,this.uniforms=e.uniforms,this.extensions=e.extensions,this.transparent=e.transparent,this.cacheKey=e.customProgramCacheKey()+"flat"+this.flatShading+this.side}onBeforeCompile(e,t){this.root.onBeforeCompile(e)}get data(){return this.root.data}get category(){return this.root.category}get hasAO(){return this.root.hasAO}getFlavor(e,t,i){return this.root.getFlavor(e,t,i)}get layers(){return this.root.layers}get fragment(){return this.root.fragment}getLayersOfType(e){return this.root.getLayersOfType(e)}getLayerByUuid(e){return this.root.getLayerByUuid(e)}updateByOp(e,t,i){this.root.updateByOp(e,t,i)}nodeMaterialDispose(){this.root.nodeMaterialDispose()}},n0=class extends t0{constructor(e,t){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];super(),this.data=e,this.allowVariableSaves=i,this.layerIdGen=0,this.flavors=[],this.masks={},this.type="NodeMaterial",this.updaters=[],this.reset0(e,t)}get nodeMaterial(){return this}getFlavor(e,t,i){let n=i?6:(e?3:0)+t;if(0===n)return this;void 0===this.flavors&&(this.flavors=[]),n-=1;let r=this.flavors[n];return void 0===r&&(r=new i0(e,t,i,this),this.flavors[n]=r,r.flatShading=e,r.side=t,r.updateAfterBuild()),r}get fragment(){return this.lightLayer.node}get category(){return this.lightLayer.category}get hasAO(){var e,t;return null!==(e=null===(t=this.lightLayer.getNode("occlusion"))||void 0===t?void 0:t.value)&&void 0!==e&&e}reset(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(this.data!==e||i)&&this.reset0(e,t)}reset0(e,t){var i,n;this.data=e;let r=null!==(i=e.layers)&&void 0!==i?i:fH.defaultTwoLayerData("phong").layers;try{this.layers=r.map((e=>Y$.create(this.layerIdGen++,e.id,e.data,t.shared)))}catch{this.layers=[]}this.layers.reverse(),this.name=null!==(n=e.name)&&void 0!==n?n:"Untitled Material",this.onUpdate(t.shared),this.transparent=e0(e,t.shared),this.saveVariableLocations(t)}onVariableUpdate(e,t,i){if("alphaOverride"===e[0])this.transparent=e0(this.data,i.shared),this.lightLayer.setValue("alphaOverride",Math.max(0,Math.min(Number(t)/100,1)));else if("layer"===e[0]){let n=e[1],r=e[2];if(n&&r){let e=this.layers.find((e=>e.uuid===n));(null===e||void 0===e?void 0:e.hasValue(r))&&("alpha"===r?(this.transparent=e0(this.data,i.shared),e.setValue(r,Math.max(0,Math.min(Number(t)/100,1)))):e.setValue(r,t))}}}saveVariableLocations(e){if(!this.allowVariableSaves)return;let t=this.data.layers.find((e=>"light"===e.data.type));t&&e.shared.getVariable(t.data.alphaOverride,["material",this.uuid,"alphaOverride"]),this.data.layers.forEach((t=>{"alpha"in t.data&&"string"==typeof t.data.alpha&&e.shared.getVariable(t.data.alpha,["material",this.uuid,"layer",t.id,"alpha"])}))}getLayersOfType(e){return this.layers.filter((t=>t.type===e))}getLayerByUuid(e){return this.layers.find((t=>t.uuid===e))}onUpdate(e){this.cacheKey=this.computeCacheKey(),this.lightLayer=this.layers.find((e=>e instanceof K$)),void 0===this.lightLayer&&(this.lightLayer=new K$(0,"",{...pH.defaultData("light","phong"),visible:!1},new e$,{},e)),this.dispose();for(let t of this.flavors)t&&t.dispose();this.applyTextureMaps(),this.applyMasks(),this.blendColors(),this.blendAfterColors(),this.blendPositions()}applyTextureMaps(){let e=this.layers.find((e=>e instanceof K$));if(!e)return;let t=e.data,i=t.bumpMap,n=t.roughnessMap;e.node.bumpMap=void 0,e.node.roughnessMap=void 0;for(let r=0;r<this.layers.length;++r){let t=this.layers[r];t instanceof Q$&&t.color instanceof AJ&&(t.uuid===i&&(e.node.bumpMap=t.color),t.uuid===n&&(e.node.roughnessMap=t.color))}}updateByOp(e,t,i){if(void 0!==t?this.data=t:t=this.data,this.transparent=e0(t,i.shared),"layers"===e.path[0]){this.data=t;let n=i.shared,r=e.path[1];if(void 0===r){if(this.layers.reverse(),4===e.type){let t=Y$.create(this.layerIdGen++,e.id,e.data,i.shared);this.layers.splice(e.localIndex,0,t),i.scene.markNeedsUpdateRendererDirty()}else if(5===e.type)this.layers.splice(e.localIndex,1)[0].dispose(),i.scene.markNeedsUpdateRendererDirty();else if(6===e.type){let t=this.layers.findIndex((t=>t.uuid===e.id)),n=this.layers[t];this.layers.splice(t,1),this.layers.splice(e.localIndex,0,n),i.scene.markNeedsUpdateRendererDirty()}this.layers.reverse(),this.onUpdate(i.shared)}else{0===e.type&&void 0!==e.props.occlusion&&i.scene.markNeedsUpdateRendererDirty();let a=this.layers.find((e=>e.uuid===r));if(a){let s,o=t.layers.data(r);if(0===e.type&&("alpha"in e.props||"alphaOverride"in e.props)&&(s="alpha"in e.props?{...e.props,alpha:X$(e.props.alpha,n,["material",this.uuid,"layer",r,"alpha"])}:{...e.props,alphaOverride:X$(e.props.alphaOverride,n,["material",this.uuid,"alphaOverride"])}),a.updateByOp({...e,...s?{props:s}:{},path:e.path.slice(2)},o,i)){let e=Y$.create(this.layerIdGen++,r,o,n);this.layers.splice(this.layers.findIndex((e=>e.uuid===r)),1,e),this.onUpdate(i.shared)}}}}else this.reset(t,i)}applyMasks(){for(let e=0;e<this.layers.length;++e){let t=this.layers[e];t instanceof Q$?t.color.mask=void 0:t instanceof K$&&(t.node.mask=void 0)}for(let e=0;e<this.layers.length;++e){let t=this.layers[e];if(t instanceof Q$&&t.isMask.value&&t.data.visible&&e>0){let i=e-1,n=this.layers[i];n instanceof K$?n.node.mask=new HK(t.color,t.alpha,HK.MUL):n instanceof Q$&&(n.isMask.value||(n.color.mask=new HK(t.color,t.alpha,HK.MUL)))}}}blendColors(){let e=this.layers.findIndex((e=>e instanceof Q$)),t=this.layers.findIndex((e=>e instanceof K$));if(-1!==e&&e<t){let i=this.layers[e].color;for(let n=e+1;n<t;++n){let e=this.layers[n];if(e instanceof Q$){if(e.isMask.value)continue;i=new xJ(i,e.color,e.alpha,e.mode)}}this.fragment.color=i}else this.fragment.color=void 0}blendAfterColors(){let e=new FK("outgoingLight","f"),t=this.layers.findIndex((e=>e instanceof K$));if(this.layers.length>t+1){for(let i=t+1;i<this.layers.length;++i){let t=this.layers[i];if(t instanceof Q$){if(t.isMask.value)continue;e=new xJ(e,t.color,t.alpha,t.mode)}}this.fragment.afterColor=e}else this.fragment.afterColor=void 0}blendPositions(){let e=this.layers.filter((e=>e instanceof Z$));if(e.length>0){let t=e[0].position;for(let i=1;i<e.length;++i)e[i]&&(t=new HK(t,e[i].position,HK.ADD),t=new HK(t,new VK(.5).setReadonly(!0),HK.MUL));this.fragment.position=t}else this.fragment.position=void 0}getDefines(){return this.defines}getUniforms(){return this.uniforms}getVertexShader(){return this.vertexShader}getFragmentShader(){return this.fragmentShader}onBeforeCompile(e){this.build(),e.defines=this.defines,e.uniforms=this.uniforms,e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.extensionDerivatives=!0===this.extensions.derivatives,e.extensionFragDepth=!0===this.extensions.fragDepth,e.extensionDrawBuffers=!0===this.extensions.drawBuffers,e.extensionShaderTextureLOD=!0===this.extensions.shaderTextureLOD}clampUniformsForPreview(e,t){let i=(e,t,i)=>Math.min(Math.max(e,t),i);for(let n of this.layers)if("displace"===n.type){let r=i(n.uniforms["f".concat(n.id,"_intensity")].value,e,t);n.uniforms["f".concat(n.id,"_intensity")].value=r}}computeCacheKey(){let e="[";for(let{data:n}of this.data.layers)if("light"===n.type)e+='"'.concat(n.visible?n.category.toUpperCase():"Basic",'"');else{var t,i;let r=(null!==(t=G$[n.type])&&void 0!==t?t:[]).map((e=>n[e])),a=(null!==(i=H$[n.type])&&void 0!==i?i:[]).map((e=>{var t,i;return null!==(t=null===(i=n[e])||void 0===i?void 0:i.length)&&void 0!==t?t:0})),s=[...r,...a],o="isMask"in n&&n.isMask,l='"'.concat(n.type,"-").concat(n.visible,"-").concat(o,'"');s.length?e+="[".concat(l,', "').concat(s.join('","'),'"],'):e+=l}return e=e.slice(0,-1)+"]",e}updateFrame(e){for(let t=0;t<this.updaters.length;++t)e.updateNode(this.updaters[t])}build(){let e=new oJ;e.needsJitter=this.needsJitter,this.lights=this.lightLayer.data.visible,e.build(this.fragment,this.fragment),this.vertexShader=e.getCode("vertex"),this.fragmentShader=e.getCode("fragment"),this.defines=e.defines,this.uniforms=e.uniforms,this.extensions=e.extensions,this.updaters=e.updaters;for(let t of this.flavors)t&&t.updateAfterBuild();return this}nodeMaterialDispose(){this.layers.forEach((e=>e.dispose())),super.dispose();for(let e of this.flavors)e&&e.dispose()}assetsLoaded(){for(let e of this.layers)if(e instanceof Q$){let t=e.params.texture;if(t instanceof fJ&&!t.image.loaded)return!1}return!0}getHash(){let e="{";return e+='"fragment":'+this.fragment.getHash(),e+="}",e}};Object.defineProperties(t0.prototype,{properties:{get:function(){return this.fragment.properties}}});var r0=class extends n0{constructor(e,t,i){super(e,t,!1),this.uuid=i,this.allowVariableSaves=!0,this.saveVariableLocations(t)}},a0=J_(sS()),s0=new Map;function o0(e){if("string"==typeof e)return e;let t=s0.get(e);return t||(t={url:URL.createObjectURL(new Blob([e]))},s0.set(e,t)),t.url}var l0,c0,h0=class{constructor(e){let t,{src:i,volume:n,delay:r,loop:a}=e;this._volume=1,this.delay=0,this._loop=1,this.loopsRemaining=0,this._status="stopped",this.onEnd=()=>{this.loopsRemaining===1/0?this.replay():this.loopsRemaining>1?(this.replay(),this.loopsRemaining--):(this._status="stopped",this.loopsRemaining=this._loop)},t="string"==typeof i?{src:i}:{src:o0(i),format:"wav"},this.sound=new a0.Howl(t),this.sound.on("end",this.onEnd),this.src=i,void 0!==n&&(this.volume=n),void 0!==r&&(this.delay=r),void 0!==a&&(this.loop=a)}get status(){return this._status}get volume(){return this._volume}set volume(e){this._volume=e,this.sound.volume(e)}get loop(){return this._loop}set loop(e){this._loop=e,this.loopsRemaining=e}replay(){this.clearDelay(),this.delayTimerId=window.setTimeout((()=>{this.sound.play(),this.clearDelay()}),this.delay)}fade(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;e?(this.sound.volume(this._volume),this.clearFade(),this.fadeTimerId=window.setTimeout((()=>{this.sound.fade(this._volume,0,t),this.clearFade()}),e)):this.sound.fade(this._volume,0,t)}on(e,t,i){this.sound.on(e,t,i)}off(e,t,i){this.sound.off(e,t,i)}play(){"playing"===this._status||this.sound.playing()||("paused"===this._status?(0===this.sound.seek()?this.replay():this.sound.play(),this._status="playing"):"stopped"===this._status&&(this.replay(),this._status="playing"))}pause(){"playing"===this._status&&(this.sound.pause(),this.clearFade(),this.clearDelay(),this._status="paused")}stop(){this.sound.stop(),this.loopsRemaining=this._loop,this.clearFade(),this.clearDelay(),this._status="stopped"}clearFade(){this.fadeTimerId&&(clearTimeout(this.fadeTimerId),delete this.fadeTimerId)}clearDelay(){this.delayTimerId&&(clearTimeout(this.delayTimerId),delete this.delayTimerId)}dispose(){this.off(),this.stop(),this.clearFade(),this.clearDelay()}},u0=class{constructor(){this.type="ShapePath",this.color=new MA,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new _O,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){var i;return null!==(i=this.currentPath)&&void 0!==i&&i.lineTo(e,t),this}quadraticCurveTo(e,t,i,n){var r;return null!==(r=this.currentPath)&&void 0!==r&&r.quadraticCurveTo(e,t,i,n),this}bezierCurveTo(e,t,i,n,r,a){var s;return null!==(s=this.currentPath)&&void 0!==s&&s.bezierCurveTo(e,t,i,n,r,a),this}splineThru(e){var t;return null!==(t=this.currentPath)&&void 0!==t&&t.splineThru(e),this}toShapes(){let e=0,t=1,i=2,n=3,r=4,a=5,s=6,o={loc:e,t:0};function l(t,n,r,a){let s=t.x,l=n.x,h=r.x,u=a.x,d=t.y,p=n.y,f=r.y,m=a.y,g=(u-h)*(d-f)-(m-f)*(s-h),v=(m-f)*(l-s)-(u-h)*(p-d),y=g/v,b=((l-s)*(d-f)-(p-d)*(s-h))/v;if(0===v&&0!==g||y<=0||y>=1||b<0||b>1)return null;if(0===g&&0===v){for(let h=0;h<2;h++){if(c(0===h?r:a,t,n),o.loc===e){let e=0===h?r:a;return{x:e.x,y:e.y,t:o.t}}if(o.loc===i){return{x:+(s+o.t*(l-s)).toPrecision(10),y:+(d+o.t*(p-d)).toPrecision(10),t:o.t}}}return null}for(let i=0;i<2;i++)if(c(0===i?r:a,t,n),o.loc===e){let e=0===i?r:a;return{x:e.x,y:e.y,t:o.t}}return{x:+(s+y*(l-s)).toPrecision(10),y:+(d+y*(p-d)).toPrecision(10),t:y}}function c(l,c,h){let u,d=h.x-c.x,p=h.y-c.y,f=l.x-c.x,m=l.y-c.y,g=d*m-f*p;return l.x===c.x&&l.y===c.y?(o.loc=e,void(o.t=0)):l.x===h.x&&l.y===h.y?(o.loc=t,void(o.t=1)):void(g<-Number.EPSILON?o.loc=n:g>Number.EPSILON?o.loc=r:d*f<0||p*m<0?o.loc=a:Math.sqrt(d*d+p*p)<Math.sqrt(f*f+m*m)?o.loc=s:(u=0!==d?f/d:m/p,o.loc=i,o.t=u))}function h(e,t,i){let n=new hA;t.getCenter(n);let r=[];return i.forEach((t=>{t.boundingBox.containsPoint(n)&&function(e,t){let i=[],n=[];for(let r=1;r<e.length;r++){let a=e[r-1],s=e[r];for(let e=1;e<t.length;e++){let r=l(a,s,t[e-1],t[e]);null!==r&&void 0===i.find((e=>e.t<=r.t+Number.EPSILON&&e.t>=r.t-Number.EPSILON))&&(i.push(r),n.push(new hA(r.x,r.y)))}}return n}(e,t.points).forEach((e=>{r.push({identifier:t.identifier,isCW:t.isCW,point:e})}))})),r.sort(((e,t)=>e.point.x-t.point.x)),r}let u=0,d=999999999,p=-999999999,f=[];this.subPaths.forEach((e=>{let t=e.getPoints(),i=-999999999,n=999999999,r=-999999999,a=999999999;for(let s=0;s<t.length;s++){let e=t[s];e.y>i&&(i=e.y),e.y<n&&(n=e.y),e.x>r&&(r=e.x),e.x<a&&(a=e.x)}p<=r&&(p=r+1),d>=a&&(d=a-1),t.length&&f.push({curves:e.curves,points:t,isCW:eI.isClockWise(t),identifier:u++,boundingBox:new _R(new hA(a,n),new hA(r,i))})}));let m=f.map((e=>{var t;return function(e,t,i,n,r){(null==r||""===r)&&(r="nonzero");let a=new hA;e.boundingBox.getCenter(a);let s=h([new hA(i,a.y),new hA(n,a.y)],e.boundingBox,t);s.sort(((e,t)=>e.point.x-t.point.x));let o=[],l=[];s.forEach((t=>{t.identifier===e.identifier?o.push(t):l.push(t)}));let c=o[0].point.x,u=[],d=0;for(;d<l.length&&l[d].point.x<c;)u.length>0&&u[u.length-1]===l[d].identifier?u.pop():u.push(l[d].identifier),d++;if(u.push(e.identifier),"evenodd"===r){let t=u.length%2===0,i=u[u.length-2];return{identifier:e.identifier,isHole:t,for:i}}if("nonzero"===r){let i=!0,n=null,r=null;for(let e=0;e<u.length;e++){let a=u[e];t[a]&&(i?(r=t[a].isCW,i=!1,n=a):r!==t[a].isCW&&(r=t[a].isCW,i=!0))}return{identifier:e.identifier,isHole:i,for:n}}console.warn('fill-rule: "'+r+'" is currently not implemented.')}(e,f,d,p,null===(t=this.userData)||void 0===t?void 0:t.style.fillRule)})),g=[];return f.forEach((e=>{let t=m[e.identifier];if(t&&!t.isHole){let t=new TO;t.curves=e.curves,m.filter((t=>(null===t||void 0===t?void 0:t.isHole)&&t.for===e.identifier)).forEach((e=>{if(e){let i=f[e.identifier],n=new _O;n.curves=i.curves,t.holes.push(n)}})),g.push(t)}})),g}},d0=!1,p0=new Promise((e=>{l0=e})),f0=!1;function m0(){if(d0=!0,!f0)return c0||(c0=async function(){let e=await __webpack_require__.e(946).then(__webpack_require__.bind(__webpack_require__,946));l0(e),f0=!0}(),c0)}var g0=new class{async load(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>{},{load:n}=await p0;n(e,((e,n)=>{e||!n?i(null!==e&&void 0!==e?e:"Something went wrong"):t(n)}))}async parse(e){let{parse:t,Bidi:i}=await p0;try{let n=t(e),r=new i,a=e=>n.charToGlyphIndex(e.char);return r.registerModifier("glyphIndex",null,a),r.applyFeatures(n,n.defaultRenderOptions.features),{font:n,bidi:r}}catch(o){console.error(o)}}};async function v0(e){let t,i,n=!1;if(e.url?(t=await async function(e){return await(await fetch(e)).arrayBuffer()}(e.url),i=e.url,n=e.url.startsWith("/")):e.data&&(t=e.data.buffer.slice(e.data.byteOffset,e.data.byteOffset+e.data.byteLength)),t){if(!d0)return{font:void 0,url:i,intercepted:n,arr:t,bidi:null};{let e=await g0.parse(t);if(e)return{font:e.font,url:i,intercepted:n,arr:t,bidi:e.bidi}}}}function y0(e,t){return t.state.glyphIndex===e||t.state.fina===e||t.state.medi===e||t.state.init===e}var b0=class{constructor(e){var t;this._arrayBuffer=new ArrayBuffer(1),this._isLoaded=!1,this._intercepted=!1,this._isUserFont=null!==(t=e.isUserFont)&&void 0!==t&&t,this._loadingPromise=v0(e).then((e=>{e&&(this._arrayBuffer=e.arr,this._url=e.url,this.font=e.font,this._intercepted=e.intercepted,this._isLoaded=!0,this._bidi=e.bidi)}))}update(e){var t;this._isLoaded=!1,this._isUserFont=null!==(t=e.isUserFont)&&void 0!==t&&t,this._loadingPromise=v0(e).then((e=>{e&&(this._arrayBuffer=e.arr,this._url=e.url,this.font=e.font,this._intercepted=e.intercepted,this._isLoaded=!0,this._bidi=e.bidi)}))}get url(){return this._url}get intercepted(){return this._intercepted}get isLoaded(){return this._isLoaded}get loadingPromise(){return this._loadingPromise}reverseLigaturesTable(e,t,i){if(!this._bidi)return[];let n=this._bidi;n.getTextGlyphs(t);let r=n.tokenizer.tokens,a=[],s=0,o=i.length===r.length;for(let l=0;l<i.length;l++){let n=i[l].index,c=String.fromCharCode(i[l].unicode),h=r[s];if(y0(n,h)||o)a.push({char:c,index:n,replacements:[h.state.glyphIndex],replacementChars:[h.char]}),s++;else{let i=h.char,r="",o=[h.state.glyphIndex],l=[],u=!1;for(;!u;)s++,r=t.charAt(s),i+=r,o.push(e.charToGlyphIndex(r)),l=e.stringToGlyphs(i),1===l.length&&l[0].index===n&&(u=!0),s>t.length&&(u=!0);a.push({char:c,index:n,replacements:o,replacementChars:Array.from(i)}),s++}}return a}generateShapes(e,t){if(!this._isLoaded)return;let i,n=this.font,r=t.fontSize/this.unitsPerEm,a=t.fontSize*t.lineHeight,s=e.map((e=>this.getTextWidth(e,t))),o=t.width,l=this.getCharWidth("\n",t),c=1===t.horizontalAlign?l:0,h=this.computeSpaceWidthForLine(e,0,t),u=this.getLineInitialOffsetX(s[0],o,t.horizontalAlign,e[0],l),d=this.getLineInitialOffsetY(a,e.length,t.height,r,t.verticalAlign),p=[],f=e.map((e=>[])),m=e.map((e=>[]));for(let v=0;v<e.length;v++){let g=e[v],y={features:{liga:!0}},b=[];try{b=n.stringToGlyphs(g,y)}catch(L){console.warn(L)}u=this.getLineInitialOffsetX(s[v],o,t.horizontalAlign,g,l);let x=[];try{x=this.reverseLigaturesTable(n,g,b)}catch(L){console.warn(L)}h=this.computeSpaceWidthForLine(e,v,t);for(let e=0;e<b.length;e++){let a=b[e],s=0===a.index?"\n":a.unicode?String.fromCharCode(a.unicode):void 0,o=x[e],l=0,g=0;0===e&&2===t.horizontalAlign&&void 0!==a.leftSideBearing&&(g=-a.leftSideBearing*r),i&&(l=n.getKerningValue(a,i)*r),u+=g+l;let y=0;if("\n"===s)y=c;else if(" "===s)y=h;else{let e=this.createPath(a,r,u,d,t);e&&(y=e.offsetX-(l+g),p.push(e.path))}if(1===o.replacements.length)m[v].push([u,d]),f[v].push(y);else{let e=o.replacements.map((e=>{var t;return(null!==(t=n.glyphs.get(e).advanceWidth)&&void 0!==t?t:0)*r})),t=e.reduce(((e,t)=>e+t),0),i=e.map((e=>e/t)),a=u;for(let n=0;n<i.length;n++){let e=y*i[n];m[v].push([a,d]),f[v].push(e),a+=e}}u+=y,i=a}d-=a}let g=[];for(let v=0,y=p.length;v<y;v++)g.push(...p[v].toShapes());return{shapes:g,charWidths:f,lineWidths:s,charCoords:m}}get isUserFont(){return this._isUserFont}get arrayBuffer(){return this._arrayBuffer}get ascender(){var e,t;return null!==(e=null===(t=this.font)||void 0===t?void 0:t.ascender)&&void 0!==e?e:0}get descender(){var e,t;return null!==(e=null===(t=this.font)||void 0===t?void 0:t.descender)&&void 0!==e?e:0}get familyName(){var e,t;return null!==(e=null===(t=this.font)||void 0===t?void 0:t.names.fontFamily)&&void 0!==e?e:""}get subfamilyName(){var e,t;return null!==(e=null===(t=this.font)||void 0===t?void 0:t.names.fontSubfamily)&&void 0!==e?e:""}get unitsPerEm(){var e,t;return null!==(e=null===(t=this.font)||void 0===t?void 0:t.unitsPerEm)&&void 0!==e?e:1}getLineInitialOffsetX(e,t,i,n,r){return(3===i||2===i)&&n.indexOf("\n")>=0&&(e-=r),3===i?.5*t-.5*e:2===i?t-e:0}getLineInitialOffsetY(e,t,i,n,r){let a=t*e,s=e-Math.abs(this.ascender-this.descender)*n,o=-this.ascender*n-s/2;return 3===r?-(i-a-o):2===r?-(.5*i-.5*a-o):o}createPath(e,t,i,n,r){var a;let s=e.getPath(i,-n,r.fontSize,{kerning:!1,letterSpacing:r.letterSpacing});if(!s)return void console.error('THREE.Font: character "'+e+'" does not exists in font family '+this.familyName+".");let o=new u0,l=(null!==(a=e.advanceWidth)&&void 0!==a?a:1)*t;if(e)for(let h of s.commands){var c;let e=null===(c=o.currentPath)||void 0===c?void 0:c.currentPoint;if(!e||"Z"===h.type||e.x!==h.x||-e.y!==h.y)switch(h.type){case"M":o.moveTo(h.x,-h.y);break;case"L":o.lineTo(h.x,-h.y);break;case"Q":o.quadraticCurveTo(h.x1,-h.y1,h.x,-h.y);break;case"C":o.bezierCurveTo(h.x1,-h.y1,h.x2,-h.y2,h.x,-h.y)}}return o.subPaths.forEach((e=>{let t=function(e){if(e.length){let t=e[0];if(t instanceof gO)return t.v1;if(t instanceof fO||t instanceof yO)return t.v0}}(e.curves);void 0!==t&&e.currentPoint.distanceTo(t)>0&&e.lineTo(t.x,t.y)})),{offsetX:l+r.fontSize*r.letterSpacing,path:o}}getCharWidth(e,t){var i,n;return null!==(i=null===(n=this.font)||void 0===n?void 0:n.getAdvanceWidth(e,t.fontSize,{kerning:!0,letterSpacing:t.letterSpacing}))&&void 0!==i?i:0}getTextWidth(e,t){var i,n;return null!==(i=null===(n=this.font)||void 0===n?void 0:n.getAdvanceWidth(e,t.fontSize,{kerning:!0,letterSpacing:t.letterSpacing}))&&void 0!==i?i:0}computeSpaceWidthForLine(e,t,i){let n=this.getCharWidth(" ",i),r=e[t];if(r){let a=this.countSpaces(r.trimEnd());if(4===i.horizontalAlign&&t<e.length-1&&a){return(i.width-(this.getTextWidth(r,i)-a*n))/a}}return n}countSpaces(e){return(e.match(/ /g)||[]).length}};var x0=class{constructor(){this.objects=new Map,this.unreachable=new Set}getCached(e){return this.objects.get(e)}get size(){return this.objects.size}get(e,t,i){let n=this.objects.get(e);return void 0===n?(n=this.createObject(e,t,i),this.objects.set(e,n)):n.isShared=!0,n}forceDelete(e){let t=this.objects.get(e);t&&(this.disposeObject(t),this.objects.delete(e))}mutateIfUnique(e,t){let i=this.objects.get(e);if(i&&!0!==i.isShared)return this.objects.delete(e),this.objects.set(t,i),i}startGc(){this.unreachable=new Set(this.objects.keys())}markAsReachable(e,t){t===this.objects.get(e)&&this.unreachable.delete(e)}endGc(){this.unreachable.forEach((e=>{this.disposeObject(this.objects.get(e)),this.objects.delete(e)})),this.unreachable.clear()}dispose(){this.objects.forEach((e=>{this.disposeObject(e)})),this.objects.clear()}},w0=class extends x0{constructor(e){super(),this.flatShading=e}disposeObject(e){e.dispose()}createObject(e,t,i){let n=kZ(e,t,this.flatShading,i);return n.computeBoundingSphere(),n}},_0={markNeedsUpdateRendererDirty:()=>{}},S0=class extends c${constructor(e){super(),this.shared=e}create(e){return new h$(e,this.shared)}},E0=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.data=e,this.geometryCache=new w0(!0),this.geometryCache2=new w0(!1),this.imageHolderCache=new S0(this),this.thisContext={scene:_0,shared:this},this.deletedMaterial=new r0(fH.defaultTwoLayerData("phong"),this.thisContext,""),this.deletedImage=new u$(rW.emptyImage,this),this.deletedVideo=new u$(rH.defaultVideo,this),this.materials={},this.images={},this.canvases={},this.videos={},this.colors={},this.audios={},this.particles={},this.fonts={},this.variables={},this.mouseProperty=null,this.raycastProperty=null,this.requestRender=()=>{this._requestRender&&this._requestRender()},t.images)for(let[i,n]of Object.entries(t.images))this.addImage(i,n);if(t.videos)for(let[i,n]of Object.entries(t.videos))this.addVideo(i,n);if(t.audios)for(let[i,n]of Object.entries(t.audios))this.addAudio(i,n);if(t.particles)for(let[i,n]of Object.entries(t.particles))this.addParticle(i,n);this.reset(e)}setRequestRender(e){this._requestRender=e}setEntityOpContext(e){this.entityOpContext=e}reset(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.resetLib(e.lib);for(let{id:i,data:n}of e.variables)this.addVariableHolder(i,n),t&&this.updateVariableHolder(i,n);for(let[i,n]of Object.entries(e.images))this.addImage(i,n);for(let[i,n]of Object.entries(e.videos))this.addVideo(i,n);for(let[i,n]of Object.entries(e.colors))this.addColor(i,n);for(let[i,n]of Object.entries(e.materials))this.addMaterial(i,n);for(let[i,n]of Object.entries(e.audios))this.addAudio(i,n);for(let[i,n]of Object.entries(e.particles))this.addParticle(i,n);for(let[i,n]of Object.entries(e.fonts))this.addFont(i,n)}addMaterial(e,t){if(this.materials[e]){let i=this.materials[e];i.reset(t,this.thisContext),i.dispose()}else{let i=new r0(t,this.thisContext,e);this.materials[e]=i}}deleteMaterial(e){this.materials[e]&&(this.materials[e].nodeMaterialDispose(),delete this.materials[e])}getMaterial(e){return this.materials[e]}getMaterialOrDeletedPlaceholder(e){var t;return null!==(t=this.materials[e])&&void 0!==t?t:this.deletedMaterial}material(e){return"string"==typeof e?this.getMaterialOrDeletedPlaceholder(e):null==e?(console.error("material is undefined or null"),this.deletedMaterial):new n0(e,this.thisContext)}getMaterials(){return this.materials}addImage(e,t){return this.images[e]?(this.onColorOrImageUpdate&&this.onColorOrImageUpdate(),this.images[e].updateSrc(t.data),!0):(this.images[e]=new u$(t,this),!1)}deleteImage(e){let t=this.images[e];t&&(t.dispose(),delete this.images[e])}getDefaultImage(){return this.images.image_0}getImage(e){var t;return null!==(t=this.images[e])&&void 0!==t?t:this.deletedImage}image(e){return"string"==typeof e?this.getImage(e):this.imageHolderCache.load(e)}addCanvas(e,t){return this.canvases[e]?(this.onColorOrImageUpdate&&this.onColorOrImageUpdate(),this.canvases[e].updateSrc(t),!0):(this.canvases[e]=new u$(t,this),!1)}canvas(e){return this.canvases[e]}addVideo(e,t){return this.videos[e]?(this.videos[e].updateSrc(t.data),!0):(this.videos[e]=new u$(t,this),!1)}deleteVideo(e){let t=this.videos[e];t&&(t.dispose(),delete this.videos[e])}getVideo(e){var t;return null!==(t=this.videos[e])&&void 0!==t?t:this.deletedVideo}video(e){return"string"==typeof e?this.getVideo(e):this.imageHolderCache.load(e)}addColor(e,t){return this.colors[e]?(this.onColorOrImageUpdate&&this.onColorOrImageUpdate(),"a"in t?this.colors[e].setRGBA(t.r,t.g,t.b,t.a):this.colors[e].setRGBA(t.r,t.g,t.b,1),!0):(this.colors[e]=new U$(t.r,t.g,t.b,"a"in t?t.a:1),!1)}updateColor(e,t){if(this.colors[e]){var i,n,r,a;this.onColorOrImageUpdate&&this.onColorOrImageUpdate();let s=this.colors[e];return this.colors[e].r=null!==(i=t.r)&&void 0!==i?i:s.r,this.colors[e].g=null!==(n=t.g)&&void 0!==n?n:s.g,this.colors[e].b=null!==(r=t.b)&&void 0!==r?r:s.b,this.colors[e].a=null!==(a=t.a)&&void 0!==a?a:s.a,!0}return!1}deleteColor(e){this.colors[e]&&delete this.colors[e]}getColor(e){return this.colors[e]}color(e){let t;if("string"!=typeof e)return new CK(e.r,e.g,e.b,"a"in e?e.a:1);{let i=this.getColor(e);i?t=i:(console.warn("Tried to create color layer params with a color key that does not exist in the assets manager"),t=new CK(0,0,0,0))}return t}addAudio(e,t){this.audios[e]=t}getAudio(e){let t=this.audios[e];if(t instanceof h0)return t;{let i=new h0({src:t.data});return this.audios[e]=i,i}}addParticle(e,t){this.particles[e]=t}getParticle(e){return this.particles[e]}deleteParticle(e){this.particles[e]&&delete this.particles[e]}deleteAudio(e){let t=this.audios[e];t&&(t instanceof h0&&t.dispose(),delete this.audios[e])}addFont(e,t){this.fonts[e]=new b0(t),this.fonts[e].loadingPromise.then((()=>this.requestRender()))}getFont(e){return this.fonts[e]}deleteFont(e){this.fonts[e]&&delete this.fonts[e]}dispose(){Object.keys(this.materials).forEach((e=>this.deleteMaterial(e))),this._requestRender=void 0,Object.values(this.audios).forEach((e=>{e instanceof h0&&e.dispose()})),this.audios={},this.particles={},this.geometryCache.dispose(),this.geometryCache2.dispose()}addVariableHolder(e,t){return void 0===this.variables[e]?(this.variables[e]={value:t.value,locations:[]},"dynamicVariableType"in t&&(this.variables[e].dynamicVariablePlayState="Playing",this.variables[e].dynamicVariableToggleIsForward=void 0),!0):(this.variables[e].value=t.value,!1)}resetDynamicVariablePlayState(){for(let e in this.variables)void 0!==this.variables[e].dynamicVariablePlayState&&(this.variables[e].dynamicVariablePlayState="Playing",this.variables[e].dynamicVariableToggleIsForward=void 0)}updateVariableHolder(e,t){this.updateVariable(e,t.value)}updateVariable(e,t){if(void 0===this.variables[e])return!1;this.variables[e].value=t;let i=t;for(;"string"==typeof i;)i=this.variables[i].value;let n=this.entityOpContext.scene;for(let r=this.variables[e].locations.length-1;r>=0;r--){let t=this.variables[e].locations[r];if("material"===t[0]){let e=t[1],r=i,a={scene:n,shared:this},s=t.slice(2);n.traverseMaterial((t=>{var i;let n=null!==(i=t.root)&&void 0!==i?i:t;n.uuid===e&&n.onVariableUpdate(s,r,a)}));let o=this.materials[e];o&&o.onVariableUpdate(s,r,a)}else{let a=n.find(t[0]);if(void 0===a){this.variables[e].locations.splice(r,1);continue}if("geometry"!==t[1]&&"particles"!==t[1]){for(let e=1;e<t.length-1;e++)a=a[t[e]];"rotation"===t[1]?a[t[t.length-1]]=i*cA.DEG2RAD:a[t[t.length-1]]=i}if(a=n.find(t[0]),"ParticleEmitter"===a.type&&a.updateVariableState(i,t),IX.is(a))if("position"===t[1]||"rotation"===t[1]||"scale"===t[1])a.onVariableUpdate();else if("geometry"===t[1]){let e=a;a.component&&(e=a.component);let t=e.dataPatched;e.chooseGeoemtryCache(this).forceDelete(t.geometry),e.createGeometryDelayed(this.entityOpContext),e.onVariableUpdate(!0),e.instances.forEach((e=>{let t=e.dataPatched;e.chooseGeoemtryCache(this).forceDelete(t.geometry),e.createGeometryDelayed(this.entityOpContext),e.onVariableUpdate(!0)}))}}}return this.requestRender(),!0}deleteVariable(e){this.variables[e]&&delete this.variables[e]}getVariable(e,t){if(Array.isArray(e)){var i,n,r,a;if("mouse"===e[0])return null!==(i=null===(n=this.mouseProperty)||void 0===n?void 0:n[e[1]])&&void 0!==i?i:0;if("raycast"===e[0])return null!==(r=null===(a=this.raycastProperty)||void 0===a?void 0:a[e[1]])&&void 0!==r?r:0;let t=this.entityOpContext.scene.find(e[0]);if("width"===e[1]||"height"===e[1]||"depth"===e[1])return t.geometry.userData.parameters[e[1]];for(let i=1;i<e.length;i++)t=t[e[i]];return"rotation"===e[1]&&(t*=cA.RAD2DEG),t}for(let o in this.variables){var s;if(void 0===t)break;let e=this.variables[o],i=null===(s=e.locations)||void 0===s?void 0:s.findIndex((e=>LV.equal(e,t)));void 0!==i&&-1!==i&&e.locations.splice(i,1)}if("string"==typeof e){let i=e,n=e;do{if(n=i,void 0===this.variables[i])break;i=this.variables[i].value}while("string"==typeof i);return t&&void 0!==this.variables[n]&&this.variables[n].locations.push(t),i}return e}getVariables(){return this.variables}getDynamicVariablePlayState(e){var t;return null===(t=this.variables[e])||void 0===t?void 0:t.dynamicVariablePlayState}setDynamicVariablePlayState(e,t){void 0!==this.variables[e]&&(this.variables[e].dynamicVariablePlayState=t)}getDynamicVariableToggleIsForward(e){var t;return null===(t=this.variables[e])||void 0===t?void 0:t.dynamicVariableToggleIsForward}setDynamicVariableToggleIsForward(e,t){void 0!==this.variables[e]&&(this.variables[e].dynamicVariableToggleIsForward=t)}resetLib(e){for(let[t,i]of Object.entries(e.images))this.addImage(t,i.asset);for(let[t,i]of Object.entries(e.audios))this.addAudio(t,i.asset);for(let[t,i]of Object.entries(e.particles))this.addParticle(t,i.asset);for(let[t,i]of Object.entries(e.colors))this.addColor(t,i.asset);for(let[t,i]of Object.entries(e.fonts))this.addFont(t,i.asset);for(let[t,i]of Object.entries(e.materials))this.addMaterial(t,i.asset);for(let[t,i]of Object.entries(e.videos))this.addVideo(t,i.asset);for(let[t,i]of Object.entries(e.variables))this.addVariableHolder(t,i.asset)}updateLibByOp(e,t){"images"===e.path[0]?1===e.path.length&&1===e.type?this.addImage(e.id,e.data.asset):1===e.path.length&&2===e.type&&this.deleteImage(e.id):"videos"===e.path[0]?1===e.path.length&&1===e.type?this.addVideo(e.id,e.data.asset):1===e.path.length&&2===e.type&&this.deleteVideo(e.id):"audios"===e.path[0]?1===e.path.length&&1===e.type?this.addAudio(e.id,e.data.asset):1===e.path.length&&2===e.type&&this.deleteAudio(e.id):"particles"===e.path[0]?1===e.path.length&&1===e.type?this.addParticle(e.id,e.data.asset):1===e.path.length&&2===e.type&&this.deleteParticle(e.id):"colors"===e.path[0]?1===e.path.length&&1===e.type?this.addColor(e.id,e.data.asset):1===e.path.length&&2===e.type&&this.deleteColor(e.id):"materials"===e.path[0]?1===e.path.length&&1===e.type?this.addMaterial(e.id,e.data.asset):1===e.path.length&&2===e.type&&this.deleteMaterial(e.id):"fonts"===e.path[0]?1===e.path.length&&1===e.type?this.addFont(e.id,e.data.asset):1===e.path.length&&2===e.type&&this.deleteFont(e.id):"variables"===e.path[0]?1===e.path.length&&1===e.type?this.addVariableHolder(e.id,e.data.asset):1===e.path.length&&2===e.type&&this.deleteVariable(e.id):"components"===e.path[0]&&t.updateByLibOp(e,this)}updateByOp(e,t,i){this.data=t,"images"===e.path[0]?2===e.path.length&&0===e.type?e.props.data&&this.getImage(e.path[1]).updateSrc(e.props.data):1===e.path.length&&1===e.type?this.addImage(e.id,e.data):1===e.path.length&&2===e.type&&this.deleteImage(e.id):"videos"===e.path[0]?2===e.path.length&&0===e.type?e.props.data&&this.getVideo(e.path[1]).updateSrc(e.props.data):1===e.path.length&&1===e.type?this.addVideo(e.id,e.data):1===e.path.length&&2===e.type&&this.deleteVideo(e.id):"audios"===e.path[0]?2===e.path.length&&0===e.type?e.props.data&&this.addAudio(e.path[1],t.audios[e.path[1]]):1===e.path.length&&1===e.type?this.addAudio(e.id,e.data):1===e.path.length&&2===e.type&&this.deleteAudio(e.id):"particles"===e.path[0]?2===e.path.length&&0===e.type?e.props.data&&this.addParticle(e.path[1],t.particles[e.path[1]]):1===e.path.length&&1===e.type?this.addParticle(e.id,e.data):1===e.path.length&&2===e.type&&this.deleteParticle(e.id):"colors"===e.path[0]?2===e.path.length&&0===e.type?this.updateColor(e.path[1],e.props):1===e.path.length&&1===e.type?this.addColor(e.id,e.data):1===e.path.length&&2===e.type&&this.deleteColor(e.id):"materials"===e.path[0]?1===e.path.length&&1===e.type?this.addMaterial(e.id,e.data):1===e.path.length&&2===e.type?this.deleteMaterial(e.id):e.path.length>1&&this.getMaterial(e.path[1]).updateByOp(dV.drop(e,2),t.materials[e.path[1]],{shared:this,scene:i}):"fonts"===e.path[0]?2===e.path.length&&0===e.type?this.updateFont(e.path[1],e,i):1===e.path.length&&1===e.type?this.addFont(e.id,e.data):1===e.path.length&&2===e.type&&this.deleteFont(e.id):"variables"===e.path[0]?2===e.path.length&&0===e.type&&"value"in e.props?this.updateVariable(e.path[1],e.props.value):1===e.path.length&&4===e.type?this.addVariableHolder(e.id,e.data):1===e.path.length&&5===e.type&&this.deleteVariable(e.id):"lib"===e.path[0]&&this.updateLibByOp(dV.drop(e,1),i)}updateFont(e,t,i){if(t.props.url){let n=this.getFont(e),r={...this.data.fonts[e],url:t.props.url};n.update(r),n.loadingPromise.then((()=>this.requestRender())),i.updateFont(e,this)}}},C0=(new E0(hW.emptyData()),class extends vK{updateByPatchedOp(e,t,i){if(super.updateByPatchedOp(e,t,i),null!==function(e,t){let i=[];if(t.length!==e.length)return null;for(var n=0;n<e.length;){if("*"===t[n])i.push(e[n]);else if(e[n]!==t[n])return null;n+=1}return i}(e.path,["materials"])&&0===e.type&&Array.isArray(this.material))for(let[n,r]of Object.entries(e.props)){let e=i.shared.material(r);this.material[Number(n)]=e}else if(VV(e.path,["material"])&&this.material instanceof t0)"material"in t&&"string"!=typeof t.material&&this.material.updateByOp(dV.drop(e,1),t.material,i);else if(VV(e.path,["materials","*"])&&Array.isArray(this.material)){let n=e.path[1];if("materials"in t&&n<this.material.length){let r=t.materials[n];"string"!=typeof r&&this.material[n].updateByOp(dV.drop(e,2),r,i)}}}get needsAO(){return void 0!==this.material&&(Array.isArray(this.material)?this.material[0]:this.material).hasAO}updateState(e,t){var i,n;super.updateState(e,t),void 0!==e.castShadow&&(this.castShadow=e.castShadow),void 0!==e.receiveShadow&&(this.receiveShadow=e.receiveShadow);let r=this.dataPatched;if("NonParametricGeometry"!==(null===(i=e.geometry)||void 0===i?void 0:i.type)&&"material"in e&&void 0!==e.material&&(this.disposeMaterial(),this.material=t.shared.material(e.material).getFlavor(r.flatShading,r.side,r.wireframe),t.scene.markNeedsUpdateRendererDirty()),("NonParametricGeometry"===(null===(n=e.geometry)||void 0===n?void 0:n.type)||"materials"in e)&&("materials"in e&&void 0!==e.materials?(this.disposeMaterial(),this.material=e.materials.map((e=>t.shared.material(e).getFlavor(r.flatShading,r.side,r.wireframe))),t.scene.markNeedsUpdateRendererDirty()):"material"in e&&void 0!==e.material&&(this.disposeMaterial(),this.material=[t.shared.material(e.material).getFlavor(r.flatShading,r.side,r.wireframe)],t.scene.markNeedsUpdateRendererDirty())),void 0!==e.flatShading||void 0!==e.wireframe||void 0!==e.side)if(Array.isArray(this.material))for(let a=0;a<this.material.length;a++)this.material[a]=this.material[a].getFlavor(r.flatShading,r.side,r.wireframe);else this.material=this.material.getFlavor(r.flatShading,r.side,r.wireframe)}disposeMaterial(){this.material&&kj(this.material).forEach((e=>{e instanceof t0&&(e instanceof r0||e.nodeMaterialDispose())}))}dispose(){this.disposeMaterial(),super.dispose()}}),A0=new FA,M0=new RA,T0=new RA,P0=new FA,D0=new mM,k0=class extends C0{constructor(e,t,i){super(e,t),this.data=t,this.isSkinnedMesh=!1,this.localGeometry=void 0,t.bindMode&&t.bindMatrix&&(this.bindMode=t.bindMode,this.bindMatrix=(new mM).fromArray(t.bindMatrix),this.bindMatrixInverse=new mM)}chooseGeoemtryCache(e){return e.geometryCache}markGeometryAsReachable(e){this.geometryCreateDeleyed instanceof fT&&this.chooseGeoemtryCache(e).markAsReachable(this.dataPatched.geometry,this.geometryCreateDeleyed)}get geometry(){if(void 0!==this.localGeometry)return this.localGeometry;if(this.geometryCreateDeleyed instanceof E0){let e=this.geometryCreateDeleyed,t=this.chooseGeoemtryCache(e);this.geometryCreateDeleyed=t.get(this.dataPatched.geometry,e,this)}return this.geometryCreateDeleyed}set geometry(e){this.localGeometry=e}get is2DAndNoDepth(){let e=this.dataPatched.geometry;return wH.is2DParametricMesh(e.type)&&0===e.depth}get is2DType(){return wH.is2DParametricMesh(this.geometry.userData.type)}get isNonParametric(){return"NonParametricGeometry"===this.geometry.userData.type}updateByPatchedOp(e,t,i){super.updateByPatchedOp(e,t,i),VV(e.path,["geometry"])&&this.updateByPatchedOpGeometry(dV.drop(e,1),t.geometry,i)}removeInteractionGeometry(e){var t;null!==(t=this.localGeometry)&&void 0!==t&&t.dispose(),this.localGeometry=void 0}updateGeometryInteractions(e,t){this.invalidateDownstreamBooleanData();let i=this.data.geometry.type;if("NonParametricGeometry"===i||"SubdivGeometry"===i){let i,n,r,a=e;if(void 0===this.localGeometry){let e={...this.data.geometry,...a};this.localGeometry=kZ(e,t,this.data.flatShading,this)}a.scaleBaked?[i,n,r]=a.scaleBaked:({width:i,height:n,depth:r}=a);let s=this.localGeometry.userData;void 0!==s.sxPrev&&IZ(this.localGeometry.attributes,i/s.sxPrev,n/s.syPrev,r/s.szPrev),s.sxPrev=i,s.syPrev=n,s.szPrev=r}else{var n;let i={...this.data.geometry,...e};null!==(n=this.localGeometry)&&void 0!==n&&n.dispose(),this.localGeometry=kZ(i,t,this.data.flatShading,this)}}refreshAttachedCloners(e){for(let t of this.attachedSurfaceCloners)e.scene.addPendingUpdateCloner(t.object)}refreshAttachedPaths(e){for(let t of this.attachedPaths)e.scene.addPendingCommand((()=>t.updateShape()))}createGeometryDelayed(e){this.geometryCreateDeleyed=e.shared,this.refreshAttachedCloners(e),this.refreshAttachedPaths(e)}updateByPatchedOpGeometry(e,t,i){var n;let r=!1;0===e.type&&0===e.path.length&&Object.keys(e.props).includes("scaleBaked")&&this.geometryCreateDeleyed instanceof jZ&&this.chooseGeoemtryCache(i.shared).mutateIfUnique(this.geometryCreateDeleyed.data,t)===this.geometryCreateDeleyed&&(r=!0,this.geometryCreateDeleyed.mutateDirectlyScaleBaked(t,e.props.scaleBaked),this.refreshAttachedCloners(i),this.refreshAttachedPaths(i)),r||(null!==(n=i.scene)&&void 0!==n&&n.markGeometryCacheDirty(),this.createGeometryDelayed(i)),this.resetBBoxNeedsUpdate(),this.invalidateDownstreamBooleanData()}updateGeometryOnStateUpdate(e,t){this.createGeometryDelayed(t)}updateState(e,t){void 0!==e.geometry&&this.updateGeometryOnStateUpdate(e.geometry,t),super.updateState(e,t)}updateGeometryGroupsIfNeeded(){var e,t;Array.isArray(this.material)&&0===this.geometry.groups.length&&this.geometry.addGroup(0,Math.max(null!==(e=null===(t=this.geometry.getIndex())||void 0===t?void 0:t.count)&&void 0!==e?e:0,this.geometry.getAttribute("position").count),0)}updateEntityBoxSize(e,t){var i,n;let r=this.geometry.userData.parameters;this.is2DType?e.set(0,0,.5*r.depth):this.isNonParametric?(e.setScalar(0),this.geometry.boundingSphere&&e.copy(this.geometry.boundingSphere.center),t.set(r.width,r.height,null!==(i=r.depth)&&void 0!==i?i:0).multiplyScalar(.5)):e.setScalar(0),t.set(r.width,r.height,null!==(n=r.depth)&&void 0!==n?n:0).multiplyScalar(.5)}updateMatrixWorld(e){super.updateMatrixWorld(e),"attached"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode&&this.bindMatrixInverse.copy(this.bindMatrix).invert()}bind(e,t){this.skeleton=e,this.isSkinnedMesh=!0,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(e){let t=new RA,i=this.geometry.attributes.skinWeight;for(let n=0,r=i.count;n<r;n++){t.fromBufferAttribute(i,n);let e=1/t.manhattanLength();e!==1/0?t.multiplyScalar(e):t.set(1,0,0,0),i.setXYZW(n,t.x,t.y,t.z,t.w)}}boneTransform(e,t){let i=this.skeleton;if(void 0===i)return;let n=this.geometry;M0.fromBufferAttribute(n.attributes.skinIndex,e),T0.fromBufferAttribute(n.attributes.skinWeight,e),A0.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let r=0;r<4;r++){let e=T0.getComponent(r);if(0!==e){let n=M0.getComponent(r);D0.multiplyMatrices(i.bones[n].matrixWorld,i.boneInverses[n]),t.addScaledVector(P0.copy(A0).applyMatrix4(D0),e)}}return t.applyMatrix4(this.bindMatrixInverse)}};function O0(e){if(Array.isArray(e.material)){for(let t of e.material)if(0===t.getLayersOfType("outline").length)return}else if(!(e.material instanceof t0)||0===e.material.getLayersOfType("outline").length)return;e instanceof k0&&e.is2DAndNoDepth?function(e){if(e.geometry.attributes.extrudeNormals||!e.geometry.attributes.position)return;let t=e.geometry.attributes.position.array,i=new Float32Array(t.length),n=new FA;for(let r=0;r<t.length;r+=3)n.set(t[r],t[r+1],t[r+2]).normalize(),i[r]=n.x,i[r+1]=n.y,i[r+2]=n.z;e.geometry.setAttribute("extrudeNormal",new sT(i,3))}(e):function(e){if(e.geometry.attributes.extrudeNormal||!e.geometry.attributes.position||!e.geometry.attributes.normal)return;let t=new Map,i=e.geometry.attributes,n=i.position.array,r=i.normal.array,a=new Float32Array(n.length);for(let l=0;l<n.length;l+=3){var s;let e="".concat(n[l],"_").concat(n[l+1],"_").concat(n[l+2]),i=new FA(r[l],r[l+1],r[l+2]);t.has(e)?null===(s=t.get(e))||void 0===s||s.normals.push(i):t.set(e,{normals:[i],result:new FA})}t.forEach(((e,t)=>{for(let i of e.normals)e.result.add(i);e.result.divideScalar(e.normals.length)}));for(let l=0;l<n.length;l+=3){var o;let e="".concat(n[l],"_").concat(n[l+1],"_").concat(n[l+2]),i=null===(o=t.get(e))||void 0===o?void 0:o.result;i&&(a[l]=i.x,a[l+1]=i.y,a[l+2]=i.z)}e.geometry.setAttribute("extrudeNormal",new sT(a,3))}(e)}function I0(e){if(!e.geometry.attributes.position)return;let t=e.geometry.attributes.position.array,i=new Float32Array(t.length),n=parseInt(e.uuid.replace(/\D/g,"")),r=[cA.seededRandom(n),cA.seededRandom(n+1e4),cA.seededRandom(n+2e4)];for(let a=0;a<t.length;a++)i[a]=r[a%3];e.geometry.setAttribute("randomColor",new nT(i,3))}var R0=new UA,L0=new FA;function B0(e){let t=!1;return e.scene.objects.traverse(((e,i)=>{"Mesh"===i.type&&"SubdivGeometry"===i.geometry.type&&(t=!0)})),t}var z0=class extends k0{constructor(e,t,i){super(e,t,i),this.data=t,this.hiddenMatrixOld=new mM,this.smoothShading=!0,this.skipReactionUpdate=!1}chooseGeoemtryCache(e){return this.dataPatched.flatShading?e.geometryCache:e.geometryCache2}get subdivPointerNew(){return void 0!==this.localGeometry?this.subdivPointer:this.geometry.ensureSubdivPointer()}get originalGeometryNew(){return void 0!==this.localGeometry?this.originalGeometry:this.geometry.originalGeometry}get phongAngle(){var e;return null!==(e=this.data.geometry.phongAngle)&&void 0!==e?e:45}updateEntityBoxSize(e,t){var i;let n=this.geometry.userData.parameters;e.copy(this.originalGeometryNew.boundingSphere.center),t.set(n.width,n.height,null!==(i=n.depth)&&void 0!==i?i:0).multiplyScalar(.5)}createGeometryByControls(e){var t,i,n,r;if(!0===this.skipReactionUpdate)return;let a=null===(t=this.localGeometry)||void 0===t?void 0:t.uuid,{originalGeometry:s,subdividedGeometry:o,subdivPointer:l}=jZ.build(e,this.subdivPointer,this.smoothShading,this.hasNonUniformScale?this.shearScale:void 0);this.subdivPointer=l,void 0!==s&&(null!==(i=this.originalGeometry)&&void 0!==i&&i.dispose(),this.originalGeometry=s),void 0!==o&&(null!==(n=this.subdividedGeometry)&&void 0!==n&&n.dispose(),this.subdividedGeometry=null!==o&&void 0!==o?o:void 0),this.localGeometry=null!==(r=this.subdividedGeometry)&&void 0!==r?r:this.originalGeometry,O0(this),I0(this),this.calcBoundingBox(),a&&(this.localGeometry.uuid=a)}updateState(e,t){if(super.updateState(e,t),void 0!==e.flatShading){let i=this.material;this.material=Array.isArray(i)?i.map((e=>e.getFlavor(!1,e.side,e.wireframe))):i.getFlavor(!1,i.side,i.wireframe),this.smoothShading=!e.flatShading,this.createGeometryDelayed(t)}}updateMesh(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];jZ.buildLevel(this.subdivPointer,!0,this.smoothShading?this.phongAngle:-1,this.originalGeometry,e&&this.hasNonUniformScale?this.shearScaleInv:void 0),this.subdividedGeometry&&jZ.buildLevel(this.subdivPointer,!1,this.smoothShading?this.phongAngle:-1,this.subdividedGeometry,e&&this.hasNonUniformScale?this.shearScaleInv:void 0)}updateTopology(){var e;this.originalGeometry.dispose(),this.originalGeometry=jZ.buildLevel(this.subdivPointer,!0,this.smoothShading?this.phongAngle:-1),this.subdividedGeometry&&(this.subdividedGeometry.dispose(),this.subdividedGeometry=jZ.buildLevel(this.subdivPointer,!1,this.smoothShading?this.phongAngle:-1)),this.localGeometry=null!==(e=this.subdividedGeometry)&&void 0!==e?e:this.originalGeometry}raycast(e,t){let i=this.localGeometry;this.localGeometry=this.originalGeometryNew,vK.prototype.raycast.call(this,e,t),this.localGeometry=i}activateSVDCompensation(){!this.hasNonUniformScale||(this.matrix.copy(this.matrixWorldRigid),this.hiddenMatrixOld.copy(this.hiddenMatrix),this.hiddenMatrix.copy(this.parent.matrixWorld).invert())}deactivateSVDCompensation(){!this.hasNonUniformScale||(this.updateMatrix(),this.hasNonUniformScale=void 0,this.hiddenMatrix.copy(this.hiddenMatrixOld))}calcBoundingBox(){let e=this.originalGeometry;null===e.boundingSphere&&(e.boundingSphere=new sM,this.subdividedGeometry&&(this.subdividedGeometry.boundingSphere=e.boundingSphere));let t=e.attributes.position,i=e.boundingSphere.center;R0.setFromBufferAttribute(t),R0.getCenter(i),e.boundingSphere.radius=i.distanceTo(R0.max),isNaN(e.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this),R0.getSize(L0),this.hasNonUniformScale&&L0.divide(this.scale);let n={width:L0.x,height:L0.y,depth:L0.z};return this.geometry.userData.parameters=n,n}updateBoundingSphere(e){let t=this.originalGeometry;R0.min.set(e[0],e[2],e[4]),R0.max.set(e[1],e[3],e[5]),this.hasNonUniformScale&&(R0.min.applyMatrix4(this.shearScaleInv),R0.max.applyMatrix4(this.shearScaleInv)),null===t.boundingSphere&&(t.boundingSphere=new sM);let i=t.boundingSphere.center;R0.getCenter(i),t.boundingSphere.radius=i.distanceTo(R0.max)}freeSubdivPointer(){var e,t;this.subdivPointer&&(jZ.freeSubdivPointer(this.subdivPointer),this.subdivPointer=0),this.localGeometry=void 0,null!==(e=this.originalGeometry)&&void 0!==e&&e.dispose(),null===(t=this.subdividedGeometry)||void 0===t||t.dispose()}dispose(){super.dispose(),this.freeSubdivPointer()}updateByPatchedOpGeometry(e,t,i){super.updateByPatchedOpGeometry(e,t,i),this.localGeometry&&this.createGeometryByControls(t)}},N0={x:[1,0,0],"-x":[-1,0,0],y:[0,1,0],"-y":[0,-1,0],z:[0,0,1],"-z":[0,0,-1]},F0={polygon_center:0,edge:1,vertex:2},j0=(e,t)=>(i,n)=>t&&0!==i&&0!==e?e*n/100:0,V0=(e,t)=>{let i=Math.abs(t),n=-1*i;return(e- -1)*(i-n)/2+n};var U0=new FA,G0=new FA,H0=new FA,W0=new FA;function q0(e,t){let i=H0.fromArray(e),n=W0.fromArray(t);G0.copy(n).sub(i);let r=G0.length();return G0.normalize().multiplyScalar(.5*r),U0.copy(i).add(G0).toArray()}var X0=new KM,Y0=new FA,Q0=new FA,Z0=new FA;var K0=e=>.5*(1-Math.cos(e*Math.PI)),J0=class{constructor(){this.perlin=new Array(4096)}noise(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(null==this.perlin){this.perlin=new Array(4096);for(let e=0;e<4096;e++)this.perlin[e]=Math.random()}e<0&&(e=-e),t<0&&(t=-t),i<0&&(i=-i);let n,r,a,s,o,l=Math.floor(e),c=Math.floor(t),h=Math.floor(i),u=e-l,d=t-c,p=i-h,f=0,m=.5;for(let g=0;g<4;g++){let e=l+(c<<4)+(h<<8);n=K0(u),r=K0(d),a=this.perlin[4095&e],a+=n*(this.perlin[e+1&4095]-a),s=this.perlin[e+16&4095],s+=n*(this.perlin[e+16+1&4095]-s),a+=r*(s-a),e+=256,s=this.perlin[4095&e],s+=n*(this.perlin[e+1&4095]-s),o=this.perlin[e+16&4095],o+=n*(this.perlin[e+16+1&4095]-o),s+=r*(o-s),a+=K0(p)*(s-a),f+=a*m,m*=.5,l<<=1,u*=2,c<<=1,d*=2,h<<=1,p*=2,u>=1&&(l++,u--),d>=1&&(c++,d--),p>=1&&(h++,p--)}return f}noiseSeed(e){let t=(()=>{let e,t;return{setSeed(i){t=e=(null!==i&&void 0!==i?i:4294967296*Math.random())>>>0},getSeed:()=>e,rand:()=>(t=(1664525*t+1013904223)%4294967296,t/4294967296)}})();t.setSeed(e),this.perlin=new Array(4096);for(let i=0;i<4096;i++)this.perlin[i]=t.rand()}},$0=new FA,e1=new mM,t1=new fM;function i1(e){let t=!1;return e.scene.objects.traverse(((e,i)=>{"Mesh"===i.type&&"TextGeometry"===i.geometry.type&&(t=!0)})),t}var n1,r1,a1,s1,o1=class extends k0{constructor(e,t,i){super(e,t,i),this.data=t}get textGeometry(){return this.geometry}get charWidths(){return this.textGeometry.charWidths}get charCoords(){return this.textGeometry.charCoords}get wrappedText(){return this.textGeometry.wrappedText}get font(){return this.textGeometry.font}get initialOffsetY(){var e,t;let i=this.dataPatched;return null!==(e=null===(t=this.font)||void 0===t?void 0:t.getLineInitialOffsetY(this.lineHeight,this.wrappedText.length,i.geometry.height,this.fontScale,i.geometry.verticalAlign))&&void 0!==e?e:0}get fontScale(){let e=this.dataPatched;return this.font?e.geometry.fontSize/this.font.unitsPerEm:1}get AD(){return Math.abs(this.ascender-this.descender)}get ascender(){var e,t;return(null!==(e=null===(t=this.font)||void 0===t?void 0:t.ascender)&&void 0!==e?e:1)*this.fontScale}get descender(){var e,t;return(null!==(e=null===(t=this.font)||void 0===t?void 0:t.descender)&&void 0!==e?e:1)*this.fontScale}get lineHeight(){let e=this.dataPatched;return e.geometry.fontSize*e.geometry.lineHeight}raycast(e,t){let{matrixWorld:i}=this;if(!isNaN(e.ray.origin.x)&&0!==this.scale.x&&0!==this.scale.y&&0!==this.scale.z&&(e1.copy(i).invert(),t1.copy(e.ray).applyMatrix4(e1),t1.intersectBox(this.singleBBox,$0))){let n=$0.applyMatrix4(i),r=e.ray.origin.distanceTo(n);t.push({distance:r,point:n.clone(),object:this})}}},l1=1e-4,c1=new FA,h1=new FA;MZ.then((e=>{r1=[(n1=e).get_face_center,n1.get_edge_midpoint,n1.get_vertex_position],a1=[n1.get_face_normal,n1.get_edge_normal,n1.get_vertex_normal],s1=[n1.face_count,n1.edge_count,n1.vertex_count]}));var u1=new mM,d1=new mM,p1=new FA,f1=new FA,m1=new FA,g1=new FA,v1=new FA,y1=new FA,b1=new J0,x1=class extends(RX(jM)){constructor(e,t){super(),this.parameters=t,this.objectForSample=void 0,this._pendingMediaLoad=!1,this.object=e}resetOnMove(){this.removeFromParent(),this.parent=null}expandClones(e){if(null===this.parent)this.updateState(this.parameters,e);else for(let t of this.children)t instanceof BX&&t.expand()}invalidateTransform(e){this.matrixWorldNeedsUpdate=!0,this.traverse((t=>{t instanceof BX&&t.object===e&&(t.matrixWorldNeedsUpdate=!0)}))}onObjUpdateMatrix(){"toObject"!==this.parameters.type&&(this.matrixWorldNeedsUpdate=!0)}update(){switch(this._updateCount(),this.parameters.type){case"radial":this._updateRadial(this.parameters);break;case"linear":this._updateLinear(this.parameters);break;case"grid":this._updateGrid(this.parameters);break;case"toObject":this._updateToObject(this.parameters)}for(let e of this.children)e.updateMatrix(),e.hasNonUniformScale&&(e.updateMatrixWorld(),e.updateMatrixWorldSVD())}_updateCount(e){let t;if(t=void 0!==e?e:"grid"===this.parameters.type?Math.round(this.parameters.grid.count[0])*Math.round(this.parameters.grid.count[1])*Math.round(this.parameters.grid.count[2]):this.parameters.count,"toObject"===this.parameters.type&&!this.parameters.toObject.object&&(t=0),"toObject"===this.parameters.type&&this.objectForSample){for(let t=0,i=this.children.length;t<i;++t)this.remove(this.children[0]);let e=this.children;if(e.length===t)return;if(e.length<t)for(let i=0,n=t-e.length;i<n;++i){let e=new BX(this.object);e.expand(),this.add(e)}else for(let i=0,n=e.length-t;i<n;++i)this.remove(e[i])}else{if(this.children.length===t)return;if(this.children.length<t)for(let e=0,i=t-this.children.length;e<i;++e){let e=new BX(this.object);e.expand(),this.add(e)}else for(let e=0,i=this.children.length-t;e<i;++e)this.remove(this.children[0])}}_updateRadial(e){var t;let i,n=e.radial,r=n.start*cA.DEG2RAD,a=r-n.end*cA.DEG2RAD,s=new CM(n.rotation[0],n.rotation[1],n.rotation[2]);switch(n.axis){case"z":i=new FA(0,0,1);break;case"y":i=new FA(0,1,0);break;default:i=new FA(1,0,0)}let o=null!==(t=e.randomnessObject)&&void 0!==t?t:HG.defaultData([1,1,1]).randomnessObject,l="perlin"===o.noiseType;b1.noiseSeed(o.seed);let c=EX((0,vX.default)(o.seed)),h=j0(o.strength,this.parameters.randomness);for(let[u,d]of this.children.entries()){let t=u*(o.freqScale/10)+o.movement,p=l?b1.noise(t):c(t,t),f=u+1;d.scale.x=n.scale[0]+h(f,V0(p,o.scale[0]))||l1,d.scale.y=n.scale[1]+h(f,V0(p,o.scale[1]))||l1,d.scale.z=n.scale[2]+h(f,V0(p,o.scale[2]))||l1,d.position.setScalar(0);let m=a/e.count*u-r;switch(n.axis){case"x":d.rotation.set(0,m,0);break;case"y":d.rotation.set(0,0,m);break;case"z":d.rotation.set(m,0,0)}d.translateOnAxis(i,n.radius),d.position.x+=n.position[0]+h(f,V0(p,o.position[0])),d.position.y+=n.position[1]+h(f,V0(p,o.position[1])),d.position.z+=n.position[2]+h(f,V0(p,o.position[2]));let g=h(f,V0(p,o.rotation[0])),v=h(f,V0(p,o.rotation[1])),y=h(f,V0(p,o.rotation[2]));!0===n.alignment?(d.rotation.x+=s.x+g,d.rotation.y+=s.y+v,d.rotation.z+=s.z+y):d.rotation.set(s.x+g,s.y+v,s.z+y)}}_updateLinear(e){var t;if("linear"!==e.type)throw new Error;let i=e.linear,n=new CM(i.rotation[0],i.rotation[1],i.rotation[2]),r=null!==(t=e.randomnessObject)&&void 0!==t?t:HG.defaultData([1,1,1]).randomnessObject,a="perlin"===r.noiseType;b1.noiseSeed(r.seed);let s=EX((0,vX.default)(r.seed)),o=j0(r.strength,this.parameters.randomness);for(let[l,c]of this.children.entries()){let e=l*(r.freqScale/10)+r.movement,t=a?b1.noise(e):s(e,e),h=l+1,u=o(h,V0(t,r.rotation[0])),d=o(h,V0(t,r.rotation[1])),p=o(h,V0(t,r.rotation[2]));c.scale.x=1+(i.scale[0]-1)*l+o(h,V0(t,r.scale[0]))||l1,c.scale.y=1+(i.scale[1]-1)*l+o(h,V0(t,r.scale[1]))||l1,c.scale.z=1+(i.scale[2]-1)*l+o(h,V0(t,r.scale[2]))||l1,c.rotation.x=n.x*l+u,c.rotation.y=n.y*l+d,c.rotation.z=n.z*l+p,c.position.x=i.position[0]*l+o(h,V0(t,r.position[0])),c.position.y=i.position[1]*l+o(h,V0(t,r.position[1])),c.position.z=i.position[2]*l+o(h,V0(t,r.position[2]))}}_updateGrid(e){var t;let i=0,n=e.grid,r=null!==(t=e.randomnessObject)&&void 0!==t?t:HG.defaultData([1,1,1]).randomnessObject,a=j0(r.strength,this.parameters.randomness),s="perlin"===r.noiseType;b1.noiseSeed(r.seed);let o=function(){let e=CX(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Math.random),t=new Float64Array(e).map((e=>SX[e%12*3])),i=new Float64Array(e).map((e=>SX[e%12*3+1])),n=new Float64Array(e).map((e=>SX[e%12*3+2]));return function(r,a,s){let o,l,c,h,u,d,p,f,m,g,v=.3333333333333333*(r+a+s),y=wX(r+v),b=wX(a+v),x=wX(s+v),w=(y+b+x)*xX,_=r-(y-w),S=a-(b-w),E=s-(x-w);_>=S?S>=E?(u=1,d=0,p=0,f=1,m=1,g=0):_>=E?(u=1,d=0,p=0,f=1,m=0,g=1):(u=0,d=0,p=1,f=1,m=0,g=1):S<E?(u=0,d=0,p=1,f=0,m=1,g=1):_<E?(u=0,d=1,p=0,f=0,m=1,g=1):(u=0,d=1,p=0,f=1,m=1,g=0);let C=_-u+xX,A=S-d+xX,M=E-p+xX,T=_-f+2*xX,P=S-m+2*xX,D=E-g+2*xX,k=_-1+.5,O=S-1+.5,I=E-1+.5,R=255&y,L=255&b,B=255&x,z=.6-_*_-S*S-E*E;if(z<0)o=0;else{let r=R+e[L+e[B]];z*=z,o=z*z*(t[r]*_+i[r]*S+n[r]*E)}let N=.6-C*C-A*A-M*M;if(N<0)l=0;else{let r=R+u+e[L+d+e[B+p]];N*=N,l=N*N*(t[r]*C+i[r]*A+n[r]*M)}let F=.6-T*T-P*P-D*D;if(F<0)c=0;else{let r=R+f+e[L+m+e[B+g]];F*=F,c=F*F*(t[r]*T+i[r]*P+n[r]*D)}let j=.6-k*k-O*O-I*I;if(j<0)h=0;else{let r=R+1+e[L+1+e[B+1]];j*=j,h=j*j*(t[r]*k+i[r]*O+n[r]*I)}return 32*(o+l+c+h)}}((0,vX.default)(r.seed));if(!0===n.useCenter){let e={x:n.count[0]%2===0?2:1,y:n.count[1]%2===0?2:1,z:n.count[2]%2===0?2:1},t=new FA(n.size[0]*(n.count[0]-e.x)*.5,n.size[1]*(n.count[1]-e.y)*.5,n.size[2]*(n.count[2]-e.z)*.5);for(let l=0;l<n.count[0];l++)for(let e=0;e<n.count[1];e++)for(let c=0;c<n.count[2];c++){let h=[(l+1)*(r.freqScale/10)+r.movement,(e+1)*(r.freqScale/10)+r.movement,(c+1)*(r.freqScale/10)+r.movement],u=s?b1.noise(...h):o(...h),d=this.children[i++];d.scale.x=1+a(i,V0(u,r.scale[0]))||l1,d.scale.y=1+a(i,V0(u,r.scale[1]))||l1,d.scale.z=1+a(i,V0(u,r.scale[2]))||l1;let p=a(i,V0(u,r.rotation[0])),f=a(i,V0(u,r.rotation[1])),m=a(i,V0(u,r.rotation[2]));d.rotation.set(p,f,m),d.position.x=n.size[0]*l-t.x+a(i,V0(u,r.position[0])),d.position.y=n.size[1]*e-t.y+a(i,V0(u,r.position[1])),d.position.z=n.size[2]*c-t.z+a(i,V0(u,r.position[2]))}}else for(let l=0;l<n.count[0];l++)for(let e=0;e<n.count[1];e++)for(let t=0;t<n.count[2];t++){let c=[(l+1)*(r.freqScale/10)+r.movement,(e+1)*(r.freqScale/10)+r.movement,(t+1)*(r.freqScale/10)+r.movement],h=s?b1.noise(...c):o(...c),u=this.children[i++];u.scale.x=1+a(i,V0(h,r.scale[0]))||l1,u.scale.y=1+a(i,V0(h,r.scale[1]))||l1,u.scale.z=1+a(i,V0(h,r.scale[2]))||l1;let d=a(i,V0(h,r.rotation[0])),p=a(i,V0(h,r.rotation[1])),f=a(i,V0(h,r.rotation[2]));u.rotation.set(d,p,f),u.position.x=n.size[0]*l+a(i,V0(h,r.position[0])),u.position.y=-n.size[1]*e+a(i,V0(h,r.position[1])),u.position.z=-n.size[2]*t+a(i,V0(h,r.position[2]))}}_updateToObject(e){var t,i;if("toObject"!==e.type)throw new Error;let{toObject:n}=e,r=new CM(n.rotation[0],n.rotation[1],n.rotation[2]),a=null!==(t=e.randomnessObject)&&void 0!==t?t:HG.defaultData([1,1,1]).randomnessObject,s="perlin"===a.noiseType;b1.noiseSeed(a.seed);let o=EX((0,vX.default)(a.seed)),l=j0(a.strength,this.parameters.randomness);if(!n.object){for(let[,e]of this.children.entries())e.position.set(0,0,0),e.scale.setScalar(1),e.rotation.set(0,0,0);return void(this.objectForSample=void 0)}if(!this.objectForSample)return;if(this.objectForSample instanceof o1){if(null===(i=this.objectForSample.font)||void 0===i||!i.isLoaded||void 0===this.objectForSample.geometry.attributes.position)return void(this._pendingMediaLoad=!0);this._pendingMediaLoad=!1}if(void 0===this.objectForSample.geometry&&this.objectForSample.isAncestorOf(this.object.uuid))return void console.warn('Oh no! The object "'.concat(this.object.name,'" (').concat(this.object.uuid,") seem to be a child/descendant of the object it's being cloned to. Please re-parent it so that they are siblings instead."));let c=this.getSubdivData(),h=[],u=e=>{let t=e.length,i=e.map((e=>e[0])).reduce(((e,t)=>e+t),0),n=e.map((e=>e[1])).reduce(((e,t)=>e+t),0),r=e.map((e=>e[2])).reduce(((e,t)=>e+t),0);return[i/t,n/t,r/t]},d=e=>Math.round(1e6*e)/1e6;c.forEach((e=>{let t=c.filter((t=>d(e.pos[0])===d(t.pos[0])&&d(e.pos[1])===d(t.pos[1])&&d(e.pos[2])===d(t.pos[2])));t.length>1?h.push({pos:e.pos,norm:u(t.map((e=>e.norm)))}):h.push(e)}));let p=function(e){let t=[],i={};for(var n=0,r=e.length;n<r;n++){var a=JSON.stringify(e[n].pos.map((e=>Math.round(1e4*e)/1e4)));i[a]||(t.push(e[n]),i[a]=!0)}return t}(h);if(p.length>0){let e=Math.round(p.length*n.count/100);this._updateCount(e)}else{let e=this.objectForSample.geometry.getAttribute("position");if(!e||isNaN(e.count)||0===e.count)return void console.warn('Oh no! The object "'.concat(this.object.name,'" (').concat(this.object.uuid,') cannot be cloned on the surface of "').concat(this.objectForSample.name,'" (').concat(this.objectForSample.uuid,") because the latter does not have a valid geometry."))}this.objectForSample.updateMatrixWorld();let f=new TX(this.objectForSample).build(),m=N0[n.axis],g=this.children;f.setRandomGenerator((0,vX.default)(this.object.uuid+n.seed));for(let[v,y]of g.entries()){let e=v*(a.freqScale/10)+a.movement,t=s?b1.noise(e):o(e,e),i=v+1,c=l(i,V0(t,a.rotation[0])),h=l(i,V0(t,a.rotation[1])),u=l(i,V0(t,a.rotation[2]));"random"===n.spreadType?f.sample(m1,g1):(p.length&&(m1.fromArray(p[v].pos),g1.fromArray(p[v].norm)),this.objectForSample instanceof z0&&m1.applyMatrix4(u1.copy(this.objectForSample.matrixWorld).invert())),m1.applyMatrix4(this.object.hiddenMatrix.clone().invert()),y.position.copy(m1),p1.fromArray(m);let d="normal"===n.align?g1:this.object.getWorldDirection(y1),g=f1.fromArray(n.position);f1.x+=l(i,V0(t,a.position[0])),f1.y+=l(i,V0(t,a.position[1])),f1.z+=l(i,V0(t,a.position[2]));let b=Math.acos(d.dot(p1)),x=v1.crossVectors(p1,d).normalize(),w=d1.makeRotationAxis(x,b),_=d.clone().cross(this.object.up).normalize(),S=_.clone().cross(d).normalize(),E=(new mM).makeBasis(_,d,S),C=new FA(p1.y,p1.z,p1.x).normalize(),A=C.clone().cross(p1).normalize(),M=(new mM).makeBasis(C,p1,A).invert(),T=(new mM).multiplyMatrices(E,M);y.rotation.setFromRotationMatrix(T),g.applyMatrix4(w),y.position.add(g),y.rotation.x=y.rotation.x+r.x+c,y.rotation.y=y.rotation.y+r.y+h,y.rotation.z=y.rotation.z+r.z+u,y.scale.setScalar(1),y.scale.x=y.scale.x+n.scale[0]+l(i,V0(t,a.scale[0]))||l1,y.scale.y=y.scale.y+n.scale[1]+l(i,V0(t,a.scale[1]))||l1,y.scale.z=y.scale.z+n.scale[2]+l(i,V0(t,a.scale[2]))||l1,y.scale.multiply(this.object.scale),y.hiddenMatrix=this.object.hiddenMatrix}}getSubdivData(){if(!this.objectForSample)return[];let e=this.parameters.toObject.spreadType;if("random"===e)return[];if(this.objectForSample instanceof z0){let t=this.objectForSample,i=F0[e],n=s1[i],r=r1[i],a=a1[i],s=[],o=n(t.subdivPointerNew);for(let e=0;e<=o-1;e++){let i=r(t.subdivPointerNew,e),n=a(t.subdivPointerNew,e);c1.fromArray(i).applyMatrix4(t.matrixWorld),h1.fromArray(n),s.push({pos:c1.toArray(),norm:h1.toArray()})}return s}return(this.objectForSample.geometry.index?function(e){let t=[];for(let i=0;i<=e.index.count;i++)if(Y0.fromArray(e.index.array,3*i),X0.setFromAttributeAndIndices(e.attributes.position,Y0.x,Y0.y,Y0.z),X0.getNormal(Q0),X0.getMidpoint(Z0),!(isNaN(Z0.x)||isNaN(Z0.y)||isNaN(Z0.z))){let{a:e,b:i,c:n}=X0,r=e.toArray(),a=i.toArray(),s=n.toArray(),o=e.distanceTo(i),l=i.distanceTo(n),c=n.distanceTo(e),h=q0(r,a),u=q0(a,s),d=q0(s,r),p=[o,l,c],f=Math.max(...p),m=p.filter((e=>Math.round(e)===Math.round(f))).length>1,g=[],v=X0.getMidpoint(Z0).toArray();f===o&&!m&&(g=[u,d,d],v=h),f===l&&!m&&(g=[h,d,d],v=u),f===c&&!m&&(g=[h,u,u],v=d),m&&(g=[h,u,d]),t.push({vertices:[r,a,s],faceCenters:g,midpoint:v,norm:X0.getNormal(Q0).toArray()})}return t}(this.objectForSample.geometry):function(e){let t=[],{position:i}=e.attributes;for(let n=0;n<i.count;n++){X0.setFromAttributeAndIndices(i,3*n,3*n+1,3*n+2),X0.getNormal(Q0),X0.getMidpoint(Z0);let e=X0.a.toArray(),r=X0.b.toArray(),a=X0.c.toArray();t.push({vertices:[e,r,a],faceCenters:[q0(e,r),q0(r,a),q0(a,e)],midpoint:Z0.toArray(),norm:Q0.toArray()})}return t}(this.objectForSample.geometry)).map(((t,i)=>"polygon_center"===e?{pos:t.midpoint,norm:t.norm}:"vertex"===e?[{pos:t.vertices[0],norm:t.norm},{pos:t.vertices[1],norm:t.norm},{pos:t.vertices[2],norm:t.norm}]:"edge"===e?[{pos:t.faceCenters[0],norm:t.norm},{pos:t.faceCenters[1],norm:t.norm},{pos:t.faceCenters[2],norm:t.norm}]:[])).flat()}updateState(e,t){var i;if(this.parameters=BF(e),"toObject"!==this.parameters.type)(null===this.parent||this.parent!==this.object)&&(this.removeFromParent(),null!==(i=this.object.parent)&&void 0!==i&&i.add(this),this.matrix=this.object.matrix,this.hiddenMatrix=this.object.hiddenMatrix,this.matrixWorldNeedsUpdate=!0,this.matrixAutoUpdate=!1);else if(null===this.parent||this.parent.uuid!==this.parameters.toObject.object){this.removeFromParent();let e=t.find(this.parameters.toObject.object);this.objectForSample=e instanceof vK?e:void 0,this.matrix=new mM,this.hiddenMatrix=new mM,this.matrixWorldNeedsUpdate=!0,this.matrixAutoUpdate=!1,e&&e.add(this)}this.update()}get pendingMediaLoad(){return this._pendingMediaLoad}},w1=e=>{var t;return(t=class extends e{}).geometryHelper=new DT(30,30,30),t},_1=new fM,S1=new sM,E1=new mM,C1=function(e,t,i,n){let r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=t,s=e.matrixWorld;if(null===a.boundingSphere&&a.computeBoundingSphere(),S1.copy(a.boundingSphere),S1.applyMatrix4(s),!1===i.ray.intersectsSphere(S1)||(E1.copy(s).invert(),_1.copy(i.ray).applyMatrix4(E1),null!==a.boundingBox&&!1===_1.intersectsBox(a.boundingBox)))return;let o,l,c,h,u,d,p=a.index,f=a.attributes.position,m=a.drawRange;if(!1===r){for(u=Math.max(0,m.start),d=Math.min(p.count,m.start+m.count);u<d;u+=3)if(l=p.getX(u),c=p.getX(u+1),h=p.getX(u+2),o=g(e,i,_1,f,l,c,h),o)return o.faceIndex=Math.floor(u/3),void n.push(o)}else{let t=a.attributes.position,r=new FA,s=new FA,o=new FA,l=new FA,c=2,h=1/((e.scale.x+e.scale.y+e.scale.z)/3),u=h*h;for(let a=Math.max(0,m.start),d=Math.min(t.count,m.start+m.count)-1;a<d;a+=c){if(r.fromBufferAttribute(t,a),s.fromBufferAttribute(t,a+1),_1.distanceSqToSegment(r,s,l,o)>u)continue;l.applyMatrix4(e.matrixWorld);let c=i.ray.origin.distanceTo(l);c<i.near||c>i.far||n.push({distance:c,point:o.clone().applyMatrix4(e.matrixWorld),object:e})}}function g(e,t,i,n,r,a,s){let o=new FA,l=new FA,c=new FA,h=new FA,u=new FA;if(o.fromBufferAttribute(n,r),l.fromBufferAttribute(n,a),c.fromBufferAttribute(n,s),null===i.intersectTriangle(o,l,c,!1,h))return null;u.copy(h),u.applyMatrix4(e.matrixWorld);let d=t.ray.origin.distanceTo(u);return d<t.near||d>t.far?null:{faceIndex:1,distance:d,point:u.clone(),object:e}}},A1=new FA,M1=new BT,T1=class extends tO{constructor(e){let t=new fT,i=new qk({color:16777215,vertexColors:!0,toneMapped:!1}),n=[],r=[],a={},s=new MA(15711266),o=new MA(15711266),l=new MA(2857471);function c(e,t,i){h(e,i),h(t,i)}function h(e,t){n.push(0,0,0),r.push(t.r,t.g,t.b),void 0===a[e]&&(a[e]=[]),a[e].push(n.length/3-1)}c("n1","n2",s),c("n2","n4",s),c("n4","n3",s),c("n3","n1",s),c("f1","f2",s),c("f2","f4",s),c("f4","f3",s),c("f3","f1",s),c("n1","f1",s),c("n2","f2",s),c("n3","f3",s),c("n4","f4",s),c("p","n1",o),c("p","n2",o),c("p","n3",o),c("p","n4",o),c("u1","u2",l),c("u2","u3",l),c("u3","u1",l),t.setAttribute("position",new sT(n,3)),t.setAttribute("color",new sT(r,3)),super(t,i),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}update(){let e=this.geometry,t=this.pointMap;M1.projectionMatrixInverse.elements=[.5112609807824982,-0,-0,-0,-0,.41421356237309503,-0,-0,-0,-0,-0,-.099999,-0,-0,-1.0000000000000002,.100001];let i=.8;P1("n1",t,e,M1,-1,-1,i),P1("n2",t,e,M1,1,-1,i),P1("n3",t,e,M1,-1,1,i),P1("n4",t,e,M1,1,1,i);let n=i;P1("f1",t,e,M1,-1,-1,n),P1("f2",t,e,M1,1,-1,n),P1("f3",t,e,M1,-1,1,n),P1("f4",t,e,M1,1,1,n);P1("u1",t,e,M1,.35,1.1,.8),P1("u2",t,e,M1,-.35,1.1,.8),P1("u3",t,e,M1,0,1.55,.8),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}};function P1(e,t,i,n,r,a,s){A1.set(r,a,s).unproject(n);let o=t[e];if(void 0!==o){let e=i.getAttribute("position");for(let t=0,i=o.length;t<i;t++)e.setXYZ(o[t],A1.x,A1.y,A1.z)}}var D1,k1=class extends(w1(T1)){constructor(e){super(e),this.object=e,this.object=e,this.name="CombinedCameraHelper: ".concat(e.uuid)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.updateTarget()}updateTarget(){let e=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(e)}raycast(e,t){C1(this.object,this.geometry,e,t,!0)}};(e=>{e.is=e=>"objectHelper"in e})(D1||(D1={}));var O1=(e,t)=>class extends(iY(e)){constructor(){super(...arguments),this.objectHelper=new t(this),this.gizmos={}}get geometryHelper(){return t.geometryHelper}raycast(e,t){this.objectHelper.raycast(e,t)}showGizmos(){for(let e in this.gizmos){let t=this.gizmos[e];t instanceof zR&&(t.visible=!0)}}updateEntityBoxSize(e,t){this.objectHelper.visible&&this.geometryHelper instanceof DT?(e.setScalar(0),t.set(this.geometryHelper.parameters.width,this.geometryHelper.parameters.height,this.geometryHelper.parameters.height).multiplyScalar(.5)):super.updateEntityBoxSize(e,t)}hideGizmos(){for(let e in this.gizmos){let t=this.gizmos[e];t instanceof zR&&(t.visible=!1)}}},I1=new FA,R1=new FA,L1=new NA,B1=new FA,z1=new FA,N1=new FA,F1=class extends(O1(BT,k1)){constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{...GH.defaultData,name:""};super(),this._cameraType="OrthographicCamera",this.targetOffset=GG.DefaultTargetOffset,this.isUpVectorFlipped=!1,this.angleOffsetFromUp=0,this.wasMovedByUser=!1,this.wasMovedBySwitchCameraAction=!1,this.super_Entity(e,t),this.previousProjectionMatrix=new mM,this.matrixAutoUpdate=!0,this.width=window.innerWidth,this.height=window.innerHeight;let i=this.width,n=this.height;this.orthoCamera=new lP(-.5*i,.5*i,.5*n,-.5*n,-5e4,1e4),this.perspCamera=new zT(45,i/n,50,1e4),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.objectHelper.update()}get isPerspectiveCamera(){return"PerspectiveCamera"===this.cameraType}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}set fov(e){this.perspCamera.fov=e}get fov(){return this.perspCamera.fov}setNear(e,t){"PerspectiveCamera"===e?this.perspCamera.near=t:this.orthoCamera.near=t}setZoom(e,t){t>=0&&("PerspectiveCamera"===e?this.perspCamera.zoom=t:this.orthoCamera.zoom=t)}set cameraType(e){"PerspectiveCamera"===e?this.toPerspective():"OrthographicCamera"===e&&this.toOrthographic()}get near(){return"PerspectiveCamera"===this._cameraType?this.perspCamera.near:this.orthoCamera.near}set near(e){"PerspectiveCamera"===this._cameraType?this.perspCamera.near=e:this.orthoCamera.near=e}get zoom(){return"PerspectiveCamera"===this._cameraType?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(e){e>=0&&("PerspectiveCamera"===this._cameraType?this.perspCamera.zoom=e:this.orthoCamera.zoom=e)}lookAt(e,t,i){"number"==typeof e&&(e=new FA(e,t,i)),super.lookAt(e),this.getWorldPosition(I1),this.targetOffset=I1.distanceTo(e)}getTarget(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new FA;return this.getWorldDirection(R1),this.getWorldPosition(I1),R1.multiplyScalar(this.targetOffset),e.copy(I1).add(R1),e}getDistanceToTarget(){let e=this.getTarget();return this.getWorldPosition(I1),I1.distanceTo(e)}updateUp(){this.getWorldQuaternion(L1),B1.set(0,0,1).applyQuaternion(L1),z1.copy(jM.DEFAULT_UP),this.isUpVectorFlipped&&z1.negate(),z1.applyQuaternion(L1),N1.copy(jM.DEFAULT_UP).projectOnPlane(B1),this.angleOffsetFromUp=N1.angleTo(z1),this.angleOffsetFromUp*=N1.cross(z1).dot(B1)>=0?1:-1}updateTransformState(e,t){let i=super.updateTransformState(e,t);return void 0!==e.isUpVectorFlipped&&(this.isUpVectorFlipped=e.isUpVectorFlipped),this.updateUp(),i}getViewFrontToObject(e){let t=e.getWorldPosition(new FA),i=e.getWorldDirection(new FA).multiplyScalar(this.targetOffset);return{position:t.clone().add(i),target:t}}getViewToTarget(e){let t=this.getWorldDirection(new FA).multiplyScalar(this.targetOffset);return{position:e.clone().sub(t),target:e}}getViewToObject(e){let t=new FA;e.getWorldPosition(t);return this.getViewToTarget(t)}setViewplaneSize(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.aspect=e/t,i){let i=e>t?this.aspect:1,n=e>t?1:this.aspect;this.left=-395*i,this.right=395*i,this.top=1/n*395,this.bottom=1/n*-395}else this.left=.5*-e,this.right=.5*e,this.top=.5*t,this.bottom=.5*-t;this.updateProjectionMatrix()}copyViewPlaneSize(e){this.aspect=e.aspect,this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.updateProjectionMatrix()}toOrthographic(){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",this.objectHelper&&this.objectHelper.update()}toPerspective(){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",this.objectHelper&&this.objectHelper.update()}setFocalLength(e){this.perspCamera.setFocalLength(e),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(e,t,i,n,r,a){"PerspectiveCamera"===this._cameraType?this.perspCamera.setViewOffset(e,t,i,n,r,a):this.orthoCamera.setViewOffset(e,t,i,n,r,a)}clearViewOffset(){"PerspectiveCamera"===this._cameraType?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}copyHistory(){this.previousProjectionMatrix&&this.previousProjectionMatrix.copy(this.projectionMatrix)}updateProjectionMatrix(){"PerspectiveCamera"===this._cameraType?this.toPerspective():"OrthographicCamera"===this._cameraType&&this.toOrthographic()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(e,t){return super.copy(e,t),this.parent=e.parent,this.orthoCamera.copy(e.orthoCamera),this.perspCamera.copy(e.perspCamera),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.far=e.far,this.view=null===e.view?null:Object.assign({},e.view),this._cameraType=e._cameraType,this.aspect=e.aspect,this.fov=e.fov,this.focus=e.focus,this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this.targetOffset=e.targetOffset,this.updateProjectionMatrix(),this}toCameraState(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t={type:this.cameraType,far:this.far,orthographic:{near:this.orthoCamera.near,zoom:this.orthoCamera.zoom},perspective:{near:this.perspCamera.near,fov:this.perspCamera.fov,zoom:this.perspCamera.zoom},up:this.up.toArray(),targetOffset:this.targetOffset,isUpVectorFlipped:this.isUpVectorFlipped};return gj(t,e)}updateCameraSubtype(e,t){let i="perspective"===e?"PerspectiveCamera":"OrthographicCamera";void 0!==t.zoom&&this.setZoom(i,t.zoom),void 0!==t.near&&this.setNear(i,t.near),void 0!==t.fov&&"PerspectiveCamera"===i&&(this.fov=t.fov)}updateState(e,t){this.updateCameraState(e,t)}updateCameraState(e,t){this.updateState_Entity(e,t),void 0!==e.far&&(this.far=e.far),void 0!==e.orthographic&&this.updateCameraSubtype("orthographic",e.orthographic),void 0!==e.perspective&&this.updateCameraSubtype("perspective",e.perspective),void 0!==e.type&&(this.cameraType=e.type),void 0!==e.up&&this.up.fromArray(e.up),void 0!==e.targetOffset&&(this.targetOffset=e.targetOffset),void 0!==e.isUpVectorFlipped&&(this.isUpVectorFlipped=e.isUpVectorFlipped),this.updateProjectionMatrix()}updateByPatchedOp(e,t,i){super.updateByPatchedOp(e,t,i),1===e.path.length&&0===e.type&&this.updateCameraSubtype(e.path[0],e.props)}toState(e){return{...super.toState(e),...this.toCameraState(e),type:this.cameraType}}},j1=new mM,V1=new mM;function U1(e){let t=!1;return e.scene.objects.traverse(((e,i)=>{var n;"BooleanGeometry"===(null===(n=i.geometry)||void 0===n?void 0:n.type)&&(t=!0)})),t}var G1,H1=class extends C0{constructor(e,t,i){super(e,t),this.data=t,this.meshSetAddresses=[],this.needsTransformForDownstream=!1,this.geometry=new fT,this.onAfterRender=(e,t,i,n,r,a)=>{super.onAfterRender(e,t,i,n,r,a),this.recomputeBoolean()},this.geometry.userData.parameters={width:0,height:0,depth:0}}get booleanOp(){return this.data.geometry.operation}get phongAngle(){var e;return null!==(e=this.data.geometry.phongAngle)&&void 0!==e?e:45}get isLOD(){return this.recomputeBoolean(),!1}updateByPatchedOp(e,t,i){super.updateByPatchedOp(e,t,i),1===e.path.length&&"geometry"===e.path[0]&&0===e.type&&void 0!==e.props.operation&&(this.freeBooleanPointer(),this.resetBBoxNeedsUpdate())}freeBooleanPointer(){super.freeBooleanPointer(),this.geometry.dispose()}recomputeBoolean(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(-1!==this.booleanMeshSetAddress&&!e)return;for(let a=0;a<this.children.length;a++){let i=this.children[a];i instanceof H1&&!0===i.dataPatched.visible&&i.recomputeBoolean(!0===e,t)}this.meshSetAddresses=[];for(let a=0;a<this.children.length;a++){var i;let r=this.children[a];if(r instanceof vK&&!0===r.dataPatched.visible&&(null===(i=r.geometry.attributes.position)||void 0===i?void 0:i.count)>0&&r.geometry.drawRange.count>0&&0!==r.booleanMeshSetAddress){j1.multiplyMatrices(r.hiddenMatrix,r.matrix);try{if(-1===r.booleanMeshSetAddress){var n;if((null!==(n=r.geometry.index)&&void 0!==n?n:r.geometry.getAttribute("position")).count/3<15e5&&(r.booleanMeshSetAddress=YZ.getMeshSet(r.geometry,!0===e,t)),-1===r.booleanMeshSetAddress)return;YZ.transformMeshSet(r.booleanMeshSetAddress,j1),r.booleanMatrixInvOld.copy(j1).invert(),r.booleanWasTransformed=!1}else r instanceof H1&&!0===r.needsTransformForDownstream?(YZ.transformMeshSet(r.booleanMeshSetAddress,j1),r.needsTransformForDownstream=!1):!0===r.booleanWasTransformed&&(YZ.transformMeshSet(r.booleanMeshSetAddress,V1.multiplyMatrices(j1,r.booleanMatrixInvOld)),r.booleanMatrixInvOld.copy(j1).invert(),r.booleanWasTransformed=!1)}catch(h){console.error(h),r.booleanMeshSetAddress=0,r.geometry.userData.booleanOperationDidFail=!0;continue}!1===YZ.hasOpenEdges(r.booleanMeshSetAddress)||a===this.children.length-1&&2===this.booleanOp?(this.meshSetAddresses.push(r.booleanMeshSetAddress),r.geometry.userData.booleanOperationDidFail=!1):r.geometry.userData.booleanOperationDidFail="openEdges"}}if(0===this.meshSetAddresses.length)return this.geometry.setAttribute("position",new sT([],0)),void this.geometry.setDrawRange(0,0);if(!0===e)return YZ.calcBooleanTopological(this.meshSetAddresses,this.booleanOp);let r=this.geometry;r.dispose(),this.geometry=new fT,this.geometry.userData=r.userData,this.geometry.boundingSphere=r.boundingSphere;try{this.booleanMeshSetAddress=YZ.calcBoolean(this.meshSetAddresses,this.booleanOp,this.geometry,this.phongAngle)}catch(p){this.booleanMeshSetAddress=0,this.geometry.userData.booleanOperationDidFail=!0,console.error(p)}this.booleanMatrixInvOld.copy(this.matrix).invert(),this.needsTransformForDownstream=!0,O0(this),I0(this)}dispose(){super.dispose(),this.geometry.dispose()}};(e=>{e.is=function(e){return IX.is(e)&&e instanceof BI}})(G1||(G1={}));var W1=(e,t)=>class extends(O1(e,t)){updateState_Light(e,t){this.updateState_Entity(e,t),void 0!==e.color&&(this.color=t.shared.color(e.color)),void 0!==e.intensity&&(this.intensity=e.intensity),void 0!==e.depth&&(this.shadow.camera.far=e.depth,this.shadow.needsUpdate=!0),void 0!==e.shadows&&(this.castShadow=e.shadows)}},q1=e=>e instanceof vK,X1=e=>null!==e&&e instanceof H1,Y1=e=>D1.is(e),Q1=class extends(w1(NR)){constructor(e){super(arguments.length>1&&void 0!==arguments[1]?arguments[1]:15),this.object=e,this.object.updateMatrixWorld(),this.name="EmptyObjectHelper: ".concat(e.uuid),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.object.isBone&&(this.visible=!1)}raycast(e,t){C1(this.object,Q1.geometryHelper,e,t)}update(){}},Z1=class extends(O1(wk,Q1)){constructor(e,t){super(),this.super_Entity(e,t),this.objectHelper.update()}updateState(e,t){this.updateState_Entity(e,t),"buffer"in e&&1===Object.keys(e).length&&t.scene.reloadSplats()}},K1=class extends(O1(wk,Q1)){constructor(e,t,i){super(),this.super_Entity(e,t),this.context=i,this.objectHelper.update()}updateState(e,t){this.updateState_Entity(e,t)}},J1=0,$1=1,e2="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",t2=class extends LT{constructor(){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super({name:"BokehMaterial",defines:{PASS:arguments.length>0&&void 0!==arguments[0]&&arguments[0]?"2":"1"},uniforms:{kernel64:new gR(null),kernel16:new gR(null),inputBuffer:new gR(null),cocBuffer:new gR(null),texelSize:new gR(new hA),scale:new gR(1)},blending:OS,depthWrite:!1,depthTest:!1,fragmentShader:"#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nuniform lowp sampler2D cocBuffer;uniform vec2 texelSize;uniform float scale;\n#if PASS == 1\nuniform vec4 kernel64[32];\n#else\nuniform vec4 kernel16[8];\n#endif\nvarying vec2 vUv;void main(){\n#ifdef FOREGROUND\nvec2 CoCNearFar=texture2D(cocBuffer,vUv).rg;float CoC=CoCNearFar.r*scale;\n#else\nfloat CoC=texture2D(cocBuffer,vUv).g*scale;\n#endif\nif(CoC==0.0){gl_FragColor=texture2D(inputBuffer,vUv);}else{\n#ifdef FOREGROUND\nvec2 step=texelSize*max(CoC,CoCNearFar.g*scale);\n#else\nvec2 step=texelSize*CoC;\n#endif\n#if PASS == 1\nvec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*kernel.xy+vUv;acc+=texture2D(inputBuffer,uv);uv=step*kernel.zw+vUv;acc+=texture2D(inputBuffer,uv);}gl_FragColor=acc/64.0;\n#else\nvec4 maxValue=texture2D(inputBuffer,vUv);for(int i=0;i<8;++i){vec4 kernel=kernel16[i];vec2 uv=step*kernel.xy+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);uv=step*kernel.zw+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);}gl_FragColor=maxValue;\n#endif\n}}",vertexShader:e2}),this.toneMapped=!1,e&&(this.defines.FOREGROUND="1"),this.generateKernel()}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}set cocBuffer(e){this.uniforms.cocBuffer.value=e}setCoCBuffer(e){this.uniforms.cocBuffer.value=e}get scale(){return this.uniforms.scale.value}set scale(e){this.uniforms.scale.value=e}getScale(e){return this.uniforms.scale.value=e}setScale(e){this.uniforms.scale.value=e}generateKernel(){let e=new Float32Array(128),t=new Float32Array(32),i=0,n=0;for(let s=0;s<80;++s){let r=2.39996323*s,a=Math.sqrt(s)/Math.sqrt(80),o=a*Math.cos(r),l=a*Math.sin(r);s%5===0?(t[n++]=o,t[n++]=l):(e[i++]=o,e[i++]=l)}let r=[],a=[];for(let s=0;s<128;)r.push(new RA(e[s++],e[s++],e[s++],e[s++]));for(let s=0;s<32;)a.push(new RA(t[s++],t[s++],t[s++],t[s++]));this.uniforms.kernel64.value=r,this.uniforms.kernel16.value=a}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t)}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}};function i2(e,t,i){return e*(t-i)-t}function n2(e,t,i){return Math.min(Math.max((e+t)/(t-i),0),1)}var r2=class extends LT{constructor(e){super({name:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new gR(null),focusDistance:new gR(0),focusRange:new gR(0),cameraNear:new gR(.3),cameraFar:new gR(1e3)},blending:OS,depthWrite:!1,depthTest:!1,fragmentShader:"#include <common>\n#include <packing>\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nuniform float focusDistance;uniform float focusRange;uniform float cameraNear;uniform float cameraFar;varying vec2 vUv;float readDepth(const in vec2 uv){\n#if DEPTH_PACKING == 3201\nreturn unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nreturn texture2D(depthBuffer,uv).r;\n#endif\n}void main(){float depth=readDepth(vUv);\n#ifdef PERSPECTIVE_CAMERA\nfloat viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar);\n#else\nfloat linearDepth=depth;\n#endif\nfloat signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focusRange,abs(signedDistance));gl_FragColor.rg=magnitude*vec2(step(signedDistance,0.0),step(0.0,signedDistance));}",vertexShader:e2}),this.toneMapped=!1,this.uniforms.focalLength=this.uniforms.focusRange,this.adoptCameraSettings(e)}get near(){return this.uniforms.cameraNear.value}get far(){return this.uniforms.cameraFar.value}set depthBuffer(e){this.uniforms.depthBuffer.value=e}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:FC;this.depthBuffer=e,this.depthPacking=t}get focusDistance(){return this.uniforms.focusDistance.value}set focusDistance(e){this.uniforms.focusDistance.value=e}get worldFocusDistance(){return-i2(this.focusDistance,this.near,this.far)}set worldFocusDistance(e){this.focusDistance=n2(-e,this.near,this.far)}getFocusDistance(e){this.uniforms.focusDistance.value=e}setFocusDistance(e){this.uniforms.focusDistance.value=e}get focalLength(){return this.focusRange}set focalLength(e){this.focusRange=e}get focusRange(){return this.uniforms.focusRange.value}set focusRange(e){this.uniforms.focusRange.value=e}get worldFocusRange(){return-i2(this.focusRange,this.near,this.far)}set worldFocusRange(e){this.focusRange=n2(-e,this.near,this.far)}getFocalLength(e){return this.focusRange}setFocalLength(e){this.focusRange=e}adoptCameraSettings(e){e&&(this.uniforms.cameraNear.value=e.near,this.uniforms.cameraFar.value=e.far,e instanceof zT?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},a2=class extends LT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new hA;super({name:"KawaseBlurMaterial",uniforms:{inputBuffer:new gR(null),texelSize:new gR(new hA),halfTexelSize:new gR(new hA),kernel:new gR(0),scale:new gR(1)},blending:OS,depthWrite:!1,depthTest:!1,fragmentShader:"#include <common>\n#include <dithering_pars_fragment>\n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nvarying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25;\n#include <encodings_fragment>\n#include <dithering_fragment>\n}",vertexShader:"uniform vec2 texelSize;uniform vec2 halfTexelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize*vec2(kernel)+halfTexelSize)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}"}),this.toneMapped=!1,this.setTexelSize(e.x,e.y)}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.inputBuffer=e}get scale(){return this.uniforms.scale.value}set scale(e){this.uniforms.scale.value=e}getScale(){return this.uniforms.scale.value}setScale(e){this.uniforms.scale.value=e}getKernel(){return null}get kernel(){return this.uniforms.kernel.value}set kernel(e){this.uniforms.kernel.value=e}setKernel(e){this.kernel=e}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t),this.uniforms.halfTexelSize.value.set(e,t).multiplyScalar(.5)}setSize(e,t){let i=this.uniforms;i.texelSize.value.set(1/e,1/t),i.halfTexelSize.value.copy(i.texelSize.value).multiplyScalar(.5)}},s2=class extends LT{constructor(){super({name:"CopyMaterial",uniforms:{inputBuffer:new gR(null),opacity:new gR(1)},blending:OS,depthWrite:!1,depthTest:!1,fragmentShader:"#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nuniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel;\n#include <encodings_fragment>\n}",vertexShader:e2}),this.toneMapped=!1}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}getOpacity(e){return this.uniforms.opacity.value}setOpacity(e){this.uniforms.opacity.value=e}},o2={DEPTH:0,LUMA:1,COLOR:2},l2={DISABLED:0,DEPTH:1,CUSTOM:2},c2=class extends LT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new hA,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o2.COLOR;super({name:"EdgeDetectionMaterial",defines:{THREE_REVISION:yS.replace(/\D+/g,""),LOCAL_CONTRAST_ADAPTATION_FACTOR:"2.0",EDGE_THRESHOLD:"0.1",DEPTH_THRESHOLD:"0.01",PREDICATION_MODE:"0",PREDICATION_THRESHOLD:"0.01",PREDICATION_SCALE:"2.0",PREDICATION_STRENGTH:"1.0",DEPTH_PACKING:"0"},uniforms:{inputBuffer:new gR(null),depthBuffer:new gR(null),predicationBuffer:new gR(null),texelSize:new gR(e)},blending:OS,depthWrite:!1,depthTest:!1,fragmentShader:"varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;\n#if THREE_REVISION < 143\n#define luminance(v) linearToRelativeLuminance(v)\n#endif\n#if EDGE_DETECTION_MODE != 0\nvarying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;\n#endif\n#if EDGE_DETECTION_MODE == 1\n#include <common>\n#endif\n#if EDGE_DETECTION_MODE == 0 || PREDICATION_MODE == 1\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nfloat readDepth(const in vec2 uv){\n#if DEPTH_PACKING == 3201\nreturn unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nreturn texture2D(depthBuffer,uv).r;\n#endif\n}vec3 gatherNeighbors(){float p=readDepth(vUv);float pLeft=readDepth(vUv0);float pTop=readDepth(vUv1);return vec3(p,pLeft,pTop);}\n#elif PREDICATION_MODE == 2\nuniform sampler2D predicationBuffer;vec3 gatherNeighbors(){float p=texture2D(predicationBuffer,vUv).r;float pLeft=texture2D(predicationBuffer,vUv0).r;float pTop=texture2D(predicationBuffer,vUv1).r;return vec3(p,pLeft,pTop);}\n#endif\n#if PREDICATION_MODE != 0\nvec2 calculatePredicatedThreshold(){vec3 neighbours=gatherNeighbors();vec2 delta=abs(neighbours.xx-neighbours.yz);vec2 edges=step(PREDICATION_THRESHOLD,delta);return PREDICATION_SCALE*EDGE_THRESHOLD*(1.0-PREDICATION_STRENGTH*edges);}\n#endif\n#if EDGE_DETECTION_MODE != 0\nuniform sampler2D inputBuffer;\n#endif\nvoid main(){\n#if EDGE_DETECTION_MODE == 0\nconst vec2 threshold=vec2(DEPTH_THRESHOLD);\n#elif PREDICATION_MODE != 0\nvec2 threshold=calculatePredicatedThreshold();\n#else\nconst vec2 threshold=vec2(EDGE_THRESHOLD);\n#endif\n#if EDGE_DETECTION_MODE == 0\nvec3 neighbors=gatherNeighbors();vec2 delta=abs(neighbors.xx-vec2(neighbors.y,neighbors.z));vec2 edges=step(threshold,delta);if(dot(edges,vec2(1.0))==0.0){discard;}gl_FragColor=vec4(edges,0.0,1.0);\n#elif EDGE_DETECTION_MODE == 1\nfloat l=luminance(texture2D(inputBuffer,vUv).rgb);float lLeft=luminance(texture2D(inputBuffer,vUv0).rgb);float lTop=luminance(texture2D(inputBuffer,vUv1).rgb);vec4 delta;delta.xy=abs(l-vec2(lLeft,lTop));vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}float lRight=luminance(texture2D(inputBuffer,vUv2).rgb);float lBottom=luminance(texture2D(inputBuffer,vUv3).rgb);delta.zw=abs(l-vec2(lRight,lBottom));vec2 maxDelta=max(delta.xy,delta.zw);float lLeftLeft=luminance(texture2D(inputBuffer,vUv4).rgb);float lTopTop=luminance(texture2D(inputBuffer,vUv5).rgb);delta.zw=abs(vec2(lLeft,lTop)-vec2(lLeftLeft,lTopTop));maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges.xy*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0);\n#elif EDGE_DETECTION_MODE == 2\nvec4 delta;vec3 c=texture2D(inputBuffer,vUv).rgb;vec3 cLeft=texture2D(inputBuffer,vUv0).rgb;vec3 t=abs(c-cLeft);delta.x=max(max(t.r,t.g),t.b);vec3 cTop=texture2D(inputBuffer,vUv1).rgb;t=abs(c-cTop);delta.y=max(max(t.r,t.g),t.b);vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}vec3 cRight=texture2D(inputBuffer,vUv2).rgb;t=abs(c-cRight);delta.z=max(max(t.r,t.g),t.b);vec3 cBottom=texture2D(inputBuffer,vUv3).rgb;t=abs(c-cBottom);delta.w=max(max(t.r,t.g),t.b);vec2 maxDelta=max(delta.xy,delta.zw);vec3 cLeftLeft=texture2D(inputBuffer,vUv4).rgb;t=abs(c-cLeftLeft);delta.z=max(max(t.r,t.g),t.b);vec3 cTopTop=texture2D(inputBuffer,vUv5).rgb;t=abs(c-cTopTop);delta.w=max(max(t.r,t.g),t.b);maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0);\n#endif\n}",vertexShader:"uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;\n#if EDGE_DETECTION_MODE != 0\nvarying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;\n#endif\nvoid main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,0.0);vUv1=vUv+texelSize*vec2(0.0,-1.0);\n#if EDGE_DETECTION_MODE != 0\nvUv2=vUv+texelSize*vec2(1.0,0.0);vUv3=vUv+texelSize*vec2(0.0,1.0);vUv4=vUv+texelSize*vec2(-2.0,0.0);vUv5=vUv+texelSize*vec2(0.0,-2.0);\n#endif\ngl_Position=vec4(position.xy,1.0,1.0);}"}),this.toneMapped=!1,this.edgeDetectionMode=t}set depthBuffer(e){this.uniforms.depthBuffer.value=e}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:FC;this.depthBuffer=e,this.depthPacking=t}get edgeDetectionMode(){return Number(this.defines.EDGE_DETECTION_MODE)}set edgeDetectionMode(e){this.defines.EDGE_DETECTION_MODE=e.toFixed(0),this.needsUpdate=!0}getEdgeDetectionMode(){return this.edgeDetectionMode}setEdgeDetectionMode(e){this.edgeDetectionMode=e}get localContrastAdaptationFactor(){return Number(this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR)}set localContrastAdaptationFactor(e){this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR=e.toFixed("6"),this.needsUpdate=!0}getLocalContrastAdaptationFactor(){return this.localContrastAdaptationFactor}setLocalContrastAdaptationFactor(e){this.localContrastAdaptationFactor=e}get edgeDetectionThreshold(){return Number(this.defines.EDGE_THRESHOLD)}set edgeDetectionThreshold(e){this.defines.EDGE_THRESHOLD=e.toFixed("6"),this.defines.DEPTH_THRESHOLD=(.1*e).toFixed("6"),this.needsUpdate=!0}getEdgeDetectionThreshold(){return this.edgeDetectionThreshold}setEdgeDetectionThreshold(e){this.edgeDetectionThreshold=e}get predicationMode(){return Number(this.defines.PREDICATION_MODE)}set predicationMode(e){this.defines.PREDICATION_MODE=e.toFixed(0),this.needsUpdate=!0}getPredicationMode(){return this.predicationMode}setPredicationMode(e){this.predicationMode=e}set predicationBuffer(e){this.uniforms.predicationBuffer.value=e}setPredicationBuffer(e){this.uniforms.predicationBuffer.value=e}get predicationThreshold(){return Number(this.defines.PREDICATION_THRESHOLD)}set predicationThreshold(e){this.defines.PREDICATION_THRESHOLD=e.toFixed("6"),this.needsUpdate=!0}getPredicationThreshold(){return this.predicationThreshold}setPredicationThreshold(e){this.predicationThreshold=e}get predicationScale(){return Number(this.defines.PREDICATION_SCALE)}set predicationScale(e){this.defines.PREDICATION_SCALE=e.toFixed("6"),this.needsUpdate=!0}getPredicationScale(){return this.predicationScale}setPredicationScale(e){this.predicationScale=e}get predicationStrength(){return Number(this.defines.PREDICATION_STRENGTH)}set predicationStrength(e){this.defines.PREDICATION_STRENGTH=e.toFixed("6"),this.needsUpdate=!0}getPredicationStrength(){return this.predicationStrength}setPredicationStrength(e){this.predicationStrength=e}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}},h2={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"},u2=class extends LT{constructor(e,t,i,n){let r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];super({name:"EffectMaterial",defines:{THREE_REVISION:yS.replace(/\D+/g,""),DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new gR(null),depthBuffer:new gR(null),resolution:new gR(new hA),texelSize:new gR(new hA),cameraNear:new gR(.3),cameraFar:new gR(1e3),aspect:new gR(1),time:new gR(0)},blending:OS,depthWrite:!1,depthTest:!1,dithering:r}),this.toneMapped=!1,e&&this.setShaderParts(e),t&&this.setDefines(t),i&&this.setUniforms(i),this.adoptCameraSettings(n)}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(e){this.uniforms.depthBuffer.value=e}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:FC;this.depthBuffer=e,this.depthPacking=t}setShaderParts(e){return this.fragmentShader="#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#define packFloatToRGBA(v) packDepthToRGBA(v)\n#define unpackRGBAToFloat(v) unpackRGBAToDepth(v)\n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nuniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;\n#if THREE_REVISION < 143\n#define luminance(v) linearToRelativeLuminance(v)\n#endif\n#if THREE_REVISION >= 137\nvec4 sRGBToLinear(const in vec4 value){return vec4(mix(pow(value.rgb*0.9478672986+vec3(0.0521327014),vec3(2.4)),value.rgb*0.0773993808,vec3(lessThanEqual(value.rgb,vec3(0.04045)))),value.a);}\n#endif\nfloat readDepth(const in vec2 uv){\n#if DEPTH_PACKING == 3201\nreturn unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nreturn texture2D(depthBuffer,uv).r;\n#endif\n}float getViewZ(const in float depth){\n#ifdef PERSPECTIVE_CAMERA\nreturn perspectiveDepthToViewZ(depth,cameraNear,cameraFar);\n#else\nreturn orthographicDepthToViewZ(depth,cameraNear,cameraFar);\n#endif\n}FRAGMENT_HEADvoid main(){FRAGMENT_MAIN_UVvec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGEgl_FragColor=color0;\n#ifdef ENCODE_OUTPUT\n#include <encodings_fragment>\n#endif\n#include <dithering_fragment>\n}".replace(h2.FRAGMENT_HEAD,e.get(h2.FRAGMENT_HEAD)).replace(h2.FRAGMENT_MAIN_UV,e.get(h2.FRAGMENT_MAIN_UV)).replace(h2.FRAGMENT_MAIN_IMAGE,e.get(h2.FRAGMENT_MAIN_IMAGE)),this.vertexShader="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEADvoid main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORTgl_Position=vec4(position.xy,1.0,1.0);}".replace(h2.VERTEX_HEAD,e.get(h2.VERTEX_HEAD)).replace(h2.VERTEX_MAIN_SUPPORT,e.get(h2.VERTEX_MAIN_SUPPORT)),this.needsUpdate=!0,this}setDefines(e){for(let t of e.entries())this.defines[t[0]]=t[1];return this.needsUpdate=!0,this}setUniforms(e){for(let t of e.entries())this.uniforms[t[0]]=t[1];return this}setExtensions(e){this.extensions={};for(let t of e)this.extensions[t]=!0;return this}get encodeOutput(){return void 0!==this.defines.ENCODE_OUTPUT}set encodeOutput(e){this.encodeOutput!==e&&(e?this.defines.ENCODE_OUTPUT="1":delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(e){return this.encodeOutput}setOutputEncodingEnabled(e){this.encodeOutput=e}get time(){return this.uniforms.time.value}set time(e){this.uniforms.time.value=e}setDeltaTime(e){this.uniforms.time.value+=e}adoptCameraSettings(e){e&&(this.uniforms.cameraNear.value=e.near,this.uniforms.cameraFar.value=e.far,e instanceof zT?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(e,t){let i=this.uniforms;i.resolution.value.set(e,t),i.texelSize.value.set(1/e,1/t),i.aspect.value=e/t}static get Section(){return h2}},d2=class extends LT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super({name:"LuminanceMaterial",defines:{THREE_REVISION:yS.replace(/\D+/g,"")},uniforms:{inputBuffer:new gR(null),threshold:new gR(0),smoothing:new gR(1),range:new gR(null)},blending:OS,depthWrite:!1,depthTest:!1,fragmentShader:"#include <common>\n#if THREE_REVISION < 143\n#define luminance(v) linearToRelativeLuminance(v)\n#endif\n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\n#ifdef RANGE\nuniform vec2 range;\n#elif defined(THRESHOLD)\nuniform float threshold;uniform float smoothing;\n#endif\nvarying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=luminance(texel.rgb);\n#ifdef RANGE\nfloat low=step(range.x,l);float high=step(l,range.y);l*=low*high;\n#elif defined(THRESHOLD)\nl=smoothstep(threshold,threshold+smoothing,l);\n#endif\n#ifdef COLOR\ngl_FragColor=vec4(texel.rgb*l,l);\n#else\ngl_FragColor=vec4(l);\n#endif\n}",vertexShader:e2}),this.toneMapped=!1,this.colorOutput=e,this.luminanceRange=t}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}get threshold(){return this.uniforms.threshold.value}set threshold(e){this.smoothing>0||e>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.threshold.value=e}getThreshold(){return this.threshold}setThreshold(e){this.threshold=e}get smoothing(){return this.uniforms.smoothing.value}set smoothing(e){this.threshold>0||e>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.smoothing.value=e}getSmoothingFactor(){return this.smoothing}setSmoothingFactor(e){this.smoothing=e}get useThreshold(){return this.threshold>0||this.smoothing>0}set useThreshold(e){}get colorOutput(){return void 0!==this.defines.COLOR}set colorOutput(e){e?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}isColorOutputEnabled(e){return this.colorOutput}setColorOutputEnabled(e){this.colorOutput=e}get useRange(){return null!==this.luminanceRange}set useRange(e){this.luminanceRange=null}get luminanceRange(){return this.uniforms.range.value}set luminanceRange(e){null!==e?this.defines.RANGE="1":delete this.defines.RANGE,this.uniforms.range.value=e,this.needsUpdate=!0}getLuminanceRange(){return this.luminanceRange}setLuminanceRange(e){this.luminanceRange=e}},p2=0,f2=1,m2=class extends LT{constructor(){super({name:"MaskMaterial",uniforms:{maskTexture:new gR(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null),inputBuffer:new gR(null),strength:new gR(1)},blending:OS,depthWrite:!1,depthTest:!1,fragmentShader:"#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\n#ifdef MASK_PRECISION_HIGH\nuniform mediump sampler2D maskTexture;\n#else\nuniform lowp sampler2D maskTexture;\n#endif\n#if MASK_FUNCTION != 0\nuniform float strength;\n#endif\nvarying vec2 vUv;void main(){\n#if COLOR_CHANNEL == 0\nfloat mask=texture2D(maskTexture,vUv).r;\n#elif COLOR_CHANNEL == 1\nfloat mask=texture2D(maskTexture,vUv).g;\n#elif COLOR_CHANNEL == 2\nfloat mask=texture2D(maskTexture,vUv).b;\n#else\nfloat mask=texture2D(maskTexture,vUv).a;\n#endif\n#if MASK_FUNCTION == 0\n#ifdef INVERTED\nmask=step(mask,0.0);\n#else\nmask=1.0-step(mask,0.0);\n#endif\n#else\nmask=clamp(mask*strength,0.0,1.0);\n#ifdef INVERTED\nmask=1.0-mask;\n#endif\n#endif\n#if MASK_FUNCTION == 2\ngl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask);\n#else\ngl_FragColor=mask*texture2D(inputBuffer,vUv);\n#endif\n}",vertexShader:e2}),this.toneMapped=!1,this.setColorChannel(J1),this.setMaskFunction(p2)}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}set maskTexture(e){this.uniforms.maskTexture.value=e,delete this.defines.MASK_PRECISION_HIGH,e.type!==kE&&(this.defines.MASK_PRECISION_HIGH="1"),this.needsUpdate=!0}setMaskTexture(e){this.maskTexture=e}set colorChannel(e){this.defines.COLOR_CHANNEL=e.toFixed(0),this.needsUpdate=!0}setColorChannel(e){this.colorChannel=e}set maskFunction(e){this.defines.MASK_FUNCTION=e.toFixed(0),this.needsUpdate=!0}setMaskFunction(e){this.maskFunction=e}get inverted(){return void 0!==this.defines.INVERTED}set inverted(e){this.inverted&&!e?delete this.defines.INVERTED:e&&(this.defines.INVERTED="1"),this.needsUpdate=!0}isInverted(){return this.inverted}setInverted(e){this.inverted=e}get strength(){return this.uniforms.strength.value}set strength(e){this.uniforms.strength.value=e}getStrength(){return this.strength}setStrength(e){this.strength=e}},g2=class extends LT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new hA,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new hA;super({name:"SMAAWeightsMaterial",defines:{MAX_SEARCH_STEPS_INT:"16",MAX_SEARCH_STEPS_FLOAT:"16.0",MAX_SEARCH_STEPS_DIAG_INT:"8",MAX_SEARCH_STEPS_DIAG_FLOAT:"8.0",CORNER_ROUNDING:"25",CORNER_ROUNDING_NORM:"0.25",AREATEX_MAX_DISTANCE:"16.0",AREATEX_MAX_DISTANCE_DIAG:"20.0",AREATEX_PIXEL_SIZE:"(1.0 / vec2(160.0, 560.0))",AREATEX_SUBTEX_SIZE:"(1.0 / 7.0)",SEARCHTEX_SIZE:"vec2(66.0, 33.0)",SEARCHTEX_PACKED_SIZE:"vec2(64.0, 16.0)"},uniforms:{inputBuffer:new gR(null),searchTexture:new gR(null),areaTexture:new gR(null),resolution:new gR(t),texelSize:new gR(e)},blending:OS,depthWrite:!1,depthTest:!1,fragmentShader:"#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize)\n#if __VERSION__ < 300\n#define round(v) floor(v + 0.5)\n#endif\n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nuniform lowp sampler2D areaTexture;uniform lowp sampler2D searchTexture;uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}vec2 decodeDiagBilinearAccess(in vec2 e){e.r=e.r*abs(5.0*e.r-5.0*0.75);return round(e);}vec4 decodeDiagBilinearAccess(in vec4 e){e.rb=e.rb*abs(5.0*e.rb-5.0*0.75);return round(e);}vec2 searchDiag1(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);vec3 t=vec3(texelSize,1.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;++i){if(!(coord.z<float(MAX_SEARCH_STEPS_DIAG_INT-1)&&coord.w>0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 searchDiag2(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);coord.x+=0.25*texelSize.x;vec3 t=vec3(texelSize,1.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;++i){if(!(coord.z<float(MAX_SEARCH_STEPS_DIAG_INT-1)&&coord.w>0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;e=decodeDiagBilinearAccess(e);coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 areaDiag(const in vec2 dist,const in vec2 e,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE_DIAG,AREATEX_MAX_DISTANCE_DIAG)*e+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.x+=0.5;texCoord.y+=AREATEX_SUBTEX_SIZE*offset;return texture2D(areaTexture,texCoord).rg;}vec2 calculateDiagWeights(const in vec2 texCoord,const in vec2 e,const in vec4 subsampleIndices){vec2 weights=vec2(0.0);vec4 d;vec2 end;if(e.r>0.0){d.xz=searchDiag1(texCoord,vec2(-1.0,1.0),end);d.x+=float(end.y>0.9);}else{d.xz=vec2(0.0);}d.yw=searchDiag1(texCoord,vec2(1.0,-1.0),end);if(d.x+d.y>2.0){vec4 coords=vec4(-d.x+0.25,d.x,d.y,-d.y-0.25)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.xy=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).rg;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).rg;c.yxwz=decodeDiagBilinearAccess(c.xyzw);vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.z);}d.xz=searchDiag2(texCoord,vec2(-1.0,-1.0),end);if(sampleLevelZeroOffset(inputBuffer,texCoord,vec2(1,0)).r>0.0){d.yw=searchDiag2(texCoord,vec2(1.0),end);d.y+=float(end.y>0.9);}else{d.yw=vec2(0.0);}if(d.x+d.y>2.0){vec4 coords=vec4(-d.x,-d.x,d.y,d.y)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.x=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).g;c.y=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(0,-1)).r;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).gr;vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.w).gr;}return weights;}float searchLength(const in vec2 e,const in float offset){vec2 scale=SEARCHTEX_SIZE*vec2(0.5,-1.0);vec2 bias=SEARCHTEX_SIZE*vec2(offset,1.0);scale+=vec2(-1.0,1.0);bias+=vec2(0.5,-0.5);scale*=1.0/SEARCHTEX_PACKED_SIZE;bias*=1.0/SEARCHTEX_PACKED_SIZE;return texture2D(searchTexture,scale*e+bias).r;}float searchXLeft(in vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;++i){if(!(texCoord.x>end&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(-2.0,0.0)*texelSize+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.0)+3.25;return texelSize.x*offset+texCoord.x;}float searchXRight(vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;++i){if(!(texCoord.x<end&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(2.0,0.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.5)+3.25;return-texelSize.x*offset+texCoord.x;}float searchYUp(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;++i){if(!(texCoord.y>end&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=-vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.0)+3.25;return texelSize.y*offset+texCoord.y;}float searchYDown(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;i++){if(!(texCoord.y<end&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.5)+3.25;return-texelSize.y*offset+texCoord.y;}vec2 area(const in vec2 dist,const in float e1,const in float e2,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE)*round(4.0*vec2(e1,e2))+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.y=AREATEX_SUBTEX_SIZE*offset+texCoord.y;return texture2D(areaTexture,texCoord).rg;}void detectHorizontalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){\n#if !defined(DISABLE_CORNER_DETECTION)\nvec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,1)).r;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).r;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,-2)).r;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,-2)).r;weights*=clamp(factor,0.0,1.0);\n#endif\n}void detectVerticalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){\n#if !defined(DISABLE_CORNER_DETECTION)\nvec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(1,0)).g;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).g;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(-2,0)).g;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(-2,1)).g;weights*=clamp(factor,0.0,1.0);\n#endif\n}void main(){vec4 weights=vec4(0.0);vec4 subsampleIndices=vec4(0.0);vec2 e=texture2D(inputBuffer,vUv).rg;if(e.g>0.0){\n#if !defined(DISABLE_DIAG_DETECTION)\nweights.rg=calculateDiagWeights(vUv,e,subsampleIndices);if(weights.r==-weights.g){\n#endif\nvec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOffset[1].y;d.x=coords.x;float e1=texture2D(inputBuffer,coords.xy).r;coords.z=searchXRight(vOffset[0].zw,vOffset[2].y);d.y=coords.z;d=round(resolution.xx*d+-vPixCoord.xx);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.zy,vec2(1,0)).r;weights.rg=area(sqrtD,e1,e2,subsampleIndices.y);coords.y=vUv.y;detectHorizontalCornerPattern(weights.rg,coords.xyzy,d);\n#if !defined(DISABLE_DIAG_DETECTION)\n}else{e.r=0.0;}\n#endif\n}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}",vertexShader:"uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}"}),this.toneMapped=!1}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}get searchTexture(){return this.uniforms.searchTexture.value}set searchTexture(e){this.uniforms.searchTexture.value=e}get areaTexture(){return this.uniforms.areaTexture.value}set areaTexture(e){this.uniforms.areaTexture.value=e}setLookupTextures(e,t){this.searchTexture=e,this.areaTexture=t}get orthogonalSearchSteps(){return Number(this.defines.MAX_SEARCH_STEPS_INT)}set orthogonalSearchSteps(e){let t=Math.min(Math.max(e,0),112);this.defines.MAX_SEARCH_STEPS_INT=t.toFixed("0"),this.defines.MAX_SEARCH_STEPS_FLOAT=t.toFixed("1"),this.needsUpdate=!0}setOrthogonalSearchSteps(e){this.orthogonalSearchSteps=e}get diagonalSearchSteps(){return Number(this.defines.MAX_SEARCH_STEPS_DIAG_INT)}set diagonalSearchSteps(e){let t=Math.min(Math.max(e,0),20);this.defines.MAX_SEARCH_STEPS_DIAG_INT=t.toFixed("0"),this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT=t.toFixed("1"),this.needsUpdate=!0}setDiagonalSearchSteps(e){this.diagonalSearchSteps=e}get diagonalDetection(){return void 0===this.defines.DISABLE_DIAG_DETECTION}set diagonalDetection(e){e?delete this.defines.DISABLE_DIAG_DETECTION:this.defines.DISABLE_DIAG_DETECTION="1",this.needsUpdate=!0}isDiagonalDetectionEnabled(){return this.diagonalDetection}setDiagonalDetectionEnabled(e){this.diagonalDetection=e}get cornerRounding(){return Number(this.defines.CORNER_ROUNDING)}set cornerRounding(e){let t=Math.min(Math.max(e,0),100);this.defines.CORNER_ROUNDING=t.toFixed("4"),this.defines.CORNER_ROUNDING_NORM=(t/100).toFixed("4"),this.needsUpdate=!0}setCornerRounding(e){this.cornerRounding=e}get cornerDetection(){return void 0===this.defines.DISABLE_CORNER_DETECTION}set cornerDetection(e){e?delete this.defines.DISABLE_CORNER_DETECTION:this.defines.DISABLE_CORNER_DETECTION="1",this.needsUpdate=!0}isCornerRoundingEnabled(){return this.cornerDetection}setCornerRoundingEnabled(e){this.cornerDetection=e}setSize(e,t){let i=this.uniforms;i.texelSize.value.set(1/e,1/t),i.resolution.value.set(e,t)}},v2=new BT,y2=null;var b2=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Pass",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Dk,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v2;this.name=e,this.renderer=null,this.scene=t,this.camera=i,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(e){if(this.rtt===e){let t=this.getFullscreenMaterial();null!==t&&(t.needsUpdate=!0),this.rtt=!e}}setRenderer(e){this.renderer=e}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}get fullscreenMaterial(){return null!==this.screen?this.screen.material:null}set fullscreenMaterial(e){let t=this.screen;null!==t?t.material=e:(t=new TT(function(){if(null===y2){let e=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),t=new Float32Array([0,0,2,0,0,2]);void 0!==(y2=new fT).setAttribute?(y2.setAttribute("position",new nT(e,3)),y2.setAttribute("uv",new nT(t,2))):(y2.addAttribute("position",new nT(e,3)),y2.addAttribute("uv",new nT(t,2)))}return y2}(),e),t.frustumCulled=!1,null===this.scene&&(this.scene=new Dk),this.scene.add(t),this.screen=t)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(e){this.fullscreenMaterial=e}getDepthTexture(){return null}setDepthTexture(e){}render(e,t,i,n,r){throw new Error("Render method not implemented!")}setSize(e,t){}initialize(e,t,i){}dispose(){for(let e of Object.keys(this)){let t=this[e];if(null!==t&&"function"==typeof t.dispose){if(t instanceof Dk||t===this.renderer)continue;this[e].dispose()}}}},x2=class extends b2{constructor(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];super("CopyPass"),this.fullscreenMaterial=new s2,this.needsSwap=!1,this.renderTarget=e,void 0===e&&(this.renderTarget=new LA(1,1,{minFilter:TE,magFilter:TE,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=t}get resize(){return this.autoResize}set resize(e){this.autoResize=e}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(e){this.autoResize=e}render(e,t,i,n,r){this.fullscreenMaterial.inputBuffer=t.texture,e.setRenderTarget(this.renderToScreen?null:this.renderTarget),e.render(this.scene,this.camera)}setSize(e,t){this.autoResize&&this.renderTarget.setSize(e,t)}initialize(e,t,i){void 0!==i&&(this.renderTarget.texture.type=i,i!==kE?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":e.outputEncoding===NC&&(this.renderTarget.texture.encoding=NC))}},w2=class extends b2{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(e,t,i,n,r){let a=e.state.buffers.stencil;a.setLocked(!1),a.setTest(!1)}},_2=new MA,S2=class extends b2{constructor(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];super("ClearPass",null,null),this.needsSwap=!1,this.color=e,this.depth=t,this.stencil=i,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(e,t,i){this.color=e,this.depth=t,this.stencil=i}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(e){this.overrideClearColor=e}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(e){this.overrideClearAlpha=e}render(e,t,i,n,r){let a=this.overrideClearColor,s=this.overrideClearAlpha,o=e.getClearAlpha(),l=null!==a,c=s>=0;l?(_2.copy(e.getClearColor(_2)),e.setClearColor(a,c?s:o)):c&&e.setClearAlpha(s),e.setRenderTarget(this.renderToScreen?null:t),e.clear(this.color,this.depth,this.stencil),l?e.setClearColor(_2,o):c&&e.setClearAlpha(o)}},E2=-1,C2=class extends QC{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:E2,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:E2,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(),this.resizable=e,this.base=new hA(1,1),this.preferred=new hA(t,i),this.target=this.preferred,this.s=n}get width(){let e,{base:t,preferred:i,scale:n}=this;return e=i.width!==E2?i.width:i.height!==E2?Math.round(i.height*(t.width/Math.max(t.height,1))):Math.round(t.width*n),e}set width(e){this.preferredWidth=e}get height(){let e,{base:t,preferred:i,scale:n}=this;return e=i.height!==E2?i.height:i.width!==E2?Math.round(i.width/Math.max(t.width/Math.max(t.height,1),1)):Math.round(t.height*n),e}set height(e){this.preferredHeight=e}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(e){this.s!==e&&(this.s=e,this.preferred.setScalar(E2),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getScale(){return this.scale}setScale(e){this.scale=e}get baseWidth(){return this.base.width}set baseWidth(e){this.base.width!==e&&(this.base.width=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getBaseWidth(){return this.base.width}setBaseWidth(e){this.base.width!==e&&(this.base.width=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}get baseHeight(){return this.base.height}set baseHeight(e){this.base.height!==e&&(this.base.height=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(e){this.baseHeight=e}setBaseSize(e,t){(this.base.width!==e||this.base.height!==t)&&(this.base.set(e,t),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}get preferredWidth(){return this.preferred.width}set preferredWidth(e){this.preferred.width!==e&&(this.preferred.width=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(e){this.preferredWidth=e}get preferredHeight(){return this.preferred.height}set preferredHeight(e){this.preferred.height!==e&&(this.preferred.height=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(e){this.preferredHeight=e}setPreferredSize(e,t){(this.preferred.width!==e||this.preferred.height!==t)&&(this.preferred.set(e,t),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}copy(e){this.base.set(e.getBaseWidth(),e.getBaseHeight()),this.preferred.set(e.getPreferredWidth(),e.getPreferredHeight()),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height)}static get AUTO_SIZE(){return E2}},A2=!1,M2=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(e),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case kS:t=this.materialsFlatShadedDoubleSide;break;case DS:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded}else switch(e.material.side){case kS:t=this.materialsDoubleSide;break;case DS:t=this.materialsBackSide;break;default:t=this.materials}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}setMaterial(e){if(this.disposeMaterials(),this.material=e,null!==e){let t=this.materials=[e.clone(),e.clone(),e.clone()];for(let i of t)i.uniforms=Object.assign({},e.uniforms),i.side=PS;t[2].skinning=!0,this.materialsBackSide=t.map((t=>{let i=t.clone();return i.uniforms=Object.assign({},e.uniforms),i.side=DS,i})),this.materialsDoubleSide=t.map((t=>{let i=t.clone();return i.uniforms=Object.assign({},e.uniforms),i.side=kS,i})),this.materialsFlatShaded=t.map((t=>{let i=t.clone();return i.uniforms=Object.assign({},e.uniforms),i.flatShading=!0,i})),this.materialsFlatShadedBackSide=t.map((t=>{let i=t.clone();return i.uniforms=Object.assign({},e.uniforms),i.flatShading=!0,i.side=DS,i})),this.materialsFlatShadedDoubleSide=t.map((t=>{let i=t.clone();return i.uniforms=Object.assign({},e.uniforms),i.flatShading=!0,i.side=kS,i}))}}render(e,t,i){let n=e.shadowMap.enabled;if(e.shadowMap.enabled=!1,A2){let n=this.originalMaterials;this.meshCount=0,t.traverse(this.replaceMaterial),e.render(t,i);for(let e of n)e[0].material=e[1];this.meshCount!==n.size&&n.clear()}else{let n=t.overrideMaterial;t.overrideMaterial=this.material,e.render(t,i),t.overrideMaterial=n}e.shadowMap.enabled=n}disposeMaterials(){if(null!==this.material){let e=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(let t of e)t.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return A2}static set workaroundEnabled(e){A2=e}},T2=class extends b2{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;super("RenderPass",e,t),this.needsSwap=!1,this.clearPass=new S2,this.overrideMaterialManager=null===i?null:new M2(i),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}get renderToScreen(){return super.renderToScreen}set renderToScreen(e){super.renderToScreen=e,this.clearPass.renderToScreen=e}get overrideMaterial(){let e=this.overrideMaterialManager;return null!==e?e.material:null}set overrideMaterial(e){let t=this.overrideMaterialManager;null!==e?null!==t?t.setMaterial(e):this.overrideMaterialManager=new M2(e):null!==t&&(t.dispose(),this.overrideMaterialManager=null)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(e){this.overrideMaterial=e}get clear(){return this.clearPass.enabled}set clear(e){this.clearPass.enabled=e}getSelection(){return this.selection}setSelection(e){this.selection=e}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(e){this.ignoreBackground=e}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(e){this.skipShadowMapUpdate=e}getClearPass(){return this.clearPass}render(e,t,i,n,r){let a=this.scene,s=this.camera,o=this.selection,l=s.layers.mask,c=a.background,h=e.shadowMap.autoUpdate,u=this.renderToScreen?null:t;null!==o&&s.layers.set(o.getLayer()),this.skipShadowMapUpdate&&(e.shadowMap.autoUpdate=!1),(this.ignoreBackground||null!==this.clearPass.overrideClearColor)&&(a.background=null),this.clearPass.enabled&&this.clearPass.render(e,t),e.setRenderTarget(u),null!==this.overrideMaterialManager?this.overrideMaterialManager.render(e,a,s):e.render(a,s),s.layers.mask=l,a.background=c,e.shadowMap.autoUpdate=h}},P2=class extends b2{constructor(e,t){let{resolutionScale:i=1,width:n=C2.AUTO_SIZE,height:r=C2.AUTO_SIZE,renderTarget:a}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super("DepthPass"),this.needsSwap=!1,this.renderPass=new T2(e,t,new dk({depthPacking:jC}));let s=this.renderPass;s.skipShadowMapUpdate=!0,s.ignoreBackground=!0;let o=s.getClearPass();o.overrideClearColor=new MA(16777215),o.overrideClearAlpha=1,this.renderTarget=a,void 0===this.renderTarget&&(this.renderTarget=new LA(1,1,{minFilter:CE,magFilter:CE,stencilBuffer:!1}),this.renderTarget.texture.name="DepthPass.Target");let l=this.resolution=new C2(this,n,r,i);l.addEventListener("change",(e=>this.setSize(l.baseWidth,l.baseHeight)))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}render(e,t,i,n,r){let a=this.renderToScreen?null:this.renderTarget;this.renderPass.render(e,a)}setSize(e,t){let i=this.resolution;i.setBaseSize(e,t),this.renderTarget.setSize(i.width,i.height)}},D2=(new Float32Array([255/256/256**3,255/256/65536,255/256/256,255/256]),{SKIP:0,ADD:1,ALPHA:2,AVERAGE:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,EXCLUSION:8,LIGHTEN:9,MULTIPLY:10,DIVIDE:11,NEGATION:12,NORMAL:13,OVERLAY:14,REFLECT:15,SCREEN:16,SOFT_LIGHT:17,SUBTRACT:18}),k2=new Map([[D2.SKIP,null],[D2.ADD,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}"],[D2.ALPHA,"vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}"],[D2.AVERAGE,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}"],[D2.COLOR_BURN,"float blend(const in float x,const in float y){return(y==0.0)?y:max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[D2.COLOR_DODGE,"float blend(const in float x,const in float y){return(y==1.0)?y:min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[D2.DARKEN,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}"],[D2.DIFFERENCE,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}"],[D2.EXCLUSION,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}"],[D2.LIGHTEN,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}"],[D2.MULTIPLY,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}"],[D2.DIVIDE,"float blend(const in float x,const in float y){return(y>0.0)?min(x/y,1.0):1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[D2.NEGATION,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}"],[D2.NORMAL,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*opacity+x*(1.0-opacity);}"],[D2.OVERLAY,"float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[D2.REFLECT,"float blend(const in float x,const in float y){return(y==1.0)?y:min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[D2.SCREEN,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}"],[D2.SOFT_LIGHT,"float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[D2.SUBTRACT,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}"]]),O2=class extends QC{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;super(),this.f=e,this.opacity=new gR(t)}getOpacity(){return this.opacity.value}setOpacity(e){this.opacity.value=e}get blendFunction(){return this.f}set blendFunction(e){this.f=e,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(e){this.blendFunction=e}getShaderCode(){return k2.get(this.blendFunction)}},I2={NONE:0,DEPTH:1,CONVOLUTION:2},R2=class extends QC{constructor(e,t){let{attributes:i=I2.NONE,blendFunction:n=D2.SCREEN,defines:r=new Map,uniforms:a=new Map,extensions:s=null,vertexShader:o=null}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(),this.name=e,this.renderer=null,this.attributes=i,this.fragmentShader=t,this.vertexShader=o,this.defines=r,this.uniforms=a,this.extensions=s,this.blendMode=new O2(n),this.blendMode.addEventListener("change",(e=>this.setChanged()))}getName(){return this.name}setRenderer(e){this.renderer=e}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(e){this.attributes=e,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(e){this.fragmentShader=e,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(e){this.vertexShader=e,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(e){}update(e,t,i){}setSize(e,t){}initialize(e,t,i){}dispose(){for(let e of Object.keys(this)){let t=this[e];if(null!==t&&"function"==typeof t.dispose){if(t instanceof Dk||t===this.renderer)continue;this[e].dispose()}}}};function L2(e,t,i){for(let n of t){let t="$1"+e+n.charAt(0).toUpperCase()+n.slice(1),r=new RegExp("([^\\.])(\\b"+n+"\\b)","g");for(let e of i.entries())null!==e[1]&&i.set(e[0],e[1].replace(r,t))}}function B2(e,t,i,n,r,a,s){let o=new Map([["fragment",t.getFragmentShader()],["vertex",t.getVertexShader()]]),l=void 0!==o.get("fragment")&&/mainImage/.test(o.get("fragment")),c=void 0!==o.get("fragment")&&/mainUv/.test(o.get("fragment")),h=[],u=[],d=!1,p=!1;if(void 0===o.get("fragment"))console.error("Missing fragment shader",t);else if(c&&0!==(s&I2.CONVOLUTION))console.error("Effects that transform UV coordinates are incompatible with convolution effects",t);else if(l||c){let f=/(?:\w+\s+(\w+)\([\w\s,]*\)\s*{[^}]+})/g,m=u2.Section;if(c){let t="\t".concat(e,"MainUv(UV);\n");i.set(m.FRAGMENT_MAIN_UV,i.get(m.FRAGMENT_MAIN_UV)+t),d=!0}if(null!==o.get("vertex")&&/mainSupport/.test(o.get("vertex"))){let t="\t".concat(e,"MainSupport(");t+=/mainSupport *\([\w\s]*?uv\s*?\)/.test(o.get("vertex"))?"vUv);\n":");\n",i.set(m.VERTEX_MAIN_SUPPORT,i.get(m.VERTEX_MAIN_SUPPORT)+t),h=h.concat([...o.get("vertex").matchAll(/(?:varying\s+\w+\s+(\w*))/g)].map((e=>e[1]))),u=u.concat(h).concat([...o.get("vertex").matchAll(f)].map((e=>e[1])))}u=u.concat([...o.get("fragment").matchAll(f)].map((e=>e[1]))),u=u.concat([...t.defines.keys()].map((e=>e.replace(/\([\w\s,]*\)/g,"")))),u=u.concat([...t.uniforms.keys()]),t.uniforms.forEach(((t,i)=>a.set(e+i.charAt(0).toUpperCase()+i.slice(1),t))),t.defines.forEach(((t,i)=>r.set(e+i.charAt(0).toUpperCase()+i.slice(1),t))),L2(e,u,r),L2(e,u,o);let g=t.blendMode;if(n.set(g.blendFunction,g),l){let t=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/,n="".concat(e,"MainImage(color0, UV, ");0!==(s&I2.DEPTH)&&t.test(o.get("fragment"))&&(n+="depth, ",p=!0),n+="color1);\n\t";let r=e+"BlendOpacity";a.set(r,g.opacity),n+="color0 = blend".concat(g.blendFunction,"(color0, color1, ").concat(r,");\n\n\t"),i.set(m.FRAGMENT_MAIN_IMAGE,i.get(m.FRAGMENT_MAIN_IMAGE)+n),n="uniform float ".concat(r,";\n\n"),i.set(m.FRAGMENT_HEAD,i.get(m.FRAGMENT_HEAD)+n)}i.set(m.FRAGMENT_HEAD,i.get(m.FRAGMENT_HEAD)+o.get("fragment")+"\n"),null!==o.get("vertex")&&i.set(m.VERTEX_HEAD,i.get(m.VERTEX_HEAD)+o.get("vertex")+"\n")}else console.error("The fragment shader contains neither a mainImage nor a mainUv function",t);return{varyings:h,transformedUv:d,readDepth:p}}var z2=class extends b2{constructor(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];super("EffectPass"),this.fullscreenMaterial=new u2(null,null,null,e),this.effects=i.sort(((e,t)=>t.attributes-e.attributes)),this.skipRendering=!1,this.uniformCount=0,this.varyingCount=0,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(e){this.fullscreenMaterial.encodeOutput=e}get dithering(){return this.fullscreenMaterial.dithering}set dithering(e){let t=this.fullscreenMaterial;t.dithering=e,t.needsUpdate=!0}verifyResources(){let e=this.renderer.capabilities,t=Math.min(e.maxFragmentUniforms,e.maxVertexUniforms);this.uniformCount>t&&console.warn("The current rendering context doesn't support more than "+t+" uniforms, but "+this.uniformCount+" were defined"),t=e.maxVaryings,this.varyingCount>t&&console.warn("The current rendering context doesn't support more than "+t+" varyings, but "+this.varyingCount+" were defined")}updateMaterial(){let e=u2.Section,t=new Map([[e.FRAGMENT_HEAD,""],[e.FRAGMENT_MAIN_UV,""],[e.FRAGMENT_MAIN_IMAGE,""],[e.VERTEX_HEAD,""],[e.VERTEX_MAIN_SUPPORT,""]]),i=new Map,n=new Map,r=new Map,a=new Set,s=0,o=0,l=0,c=!1,h=!1;for(let d of this.effects)if(d.blendMode.blendFunction===D2.SKIP)l|=d.getAttributes()&I2.DEPTH;else if(0!==(l&d.getAttributes()&I2.CONVOLUTION))console.error("Convolution effects cannot be merged",d);else{l|=d.getAttributes();let e=B2("e"+s++,d,t,i,n,r,l);if(o+=e.varyings.length,c=c||e.transformedUv,h=h||e.readDepth,null!==d.extensions)for(let t of d.extensions)a.add(t)}let u=/\bblend\b/g;for(let d of i.values()){let i=d.getShaderCode().replace(u,"blend".concat(d.blendFunction));t.set(e.FRAGMENT_HEAD,t.get(e.FRAGMENT_HEAD)+i+"\n")}if(0!==(l&I2.DEPTH)){if(h){let i="float depth = readDepth(UV);\n\n\t";t.set(e.FRAGMENT_MAIN_IMAGE,i+t.get(e.FRAGMENT_MAIN_IMAGE))}this.needsDepthTexture=null===this.getDepthTexture()}else this.needsDepthTexture=!1;if(c){let i="vec2 transformedUv = vUv;\n";t.set(e.FRAGMENT_MAIN_UV,i+t.get(e.FRAGMENT_MAIN_UV)),n.set("UV","transformedUv")}else n.set("UV","vUv");t.forEach(((e,t,i)=>i.set(t,e.trim().replace(/^#/,"\n#")))),this.uniformCount=r.size,this.varyingCount=o,this.skipRendering=0===s,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderParts(t).setExtensions(a).setUniforms(r).setDefines(n)}recompile(){this.updateMaterial(),this.verifyResources()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:FC;this.fullscreenMaterial.depthBuffer=e,this.fullscreenMaterial.depthPacking=t;for(let i of this.effects)i.setDepthTexture(e,t)}render(e,t,i,n,r){for(let a of this.effects)a.update(e,t,n);if(!this.skipRendering||this.renderToScreen){let r=this.fullscreenMaterial;r.inputBuffer=t.texture,r.time+=n,e.setRenderTarget(this.renderToScreen?null:i),e.render(this.scene,this.camera)}}setSize(e,t){this.fullscreenMaterial.setSize(e,t);for(let i of this.effects)i.setSize(e,t)}initialize(e,t,i){this.renderer=e;for(let n of this.effects)n.initialize(e,t,i),n.addEventListener("change",(e=>this.handleEvent(e)));this.updateMaterial(),this.verifyResources(),void 0!==i&&i!==kE&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(let e of this.effects)e.dispose()}handleEvent(e){if("change"===e.type)this.recompile()}},N2=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],F2=class extends b2{constructor(){let{resolutionScale:e=.5,width:t=C2.AUTO_SIZE,height:i=C2.AUTO_SIZE,kernelSize:n=W2.LARGE}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super("KawaseBlurPass"),this.renderTargetA=new LA(1,1,{minFilter:TE,magFilter:TE,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";let r=this.resolution=new C2(this,t,i,e);r.addEventListener("change",(e=>this.setSize(r.baseWidth,r.baseHeight))),this.blurMaterial=new a2,this.ditheredBlurMaterial=new a2,this.ditheredBlurMaterial.uniforms.scale=this.blurMaterial.uniforms.scale,this.ditheredBlurMaterial.dithering=!0,this.dithering=!1,this.kernelSize=n}getResolution(){return this.resolution}get width(){return this.resolution.width}set width(e){this.resolution.preferredWidth=e}get height(){return this.resolution.height}set height(e){this.resolution.preferredHeight=e}get scale(){return this.blurMaterial.scale}set scale(e){this.blurMaterial.scale=e}getScale(){return this.blurMaterial.scale}setScale(e){this.blurMaterial.scale=e}getKernelSize(){return this.kernelSize}setKernelSize(e){this.kernelSize=e}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}render(e,t,i,n,r){let a,s,o=this.scene,l=this.camera,c=this.renderTargetA,h=this.renderTargetB,u=N2[this.kernelSize],d=this.blurMaterial,p=t;for(this.fullscreenMaterial=d,a=0,s=u.length-1;a<s;++a){let t=0===(1&a)?c:h;d.kernel=u[a],d.inputBuffer=p.texture,e.setRenderTarget(t),e.render(o,l),p=t}this.dithering&&(d=this.ditheredBlurMaterial,this.fullscreenMaterial=d),d.kernel=u[a],d.inputBuffer=p.texture,e.setRenderTarget(this.renderToScreen?null:i),e.render(o,l)}setSize(e,t){let i=this.resolution;i.setBaseSize(e,t);let n=i.width,r=i.height;this.renderTargetA.setSize(n,r),this.renderTargetB.setSize(n,r),this.blurMaterial.setSize(n,r),this.ditheredBlurMaterial.setSize(n,r)}initialize(e,t,i){void 0!==i&&(this.renderTargetA.texture.type=i,this.renderTargetB.texture.type=i,i!==kE?(this.blurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1",this.ditheredBlurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1"):e.outputEncoding===NC&&(this.renderTargetA.texture.encoding=NC,this.renderTargetB.texture.encoding=NC))}static get AUTO_SIZE(){return C2.AUTO_SIZE}},j2=class extends b2{constructor(){let{width:e=C2.AUTO_SIZE,height:t=C2.AUTO_SIZE,renderTarget:i,luminanceRange:n,colorOutput:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super("LuminancePass"),this.fullscreenMaterial=new d2(r,n),this.needsSwap=!1,this.renderTarget=i,void 0===this.renderTarget&&(this.renderTarget=new LA(1,1,{minFilter:TE,magFilter:TE,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target",this.renderTarget.texture.generateMipmaps=!1);let a=this.resolution=new C2(this,e,t);a.addEventListener("change",(e=>this.setSize(a.baseWidth,a.baseHeight)))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(e,t,i,n,r){this.fullscreenMaterial.inputBuffer=t.texture,e.setRenderTarget(this.renderToScreen?null:this.renderTarget),e.render(this.scene,this.camera)}setSize(e,t){let i=this.resolution;i.setBaseSize(e,t),this.renderTarget.setSize(i.width,i.height)}initialize(e,t,i){void 0!==i&&i!==kE&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},V2=class extends b2{constructor(e,t){super("MaskPass",e,t),this.needsSwap=!1,this.clearPass=new S2(!1,!1,!0),this.inverse=!1}get inverted(){return this.inverse}set inverted(e){this.inverse=e}get clear(){return this.clearPass.enabled}set clear(e){this.clearPass.enabled=e}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(e){this.inverted=e}render(e,t,i,n,r){let a=e.getContext(),s=e.state.buffers,o=this.scene,l=this.camera,c=this.clearPass,h=this.inverted?0:1,u=1-h;s.color.setMask(!1),s.depth.setMask(!1),s.color.setLocked(!0),s.depth.setLocked(!0),s.stencil.setTest(!0),s.stencil.setOp(a.REPLACE,a.REPLACE,a.REPLACE),s.stencil.setFunc(a.ALWAYS,h,4294967295),s.stencil.setClear(u),s.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?c.render(e,null):(c.render(e,t),c.render(e,i))),this.renderToScreen?(e.setRenderTarget(null),e.render(o,l)):(e.setRenderTarget(t),e.render(o,l),e.setRenderTarget(i),e.render(o,l)),s.color.setLocked(!1),s.depth.setLocked(!1),s.stencil.setLocked(!1),s.stencil.setFunc(a.EQUAL,1,4294967295),s.stencil.setOp(a.KEEP,a.KEEP,a.KEEP),s.stencil.setLocked(!0)}},U2=class extends b2{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"inputBuffer";super("ShaderPass"),this.fullscreenMaterial=e,this.inputBufferUniform=null,this.setInput(t)}setInput(e){if(this.inputBufferUniform=null,null!==this.fullscreenMaterial){let t=this.fullscreenMaterial.uniforms;void 0!==t&&void 0!==t[e]&&(this.inputBufferUniform=t[e])}}render(e,t,i,n,r){null!==this.inputBufferUniform&&null!==t&&(this.inputBufferUniform.value=t.texture),e.setRenderTarget(this.renderToScreen?null:i),e.render(this.scene,this.camera)}initialize(e,t,i){void 0!==i&&i!==kE&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},G2=.001,H2=class{constructor(){this.previousTime=0,this.currentTime=0,this.delta=0,this.fixedDelta=1e3/60,this.elapsed=0,this.timescale=1,this.fixedDeltaEnabled=!1,this.autoReset=!1}setFixedDeltaEnabled(e){return this.fixedDeltaEnabled=e,this}isAutoResetEnabled(e){return this.autoReset}setAutoResetEnabled(e){return typeof document<"u"&&void 0!==document.hidden&&(e?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this.autoReset=e),this}getDelta(){return this.delta*G2}getFixedDelta(){return this.fixedDelta*G2}setFixedDelta(e){return this.fixedDelta=1e3*e,this}getElapsed(){return this.elapsed*G2}getTimescale(){return this.timescale}setTimescale(e){return this.timescale=e,this}update(e){return this.fixedDeltaEnabled?this.delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=void 0!==e?e:performance.now(),this.delta=this.currentTime-this.previousTime),this.delta*=this.timescale,this.elapsed+=this.delta,this}reset(){return this.delta=0,this.elapsed=0,this.currentTime=performance.now(),this}handleEvent(e){document.hidden||(this.currentTime=performance.now())}dispose(){this.setAutoResetEnabled(!1)}},W2={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},q2=class extends R2{constructor(){let{blendFunction:e=D2.SCREEN,luminanceThreshold:t=.9,luminanceSmoothing:i=.025,resolutionScale:n=.5,intensity:r=1,width:a=C2.AUTO_SIZE,height:s=C2.AUTO_SIZE,kernelSize:o=W2.LARGE}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super("BloomEffect","#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D map;\n#else\nuniform lowp sampler2D map;\n#endif\nuniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=clamp(texture2D(map,uv)*intensity,0.0,1.0);}",{blendFunction:e,uniforms:new Map([["map",new gR(null)],["intensity",new gR(r)]])}),this.renderTarget=new LA(1,1,{minFilter:TE,magFilter:TE,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.renderTarget.texture.generateMipmaps=!1,this.uniforms.get("map").value=this.renderTarget.texture,this.luminancePass=new j2({renderTarget:this.renderTarget,colorOutput:!0}),this.luminanceMaterial.threshold=t,this.luminanceMaterial.smoothingFactor=i,this.blurPass=new F2({resolutionScale:n,width:a,height:s,kernelSize:o});let l=this.blurPass.getResolution();l.addEventListener("change",(e=>this.setSize(l.baseWidth,l.baseHeight)))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}get resolution(){return this.blurPass.resolution}getResolution(){return this.blurPass.resolution}getBlurPass(){return this.blurPass}getLuminancePass(){return this.luminancePass}get luminanceMaterial(){return this.luminancePass.fullscreenMaterial}getLuminanceMaterial(){return this.luminancePass.fullscreenMaterial}get width(){return this.resolution.width}set width(e){this.resolution.preferredWidth=e}get height(){return this.resolution.height}set height(e){this.resolution.preferredHeight=e}get dithering(){return this.blurPass.dithering}set dithering(e){this.blurPass.dithering=e}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(e){this.blurPass.kernelSize=e}get distinction(){return console.warn(this.name,"distinction was removed"),1}set distinction(e){console.warn(this.name,"distinction was removed")}get intensity(){return this.uniforms.get("intensity").value}set intensity(e){this.uniforms.get("intensity").value=e}getIntensity(){return this.intensity}setIntensity(e){this.intensity=e}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}update(e,t,i){let n=this.renderTarget;this.luminancePass.enabled?(this.luminancePass.render(e,t,n),this.blurPass.render(e,n,n)):this.blurPass.render(e,t,n)}setSize(e,t){let i=this.resolution;i.setBaseSize(e,t),this.renderTarget.setSize(i.width,i.height),this.luminancePass.resolution.copy(i)}initialize(e,t,i){this.blurPass.initialize(e,t,i),void 0!==i&&(this.renderTarget.texture.type=i,e.outputEncoding===NC&&(this.renderTarget.texture.encoding=NC))}},X2=class extends R2{constructor(){let{blendFunction:e=D2.NORMAL,brightness:t=0,contrast:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super("BrightnessContrastEffect","uniform float brightness;uniform float contrast;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=inputColor.rgb+vec3(brightness-0.5);if(contrast>0.0){color/=vec3(1.0-contrast);}else{color*=vec3(1.0+contrast);}outputColor=vec4(min(color+vec3(0.5),1.0),inputColor.a);}",{blendFunction:e,uniforms:new Map([["brightness",new gR(t)],["contrast",new gR(i)]])})}get brightness(){return this.uniforms.get("brightness").value}set brightness(e){this.uniforms.get("brightness").value=e}getBrightness(e){return this.brightness}setBrightness(e){this.brightness=e}get contrast(){return this.uniforms.get("contrast").value}set contrast(e){this.uniforms.get("contrast").value=e}getContrast(e){return this.contrast}setContrast(e){this.contrast=e}},Y2=class extends R2{constructor(){super("ColorAverageEffect","void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=vec4(vec3(average(inputColor.rgb)),inputColor.a);}",{blendFunction:arguments.length>0&&void 0!==arguments[0]?arguments[0]:D2.NORMAL})}},Q2=class extends R2{constructor(){let{blendFunction:e=D2.NORMAL,offset:t=new hA(.001,5e-4)}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super("ChromaticAberrationEffect","varying vec2 vUvR;varying vec2 vUvB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec2 ra=texture2D(inputBuffer,vUvR).ra;vec2 ba=texture2D(inputBuffer,vUvB).ba;outputColor=vec4(ra.x,inputColor.g,ba.x,max(max(ra.y,ba.y),inputColor.a));}",{vertexShader:"uniform vec2 offset;varying vec2 vUvR;varying vec2 vUvB;void mainSupport(const in vec2 uv){vec2 shift=offset*vec2(1.0,aspect);vUvR=uv+shift;vUvB=uv-shift;}",blendFunction:e,attributes:I2.CONVOLUTION,uniforms:new Map([["offset",new gR(t)]])})}get offset(){return this.uniforms.get("offset").value}set offset(e){this.uniforms.get("offset").value=e}getOffset(){return this.offset}setOffset(e){this.offset=e}},Z2=class extends R2{constructor(e){let{blendFunction:t=D2.NORMAL,worldFocusDistance:i,worldFocusRange:n,focusDistance:r=0,focalLength:a=.1,focusRange:s=a,bokehScale:o=1,width:l=C2.AUTO_SIZE,height:c=C2.AUTO_SIZE}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super("DepthOfFieldEffect","#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuffer;\n#else\nuniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer;\n#endif\nuniform lowp sampler2D nearCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);float CoCNear=texture2D(nearCoCBuffer,uv).r;CoCNear=min(CoCNear*scale,1.0);vec4 result=inputColor*(1.0-colorFar.a)+colorFar;result=mix(result,colorNear,CoCNear);outputColor=result;}",{blendFunction:t,attributes:I2.DEPTH,uniforms:new Map([["nearColorBuffer",new gR(null)],["farColorBuffer",new gR(null)],["nearCoCBuffer",new gR(null)],["scale",new gR(1)]])}),this.camera=e,this.renderTarget=new LA(1,1,{minFilter:TE,magFilter:TE,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="DoF.Intermediate",this.renderTarget.texture.generateMipmaps=!1,this.renderTargetMasked=this.renderTarget.clone(),this.renderTargetMasked.texture.name="DoF.Masked.Far",this.renderTargetNear=this.renderTarget.clone(),this.renderTargetNear.texture.name="DoF.Bokeh.Near",this.uniforms.get("nearColorBuffer").value=this.renderTargetNear.texture,this.renderTargetFar=this.renderTarget.clone(),this.renderTargetFar.texture.name="DoF.Bokeh.Far",this.uniforms.get("farColorBuffer").value=this.renderTargetFar.texture,this.renderTargetCoC=this.renderTarget.clone(),this.renderTargetCoC.texture.name="DoF.CoC",this.renderTargetCoCBlurred=this.renderTargetCoC.clone(),this.renderTargetCoCBlurred.texture.name="DoF.CoC.Blurred",this.uniforms.get("nearCoCBuffer").value=this.renderTargetCoCBlurred.texture,this.cocPass=new U2(new r2(e));let h=this.cocMaterial;h.focusDistance=r,h.focusRange=s,void 0!==i&&(h.worldFocusDistance=i),void 0!==n&&(h.worldFocusRange=n),this.blurPass=new F2({kernelSize:W2.MEDIUM,width:l,height:c});let u=this.blurPass.getResolution();u.addEventListener("change",(e=>this.setSize(u.getBaseWidth(),u.getBaseHeight()))),this.maskPass=new U2(new m2(this.renderTargetCoC.texture));let d=this.maskPass.fullscreenMaterial;d.maskFunction=f2,d.colorChannel=$1,this.bokehNearBasePass=new U2(new t2(!1,!0)),this.bokehNearBasePass.fullscreenMaterial.cocBuffer=this.renderTargetCoCBlurred.texture,this.bokehNearFillPass=new U2(new t2(!0,!0)),this.bokehNearFillPass.fullscreenMaterial.cocBuffer=this.renderTargetCoCBlurred.texture,this.bokehFarBasePass=new U2(new t2(!1,!1)),this.bokehFarBasePass.fullscreenMaterial.cocBuffer=this.renderTargetCoC.texture,this.bokehFarFillPass=new U2(new t2(!0,!1)),this.bokehFarFillPass.fullscreenMaterial.cocBuffer=this.renderTargetCoC.texture,this.target=null,this.bokehScale=o}get cocTexture(){return this.renderTargetCoC.texture}get cocMaterial(){return this.cocPass.fullscreenMaterial}get circleOfConfusionMaterial(){return this.cocMaterial}getCircleOfConfusionMaterial(){return this.circleOfConfusionMaterial}getBlurPass(){return this.blurPass}get resolution(){return this.blurPass.getResolution()}getResolution(){return this.blurPass.getResolution()}get bokehScale(){return this.uniforms.get("scale").value}set bokehScale(e){let t=[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass];for(let i of t)i.fullscreenMaterial.setScale(e);this.maskPass.fullscreenMaterial.setStrength(e),this.uniforms.get("scale").value=e}getBokehScale(){return this.bokehScale}setBokehScale(e){this.bokehScale=e}getTarget(){return this.target}setTarget(e){this.target=e}calculateFocusDistance(e){let t=this.camera;return n2(-t.position.distanceTo(e),t.near,t.far)}setDepthTexture(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:FC;this.circleOfConfusionMaterial.depthBuffer=e,this.circleOfConfusionMaterial.depthPacking=t}update(e,t,i){let n=this.renderTarget,r=this.renderTargetCoC,a=this.renderTargetCoCBlurred,s=this.renderTargetMasked;if(null!==this.target){let e=this.calculateFocusDistance(this.target);this.circleOfConfusionMaterial.focusDistance=e}this.cocPass.render(e,null,r),this.blurPass.render(e,r,a),this.maskPass.render(e,t,s),this.bokehFarBasePass.render(e,s,n),this.bokehFarFillPass.render(e,n,this.renderTargetFar),this.bokehNearBasePass.render(e,t,n),this.bokehNearFillPass.render(e,n,this.renderTargetNear)}setSize(e,t){let i=this.resolution;i.setBaseSize(e,t);let n=i.width,r=i.height,a=[this.cocPass,this.blurPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass];a.push(this.renderTargetCoC,this.renderTargetMasked),a.forEach((i=>i.setSize(e,t))),a=[this.renderTarget,this.renderTargetNear,this.renderTargetFar,this.renderTargetCoCBlurred],a.forEach((e=>e.setSize(n,r))),[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach((e=>e.fullscreenMaterial.setSize(n,r)))}initialize(e,t,i){[this.cocPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach((n=>n.initialize(e,t,i))),this.blurPass.initialize(e,t,kE),void 0!==i&&(this.renderTarget.texture.type=i,this.renderTargetNear.texture.type=i,this.renderTargetFar.texture.type=i,this.renderTargetMasked.texture.type=i,e.outputEncoding===NC&&(this.renderTarget.texture.encoding=NC,this.renderTargetNear.texture.encoding=NC,this.renderTargetFar.texture.encoding=NC,this.renderTargetMasked.texture.encoding=NC))}},K2=(new FA,new mM,class extends R2{constructor(){let{blendFunction:e=D2.NORMAL,hue:t=0,saturation:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super("HueSaturationEffect","uniform vec3 hue;uniform float saturation;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,hue.xyz),dot(inputColor.rgb,hue.zxy),dot(inputColor.rgb,hue.yzx));float average=(color.r+color.g+color.b)/3.0;vec3 diff=average-color;if(saturation>0.0){color+=diff*(1.0-1.0/(1.001-saturation));}else{color+=diff*-saturation;}outputColor=vec4(min(color,1.0),inputColor.a);}",{blendFunction:e,uniforms:new Map([["hue",new gR(new FA)],["saturation",new gR(i)]])}),this.hue=t}get saturation(){return this.uniforms.get("saturation").value}set saturation(e){this.uniforms.get("saturation").value=e}getSaturation(){return this.saturation}setSaturation(e){this.saturation=e}get hue(){let e=this.uniforms.get("hue").value;return Math.acos((3*e.x-1)/2)}set hue(e){let t=Math.sin(e),i=Math.cos(e);this.uniforms.get("hue").value.set((2*i+1)/3,(-Math.sqrt(3)*t-i+1)/3,(Math.sqrt(3)*t-i+1)/3)}getHue(){return this.hue}setHue(e){this.hue=e}}),J2=(new MA,class extends R2{constructor(){let{blendFunction:e=D2.SCREEN,premultiply:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super("NoiseEffect","void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 noise=vec3(rand(uv*time));\n#ifdef PREMULTIPLY\noutputColor=vec4(min(inputColor.rgb*noise,vec3(1.0)),inputColor.a);\n#else\noutputColor=vec4(noise,inputColor.a);\n#endif\n}",{blendFunction:e}),this.premultiply=t}get premultiply(){return this.defines.has("PREMULTIPLY")}set premultiply(e){this.premultiply!==e&&(e?this.defines.set("PREMULTIPLY","1"):this.defines.delete("PREMULTIPLY"),this.setChanged())}isPremultiplied(){return this.premultiply}setPremultiplied(e){this.premultiply=e}}),$2=class extends R2{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:30;super("PixelationEffect","uniform bool active;uniform vec2 d;void mainUv(inout vec2 uv){if(active){uv=vec2(d.x*(floor(uv.x/d.x)+0.5),d.y*(floor(uv.y/d.y)+0.5));}}",{uniforms:new Map([["active",new gR(!1)],["d",new gR(new hA)]])}),this.resolution=new hA,this.d=0,this.granularity=e}get granularity(){return this.d}set granularity(e){let t=Math.floor(e);t%2>0&&(t+=1),this.d=t,this.uniforms.get("active").value=t>0,this.setSize(this.resolution.width,this.resolution.height)}getGranularity(){return this.granularity}setGranularity(e){this.granularity=e}setSize(e,t){this.resolution.set(e,t),this.uniforms.get("d").value.setScalar(this.d).divide(this.resolution)}},e3=(Math.PI,new FA,new FA,"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAYAAACm53kpAAAAeElEQVRYR+2XSwqAMAxEJ168ePEqwRSKhIIiuHjJqiU0gWE+1CQdApcVAMUAuARaMGCX1MIL/Ow13++9lW2s3mW9MWvsnWc/2fvGygwPAN4E8QzAA4CXAB6AHjG4JTHYI1ey3pcx6FHnEfhLDOIBKAmUBK6/ANUDTlROXAHd9EC1AAAAAElFTkSuQmCC"),t3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAYAAAABNmBHAAAgAElEQVR4Xuy9CbhlV1ktOvbpq09DkiIkUBI6kxASIH0DlAQiIK1wRfSJTx+i4JX7vKIigs8HXpXvqVcvrcC9agQ7IDTSSWgqCQQliDRBJKkkhDSkqVPNqVOnP+8b//rH3P+eZ+199tlznVTlvVrft7+1T7OaueZY42/m37QALKNk2wHg1pITlB17mC+Pp11W3X/LHyT32vhg48/5SOv+PnwpsHA70JoGlueB1iKApeqzvOzn44GatTB76Xzhd7suBR7+WWADgDEAwwCG/L54b/poDLrHuvvm70Z2Avhsc+PVcxscBU8F8C8ADg5+ipIjD/PlGwfgju8B924E5seARUfLsiNmqQW0IjL8+7L2NYD/7COBzfcCm+aB8SVgdAkYIRCXKyDax4EdAanL5PuNPllNvXDlAHwFgP8AcC2AhRIoDXbsYb48dl5WkVFTE3LGDcC9m4CZCWBuFFgeAZaGAYJQQCRqDHT+McJrVb8zwATUXH02MHYfMHEIGFsAxgjApQqACYQORjtd/B7Axt/z79sC0+cMPgjjlwPwVwHcA+DfAHzTxcVgWBroqMN8+cYBeM71wH0TwKExYHYUWCIAHYRLTlkCYgcIBcAgU/n3qy8GRu4HRgnAOWBkERhddPAJhGJDBxkvw7cqimr+zFM/ZLnZF64cgL8BYD+AWwB8x/dlWuWagHiYL984AJ/0RWBy1AE4AizyM1yxYAcTigW55xMbAkxEiwEdkJ/ZCQxPAiOHgBECcKEC4TBZcKkSv+mTieNcNPNC26mLNsj45QD8LQDTAO4GcJt/7iw2bfoG4WG+vAGwm9ExiEg69zpg/wgwPQLMjgALzn4E4aIzoJjQ9g4024uygkj+pyuAoX0VAIfngOH5NgCHMhAm8Sv2y3XDZeBhNIp8OzJE8OsBzAKYBHAXgDt8/4O+MVT0j4f58o0D8Pxrgf3DwMwIMEPQEYRkNwfgsuuDZLskip0No0gWMD/9HGDoADAkAC4Aw/wsAgZAgs2Z0ABI0GU6IVmKv+f28KDnHxkA/G0A8y6G73N9kOCjXnh/Ebb6OvgwX75xAF5wLTA1VIHPADgMLDj4yIA5AAm6aCUnv4oz46eeDwxNAUMzwJAz4BABSNDFTwSfg7DDKHE23MG5PqIY8A1u/dINs9dBdy8AgnGPM2NfUBrsnw7z5RsH4IXXAAcJviFgluAbygBINnSLWOAjGxJ4pgOKDV0v/OSLKp8iGXBovhLBBOCQM2ACoTOhnYrAdItYbCij5JFzRyIAqRccAnDAQUjg6UNQ7hsMXP0cRQAexss3DsCLCECCLwCQzMcPwUi2MwAScAKbfnY/YRLFQ8DHX+IAJAMSfDkAF13kLvleIjhjQQHxUVS3jjgGpKeeNzYVQEjgUS8k+PghONdhIwAP4+XXBYCHKIJbwJyDTgaIAdCBJx3Q2M8tYAHP9m4df/ylQOsQ0JqtRLCx30K1wtLBggScQOgsKBGcWHAJeOwRC0BSM1mQIKRbhh+Bj98JQP6t4U0APEyXXxcAEnxkQAFwoVUxID9kvQg+c1C7vidRbIDkc24B//hTQGumDcCWA5DgMxASdNIFBUI5pCML8v8API5zfEQx4BudgqiczviSnJhQwCP4BMCGl+wO8+U7AJi/W4O4YS6+pmK/2ciADsAOBhTIIiAJnPB7AvNjP+0AnANaYkAHX2JBAc+tYaJXOqBZv24Vc386XW5dtkHGW+4HFAJonpOe+YYQZAShgKjv3PNvPQaxVoI8zJdfFwASfPzMUwS3Kt1v0UFIlos6oDFdAGFcliMAP/ryAEAGNwQRnDOgLbdlIEwrIs6AZ/QgkMMHQF6ZAKQcJAsSYPwIeAIk9wJgoPK1gi7+PwF4GC/fOAAvIQPSs0URTPBJ/Pp3GSEGRHfBCIQ0xowBtUbcAj7ys5X4Jfu1HIAGQrIgQRXEsAFQIORDFhiDY/rMHmrU4QUgR08AkgUjCAW6CD6CkwBsAIQC4GG6fPMA3OXiNzCg2I9gNCMksmAAoemDzoimFwL48M85AKkiuQVMAAp8CYRRDAt8GQiJ67N6GJODAXAHlsGguscA2AJg1IPGYmxOpBxFWkRN9LsATgIwXnNs/v/5z/9XCf8BO3YAtxbc/46/KDt+5+ea1Yku2VUxHz/z0v24FwMGK1gWsK2OUUxHHdCBeRUB6OxHABr4ZICIBd0QWSF+XRdMTAjgCdTrG9cBNwE4F8CpDkICyYLGsuhFt6zs+gISwUen8zEAjgMw4cfx2H6O/90yAFo84Cbg4ID3/9TfLTt+5+ebnRABkODjx0SwPi5ec/FrYpmqSAxM8Dn60CsqAFI6GfhqAMiDE/gokmvEr0C4PgDkBQm40wE8zMFEUDKEVoxIMLl/KS73mE7H9d+vcKHQQcjwW0Yu9nP8m8sAmOIBuWY6wP2/4s0ezjjg8TuvaR6ABJ70vxUApGrm7EbGE+i472BAB+WHfqHS/eoAaEwY2E9+wLSXTqhI7CXgnB6LCoOJ4BiST+hTnG0HcCwAglCx3ARoZEVFXnBPp/O/A/hXACc7CPs9/i1lAOyIB+RDX+P9/+pbQjjjAMfv/PL6AFDs1wFAgs/9fgKfgdE/ZEpuiQlbwAde6QAMBgiRmsSwA9BY0JfjovGRDBMH4TlcXGhcBOc6HkF0gjPhZgchxTLZMAci/04W/B6Ab3t09EPXcPyflgFwRTwgJ2MN9/8bf5qFM67x+B/aW4XQz42FeL0YrRyikztUFw0704mf9kXgxhOAqc3AAsPyRxxQCs/PdXOFY0W1KHy3QIUGtx+6vdnx1vsB+dsTncm2AogglFgVEAlUWrOMB2RyEmMCGQ/Y7/HvKns6tfGAnJQ+r/9b76oJZ1zD8WdyQjYBh8aBhVEHjELouQ8ukQ7VRSCJAALwkr+sALhnGzDD3JAJYJHg9uhoi4bx8ytkWUtvHT/7+Zc4dw1uZ3612fH2dkQf7yxIEEockwkJQn4IQoq8unhAhmPRKKFx0uv4K8ueTs94wD7u//VX9ghn7OP4c+4G7h8HpseB+dF2AKlFLwuAIZ8jD6NPrOhAffmfA9/ZBuzZCkyRWSeqBCWyoYGQ5yQrBpDbum/ME1HoPo0XEkSD2zlfbna8q6+EUJcTCxKEtHL5EQjP6BEPyIgYAZBvYt3xHyx7OqvGA65y/7/9wVXCGVc5/sl7qxD66dEqiYgRzAqhN1A4CBNAAlDyAFI+iZ9/N3DLJuC+jcDUBmCWyUnOrmTYCMIOkNclLg0B8/RsNLg9+UvNjnd1APLmmQpFHyEBROuWACQT8nN+H/GAvY7/VNnT6SsesMf13/CpahGnZzhjj+PPmwX2MYdDIfQexWyBAwEUOQDrRDN/98p3A7dvAO6fAA5sqHJDBEAyoUVGkwEd6HR12XU4kwzfl6fCXTZzjy57vvnR513X7Hj7AyDvggAUi9EyFgiZqNxPQF6345nOWbD1HQ/Y5fpvuLa/2+82/vNHgAPDFQDnhoF5j2C2qBWCI8bw1eRw5CL5l94L3DEOTI4DB8Y9OWmsEu/zBJ3rgsaybqBob/7A4C7jtWcooRrczr+u2fH2D0AOQgAUCxKEP7aGgLy64+m6KdjWFA9Yc/03/Osa4glrjr+AupqHz1sEs0cxG0BC9HIePLoit9eNkVf9L+DuUWByDJgaq4ybGYLPAWgiXmLedUE7dwC7saL7CqfPKXi4NYdaykCD410bAHlDEsNiwZ9wAPYbkJcfz6T2gm3N8YDZ9d/wHxUA+739fPwXPrSKYGb+BuP3jAFDElFH9HIWwbzCIGkBr/or4J4RYO8oMOW6ZVcAuvi1Cgoha04BCwT5gfMKHm7NoRde2+x41w5A3hQZkADk5+cGiAeMx3+/7AENFA8Yrv/G71cAXFM4Yzj+otOAaQLQA0gZxaIIZtMDFTigKJV8H9Iq6aZ59ZXAvSPAvpEKgBTtBODcSCWCZeRYtpzrmLyeGNCAyFl1v+Hei8qeb370Rdc2O97BAMi7EgB/2QG41nhAHU9LuWAbOB7Qr//GPRUA13r7Gv9FZwIMoVcEswEwfDoimEP0shKKtIphaZQAXv1+YM+wA3DEdcvRKkGJADQQEsQuhi1Tjt95vBsh5nx2IO59SsHDrTmUOStNjndwAAqEry0IyCMICkOyiuIBNwBvPFQQT7gBuPjc9oRYAIHyOEL4vIFEYVNaOou5vCGE/tV/A0wOVcnpzI47NOri3QFIBpSeaSDUdYLOSWvYImSGgftpJDa4MWJbAGxivGUA5MAOc0Be6eVLj7/4Mk+hzCOYPYpZDBiNkLh+G/M3yFyv/ltgL3W3YQfgcFUhgRY2PwY+Z7/EhAR1SFyXCOb57r28QfQBsJQBMn5D4y0HYLPje9Cd7RIC0PM3EiMofF4gVCBp1P840ix/gyz56r+vAMjk9Gl375iB4+CzveuZdLkkEPJ8ZEfX/6R73vOjzT5Si9hucLxHAVg4PwJgRwh9CKOXK8YA4ZEqKZXSQWh5P+5AftXfA/uGKvYjCKn72cctbFrZNECka5L5CPwIPtMH3TVz17MLB5gdLgA2Nd6jACycHwLQxFEUSR5ASvARDB0h9AQb9bXIgCGk6lUfAPYTgEPAITKgg1BObk58srTJgG58WMkWMaAbQQT1nc8rHGANAJsc71EAFs4PAagQestgC1lsBJ4BMCSOK6dDUcwqqaFiQr/0QeAAAdjy+jBiQQeeMSBZT3nCPUDIa9z+/MIB1gCwyfEeBWDh/BCAeQSzgkjFfGLBBD5nxQ4DxN0wv3hVxX5TBGDwL5obxvVA5YqYL5BeMLd66YYxJpRB0gK+96LCAdYAsMnxHgVg4fwIgMrhUPKQ2C+Bz0PmBTqBMQehAbDlIjj4F80KJguSVZ0FuXpjoCOgXawLjALhbT9eOMAuAGxqvEcBWDg/l1IE05Ed0ygZnyHdz0VwCqEPIfNyx0QQvvLDFQCp+8nfZk5und8tXwIgWcHSNX0N2CJmnAl3v6RwgNnhl17T7HiPArBwfghAS7mV/hey2JS9FvM3BLpUUi1YwDRMXvkRYJoAlAh2l0dcZ04s6JUTDIjyBcrl4yDc/dLCAdYAsMnxHgVg4fxwKVwJgGEJNmWtxpQMpX9on2eRhVA+O56AjMfnP+e3Xvf3NwG4xIPTleiY55bpGh6UbafNU0l0z0p+5Jh5HqYJ6b51nP6XP8cx12XNHQVgIQB/bFPVg2OC7Q+WgVFWng/FvtWLI06uWh5oguKEcXVS/9sEAF//VGD7t4ETDgJbF4CNi8CGZWBs2fPL/H6Vwp2KEtVk4fJ+v/EIYPN9wKa5qu+IncfPwXHVZe/aOL3EbwS7xv8A1rQvnO0j8PArTgTGZ4BxFv9mIxhOCGsv+0OPYDRghcLfkWkEuq0+G00x4OtfDGz+d2DbHmDLjL8si8AYP/7CGIAiEEMTG92zXqSbH+d9R2aA0XnvO+JjthiIrOVDHHPOkBrzUQAWAPsZp3oPDpa/Xag6EVkLBK+5rAnJC3/nYk/APD704WiEAV8OTHwX2LQH2DgFbJgFNrBhjd8r79deGoEwsllgNBOzy8CdjweG9wBj08AIAci2D6HafmyAk4/Z7SJ72hGYRwFYAMDLTwOGp4FRFgD3HhzqRGQiyeurqOdG6r0Rm8IEZjzRlkiqCWoEgK8Axm4BJu4HJhyAbFhDxmbDGnZO4j0SgLGDkpibgEq66TJw/1nA0F5gdLpq+zDqFfd5LMeWqu5HNST0uJOIllg+qgMWgI+HPv0xwLA3gWHpW2sC441gCECbmKziaGrnUdMO4aHeh6MxAP4SMHI7ML4HGD8AjHvHJGNAgpDgY/ck3stipRemvVhc+uASMPUEYGh/9dIRgGx8Y+MNbR/00uVtH0wEx94j/v0oAxaA8Ed+GBieAYZZg5kADC0QWGOFzGJlcGPzl1BxNLXD8sk4xftwNAbA/wwM3wGMUmxOOQBnHXzetIYvibonmSiuYTNjriVg7glAiwBk0fNZH6+PmX9P6kfNmCXGpftJ7TgKwBIAnln14BAAYxMYm5C6RjCyCoOyr0qkD/c+HI0B8DXA8N3AyCQwesD1VQKH7EcASm1Q+y4CkN9pUKiVF5nLvy+fBbTUd8QBaH1HvNBROiZvfsNnrF4kcvPwpdsBLBeU18Nf7AB23Dp4ecHC8oBgUlJJecLS+7+WOpE3gbE+HKw+yoevCYkMGKqPJrdEKARutaFYRs1fiEZ0wP8CDN8LDO8FRqYq3W10pgKgfYLaYCzootgA6KXaTA90y374TKB1sBozy77xHFZ536utRgAmEaw6g5kUSFZwSXnA330qsOlfgHMPDlZesLA8IOjoLypPWHj/11EnCiVwkz7kAExtsGraYUWdSDX5TmsagL8KDBGA7Bd30JsW0oWivnEOQNP7yGTSBR101AlZSUtGyfgZDkCWY1HnJdcBVe6325hTvelg2CQjZNDygG/2An0j1wKnL6y9vGBheUC8prQ8YeH9X39OVQSc7Mc6fCaKvAeHdCIVf4yMYCynTpX+nb97NJmlSQb8r8DQHm9YOFUZTKOzoXGhs6AxF0HIexcLBvWBuiHN8s2ne98R3qc6L4Vyb2oBVjfm9MIFHbjDCh6kPOBbQoG+oW8CO5bWVl6wsDwgfr20PGHh/X/1iaEIuDcCTIW/1Q4rFv8OnYiW3c+W2iKwUjKbyjQNwL1uuR6sAEgDgq1brXOmV81PxhNB6DUDBSYzQJwFtz623XcktX1Q1VWKaTF/zZhVazBVYA1tX5MazsGvobwe/jQr0Ne6BTh5uf/ygoXlAfG60vKEhff/rSe1i4DnTWDUACY1guFTDqLYdCBvf6DJYSMYATBfOx1kLfj1v1axH10nQ3Sd0GUkBnTfpemtBJgseIKQAHLQcVxa2TnuMW0Aqui5es8xBIegVdVVE8VhzHnLh65WMB9An+X18K6aAn2tO4ETl6vqbKuVFywsDwhevqg8YeH93/Rk70JE90nowxZbIJjvS3WYNSGUwGHJTpPxwwcbBuBrgRYBeKACn7VtpdUu/c0NJxO9BIxcKu4TTODzbkonPLoaL0vyUQRb2y8HsL1ckfWzMeuFi40Qezqi+yiPhyt7FOjr6/gCFwgP7Xb5vssTFt7/nQRg6MGRWmDRoeyTlpgw68GRTwgZgo1gGmXAX6/8dtaylSKY/koyID9BhzML3q1gAos2AcOrZYSoq/pJp1VtODRm9Z3LS/7WjVkvXOzEtOpKyGrlAT+4SoG+VY8vBGCvy/dVnrDw/vee65NBJiAjBIVcAJQjOm+DkCZEeiGAMw6sAwDZsJrAdhFM9rPGhd4904Co5oVuCZPV6kD40Ec6+9W8dBTBsfdc3nkpvnB82fp2RPcs79dHgb51LA9ofsDV6vut5/3PnxcAmLVBiDqgevDaJLkYrpuQxzcNwN8AWgIgRbB8loEBzXDwl4cGiDGft58SCOWGedgjvOJ+bPvgRkiuA+ZjzhnQQOiFNVbloa7l/fos0LdO5QENgEXlCfs8Qbf7HyMA3QVjYihYhLENgjX9y/qwxQmRU/asfd0ZcLU2CHVGyusJQLKfVi98CS12T5f7iECkHpsMkAhCF8+nshWH2I/jXsOYO144GV/9ApAIrS3vt4YCfetQHtAA2G+/4PW4/2PPbzMgmUMi2NoeSCRxIt2/FvuxWURIWCXg357gfTjEDNIHnTRXRCpH5ugKwGl3HpMBXQc0v6WLYVm/5limj04rG762K2uYY9jBkr9+rI03NL5ZbczS/dJ+LQyoga4o77fGAn0NlwdMAOy3vl/T938KAcj121z8Bn+Y9eWQJRz8Y6kNagDh2ey5EvxjxQD8TWdAuneCCO4An1vw5vdzQMmdktwq7pLZQR+dM34+ZumAxvY1Y04uqOAJ6FsExzeto7zfAAX6GiwPaLWR1lrfr8n7f/Rl3QGzmsis+/uO71V9OFgP2gpPhgr7TGRqRUT6dyvr4aIs/pm/2zVUNbBSv6G8e5pEv0Cvec7Po7+bTtjlBRlkvAMBkDeQyvsNWKCvofKACYBrre/X1P0/oWEAnnFD1YdjhtXxR73mX10FfCHHE9pVWcGAI/S0gKsfA2y+twrFZw6Hxf/F0Pk8Ri/kpGSnMuDx5T0iACgQHioo0NdAecBUHW6QdsV2/cL7v/Cyqr5gnc42CCOcfX1VIZ/V8We9IDmTzVXwPDJiXuKXPxtDBma8+lzP4WAgKkPxCUAPE4v5GzEuMX0PYJPLhB6FJsc7MAMmkVxaYC/K9gG+F1++8AQ7Gwbgk78I7GFpXgIwFiRXOwaJZPUbiR0yCUDRk+cHf+YpwMj9HgfI8ClGPyvsSiH0WSKRuYlitLb/zHM/JOSs5C/YIC9cMQDZr/dwxgOW9gtGYUBi0wA8l304vDQvAchilFbpIBQhZ7Ejq6ZQ0/Yhil8y4j89Axie9DAsD6FX9HOK3QtROTFkviN83kG4felIY8DCeLrSeMDSfsEovAECUFsTjHD+tcB+tkFgcXKvBRir7qtFl9owmO4Xy/1G3bAFfPrZHorFNWBFwHjQAFctIghj2kBarw06If/+MM9ZqTN6DgsDojCerjQesLRfMApvoGkAWh8Ob/tgAPSKWCp8ngNQtadjmTdltvNvn3peFYhgQQgh+iUmEaUAUoXM1yRLmWuFLaE9Z+XIAWBhPF1pPGBpv2AU3kDTALzwmqo6qtVh9kJErAudABia38TC5wJgS2xIhAwBn3yhByL4EhzXfRXxYsDTJ4IvrNN2JFMxZcBzVo4cABbG05XGA5b2C0bhDTQNQLZBYH1AVsQSAAU+imI1obHyblnjG/kJk3U8BHz8xVUQAhnQIl5CyNgKAGp5LKSSCoAySh5Jj79vTagcxUaIBeRNe79g9gq+DXig4wGzy+PONfT7RWFA4noAkGXZVAhcBckJQgNgrLiaNb3paIDo1vHHX+oA9LQBi4DxJcOUPJUnTgU2NJUyROs8irGARxQAC+PpCtsFd40H/AEf0gMQkLgeACT41PiGoLOKqyrJq3K/Ya9mNyr5FusN/uPLPIeDa8Bc+w3rtyl4VFHaMZc3i9RWBM9jjzgAFsbTFbYLRmm/YBTeQNMAtD4cBKDXBTQGdAB2MGBo8SCLmEuS1AFVAJ3A/NhPt0PoCcA8bSDG76XI7aySg6JYuGfKwJHFgH0E5B3ueMCe/Y4L+xVHAOZ+9EHcEgQgwbeiEYx6jwTdz4qfu7EhEJqxGqruf/RnHIAEnxgwBM0aC8aUAYWNBRCmoIll4HTqO122QcZbrgMWxtMVtgvuOx6wa7/jwhtoGoDWh4MBJ16WN4lfr8AqI0TVV1O1fa9BbQzovkAy4Ed+NgCQUSxZCFWvCOaOFREXyUwZOPIA2GdA3uGOB6wPaOz+QPv5S+MA3OXiN9aclghW+d3IgupBF2pPqxcxGenDPxfSRh2ASiKKiVP2PaZScvAKoA0VDc6cOlIB2GdA3uGOB1zR77iwX/F6AFB9ONSOQW0frA50sILVcckWJyIDSgwPAVcJgFbYuZ3FJvAlEHbJ3IsgJLGedeBIA+AAAXmHOx6wo99xYb/i9QKg2iAIfDJEJHqj4SExbEty0gkdhB/6P9oZbBZIGiKYVb9GKaN50lRHBLOvhDxh/5EKwDUG5B3ueMB2QGM/grb7/6wHAPNGMAY+GSGUjC52VX2f2CD4+HO0gqkZfegXKgBaHkcWtS0AWii9xG1ImrLlN5XR8L8fmQD05BVrmEENmpYSP9QX+KHiqj2/82+HqqDWwnbBRfGATdzAegGwru2DpRq7Mzq2fpAf0Nq0Rl2wBXzglZ4yUAPAmDSVWDBPHQjLcgTqOZ6zUvdKHh4ruDCerox/Dnu7YqwXAC1NI/QcEQuK6WK/kdgCTGC0PYAP/KIDMBgglq+hIkrOfsaCviLSofcJgJ5AdM7kkSaCj/HqQKVIGvD4swF8bcBjmzjsaQ2H5D/6acBd9wALB4DFWWB5AVherMp4GKIYEOp7+26UF0aSfT/xYuDG7wDjrIpAERytXf2vajj7ueryQXSFl10K/ON3gIWDwCLvjfGB8Z54O+Ee4ve6513uB2R1yzsqC+twbC8HcNVhfAeaBuDP/TvwtS3A/ePAIfYFVlPq2HHTuyulZCTlhbjhETF5yxTQGgPGhoHhIWC4VSXGD3n0tLkMHXHxu+YyB+MlPwDuZs5K6FlsbCzdVO9DuKfkHM8AEkP7B8fOkwDcD+B7np42+JkGOvKdAL4E4K8P0zvQdET0b14D3DgB3D0B7B8HZka9WzrD88N6sFm+YcUjrn7E1ZDvMtF9DBgeAYaHgSGB0PNHCD4BLwLRsByAyX/ij0/dDUxuqlIG5hix7eFhvLcOVUAtyPSydAFmOQNe6EYGV/9ZESiKgIEgtbaD/gHALQC4ovY5r5KwtjOU/XfTAHzzLuCmIeDuMWDvKHBwpMoN0WQzNtAaYSs0K4ZlOSAjGG9kPjCBRwZ0ABKEBJexYAZEAU3A7Oi1BeDym4EDnjQ1TwCGWMW8MXcKks0YOyZNlQOQjcgYIUHllEzYQ0ktm+r6oz8G4F4AXwXwRd8/kO9A0wB8y65KmPxgGJgcqYJTKYpTv2CCzyddQJRDOjKivn+Deh8BF8BnwBtaCUA+YYEyAU8h+c6Az9gNHHRmrgOgmDA3jHQ+iWupCeUAvNSrA9HNwqx+muk9nJVNg/CTfrmbAPwbgK8D+PcHkIibjob5o13A3XypWsAkG1cPA9PDFQDZM1id0i1KxsWfOrKnAFXlifCFFMMRcASigOcs2MGAIfE9iWXplS6On7UbmPaUUTXQrgsVMzcRj5Folg2V5ayUA5BWYKwOxKUafnosWjcJwk+7W5F2EKvlE3xcXaNYfiCYsGkA/smuqug6hcleAnAImPbO6YwRpMgjCAVAm/yQmKTv5hNsAf/i7SyNBSl2a8Qv/4/M1yF+BZSYlNQCnnVrpbC+mToAACAASURBVJcaI7sOSEY2NpaDXLqpR+vE/OVksDgImgGgghHoYJbTWc7oJtFWc65/cg2AYvh2ALsB3AzgVv95nS/f4QdsIkT9T3cBrGtITWZfC5hqtQHInsEGQn3UDDvEDEY/ICf7SxMOrAg8T+c00JGkvHGd2DABUYZIAONzCUDppCFhSukCBsLQrFtZe/IixYQpSyEoJoqnuPWrVRAubQh83HNlZB23z7j1ywmj6CIIqUPxw2Xeu9bx2jx10wz4Z7sqTYZaDD8EIDuoE3hMVEphWg66JIp90k0sBxBcy+iPIIaT1RtEsHS/yIAqw+VSNPWQfe5tlVEk8auXgVa5BUsEJuT5uoliAbE5AGotmIAjCPnR9xDG3TQernYAUupTdBGEFMf83OkApHG+XlvTAPwfuyrgSZOhas3u6cwTsUBVn2gTwyFMi8wjHZAA1M9fYGHDULJD1m8Cpa8fRxDad+l+Ykf/3XNvd11U+qiL39SxXevSsshdDFvgbI1O2AwAtRZMZzTBRuDFjxe1Xg8QEIB8yyj5yYIUxfQIkfkIRnmHCM712JoG4FsdgHHp3ACoMH2G6jM4lWzoQarSvwQ6MSB/vporVaFkh+mCLlpVR8Z+dqDZLoDOpHSiQeAFDkBjPrlgCHgCUaFifg67H/9uYjn4Ai1vpTERTAASBaoQJBAKeNqHlL6mwPDZYAOROag/EYRkPX34MwHIvzW9rQcA+TLpI22G7EcQKlJGsYIJhC6ClUMiXfBTbFUQAej6nPS/OuAl9pOOqIc2BLzg++3VmWgIEUz82cRuCAtLIHQQm0gO52uOAb22sC3JEWgRfPpZf2sQBQIgLydPEIFGwPEj8MlF2bSbsulghLftqsCXq9HGgHysznrGgi5qzTUTFH8FLhAUn3hIJwCN0HLncw37qaF2zoYvuKNivmQIuUNc7GvWt6sHNs26twA6vhyq8NEMAHlyntFrDCcQehyaPTl+FwAbXDcmAKMRThakEk8Q8kPg8SPL0qzLBl+A9QCgR6uZGs3vfHz8TtBZvkgGQrEPBVAUg2Sij50QAOjiVKI3saADJRm7dSLYWfSFDkCem/dhZeMy9pPY5QvSDYQyUJoDIK8qMezh3wY6fSL49PcGgCAA8pScJLIgAUYQEmz8RPA17StvGoBv39W24eREiBoNQSgWNI1HBkdgxJSw1AI+dFIbgOYmkjimQ1r6XXC3rAbCHycAgytohf8vsB/r2KRaRq7zpZ+D37HMX0s3DDcCUGLYaw53MJ4YUODzusqlGCQAOQCejuxA8UULUkxIwAmMAp8Wa3qkN/R9W+sBwOhIEPjk5SLr8HeKFbTQfb77csPIMHGl/4MPbReslPhNe4+MiTpi9AFGV4nI7MfvagNQLh/pfrYnDAS8aJQ42A2w4em2cAyWQUuJVQTGWLs1uL7DG9J1RjhA+jvYk4t3KXeMqijpzrud4At9z3XtP16yGfjKZmCGooYh1tZzvv8xXPFl4PoJYC97k9FlwZWD+Azi/deMZWeP13eQCGEyoERudChIjbb3mJYwH7V0QIKuCwj/gfMj0asn2I0FXRSHXfL/iRkNgLyeVj8ccMY//J1fyxzTAXT2+xoQViKYD/1hDqLxPiYxTgSvQrphphG97tz4Slqafnj7uk1kIQDZrvWTw8B3jwEW+RLxPgSiCERdPwPR7+wCPg/gulFgfruDkOMQkFc5x84e708JAMmCuRNBXi4TIg5CGRzGiBGE/D4E/C2r2vcAYJoify62i0aJSMhB+2IHoNwu0fkcjQ85pu3ack5nIBREqneYFyWLkAXIJHESe00Cyx5QyeL6F/tyEcDcrOW2n7fX8df0mME+/vQ/PQjhoy3gzo3AISYf80MQaQx1peH9wb7v2mrtmCBkIMMejp3jIJD1MsaxaMZ8v5N/67INAsB3BAYU4JL4DSo1J15AFPAEwuQHZJzkKfUAtOHLJSOQRWndBYQvCQA01cfnNopfsaCJaD2baBn79QjSTiOEP1EcawIpkq2kegBTNgHWEpOKF8Uwq2NRFPM4AqCf46/rA2U9/uVDvurB01zvAJpiiwOl3fEeciCGF+Ij11f+QkbSfMPfIzqw57mEFZ9Dl3Ps5HXWAYByHJAJKV7N+s0cCQQhwSlfm4lGZ0KB8C/rABgZUS6ZHITBSEhCowUYAAksF7cStWREyxRwtuPpOlgw+5s9sq6OaIJIIlUgEhA1edoTgHxa9HVw5jibZNF+j/9yGQA/7pbujZ4bwv2+cWB6tFo0NzYnkxFA+cvEAo43VBoEo2e+48EMXEOmD9F6xhCE8RwZEJ80VblKvDlmzwicfqy93/o+8K8TwB2jVSgW138FrJQTXBNlnJgmrjZwanow9CBP/rL9wF0jwAGWDtFyoN9PHutnIHT05mPXz93dMGQAPniJsjiBXiTbxDZFMF9NLUPQxKR5qezz1Y6/YZDH0D6GkdAkYJIvRalAdHAMmPZoYhb6NhDWvEyf/ma737CXN7R1ZC7hUbPgcFgqt/ZZjADnM1xqEVhYBpb4CUk5UsL7jQvj///5buDrLeCOEeD+YQchYwG9VIfyg1NaZszFiCH6DkRGLze5/dgk8IMWcMCjdCiCzR8od1B8OTwvJM8JEShFut1fzMhi+eRJr6LI7hYP2M/xVLwKNoZjUTwRMAQQmYyhWGQxsSADOflZ4kukj7PhZ75bETjBpkAGahMkcrGgwhsXeCyBHBj1wmOBQwvAwqKzoFeRV8ZaerjKYAuirmPY/o9X7q5Cyr7fAvYMAftCPGAEoYlBiVtFwLjtp2U4irj7yOANbi+crHyrfCbTquJV44O0F1FrwQGIMZFqdQDyP/gGSZ8TC0ZRRsOlVzzgasd/u+zpMByLehAfCgMQCDyGZJHFCCgLZ2f8mgI5qauEcVx9e5vACTgCTwEMWr5TdIpWKJb5MvrnoocDswvAPAG4VLGg6UKeqmi4iuDz4er30oX0FP7u5moMvIf7W8B+jwlUNAzFnlZCIhvGFRCeWzrgXSSIBreXTFZSgVLHAp4UHOFuociEEsn2PJwl/XEk0dzfSojeerFg1IOo5BKAveIBex1P67lgUzgWQaJwLAKRH04i14ItgDKEtGsRnWx49b2Vkk9wUefTGrKCF7R0JxZMqxN8cmPAxWcAcxGABKEAKPA5u9lEaAbCmKMI+sDN1X3z+ro24wEZFc0VEE64ABgT180PF9ZdBcDb6JpqcPtPk+1ACbmKjJnllwyuILunEAWjZHkBsrsRUnfD0qEiC5IJfyisgMhzWhcP2O14Ro4WbASgAMQJ48SJwchmBCDFa8qpyBbSP7OvU4PQ0p2W7+LSnSJUFOrI4V7w5IoBTQQTfJ6oTSYk2mQcpGRyH2syGjIF6EM3V/fM++C1CfwUExhCsmzCaQT43lZC3e1hBpEHh36XEqrB7Scmq5dV0XZxmV8WuDFzAF9iwhow9seAGoBcGtKjqAc+1l9rLb/1igesO55ysmCrC8ei6IxRMAKTWNBi6Xw98xNTFUi0jEcmpYgRAPhddpVi9OIEPP5cYD4CcLkCooHPwaW9kV+iwWrQHT8uA1fd3F7DFvgUHUP2k8jTiogAqLoxFpDgbMj9jXSuN7i9dLIdaxzBp5XVBMIMgFEnFAPKT9qPd6A9BIGI7MfPmf4U+40HzI8nWgq2PBxL4FEkjKJixGRRFyQQPzzd1iAUzCAQas1YOmAEoFjwkecDC/PAwhKw6CxIkCXwOdVJLxTobMjBdyIgfvimNvNJ7Evf4jWtdnRYD1YNGVuG93VWuWs4Jf+mlZCCZxwP/cnJ6mXVKk2+tK8lQQVHRTGc64SDAZB3Ey3JcxyACkToJx4wHl+YwqloGDICmYmTFgMQFBET8yyYzyAG/AfWX8mCGQg0BTRoHwt9KVaPE/HQ890AIfgWK+CRAaMRYnVdxHbhdY8Wslw1V93UDsmPIj9GxgiAioRRMIJNvoti+SW/Ikd0gwAU8+XxJcbGITJPDvI6XdCFREFSknTB83xka40H1PGF9dnycCxFwygkK0bASJQSVAbAYeD98xUAe5U3jKIwBosSgNsuABYogl3/IwgFPrOIg1Xc4ZrpAsSrvruykl2ucykapkMMh4CExD5DwJfWAYAxwk4MKPAJgOIjGSEGwuCakRhemw6Yv0UUwRf7L00L9pnsNx6Qx4feY4O8pDEcixOjsoTKKpMYjSFYYjOC8Eq3Wnnr0YYS+0Tmi2HysrPGLqwASNYzBnT2Mz2QD91laxLB0gs12GAh81cf/o/OcHyJ+qj0S/zxnhUZbSyYWaL8+Rq2S29wowiWkJPan4MvgrDDGAlRe7KIywDIgR3meEDWg9HbJgApNTkXo8o0i7oVgxnEgFr8F7jEdnU5GvqfJQKQKyEOPlsNIQvyvupAGHS/Okv4qv9oh+PHxMLk8ggBCRxvAmEN+AiEzz2iQfQBeNmkh4K52hJBKOaNe/FSLobLRXCz43rQnu2yi9oMSMDxs2jo8303ERz1wsCGZECF4kd3DwEYYwJjhoNlQrgIjlYodbBPrwMAZfEmyzcIv27gs6XDzC/IR1DOgA9a6DRz4wZAsZ+LYXvQYsHoD4ziOFklna6YD3+nnU6dZ7bGDAcBUImIAmEUw/zbJ1i/scGNDJiLXmle3RhQ+l/aq57gUQCWzwwBKPeLsZ/LFrGg/ShRXAe64Ajkv30kALAjF8R11Dy3K7KRwJcsUTaqWScARou3w/INVnCH+A36n8RvM3nB5XP4oD6DATBYwGb5ajlOLOh6X8JaBKRG77+7ygGYp1bn+V25/01AzBnwQ1ypanD7KWfA1QDYC3zJIj7KgOUzc9nFbetX/r+O5biwNhyX5uSEDr5o0xsJwLp8/m4A7GaJUv/j3/5+HQFYJ3oFPPkho/hNeqBcMkcB2BAA6XrxmMBkfFAci/m0JpwzXw0TXvXtzrz+PKc/Ml/ugzM9MDqCAbz/keVjjGcQA/YLvjoguo1mRslRI6RwfsiA5nqhL5D6nscF8gfTdfxpS+/hLzvWfzMQCoB1Fq/8b3VWaPIDZqsRV64DALsZHVHs1gEvsqFAeBSApQC8pHK90Oql4UEAyvCwNeGcBXNLOPMLftgZsI75ouUr9ousp2TEyIJ/sU4AzC1e+WIFshyAHPZREVwItrrD3wGAhibTYBhxVpe/xePyrNBuWaoNp3DgFwC81O+RAepK/a5Lfe51jxr7JwA83nPXYgq1asl0yX5N48+f4VEGLATlK1vAo5YB1gBSRmsM+NFE57lcfPD5pPFWCJImtyvGgGfOAacBYO59zFglgHgPefZsXV6/gPXBYeC0RVgyJNOGYuJjPka9eHWgjL9bWzhWk0/n/wPn+k8bgFNmgYcsVflZnBRmIShtJM/m7JGibGBoOIIez9wKPP4AcNpylfbNlGfdI+9NjBjz8JVzppckZuJ+dBw4aQ44drk6j1LIY9JkPD7P4s2lwVEGLHwJnncscNIh4Nh5YMsSsHm5ndOu1BGFThJ8/K6JrZtoslST2+XHA6ftB05ZAE5crgAups5TfaL6EF+UyIif3gAcOwtsXep82eIYY9JkXpMgMp/AeZQBC2b8OduBYw8C2+aALQvARgJwGZhY7swEzbNa88IRvAVO1qkF91J36DNOBE7eD2yfB45fqphLnevzdGeBKBfL8UX5/CZgyyyweRHYsFwxYHzRNK6oetSBMDLjUQAWTPqPngpsnQK2zgKbCMAlYMMSME4ALrcnR6JYQIwsoUnjpDRstOLy7cBJB4CHUGwuAtuW2nUDVH1EFUhycSwWjGD64mZg0xywcaECoI0z5P3X5P6nWlHdgHgUgAUAfOYOYMtBYNMssHEe2LgITBCADkIzSJZXpCOnIg25uPrhgnupO/TyhwLHHwSOmwW2LVSik2pCrDsQskzNIBGIpBdGI+VfNgMb5oENCxX4yPRjPj4xaJ0+WGeEHRXBDUz2Mx4FbDoIbJypADixUAFwzAFI8KUJChMV2SUaAGc1cE/xFJef3FYRti64nkqWDrqqEhbrsm5zvZCdPCd8nHzJOLZuABRz9hTHZwPL7LnLnoNMIY2VyaKcjtZLHOAbNgNPngKe4BacfGF1pnydD+hphQ/8XV5UiEueLGnDN1tWXj/3/4cTwAUzwGPcRcFJiDpPt3FLmf5vjwE2HAQ2zPrEzDv7OQg5OSM+ScYQy5Xbo8465u/ZfLTJ7fKHAdumKxVh8wKwealSE6inEoSy2MWCdbUHIghv3AqMzwHji9VLZuDzD8cXxxWZs5c7apmW0fMBnIHKn5X7d6I5npvRz94O7LgXuGIReJSb+Xl1tzqflybwRwqf9i97BQRWomWJQ7oZVFtJoqDX/b/oGODsvcBTATB9gsfGqmzdjtVz+G+PAyamgYmZCoDjFE2anCVg1CeJwOMnTRB/DmUINVkkgia3y08BtkwDW+YqAFJFMD1VAAw6XG61R31O9/fdrcDYPDDmY0zjc1UjivBuAMx1QdMB+WAYXU8dhEU16dOSkppbcHFSrng8MHwnsGMPcN5ypURHp2xMIa7zDz2z8Gn/kVe0YomO0wEwBYKujL7v/zHA6C3AxfOVh58g5AsZxx4fZM7sf3h6BcDxWWeGBZ+cMEFiwGEHHRnDzun7ONHs/djkRgBunql0VDOSHIDU3cxSD4aEajhFXS4H4S1bgVGN0V8we7E0Fh9jVDG6Obr1LJMRwn+kOCaTEYT0dsfqZHXl/p7PrLi9wIY7gO0H2yAgCAWCWCowKrYE8nMLn/a7PQn9X7zIJPPkCcK+758y7x7guNsB6l98gZjLLYet3Ay5n0sv4R+fCYxPA2MOwLEAQLIDPyP8uBg2cRYmzFweAYilKkn+OC8/Fdh0CNhEA4nGA40kd6FES13WLO8v1qHKAfh9B+DoYjU2Ak/js/8NAIwg7OUb7LCC+WAfB4CpBJoIiTRNRmS1l13kqWh3Adv2A8cdqqp1MB+aIOSxWv6pq5D2kkIAvt8rF7BLJksN/jMqfa7v+7/Ak4B3A6ceqpasKMq5akAmlLWY37t8ZW97PDB2qALg2BxgAFwANEGcnI5JcrDZRPlkaXL4u1KJUAfAjbTQ59x6dSvdLPXAgGYshZWR6JIRaXB/NwFI8C1WwLMXzMeSwLfcXuKrA2G+wrLCDcN/IIg4ERRn0qvyySAQX6mG1XuA4fuAbTOVwktRRr2MLCoQyvEZ/UY/WwjAj3jtFJZkU79g1ghkgEBf98+0Umb/3A2M3lkBl/fOcdMok2EjkZyv8773LAfgHDDKjwNwxEUw9yailpwdxBAEYhBbAuGzG3aKkQEJwAkCkOCjlb7Y6SYyf2UwlAS+vKYnAXjfNmDEX7DEfA5CjUcsnzvbu1nDtUMmCDkRZEEyGdlAk6G6lQTSa6m0MP6HuY73AxNTlcJLZ6WOJYC5/CNxLpHMgdKIKNl69Qvu6/75AjHOiTU87gKOOViJb748BKCWrnK/maTA+58AjM0Ao7PA6Lx/xBAupoYDC9okBRAmPdBZ47lNA/DhwMRsxX7mPgl+SrmK5EaRNRslXFQ9CKB9DkADn79cZtkHFkysJ103eBbqlh97DpmTQTYgk9VNxu+xYbXKU3lhFoJPOgdFGY+lPkgQxokkgF9Xgj4AvfoFs84eX4Ke9x9fIC+tRfDxvvniif358sSir2LCj5wNjBKAc8CIi2AxxLCzIAGY9L7AhGIKgpATw4l8wToB0JjPrfTkp+SLQbHrOqm5jNyajS6VCMIpApDAWwQ4LrGgXqzIfnq5cv0vN0ZXHTInME5GBNLb1DGdOYQsI7AfGKFjlgqve8wJwG4T+fuFAFytXzCLb+VgWnH/fIGYfc46Hs7iHC8ZkPcdXx4VfVXJw8+cA4wIgM6AHSLKWZCTESfLfg7WsIyRF3ckiRQ+HACXkwHptyP4KHrpJvKVGnOhRF9eBF9wE0mUEogz2wC+WGI/vVxiQQIxAs9+rmHA6E1YFYB8DJwQMZl0OrLZ++i7sfT8zroYHLS9df4RACWKxSZvLXzG/fQLZqk2gqn2/vUCUQ9UZaM9wDaPeSPrC4A5C1KV+NITKwCS/SiCR/jRBDlLmP7nHynsxno1IPwJSyRpbiMADXzuPDYfZfBTEoAmcuVQdiaW0zwXwQsCYDYmMaDA1wG8TBSvaoR0G77EcGSET6hjOvVApfRPAUN0zjr45JzVcSqiTxD+VeGzXku/4Nr7JwDJOkxFIwt6j6+RqUrlkO4bXzp1gCAAv04AzgLDDsBhKugLFUvQUhTwCEKbnKCw14HwJ9cDgGQ9WegRgDI8XEcVEDvAl7lVlglAgi+I4CR+Zf1mLGgMmDFhBGFfDCicRJFERviSABjLS7FC0MFKMU+07wOPE0kGvaoQgGvtF9z1/iODkwn3VWoEXxres5ib9xx1wZufBAwLgAQexbAD0JiQwJOuJBA68/H3Zhk6+3CifqqwWNMKN8wjKgbk6gWJgC+FMaBb5vJVmsUbV2vCqo3cRWZcCIACoax53+ulkqNd7iqOcU1WcC9cxEm5kQBUdZ+sTnSL/jEtTWngi21jhJNJBivZBukXvOL+yYBkcOqxKjJ4AGgxzMrBVwdAMmHrZOAYF2l6y/mwV6xD17zmWo6MbRyeWtOHwxJ91IIhr6rqZS70DPPLXDVUrfBwzHKr1EUp6/h0T/6L/GcCqslt4IhoTcwdAqDSs7I60WQH6R329pHuFyuXDJmEjuOSbdB+wSvuP5bGUjmsA5XoUvcvBXKKAQnApUdXwah0b8jXR2YzJTsC0ZHB33FL+2yiX3h/1YeD1fFZGT81g/H6yqkVa9YEpqMhTADle8erHA6t7Mh6j4ZBXdBGjFyO4CSIm9wGBiBvgqxwIAJQlXIyEJLyI/i0SkAG/FbhaEr6BXfcv+5dLKhCg4z1C1HEBJ8+BODQGZXfk/quAZC6ketAZEQCTWAU8PIJt0fgwHzZvVWNaKqi7JLOmtDWFy42g1FxH/XfqGkII0C+a0tnDkfsGxQjn3VPsk7tXmuy+Xp0JhtoJosAaFcUAJUYKiYJxcqHqKAH9rPlG2cMrmCUbMX9guMLpGTcCMKDlZGhMK8IPnPIn1X5PA2AwegwEEYmDGBMjOI5whGQP3NPBT7VJlRNaKvF4t2IWHbDErtDlSk1p4lJ7/zd246tglGZryIfrFhQ7pU8WCAX0ZENG+57U14Z4YrCeLrSxXdev6TfLwrbxT7znMrfKQXfHLQCnyvmRIv0Q3430ezMmL98P393G3wqz6am1NYzzoGn+svqRmTAU2citctqAX/2EI8F9ACEmLHXLZGoFxtSl2xyK2bAYwrj6Xr12+1noL/jUTCD9vvFrn6u0v1/nvGkaoVBAQi0eummMAuXQHMWJAA7gCixG8U0gFfcXdlBKk4Z6zELgAJfZEKrxpC1xOIl/+Sk7jkcdYlSco90y9+gK6vJrRiADD0piad7RuFo3udNCgft94vCdrGXn+tujgV3QAcHLcFnroelivHkchEL8ue0uQ74S3eubAITS3IQhKkMRjBMokgWG3L//2z3VSnP4VDgQWxUEEUxAZFHL0eR3HDfm3IRbDHkBfF0zy4EIKNhSvr9goGEBdvTz/MIYQLQdVsTwRTFDj5jQmdArRDYJQNDSs961R3tPhx5NXoVgoxleHnarjohgLec3D2HI492yQNvIwvqO9fJm9zKGbAwnu6FhaP5pFuMg/b7tTbpBdvTz68cz/zI8azVj8iAHTqgmFHXDUB89R2dtaC7tUGw4kDOgFb0R2wYRDGZ8g9O8aU4XwPOczhiwGlMjqqLWiFYGu570wADFsbTvaxg8nkow7E8nM/atfKzln6/1mS4YHv6BQ4+Z0BbqHcd0NwwYbVD3+1yWhXJxPBrbq8AqE/XApSqAxiBV2MZ/54DMOZwKE00rnDUWcR5KiV/brjtSAMALIyn+/mCyeehjIYp6fdrvVELth8RAClyHXxmhPi6r1m8FM0ucgk8+y4RHC1kAK/5XgW+2hZYofafWcPq1B5AqDqEYsQ3nepR2gqhV2yiol1COkD0C+aOaoGx4aL7DQCwMJ7uVwomn4fm7VrX2u/XAlELth+5sHPtN+l/Ap6sX2dCsZ/phZkIJgv9l++1wbcq+2WFv2NXIjNKAPzuw7MUAV8DTuynFIEsQy83RgTAhiv+NgBABaQOGE/3mwWTLwAqHnaQfr9GnwUbARgDNBUlkpzQboyYCyYDYdILdf0l4NduW9kGoa4geNdazLElKoA3Prx7DofiETtC6XvE7hGEzJlpcis3Qgrj6d5UOJoYDcMglrX2+y0NPtl5UZUjkfx/Hqbecoe0OZzdF1gHQrln9Bhee4s3f3Zxm4MvAk9VSFdUIw0i+Q2PaBtISiBSSFgCYMjMW00MP7pwvvLDmwFgQTzdHxcOSGvBg/b7ZRZByWYAlOERluKM3Ra9CKWc0q73dTBhMFT4ZwIw9l5Lrpes+HjeBiGCUOKXeuBvPcKTiEIOR0f+RhDBMYi0Lhea4GTaa5NbOQAVDzhgPB1La5RssV3rIP1+7yy5OAADoAchEHBkFbKfGRpiweAPtMs5IFNokyOGk/7rAYC9OhBFwNXVY1at5tftCBHaWVS2AJdEcEinrDNC+Lumiyc1B8AB4+muLARAXTDCWvr93lR4/Z0Xt6ODFQkj8WtumEwHTKDLQejAfN3uds/dfjoQdatGLxb8jQBAYz6/boxiFgAVudzNIc2/s3xLk1szAORoB4yn+2DhaATAGJCtbpkCYq9+v4V+aBgAQ4i66XtaC85YkDog/zdZvzUgfN1N7a633Xqv6fe9msDIHfNaB6Ay2JRE1AHAEDIfI5nzZCLeN4Nbm9yaA+CA8XSsul6yqV0rJ2WQfr+splCyCYBR/HJyKX4phs0PKBZ0lqOYTpvniAiUAmAd+HKjo1cvDjHgr+3wPJQsVCymUZrPMuRsRBDG4AQCsunyJtFGHwAAIABJREFUcc0BUJlxQoH62q8ST8cggpKNAFRGwCD9fkuvbwAkyGgJE3C+Nz1P1q9/T3F1EZBxvZh50s6AEYC5yyUHXt5/Q8zI5/KrAmAIkkipkyGPYwXz1aRT8v5ZO6jJrRyAvKOvNXlLazsXs9bo/ztc29Pohgotp5J49Rcj/pzfIwGS//3OM4CNd1dpntQpFUmjEH4LYIgnyn/OLjL8FeDGhwJbNgFjI8DIEDA8BAy1PFK7FSKf43cNKrvHx+8C/vmxwMgmYHgEaA35J0StpvvzL/nP8RbLAfhyT207TChgDRiu/ZL9DsfWNABvYzbhCDBKoBAk/pEobGWTqp819hzQ1/0k0PoaMDEJbJjxVZFgDad0SaUO5LksWVj+XScDmw5UEUDJ6U4d0nVbC91S3ovfVHp5al64cgC+k7mZAP768KCA0WD3A/ieLz090CDceVmlAuhBljLgrfcAw6PAyDAwPFwBkCAbItM4a/FiNtERjBl76W9ffD2AbwJDdwFj+6syImRXrd5Y2FjIYcnzWPLEqnsfC0zsr6qBMQmfIDR/pyJ6xMhKyMrSDiKD2xja6TADTt0/AGAs1KcAUCFrOLF6tbtiRVFavT/wuMCa7MfVTlH098YBeBcwNAIMEYAUlS4uBULOmK3LCnwOPANlEIOSoF9+C4DvVoWXhvdWZVOYqWgi3vOXDUQhgieB0EElViMYJ08HxqeqnG8D4IIDkAzo51DKQQJvBKUmKACzbM4+5hUivwrgiwC4LzvjmgCh6nBcgiMTcv9Abo0D8E6g5eCjfpUA6AxoQIzgi8ALmWwC4z//DxcPPwBak8DQFDB8yJPpPZHeGCyC0KN5DFCByfh9/+OAsekKgEzCTwD047X0SCPM1IYQjCv2E/MJoGVwUUQoPboq0MdqkWVn7RtDDMahB4g+P6qhXFpjVtkDtRGA2nKjos7IyOyHFUbIrXe0FXsTuzIYfNb4O2M3ATGIYQOmPn6hG6gi3eUkQQAeAIYOAUOzALMVh2pAlESqGFBAXAYOMQVjxll03iO/yYKRAT0FQXkwZkjp1pz51LO2XAT3KtD3AIAwj4Wg05kfiuUHYlsXAJLVnP0INLM0OYFx78AzcRySeTsw2AJueI+Dj2Fne4EWKz5MA0MzDkCCkAByUWqsJzarEanzj2zXwjEGFHuGY+pYsMojzZL1G9EBexXou339IRBrC3lJGmNDuSHX+w7WC4Cm6wWxm8DngLTImgC8pBcGBuTXf/1fXnyTugnFwxTQOgi0CECyIFlsvvJfEnh0mhsYI/s5uxFYi1xZof7oOqSAawwYjRGBzYGXbtWXaCIrlvHUagX6SP/ruMVYCEbEqECXAMjfree2HgA0ESur1/0vtnNwGSsG0RsZME20/+/XWH6Mugk/yngPAGy5GDYALjiIHIgRUIrsZjM7Ax+BSx1S4pfffQVIep8dL7dMDsTGjJB+CvQxTHmdtrw4l0CovFruC2NOe975egDQsCXRK/eK634JhBK90q2C7I1i+Gt0jxF40k1cPJAB7UP2m3MGJAAFQrGei9iUTH9yBUDTHfU3B5+BOIKQ43BWtNtPcWIOzEZE8FoK9K0DCGNxLi3FqaKA9gTgeoFwPQAoI0OulWT11oEwiFz7cwbErzNxWtEYBB+VY76Vh4DWrH8IOoGQ7Ocg1CqMRLPltmxvs1/SHaP4dcAJePYyyUCRIzrTB8tE8FoL9DUMwl61kQQ87Rmy2PS2rgB0a1ci18RudEJH57OsY02y/+83/sZdBKr4FXQTApBvprGgQCg9UEAM+h9F6ugJDkC3gJPBEvRGrYoYCBX9IxEcS5K4i6cZAHIw8oXQ4mLBb35YH5d7OekadtTV1UZSjaEIPH4nQzYNwgjAHNwDuWGYpZc7lzPfX1cQur5oBorfzDf+zi0yVTuSkuxBI2Q+PhQDIUEnMLo1TBCZLufGw/ixbQa0KB8CTODjPohdY78IQmfDjmW7Yo/doAX6GqIiAtDHaYswSmeMubV81kp11L6hy2PdAcgblfslOKC1IiKRmyRxZgV/8++DS8BFrxXi5Hd/U6MeSKdqEsEKhpBRsgRMbAtuG4KU/+9ry5brzP/lPVMv1EPOQegharrVcgZUhVHFxNPcp9VFtlOWkL437C0WABWypFRGsV0sb5Hn2zYBwvUGoKl10v1knDgo0y7XA8Pfv0UACnjaK33Co9gJQAOe64FkNvtZAHQdjz9v2Nz2GSa3jYej2W3KGuZ9ixGdIVSoKT13B2s5AHkGheST6qn0erHv5AIgAAU+LVfw/wq3CEAV7clBKDDGZG9/5oVXx/oyYARczcqH5GyH8eFplTawFvAtrtXLGpNrQDGbejupB3omlIHQGc/ErzOcGSRs8zrhAbbuL1Tco/JfbLlNwHOmi2kIcs3owbdwNpYtynDQhsFcgvuG9/YapGFvYX22zZcAU0/GwA2LJ/4AmGF9mwEbBu98Y3cMF+uAGQCj2HVp3BbPuo3IlqxAy5wHAq4OfARmEBXGfNIBa0BIsG0ecwC67merHgRpZLwocrWaovuTxew/V0txJQ2DWeae3WAGbdhb2DB4+wRw7w5g8Qpv88liyGtoWHzMi4C9fAEHbBi8kwUKu2xNAdBxaGBLbJdZux1LwAGECYAEm6wyfpelJrEgFnRDxESwgyUxIUsVMwjVy5AYO0bG89Auu1/5BF38KqjBHlUAYXsteNCGwTeWNuwtk4JMkrlzGNizA1hm69g1Nix+zDOBW0aBeRZZGqBh8M4emfWNADDT+zqMjQyESdQFHfDbZECCLRgdHeCTe8CBaKJY1rDnBRCIAuGW4TYAZeFG8ZuMkGiQ1IEwGCJtHZBmy1obBsvVMnDD3jIAerti3LEBOMjGcOpa3WfD4ic9t6oveDtLfw7QMHjnH6wPAybW6yaG4+8D4HIQfvtDIVtLejpBFsVvUI7NIBHw3DUjRzL3rDVtsYPOkAScuX3coNDynT2VYJCkn+PjqvUD8hVbS8NgjphGxcANe8sAGNoVY/824BCBtIaGxRe8pLKZdpMkTvXiJ2toGHzSNHDPScAyq3er4qPyGaNc7JCRXWLT2TjwGmCOeQashq6+qSpZmp8vojQpheF58ncdZVjLnjWPHr4VWKTKxrHGUqq97qXu3jp0wPy+eEC/DYNZsZAO6IEb9pY9lNCuGPcNV830ZmkM9dmw+OKfbdcXvJMPdY0Ng0/7GnDXKcDMccBS7MwdKz8KCAKQIgY0MWGCtr4TOHAasMwOkTqf6unyuLykfd254nkb7qsw/iVg7jhgmSX31Vpd9yRHeLx+zRhjEGRbB6wDYT8NdymyubzDzCCGfpMJWfSRYfr9HP/aMgBm7YoxNQHMbQHm+ID6aFh8yS93tAvGQb7da2gYfPoXgbtPAqaPA+a3AEubgGU1RM6B060fgkRoCzj+TcD+04CFE4BldZdRc4/YxlxgjJMewSiwN1zWfsOngdljq3EmY08vm5i/7j5yIMqpvupKyGoNg9lngYosl9wY/0dZdrMzYl8Ne8sAWNOu2MA3zw/F2CoNiy99XbvftrcLriz6PhsGn3U9cM9xMODObQYWCMANwPJ49UliuW6SaqqBn/gGYP8pwPyJwNIxwDK76ahDeN6uXYCuYyABkEza4LbpY5WEWdSLxjF26/dQB0SJ6r4ByAN6NQxmkWcqrnQ00x1DEDJFjR8CcNWGvWVPp6ZdMQ6OVOCb3wAscPJ6NCy+7PerkP5Q3tBY1PrT9tEw+JwbgPu2AlNbgVkCcCOwtAFYcgAuiwWlM/XqDjMEbP9t4MB2YO54YJFMo/5gHIcALV1TRZ17FXOhPtvgtvkqf9H4kvHDlyKK4l6VzvVSBF22uwjOb7pbw+CfcwBSkyeFEHAUx/yw9JTyEbo27C17Ol3aFWNuAlgIn9QxO2tYfNlbK6MvaxeMRYquvL9rTcPgJ30TuH8LcHAzMOugX3QALo21WXBZLEHwRF1OgHS2eOgbgIPHA7PHAezNu7QFWFZ7JnXJ5rnqxHEulvlzwyVNN3+wern5Yovl7SXLGwvn4riLWO4fgMRJXcPd/+pmOymELEhRzBxJAo9gVL4kwVnbsLccgHEpWi3epocCAMeBRU5eTcPiy/6qtl0wpvhA+2gYfO7NwOQm4OBGYGaDs+5ExYDGgqP+ccAkINaVpB8GTv4d4OBxwNw2YGFrxYCmV0YxLNYheCXau7EhV3ga3Lb8g4+R45uoGLADgHWqhsBXA8K1AZADyRvuvtkBSArh+i9DsQhCOtf0UUgW/7aiYW/Z0+nRrhizoxXwFhyAi5y4rGHxU66qAFhT3rDSIVdpGHzencDejcDBDcDsBDBP1uX1CMJRwFiQIBzxieL3KIY1YW5MPOxNwLRb8gs0aghAss1GZ1O+SFHsdRPt0i/PLHu++dFb/x4mXfhcbWxhfCtYMFr/uWvKxfDaAcg7ipPCvFOVpuo3HrCjYW/ZA+rRrti6TS6MVQ+L4NPH2nx698GnXF0BsKa8Iab4dFZpGHz+JLBvApieqAA4J8CPOQuOBBAOV0CUYbIskRkAecrvAdNbXc/aDCxSpyT4CEIyTgRgneiLIp3nP6fs+a4A4N8B8/48CUC+ZGJA29fpuLmxJW+5h5kNFg2jiWHSi0r0Uv4pCoZsxw8DUfnhd4Vk0XGdGvaWPaBV2hVjdjgA0BlpkQ/K9bmn/HOVqtClvKEBqlfD4AtmgP3jDsBxB6DA7tdbcvYzJvQJkii2n4NOeMpbgJktbYPGACiF3wFoEx1ZMNe/4jnPLXu+KwD4t/5SO/iMBcXuesHylyACMBPDgzGg7opM8mEHIGdwrfGA1rC37AH10a64Yr4APvvOSdwEPOVbKxu+K2pdKRTmdI3dqkPPVgbSTBGAY8AsATjWniBdx0QxJylOFCcr6HBiw1P/CDgU3EgEIMW52M8YkLolQRddIN1AyKWiBretf9MJQN6HsaCPxe4rvgDdHOcOxDIAcmDFDXvLnk4f7Yqt63gEIB/Yoj+4p9xaAbBHeUPM8qF2aRh84QQwNQYcGgdmx4C50WqCFngNsgSvQ+Dxu4MuiawhwIAXVk1O+e/A7CZgThY1dcno1nHL2oDIyZULpBsAFTBZ9pjT0QQgn2V6ufRicS8QRgbs5ZYpEsENDejBfpoLrwAOjgIzZMBRZ0AHoUC+SOA56xJwNlEyTFw5FxBPeWvlzpnbANCdQ1eSGTRybMuydgMggVBsKmtYoC6Mt8znZxsZMLzAxoAOvsh+ydDqtXx4FIDl8L/omQ7A0QqA82S/ERdTI22mNfaTuBIIxR4BhKe+y61punQC+MytI/Zz/c9EuvyBeetLAfGZ5WOMZ9j2/gqABB1fMLsHAVBqhfTcyH5d9MByEdzs+B50Z7voGZX+NzNSsd8cwUcG5ASRKYbdHRNYwhhDIHRgGmO0gFP+HJh15jOXjnyKblVT5Cbfoq+yJOszF8P8+VnNPlICkMAzds/YLxlYznrJwIpO6egTPMqA5ZNDAB6iCCYAyYBcBqTRQ0e4630SxZyQJQIvMJ8mSeLrYe+p/GzGfnTpEIBy6US/out+K1wg+brs88rHmDOgAVCMnrEfxxMte1Mt6j7u9zzKgIXzczEBOJIB0BnCJoqgIfDEhM58SWzJEPGJe9hfVH42un/Mfxl9bgSiBySIBWnAJBDGEDAB8QWFA8wO3/a+wH4+rg4RLPYLul8tCI8CsJmJMQAOuwFC9qMI9g9Z0CxhZz65K0wfFBPqu7PEyVdWAOTHVlTcpxhXHZLz1w0ZA6EDLhkCskRf0sw4dRYC0PQ/vVSRAYPo7QCdj7GqVOSMeBSAzUzMxZcDMwLgcKX/zbv45SQlHXDIgagJc+bjZBqAWhUoH/Y+B2D0J7rFa6LYDRmzomsAaOeKqxEvbWacHQB08JkRIteSXiSBLYJOLB+X4xrzAzY7vgfd2S4RAKkDDgPzNEAIxMASSWF38WsgkuXLyXTRSRCe/DduSZMBMwe6ObTd8JBj24Aot07uDObPP9XsIzUGFPs5+JJ/M6oT4buxHv9X7BeY8KgOWDg/Z58GTC9Xq5FxTXOw9c3Cm6k5fPcjgbHbgAlvVG2tH1T3Oavoq6BlniZ+12n5u/2sDbOvasqoFg8x2Lnbcd1GdhSAhXN+7qMrAC4sA8sORJ6yHwD28z+Ft4fdv8UyqUDrDmCEBcpZ39kLS6aq9l4D2rLb/KYsFTPWdfbvh86vQu2s1K/K+zIjTsXIVQ9a59Egs4Y6sZfIA/EcSp/jEXv8BWcAhxaA+SVgSQAkGAMICcwVlNLlqTc9Gbv/HAA7MrL4+f1VlXwrUq7SvCoyGcrrWpGhuur2fNGYwM8YT67hT3s1LaZvqn5MLM0bzmHMmIFSgdFNj/mIBct63NhFZwEzDsBFgpDPeanNgATfCtGsX9TIKwNrg9tuVkhlng7TI/YArX1VkXKrEe1l2SynN1RCsFJsqnQv3UIMxhwIRjU5AGN9QUteVz3BUAvahuNgjC3HxLAND7nBp/cgONXF5wCz8xUDGgCjKPbvevlzcKUHH2ag6cnYzepYBB9Zi2FxDJdjoXJv1WDFiLJ6MKqKZUzoQFTfj2HmwTKcTpVWvcxHKm6kKgoORAEvVclPD6NdzLXpMT8IYNPcLV7yJGB2AVhYrAC4SNA5AxKM9ryDPE5fs6eeVKWGZ2M3S3MQfEyJUKV8L1ZpJXpVJ9pLilmlAxWkVJHKwIhjjD9TtVXVm1HdOy/pJiaMFRWM+bo0rWl4yM1N7oPhTJecC8wRgAttBjQWdBBGESwgSiV0Pb9DRgu0TY19N+M1mRKh8niqFx3rRDsLqjgl9yaGXT80vcL1wnE252PAZCzAHQCoiqoW3yYWFIt664fUpKaREr1NPakH6XkuOQ+YDwy4FMSwgU8GSRSz0UJx3Vx/5vFNbrs/EiLRY+v4ACITww6iJEodQKwBIyBRv9vwhKzUW6z66TUGEwhDS3ezqusAyNxnJn8xa1KRPSFts9YfFB/QDZcAm78CnDBT5U8rCqjfc3yh8Gn/hGd/MsKf1+QzYJ4891Jye13iy1cAE9cDJ+6FpYrEkidxDN3OtXR+FwBGMezoMmxJLOumAuD4J4rxJrfdH/XCoLGFVKiUbw+LAPQqWWaMMLrd6/+JycSIm85w9lOpt1j1MwAwFTiqAWEUxeYH5ENn/jInUVHeMXQ/f/jRePvCa4DhTwLHfBc4frGqqaNJzLPw6iZxV+HTplFGvZrXZT45N39+HW3TujlZv8D6fp8HRq8Dts9XIOR5YtakgBgdrrrt5Qsq8Ssd0BhQ4HMwmVitAWHAY/LbLDQNQDaTVJ8Q6W4qVB51OOqDZDPVB3TLOBepW5jmqaLbec3jGgBGMSxvvemDYkQ9GoKF1ShUCSKCqBeQrvmfVZPC1keBjXcCmw911tTJ8q5XgOLaQgA+x/OdWA2EGZ98gbjleTHdQHQN+2iwls3nK3/Zhj3VeQhovYzdxmArSwQgDRA3QiSCJUrTnjfl4KozRCSCCeYmt90EoJJbVCk/1+FiCwFZxLk4dRfLFia6x8LbYkD9v9cXtLG6+O4AYQRfrgPygVIcqyhTXcWFOJH8fh3rz7EKwnUArq8mcGwK2MCC1i7WY7Zenh56feHT/jE3yliE4TZncd636gPFCKWavGhcRx2J+cvs9MlSw0Ty3cCm+c7n0G0MExdW4BMIbTXE9UCynvyCCX+Ovm4gbByA/xisVgJPpXrzLj4EoRJjJIZrWHArS9iprK+KcefgiyB0XVKGjOmCmW9xhRVMUSyRFnNeFGEdI2q+/HFXclkp9WsAbgTG9wGj08CI64WxRk/OTDcUAvBHXSLQxcVCDMQSWbzv+1e7WVbz+k5w2tJtsbcCYV6WJY7hmAsDA7r1Sz3OgOgoM+KTOJbcjSI5yGIaNE1uuwlAAU/MF+tF5/0sIghVLdVdM2S0bSzHx2Mi+FTxXf8X925NC4BycK8QwfmgVX1LlcFiykEMcL2BndJJ7aQfijKfxLGDwAhByM7aC5U4qwPzNwufNnNuOH4VZaCPlPo2AahqFqoPVFc14ga2m+WEEL0cAz9kdPrOmMu8r1o/rTsXz7f9oswFs+jO6LAqkvC3Ggg5Fg6mwW03CUI6X12h8lyfcz3QHqr3DIl64DbqaQKc9mI87QXACD6vpJqY0EVxz2CEyCI5eMSGX2e7VtI5J4yTRyZhscrvt1nQuivOAaNLlYESwcySgiVbr37Bfd0/u31yEgg2FVaiPCeVOguqAfGov0iR0R9JABJ0bnwk9nMxw+fOh55EbgRhzozrBUA1polN9CLwok5HEEUQBjFMQB7D+j656PW+IrJ8O/bBCo4sGFdGejqiyYCx3mKe9/JtTiBvmI5OFiTisg9LtJFF7gZGDrUbHKs79+hyu5hSaUvh1foFr3r/6vZJCiXgCDwVVFJ7MVmRLsrGltuFCc68yFdACMDAflwR4QM3HPoKgIExt4gz42SuaQb8hBOE2oZmlu+KFlKR3QSssMJxDPWbbjpfLoJrxG8CYT8MKGZSVTCxYFTIb84nkCxCIPLDiby30gXFghaF4c2ReR466Uu2fvoFr3r/fKAEFxvpqMcd9yonIrkuK5LLV7MVCM+/uDJCyIC2J8a0z1iwqyESgMl15Sa33QKgmtPEBnp11mwuXgO70Ud4DHWzfgDYC3zBEOk7HlA6XKyHQzb8HgGoCSQLqsxorIy1Bxie7Wx0rFaf+wr9Xv32C+56/7HbJ5VHtRYT+GJrsehHcya57PyKAQk6+vBkBZPpjPEExlwU59awg3C24W6KBsC6tqHR+MidyVG3i3rdAnAsH2T093XT+zLr197MTA80h3SfsZP2UqpCrPQ46oF317VrpeiKXTJ9MhMLkgGdCacKG/mupV9w1/vnwyGgCDCKWzJe3lqsyzLWZWe6/kc/oKzgKH4jC7oolhdC4jiuzM0WPo+cPQ2AsX1obFCTO5Jzn566PwbReiwnfTWjI4KvDoh1juh+aT+WKSYD3i8Aql2rJk+VsVQly5kkddv2FvHT61icqO7Fr71/IkLNXOi0FQjV0046oBy6wZ922Q95ICqDEaL4XWw3COcf9Mw73DFB9AqE6wZAAS8XuzGQIDKf+oVkqxt00ttAc+YT0PJ9qRFSB8xoye5Xu1ZVeCSgCLbYLVNswoncHxoeLwCzBGjBNki/4BX3z9lXgUCyIIGmhova83cRgO5Te9yLgP3MfmsBS8xs8/U67ePQOqy9umBUruDchqo8sHSd3PMfT5ifo+ack8eFHI6QEcnT5GvdOnVdXof+ptJ+BVPWceiaRHA8Us/nkACo8mzqlqmWrbFDppT5A5UIZm7CPA2Vgm3QfsEd909kKIqB1qJAKCBG8ZstZz3xHOAAiwmpDIdng1maZQAkZzsHZ537YfQrwNyxoQ+HakrnS0h1mUA1C96TdJTmORyhC3oeqdwROi+GDhkFI6bYNrcNDEDeAkXwQizPRpmnIs3OdqZPSaRFUcbchHlgie6agq2kX7Dd/+d8lUJVXuUzk8ERmS+2vfd4uvN2VOV5rSwb0y3JhgIh9wJeN3YMQCIgR78Q+nDEVYBYZUrUpbXFnM7COSdf7N4IPvtDnT2BY/h8Chh10MXQeYGS+7GGjaQiABpuNIFiECnzdWJMIUHcazLptC7YivsF8/7FgLFMqpiQL5TuNbKfA/DC46rqqAbAwIKWK+timRUBEiNGsOQsyQm+Gpjd4n046hbT84KPuYjOmHHyp92gcgDS2OoIuVIeh/xyUkaVwyEWdLrewHE3uBUDcKIwnq40HpDXL+n3CzbaKdguel5VnFJl2awaghLQBTzteZ0cjLq2A2n0M6EPh2pC57Wg41poLzZsAZNso0Hw6eVR/J8bF9YjWGmVCpGKwQLBRCcrbiSxNLgVAxCF8XSl8YDHHFPW7xeFBRwv/rGqOKUBkODzqgdWPYAM53vTASMQu4Bx9J+69OHIF+N71F1O1gUB+AsBfFqKC+4Wi4BWX+CYgOTAU36wdMVNVKka3MoBWBhPxyiuko3xkSX9fvGMkqsDlzzHC1N6SQ4DoINOe7KelWWTheziObeKCdARApD1AdVnRH048gKUAmAEYi6Oh4DJV4VoGDWqjq4XLbO5o1jBoimEPhPJmwu9FvnTLgdgYTwd2wyXbMyRKen3i2eXXB245FlVYUpVxUpGiLtmGBlrTEhVUwV8dEkVKAq3MHJ1uzRbRx+OOgDWFX6MsXJU/36lJoEoA2AKvw8+uwTEDIBbStdOs8ddDsDCeDom7ZdszBIs6fcL9ror2C75US9IxJJsEsHdGFBil4yYuUwknofJgF4XcEUfjrz+X7fKo4EJJ//PkMORO6FrVjQMeL5kJhZMMXzLwNZCt1nzDFgYT8cQwpLt4hDON0i/X7ys5OrAJVe0S/ISgFY7j9ZvnQ7I3+lyqpYaL98CWp/N+nDkZdhi6bW8An1kP3fRTLKVWlwF6RZCH2L4zDDR0k1IqeTNb2OQSYNbOQMWxtMxeqtkY6I+ny9VEz6btfb7xc+XXB249AoXv85+tIBVgJJ6n4lf6oV+mfjdDJNMH0wAVFX90GMk1f5TxlS3Fggh92DyN0IORy5665KIfCktsl+K3VsGtpVOWOMiuDCerlSnjQ2rB+n3C+pIBdulz8wqonrNPLKgwKaC5B3s53qhXVq6oDNg6sOhqvqhEr3V2VNLBjmnSSNdrOLJ1zkAu6VPRjFcFz4fXDJ8i45hG94Gt3IGjOFYA8TTlQZ/qGH1oP1+8ZtlT1MAtHK8mQg25zOZUSCLIliWcbw8wfW5Ln04ssqnHX04euiCk6/3de66MPpuAQVZAEFkw2MKFw6a1wEL4+lSBvmAOMhD8vkOkFX77feLNw14YT/ssmc4A6oOdHBEkwXlgjH2k4Nal6wB4fIuX9LzZjAmorNeHMo5Tc0OewHwDTUh9HXxfGJsYkAbAAAgAElEQVS/uvCpoAcew6zBBrdyBlQwwoDxdLZWXLDFkHyF8xGE/fb7xR8XXByAAVC1oB18HQYIT+8uGfP75SCUs1o64he8v4j6cIQ+IqkPhxrBCHjdjBH6AblQkAeY1ondukSiELmsUPpjbyp7XuvDgAXxdNZVvWCLIfmKg6Bbhrjup98v3lVwcQLw8gqA5v9zC9jErutltg8gMxDWWMBaMVkmANWFyEV6R0uH2I1IzW7ypbkQOTP5f2ch9KsFkwp0kQlDAOmxzHpscGuGAQvi6VD4RgmAg/b7xZVlT5MATNXwqQc6KGwf2U2uGV2uzg3D4ua7fDnPwZcKgIdq9GaIBPZb0YdD7hgyIFWMXiH0eQ5vXS5HcMkc++9lz2t9GLAgns7KxxZsCkgdtN8vWD+vYDMAUpcja7lOR9eLVcIP4tcuob/3AOHCdW02VTX62ApB4Mv1v24gnPy9HiH03fJ366KYHYTHsgBBg1s5AxbG0+HLZaOp65i+ln6/YM5EwdYBwGj1cmUkE7+8THLNdAHhwrUOXtcrO/pwhF4cct2oN68BMDCfmsJM/n6PEPoYPp8bH3kCkbtjji2tJJA962YAWBBPZ0WBCrbYsFoOf9pDAiENk179fkuvf9nTXewKcBSjsn7ldonWbgQpx+26otaLIwAlfi2QQSJY3Yjy5i9dmsFM/oEDMM/Z7Uf0RiYUA7J+ToNbOQC3e0WBBm9qLad6HICG1ZK1XB5PoxnuOOIcxSXe/Of8xHV/P+FpwN47gKUpYHmuSve0pKZgCKSq5wqniWE1WZz/xouBm74KTMwBI17lVBXwtWSs+8/vL45Ff3vhpcAnvwos8d48DZX3M2hx9XIAnu0IIO0chu35AOgLL0yuG/jOmwbg028G/mNz1YWdETbm4I5BrFlov+EtD2wIo7l+Atg8D2xY7iw3V5diEqO54mnj6XdMAYcU+6gon7A3NSO2qFjlyZYDkAX6uD5Iam44YaUfVNDNxaJcLIPXcGGpfi6PnZdVD1wPspQBX/wl4OaNwN6Jqg+xwrxslcVFuYJblehkcYYZGPS3L20BxueBcS8nwg5H5kZkx6TQSbXFZcCQKadx5Cz5mPurAFxrRaa17pAR2PFC+ElSHKQ/0QjQcgCyGyM9v3SnsDBRJgL6msWCf6IfWeUJac8UFlpY8500DcCfvgb43hiwZwyYVhd2D/VSrKGAmIDnBkiafEcN9cprHgKMzgNjS1V7rRjRlceyrqif6KAkMgXIM+6tAnDl+zSL36O9+U8p9jGHQo285/2XA/AnXeNnKAorDXH/AILwbSvLEz6Ql2+cAf/3XcCdw8DkKHBwpOpFbE2wadzIdyh3jjNQirYWEwYq+/zJwMh8pf+xKNSwM6DZMmzNRRbM2K+2Ii6TlFrAWfd5V3i/F7IgT2LBF5LbIdkqxLPWvtzlAGQ3RpU3Y7AiixMxLOUB2t7pKQ8M0qCTnp8HkojJgNqaMEJesQv4AR3Iw8DB4QqAs+6SWRiqgJgY0HVDAdBA4Ba4xN7ndlSFAAjAYX4IPO5dBDMAdS2i+Jx7XTf1eEdTDfgAQnR34p/wQkRmjNAoByDT/ugFphXAmjAEn8qaPQAgZCs0lSckCNmVigEbFMsPBBE3DcBX7gLuawH7hoAD7EM8DMw48AhATrjtQwiXoqkTEwWd7LOneXNCbz6Tiq/TInb2M8ZzIFrTQbGiy92oGz7pXl/7jvdAJnb2470IbB3T77Sai+hyAP5voTqW6sKwFAc/TAdc5+3dvcsTrvPVYSK4SQb8xV3+6IaAqSHg0FDVh3iOIFTIFxtit9orL5Z/LD1Q4s+B8OnHVuXwhhdd5DoLGsgCCJ04q66X/Ju/vSaeAxDPvbdtmdtKDV90gVEPIl/xySkviOhmAEjrlzSkwj40SlQZYZ39I+8JBMx8mZryhOsKwqYB+KpdVSDFvhYwPVR9BD7uyX4SwRS59nNI+bRck/DzJ05v12M0nY8fAk8iWL5BB5qASPGRCi8EVjzv3mqpkC9ACrrwhKukB67GhpqRRowQMqCiYbj8oOoHeUWpdYIBAUj8c8WjrjyhNIJ1unzjDPjqXdUjJAAP8TMEzLYq9uOHICQALe/EwWe+QgddAqCzzD8+vgIgg0qp+5nYjaDzCgjmnCYone0klqP4JSgvvK+6LoFPoFMlkPGh+0rPWta4RHTNJJQz4M8EAGoNTPVU8opS64CC9zoAWTFChcq7lCdch6s3L4J/2QFIEBKA1P9mHIBmhPh3Ai354RyAAmWsR/PRs6vOR8Z8FMPS97yxtIlYgVB/I7jC0rIKSfLXF1EEB+BFFjQ3jCLA49OWsRTTEPzvzQEwry7VrZ5KwzAQAPssT9jw1dcHgCrORQCS/bgn+1HsCYQSveaHkzvGv1scgU/6R55Y1YIxhvOm1EZekQWl8wVDxJgwc88QiJc6AKX/meHDawX9z16M/Em7bO8Q08GBP/jEkAEVjMBoAFWXUjRA3KtNwOBXW3EkAZhrALktpC6lKtTV4OU7RHB+3kHWgv/zrnYZl2kCkF4uF8MGQGc+MqEYUCA0n1tkwxbw4ScHAHr71Q7W4++c8czwcBAmHVB/c7Bcek9b3FuwbdD/kjGWgzJjQ3thGmVA3jhfOyU+RxB6FamOFp8NrhsTgLy8Cpzm5QlVptAU+6CiNgXCaIQ0BcDYV8b0P4pi30vfIxD5+w72C9aliegW8MHzqrmh/meuFhYi0pKbs6D9fsh/n1XFMrYMbPgUByCZz6J+uEknDA9AornWFRb01WZEsACoHhOqyC7wdetT0QAK2KqOb5MCUvPyhLE0oQxzqaYNXL5xBvyVXe12vByLADjXAvgxBvSPGFGMIjCmJbEW8HfntxtQmxT0cmxp9UPAdKAZ1upA6EB7qgDo6oCUxXRtPVSpAwJpnUhuxAqWCCYK1MBExZljY5S8SYr+pxAFAuBayhNG26jw8usCQLX0SAAkwwcAEngyQizaXoziIli+Oe7/9kJvNk1LmBMe9ECO3XRB7aPeF0EYHNVPdT8gj016YBcWtBfBVYJuz7mF7VgGY/pO8f5WdQ1/7U67nIKNS7j0wIbDPFZsyNHHY7od/xdlEHj8CcC3TgCWHgGAPSxiSdt4312u/8SPAl8/Dlh4pDeZW2PD4J1c9+uyDaIDkgEJQKnTfG/N8nUAmu5HUnMW5ARbPfEuIHy/ACjRK7FL5pOR4RaxgTHofKl8r/S1ZWBnAGDKefbn3AFIPRPXB7sFiVQimKVgGdl5ooNwLQ1/1U+DQGSXQ9r5Evy1q9rZbP1lGQDZsPpzI8APHgXgod7qUx11YtBbFzC+/C+BL7SAWwhgdoLkONSLqy5oLogYft3ZI1F7EAC+phsAnekokhP4HIzml/PvthQWmPB9LJ7jxkcSr14jWj4/0wFlgJD5eoDw6fe4DzAYPHokWhHJZ3TFSkn4h7YOSOBwEtiMTv1aY0uktFYTmI2/43EMQmCuAJmUE0gmVD8EFdPpdnxhVhqzDr8F4NMtYM9Jfg98EVTeNu9Q2OFZBX7vr9vtgm/lcezczZ61ZNN8DCvilYCdPXqNDQpAlfGTKm0M6AA0PTAyoMSx64cRfPQHXsniOTI+fEWDFGp+Qb9BeySRBV2kpl0QxxGAlHDmkI56X6z+EP7UDYSdRgh/IouwIZ36lHabBE0GJ0r10Rgb/xA/tt/j/6aMAf+7R4CxzuBXWRGULwBfIrY6UNfpvLae7n0I+LO/reoLMqiVMbW38oUhkNkQIzZO7tIweGePcmWlAFTjAYHPVGwXxWoLYblEDkLuTT8MDPhXLJ4jALpaJB+ggU6xfgJknT7IKXIQXh4Y0FZCog+wxiUTwSkXUbSMV1rB/A31OXWuFpPUda/mRHKi1e6U+hA7Zq7l+A+UAfDtHg/LrptkQpZ727cRWOL9542Pa3rOvuOqagUltgtmJM08j4/PILbIDKz6w5PAHsbraTnMGdZWIwIzxIfeK0rn578J3LAVuH8CODRahV/FFQ/1IumIvXP1QudNfyNT8oVqcHviPcBd48A0g2RDuoDqHdb2SalZAdG9dnfDkAE0gXnH5ijWCDbKCq5/MRiV0QD8HgHQ63jG0hdsLGxA3x9Bw1Asli7hO3BwApgng/Gjvq01IHrXJ7q3Cz7E++YziF2rs1ZLZ+8H9jJsSoECWXj6igmR87aLgfbGq4GvbgLu2gjsHwdmCEIPSI1h+SkCRjpfUC3iNWcpoRrcnrYbuGsUOMBo7QBCxSTG/igxVcBIVGPWM1h1JYQPnyKNExGZMDIJ9b66eEBGxPDY1Y5nv+GCjfGAxD+DDpiawphABWZPjwNzNLAEIH4XCH0M7/5c93bBfI8Yk2cgVAdvdT10ifDkBWC/r9lGH51NhIsnsWHOfPmEUKT94WeAG8eAO8aAfWPAwVEHISNQlKQUglJjJExqC+H6Nq93kOpUg9szbwLuHa66QzFWkaFieXxi6hgVHOMCYGRuJ+5V4jYJIDKI9KlsAvFDq8QDrnb8NWVPh9EwdFkQ79TlSMIsN0Mi5s9MoOGno4U6f3YAvefL7Y7rvdoFLxOANSA8f7xSgWmd0kCQbmZ6mTLEnJ0UqWLhUkxlrBn6n3wWuGkYuGukCsufGq2iojnRFpafsU7MDxErJuZhYCsJosHtWTcBe1oeq+hxigJgXBrMmTBPnJKLrr+VED54ibHYvZos8sO+DNcrHrDX8YVVyglAKud0LtMjFPtNMz6QLDY7VomLJd671AEH4Xu+3g7nWq28ISvX58/hguOBg8vtFQvV/hEzxfqOevuTfpjri8vAWz8L3NYCfjBc6ZYHmBcitnFd06pxyb8W4gPlgonBqffTtdTg9pybqiVNBssyUsdUD7eGO9amnf3sXtxQipl7Wg/sD4A8AwHIyZMYky50Tp/xgN2OL8y051qw2hXzwRCEdT2nmck1RxHG+w5jeO9NFQBpR6ldMIMXlFWgVndqF2dVFsJzuOgRwMElB6DcI6rznemD0RnbwQiSRS3g7Z+tVIl7PC9kahiYZm6IizuLigliT/VoUog+p8P9l3wJ7qGEanB77k3VczroUToWLCsABud4ypaLCUoxf9i/9w9ADiICULrQRWuIB6w7nuZrwaZwLBGwClSqSyz3AhHbaRGEFGOmC44D72UVgjW2C2Z4lIF4ArjodODQcqUGqAxfcpG4mJVuVqcL5tbs2z/veV0tYK/nhTAqesYNHdO5PCJZos+WuzxHJIViuXFyJxupNLg976ZK2lizUKodilGUgzyGhokF8yw5Mf+qRkjdjfuDtwkkm7DTkNaBaQ2ox1q3eMD8+B6O3H6em8Kx1Ccx9ptWl9iYIUAAWrI3I3nHgPdOtsO5eOuxXXBdj0V1vOL/so3Cxef60tlSpYwveKf0pAu6ohfdJ8k4CUqgvr5jV6VGTBKALeCAh+VbZLTnh5gu6D44A6H8cVlkNK95O1WkBrfn31R5HSy+JCwPplAxRegE/2T+AloGncNmbQyogUQx/KwB4gHj8YWNTwRAOW0FIIIndoqNkTAxz/bd09XDGLBdMM6/pLKi5whAX60gCK2ujxzEAqGL2pQ1Jis5AJEAFHvTujYAKjRf+SEugm1d2COQLU/DAwQ44caEw8AtZzSIPgAvuKkdrWMM6M7xCMBoiBn4YpCE2NCfxWAA5MEuwvCCEICwlnhAHV+YORfDsWJGgPpMKwg1b9QpFnzHbD2BK2JGul9s8KkYW17vLALQRTCBpzXZpS4gtCXXMAkduuAy8E7PijPWprXJ5CR38ygw1fJDohh2BlRAgq2OeN7uTWc1D0AFNtmL54ESBsCaJcLkDajxj5ZXRiCIGA0waDwgjy8sk5+HY+X9ppUbJSCp6TnFCMXwny1WAFQ8rUAc2wUrRL6mXTAefWnFfnz3FpbagQKLAqAzoZjAKkkpXkNO5GCEvOMLFXOnnC4xIKOjnQGNdWSM+GqHQGd7JSsxUf+JzQLwhTdV4je1nQvr1MkPGtlf9yP2Dy+gAqZ6rQytfvdHSDxgLwBF8AmAYjHWluEDiKGMiqOVvtejXTBOuRSYJwDJAARgZAGWL9Nk+IM3SzgTydE4eec1nZHbtDaNAf1Dpd/SMx2END6kD0oXtFhBXmcY+OY6AFChnKnzl7NfdMR3qCAae2B+VVMYXASvDs3/X/zHJZcB84vuiqABEo0QPnhnwqQLyRURmZBPytnwHde0M1vN2lR6picoKULaxHDIEdHkW2iWg4/7b5zb7DSQAVd0/griV2JYojfpwRGEYsGBrOBmx/OgP5sAKANkcbFzNWTRnX/GSGImMYH/LYlk+gGvdT+bW+SWH+Ig1GqL5QeTtR2EYj5LVHfjw/ZDwL8yJ6TB7UU3VVoTjTYxYDK+Ivv7dzNAZIxpZSiU8jjKgIWTcykZkBawDBBnQdMr5QeTKI5iWCB09AmEb7+ucnOQ/aTPWn6wuzyS4u+R0Ob6CUGqJpIDA97AdqINbgRgBJ69CG4Jp6q/ckjXqB/RKla4WpkO2ODgHoynigA0JiLwaNiEt95YQKJ4FRC+7brKzRH9jZbN6iJYuSHm9I5iOAOhHNJfZkh+gxsBKPbLu3+JgaWDdojhMO5kkDWSlNTg4B6MpyIAjf3IggJgMD4MCARjFMU9QCgAykhSKnUCYHB9JB0wy5aTRUxmup4h+Q1uAmDs+hpXgFLnB6ULONOn5xACNJqxghsc3IPxVBGAiQG9aLeilWUJW1FvVXEN0TKp1C6At19TMSCBpz1dHtT/JH7N9yaxp6QkF73KBxYIr10nAMproB44qQGTj6sjUrtOFPtLeFQHLES9AdDFrq1E6M13MaxVCTNAXNFThIylLcor40zxtgDAPKuVwDMrOKw+SBTbtR2MND7sZwC7Qvm4wqHa4T/uIrhb+7n0EgbQdTijoyg+agWXT8llDsAFWr/B8qP1K7bT0pvtVwHhW6+t2C/m8svvZlawi2CKe37nhFtapkDnILRqBQA+v04AjMyn79EIkXO/DnzyCBwVweX4wxs9B4rRZgyPVFqykgDd+5JSpBU5r0vHyHz+jsc3ub0KABsZMCyQgeExKyFPVIz3lmcM6OfPAGCADYPE67Jfs6h7G0o+xvi7oyK4cLZfOgpsXwC2Lq9MwuuVERonKn4nSJrcXnQKcM7dwMMXgYcsVxkSebJgzOWPqdB1ad2f3gpsnwK2LXWeR9m3danUIV1lBSCPArBwtp+7DThuBti6UDWDmWA/DvXk8LRptfPtNUlihYZTOPCi04GH3wFsnwGOW6iAs5n3GeJJ+KLoE+9VDClQ8R6vOQHYegDYwuY3S6H/iJ8jb11ck0q9Qhoc9QMWgPBZJwFbpoFN88DGRWBiqQIgWyJY3lPozaGJ1KTEPh36zpTkJrcXPRE44S7g+Cng2DlgyyKwaclfFoIwvCwx9Zn3Q1DmIPx/2/sSaMuusszvjfXq1ZRUElJkKsBEGQyYhJCBSkUqAW1tsBdpuxEVaBzowXZqe1g90G2LotjQdmMjKqtBxQERdAWUAkUlZNBGkQRNyIAEMAkxpFKpqjfUG3t9//m/c/+737njPq9uVeqcte66b7jnnn32/s6///3v//++Tz0dmD0KzC4DM6vAFpd/0L3Gh6yTDgnvLwKzAWDGiH/ThcC2OWDrErB1pRgQisIQhAa+AED+HEEY6uNLyrRnZLSl6tSbrgLOeBQ44yiw8ziwfaV4UGbdegmA5QMTLFlqsfn7XecDW+eAmePAltXiXnkuZSBkRcm4UGXtU2uo3xsAZgz6y54JzMwDWzkgBOAqMMVBCSAUObh8QuN/CiTgcWAuyWhL1amvvBbY+VgxbW477paa7gIBqCnUrbUBiQuhAKDUot13IbBlDtiyBEyvtO5VDxvvVfxW/JkWNFrCeK8NAGsY7BsvKQC4hQCkJNaKy2LRIsg6SJ3IQSe1onKKC2CsOYMeN+0Dtj0ObDsGbFsEZmWp5S74g2Ir2uA22BScAJGA+dJFwPQ8ML0ETAUAkgDTPq9zdK/+sMWpPF19NxYwA4g3PtsHxAE4SQC6FdSgmGWRRIJLZJll8EGKjHiX1jwaN10HzD4BbD0GzC4WrsKMW2pNobZoCu6CLCDfCTqzgg6sr+wFphaAKQfgZHKvpRSYg7HN5XCL2AbAZwPrZGaj6ippXhgn0kqmU1woxnHedg5AATuWHig2FE1uVRwoxoX+Wcbg89S3AqCKPONcCi8oPtVP+9++G3j+oSK2xRBFDElUxbTS+3nvc4FpDsjxllXQoJg8FgdCQoGJJTTicLcQ6vPL6wbg9cDM4cJv27oAzFA5ky9/UOSvmg8oP86n0dICBn25JwjARWDSAUgBHN6vfdbv10AbARh8X91vDM2ss+NvAECKPVLCsHoyUgRqrlbnRwB933OBc+4DXrIC0IEmiLnE75di8HsyAcjzWUVGUi6uICMpVwwJVMXdeOk3XAxc+Hng+vV2esAYw+sWoP31r3eLcLwQBeQUrEHh4Jo2h4vDmJPuAyMLGAeEn7uqbgB+I7DlSWBGCwe31Gb9aL20kGDb/EGRxY6WTz8f2wtM8l4pgL1SgM8esHCvsuylME4nn9cfQLtldg6TZ0kUKorAfij23vAPCmqp3fcCl60XFINid1PlZrf41/dnApB6wSQjutUfIDJR8CGIQOwWEH7DywpKrWc8CFzqRLHkVYrB2jS2FQH5vkuBycXCAlIUUAAkCM2iRBA6+ARCe7DjYmQduLYTleiQ/XTTS4DpI+6nLhZW2nzVCEBaMLd+soIGqjD1ampdugiYWCpeBKA9bBJC9ActAk8LES26SqsftInLZ44dQif4Igdhym5WLrPDyuYH/7HTCNwDnPko8LXrBccjQaioe6BiKad3+QY/MGTH6rS3OBvCnQDuAIyqhiDkQ9RX+29yE3on8IwjxQPI8zkTiApGU3oVkD/4fGDieAuAdMw5MFQjEgg1DYsUku+a3uI0TGBfV7PotwHwaOEmbHEATvuDIutni6UAQoFRIFRYhfe/dhEw7tbe9Of0Si1g8HkrwRcevDajz07gIJ7n05rYyWIpb4ya/7vv8PRdFpj/LXDmkQLAnA4jCCOlTBRN/rFMAJKgkkVHpGUjySSBSFeg7/azqk8EgbSEq8UDRACLKDXSyaQ7Br//DcA4LSCtwnKhTEkQcmAIQhtM+Uaajl0uS9NatITXWzpzfcdNB4DpY+6nBgDaCtanYLN6fCj4u1ay0QIqtML/EYC61wSA9tAJeP6eWsAoDysFpg1eB0HIQRCIIkVeCqQf/05P3WCB+UPA+CPAzvmCaFWDKEuYcl1yMN+Y2dckqGTeHPEvvWDSNhOAfbefX0A6rS8CUw8X9066bFIfdqMHJID++DJgLACQumyc3gyAEYRRKFCLD1eu5ODLF6QvXedx0w3A1BwwxdAJLTXjd8seQnGrZ9bPFxLyA7WIKON63tYtCQBN/sv9QPm6BkLp0vl9t/m6ietR6fbyBA4gnXtORwRRpNnTtPpW6gWLH83lKqcOFTEnDiKtoHwy8RNFhrefyeztbnrBfbWfgttsP+kIyO32ELD1cHHvInrlvWs6TsnB7qAUlg/suFtAWkE55zYQ0QpqcALoNCXTEt7A3KoaDwGQfqoAOEUBa7fUbKctltwCajVbxvSiyvoasM0BaBKwwdKb9fN7NfcqBWGiSWykWXER0umeacUEonQgCKRfIgDFjya5yq8Wfsfs8dYgiuMxgpAg/vnMzu6mF0z6Zj5APdvPQec0TEosnvQosGOhaLuIYvnwEYSithE52F1XFAA0p5yigD4otCqygFKnpHUpLYP0OcKURYv6Mj4MNR433QhM0gL6QongawOg+6rl9CswKoSkEIxPyTsuAPigCYBmAXVfYcVf+n0SRYw6dP1YwNgHsgSajiJP429RrpWOM6cxDiJB6NINM4w7LbUGMQUwB/M9mZ3dSy+YVG0EoBiDBST5ddZ+PkCsAiIlQZDa3LVatJ0WXG2PbL98AB+4omB3oP/HgTUhmGgBfRqWf2TTrUSjExDSP/qWzQDgfAFAWyzR8rkFtDAKX75jo6nUguZxZ8NByHbvvqBQ36T1swcsBaBAGGRg40Ir+rt9WUDhQ5ZAU7Es2e9LLzglqHRxNkbeuW+oQRRls5jaMjnK0a9ecNf2R4LAwO829kQB3LTtEYQPUwzQAWgW0AGo8AQH0ljp/V17pm0KRcEifGuNOnocO1rACQbKPXhs8TtNwVr5uh+n6Zf3wDgu29g2FdMtOc8B6PdpFj08ZFrplw+ZA5FTvAQQ0/BT36FPDkRqBT9Jag7xYlQItY0f88j78sZzCcKPZlrAQfSCK9uvB4h577SCotUiEJ8opq8IQFl/PUBPEoBLxbRE62LSqG4dFB8r5bHcOtiOQSqT5T7RKzYDgJx+BUCCTxZQCwhaQc9oKcEnEBKknj5FsJ1LAPo9xoWWPWDy+6IIoqbeaO0VA+zHB0zxIQDKkn1GgtXiRxMIAx0Vn0Db+lkuFjLRCt5WEwD71Qvu2H5OfekD5FaciQay/GIbFgBXriwAyGmJADR1ck3DwTE3TQ4B0LetzBJErTYAr2BBSI3HTS8tLKBZPo/fWQDZp197Z3scjGb5BDp/L3+njMweB6B83Gj9wj3atOsPWin9WgXCFlVO/3ctf4iD8XkBkH5USlAZlNPZAQqARr5vxu1yjmH0givbX0UQKI63o0Wun/xHuR8E4VnPK5JQLd4VNttTBvK2uoiKOUf/f+GjwMNBh0NMV6J0c0NpcRv7mrYv3kh8/uHxYp+bVpwLp3R7sts2YzouSq3KGa+q7+x7Co4nazAerRKsVlV1QitF59dyyFZaYY0HMu9mWL3gtvZXMbymBIFMZ1ov2h0B+LTLisxgW+Eq5uU92iZ72ud9vvR+4JFp4NjkRh2ONi0OB1/UBCkvEYRhfuNs4OmhhiPKnFQlx6aAjMnSXJUAACAASURBVPjmz1w41nnwO4cCIBvBwZgTAOUHRq3gyDExD4zRGVYEnpm5LqmQc0M5esFt7acFl0SlHiBxuTkYxxdaihUC4QVXFu5FCUD5QtJl85sjGA0ziQxqeu/fem+hw0F2fLLQGxFlYMRvo7v1WmIVtpt1DFkXvOR7LwJ2HSkyoZmEypoVVe8p7b6qEMnidGG/Vl/L2aPOIwuA1pAIQE3DAmFa4j9f7CPaFpCHKujr5xzZesGdHqAqKz5X+FLRAl58le+jui+kTBALMcgZ73CDBkpN2/7+bfcWOhwUyCEAjQTcAVhKdjkPc2RajewKyu/n1//qJcA2uhBMRGXQOcn9U6JIOjXHQqSYOsVoQp1HNgAvz8yny80H5PVz9H6RqVd849WtXQ/zA0Ow2ayGLJ474L0G79vvbulwkJi8BGCg4S01SKqofoNvSIC+5zkhFUupV8rUTpJN06KpaBkFQm5M1HlkA3AyM5/u9Zl38zrk6f0iU6/4hmscgK5ISUtCTowyDqb7UxwsqFJW3fo/vbuIBJEZ1YRgyHwQKNi0KEl1OKTCZJdxtPDn//v8ooaDaVgqFyiTD2IKfcjZS4Fo+7g+HXOPv84jG4DIzKfLzQf8KVfI/FNKrQ6h94tfz+vOA9cGAAbrpylY2SDlVTTt+uCnV3/V3a7DQQAysJAwobZJgUXi78Qayhd812WeiOAZzEyUiAkHMeu5BF5FwZQAWLPwknkLQy9CrPMy8+lIHZFzvN3T+YbV+8X7c64OHHix74V6zIxB+RJ0wQ+UU992tYoFy3fcXcTDxQkoPsCUhFIczKVCegSg5B8A/PILN9ZwxBSxtiKiUAOi7JW0dLTustF8AGbm0/1o3vjjnSGdj+lYlGwdRO8XN+c1wABIoHk6k61yuSCJITq3jDY9Vx0BqK++uwAfX6JkI/hME0SC1EGguiQ+isqcQRLrF6/0jO2w+6FMnZhyZYsQ1W50qOHgPX1NXndtODsfgMwHzMin+0+ZN0S9YOllMzWfLwKQSS396P3iY3kNOLDPM1y065H4gOW3p4uTDkB8zWdb7FgbdDhEgJkCUDRvogTmd/vPv3BVAUBuvylNzAAYi4hisVQnEHoIqWblrxqm4Mx8ujfljT+YjsWBYgIOc0oJPsq1slCpH71fKybJOEoAuuVTRSCnYlmU6P/Z4iSJEcbLv+Yu9/1EAh7JKEXDKxq4ChUiKymRbwjgHdcUWTARgLYXHSr2LOU+BV7MVwzxwOfkOWybYAGZD5iRT0edjpxD6VhcOQ6j94tP51wdOHBdMeXa9OqWRcmWXA1XLUIUH6zyCwlAs3z+YBkfs1u+VIejJEF3ckrjI9T0y/aMA2+/tgAg08VURKT8vbKMUgAMIGzzAcOi5HknHQAz8+l+MW/829KxhtH7tTz+jIMAJPCYMULAWd6fvi+EY9ouoZBM/Kx/4LUBgFLgNC5o16FrE8JJVJgkiFhaQQBv3+dVbMrWVsC8UxFRkjjaVsW2DtRdOJ/vAyohVYK7A+bTvTdj8HlqTMcaRu/XxHkzjgNkIOWuDr8jnYYDKDutgpUhra0uAlAyCCUAK8BXcjBXgLCk/h0D/hcByDxFAdAzoFUqUBYRJTUcMWdPP7ONL6i5bLQeALJRQ+bT/W7G4AuAOXq/lsGdcRgAY+glLkYclJVTsa6ptCX3uQjAKINQstFrAZKIwWxQIhIJuovB/Nx+r2LzFCwlj8Y0evl/MYk0kieVtcvrwGUnHQCVjjVkPl3mItQsIPuElx9G79dOzDgMgGkAWlNyBJn8xKprBRC+zgEo4LWRgcdVcOCjjlNvmx84DrzNAahaFZWLygKWxUNibIhTcPD9BMLLa65bzreAMSGVoXvJ/Cgh1WUfO+XTZS5CDYDs9GH1fnOrIDcAkABTTDCCLYK0Cwi/586WcKJUiEpC8CCBYDsiiSplqUIUmOjf+o2tIiKVUJbgU5uSWl4DWwX4+PcXnrQATBNS+8yny1yEopdcay+930y5YhgAg+9n2OoUeI5TdQer+32fdhmGoOBZanBo+g1yEKU4dYgFSvqB//vZBIBt9RshkTbW8ZZZ2hUgvDL3iU3uux4LSBM0ZD7dPRnTH08VAIfV+2XAOucQAMuVcKfFSD/+IAABsEoGwYAoHZIKEEYxRIHwLS8pUuhjFVs6/ZZhIVWyxVKBBIRXnbQATBNS+8ynI4tBzkEACv+chlUVIKE/5cRGsWmlKfIzudc3APLQSlg3E2OCyVRc1kpU3DgBmKoQsWtlBcswjPu+nfTYtBL+GQdgOf16GCZW6pXlBCqWSgqJypoOAFfXXDifbwFJLvi5HAjlnUsiIe6AjOp4iQNQHRlT2PlgJCUbbc2s+v/hFwFb/q7gm6HlYpBbmTV2sscQyy/qFBj2v0/cAdz/HGD7NDA1AUyOOU+1CwWOewNjKj6/O03F1/WuugW4/XJgfBoYmwDGdH7IxB5kLPIB+I8AfNwZgga5ck2fJbEm8V9zNWPfrasbgMuPAcuseJ8Exsb9FdBhA+7gaQNKB6TfcgCYug+YJT+g89aoBDMmIMScP12uTKj13uDv8zsKig/uJ1uQOsnojm3qB5P5ACRBH3OhPuzzRN9DV88HqQLEWPJnvTy5nm/t/1s4BcuSpRZtGAu4fi+wtBVYEyccrYwn6hF8/FkJp9bKxAKVFsn/d8urgbHPA9NPOEOWl4+2cfoFHhfVrJTZPKHSj5daOtup6JyCpPx8rHWRVQ7WOlrYCMx8AHIzlxkALPD9c0VB+x/A3E/+E2fUYHXdF7KTGwdvTd0AHP9r4PgWYG0KWBdfsBdsMPfPrKKsoL9XAVLAvO2fFylCE4cKliyrDVZNcGS1CqEYhWFiAZV+XntaURdTLmpCEbpchTYLqi6NrkMCzLzt5Xc4HwyJmmkJ+Z73jQOh4NWeDUZiK1K08f0EXt7CMHVawIk7gaVpYJUA9LI1Ao8bzKX1cytoFtFfpdCIWz7rgzHgth8u0oPGDwETc8CEMySUzFaikgtlpW1Ta8JqNba7lVljSRgW+Q6ZP/57WQvj6fydBjXfAjKbgEvMLwWCvhNoipgNpnQshlS4IGFWzIk6ylWwAz93ETLxGWB5ClidLABoIOS7pmGfG+33YAG5mND0G8F4678vkiPJczNOAC4UyQm2N8w94kirFlfIAl7i402d6dbPWWAtrsjOFiuCvAJZOQE0pHTFsckHYDeCvhNgipQNxoAz8/8IPr5nbvH2jd+6AThJAE4AqwTdZKEBLDoDgU4+YVkPHIBoPwareOt/BkDexsMFAFnbzNJYm0IDnVwbt4uyur1kwL7Tp+iZM/08WT9Rc7DHUmuYTr/x+6o4ovvu9fjBbgR9JyA+omwwxvZI5ULg6ZW7y9FPf9QNwKm/CgCcKABovh8ByVy/UCtJq2f+X1yYJPGU27lIZLbuEWDsWBHesZeDz4iURLUWa1TE47LqK12fZmd3OXidFctqm92KatVs1jAEsNv6sdymaa2g8+xUL4I+Pn2beCgbLGWHI/h8G3oTr45iK86POlbBU9yKI/AcfLR+ouQwH9BfmmbLlTHboOnZ/T9+5vaf8FUaAThXsFOQ45mUcgZCWTAxe0UQ+urYMO1/37GtxQmoLCBtRSp30LrDp2SFdzYMgk/R+VNwvwR9mwQDsaspGSfJgYDYNTbp8psCQFJxEIBkQjDrxt8dXCUIY+COH5MVFPi8SOn2n/QYLZ9Gp0cxANIP5IvAkzVzxivRydnKNzBa8fddM84b6AFyAriMF2pajk9kYIeoClXmA3AQgr5NQEHMBqMVFMNaIOayNRL/vhlH3RZwmhbQQUcAasrVVGz4EtjCu/3dfb/ID3PbT7uKAZ/MhcIC0vqRTo4W0IBIEAmEtFwCYqjW03bcmdwBYeoWgetUbrR8snrloiR2drpACf+rD4D9EvTVjIJu7HBV+781X752Czj9lwUZkTEgcPoNPp5Nv4oBRhCG6dd+1DkMz1JIhR1BAHJ7zwqO3fIRRM5tmDK5CoQKsSgOeBYBKFZULTqcB9r6Ni5KYmd3WKDUA0BlhNLM8EbT1QBXBU72aI5ZjUcVOxz7WLkQ8d37vsart/uA6RcPsxNSAtAXHDYNC1AEpf9s01kKwuBwGU7HgVt/1jtD1e60fgQigSe/j5bQp+KYpGB+H62jT7P8/ZypBIC8Dhcx8eY9wF015abhmnoAyJ5WSrKeNgKO9SHxnT/LSasJBim5lRjWBEIVeROInKL1qunybRawLgASdEy74qjaNNzJCgqEEYzBGvK0297mAFSHEIB6ebKDgc8J1ksmV8t29f1en6L5v6cxIK5iK6Xne/5jCTiFcTqVn/r/tWDPWwXnEPTVgIKUHU7ljASawKefIwDpMdRxRB+wFgD+RREDJABpwSzz2c0LfxczVjkVKwaYgtBBezu3SvX08d39P5uO3QKahXMQciourZRAGKZWar/YZ1xXRPe8wQr2AUK7TvbOVTZBXx4MBECRnConUBSFEXT6mf/TK+/qmzAF/0UBOPqBZYF52HrTFCw2LH5G8UCzJEko5nZqmRnPh/uCXmpnVpDTsIPPwKApOaSA2QLDLSHf97iPx0tpISLfz7bl4iFfsUsnj+HZWEeOYDCDnDmCvZkEgedcCjxGseIhBYt3vx049HwMLRh8gA9gh2MoH9ABqKJzxf0McO7XlSAU4HzhYYFq+5D7hwBu/98OQLlIBCKnW39SlXNY+nqeiq2dkQg+gnGPb9/ZpT0lq6MV5D96gLCwgDmCwbdnCvZmCgY/dxy47xxg5SWuUjigYPHFbwA+fyGwfr2rXrMvPB+vp3L3GHCgi9JOHQCkRVPppeUBigXLFymyejYTB4YsgfA20ofRAlYB0FfAlvQqP0/TsX5PLOB5DNu471cmIwiBaRww/F01J+mz2pqChxUMZvpJlmBv3iTocsW4dzewfhkGFix+2febXDAeJO/YEILBB7pU1g8LQFo98QASVGYNQ6DZfEG3fnEqrgLhbf/HV15anbkFNCvohWSl9XPQ2XTM/2s3I4DwPIZwBEDfgitH0Ek6N6x+u/iD7T4g/YdBBYPpWHEaHlqwNw+AQa4Yj54JrJO+aQDB4pt+oCAyYvOPEIQDCgYfeF/9U3AbAMX7ItAlVtAspKZdz5SOlvA2pstxjES3wJ+92NgAGK2gwi78QoVfEhBeQACqNNP1RdoA18kKdgDhxkUI/zKIYDCnqyzB3jwAJnLFOEIW7QEEi1/1Y21ywVglCAcQDD5/Efj7M4CVrZ5AKlkhxeQUaxBI4nvFzxf8IfCVC4HV7cC6ZEX5nen3VX1vAGLZq8ysrvHY+QBwbGfI2E6JpLvdX+ksthpUvQrmX/sVDGZVUJZgb17vJHLFeGQcmCdVb5+Cxd/5xjZ6QzzMLOQBBIOfTV2Ps4HFHQ7CLQUQmUrV0rgKJMsCjsxGAqTn/hzw0EXA4tnAyg5gbTYBorKkUyLnkB9YVhTxu+kT13iccwtwdBewPAus+b2ar9xJAafqfgMQO4dh+J9+BHe5gqZZZzYok1JJUcpaR6bp93P+W/N6p0KuGIemgEWKgPQhWPxdP7NBLhiHKYHUp2DwpZ8rLOD8tmJQVplOLxAqmbRKC6EDYC7/CeCRPcCx3cDSrsISrs04CPm9ArZk55UvKAspYLqPaPdR4/H0g8DRHcDyVr/X6VabLHk2PhjpPVZY7d5xwF6CwS9y/4LbbVyQsEKIufGiKe0p2JvXOx3kinF0GjhOQY+oNRtljji9TQPf/fOV9IZY4Gq4D8Hgy/4W+Oo2YG5bUUy04vUcLCqSJVRWszJbNgxSmMau+q/Ao2cBR88EjtOqbgNWWaTkIFz3YiWrF4nAjtN0nBZrJnU+/8PA3CxwfMYB6LUra3oglL0tps6wlVha5rLiqd9AdDfB4Je6U0s/0BXTDYh80Sr2FOzNA2AXuWIszABL1JaKWq1R+nwGeM17OsoFY5XTVw/B4Cv+Djg0C8xvLYqJCECzgsxmZlq9T8e0XGUyaUizavPtxoFr/zvw2BnA0Z3A8e2FVV3x6c4sqwObckeyhiXAowUSADhD1XhceDMwx37lvU4XxVN2n3rJIocygkr/Vbs7fe+EdBLcfaXXQ3IPWIrpBB6XlnwpR76jYG9e7/SQKzarxM7qJFj8mg8UarMV9IZ4gvNDD8HgKx8HDs8A8zMFAFnPYQPDl0Co2g4fpDZLqKCxT0/7fhJ4fCdwbFvhRiwRgJruCOwUgCpeCvUjZmEFxhfk9W969kW/B8xvKQqnVgg+B6CB0MsI7P70AHgmd2n1NQ0rv7FvALIlVYK73MnQCDLThSGZoDpuP7uCeuX5n8zroB5yxThGnQ0CgyBMxY63Aq/5aBHG6EBviDlOLV0Eg1+0AByZLgbl+HRxnZXJoqqttA4ODovlJZVuSjTQFtq+NwNPbHMAzramdVpVs6wEoPtdNg37wJfvsYiJP9NFqvHY+7vAwjSwxAeNxVO8T6aNVRRRlT6hHrJ0Ovaw0WDJCKng7g86APvNB9wg2JvXO33IFWOBgn8EIf2nRLD4tbe1+AU7yAWbZeskGHwVdd2mgAUCcNKnJgLQrZ/V9/Jnn5JUYmnAE3hCmv3+t8AWQfSzyPK/POOgJgDdsgqA5nfJAvLdLV+bz0kK4RqPZ3wQWJxyAPqDVhZQyQr7gyaXI9axWCFVAGLvRUhV46PgLnUWBs0HbBPszeudPuWKsTRZAJDTo8l8ui/42juL5veQC7ZpsEow+OrZQlqVVuH4FLA8WVyDAOTAmHUQCAWQkOlsQAwDt/9/AE8SgPQpNa07+AhAA6HLXbb5Xr4IaAMfv/eGvP5NzyYA7UGjBWTWjh40v9fSyscHLtaxhJWxFVsNNAXH1khw983+DYPmA5aCvXkdNIBccemfceooAfhAAcA+6A2xLuAGucxrzgKOMexDfV9OwbS2BB/BEoqLSrBoYGgJ3E8qLcIEsP/ngCPuUy7S13L3wb6PU56/m/Xj4Ps0TKCXQA6AXuNeZY3HMz5QANAeND1kwcKXlj6wOZQ+b7R+Pi0PD0DeFAfk590CKg8qncfoFzIRVWVqfFfBhgn25vXOAHLFWCDbvPstBsJZ4LUPt+jdesgFg+qVptWq11bg2gtgfuLiRAAgQeg+oEmsOujsXb5SsAoCIN/3vx04OlNM6Yv0tdx1MKvK7/TFjVmeCD4HQQQhf159eV7/pmc/kwCcKABoeYvR0oept7SEoZQ0Tr1lPuPQFlAtO0nyAcWhpzw/FSjFzGjLx+RGvxzoSeC1hwsA9klvaFN5FAy+9mJgnhaQ0qqagglADo4c9AhCDpJPl5ZommQ8738HcGw6AJBW1VecZv0cePwOY0/wl1lAD/WUCx0mMlDLr8bjmb+Dwp3x4nkDYbD0thIO5aNtfmDi/xGEeRawxhs7Vb/q2huABQJwAlhyy2cC0xoggjAAUCWWAkksOiIY978TmOOqeqqwqAx3WGhHK06n7TDwOcAV/iipPAKjwgrZm2o8nkUA0gKmAHTrp+o9MTrEYvq44o9pZIOtgmu8mafCV72YAKT/RwAy5OPOuVlAAk9Oule6xQRTWUKlWtkU/IvAHAHti5oIwDK841ZPFtCmdr0U8PaC9hVultd4CIC8P2Ztt/m5/qC11TJXlJDGGpfGAmYODgFoCxACkLpuWh3KCgqE8gNVZK4KtxgjJAB/2X1Krao1rfN7CWZf3LSBT4uAEIyWBVpipL7GgwA0AW25GbGENBTRx3rm1M2w39mmrFVwjTd1Kn+VAZALEE5LtIDyMWUBvbLNLGHgd5H/V07BDp7r3uU+Jadgn3ptxekA5MBri0/Wp4wzBjDbCnkMWMqVpE8GJwLQqvfc0pqbkVj5aNk7gbCxgJno30cAjntowtXNaZ1suvSKNhsYTcVKmw9F5xGE+94dfEoP+JYhD/8OC8eIPUsUHokVVKB78XszbzAF4Pvd//PCKVGIpOAr78mn4DZOm8YC1jco+w6EFTDDPJqeCEBZBa5GffVbhmQ8DtZW5TYOvPhXip0GTuu22lTMLSw+aAVl9QhEWjurI/aQiLJkTMLsX9R3r/ymZ73fp1+37OU9hunXSkdl7T3QrhKCtlCM59k2i5CMMSIAGdqxEIwrmptzTsCEut5yilKoJLAcxCq3fe8tLCDBFwO+tKjyuxSCMdYEXoeDrHcHvu0tTwLzmwHA4N/Gh6zNCqqeOSxC2lb8tQSiMwbuqXIqAcjFh2JjBKGJyShQG6ygVbfJegULWBYcMR3rvb6oCRaQwFPgl1M5rR7/JtBZOIZWx/0+s4QeY5z/1/X2tFnAxPpFELaVkdLN8MWGVr4pCBsfMHN8bmTKfCjZ0Ncp456/x58zLzfw6Qf3ABd8pUgEYmqk5bGyek06IQl1bkXScnlN/u8L24Gdx1qVq91KQvrpgwaAAw9p+wnXPw1YjyWMGtDo2ASOFGMU7SIEUzdYD34vMPmXwLbHgdkFYAtlGiim6DpxJtvq9LtlVr/aWKEB8pUXAOOPAFPzwBTZ9r04vdQ9Ts4pAZ3cd+yHxgfMAOH+vcA69/9Uxijmz/AerYpdar1lNSMYzV+vWY/34I8DY58Gph8Bpo8A04vAFEFIknIHohGVR62QhFRSYjQE6qFri2z3iaPAhHNNlxKwArI0Q1IAxwfReacbC5gBPp66/5ICgLKCtqnsrKKlrFZUFPKOr7osMTtdsxzqQRZ93Q1MPARMPllohUxRqkEK6gShOP0S+dY2hlRv99y+ovRi7IiTnTvLqmg6xDPYpqAUgRgsoR7MxgJmgHD/c4E1FXu7FRRbvEgd7evXWlbPpp9EgUjiJpwe6zwOMlvpAWCMVusJYPIYMOlSDZRpoGiNxKzbdIQlXONMWJbGtw4svdgz3El47nzTRvPrrKptAJT6ZrzfintvAJgx4vsvdQvIXK5VYF3sUZxmJUvgA1FOvwF8spKyBtM1y6EepI4LqVMedbEaTp0EIKdPKh5FqYYqSxgo2jgFr13j6XXHnOiSZOeBVSvyC8qC2r05FVvVw9cAMAOA178AWPMp2LJaaekiCPXExwHw660n1oB/niGQazwOkkSepbJ/72I1x4CJ+cJ6lYI1riccrVicUuVSmIW82pkwnHHVOKbFsOozQGkFkwewnBES37ABYMaAX39ZAUCCb82nIlo+40p2gNnvsoKunxH1xGwA/LOzdQOQJPIuHzV2GBg7Cow7AI0l33XfjOsv6oVodes6ISbBsAZMX+kJxU56KY7pkmFVhOciuvTzSt05v0+ryuT/9gDrZNe4wPMsI7VJP3GcP7gUOOdvgL1rRYJ0ZI5IV3hV4/wrGYPPU3/AiRhYusy2K7mU999P+z90ObD7LuBZK0Xdkeq9NSX2+o4HLwfWlopFCC0fgciBMtAFC8CGrYXVoVjnU2G7rTXrzh4kfRzLY1kyGwBoeiGcPiXb5eAzdXWnazPCSScb4j3xfmav8Cx2p50lAMW0VXINitCogl2r9H2dcctWwQxQsn6ZTBbMNtcgdKIbiZj51VcBk38CXPxoQcfCUg8pjcYgZScw/momACnXyr4leBhs5QaBTHpf7X8dMPYJYO8XgAv9e8QJlAZZq8D4xSuANYKPJQn0AR2AHKy1MACKe9nfFI6IEqduEWoHIJ9wlsVKLekoMCa9EAegSTYQeM4TXco2SEMkAHEbBZoj4bbYtdyCVrFqGXgTSxgXYTZeHLi9AMjEQRCVUXP/n4KUaaT8vVTi+Rtg7GPAuYcAWlMCgUVkQfJ2Q12yBvPXMwHImhDWwf81imsTiLSEvHZkr+jY/p9CQRD4p8DOBwteItai05qn31FFdfLlFxYWgCDUIkRkj/TxbCEi/89jfPZ3X2VqYSJQbmUNQY3HQT7hbv2sLoerVwKQHNEEoCsm8R4MhPRjXUGzVEIKIoY7yaEYuY4dgGb5RXruoSgtSCLLarkICQ9f6QNykGjFdjsIBaI4kGlt8W+Rg5g0HJ8qAp47nihAzFpuWtPIMBZJlASILvR6fQ0DCVbJCkJOJCqnk4pGpb99tZ8MopyiKDX7WWDiwYKXiEQOehCrgKh+eJQ+EQHo1Lby/zRlyf8TIbf9XS5ftIb8I92YugH4ay2pLusorl7dAoonWtMwQSTdOFuQSLTGHyIC8kxSIQuA4hwU2WUAoO4/grBcDbsfWElSzg+JCoYDoEGM1ixSkHzgF/wG7y8sIa3J7JPAGWuFJSQIaU01iJHUiYP4e33BrPOHmG/JMaOfTZVYRhwGav87vWKPJ9/rSH4IOGO5sITqg/ggxXs4TOaBAECbeoOsgfl+DrQShFqcEIhyyt0MbMusEkx76iAZXKM8BvXiZAGlF+KaIbaadYpem4aDgpJZQz6YJABV5VcHAJZ0v4FxX6KG5UpYs0KnqjhRuagEVgPglYAl9ciHf8mdUrJh0Qx9vkDBzBywfbkYQIGwahA/kglATsHsDzKA0BATiPyZ4NEDwIeoa/uFYKKXL2f24nQoIgd9R3yQCMTFqwIAfdBWI7+yB5ZLECYLETd85YJl+2YAUNosLIel/xYlu4Jsl6bhNhD6it4WJCvA2Zc4Gxo73RcgJeOqFmGR6rcChLYACyGojmEYdj59KnZ+tIQRhH9IvWA2hiREjDeRI9Cly7fMF3EtWRFawhQIf5IJwE56wdTIYdt7tp9ys1K8JnoJvod9Wn682PNkP4hUy1ndWgstAtBDMLYN5/6PAc5DGNoF4SrZfN+4+IhT8jqwg2Cp8ThIJ5vfSWBXAVCrWN9SMxDK+skaOvhoAc8me654pmUB3f0wyt+E8FyRAGmPlOEoiSD2qgvmAKoOm52fAuiTDHSyIRxx+lI0QxxADubfF5vffMmSajrWlP7nmZ3dSy+4r/ZzAUEHnQ8R70HsXlK+PgJsW68G4XYGZj0EY2EYATCAT6tAhmE0DXcC4faapcwMgAIfLb0kuzT9Qmw5uwAAIABJREFUSi+EfeALkSrpBovbrQDnkm8wAo8/E3i+CCsZ98NCpAp8cUekZyBavI4ET/TnaAk/RQCyAXy6uNSPA0i+wMeB6ePA5HFgZq2wpNGK3FUDAHmv3fSCe7afX8CB4UNEEOolVi/3obastNwJ9cO5BOBKEQMsAcifHWzRAigWWAlCn5K2bQYAOe1KMjTIR2kRUhKVS7IrLia0v+3xwHMZMCbYNP0KfG79zAqK5DxOvyEuWu6VD5KSHy2YAEQAfpaRdl5UkuUctIpBnCIIl4psD03FtIIP1ADAlBuJM47EqqUX3LX9kSBQcuuyftK78xUkHyQ+RLqHZ3Fv1KcgLj5kAQ1s0Qo6IA1nHhNLQzA8ZxvBXuNx8DcS5UYpNnoYxsCnUIqvZo0F3wPTMa7Hv53HOJVbS/l+5bumX7d+5WLE44hxIRJB2NMCqj9ixwuE90svWCaIA6bAp959EKeWChAyA0PTOV2unGMQveCO7bfqHbcS4rJR7Ewqnw5AWhLuImg2uFQAXAVs8RGmntW4+g2hB3P79L/EJ9zGvqrxOPibiVihAOgrWQOf/EBfBcsPNBBqW9Hv6zzGqFzmoXz3B9AePgXiq6bgiv4YOB9QHS8AfpkAFMMjrWAcQA0iO9XJiQyAnos2vV7ESHOOQfWCO7Zf7F40mZFQScRKAYBaSU6vAVcTgN7xXHiUFpDTMK2dFh56912BTiDcvpkATIXzCL4g3WXTZ4jpGfjoF/oihL+fx+0yWUABLwIwtYKKIabgCzHQvi2ggBKn0McEQDaKT5cGkIOo6SuyYzEfjQB0EM5nZgAPoxe8of3sgSqCQM3jkdFLvpRvR13+7UVRuhUFSavNO6otwp88ZZ3+t4M6HLtch6OT9AG/q9cmtf//gV1JDYcnQ2zY6/YakfSrU+Pg1M45NqPt3IEtoM7WFHokyrWKkooglCMWLYjiUXMtK3g8Uzd1WL3gDe3vRRCoUEYCwGtYFxxqgA2E/jI20F5hhmQod98BHNnlxOTig1aGiDanO21yV4DygWuB8YeB6fnC9WEtiKVVKeE0ZGiXWczeJoWMIig5a9V5DA1ANoKDeDylZ9NSXxyAsiKawrQqmCv2HVf5e8aRoxfc1n7xs+khItAUvojvyWryxVcWJZksVSyZoQRA3dcAoHzax4Gj2wtu6FVKM7gMgti02jbV476oUJJs1j/AbA1mQ3Pm8eTRsoZDtR+xZKCiEKmMXTIeXHPGdhYArX8FwG4DGMEnAHIK4yvT58nWC2b73cexaZgWWaEKgU1gjNbPP7PvOYGsUSBkv3hBtmRWNzxjTk9RWktvxp6POj0vARjY9sWkFel8RWxegjIF4RjwAOnZWMPBTGjqvHmszxJOBUD3xyznL2bqROvoP3N3q84jG4C7M/PpcvMBef0cvV9k6hXv+2Yno5QfGArRbaCC0mWv2YtF3ecerNDhkNZIIsXQRv5dlTtGADJSz2gEE1EJQM//026HdIEZLC8B6A0tk0g1Ja8DuzJdphS82QBEZj5dbj7gxZN5er/IZI+67pscgE7QaDOUMyC0Wb8+gXjuR4F5J6YsaXnFhBoAGEVvUhb60jISgCQnoh/OLBgvIrL8v7DdFkEYM5dtNg97tvz5zJqzdfIBmJlPl5sP+DJP5xtW7xffnzeh7H+Z+3+RpkyWT1YxuURJYVtx6T0fCTocouQV85VkHRIGegEuEv/YKpkA/JceVmL8kv6t5/9pu62tfiPWcFQVEa0DZ9WcLJEPwMx8uvfnjT9IgZyj94t/ldeA/S9tMaGa9SNdmsIxbvVscVJ1GScoMt4UPwhAsmMZ0aXzQBsvdGRBjQz0FUpEJRAJQOq4KAnBdz+sfiPJ3bOYn8fsykyVWMfiN3BOzckS+QDMzKe7OW/88aqQzsfE5kH1fvGjeQ0wADodmVGwOeiMsUqHrGOnS4UFy9P/wAEojkEnI+IqOIJQNLgpCXhcmLAtD/D+kgQE235L93tj+YBqgTX9BiCeW/NedT4AmQ+YkU/3sbzxBymQuZhm8g1T+QbV+wWFdjKO/Te2mEFNlCb6gPF708VJ1TXHgKd91GnZpDfi1k/gM2vqU3DUnCuBmNQe3P9vw6pe229KOvB0K1k+ZS+rnrfM2AlA3JMZtah/EZKZT3drxuDz1O/yxAwu9JgJxr3lQfR+8aa8Buy/wdWQZAVl+ZzCrG3q9c/YrkmHy3IRYryAAqAkEBIlopJxNNUbER+fA/H+/+AAdP9PmS9dazicJybm7mlB8nR2dI1HvgVkOlZGPt2nM29GCamcGZjAwlQ+vvrV+8X/zGsAAUiLVPp/wd+zaTMFWw+/kAA0GQQnpCw5mDsAMIrcRB5mC/+MAffTwgfwKY2KfmCZ6ZIkUShrxXxBX4yYaV8Hzmcn13jUA8CMfDqWYeQcSkhVOl8U6uxH7xekrsg49h8oiCENgC5TUG5vKxxT8f2aRtOtcAKQ1s8soPuOVUIwpchNlEEIOyNSIrrvv3hwnckWIZPZsnbcDyzTpvg3lU8mpZQqozyfK74aj3wAKh1LgrsD5tMxiz/nkGD1sHq/YNFOxkEAcuW7oqmXlisuQOT7VV2jwi/kTgj1RkoZhBje8Z83SCAEEJZW0C3gff8tADCt4VASaWIBK0HI9q8BF5yUAMzIp8tNx5Jg9bB6v/jdDPSRns0BWIZeUitIo9IhHmhXTvzCPQddccnZ76U1V/IvC4SBCFyg26DFNg7c++Mhhb6qiCikT7WVUmr6lYn2nRKyrdZ51GMBlZIc07GUBdMjny6XCiUmpA6j94vMZbgBMFo552pu27PXAqXTyAUQcitOQjAm9xX0N9pIwIPmSCmH5QuPqER0L4kDYgp9zOUL6fYxkbZcFceyAreAF3GlV+NRDwAz8uksnT3jiILVSmpWNlhMze+k94vMZfgGAPJeHDjpCrgM01Tdry9OzvmYAzAqLVWIwEShwzbRwwSEn+MqP6bQK5tZlWyhjCCCsC19Xv7gOnBRbgp7cu/5AOyVjqVMmA75dJZ9nHF0yohWNlhMxKnS+0XmMtwAmFq4imnYbrEqNJPc+9kfd62RKh0On8qV9hXZ9askEPgAfI56ziocUgVbzGT28lEtRMoKtg7lBHtznfZNA+CQ+XQWM8k4uglWK/NLYKzS+8U9GReXD0g/Tyvh4Ne17Yb4Zbr6g6y7/aNWcoPpjKRTsJIags5IJwkEAv6en05S6GUBfRWsUExZyVZVQCQwrgN7Wfdd41GPBczIp8ODeXfTSbBa6YYxlY8/p3q/udc3C+jTbtvqt2oadnB2m4oNgMn0W0p+hYWHWbwg9yU/0Kb9EIy+5y2hiCit4UgKyTeAkN8Valk4Le/ldlONRz4AWWBRM6fdIPfHstw/G+SE5rMnVQ/kA5AkLHS0ak7V7reXfhgACaBqDtD3e/nmc5k9kA/A80JReq+U38zGVp3ObJo/BvAOD3dtwiWar9zEHsgHIGlFubqSx7+Jja36anLLcDvvgwA+NDpDfILv+qlzuXwAXuSjrkKemlO2e3U1uWUYnL8dwB/5e2apca9LNv+vsQfyAUheX4VguB+mzIsaG9ntqxhF4Xbe3QD+n7/uHLAW9wQ1tblMRQ/UA0CaHC7plXEh+q4T0OWcfhleYTSHBK0EH/mi+fcRuKQn4I6fWpeoB4AevCz3HOOm9yb3F5mBlZBNclYCj1aRfyfrbgPCTR6AzK+vD4CyglX7jpmN7HY66d1E0ctdIrEEE4wEIMlam+Pk7YF6AMj7EwAVbU82vTerCwhAXopJN9zVI+AYrOeULLZgErY2x8nZA/kAJGWr0naUWdFpy2cT+oCWjpdjLFxE5UzYIBBpEUX5nLnlvAktb76SPVAfAOUHpiAMm96bsVtCAMaKALICMyxDq6cXfycA+b/mOLl6oF4AiqBRIEzBp7/X2Af0+fi1XIioMIlAI+AIPIGPmeROWV3j1Zuvyu2B+gHoFfZiDS2lC0LiY52WUADkQoTTMH1BFSYRdHoRfKSu5v9qrizMHYPT+vx6ARhSuDcAzzmDo5ZGHT1PAKYMwQxME2jiSo/gEwBrrq+u41ZOy++oD4BaCcsXTPiSI3ey8s4KGoG8QwCMFM+0ggQhLR0BF19SXuD/ayakz7uR0/TsMcxg3SjfqWNA0hsrga/ojaq/8WPcC+YIk4Ke4CMSuB2XVht1Oj8zIfXlU8BtU8DhmYRXWdfrdF1fgr3+S8At48CD04DVjXQSDO70PTUnaJ5uOCwsIIFHSSFy1pKPWCDsZxCpw8UVgKSPxLXM937OzxxAljzcPAbcswU4Qh4V3UN8mKoeKm/bu78IfKJQa8VD48CylHQiL3O3/qg5Rf30BKACMtJXjXKQcfBSK8Dfqc3KVCwuN2VFGRnm/yKZtq4Re5ifyQQgM2A+BeB3GHaZBo5MAIue0l7Kt3cC4xhw+5eL7TuCkJk1jBtyerbUfYG5ExjZ/pqrxE5fAOrOq5SmowVIrRp1IyT2R6+fg0bgVYG4CsyZe2UsaiOGKXr4Sfp9k8CxCYAFSKyvXeY1o1BxQux91yMtfsHPutgnnyUuUvhc0ZsgUXib+nVkq6+ZKaABIHsgVZnuwD9sVo66rrR4ImdhLGSQ8zPL/JgBQxeU1ouWkO9PTgDzbgmXxrzMkatl3keivfG5x4r4IRcz5BfkO5vEZ0kgpIfBZ8yKjlL17syy0tMNcOn9dl4Fy6dLFabj1Mpvow9Ify+I4Nlo9Xt+ZqU9VdJpqZh4QDDyxUyYOYJwHDg+DhgI/WUVZl7aSEt93+GO9Ia2iuZKOfA7lhp9JpvAVy61w2mOwO5hmCgMHC1H9O24gu6UD9jP+ZmbtLRaSsei9SL4XDPbAEh/kGQ/pSUcc0lbApFWb67lQUhpVnLBsoKqqZclFMmUtrxPcwxl3X7vOCAtYLSCcugFQmqhdssH7HU+RznjiOlYXA8wqkOfkItTAom+oKygca4ES8jY+N3z7fSG4hfUtp3ihUHruVSsFy1iRvNP+1N7A5BdJACmVpAgZPhGOyCigEjlPLudn7kvFtOxuB4g6OjD8UWLRkCZFRwrLCEXJQQhp2K+37lQeBCRX1A7KPQto1prFEmSYn2mB9EAsO+kYfk8KQhZF8yjVz5gp/MztyOUjiW9bCUhEBhKRCCgSis45uQ/PhX/xfFWMgOnWu2gxB0TF/o0kEZ/kCDM1Ts+3RHYnwVUL6XhDFrAswfIB6w6P1MrTulY0sum1VICglKwCEACqvQFCUK3gHcsFQCM/ILayqP1k9JshVqrncMalOYYvgcGAyCvIwuod8YBJQmZpmGJeyRwkGw4n8jJOJQNw3idLFhMRNB0SgASTJyKoy/4ieXCeFfJBUeV2SoAclFyR0bbm1OHTUiN0/DTAwD7zQeM52dqj8VsGEkVE2jKetG7AEhQ0frJAv6RC0trC1skl+IWlNinGLbSaZg7Mc0xfA8MbgF1LQV1z08A2G8+oM7PVF9Ms2GUE0gQyp+Lwu2yagLgR9ZaYpkSypQ6a6Q2DCqzpkvietXIFdoZfuieGmcOD0DeP0HEbBhNwYPmA/L8zJQsATAKnguEqS+XTqkE4YfWWwCUFZTksYAYwZfIBeN9Tw0cjOwu8gDIZqsoSSvhEeQDiiGYFoyWiSDRypWgi69UP5sc5fIcquSCNeXqe2X9ZAHfM7Khe2pcOB+AT41+aO5iRD3QAHBEHd9ctuiBBoANEkbaAw0AR9r9zcUbADYYGGkPNAAcafc3F28A2GBgpD3QAHCk3d9cvAFgg4GR9kADwJF2f3PxBoANBkbaAw0AR9r9zcUbADYYGGkPNAAcafc3F28A2GBgpD3QAHCk3d9cfOxqYJ2au9RdPtdp/khoEOlglDYT39V1PzQFXLsMXAlgt9PCxJKPbufyf8/KHIPfBPAZABf79Xc5XQ0ZQ1Q7360NbxoHrlsDvs5ZRsgo0une06by6X1mZvtP99PNAp4F4LsBXA5gjw8EGTeqaGF4QhzQF80CX7cAvGIdeDYAfhdZ2sTKUcVrpE7nd31N5gj8e2dIo2osk7NZpMdK0Z19tv+bJ4F9K8D1ACj8yfNSikHeg+5Z969m57Y/8/ZP+dPLKZhP/rcA+AYAF7g1oRUhEMUzFMt6eSJfX78b2DkPfM0i8GIAX+uWlAMppreUUErn8p2gzTl+2flg/sDbTkvIOik+CP20//mzwAXzwDcCuNTPJeFXpEpM6QEjIHm/zTF8D7T5gATYNQCe69aAloRTGulfBESBSYNyxR5g/Bhw7hKwZwl4vk9LnM5JmsBzUyDGAX3B8G23Mz/g9BuUa/0IiutfMkj7zwKmngAuXSvOpUvAWYBtF4BTnspIj/O8zPaf7qdvWITw6eZA0JLQEhKEGgxZhUj/dz3NzSKwbR44exnYvVKcy+mM5Km0JhxInUtrGkmzCPicg3W5LMGkQiZZTm9xS9Z3+4m2o8C5c4X15pTKW2Lb+fCx7WLtjYxzqiql29Icw/dA5SqYf6RTTilg+lYCIXmICKQ4IK9wxfSJY8AZK8CuFWDnanEua9ZTAMsaCog3Dt92O/MvnRGBtGwkqKRmMEkqCaa+2k+0LQDTh4rP88UHj74kF1WaATo9QHQ7mmP4HugYhtEKj4PB6ZQ+FS0hQahpldPya1kXTOqNY8DscgG+HavAttUCvBxInitrkgL4lcO33c7spBdM3kAuSnq2nx9gQfAh4JyVwvrxwel2z3p4aMlzH6DM2z/lT+8aB+Q/OT4EEqckWQSBkGD6EQKQnDCLwBSnYgcf32fXioGUFawC4esyu7CXXnDP9tOCsyD4KLB1rmgvX7zfbu2WG/Jtme0/3U/vKxBNAMoi0KcjkATCN3HOEr3UAjDrwOP71rXixYEkeKMFlSX8ocwR6KUXTJ7AaNE2tF8WfA4Ye7Kw1mwvX/yZn+eKnvcrfzC6IK/ObP/pfnpfAGQnySoISBqUXyAASS1AK0JfagWYcRDOrAF66TxZQU7jBOEbM0egH71gcgXSFZAV54NQtj9YcNIpbONCyh8Ygi8CVospApDuB63g92W2/3Q/vW8AsqM4gLIKBBIH8bcJwMCNMX68BTqBb8s6sGWtsIA6jwDk662ZI9CvXjA5A6NVa2t/IAicnC/aGV+8T74IQPm/AmGuBc+8/VP+9IEAyLslAKMV/LgAyIUInfnjwPQqMOOgI/DstQ5Mr7UAqMF8V2YXDqoXXNl+EQQ6N9v29aKdesUpWJZbAPyPme0/3U8fGIDssDid/pUASCvCaXgJmFguAEfgEXT27gDkuwaUg/nbmSMwjF7whvbLhSDL5TwwvdRqo9oqHzACkCB8U2b7T/fThwIgO01T1IMCoAZxGRhbKoAXQUcQTjkI+a4B5e5FzjGsXvCG9gdqrLGFYrpVG/UuHzBOw2/LaXxzbh43DKeoJwlAHqLndSs4udoCoIBHQE45EPk3DuitmYOQoxdctp8+rFwIWsGFYiFFoLGNchcEQC6e+OJC5J2Z7T/dTx/aApYdJ37AyJK/DIwvFxYvWr0IwEn/H1Opco5sveDUhSAAF4HJpQJkWixp6k2n4IYfMGf0amDHev2I8+l4/UbvNw8Eozw72wJePOJ8und7EkKj9ztKGA1/7WwATo44n45pWI3e7/AAGPWZ2QBkYHCU+XTMfGGQmYIxjd7vqOE0+PXzATjifDrKtTZ6v4MP/MlyRj4AR5xPF+VaqZLJF1UzKdPV6P2eLDDr3I58AI44n07ZMARbo/d78gMubWE+AEecT8e9YOn2Uheu0fs9tUCYD8AR59MpG6bR+z21gKfW1gNAz4geRT5dTEZo9H5PPRDmAzBmRM8BJzqfLiYjSKKr0fs9dYBYDwBHmE9XtRfMsIz04aQZ1+j9npygrA+Akqs8wfl0BCCTWRq935MTYL1aVQ8Ao1zlAnAi8+kEQGZTNXq/vYb75Pt/fQAcUT5dBGCj93vyAaxXi+oDoFLyT3A+3Rcavd9eY3xS/z8fgCQX/LPR3SOzkon55jg1eyAfgD8M4NcAPD6aDmBtB1e4NMDNcer1QD4AbwbwxwDe4UvRE9wHZG1gNSXDLlwLNcep1QP5APxzzwj9IIAPnXhT5ORc5EYCA9HNcWr1QD4AmRH6FQBMTSZZH98ZmD5Bh5g1FopiNns1x6nTA/kAvAfAEwDudnI+EvQxPfkEzYfaCXRSBluQMB7YHKdGD+QDsBNBH/9+AkAobqTADGK7Inw1x8nfA/kA7EXQt8kgrGAGMfBxZ5Cv5ji5eyAfgL0I+r68uR0QmUFoBQU8vfNvzXHy9kA9AORoMw7CdGQCjoUZDwL4kv/+8OZ1gJhBIjGDgMh3vTavBc035/RAPgD7JegjODfhiMwgoqeJwNPPTaB6Ezq/hq+sB4AcXeXEP+ZhGVo9vRimIQD5v5oPAZCupgDI9wg8/qz/1Xz55usyeyAfgMMQ9GU2Op4eAchpOIJQQEz/VuPlm6/K7IH6AMjgGzdl6QtyX5jWjpQFevF3lq3xf6yhrOlIAUgQCojR8gmE+l9Nl2++JrMH6gEgR5UA5KYsc+AZmCbQCDi+IvgEQMob1XBEAHIajgBMLV+0kCdws6aGu3zqfkV9AGTwjftg3JRVVRAtHQEXX/wbAcoXP5d5CID8GoJKvqDAloKOoIz/y7x8c3pmD4zhaqwjRzCYyQg5gr2ZgsFTLweWr8XQgsXjbwLWrnNtMlKgNoLBmZAa7PTCAuYIBlMvlWQswwr2UlUw45jdDSx8HbD+Ctd+HVCwePKbgJV9aASDM8Yg59TWFDysYPBtmYK91IbNOHaPA/M7gUXKXA4hWDz79cA8+W0aweCMURj+1HYfcBjBYO54MMY3tGDv8I3nmWSHOzYOLJ0LLPGXAQWLz3oB8MQUsEa16kYwOG8whjh74yJkUMFgbsNlCfYO0epwissVY34bsHw2sEIRkAEEi/dcU0SP5qhF1ggG5w3GEGdXr4L5134Fg4kAjuDQgr1DtDqcUmZETwArZwAru4BVqsv0KVh8/o3F4v0QXZBGMDhvMIY4u3MYhv95Zh+Cu1xBcxuOU/HfeDIq5cv7FuwdotXhlCBXjOXZAnyrO4BV6in0IVh8wStLuWCsUAyvEQzOG5ABz+4eB+R/ewnu/kOP/3G/l4kJTERlljQtIot2e53/IwO2OPl4FLtcnCqAp9cahT56CBZf+LpSLhhz1N5qBIPzBmTAs/sLRHcTDKbiNHdBGGymOC/3hglEvgjAnoK9A7Y4+XgiV4zVWYDAs/etxaubYPFFP1QkLtCIP8neaASD8wZkwLP7AyC/tJNg8L/xLNBu+YBdBXsHbHEFAINcMVamgdWZAoRrfPdXm8KitLdmgYveWAq+2y7iMqfuRjA4b1AGOLt/APJLqwSD3+y5T1yI0AoSbAxMMzGV1o8/My2ro2DvAK2t+GgiV4zj4+3AIwDXtwBrVJeuECze+9aW4Dut4PxkIhYsdetGMDhvoDqcPRgA+SWp4O4veQ5Uv/mAGwR78+6rQq4Yq9PAOi2fA4/vBkKudKVU7VZw77uKvWFuZbtcMNb5v0YwOG9g+jx7cADyi6Pg7gccgIxlcA5TKhaD01yYKBmVFpBZMfx/m2Bvny3t8LGqoqTliZbVI+gMgHwnMAnCIFi897cLAAZ6QyzFzzSCwXkD1OPs4QDIL5XgLmk5JHk/SD5gKdibd38VcsVYGmuBTaAzEHLHgyCcaokB7/1IkUET5IKxwF5pBIPzBqbPs4cHIC/AaeqvPL9pmHxAE+zts6VdLCD/lcgVY3UyWD0Bj1ZwqgCggXA7sPfWAoAJvaEtZBrB4Lyx6efsPADyCtmCvf00s/NnOsgVY3m8BTRZPZuGBUACdArY+5lWDqGmYbIrLHEx0ggG5w1OH2fnA7CPizQfaXqgUw80AGywMdIeaAA40u5vLt4AsMHASHugAeBIu7+5eAPABgMj7YEGgCPt/ubiDQAbDIy0BxoAjrT7m4s3AGwwMNIeaAA40u5vLt4AsMHASHugAeBIu7+5eAPABgMj7YEGgCPt/ubiDQAbDIy0B8ZYNMbkX+ZekpuIiOQrPar+xs889HJg6jZg5jAwvVZ8B+ll9PlO5/Fc/o+ECjnHfi8zYfkvM5ulmp4qJXVqx5deD4zfAkw/CGxdAZgoHfuh131QkaI5hu8Bs4Ds8B0AWLnIRGCBsFfn87JffDMwdjOw5R5g8giwZa34jnQQUwDo99wBfJ4TM7COiNdlaj2rA/jeV/vfDeATAP4UGH8I2Lrc6gc+SHqY4oMZ74VSKM0xfA+UUzB/oBUUCKMl6zSQ/PsXqZD5KQC/A0w/DEwcAcYXgYnVwppwADuBkefnCim90FmBWXwnK87Uen53BI8sbuwqaz9p5UgnQhBS+ZN1zE8Ak0utviCwq8DI8/nx5hi+Bzb4gJzKZE1SEFZZgS9/2pWR/gTAJ4HJQ8DEMWB8ARhfBsaWCwDquwQKvvNgHXvOcYVbPFJPkw+dDxC/W1Y4tWDpw/Rlgo4lo1T4/KxTihDNpJwj3/UiMLXemprjffC7eWpzDN8DlYsQDiKtVxzEqoHkyX9HRizW+nIgaQnvAiaeBCbmC0s4tgSMu2rMePAR9X252jXklaTFU108K0MHav/nvJ6ZxVVk9OI7GR2IZoGQNc/HgbHgIwqILIVujuF7oOMqWFawCoRxkfEIB5CWgkREBCNf9wMTc8A4QciBWyoGz16rwNgaML5eWKpctYZL3N+TWLX0gvtuP0HHk2n16JDyxXmVhfU0qywbJbr5GSuXKxA/sV5Y9UYWdnjwyS3qKKgarWA69Wg6fjQOIK0HadnIjPVFB+AiME4AuiUkCFnESyCSkmAuU7Cjm15wX+2X2ifBRn9A8mKcW2UFjULVQcgVDl80u40SYh763FfvquhLCxitoBYUsoJfjXKttByMq9CKcHn4sPuCbgXNJwyWkECcz5Q376UX3LNncZyQAAADEklEQVT9fFgIJs6lBBwtn3Tt6FpIz4RWnuQxPh2XIGzm4CwQ9hWIFgBTK0gQHiIAJddKq0ELQh+KL1qUR4MvSEsoENIKrgALHNiMox+94K7tl9qnnMio8MSf6SNwGpYVjCDk/Ju7isq496fCqX0BkDeqlWwKwic1gAQSpzGREnFgREz01eALLvvq2Kfi45m6cf3qBXdsfxRbJMho8dimqOhEK8cXQRr9QVpvPoDNMXQP9A3ACELFxPh+jACkP0fLIKFCCRRqKuPUdqjlC9o07JZwKVNHeBC94DQcZO0XAAkmgotAk9QYrR9f/BvByYfMSATDVMzwTXMM3QMDAVAgVHCZ7/MaQK4QZUHiNCbBQlqUw74YCb7gcmYkelC9YFlwvVv7RRAorTuBkECU9asCID9/x9B935zYzyKkqpfiNHxcA0gLQgvBAaPVkCqm3h2AtC5m/RyEqzw/4xhGL3hD++MmslgqCbgUfLKAcRrmTlBzDN0DA1tAXUlWcDm1IOIIJAjlT/Fd05lbFQFwjdtgGcewesFt7Rc/Gx8iWjUCjGCT1YvWT1MwgUqrf3NG45tTbcu0aximWx9xENcEQHGbcYAEwtSXSqY0gnCdgeuMI0cvuGx/FUGgFhwEYrR80QckWN+X0fjm1DwAWv8RgJFilJZBznz0pQg+AZAAlVWh1GvGka0XzB0cCQi30aSGVa9AF62fLOB7MhrfnJoPwPER59Px+o3e76mL5Kwp2G57xPl0kxc3er+nLvyKtLmhfUC78RHn081ONnq/pzcAR5xPR9mRRu/31IVgvgUccT4dNaobvd/TGYAjzqejumqj93s6A3DE+XRUg2VSCjdaGr3fUw+I+VPwiPPpqJjO8J1Nw43e7ymHwHoAKMFd7QErAeEE5NNJMb3R+z3lsGcNzgfgiPPpomJ6o/d76oGwPgCOKJ8uKqY3er+nKwBHmE+noqRG7/fUA199U/AI8+kEwEbv93QHoEhZTnA+nYqSGr3fBoAtaiqBUImdm5hPJwA2er+nKwBHnE+X1gUzSbnR+z11wPj/AeCpPDD3t7rvAAAAAElFTkSuQmCC",i3={LOW:0,MEDIUM:1,HIGH:2,ULTRA:3},n3=class extends R2{constructor(){let e,t,{preset:i=i3.MEDIUM,edgeDetectionMode:n=o2.COLOR,predicationMode:r=l2.DISABLED}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super("SMAAEffect","uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",{vertexShader:"varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",blendFunction:D2.NORMAL,attributes:I2.CONVOLUTION|I2.DEPTH,uniforms:new Map([["weightMap",new gR(null)]])}),arguments.length>1&&(e=arguments[0],t=arguments[1],arguments.length>2&&(i=arguments[2]),arguments.length>3&&(n=arguments[3])),this.renderTargetEdges=new LA(1,1,{minFilter:TE,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new S2(!0,!1,!1),this.clearPass.overrideClearColor=new MA(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new U2(new c2),this.edgeDetectionMaterial.edgeDetectionMode=n,this.edgeDetectionMaterial.predicationMode=r,this.weightsPass=new U2(new g2);let a=new TI;a.onLoad=()=>{let i=new IA(e);i.name="SMAA.Search",i.magFilter=CE,i.minFilter=CE,i.generateMipmaps=!1,i.needsUpdate=!0,i.flipY=!0,this.weightsMaterial.searchTexture=i;let n=new IA(t);n.name="SMAA.Area",n.magFilter=TE,n.minFilter=TE,n.generateMipmaps=!1,n.needsUpdate=!0,n.flipY=!1,this.weightsMaterial.areaTexture=n,this.dispatchEvent({type:"load"})},a.itemStart("search"),a.itemStart("area"),void 0!==e&&void 0!==t?(a.itemEnd("search"),a.itemEnd("area")):typeof Image<"u"&&(e=new Image,t=new Image,e.addEventListener("load",(()=>a.itemEnd("search"))),t.addEventListener("load",(()=>a.itemEnd("area"))),e.src=e3,t.src=t3),this.applyPreset(i)}get edgesTexture(){return this.renderTargetEdges.texture}getEdgesTexture(){return this.edgesTexture}get weightsTexture(){return this.renderTargetWeights.texture}getWeightsTexture(){return this.weightsTexture}get edgeDetectionMaterial(){return this.edgeDetectionPass.fullscreenMaterial}get colorEdgesMaterial(){return this.edgeDetectionMaterial}getEdgeDetectionMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.fullscreenMaterial}getWeightsMaterial(){return this.weightsMaterial}setEdgeDetectionThreshold(e){this.edgeDetectionMaterial.edgeDetectionThreshold=e}setOrthogonalSearchSteps(e){this.weightsMaterial.orthogonalSearchSteps=e}applyPreset(e){let t=this.edgeDetectionMaterial,i=this.weightsMaterial;switch(e){case i3.LOW:t.edgeDetectionThreshold=.15,i.orthogonalSearchSteps=4,i.diagonalDetection=!1,i.cornerDetection=!1;break;case i3.MEDIUM:t.edgeDetectionThreshold=.1,i.orthogonalSearchSteps=8,i.diagonalDetection=!1,i.cornerDetection=!1;break;case i3.HIGH:t.edgeDetectionThreshold=.1,i.orthogonalSearchSteps=16,i.diagonalSearchSteps=8,i.cornerRounding=25,i.diagonalDetection=!0,i.cornerDetection=!0;break;case i3.ULTRA:t.edgeDetectionThreshold=.05,i.orthogonalSearchSteps=32,i.diagonalSearchSteps=16,i.cornerRounding=25,i.diagonalDetection=!0,i.cornerDetection=!0}}setDepthTexture(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:FC;this.edgeDetectionMaterial.depthBuffer=e,this.edgeDetectionMaterial.depthPacking=t}update(e,t,i){this.clearPass.render(e,this.renderTargetEdges),this.edgeDetectionPass.render(e,t,this.renderTargetEdges),this.weightsPass.render(e,this.renderTargetEdges,this.renderTargetWeights)}setSize(e,t){this.edgeDetectionMaterial.setSize(e,t),this.weightsMaterial.setSize(e,t),this.renderTargetEdges.setSize(e,t),this.renderTargetWeights.setSize(e,t)}dispose(){let{searchTexture:e,areaTexture:t}=this.weightsMaterial;null!==e&&null!==t&&(e.dispose(),t.dispose()),super.dispose()}static get searchImageDataURL(){return e3}static get areaImageDataURL(){return t3}},r3={DEFAULT:0,ESKIL:1},a3=class extends R2{constructor(){let{blendFunction:e=D2.NORMAL,technique:t=r3.DEFAULT,eskil:i=!1,offset:n=.5,darkness:r=.5}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super("VignetteEffect","uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb;\n#if VIGNETTE_TECHNIQUE == 0\nfloat d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset));\n#else\nvec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord));\n#endif\noutputColor=vec4(color,inputColor.a);}",{blendFunction:e,defines:new Map([["VIGNETTE_TECHNIQUE",t.toFixed(0)]]),uniforms:new Map([["offset",new gR(n)],["darkness",new gR(r)]])})}get technique(){return Number(this.defines.get("VIGNETTE_TECHNIQUE"))}set technique(e){this.technique!==e&&(this.defines.set("VIGNETTE_TECHNIQUE",e.toFixed(0)),this.setChanged())}get eskil(){return this.technique===r3.ESKIL}set eskil(e){this.technique=e?r3.ESKIL:r3.DEFAULT}getTechnique(){return this.technique}setTechnique(e){this.technique=e}get offset(){return this.uniforms.get("offset").value}set offset(e){this.uniforms.get("offset").value=e}getOffset(){return this.offset}setOffset(e){this.offset=e}get darkness(){return this.uniforms.get("darkness").value}set darkness(e){this.uniforms.get("darkness").value=e}getDarkness(){return this.darkness}setDarkness(e){this.darkness=e}};new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1]),new Float32Array(2),new Float32Array(2),new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125]),new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4]),new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3]),new Map([[o3(0,0,0,0),new Float32Array([0,0,0,0])],[o3(0,0,0,1),new Float32Array([0,0,0,1])],[o3(0,0,1,0),new Float32Array([0,0,1,0])],[o3(0,0,1,1),new Float32Array([0,0,1,1])],[o3(0,1,0,0),new Float32Array([0,1,0,0])],[o3(0,1,0,1),new Float32Array([0,1,0,1])],[o3(0,1,1,0),new Float32Array([0,1,1,0])],[o3(0,1,1,1),new Float32Array([0,1,1,1])],[o3(1,0,0,0),new Float32Array([1,0,0,0])],[o3(1,0,0,1),new Float32Array([1,0,0,1])],[o3(1,0,1,0),new Float32Array([1,0,1,0])],[o3(1,0,1,1),new Float32Array([1,0,1,1])],[o3(1,1,0,0),new Float32Array([1,1,0,0])],[o3(1,1,0,1),new Float32Array([1,1,0,1])],[o3(1,1,1,0),new Float32Array([1,1,1,0])],[o3(1,1,1,1),new Float32Array([1,1,1,1])]]);function s3(e,t,i){return e+(t-e)*i}function o3(e,t,i,n){let r=s3(e,t,.75),a=s3(i,n,.75);return s3(r,a,.875)}var l3=class{constructor(e,t){this.enabled=!1,this.effect=new e(t),Object.defineProperty(this,"opacity",{enumerable:!0,set(e){this.effect.blendMode.opacity.value=e},get(){return this.effect.blendMode.opacity.value}}),Object.defineProperty(this,"blendFunction",{enumerable:!0,set(e){this.effect.blendMode.setBlendFunction(Number(e))},get(){return this.effect.blendMode.blendFunction}}),this.blendFunction=D2.NORMAL}},c3=class extends l3{constructor(){super(q2),this.blendFunction=D2.SCREEN}set intensity(e){this.effect.intensity=e}get intensity(){return this.effect.intensity}set luminanceThreshold(e){this.effect.luminanceMaterial.threshold=e}get luminanceThreshold(){return this.effect.luminanceMaterial.threshold}set luminanceSmoothing(e){this.effect.luminanceMaterial.smoothing=e}get luminanceSmoothing(){return this.effect.luminanceMaterial.smoothing}set blurScale(e){this.effect.blurPass.scale=e}get blurScale(){return this.effect.blurPass.scale}set kernelSize(e){this.effect.blurPass.kernelSize=e}get kernelSize(){return this.effect.blurPass.kernelSize}},h3=class extends l3{constructor(){super(X2)}set contrast(e){this.effect.uniforms.get("contrast").value=e}get contrast(){return this.effect.uniforms.get("contrast").value}set brightness(e){this.effect.uniforms.get("brightness").value=e}get brightness(){return this.effect.uniforms.get("brightness").value}},u3=class extends l3{constructor(){super(Q2),this.effect.offset=new hA(.01,.01)}set offset(e){this.effect.offset.set(e[0]/1e3,e[1]/1e3)}get offset(){return[1e3*this.effect.offset.x,1e3*this.effect.offset.y]}},d3=class extends l3{constructor(){super(Y2)}},p3=class extends l3{constructor(){super(K2),this._hue=0}set hue(e){this._hue=e,this.effect.setHue(e)}get hue(){return this._hue}set saturation(e){this.effect.uniforms.get("saturation").value=e}get saturation(){return this.effect.uniforms.get("saturation").value}},f3=class extends l3{constructor(){super(J2),this.blendFunction=D2.OVERLAY}},m3=class extends l3{constructor(){super(a3)}get eskil(){return this.effect.eskil}set eskil(e){this.effect.eskil=e}get darkness(){return this.effect.uniforms.get("darkness").value}set darkness(e){this.effect.uniforms.get("darkness").value=e}get offset(){return this.effect.uniforms.get("offset").value}set offset(e){this.effect.uniforms.get("offset").value=e}},g3=class extends l3{constructor(e){super(Z2,e)}set focalLength(e){this.effect.circleOfConfusionMaterial.uniforms.focalLength.value=e}get focalLength(){return this.effect.circleOfConfusionMaterial.uniforms.focalLength.value}set focusDistance(e){this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value=e}get focusDistance(){return this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value}get bokehScale(){return this.effect.bokehScale}set bokehScale(e){this.effect.bokehScale=e}},v3=class extends l3{constructor(){super($2)}get granularity(){return this.effect.getGranularity()}set granularity(e){this.effect.setGranularity(e)}},y3=class extends LT{constructor(){super({name:"PassthroughMaterial",uniforms:{inputBuffer:new gR(null)},blending:OS,depthWrite:!1,depthTest:!1,vertexShader:"#define GLSLIFY 1\nvarying vec2 vUv;void main(){gl_Position=vec4(position.xy,1.0,1.0);vUv=position.xy*0.5+0.5;}",fragmentShader:"#define GLSLIFY 1\nlayout(location=1)out vec4 gVelocity;varying vec2 vUv;uniform sampler2D inputBuffer;void main(){gl_FragColor=texture2D(inputBuffer,vUv);gVelocity=vec4(0.0);}"})}set inputBuffer(e){this.uniforms.inputBuffer.value=e}},b3=class extends b2{constructor(){super("TAAResolvePass"),this.MRTCompatible=!0,this.needsSwap=!1,this.passThroughMaterial=new y3,this.resolutionVector=new hA,this.resolveMaterial=new LT({name:"TAAResolveMaterial",uniforms:{inputBuffer:new gR(null),historyBuffer:new gR(null),velocityBuffer:new gR(null),depthBuffer:new gR(null),resolution:new gR(new hA)},blending:OS,depthWrite:!1,depthTest:!1,vertexShader:"#define GLSLIFY 1\nvarying vec2 vUv;varying vec2 vTexCoords[9];uniform vec2 resolution;void main(){vUv=position.xy*0.5+0.5;vec2 texelSize=vec2(1.0)/resolution;vTexCoords[0]=vUv+vec2(-texelSize.x,-texelSize.y);vTexCoords[1]=vUv+vec2(0.0,-texelSize.y);vTexCoords[2]=vUv+vec2(texelSize.x,-texelSize.y);vTexCoords[3]=vUv+vec2(-texelSize.x,0.0);vTexCoords[4]=vUv+vec2(0.0,0.0);vTexCoords[5]=vUv+vec2(texelSize.x,0.0);vTexCoords[6]=vUv+vec2(-texelSize.x,texelSize.y);vTexCoords[7]=vUv+vec2(0.0,texelSize.y);vTexCoords[8]=vUv+vec2(texelSize.x,texelSize.y);gl_Position=vec4(position.xy,1.0,1.0);}",fragmentShader:"#define GLSLIFY 1\n#include <common>\nvarying vec2 vUv;varying vec2 vTexCoords[9];uniform sampler2D inputBuffer;uniform sampler2D historyBuffer;uniform sampler2D velocityBuffer;uniform sampler2D depthBuffer;uniform vec2 resolution;\n#define USE_YCOCG\n#define USE_CATMULL_ROM\nconst float feedback_min=0.5;const float feedback_max=0.95;vec3 RGB_YCoCg(vec3 c){return vec3(c.x/4.0+c.y/2.0+c.z/4.0,c.x/2.0-c.z/2.0,-c.x/4.0+c.y/2.0-c.z/4.0);}vec3 YCoCg_RGB(vec3 c){return clamp(vec3(c.x+c.y-c.z,c.x+c.z,c.x-c.y-c.z),vec3(0.0),vec3(1.0));}vec4 sample_color(sampler2D tex,vec2 uv){\n#ifdef USE_YCOCG\nvec4 c=texture(tex,uv);return vec4(RGB_YCoCg(c.rgb),c.a);\n#else\nreturn texture(tex,uv);\n#endif\n}vec4 sample_catmull_rom(sampler2D tex,vec2 uv,vec2 texSize){vec2 samplePos=uv*texSize;vec2 texPos1=floor(samplePos-0.5)+0.5;vec2 f=samplePos-texPos1;vec2 w0=f*(-0.5+f*(1.0-0.5*f));vec2 w1=1.0+f*f*(-2.5+1.5*f);vec2 w2=f*(0.5+f*(2.0-1.5*f));vec2 w3=f*f*(-0.5+0.5*f);vec2 w12=w1+w2;vec2 offset12=w2/(w1+w2);vec2 texPos0=texPos1-1.0;vec2 texPos3=texPos1+2.0;vec2 texPos12=texPos1+offset12;texPos0/=texSize;texPos3/=texSize;texPos12/=texSize;vec4 result=vec4(0.0);result+=texture2D(tex,vec2(texPos12.x,texPos0.y))*w12.x*w0.y;result+=texture2D(tex,vec2(texPos0.x,texPos12.y))*w0.x*w12.y;result+=texture2D(tex,vec2(texPos12.x,texPos12.y))*w12.x*w12.y;result+=texture2D(tex,vec2(texPos3.x,texPos12.y))*w3.x*w12.y;result+=texture2D(tex,vec2(texPos12.x,texPos3.y))*w12.x*w3.y;return result;}vec3 choose_motion_vector(){\n#ifdef CHOOSE_LONGEST_MOTION_VECTOR\nfloat longest=-1.0;vec3 v_choose=vec3(-1.0);for(int i=0;i<9;i++){vec3 v=texture2D(velocityBuffer,vTexCoords[i]).rgb;float l=length(v.xy);if(l>longest){longest=l;v_choose=v;}}return v_choose;\n#else\nfloat closest_depth=1000.0;vec2 closest_uv_offset=vec2(0.0);for(int i=0;i<9;i++){float neighbor_depth=texture2D(depthBuffer,vTexCoords[i]).r;if(neighbor_depth<closest_depth){closest_uv_offset=vTexCoords[i];closest_depth=neighbor_depth;}}return texture2D(velocityBuffer,closest_uv_offset).rgb;\n#endif\n}vec4 clipAabb(vec3 aabb_min,vec3 aabb_max,vec4 avg,vec4 input_texel){const float FLT_EPS=0.00000001;vec3 p_clip=0.5*(aabb_max+aabb_min);vec3 e_clip=0.5*(aabb_max-aabb_min)+FLT_EPS;vec4 v_clip=input_texel-vec4(p_clip,avg.w);vec3 v_unit=v_clip.xyz/e_clip;vec3 a_unit=abs(v_unit);float ma_unit=max(a_unit.x,max(a_unit.y,a_unit.z));if(ma_unit>1.0){return vec4(p_clip,avg.w)+v_clip/ma_unit;}else{return input_texel;}}vec3 clip_aabb_variance(in vec3 cOld,in vec3 cNew,in vec3 centre,in vec3 halfSize){if(all(lessThanEqual(abs(cOld-centre),halfSize))){return cOld;}vec3 dir=(cNew-cOld);vec3 near=centre-sign(dir)*halfSize;vec3 tAll=(near-cOld)/dir;float t=0.0001;for(int i=0;i<3;i++){if(tAll[i]>=0.0&&tAll[i]<t){t=tAll[i];}}if(t>=0.0001){return cOld;}return cOld+dir*t;}void main(){vec3 v=choose_motion_vector();vec2 velocity=v.rg;vec2 previousPixelPos=vUv-velocity;vec4 currentColor=sample_color(inputBuffer,vUv);\n#ifdef USE_CATMULL_ROM\nvec4 previousColor=sample_catmull_rom(historyBuffer,previousPixelPos,resolution);\n#else\nvec4 previousColor=sample_color(historyBuffer,previousPixelPos);\n#endif\n#ifdef USE_YCOCG\npreviousColor=vec4(RGB_YCoCg(previousColor.rgb),previousColor.a);\n#endif\nvec4 ctl=sample_color(inputBuffer,vTexCoords[0]);vec4 ctc=sample_color(inputBuffer,vTexCoords[1]);vec4 ctr=sample_color(inputBuffer,vTexCoords[2]);vec4 cml=sample_color(inputBuffer,vTexCoords[3]);vec4 cmc=sample_color(inputBuffer,vTexCoords[4]);vec4 cmr=sample_color(inputBuffer,vTexCoords[5]);vec4 cbl=sample_color(inputBuffer,vTexCoords[6]);vec4 cbc=sample_color(inputBuffer,vTexCoords[7]);vec4 cbr=sample_color(inputBuffer,vTexCoords[8]);vec4 cmin=min(ctl,min(ctc,min(ctr,min(cml,min(cmc,min(cmr,min(cbl,min(cbc,cbr))))))));vec4 cmax=max(ctl,max(ctc,max(ctr,max(cml,max(cmc,max(cmr,max(cbl,max(cbc,cbr))))))));vec4 cavg=(ctl+ctc+ctr+cml+cmc+cmr+cbl+cbc+cbr)/9.0;vec4 cmin5=min(ctc,min(cml,min(cmc,min(cmr,cbc))));vec4 cmax5=max(ctc,max(cml,max(cmc,max(cmr,cbc))));vec4 cavg5=(ctc+cml+cmc+cmr+cbc)/5.0;cmin=0.5*(cmin+cmin5);cmax=0.5*(cmax+cmax5);cavg=0.5*(cavg+cavg5);\n#ifdef USE_YCOCG\nvec2 chroma_extent=vec2(0.25*0.5*(cmax.r-cmin.r));vec2 chroma_center=currentColor.gb;cmin.yz=chroma_center-chroma_extent;cmax.yz=chroma_center+chroma_extent;cavg.yz=chroma_center;\n#endif\nvec4 previousColorClipped=clamp(previousColor,cmin,cmax);\n#ifdef LUMINANCE_DIFFERENCES\n#ifdef USE_YCOCG\nfloat lum0=currentColor.r;float lum1=previousColorClipped.r;\n#else\nfloat lum0=luminance(currentColor.rgb);float lum1=luminance(previousColorClipped.rgb);\n#endif\nfloat unbiased_diff=abs(lum0-lum1)/max(lum0,max(lum1,0.2));float unbiased_weight=1.0-unbiased_diff;float unbiased_weight_sqr=unbiased_weight*unbiased_weight;float k_feedback=mix(feedback_min,feedback_max,unbiased_weight_sqr);vec4 result=mix(currentColor,previousColorClipped,vec4(k_feedback));\n#else\nconst float alpha=0.1;vec4 result=mix(currentColor,previousColorClipped,1.0-alpha);\n#endif\n#ifdef USE_YCOCG\ngl_FragColor=vec4(YCoCg_RGB(result.rgb).rgb,result.a);\n#else\ngl_FragColor=result;\n#endif\n}"}),this.historyRenderTarget=new LA(1024,1024,{minFilter:TE,stencilBuffer:!1,depthBuffer:!1}),this.historyRenderTarget.texture.name="TAA.History",this.resultRenderTarget=new LA(1024,1024,{minFilter:TE,stencilBuffer:!1,depthBuffer:!1}),this.resultRenderTarget.texture.name="TAA.Output"}setSize(e,t){this.historyRenderTarget.setSize(e,t),this.resultRenderTarget.setSize(e,t)}render(e,t){this.fullscreenMaterial=this.resolveMaterial,this.resolveMaterial.uniforms.inputBuffer.value=t.texture[0],this.resolveMaterial.uniforms.velocityBuffer.value=t.texture[1],this.resolveMaterial.uniforms.depthBuffer.value=t.depthTexture,this.resolveMaterial.uniforms.historyBuffer.value=this.historyRenderTarget.texture,this.resolveMaterial.uniforms.resolution.value.set(t.width,t.height),e.setRenderTarget(this.resultRenderTarget),e.render(this.scene,this.camera),this.fullscreenMaterial=this.passThroughMaterial,this.passThroughMaterial.inputBuffer=this.resultRenderTarget.texture,e.setRenderTarget(this.historyRenderTarget),e.render(this.scene,this.camera);let i=this.renderToScreen?null:t;this.fullscreenMaterial=this.passThroughMaterial,this.passThroughMaterial.inputBuffer=this.resultRenderTarget.texture,e.setRenderTarget(i),e.render(this.scene,this.camera)}dispose(){this.resultRenderTarget.dispose(),this.historyRenderTarget.dispose(),this.resolveMaterial.dispose(),this.passThroughMaterial.dispose()}},x3=class extends b2{constructor(e,t,i){super("TransmissionPass",void 0,t),this.MRTCompatible=!0,this.depthPass=new P2(e,t,{renderTarget:i.transmissionDepthTarget}),this.passThroughMaterial=new y3,this.splineScene=e,this.needsSwap=!1}updatePasses(e){this.passThroughMaterial=new y3,this.depthPass=new P2(this.splineScene,this.camera,{renderTarget:e.transmissionDepthTarget})}setCamera(e){this.camera=e}setScene(e){this.splineScene=e}render(e,t,i){let n=this.camera.layers.mask,r=e;r.setRenderTarget(r.transmissionRenderTarget),this.fullscreenMaterial=this.passThroughMaterial,this.passThroughMaterial.inputBuffer=t.texture[0],r.clear(),r.render(this.scene,this.camera),this.camera.layers.disable(3),this.depthPass.render(e,t,i),r.shadowMap.needsUpdate=!1,r.shadowMap.autoUpdate=!1;let a=this.renderToScreen?null:t;this.camera.layers.set(3),e.setRenderTarget(a),e.render(this.splineScene,this.camera),this.camera.layers.mask=n}},w3=new Dk,_3=new LT({transparent:!0,vertexShader:"\n        void main() {\n            gl_Position = vec4(0.0);\n        }\n    ",fragmentShader:"\n        layout(location = 1) out vec4 gVelocity;\n\n        void main() {\n            gl_FragColor = vec4(0.0);\n\t\t\tgVelocity = vec4(0.0);\n        }\n    "}),S3=class extends b2{constructor(e,t,i){super("OpaquePass",null!==t&&void 0!==t?t:w3,i),this.MRTCompatible=!0,this.hasTransmissionPass=!1,this.clear=!0,this.clearColorOnly=!1,this.clearDepth=!1,this.needsSwap=!1,this.originalMaterials=new Map,this.MRTCompatible=e}set splatViewer(e){this._splatViewer=e}get splatViewer(){return this._splatViewer}setCamera(e){this.camera=e}setScene(e){this.scene=null!==e&&void 0!==e?e:w3}getScene(){return this.scene}render(e,t){var i;this.camera.layers.enable(3),this.hasTransmissionPass&&(this.originalMaterials.clear(),this.scene.traverse((e=>{e.layers.isEnabled(3)&&e instanceof vK&&(this.originalMaterials.set(e.id,e.material),e.material=_3)})),e.shadowMap.needsUpdate=!0,e.shadowMap.autoUpdate=!0),this.camera.layers.enable(8);let n=this.renderToScreen?null:t;if(e.setRenderTarget(n),this.clearColorOnly&&e.clear(!0,!1,!0),this.clear&&e.clear(),!0===(null===(i=this._splatViewer)||void 0===i?void 0:i.splatRenderingInitialized)){let t=e.autoClear;e.autoClear=!1,e.render(this.scene,this.camera),this._splatViewer.update(),e.render(this._splatViewer.splatMesh,this.camera),e.autoClear=t}else e.render(this.scene,this.camera);this.clearDepth&&e.clear(!1,!0,!1),this.hasTransmissionPass&&this.originalMaterials.forEach(((e,t)=>{let i=this.scene.getObjectById(t);i&&(i.material=e)}))}},E3=class{constructor(e){let{depthBuffer:t=!0,stencilBuffer:i=!1,multisampling:n=0,frameBufferType:r=0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.renderer=e,this.helperStartIndex=0,this.copyPass=new x2,this.depthTexture=null,this.timer=new H2,this._width=1,this._height=1,this.passes=[],this.helperPasses=[],this.autoRenderToScreen=!0,this.inputBuffer=this.createBuffer(t,i,r,n,!0,"input buffer mrt"),this.inputBufferSingle=this.createBuffer(t,i,r,n,!1," input buffer single"),this.inputBufferSingle.texture.dispose(),this.inputBufferSingle.depthTexture.dispose(),this.inputBufferSingle.texture=this.inputBuffer.texture[0],this.inputBufferSingle.depthTexture=this.inputBuffer.depthTexture,this.outputBuffer=this.inputBuffer.clone(),this.outputBuffer.name="output buffer mrt",this.outputBufferSingle=this.createBuffer(t,i,r,n,!1,"output buffer single"),this.outputBufferSingle.texture.dispose(),this.outputBufferSingle.depthTexture.dispose(),this.outputBufferSingle.texture=this.outputBuffer.texture[0],this.outputBufferSingle.depthTexture=this.outputBuffer.depthTexture,this.setRenderer(e)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(e){let t=this.inputBuffer,i=this.multisampling;i>0&&e>0?(this.inputBuffer.samples=e,this.outputBuffer.samples=e,this.inputBuffer.dispose(),this.outputBuffer.dispose()):i!==e&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),console.log("creating new input buffer"),this.inputBuffer=this.createBuffer(t.depthBuffer,t.stencilBuffer,t.texture.type,e,!0,"new input buffer"),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(e){if(this.renderer=e,null!==e){var t,i;let n=e.getSize(new hA),r=null!==(t=null===(i=e.getContext().getContextAttributes())||void 0===i?void 0:i.alpha)&&void 0!==t&&t,a=this.inputBuffer.texture[0].type;a===kE&&e.outputEncoding===NC&&(this.inputBuffer.texture[0].encoding=NC,this.outputBuffer.texture[0].encoding=NC,this.inputBuffer.dispose(),this.outputBuffer.dispose(),console.log("doing some kinda dispose??")),e.autoClear=!1,this.setSize(n.width,n.height,!1);for(let t of this.passes)t.initialize(e,r,a)}}replaceRenderer(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.renderer,n=i.domElement.parentNode;return this.setRenderer(e),t&&null!==n&&(n.removeChild(i.domElement),n.appendChild(e.domElement)),i}createDepthTexture(){let e=this.depthTexture=new Ek(this._width,this._height);return this.inputBuffer.depthTexture=e,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(e.format=XE,e.type=VE):e.type=BE,e}deleteDepthTexture(){if(null!==this.depthTexture){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(let e of this.passes)e.setDepthTexture(null)}}createBuffer(e,t,i,n,r,a){let s,o=this.renderer,l=null===o?new hA:o.getDrawingBufferSize(new hA),c={minFilter:TE,magFilter:TE,wrapS:SE,wrapT:SE,stencilBuffer:t,depthBuffer:e};return n>0?(s=new LA(l.width,l.height,c),s.samples=n):(r?(s=new zA(l.width,l.height,2,c),s.texture[1].type=NE):s=new LA(l.width,l.height,c),s.depthTexture=new Ek(2048,2048),s.depthTexture.type=zE),i===kE&&null!==o&&o.outputEncoding===NC&&(Array.isArray(s.texture)?s.texture.forEach((e=>e.encoding=NC)):s.texture.encoding=NC),Array.isArray(s.texture)?s.texture.forEach(((e,t)=>{e.name="EffectComposer.Buffer ".concat(r," ").concat(t),e.generateMipmaps=!1})):(s.texture.name="EffectComposer.Buffer ".concat(r),s.texture.generateMipmaps=!1),s.name=a,s}addPass(e,t){var i,n;let r,a=this.passes,s=this.renderer,o=s.getDrawingBufferSize(new hA),l=null!==(i=null===(n=s.getContext().getContextAttributes())||void 0===n?void 0:n.alpha)&&void 0!==i&&i;if(e.MRTCompatible&&(r=this.inputBuffer.texture[0].type),e.MRTCompatible||(r=this.inputBuffer.texture.type),e.setRenderer(s),e.setSize(o.width,o.height),e.initialize(s,l,r),this.autoRenderToScreen&&(a.length>0&&(a[a.length-1].renderToScreen=!1),e.renderToScreen&&(this.autoRenderToScreen=!1)),void 0!==t?a.splice(t,0,e):a.push(e),this.autoRenderToScreen&&(a[a.length-1].renderToScreen=!0),e.needsDepthTexture||null!==this.depthTexture)if(null===this.depthTexture){let t=this.createDepthTexture();for(e of a)e.setDepthTexture(t)}else e.setDepthTexture(this.depthTexture)}setHelperStartIndex(e){this.helperStartIndex=e}removePass(e){let t=this.passes,i=t.indexOf(e);if(-1!==i&&t.splice(i,1).length>0){if(null!==this.depthTexture){let i=(e,t)=>e||t.needsDepthTexture;t.reduce(i,!1)||(e.getDepthTexture()===this.depthTexture&&e.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&i===t.length&&(e.renderToScreen=!1,t.length>0&&(t[t.length-1].renderToScreen=!0))}}removeAllPasses(){let e=this.passes;this.deleteDepthTexture(),e.length>0&&(this.autoRenderToScreen&&(e[e.length-1].renderToScreen=!1),this.passes=[])}render(e){let t,i,n,r,a=this.renderer,s=this.copyPass,o=this.inputBuffer,l=this.outputBuffer,c=this.inputBufferSingle,h=this.outputBufferSingle,u=!1;void 0===e&&(e=this.timer.update().getDelta());for(let d of this.passes)d.enabled&&(d.MRTCompatible?d.render(a,o,l,e,u):d.render(a,c,h,e,u),d.needsSwap&&(u&&(s.renderToScreen=d.renderToScreen,t=a.getContext(),i=a.state.buffers.stencil,i.setFunc(t.NOTEQUAL,1,4294967295),s.render(a,o,l,e,u),i.setFunc(t.EQUAL,1,4294967295)),n=o,r=c,o=l,c=h,l=n,h=r),d instanceof V2?u=!0:d instanceof w2&&(u=!1))}setSize(e,t,i){let n=this.renderer;if(this._width=e,this._height=t,void 0===e||void 0===t){let i=n.getSize(new hA);e=i.width,t=i.height}n.setSize(e,t,i);let r=n.getDrawingBufferSize(new hA);this.inputBuffer.setSize(r.width,r.height),this.outputBuffer.setSize(r.width,r.height),this.inputBufferSingle.setSize(r.width,r.height),this.outputBufferSingle.setSize(r.width,r.height);for(let a of this.passes)a.setSize(r.width,r.height)}reset(){let e=this.timer.isAutoResetEnabled();this.dispose(),this.autoRenderToScreen=!0,this.timer.setAutoResetEnabled(e)}dispose(){for(let e of this.passes)e.dispose();this.passes=[],null!==this.inputBuffer&&this.inputBuffer.dispose(),null!==this.outputBuffer&&this.outputBuffer.dispose(),null!==this.inputBufferSingle&&this.inputBufferSingle.dispose(),null!==this.outputBufferSingle&&this.outputBufferSingle.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose()}},C3=new LT({name:"CombineMaterial",uniforms:{inputBufferA:new gR(null),inputBufferB:new gR(null)},blending:OS,depthWrite:!1,depthTest:!1,vertexShader:"\nvarying vec2 vUv;\nvoid main() {\n    gl_Position = vec4(position.xy, 1.0, 1.0);\n    vUv = position.xy * 0.5 + 0.5;\n}\n",fragmentShader:"\n    varying vec2 vUv;\n    uniform sampler2D inputBufferA;\n    uniform sampler2D inputBufferB;\n\n    // TODO: Why do we need these when postpro of framemode is enabled???\n    layout(location = 1) out vec4 gVelocity;\n\n    void main() {\n\tvec4 resA = texture2D(inputBufferA, vUv);\n\tvec4 resB = texture2D(inputBufferB, vUv);\n    float a = resA.a + resB.a * ( 1.0 - resA.a );\n\n\tvec4 res;\n\tres.rgb =  resA.rgb + (resB.rgb * (1.0 - resA.a));\n\tres.a = resA.a + resB.a * (1.0 - resA.a);\n\tgl_FragColor = res;\n    gVelocity = vec4(0.0);\n    }\n"}),A3=class extends b2{constructor(e){super("HelperPass",void 0,e),this.MRTCompatible=!1,this.fullscreenMaterial=C3,this.helperPass=new S3(!1,void 0,this.camera),this.helperPass.hasTransmissionPass=!1,this.helperPass.clear=!1,this.helperPass.renderToScreen=!1,this.helperPassOnTop=new S3(!1,void 0,this.camera),this.helperPassOnTop.hasTransmissionPass=!1,this.helperPassOnTop.clear=!1,this.helperPassOnTop.renderToScreen=!1;let t=new n3({preset:i3.LOW,edgeDetectionMode:o2.COLOR});this.effectPass=new z2(this.camera,t),this.rt=new LA(10,10,{minFilter:TE,magFilter:TE,wrapS:SE,wrapT:SE,depthBuffer:!0})}setSize(e,t){this.rt.setSize(e,t),this.effectPass.setSize(e,t)}set sceneHelpers(e){this.helperPass.setScene(e)}get sceneHelpers(){return this.helperPass.getScene()}set sceneHelpersOnTop(e){this.helperPassOnTop.setScene(e)}get sceneHelpersOnTop(){return this.helperPassOnTop.getScene()}setCamera(e){this.helperPass.setCamera(e),this.helperPassOnTop.setCamera(e)}initialize(e,t,i){super.initialize(e,t,i),this.effectPass.initialize(e,t,i)}dispose(){super.dispose(),this.rt.dispose(),this.effectPass.dispose()}render(e,t,i){this.rt.depthTexture=t.depthTexture;let n=e.getClearAlpha();e.setClearAlpha(0),this.helperPass.clearDepth=!0,this.helperPass.clearColorOnly=!0,this.helperPass.render(e,this.rt),this.helperPassOnTop.render(e,this.rt),this.effectPass.renderToScreen=!1,this.effectPass.render(e,this.rt,i),this.fullscreenMaterial.uniforms.inputBufferA.value=i.texture,this.fullscreenMaterial.uniforms.inputBufferB.value=t.texture,e.setClearAlpha(n),e.setRenderTarget(null),e.clear(),e.render(this.scene,this.camera)}},M3=[[.478712,.875764],[-.337956,-.793959],[-.955259,-.028164],[.864527,.325689],[.209342,-.395657],[-.106779,.672585],[.156213,.235113],[-.413644,-.082856],[-.415667,.323909],[.141896,-.93998],[.954932,-.182516],[-.766184,.410799],[-.434912,-.458845],[.415242,-.078724],[.728335,-.491777],[-.058086,-.066401],[.20299,.686837],[-.808362,-.556402],[.507386,-.640839],[-.723494,-.22924],[.48974,.317826],[-.622663,.765301],[-.01064,.929347],[.663146,.647618],[-.096674,-.413835],[.525945,-.321063],[-.122533,.366019],[.195235,-.687983],[-.563203,.098748],[.418563,.561335],[-.378595,.800367],[.826922,.001024],[-.085372,-.766651],[-.92192,.183673],[-.590008,-.721799],[.167751,-.164393],[.032961,-.56253],[.6329,-.107059],[-.46408,.569669],[-.173676,-.958758],[-.242648,-.234303],[-.275362,.157163],[.382295,-.795131],[.562955,.115562],[.190586,.470121],[.770764,-.297576],[.237281,.93105],[-.666642,-.455871],[-.905649,-.298379],[.33952,.157829],[.701438,-.7041],[-.062758,.160346],[-.220674,.957141],[.642692,.432706],[-.77339,-.015272],[-.671467,.24688],[.158051,.062859],[.806009,.527232],[-.05762,-.247071],[.333436,-.51671],[-.550658,-.315773],[-.652078,.589846],[.008818,.530556],[-.210004,.519896]],T3=new LT({vertexShader:"#define GLSLIFY 1\n#include <skinning_pars_vertex>\nout vec3 n;void main(){\n#include <beginnormal_vertex>\n#include <skinbase_vertex>\n#include <skinnormal_vertex>\n#include <defaultnormal_vertex>\n#include <begin_vertex>\n#include <skinning_vertex>\nvec4 view_space=viewMatrix*modelMatrix*vec4(transformed,1.0);gl_Position=projectionMatrix*view_space;n=normalize(transformedNormal);}",fragmentShader:"#define GLSLIFY 1\nin vec3 n;void main(){gl_FragColor=vec4(n,1.0);}"}),P3=new LT({vertexShader:"#define GLSLIFY 1\nout vec2 v_uv;void main(){gl_Position=vec4(position.xy,1.0,1.0);v_uv=uv;}",fragmentShader:"#define GLSLIFY 1\nin vec2 v_uv;uniform sampler2D texture_ao_lrez;uniform sampler2D texture_depth_lrez;uniform sampler2D texture_depth_hrez;uniform float near;uniform float far;float linearize_depth(float depth_sampled){float z=depth_sampled*2.0-1.0;return(2.0*near*far)/(far+near-z*(far-near));}vec2 nearest_depth_filter(in vec2 uv){vec2 resolution=vec2(textureSize(texture_depth_lrez,0));vec2 texel_size=1.0/resolution;vec2 offset=uv-0.5*texel_size;float d_hrez=texture(texture_depth_hrez,uv).r;float a=abs(d_hrez-texture(texture_depth_lrez,offset).r);float b=abs(d_hrez-texture(texture_depth_lrez,offset+vec2(texel_size.x,0.0)).r);float c=abs(d_hrez-texture(texture_depth_lrez,offset+vec2(0.0,texel_size.y)).r);float d=abs(d_hrez-texture(texture_depth_lrez,offset+vec2(texel_size.x,texel_size.y)).r);float min_diff=min(a,min(b,min(c,d)));if(min_diff==a)return offset;if(min_diff==b)return offset+vec2(texel_size.x,0.0);if(min_diff==c)return offset+vec2(0.0,texel_size.y);if(min_diff==d)return offset+vec2(texel_size.x,texel_size.y);}void main(){\n#ifdef DEBUG\nfloat d_lrez=texture(texture_depth_lrez,v_uv).r;float d_hrez=texture(texture_depth_hrez,v_uv).r;float output_d=mix(linearize_depth(d_lrez)/far,linearize_depth(d_hrez)/far,step(0.5,v_uv.x));gl_FragColor=vec4(vec3(output_d),1.0);\n#else\nvec2 filtered_uv=nearest_depth_filter(v_uv);vec4 ao=texture(texture_ao_lrez,filtered_uv);gl_FragColor=vec4(ao.rgb,1.0);gl_FragColor=ao;\n#endif\n}",uniforms:{texture_ao_lrez:new gR(null),texture_depth_lrez:new gR(null),texture_depth_hrez:new gR(null),near:new gR(null),far:new gR(null)}}),D3=class extends b2{constructor(e,t){super("AmbientOcclusionPass",void 0,t),this.fogEnabled=!1,this.fogNear=1,this.fogFar=1e3,this.frameIndex=0,this._runHalfRes=!0,this._width=1,this._height=1;let i=1024,n=1024;this.gBuffer=new LA(i,n,{type:zE,depthTexture:new Ek(i,n),minFilter:TE,magFilter:TE}),this.depthBufferHighRes=new LA(i,n,{depthTexture:new Ek(i,n)}),this.aoBuffer=new LA(i,n,{minFilter:TE,magFilter:TE}),this.splineScene=e,this.splineCamera=t;let r=new Float32Array(2*M3.length);for(let s=0;s<M3.length;s++){let e=2*s;r[e+0]=M3[s][0],r[e+1]=M3[s][1]}this.blueNoiseInDiskTexture=new Lk(r,M3.length,1,ZE,zE),this.blueNoiseInDiskTexture.wrapS=_E,this.blueNoiseInDiskTexture.wrapT=_E,this.blueNoiseInDiskTexture.needsUpdate=!0,this.hbaoMaterial=new LT({vertexShader:"#define GLSLIFY 1\nout vec2 v_uv;void main(){v_uv=uv;gl_Position=vec4(position.xy,1.0,1.0);}",fragmentShader:"#define GLSLIFY 1\nin vec2 v_uv;const float pi=3.14159265;const float num_steps=4.0;const float num_directions=4.0;uniform float near;uniform float far;uniform float fov;uniform vec4 proj_info;uniform bool is_ortho;uniform vec2 resolution;uniform float radius_of_influence;uniform float radius_in_screen_space;uniform float exponent;uniform vec3 ao_color;uniform float bias;uniform sampler2D texture_depth;uniform sampler2D texture_normals;uniform sampler2D texture_blue_noise;uniform sampler2D texture_blue_noise_in_disk;uniform sampler2D texture_color_pass;uniform int frame_index;uniform bool fog_enabled;uniform float fog_near;uniform float fog_far;vec3 uv_to_view_space(vec2 uv,float eye_z){return vec3((uv*proj_info.xy+proj_info.zw)*(is_ortho ? 1.0 : eye_z),eye_z);}float linearize_depth(float depth_sampled){float z=is_ortho ? depth_sampled : depth_sampled*2.0-1.0;return mix((2.0*near*far)/(far+near-z*(far-near)),near+z*(far-near),float(is_ortho));}vec3 get_view_position(vec2 uv_coords){float linear_depth=linearize_depth(texture(texture_depth,uv_coords).x);return uv_to_view_space(uv_coords,linear_depth);}vec3 min_difference(vec3 p,vec3 right,vec3 left){vec3 v1=right-p;vec3 v2=p-left;return(dot(v1,v1)<dot(v2,v2))? v1 : v2;}vec3 rebuild_normal(in vec2 uv,in vec3 p){vec2 one_over_resolution=1.0/resolution;vec3 r=get_view_position(uv+vec2(one_over_resolution.x,0));vec3 l=get_view_position(uv+vec2(-one_over_resolution.x,0));vec3 t=get_view_position(uv+vec2(0,one_over_resolution.y));vec3 b=get_view_position(uv+vec2(0,-one_over_resolution.y));return normalize(cross(min_difference(p,r,l),min_difference(p,t,b)));}float falloff(float distance_squared){float neg_inv_r2=-1.0/(radius_of_influence*radius_of_influence);return distance_squared*neg_inv_r2+1.0;}float ao_contribution(vec3 P,vec3 N,vec3 S){vec3 to_sample=S-P;float norm_squared=dot(to_sample,to_sample);float norm=sqrt(norm_squared);float cos_theta=dot(N,to_sample)/norm;return clamp(cos_theta-bias,0.0,1.0)*clamp(falloff(norm_squared),0.0,1.0);}float compute_ambient_occlusion(vec2 uv,float radius_in_screen_space,vec3 pc,vec3 view_space_n){vec2 one_over_resolution=1.0/resolution;ivec2 noise_uv=ivec2(int(mod(gl_FragCoord.x,128.0)),int(mod(gl_FragCoord.y,128.0)));float noise=texelFetch(texture_blue_noise,noise_uv,0).r;noise=fract(noise+0.61803398875*float(frame_index));float theta=noise*2.0*3.1415;float ct=cos(theta);float st=sin(theta);float step_size=radius_in_screen_space/(num_steps+1.0);const float angle_step=2.0*pi/num_directions;float contribution=0.0;for(int i=0;i<int(num_directions);++i){float current_pixel=step_size+1.0;for(int j=0;j<int(num_steps);++j){int index=i*int(num_steps)+j;vec2 blue_noise_sample=texelFetch(texture_blue_noise_in_disk,ivec2(index,0),0).rg;vec2 disk_point;disk_point.x=blue_noise_sample.x*ct-blue_noise_sample.y*st;disk_point.y=blue_noise_sample.x*st+blue_noise_sample.y*ct;vec2 sample_direction=disk_point;vec2 snapped_uv=round(current_pixel*sample_direction)*one_over_resolution+uv;vec3 ps=get_view_position(snapped_uv);current_pixel+=step_size;contribution+=ao_contribution(pc,view_space_n,ps);}}float mult=1.0/(1.0-bias);contribution*=mult/(num_directions*num_steps);return clamp(1.0-contribution*2.0,0.0,1.0);}\n#define USE_GBUFFER_NORMALS\nvoid main(){vec3 view_space_p=get_view_position(v_uv);\n#ifdef USE_GBUFFER_NORMALS\nvec3 view_space_n=texture(texture_normals,v_uv).rgb;view_space_n.z*=-1.0;\n#else\nvec3 view_space_n=-rebuild_normal(v_uv,view_space_p);\n#endif\nfloat radius_ss=radius_in_screen_space/(is_ortho ? 1.0 : view_space_p.z);float ao=compute_ambient_occlusion(v_uv,radius_ss,view_space_p,view_space_n);float final=pow(ao,exponent);if(view_space_p.z>=far){final=1.0;}vec3 color=mix(ao_color,vec3(1.0),final);if(fog_enabled){float fog_factor=smoothstep(fog_near,fog_far,view_space_p.z);color=mix(color,vec3(1.0),fog_factor);}gl_FragColor=vec4(color,1.0);}",uniforms:{near:new gR(null),far:new gR(null),fov:new gR(null),proj_info:new gR(new RA),is_ortho:new gR(!1),resolution:new gR(new hA),radius_of_influence:new gR(8),radius_in_screen_space:new gR(1),exponent:new gR(1),ao_color:new gR(new FA),bias:new gR(.5),texture_depth:new gR(null),texture_normals:new gR(null),texture_blue_noise:new gR(null),texture_blue_noise_in_disk:new gR(this.blueNoiseInDiskTexture),frame_index:new gR(0),fog_enabled:new gR(!1),fog_near:new gR(1),fog_far:new gR(1e3)}}),this.radius=128,this.aoColor={r:0,g:0,b:0},this.bias=.5,this.hbaoMaterial.uniforms.texture_depth.value=this.gBuffer.depthTexture,this.hbaoMaterial.uniforms.texture_normals.value=this.gBuffer.texture,this.needsSwap=!0,this.aaBuffer=new LA(i,n,{minFilter:TE,magFilter:TE,wrapS:SE,wrapT:SE,depthBuffer:!1,type:zE});let a=new n3({preset:i3.ULTRA,edgeDetectionMode:o2.COLOR});this.effectPass=new z2(this.camera,a)}initialize(e,t,i){super.initialize(e,t,i),this.effectPass.initialize(e,t,i)}setBlueNoiseTexture(e){this.hbaoMaterial.uniforms.texture_blue_noise.value=e}setSize(e,t){this._width=e,this._height=t,this.depthBufferHighRes.setSize(e,t);let i=this._runHalfRes?.5:1,n=e*i,r=t*i;this.gBuffer.setSize(n,r),this.aoBuffer.setSize(n,r),this.hbaoMaterial.uniforms.resolution.value.set(n,r),this.aaBuffer.setSize(n,r),this.effectPass.setSize(n,r)}get runHalfRes(){return this._runHalfRes}set runHalfRes(e){this._runHalfRes=e,this.setSize(this._width,this._height)}setCamera(e){this.splineCamera=e}setScene(e){this.splineScene=e}render(e,t,i){this.splineScene.overrideMaterial=T3;let n=this.splineCamera.layers.mask;if(this.splineCamera.layers.set(5),e.setRenderTarget(this.gBuffer),e.clear(),e.render(this.splineScene,this.splineCamera),e.setRenderTarget(this.depthBufferHighRes),e.clear(),e.render(this.splineScene,this.splineCamera),this.splineScene.overrideMaterial=null,this.splineCamera.layers.mask=n,this.hbaoMaterial.uniforms.radius_of_influence.value=this.radius,this.hbaoMaterial.uniforms.ao_color.value.set(this.aoColor.r,this.aoColor.g,this.aoColor.b),this.hbaoMaterial.uniforms.bias.value=this.bias,this.hbaoMaterial.uniforms.fog_enabled.value=this.fogEnabled,this.hbaoMaterial.uniforms.fog_near.value=this.fogNear,this.hbaoMaterial.uniforms.fog_far.value=this.fogFar,this.hbaoMaterial.uniforms.frame_index.value=this.frameIndex,this.frameIndex++,this.splineCamera.isPerspectiveCamera){this.hbaoMaterial.uniforms.near.value=this.splineCamera.perspCamera.near,this.hbaoMaterial.uniforms.far.value=this.splineCamera.perspCamera.far;let e=this.splineCamera.perspCamera.projectionMatrix.elements,t=2/e[0],i=2/e[5],n=-(1-e[8])/e[0],r=-(1+e[9])/e[5];this.hbaoMaterial.uniforms.proj_info.value.set(t,i,n,r);let a=this.splineCamera.perspCamera.fov*(Math.PI/180),s=this.hbaoMaterial.uniforms.resolution.value.y/(2*Math.tan(.5*a)),o=.5*this.hbaoMaterial.uniforms.radius_of_influence.value*s;this.hbaoMaterial.uniforms.radius_in_screen_space.value=o,this.hbaoMaterial.uniforms.is_ortho.value=!1}else{this.hbaoMaterial.uniforms.near.value=this.splineCamera.orthoCamera.near,this.hbaoMaterial.uniforms.far.value=this.splineCamera.orthoCamera.far;let e=this.splineCamera.orthoCamera.projectionMatrix.elements,t=2/e[0],i=2/e[5],n=-(1+e[12])/e[0],r=-(1-e[13])/e[5];this.hbaoMaterial.uniforms.proj_info.value.set(t,i,n,r);let a=this.hbaoMaterial.uniforms.resolution.value.y/i*.5,s=this.hbaoMaterial.uniforms.radius_of_influence.value*a;this.hbaoMaterial.uniforms.radius_in_screen_space.value=s,this.hbaoMaterial.uniforms.is_ortho.value=!0}this.runHalfRes?(this.fullscreenMaterial=this.hbaoMaterial,e.setRenderTarget(this.aoBuffer),e.clear(),e.render(this.scene,this.camera),this.fullscreenMaterial=P3,P3.uniforms.texture_ao_lrez.value=this.aoBuffer.texture,P3.uniforms.texture_depth_lrez.value=this.gBuffer.depthTexture,P3.uniforms.texture_depth_hrez.value=this.depthBufferHighRes.depthTexture,e.setRenderTarget(e.aoRenderTarget),e.clear(),e.render(this.scene,this.camera)):(this.fullscreenMaterial=this.hbaoMaterial,e.setRenderTarget(this.aaBuffer),e.clear(),e.render(this.scene,this.camera),this.effectPass.renderToScreen=!1,this.effectPass.render(e,this.aaBuffer,e.aoRenderTarget))}dispose(){this.gBuffer.dispose(),this.depthBufferHighRes.dispose(),this.aoBuffer.dispose()}},k3=class extends U2{constructor(){super(new LT({vertexShader:"\nvarying vec2 vUv;\nvoid main() {\n    vUv = uv;\n    gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"\nuniform sampler2D tInput;\nuniform sampler2D tMap;\nuniform vec2 resolution;\nvarying vec2 vUv;\n\nuniform vec2 uResolution;\nuniform vec2 uCoords;\n\n// Draws a rectangle at center <st> with size <size>\nfloat rectangle(vec2 st, vec2 size) {\n    size = vec2(0.5) - size * 0.5;\n    vec2 uv = vec2(step(size.x, st.x), step(size.y, st.y));\n    uv *= vec2(step(size.x, 1.0 - st.x), step(size.y, 1.0 - st.y));\n\n    return uv.x * uv.y;\n}\n\nuniform vec2 uSize;\nuniform float uScale;\nuniform float uDPR;\nuniform float uCurrent;\nuniform vec3 uSceneColor;\n\nvoid main() {\n    vec2 screenUv = gl_FragCoord.xy / uResolution.xy;\n    screenUv *= 1.0 / uDPR;\n\n    vec2 center = vec2(0.5, -0.5);\n    vec2 outsideUv = screenUv;\n    outsideUv += center;\n    outsideUv -= uCoords.xy / uResolution.xy;\n    outsideUv = (outsideUv - 0.5) + 0.5;\n    outsideUv -= center;\n    vec2 s = (uSize / uResolution) * uScale;\n    float isOutside = 1.0 - rectangle(outsideUv, s);\n    \n    vec2 mid = vec2(0.5);\n    vec2 insideUv = (screenUv - mid + s * mid) / s;\n    vec4 background = texture2D(tInput, screenUv);\n    vec4 image = texture2D(tMap, insideUv);\n    gl_FragColor = mix(image, background, isOutside);\n}\n",uniforms:{tInput:new gR(null),tMap:new gR(null),uResolution:new gR(new hA),uSize:new gR(new hA),uCoords:new gR(new hA),uScale:new gR(1),uSceneColor:new gR(new MA(16711680)),uDPR:new gR(1),uCurrent:new gR(0)}}),"tInput"),this.needsSwap=!0}get uniforms(){return this.fullscreenMaterial.uniforms}get texture(){return this.uniforms.tMap.value}set texture(e){this.uniforms.tMap.value=e}},O3=[],I3=class extends U2{constructor(){super(new LT({vertexShader:"\nvoid main() {\n    gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"\nuniform sampler2D toScene;\nuniform sampler2D fromScene;\nuniform vec2 resolution;\n\nuniform vec2 uResolution;\nuniform float uDPR;\n\nuniform float mixRatio;\nuniform sampler2D tMixTexture;\nuniform int useTexture;\nuniform float threshold;\n\nvoid main() {\n\tvec2 screenUv = gl_FragCoord.xy / uResolution.xy;\n\tscreenUv *= 1.0 / uDPR;\n\n\tvec4 texel1 = texture2D( fromScene, screenUv );\n\tvec4 texel2 = texture2D( toScene, screenUv );\n\n\tif (useTexture==1) {\n\t\t\n\t\tvec4 transitionTexel = texture2D( tMixTexture, screenUv );\n\t\tfloat r = mixRatio * (1.0 + threshold * 2.0) - threshold;\n\t\tfloat mixf=clamp((transitionTexel.r - r)*(1.0/threshold), 0.0, 1.0);\n\t\t\n\t\tgl_FragColor = mix( texel1, texel2, mixf );\n\t} else {\n\t\t\n\t\tgl_FragColor = mix( texel1, texel2, mixRatio );\n\t\t\n\t}\n}\n",uniforms:{toScene:new gR(null),fromScene:new gR(null),uResolution:new gR(new hA),uDPR:new gR(1),mixRatio:new gR(0),threshold:new gR(.1),useTexture:new gR(0),tMixTexture:{value:O3[0]}}}),"toScene"),this.needsSwap=!0}get uniforms(){return this.fullscreenMaterial.uniforms}get texture(){return this.uniforms.fromScene.value}set texture(e){this.uniforms.fromScene.value=e}},R3=class extends U2{constructor(){super(new LT({vertexShader:"\nvoid main() {\n    gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"\nuniform sampler2D inputBuffer;\nuniform sampler2D blurredInputBuffer;\nuniform sampler2D overlay;\nuniform float blurIntensity;\n\nuniform vec2 uResolution;\nuniform float uDPR;\n\nvoid main() {\n\tvec2 screenUv = gl_FragCoord.xy / uResolution.xy;\n\tscreenUv *= 1.0 / uDPR;\n\n\tvec4 texel1 = texture2D( overlay, screenUv );\n\tvec4 texel2 = texture2D( inputBuffer, screenUv );\n\tvec4 texel3 = texture2D( blurredInputBuffer, screenUv );\n\n\tfloat blurMask2 = max(sign(texel1.a), 0.0) * blurIntensity;\n    gl_FragColor = mix( mix(texel2, texel3, blurMask2), texel1, texel1.a );\n\tgl_FragColor.a = 1.0;\n}\n",uniforms:{inputBuffer:new gR(null),blurredInputBuffer:new gR(null),overlay:new gR(null),uResolution:new gR(new hA),uDPR:new gR(1),blurIntensity:new gR(0)}})),this._blurEnabled=!1,this.blurTarget=new LA(1,1,{minFilter:TE,magFilter:TE,wrapS:SE,wrapT:SE}),this.blurPass=new F2({width:window.innerWidth,height:window.innerHeight,kernelSize:W2.HUGE,resolutionScale:.25}),this.blurPass.renderToScreen=!1,this.uniforms.blurredInputBuffer.value=this.blurTarget.texture}get uniforms(){return this.fullscreenMaterial.uniforms}get texture(){return this.uniforms.overlay.value}set texture(e){this.uniforms.overlay.value=e}setResolution(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;this.uniforms.uResolution.value.set(e,t).divideScalar(i),this.uniforms.uDPR.value=i,this.blurPass.setSize(e,t),this.blurTarget.setSize(e,t),this.blurPass.setSize(e,t)}get uiCanvas(){return this._uiCanvas}set uiCanvas(e){this._uiCanvas=e,e.texture&&(this.uniforms.overlay.value=e.texture);let t=e.frame;if(t){let e=t.data.backgroundBlur,i=e.radius;this._blurEnabled=e.enabled,this.uniforms.blurIntensity.value=this._blurEnabled?1:0,this.blurPass.scale=i/3}}render(e,t,i,n,r){this._blurEnabled&&(this.blurPass.setDepthTexture(this.getDepthTexture()),this.blurPass.render(e,t,this.blurTarget,n,r)),super.render(e,t,i,n,r)}};function L3(e,t){return t&&t.enabled&&e.push(t.effect),e}var B3=e=>Object.values(D2).includes(e)?e:D2.NORMAL,z3=class extends QC{constructor(e){super(),this.postprocessingState=MH.defaultData,this._scene=new Dk,this._camera=new F1,this.effects=new Map,this.blueNoiseTexture=new Lk,this._renderToScreen=!0,this._isUIOverlayEnabled=!1,this.clock=new $I,this.renderer=e,this.debug=!1,this.effects.set("bloom",new c3),this.effects.set("chromaticAberration",new u3),this.effects.set("vignette",new m3),this.effects.set("noise",new f3),this.effects.set("colorAverage",new d3),this.effects.set("hueSaturation",new p3),this.effects.set("brightnessContrast",new h3),this.effects.set("depthOfField",new g3),this.effects.set("pixelation",new v3),this.effectComposer=new E3(this.renderer),this.effectComposer.autoRenderToScreen=!1,this.opaquePass=new S3(!0,this.scene,this.camera),this.opaquePass.clear=!0,this.transmissionPass=new x3(this.scene,this.camera,this.renderer),this.aoPass=new D3(this.scene,this.camera),this.taaPass=new b3,this.taaPass.renderToScreen=!1,this.helperPass=new A3(this.camera),this.helperPass.renderToScreen=!1,this.stylesOverlayPass=new k3,this.stylesOverlayPass.enabled=!1,this.uiOverlayPass=new R3,this.uiOverlayPass.enabled=!1,this.sceneTransitionPass=new I3,this.sceneTransitionPass.enabled=!1,this._initCopyPass(),this._initPasses()}set overlayTexture(e){void 0!==e?(this.stylesOverlayPass.texture=e,this.stylesOverlayPass.enabled=!0):this.stylesOverlayPass.enabled=!1}get overlayTexture(){return this.stylesOverlayPass.texture}set sceneHelpers(e){this.helperPass.sceneHelpers=e}get sceneHelpers(){return this.helperPass.sceneHelpers}set sceneHelpersOnTop(e){this.helperPass.sceneHelpersOnTop=e}get sceneHelpersOnTop(){return this.helperPass.sceneHelpersOnTop}get scene(){return this._scene}set scene(e){this._scene=e,this.opaquePass.setScene(e),this.transmissionPass.setScene(e),this.aoPass.setScene(e)}get camera(){return this._camera}set camera(e){this._camera=e,this.opaquePass.setCamera(e),this.transmissionPass.setCamera(e),this.aoPass.setCamera(e),this.helperPass.setCamera(e)}updateRenderToScreen(){let e=!1;for(let t=this.effectComposer.passes.length-1;t>=0;t--){let i=this.effectComposer.passes[t];!0!==i.enabled||e||!this._renderToScreen?i.renderToScreen=!1:(i.renderToScreen=!0,e=!0)}}get isUIOverlayEnabled(){return this._isUIOverlayEnabled}disableUIOverlay(){this._isUIOverlayEnabled=!1}enableUIOverlay(){this._isUIOverlayEnabled=!0}disableHelpers(){this.helperPass.enabled=!1,this.updateRenderToScreen()}enableHelpers(){this.helperPass.enabled=!0,this.updateRenderToScreen()}updateBlueNoiseTexture(e){this.blueNoiseTexture=new Lk(e,128,128),this.blueNoiseTexture.wrapS=_E,this.blueNoiseTexture.wrapT=_E,this.blueNoiseTexture.minFilter=CE,this.blueNoiseTexture.magFilter=CE,this.blueNoiseTexture.needsUpdate=!0}setAmbientOcclusionParams(e,t,i,n,r,a,s,o){this.aoPass.enabled=e,this.aoPass.radius=t,this.aoPass.bias=i,this.aoPass.aoColor=n,this.aoPass.fogEnabled=r,this.aoPass.fogNear=a,this.aoPass.fogFar=s,this.aoPass.runHalfRes!==!o&&(this.aoPass.runHalfRes=!o)}setTransmissionPassEnabled(e){this.transmissionPass.enabled=e,this.opaquePass.hasTransmissionPass=e}_initPasses(){var e,t;if(null!==(e=this.uvEffectPass)&&void 0!==e&&e.dispose(),null!==(t=this.effectPass)&&void 0!==t&&t.dispose(),this.effectComposer.removeAllPasses(),this.transmissionPass.updatePasses(this.renderer),this.effectComposer.addPass(this.aoPass),this.effectComposer.addPass(this.opaquePass),this.effectComposer.addPass(this.transmissionPass),this.effectComposer.addPass(this.taaPass),this.postprocessingState.enabled){let e=[this.effects.get("pixelation")].reduce(L3,[]);e.length>0&&(this.uvEffectPass=new z2(this.camera,...e),this.uvEffectPass.renderToScreen=!1,this.effectComposer.addPass(this.uvEffectPass));let t=[this.effects.get("chromaticAberration"),this.effects.get("bloom"),this.effects.get("colorAverage"),this.effects.get("hueSaturation"),this.effects.get("brightnessContrast"),this.effects.get("vignette"),this.effects.get("noise")].reduce(L3,[]);t.length>0&&(this.effectPass=new z2(this.camera,...t),this.effectPass.renderToScreen=!1,this.effectComposer.addPass(this.effectPass))}this.effectComposer.addPass(this.stylesOverlayPass),this.effectComposer.addPass(this.uiOverlayPass),this.effectComposer.addPass(this.sceneTransitionPass),this.effectComposer.addPass(this.helperPass)}_initCopyPass(){if(this._savePass)return;let e=new hA;this.renderer.getDrawingBufferSize(e),this._rt=new LA(e.x,e.y,{depthBuffer:!1,stencilBuffer:!1,wrapS:_E,wrapT:_E}),this._rt.samples=0,this._savePass=new x2(this._rt,!1),this._savePass.renderToScreen=!1}setCopyPass(e){this._rt=e,this._savePass=new x2(this._rt,!1),this.renderToScreen=!1}get renderToScreen(){return this._renderToScreen}set renderToScreen(e){if(this._renderToScreen===e)return;let t=this.effectComposer;!t||(!0===e?t.removePass(this._savePass):t.addPass(this._savePass),this._renderToScreen=e,this.updateRenderToScreen())}set sceneTransitionFromTexture(e){e!==this.sceneTransitionPass.texture&&(null!==e?this.sceneTransitionPass.enabled=!0:(this.sceneTransitionPass.enabled=!1,this.updateRenderToScreen()),this.sceneTransitionPass.texture=e)}get texture(){return this._rt&&this._rt.texture}get renderTarget(){return this._rt}updatePostprocessing(e){let{enabled:t,...i}=e,n=!1;t!==this.postprocessingState.enabled&&(n=!0);for(let r of Object.entries(i)){let e=r[1],t=this.effects.get(r[0]);if(t){t.enabled!==e.enabled&&(n=!0),t.enabled=e.enabled;for(let[i,n]of Object.entries(e))"blendFunction"===i?t.blendFunction=B3(n):t[i]=n}}this.postprocessingState=e,n&&this._initPasses()}render(){this.effectComposer.render(this.clock.getDelta())}setScissor(e,t,i,n){e instanceof RA?(this.effectComposer.inputBuffer.scissor.set(e.x,e.y,e.z,e.w),this.effectComposer.outputBuffer.scissor.set(e.x,e.y,e.z,e.w)):(this.effectComposer.inputBuffer.scissor.set(e,t,i,n),this.effectComposer.outputBuffer.scissor.set(e,t,i,n));let r=this.renderer.getPixelRatio();this.effectComposer.inputBuffer.scissor.multiplyScalar(r),this.effectComposer.outputBuffer.scissor.multiplyScalar(r),this.renderer.setScissor(e,t,i,n)}setScissorTest(e){this.effectComposer.inputBuffer.scissorTest=e,this.effectComposer.outputBuffer.scissorTest=e,this.renderer.setScissorTest(e)}setViewport(e,t,i,n){e instanceof RA?(this.effectComposer.inputBuffer.viewport.copy(e),this.effectComposer.outputBuffer.viewport.copy(e)):(this.effectComposer.inputBuffer.viewport.set(e,t,i,n),this.effectComposer.outputBuffer.viewport.set(e,t,i,n))}resize(e,t,i){if(this.effectComposer.setSize(e,t,i),this._rt){let i=this.renderer.getPixelRatio();this._rt.setSize(e*i,t*i)}}dispose(){var e,t;null!==(e=this.uvEffectPass)&&void 0!==e&&e.dispose(),null!==(t=this.effectPass)&&void 0!==t&&t.dispose(),this.effectComposer.dispose()}},N3=JT.lights_fragment_begin,F3=JT.shadowmask_pars_fragment,j3=null,V3=new LT({vertexShader:"\nattribute vec3 randomColor;\nvarying vec3 vNormal;\nflat out vec3 vColor;\n\nvoid main()\n{\nvNormal = normal;\nvColor = randomColor;\ngl_Position = projectionMatrix * (modelViewMatrix * vec4(position, 1.0));\n}\n",fragmentShader:"\nuniform float depthContrast;\nvarying vec3 vNormal;\nflat in vec3 vColor;\nvoid main()\n{\nvec3 normal = (normalize(vNormal)).rgb;\n\nfloat contrastDepth = (gl_FragCoord.z - 0.5) * depthContrast + 0.5;\n\nvec3 resultColor = mix(mix(vColor, normal, 0.2), vec3(contrastDepth), 0.4);\ngl_FragColor = vec4(resultColor, vColor.r);\ngl_FragColor = vec4(resultColor, vColor.r);\n}\n",uniforms:{depthContrast:{value:1}}}),U3=new IA,G3=class extends Tk{constructor(e){var t;super(e),t=this,this._pixelRatio=this.getPixelRatio(),this.viewportWidth=1,this.viewportHeight=1,this.resolution=new hA,this.pipeline=new z3(this),this.dummyCamera=new F1,this.sceneTransitionDuration=0,this.sceneTransitionTimeRemaining=-1,this.isXRCopyPassSet=!1,this.clear=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t.getContext(),a=0;e&&(a|=r.COLOR_BUFFER_BIT),i&&(a|=r.DEPTH_BUFFER_BIT),n&&(a|=r.STENCIL_BUFFER_BIT),r.clear(a),r.clearBufferfv(r.COLOR,1,[0,0,0,1])},this.autoClear=!1;let i=this.setPixelRatio.bind(this),n=this.setSize.bind(this);this.shadowMap.enabled=!0,this.shadowMap.type=AS,this.dummyCamera.matrixAutoUpdate=!1;let r=this.getContext();if(r&&"drawingBufferColorSpace"in r)try{r.drawingBufferColorSpace="display-p3"}catch(l){console.warn(l)}this.setPixelRatio=e=>{this._pixelRatio!==e&&(this._pixelRatio=e,i(e))},this.setSize=function(e,i){var r,a;let s=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];(t.viewportWidth!==e||t.viewportHeight!==i)&&(t.viewportWidth=e,t.viewportHeight=i,n(e,i,s),null!==(r=t.normalRenderTarget)&&void 0!==r&&r.setSize(e*t._pixelRatio,i*t._pixelRatio),t._resizeTransmission(e,i),null!==(a=t.transmissionDepthTarget)&&void 0!==a&&a.setSize(e*t._pixelRatio/2,i*t._pixelRatio/2),t.pipeline.resize(e,i,s))},this._superDispose=this.dispose,this.dispose=this._currentDispose}createAORenderTarget(){void 0===this.aoRenderTarget&&(this.aoRenderTarget=new LA(this.viewportWidth*this._pixelRatio,this.viewportHeight*this._pixelRatio,{generateMipmaps:!1,minFilter:TE,magFilter:TE,wrapS:SE,wrapT:SE,depthBuffer:!1}))}_resizeTransmission(e,t){var i,n;null!==(i=this.transmissionRenderTarget)&&void 0!==i&&i.setSize(e*this._pixelRatio/(this.hdTransmission?1:2),t*this._pixelRatio/(this.hdTransmission?1:2)),null===(n=this.aoRenderTarget)||void 0===n||n.setSize(e*this._pixelRatio/1,t*this._pixelRatio/1)}get hdTransmission(){return 1===KJ.transmissionLod.value}set hdTransmission(e){KJ.transmissionLod.value=!0===e?1:2,this._resizeTransmission(this.viewportWidth,this.viewportHeight)}createTransmissionRenderTarget(){void 0===this.transmissionRenderTarget&&(this.transmissionRenderTarget=new LA(this.viewportWidth*this._pixelRatio/(this.hdTransmission?1:2),this.viewportHeight*this._pixelRatio/(this.hdTransmission?1:2),{generateMipmaps:!0,minFilter:DE,magFilter:TE,wrapS:SE,wrapT:SE,depthBuffer:!1}),this.transmissionDepthTarget=new LA(this.viewportWidth*this._pixelRatio/2,this.viewportHeight*this._pixelRatio/2,{minFilter:CE,magFilter:CE,depthBuffer:!1}))}createNormalRenderTarget(){void 0===this.normalRenderTarget&&(this.normalRenderTarget=new LA(this.viewportWidth*this._pixelRatio,this.viewportHeight*this._pixelRatio,{generateMipmaps:!1,minFilter:CE,magFilter:CE,type:zE,depthTexture:new Ek(this.viewportWidth*this._pixelRatio,this.viewportHeight*this._pixelRatio)}))}renderNormal(e,t,i){this.normalRenderTarget&&(this.setClearColor(0),i.layers.enable(8),i.layers.disable(0),i.layers.disable(3),t.traverseEntity((e=>{e.layers.isEnabled(8)&&(e.copyPreviousMatrix=!1)})),this.setRenderTarget(this.normalRenderTarget),this.clear(),V3.uniforms.depthContrast.value=i instanceof F1?(i.far-i.near)/1e4:1,t.overrideMaterial=V3,this.render(t,i),this.setClearColor(t.bgColor,t.bgColor.a),this.setRenderTarget(null),t.overrideMaterial=e.wireframeState?s6:null,i.layers.enable(0),i.layers.enable(3),t.traverseEntity((e=>{e.layers.isEnabled(8)&&(e.copyPreviousMatrix=!0)})))}renderSplineSceneWithDummyCamera(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;this.dummyCamera.updateCameraState(t.dataPatched),this.dummyCamera.matrix.copy(t.matrixWorld);let n=t.height,r=t.width,a=this.viewportWidth/this.viewportHeight;r<n?r=n*a:n=r/a,this.dummyCamera.setViewplaneSize(r,n);for(let s=0;s<i;s++)this.renderSplineScene(e,this.dummyCamera)}renderSplineScene(e,t){var i;let{sceneHelpers:n,sceneHelpersOnTop:r,overrideTransmission:a,overrideNormal:s}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=e instanceof l6?e.activePage:e,l=o.visible;o.visible=!0;let c=o.scene;this.xr.enabled&&(!1===this.isXRCopyPassSet&&null!==this.getRenderTarget()&&(this.pipeline.setCopyPass(this.getRenderTarget()),this.isXRCopyPassSet=!0),this.xr.updateCamera(t)),this.setClearColor(o.bgColor,o.bgColor.a),o.penumbraSizeArray.forEach(((e,t)=>{KJ.penumbraSize.value[t]=e})),KJ.pixelRatioNode.value=this.getPixelRatio(),0!==this.resolution.x&&0!==this.resolution.y?KJ.resolution.value.set(this.resolution.x,this.resolution.y):KJ.resolution.value.set(this.viewportWidth*this._pixelRatio,this.viewportHeight*this._pixelRatio),void 0!==s?(KJ.normalRenderTarget.value=s,KJ.normalRenderTargetDepth.value=U3):c.needsNormal()&&(this.createNormalRenderTarget(),KJ.normalRenderTarget.value=this.normalRenderTarget.texture,KJ.normalRenderTargetDepth.value=this.normalRenderTarget.depthTexture,this.renderNormal(c,o,t));let h=o.data.ao,u=h.occlusion;u&&(this.createAORenderTarget(),KJ.aoRenderTarget.value=this.aoRenderTarget.texture),KJ.aoEnabled.value=u,this.pipeline.setAmbientOcclusionParams(h.occlusion,h.radius,h.bias,o.aoColor,null!==o.fog,o.backupFog.near,o.backupFog.far,h.aoFullRes),this.pipeline.aoPass.setBlueNoiseTexture(this.pipeline.blueNoiseTexture),this.pipeline.isUIOverlayEnabled&&null!==(i=o.uiCanvas)&&void 0!==i&&i.enabled&&o.uiCanvas.texture&&o.uiCanvas.texture.image.width>0?((o.uiCanvas.width!==this.viewportWidth||o.uiCanvas.height!==this.viewportHeight)&&o.uiCanvas.applySize({width:this.viewportWidth,height:this.viewportHeight}),o.uiCanvas.render(),this.pipeline.uiOverlayPass.uiCanvas=o.uiCanvas,this.pipeline.uiOverlayPass.enabled=!0,this.pipeline.uiOverlayPass.setResolution(this.domElement.width,this.domElement.height,window.devicePixelRatio),this.pipeline.updateRenderToScreen()):(this.pipeline.uiOverlayPass.enabled=!1,this.pipeline.updateRenderToScreen());let d=!1;if(void 0!==a)KJ.transmissionRenderTarget.value=a,KJ.transmissionRenderTargetDepth.value=U3,this.pipeline.setTransmissionPassEnabled(!1);else{let e=c.needsTransmission();e&&(void 0===this.transmissionRenderTarget&&(d=!0),this.createTransmissionRenderTarget(),KJ.transmissionRenderTarget.value=this.transmissionRenderTarget.texture,KJ.aspectRatio.value=function(e,t){return e>=t?new hA(t/e,1):new hA(1,e/t)}(this.viewportWidth,this.viewportHeight),KJ.transmissionRenderTargetDepth.value=this.transmissionDepthTarget.texture),this.pipeline.setTransmissionPassEnabled(e)}t.layers.enable(3),t.layers.enable(8),this.pipeline.sceneHelpers=n,this.pipeline.sceneHelpersOnTop=r,this.pipeline.scene=o,this.pipeline.camera=t,d&&this.pipeline.transmissionPass.updatePasses(this),this.pipeline.postprocessingState!==o.postprocessing&&(this.pipeline.updatePostprocessing(o.postprocessing),!n&&!r&&this.pipeline.disableHelpers()),void 0!==this.clearAlphaOverride&&this.setClearAlpha(this.clearAlphaOverride),o.overrideMaterial=c.wireframeState?s6:null,this.pipeline.render(),KJ.frameIndex.value=(KJ.frameIndex.value+1)%16,t instanceof F1&&t.copyHistory(),o.visible=l}renderFromSceneForSceneTransitionPass(e,t,i){this.pipeline.renderToScreen=!1,this.pipeline.renderTarget,this.renderSplineScene(e,t),this.pipeline.sceneTransitionFromTexture=this.pipeline.renderTarget.texture,this.sceneTransitionDuration=i,this.sceneTransitionTimeRemaining=i,this.pipeline.renderToScreen=!0;let n=this.pipeline.sceneTransitionPass.uniforms;n.uDPR.value=window.devicePixelRatio,n.uResolution.value.set(this.domElement.width,this.domElement.height).divideScalar(window.devicePixelRatio)}_currentDispose(){var e,t,i,n,r;this._superDispose(),this.pipeline.dispose(),null!==(e=this.aoRenderTarget)&&void 0!==e&&e.dispose(),null!==(t=this.transmissionRenderTarget)&&void 0!==t&&t.dispose(),null!==(i=this.transmissionDepthTarget)&&void 0!==i&&i.dispose(),null!==(n=this.normalRenderTarget)&&void 0!==n&&n.dispose(),null===(r=this.normalRenderTarget)||void 0===r||null===(r=r.depthTexture)||void 0===r||r.dispose()}},H3=class extends(w1(OR)){constructor(e){super(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,arguments.length>2&&void 0!==arguments[2]?arguments[2]:10066329),this.object=e,this.added=!1,this.name="DirectionalLightHelper: ".concat(e.uuid)}raycast(e,t){C1(this.object,H3.geometryHelper,e,t)}},W3=class extends(w1(TR)){constructor(e){super(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,arguments.length>2&&void 0!==arguments[2]?arguments[2]:6710886),this.object=e,this.name="PointLightHelper: ".concat(e.uuid)}raycast(e,t){C1(this.object,W3.geometryHelper,e,t)}},q3=class extends(w1(MR)){constructor(e){super(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:6710886),this.object=e,this.name="SpotLightHelper: ".concat(e.uuid)}raycast(e,t){C1(this.object,q3.geometryHelper,e,t)}update(){if(void 0!==this.object){let e=q3._vector,t=this.object.distance?this.object.distance:1e3,i=t*Math.tan(this.object.angle);this.cone.scale.set(i,i,t),e.setFromMatrixPosition(this.object.target.matrixWorld),this.cone.lookAt(e);let n=void 0!==this.color?this.color:this.light.color;if(this.cone.material instanceof Array)for(let r=0,a=this.cone.material.length;r<a;r++)this.cone.material[r].color.set(n);else this.cone.material.color.set(n)}}},X3=q3;X3._vector=new FA;var Y3,Q3=class extends(W1(ZI,H3)){constructor(e,t,i){super(),this.super_Entity(e,t),this.castShadow=!0,this.shadow.mapSize.width=2048,this.shadow.mapSize.height=2048,this.shadow.normalBias=1,this.layers.enable(3);let n=this.shadow.camera;n.top=1250,n.bottom=-1250,n.right=1250,n.left=-1250,n.near=-1e4,n.far=2500;let r=new LR(this.shadow.camera);r.visible=!1,this.gizmos.shadowmap=r}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this.gizmos){let t=this.gizmos[e];t instanceof LR&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.objectHelper&&this.objectHelper.update()}updateState(e,t){this.updateState_Light(e,t);let i=void 0!==e.depth&&e.depth!==this.shadow.camera.far||void 0!==e.size&&e.size/2!==this.shadow.camera.right;void 0!==e.size&&function(e,t){e.shadow.camera.right=t/2,e.shadow.camera.left=-t/2,e.shadow.camera.top=t/2,e.shadow.camera.bottom=-t/2,e.shadow.needsUpdate=!0}(this,e.size),void 0!==e.shadowRadius&&(this.shadow.radius=e.shadowRadius),void 0!==e.shadowResolution&&(this.shadow.mapSize.set(e.shadowResolution,e.shadowResolution),this.shadow.map&&(this.shadow.map.dispose(),this.shadow.map=null)),void 0!==e.penumbraSize&&t.scene.markPenumbraSizeDirty(),i&&this.update()}},Z3=new FA,K3=new FA,J3=new NA,$3=class extends(W1(GI,X3)){constructor(e,t,i){super(),this.super_Entity(e,t),this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024,this.shadow.normalBias=1,this.layers.enable(3);let n=this.shadow.camera;n.fov=2*cA.RAD2DEG*this.angle,n.aspect=1,n.near=100,n.far=2500;let r=new LR(this.shadow.camera);r.visible=!1,this.gizmos.shadowmap=r,this.update()}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this.gizmos){let t=this.gizmos[e];t instanceof LR&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),K3.setFromMatrixPosition(this.matrixWorld),J3.setFromRotationMatrix(this.matrixWorld),Z3.copy(this.up).applyQuaternion(J3).negate().multiplyScalar(this.distance),this.target.position.copy(K3).add(Z3),this.target.updateMatrixWorld(),this.objectHelper&&this.objectHelper.update()}updateState(e,t){this.updateState_Light(e,t),void 0!==e.distance&&(this.distance=e.distance),void 0!==e.decay&&(this.decay=e.decay),void 0!==e.angle&&(this.angle=e.angle),void 0!==e.penumbra&&(this.penumbra=e.penumbra),void 0!==e.shadowRadius&&(this.shadow.radius=e.shadowRadius),void 0!==e.penumbraSize&&t.scene.markPenumbraSizeDirty(),void 0!==e.shadowResolution&&(this.shadow.mapSize.set(e.shadowResolution,e.shadowResolution),this.shadow.map&&(this.shadow.map.dispose(),this.shadow.map=null))}};function e4(e,t){return[[e[0][0]*t[0][0]+e[0][1]*t[1][0],e[0][0]*t[0][1]+e[0][1]*t[1][1]],[e[1][0]*t[0][0]+e[1][1]*t[1][0],e[1][0]*t[0][1]+e[1][1]*t[1][1]]]}function t4(e){return[[e[0][0],e[1][0]],[e[0][1],e[1][1]]]}function i4(e){let[t,i,n]=function(e){let t=(e[0][0]+e[1][1])/2,i=(e[0][0]-e[1][1])/2,n=(e[1][0]+e[0][1])/2,r=(e[1][0]-e[0][1])/2,a=Math.sqrt(t*t+r*r),s=Math.sqrt(i*i+n*n),o=a+s,l=a-s,c=Math.atan2(n,i),h=Math.atan2(r,t),u=(h-c)/2,d=(h+c)/2,p=[[Math.cos(d),Math.sin(d)],[-Math.sin(d),Math.cos(d)]],f=[[o,0],[0,l]],m=[[Math.cos(u),Math.sin(u)],[-Math.sin(u),Math.cos(u)]];return p[0][0]*=-1,p[0][1]*=-1,m[0][0]*=-1,m[1][0]*=-1,[p,f,m]}(e),r=e4(t,t4(n)),a=e4(e4(n,i),t4(n));return{rotation:Math.atan2(r[1][0],r[0][0]),scale:[a[0][0],a[1][1]],shear:[a[0][1]/a[1][1],a[1][0]/a[0][0]]}}(e=>{function t(e){return[e[0],e[3],e[1],e[4],e[2],e[5]]}e.identity=function(){return[1,0,0,0,1,0,0,0,1]},e.copy=function(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.identity();for(let e=0,n=t.length;e<n;e++)i[e]=t[e];return i},e.create=function(t,i,n,r,a,s){return e.setAbcdef(e.identity(),t,i,n,r,a,s)},e.setAbcdef=function(e,t,i,n,r,a,s){return e[0]=t,e[1]=n,e[2]=a,e[3]=i,e[4]=r,e[5]=s,e},e.append=function(i,n){let[r,a,s,o,l,c]=t(i),[h,u,d,p,f,m]=t(n),g=h*r+u*s,v=h*a+u*o,y=d*r+p*s,b=d*a+p*o,x=f*r+m*s+l,w=f*a+m*o+c;return e.create(g,v,y,b,x,w)},e.prepend=function(i,n){let[r,a,s,o,l,c]=t(i),[h,u,d,p,f,m]=t(n),g=r,v=a,y=s,b=o;(1!==h||0!==u||0!==d||1!==p)&&(g=r*h+a*d,v=r*u+a*p,y=s*h+o*d,b=s*u+o*p);let x=l*h+c*d+f,w=l*u+c*p+m;return e.create(g,v,y,b,x,w)},e.getAbcdef=t,e.invert=function(t){let[i,n,r,a,s,o]=e.getAbcdef(t),l=i*a-n*r,c=a/l,h=-n/l,u=-r/l,d=i/l,p=(r*o-a*s)/l,f=-(i*o-n*s)/l;return e.create(c,h,u,d,p,f)},e.apply=function(t,i){let[n,r]=t,[a,s,o,l,c,h]=e.getAbcdef(i);return[a*n+o*r+c,s*n+l*r+h]},e.applyInverse=function(t,i){let[n,r,a,s,o,l]=e.getAbcdef(i),c=1/(n*s+a*-r),[h,u]=t;return[s*c*h+-a*c*u+(l*a-o*s)*c,n*c*u+-r*c*h+(-l*n+o*r)*c]},e.scale=function(t,i){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i,[r,a,s,o,l,c]=e.getAbcdef(t);return e.setAbcdef(t,r*i,a*n,s*i,o*n,l*i,c*n),t},e.rotate=function(t,i){let n=Math.cos(i),r=Math.sin(i),[a,s,o,l,c,h]=e.getAbcdef(t);return e.setAbcdef(t,a*n-s*r,a*r+s*n,o*n-l*r,o*r+l*n,c*n-h*r,c*r+h*n),t},e.rotateAround=function(t,i,n){let[r,a]=n,s=e.translate(t,-r,-a);return s=e.rotate(s,i),s=e.translate(s,r,a),s},e.translate=function(t,i,n){let[r,a,s,o,l,c]=e.getAbcdef(t);return e.setAbcdef(t,r,a,s,o,l+i,c+n),t},e.setTranslate=function(t,i,n){let[r,a,s,o]=e.getAbcdef(t);return e.setAbcdef(t,r,a,s,o,i,n),t},e.setPosition=function(t,i,n){let[r,a,s,o]=e.getAbcdef(t);return e.setAbcdef(t,r,a,s,o,i,n),t},e.getScale=function(t){let[i,n,r,a]=e.getAbcdef(t);return[Math.sqrt(i*i+n*n),Math.sqrt(r*r+a*a)]},e.getPosition=function(t){let[,,,,i,n]=e.getAbcdef(t);return[i,n]},e.getRotation=function(t,i){return e.decompose(t,i).rotation},e.decompose=function(t,i){let[n,r,a,s,o,l]=e.getAbcdef(t),{rotation:c,scale:h,shear:u}=i4([[n,a],[r,s]]);return{position:[o+(i[0]*n+i[1]*a)-i[0],l+(i[0]*r+i[1]*s)-i[1]],scale:h,rotation:c,shear:u,pivot:i}},e.compose=function(t,i,n,r){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[0,0],[s,o]=t,[l,c]=r,[h,u,d,p]=function(e){let{rotation:t,scale:i,shear:n}=e,r=Math.cos(t),a=Math.sin(t),s=e4([[r,-a],[a,r]],[[i[0],n[0]*i[1]],[n[1]*i[0],i[1]]]);return[s[0][0],s[1][0],s[0][1],s[1][1]]}({rotation:n,scale:i,shear:a}),f=s-(l*h+c*d)+l,m=o-(l*u+c*p)+c;return e.create(h,u,d,p,f,m)}})(Y3||(Y3={}));var n4=Math.PI/180;Math.PI;var r4=class{constructor(e,t,i){var n;this.uuid=e,this.data=t,this.localMatrix=Y3.identity(),this.worldMatrix=Y3.identity(),this.ignoreCameraZoom=!1,this.visible=!0,this._singleBBox=new f4,this._recursiveBBox=new f4,this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0,this.stateSelection=null,this.prevState=null,this.currentState=null,this.reversibleToState=null,this.currentTransitionEvent=null,this.previousAction=null,this.name="",this.position=[0,0],this.scale=[1,1],this.rotation=0,this.shear=[0,0],this.emitter=function(e){return{all:e=e||new Map,on:function(t,i){var n=e.get(t);n?n.push(i):e.set(t,[i])},off:function(t,i){var n=e.get(t);n&&(i?n.splice(n.indexOf(i)>>>0,1):e.set(t,[]))},emit:function(t,i){var n=e.get(t);n&&n.slice().map((function(e){e(i)})),(n=e.get("*"))&&n.slice().map((function(e){e(t,i)}))}}}(),this.dpr=null!==(n=i.dpr)&&void 0!==n?n:1,this.dataPatched=t}project(e,t){let i=this.worldMatrix;return t&&(i=Y3.append(t.worldMatrix,i)),Y3.applyInverse(e,i)}intersects(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return this.visible&&!this.data.raycastLock&&this.intersectsInLocalSpace(...this.project([e,t],i),n)}intersectsInLocalSpace(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],{min:n,max:r}=i?this.recursiveBBox:this.singleBBox;return e>=n[0]&&e<=r[0]&&t>=n[1]&&t<=r[1]}applyTransforms(e){e.setTransform(this.worldMatrix,this.ignoreCameraZoom)}get singleBBox(){return this.singleBBoxNeedsUpdate&&(this.singleBBoxNeedsUpdate=!1,this._singleBBox.setFromObjectSize(this,!1),this._singleBBox.computeVertices(),this._singleBBox.computeEdges()),this._singleBBox}get recursiveBBox(){return this.recursiveBBoxNeedsUpdate&&(this.recursiveBBoxNeedsUpdate=!1,this._recursiveBBox.setFromObjectSize(this,!0),this._recursiveBBox.computeVertices(),this._recursiveBBox.computeEdges()),this._recursiveBBox}updateLocalMatrix(){this.localMatrix=Y3.compose(this.position,this.scale,function(e){return e*n4}(this.rotation),XW.getPivot(this.dataPatched),this.shear)}updateWorldMatrix(e,t,i){let n=this.parent;t&&null!==n&&void 0!==n&&n.updateWorldMatrix(e,!0,!1),e&&this.updateLocalMatrix(),this.parent?this.worldMatrix=Y3.append(this.parent.worldMatrix,this.localMatrix):this.worldMatrix=Y3.copy(this.localMatrix),this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0}get pivot(){return XW.getPivot(this.data)}getCenter(){return[0,0]}getHalfSize(){return[0,0]}get id(){return this.uuid}resetBBoxNeedsUpdateSelf(){this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0}resetBBoxNeedsUpdate(){this.resetBBoxNeedsUpdateSelf(),this.traverseAncestors((e=>{e.resetBBoxNeedsUpdateSelf()}))}updateTransformState(e){let t=!1;void 0!==e.position&&(t=!0,this.position=e.position),void 0!==e.rotation&&(t=!0,this.rotation=e.rotation),void 0!==e.scale&&(t=!0,this.scale=e.scale),void 0!==e.shear&&(t=!0,this.shear=e.shear),t&&(this.updateWorldMatrix(!0,!1,!0),this.resetBBoxNeedsUpdate())}updateByOp(e,t,i){0===e.type&&void 0!==e.props.visible&&(this.visible=e.props.visible),this.data=t,this.data=t;let n=e,r=VV(e.path,["states","*"]);if(null!==r){if(0===e.type){let[t]=r;if((null===this||void 0===this?void 0:this.stateSelection)===t){let t={...e.props};if(delete t.name,Object.values(e.props).some((e=>void 0===e))){let i=this.data;if(void 0!==i){let n=LV.zoom(i,e.path.slice(2));if(n)for(let i in e.props)void 0===e.props[i]&&i in n&&(t[i]=n[i])}}n={...e,props:t,path:e.path.slice(2)}}}}else if(0===e.type){let t=this.stateSelection?this.data.states.data(this.stateSelection):void 0;if(void 0!==t){if(void 0!==e.props.name&&t.name){let{name:e,...i}=t;t=i}let i=LV.removeOverridden(e.path,e.props,t);n={...e,props:i}}}this.updateByPatchedOpBase(n,BW.patch(this.data,this.stateSelection?this.data.states.data(this.stateSelection):void 0),i)}changeSelectedState(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(0!==this.data.states.length||i){for(let e of this.data.states)BW.toOps(this.data,e.data).forEach((e=>{let i=uV.replaceProps(e,this.data);this.dataPatched=this.data,this.updateByPatchedOp(i,this.data,t)}));if(null!==e){let i=this.data.states.data(e);i&&(this.dataPatched=BW.patch(this.data,i),BW.toOps(this.data,i).forEach((e=>{this.updateByPatchedOp(e,this.dataPatched,t)})))}i&&this.updateTransformState(this.dataPatched),this.stateSelection=e}}updateState(e,t){void 0!==e.name&&(this.name=e.name),void 0!==e.visible&&(this.visible=e.visible),this.updateTransformState(e)}updateByPatchedOpBase(e,t,i){this.dataPatched=t,this.updateByPatchedOp(e,t,i)}updateByPatchedOp(e,t,i){0===e.path.length&&0===e.type&&this.updateState(e.props,i),this.requestRender()}traverseFrameAncestors(e){this.traverseAncestors((t=>{"frame2d"===t.data.type&&e(t)}))}traverseAncestors(e){let t=this.parent;for(;t;)e(t),t=t.parent}requestRender(){this.traverseFrameAncestors((e=>{e.requestRender()}))}clone(e){let t=new r4(this.uuid,this.data,e);return t.parent=void 0,t}addEventListener(e,t){this.emitter.on(e,t)}removeEventListener(e,t){this.emitter.off(e,t)}dispatchEvent(e){var t;this.emitter.emit(e.type,{...e,target:null!==(t=e.target)&&void 0!==t?t:this})}traverseSortNextHelper(){let e=this.parent;if(e){let t=e.children;if(t){let i=t.indexOf(this)+1;return t[i]?t[i]:e.traverseSortNextHelper()}}}sortNext(){let e=this.children;return e&&e.length>0&&e[0]?e[0]:this.traverseSortNextHelper()}isDescendantOf(e){e instanceof r4&&(e=e.uuid);let t=this;for(;t.parent;){if(t.parent.uuid===e)return!0;t=t.parent}return!1}},a4=class extends r4{constructor(e,t,i){super(e,t,i),this.uuid=e,this.data=t,this.context=i,this.children=[]}add(e){e.parent&&e.parent instanceof a4&&e.parent.remove(e),this.children.push(e),e.parent=this}remove(e){let t=this.children.indexOf(e);t>=0&&(this.children.splice(t,1),e.parent=void 0)}traverse(e){let t=e(this);if(!0!==t)for(let i of this.children)i instanceof a4?i.traverse(e):t=e(i)}intersectsChildren(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];for(let s of this.children){let o=s instanceof s4;if(s instanceof a4&&!o&&a&&s.intersectsChildren(e,t,i,n,r,!1),s.intersects(e,t,i,o)&&(r.push(s),n))break}return r}updateWorldMatrix(e,t,i){if(super.updateWorldMatrix(e,t,i),i&&this.children)for(let n of this.children)n.updateWorldMatrix(e,!1,!0)}find(e){let t;return this.traverse((i=>{i.uuid===e&&(t=i)})),t}innerDrawChildren(e){for(let t=this.children.length-1;t>=0;t--)this.children[t].draw(e)}resetBBoxNeedsUpdate(){super.resetBBoxNeedsUpdate(),this.traverse((e=>{e.resetBBoxNeedsUpdateSelf()}))}clone(e){let t=new a4(this.uuid,this.data,e);t.parent=void 0;for(let i of this.children)t.add(i.clone(e));return t}},s4=class extends a4{constructor(e,t,i){super(e,t,i),this.uuid=e,this.data=t,this.updateState(t,i)}draw(e){!this.visible||(e.save(),this.applyTransforms(e),this.innerDrawChildren(e),e.restore())}clone(e){let t=new s4(this.uuid,this.data,e);t.parent=void 0;for(let i of this.children)t.add(i.clone(e));return t}};function o4(e,t){let[[i,n],[r,a]]=e,[[s,o],[l,c]]=t,h=(i-r)*(o-c)-(n-a)*(s-l);if(0===h)return!1;let u=((i-s)*(o-c)-(n-o)*(s-l))/h,d=-((i-r)*(n-o)-(n-a)*(i-s))/h;return u>=0&&u<=1&&d>=0&&d<=1}var l4,c4,h4,u4,d4=[[-1,1],[-1,-1],[1,-1],[1,1]],p4=(e,t,i)=>{let n=e.getCenter(),r=e.getHalfSize(),a=Y3.append(t,e.worldMatrix);0===r[0]&&0===r[1]?i.push(Y3.apply(n,a)):d4.forEach((e=>{let t=[e[0]*r[0]+n[0],e[1]*r[1]+n[1]];i.push(Y3.apply(t,a))}))},f4=class{constructor(){this.matrix=Y3.identity(),this.min=[1/0,1/0],this.max=[-1/0,-1/0],this.vertices=[],this.edges=[]}setFromObjectSize(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.updateWorldMatrix(),this.makeEmpty(),Y3.copy(e.worldMatrix,this.matrix);let i=Y3.invert(e.worldMatrix);this.expandByObjectSize(e,i,t)}expandByObjectSize(e,t){let i=[];!0===(arguments.length>2&&void 0!==arguments[2]&&arguments[2])&&e instanceof a4?e.traverse((e=>{e.visible&&p4(e,t,i)})):p4(e,t,i),this.setFromPoints(i)}getCenter(){let[e,t]=this.min,[i,n]=this.getHalfSize();return Y3.apply([e+i,t+n],this.matrix)}getSize(){return[this.max[0]-this.min[0],this.max[1]-this.min[1]]}getHalfSize(){return[.5*(this.max[0]-this.min[0]),.5*(this.max[1]-this.min[1])]}makeEmpty(){this.min=[1/0,1/0],this.max=[-1/0,-1/0]}setFromPoints(e){this.makeEmpty();for(let t of e)this.expandByPoint(t)}expandByPoint(e){this.min=[Math.min(this.min[0],e[0]),Math.min(this.min[1],e[1])],this.max=[Math.max(this.max[0],e[0]),Math.max(this.max[1],e[1])]}computeVertices(){let[e,t]=this.getHalfSize(),i=this.getCenter(),[n,r,a,s]=Y3.getAbcdef(this.matrix),o=Y3.create(n,r,a,s,i[0],i[1]);this.vertices=d4.map((i=>{let[n,r]=i;return Y3.apply([n*e,r*t],o)}))}computeEdges(){this.edges=[];for(let e=0,t=this.vertices.length;e<t;++e)this.edges.push([this.vertices[e],this.vertices[(e+1)%t]])}project(e,t){let i=this.matrix;return t&&(i=Y3.append(t.worldMatrix,i)),Y3.applyInverse(e,i)}intersects(e,t,i){return this.intersectsInLocalSpace(...this.project([e,t],i))}intersectsInLocalSpace(e,t){let{min:i,max:n}=this;return e>=i[0]&&e<=n[0]&&t>=i[1]&&t<=n[1]}containsPoint(e){let[t,i]=e,[n,r]=this.min,[a,s]=this.max;return t>=n&&t<=a&&i>=r&&i<=s}intersectsBBox2D(e){for(let t=0,i=this.edges.length;t<i;t++){let i=this.edges[t];for(let t=0,n=e.edges.length;t<n;t++){if(o4(i,e.edges[t]))return!0}}for(let t=0,i=e.vertices.length;t<i;t++){let i=e.vertices[t];if(this.containsPoint(i))return!0}return!1}ensureMinMax(){let e=this.min,t=this.max;this.min=[Math.min(e[0],t[0]),Math.min(e[1],t[1])],this.max=[Math.max(e[0],t[0]),Math.max(e[1],t[1])]}copy(e){this.min=[...e.min],this.max=[...e.max],Y3.copy(e.matrix,this.matrix),this.computeVertices(),this.computeEdges()}clone(){let e=new f4;return e.copy(this),e}},m4=new Promise((e=>{l4=e})),g4=!1;function v4(){if(!g4)return c4||(c4=async function(){var e;let t=await __webpack_require__.e(160).then(__webpack_require__.bind(__webpack_require__,160));l4(null!==(e=t.default)&&void 0!==e?e:t),g4=!0}(),c4)}function y4(e){let t=!1;return e.scene.objects.traverse(((e,i)=>{("Mesh"===i.type&&"UIGeometry"===i.geometry.type||"Page"===i.type&&void 0!==i.uiFrame)&&(t=!0)})),t}var b4=Y3.identity(),x4=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.canvas=e,this.dpr=t,this._width=0,this._height=0,this._strokeMode="inside",this._layerBlur=0,this._backgroundBlur=0,this._dropShadowBlur=0,this._dropShadowOffsetX=0,this._dropShadowOffsetY=0,this._dropShadowColor=zG.transparent,this._innerShadowBlur=0,this._innerShadowOffsetX=0,this._innerShadowOffsetY=0,this._innerShadowSpread=0,this._innerShadowColor=zG.transparent,this._fonts=new Map;try{let i=e.getBoundingClientRect();e.width=i.width*t,e.height=i.height*t}catch{console.log(e.width,t)}this._currentM3Transform=b4,this._currentTransform=new Float32Array(b4)}async init(){var e,t;if(!this.wasmURL)throw Error("Your must set the wasm binary url with renderer.wasmURL = ... before you can call renderer.init");await async function(e){let t=await m4;h4||(u4||(u4=t({locateFile:()=>e})),h4=await u4)}(this.wasmURL),this._surface=h4.MakeWebGLCanvasSurface(this.canvas),this.ctx=null===(e=this._surface)||void 0===e?void 0:e.getCanvas(),this._paint=new h4.Paint,this._paint.setAntiAlias(!0),this._paintFill=this._paint.copy(),this._paintFill.setStyle(h4.PaintStyle.Fill),this._paintStroke=this._paint.copy(),this._paintStroke.setStyle(h4.PaintStyle.Stroke),null===(t=this.ctx)||void 0===t||t.scale(this.dpr,this.dpr)}get currentTransform(){return this._currentM3Transform}get currentTransformBuffer(){return this._currentTransform}set currentTransform(e){this._currentM3Transform=e,this._currentTransform.set(e)}async loadFont(e,t){let i=await(await fetch(e)).arrayBuffer();this.registerFont(i,t)}registerFont(e,t){if(this._fonts.has(t))return;let i=h4.FontMgr.FromData(e);if(!i)throw new Error("Invalid font data for "+t);this._fonts.set(t,i)}get width(){return this._width}get height(){return this._height}set strokeColor(e){this._paintStroke&&this._paintStroke.setColor(_4(e),h4.ColorSpace.DISPLAY_P3)}set fillColor(e){this._paintFill&&this._paintFill.setColor(_4(e),h4.ColorSpace.DISPLAY_P3)}set lineWidth(e){this._paintStroke&&this._paintStroke.setStrokeWidth("center"===this._strokeMode?e:2*e)}set strokeMode(e){this._strokeMode=e}set dropShadowBlur(e){this._dropShadowBlur=e}set dropShadowColor(e){this._dropShadowColor=e}set dropShadowOffsetX(e){this._dropShadowOffsetX=e}set dropShadowOffsetY(e){this._dropShadowOffsetY=e}set innerShadowBlur(e){this._innerShadowBlur=e}set innerShadowColor(e){this._innerShadowColor=e}set innerShadowOffsetX(e){this._innerShadowOffsetX=e}set innerShadowOffsetY(e){this._innerShadowOffsetY=e}set innerShadowSpread(e){this._innerShadowSpread=e}set layerBlur(e){this._layerBlur=e}set backgroundBlur(e){this._backgroundBlur=e}clear(){var e;null===(e=this.ctx)||void 0===e||e.clear(h4.TRANSPARENT)}save(){var e;null===(e=this.ctx)||void 0===e||e.save()}restore(){var e;null===(e=this.ctx)||void 0===e||e.restore()}beginPath(){var e;null!==(e=this._currentPath)&&void 0!==e&&e.delete(),this._currentPath=new h4.Path}closePath(){let e=this._currentPath;if(e){if(e.isEmpty())return;let t=e.getBounds();(t[3]-t[1]||t[2]-t[0])&&e.close()}}fill(){this._paintInner(this._paintFill,!0)}stroke(){this._paintInner(this._paintStroke,!1)}clipRect(e,t,i,n){var r;let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,c=h4.XYWHRect(e,t,i,n);if(0===a&&0===s&&0===l&&0===o)null===(r=this.ctx)||void 0===r||r.clipRect(c,h4.ClipOp.Intersect,!0);else{var h;let e=h4.RRectXY(c,a,a);e[4]=e[5]=a,e[6]=e[7]=s,e[8]=e[9]=o,e[10]=e[11]=l,null===(h=this.ctx)||void 0===h||h.clipRRect(e,h4.ClipOp.Intersect,!0)}}_applyShadowOffsetMatrix(){if(this.ctx){let e=Y3.invert(this.currentTransform);this.ctx.concat(e);let t=Y3.translate(Y3.identity(),this._dropShadowOffsetX,this._dropShadowOffsetY);this.ctx.concat(t),this.ctx.concat(this._currentTransform)}}_applyEffectsToPaint(e,t){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(this.ctx&&this._currentPath){let d,p=!1;if(i&&this._hasDropShadow()){var n,r,a;let i,s=e.copy();s.setColor(_4(this._dropShadowColor)),this._dropShadowBlur>0&&(i=h4.MaskFilter.MakeBlur(h4.BlurStyle.Normal,this._dropShadowBlur*this.dpr*(null!==(n=null===(r=this.camera)||void 0===r?void 0:r.scale)&&void 0!==n?n:1),!1),s.setMaskFilter(i)),this.ctx.save(),this.ctx.clipPath(this._currentPath,h4.ClipOp.Difference,!0),this._applyShadowOffsetMatrix(),t(s),this.ctx.restore(),s.delete(),null===(a=i)||void 0===a||a.delete()}if(this._backgroundBlur>0&&i){this.ctx.save(),this.ctx.clipPath(this._currentPath,h4.ClipOp.Intersect,!0);let t=h4.ImageFilter.MakeBlur(this._backgroundBlur,this._backgroundBlur,h4.TileMode.Clamp,null),i=e.copy();i.setImageFilter(t),i.setAlphaf(1);let n=this._currentPath.computeTightBounds();this.ctx.saveLayer(i,n,null,h4.SaveLayerInitWithPrevious),this.ctx.drawColor(e.getColor()),this.ctx.restore(),this.ctx.restore(),i.delete(),t.delete(),p=!0}if(this._layerBlur>0){var s,o;let i=e.copy();d=h4.MaskFilter.MakeBlur(h4.BlurStyle.Normal,this._layerBlur*this.dpr*(null!==(s=null===(o=this.camera)||void 0===o?void 0:o.scale)&&void 0!==s?s:1),!1),i.setMaskFilter(d),t(i),i.delete(),d.delete(),p=!0}if(p||t(e),i&&this._hasInnerShadow()){var l,c,h,u;let e,t=new h4.Paint;t.setAntiAlias(!0),t.setStyle(h4.PaintStyle.Fill),t.setColor(_4(this._innerShadowColor)),this._innerShadowBlur>0&&(e=h4.MaskFilter.MakeBlur(h4.BlurStyle.Normal,this._innerShadowBlur*this.dpr*(null!==(l=null===(c=this.camera)||void 0===c?void 0:c.scale)&&void 0!==l?l:1),!1),t.setMaskFilter(e));let i=this._currentPath.computeTightBounds(),[n,r,a,s]=i,o=a-n,d=s-r;this.ctx.save(),this.ctx.clipPath(this._currentPath,h4.ClipOp.Intersect,!0),this.ctx.saveLayer(t,i,null,h4.SaveLayerInitWithPrevious),null!==(h=this.ctx)&&void 0!==h&&h.translate(this._innerShadowOffsetX,this._innerShadowOffsetY),this.ctx.drawRect(h4.XYWHRect(-1e3-this._innerShadowOffsetX,-1e3-this._innerShadowOffsetY,2e3+o+Math.abs(2*this._innerShadowOffsetX),2e3+d+Math.abs(2*this._innerShadowOffsetY)),t),t.setBlendMode(h4.BlendMode.Clear),this.ctx.drawPath(this._currentPath,t),this.ctx.restore(),this.ctx.restore(),t.delete(),null===(u=e)||void 0===u||u.delete()}}}_paintInner(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.ctx&&this._currentPath&&e){let i=this.ctx,n=this._currentPath;this._applyEffectsToPaint(e,(e=>{let r=!1;!t&&"center"!==this._strokeMode&&(i.save(),i.clipPath(n,"outside"===this._strokeMode?h4.ClipOp.Difference:h4.ClipOp.Intersect,!0),r=!0),i.drawPath(n,e),r&&i.restore()}),t)}}_hasDropShadow(){var e;return(null===(e=this._dropShadowColor)||void 0===e?void 0:e.a)>0}_hasInnerShadow(){var e;return(null===(e=this._innerShadowColor)||void 0===e?void 0:e.a)>0}path(e){var t;null===(t=this._currentPath)||void 0===t||t.addPath(h4.Path.MakeFromSVGString(e))}ellipse(e,t,i,n,r,a,s,o){var l;if(!w4([e,t,i,n])||!this._currentPath)return;if(i<0||n<0)throw Error("radii cannot be negative");let c=h4.XYWHRect(e-i,t-n,2*i,2*n);null===(l=this._currentPath)||void 0===l||l.addOval(c)}rect(e,t,i,n){var r;let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,c=h4.XYWHRect(e,t,i,n);if(w4(c))if(0===a&&0===s&&0===l&&0===o)null===(r=this._currentPath)||void 0===r||r.addRect(c);else{var h;let e=h4.RRectXY(c,a,a);e[4]=e[5]=a,e[6]=e[7]=s,e[8]=e[9]=o,e[10]=e[11]=l,null===(h=this._currentPath)||void 0===h||h.addRRect(e)}}getHorizontalAlign(e){switch(e){case 2:return h4.TextAlign.Right;case 3:return h4.TextAlign.Center;case 4:return h4.TextAlign.Justify;default:return h4.TextAlign.Left}}drawTextInner(e,t,i,n,r,a){let[s,o,l,c]=n,h=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],u=0,{ctx:d}=this;if(!d)return u;let p=a.copy(),f=a.copy();return f.setAlphaf(0),this._applyEffectsToPaint(p,(n=>{t.pushPaintStyle(i,n,f),t.addText(e);let a=t.build();a.layout(l);let h=o;2===r?h+=(c-a.getHeight())/2:3===r&&(h+=c-a.getHeight()),d.drawParagraph(a,s,h),u=a.getHeight(),t.reset(),a.delete()}),h),p.delete(),f.delete(),u}drawText(e,t){let i=0,n=this._fonts.get(t.font),{ctx:r,_paintFill:a,_paintStroke:s}=this;if(n&&r){let r=new h4.TextStyle({fontFamilies:[t.font],fontSize:t.fontSize,heightMultiplier:t.lineHeight,letterSpacing:t.letterSpacing}),o=new h4.ParagraphStyle({textStyle:r,textAlign:this.getHorizontalAlign(t.horizontalAlign)}),l=h4.XYWHRect(t.x,t.y,t.width,t.height),c=h4.ParagraphBuilder.Make(o,n);a&&(i=this.drawTextInner(e,c,r,l,t.verticalAlign,a,!0)),s&&(i=this.drawTextInner(e,c,r,l,t.verticalAlign,s,!1)),c.delete()}return{height:i}}render(){var e;null===(e=this._surface)||void 0===e||e.flush()}moveTo(e,t){var i;null===(i=this._currentPath)||void 0===i||i.moveTo(e,t)}lineTo(e,t){var i;null===(i=this._currentPath)||void 0===i||i.lineTo(e,t)}bezierCurveTo(e,t,i,n,r,a){var s;null===(s=this._currentPath)||void 0===s||s.cubicTo(e,t,i,n,r,a)}quadraticCurveTo(e,t,i,n){var r;null===(r=this._currentPath)||void 0===r||r.quadTo(e,t,i,n)}setTransform(e){var t,i,n,r;let a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.ctx)return;let s=this.ctx.getTotalMatrix(),o=Y3.invert(s);if(o&&this.ctx.concat(o),null!==(t=this.ctx)&&void 0!==t&&t.scale(this.dpr,this.dpr),null!==(i=this.camera)&&void 0!==i&&i.enabled&&(null!==(n=this.ctx)&&void 0!==n&&n.concat(this.camera.worldMatrix),a)){var l;let e=Y3.getScale(this.camera.worldMatrix);null===(l=this.ctx)||void 0===l||l.scale(1/e[0],1/e[1])}null!==(r=this.ctx)&&void 0!==r&&r.concat(e),this.currentTransform=e}transform(e){var t;null===(t=this.ctx)||void 0===t||t.concat(e)}setSize(e,t){var i;e===this._width&&t===this._height||(this._width=e,this._height=t,this.canvas.style.width=e+"px",this.canvas.style.height=t+"px",this.canvas.width=e*this.dpr,this.canvas.height=t*this.dpr,this._surface&&(this._surface=h4.MakeWebGLCanvasSurface(this.canvas),this.ctx=null===(i=this._surface)||void 0===i?void 0:i.getCanvas()))}};function w4(e){for(let t=0;t<e.length;t++)if(void 0!==e[t]&&!Number.isFinite(e[t]))return!1;return!0}function _4(e){let{r:t,g:i,b:n,a:r}=e;return h4.Color4f(t,i,n,r)}var S4,E4,C4,A4=class{constructor(e,t,i){this.uuid=e,this.data=t,this.enabled=!1,this.color=zG.transparent,this.blurRadius=0,this.offset=[0,0],this.spread=0,this.update(t)}update(e){void 0!==e.color&&(this.color=e.color),void 0!==e.enabled&&(this.enabled=e.enabled),void 0!==e.blurRadius&&(this.blurRadius=e.blurRadius),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.spread&&(this.spread=e.spread)}},M4=class{constructor(e,t,i){this.uuid=e,this.data=t,this.enabled=!1,this.radius=0,this.update(t)}update(e){void 0!==e.enabled&&(this.enabled=e.enabled),void 0!==e.radius&&(this.radius=e.radius)}},T4=class{constructor(e,t,i){this.uuid=e,this.data=t,this.enabled=!1,this.color=zG.transparent,this.update(t)}update(e){void 0!==e.enabled&&(this.enabled=e.enabled),void 0!==e.color&&(this.color=e.color)}},P4=class{constructor(e,t,i){this.uuid=e,this.data=t,this.enabled=!1,this.color=zG.transparent,this.thickness=0,this.mode="inside",this.update(t)}update(e){void 0!==e.enabled&&(this.enabled=e.enabled),void 0!==e.color&&(this.color=e.color),void 0!==e.thickness&&(this.thickness=e.thickness),void 0!==e.mode&&(this.mode=e.mode)}},D4=class extends r4{constructor(e,t,i){super(e,t,i),this.uuid=e,this.data=t,this.autoClose=!0,this.fill=new T4(e+"-fill",t.fill,i),this.stroke=new P4(e+"-stroke",t.stroke,i),this.dropShadow=new A4(e+"-dropShadow",t.dropShadow,i),this.innerShadow=new A4(e+"-innerShadow",t.innerShadow,i),this.backgroundBlur=new M4(e+"-backgroundBlur",t.backgroundBlur,i),this.layerBlur=new M4(e+"-layerBlur",t.layerBlur,i)}applyFillStroke(e){e.fillColor=this.fill.enabled?this.fill.color:zG.transparent,e.strokeColor=this.stroke.enabled&&this.stroke.thickness>0?this.stroke.color:zG.transparent,e.strokeMode=this.stroke.mode,e.lineWidth=this.stroke.thickness}applyFilters(e){this.layerBlur.enabled?e.layerBlur=5*this.layerBlur.radius:e.layerBlur=0,this.backgroundBlur.enabled?e.backgroundBlur=5*this.backgroundBlur.radius:e.backgroundBlur=0,this.dropShadow.enabled?(e.dropShadowBlur=5*this.dropShadow.blurRadius,e.dropShadowColor=this.dropShadow.color,e.dropShadowOffsetX=this.dropShadow.offset[0],e.dropShadowOffsetY=this.dropShadow.offset[1]):e.dropShadowColor=zG.transparent,this.innerShadow.enabled?(e.innerShadowSpread=this.innerShadow.spread,e.innerShadowBlur=5*this.innerShadow.blurRadius,e.innerShadowColor=this.innerShadow.color,e.innerShadowOffsetX=this.innerShadow.offset[0],e.innerShadowOffsetY=this.innerShadow.offset[1]):e.innerShadowColor=zG.transparent}innerDraw(e){}draw(e){!this.visible||(e.save(),this.applyTransforms(e),this.applyFilters(e),this.applyFillStroke(e),e.beginPath(),this.innerDraw(e),this.autoClose&&e.closePath(),this.fill.enabled&&e.fill(),this.stroke.enabled&&e.stroke(),e.restore())}updateByPatchedOp(e,t,i){super.updateByPatchedOp(e,t,i),0===e.type&&(VV(e.path,["fill"])?this.fill.update(e.props):VV(e.path,["stroke"])?this.stroke.update(e.props):VV(e.path,["dropShadow"])?this.dropShadow.update(e.props):VV(e.path,["innerShadow"])?this.innerShadow.update(e.props):VV(e.path,["layerBlur"])?this.layerBlur.update(e.props):VV(e.path,["backgroundBlur"])?this.backgroundBlur.update(e.props):this.resetBBoxNeedsUpdate())}updateState(e,t){super.updateState(e,t),void 0!==e.fill&&this.fill.update(e.fill),void 0!==e.stroke&&this.stroke.update(e.stroke),void 0!==e.dropShadow&&this.dropShadow.update(e.dropShadow),void 0!==e.innerShadow&&this.innerShadow.update(e.innerShadow),void 0!==e.layerBlur&&this.layerBlur.update(e.layerBlur),void 0!==e.backgroundBlur&&this.backgroundBlur.update(e.backgroundBlur)}clone(e){let t=new D4(this.uuid,this.data,e);return t.parent=void 0,t}},k4=class extends D4{constructor(e,t,i){super(e,t,i),this.uuid=e,this.data=t,this.width=0,this.height=0,this.updateState(t,i)}innerDraw(e){e.ellipse(.5*this.width,.5*this.height,.5*this.width,.5*this.height,0,0,2*Math.PI)}intersectsInLocalSpace(e,t){return function(e,t,i,n,r,a){let s=e-i,o=t-n;return s*s/(r*r)+o*o/(a*a)<=1}(e,t,.5*this.width,.5*this.height,.5*this.width,.5*this.height)}getCenter(){return[.5*this.width,.5*this.height]}getHalfSize(){return[.5*this.width,.5*this.height]}updateSizeState(e){let t=!1;void 0!==e.width&&(this.width="number"==typeof e.width?e.width:this.width,t=!0),void 0!==e.height&&(this.height="number"==typeof e.height?e.height:this.height,t=!0),t&&this.updateWorldMatrix(!0,!1,!0)}updateState(e,t){super.updateState(e,t),this.updateSizeState(e)}clone(e){let t=new k4(this.uuid,this.data,e);return t.parent=void 0,t}},O4=class extends D4{constructor(e,t,i){super(e,t,i),this.uuid=e,this.data=t,this.width=0,this.height=0,this.cornerRadius=[0,0,0,0],this.updateState(t,i)}innerDraw(e){e.rect(0,0,this.width,this.height,...this.cornerRadius)}getCenter(){return[.5*this.width,.5*this.height]}getHalfSize(){return[.5*this.width,.5*this.height]}updateCornerState(e){void 0!==e.cornerRadius&&(this.cornerRadius=e.cornerRadius)}updateSizeState(e){let t=!1;void 0!==e.width&&(this.width="number"==typeof e.width?e.width:this.width,t=!0),void 0!==e.height&&(this.height="number"==typeof e.height?e.height:this.height,t=!0),t&&this.updateWorldMatrix(!0,!1,!0)}updateState(e,t){super.updateState(e,t),this.updateSizeState(e),this.updateCornerState(e)}clone(e){let t=new O4(this.uuid,this.data,e);return t.parent=void 0,t}},I4=class extends D4{constructor(e,t,i){super(e,t,i),this.uuid=e,this.data=t,this._textHeight=0,this._textHeightDirty=!0,this.width=0,this.height=0,this.updateState(t,i)}get textHeight(){return this._textHeight}applyFillStroke(e){e.fillColor=this.fill.enabled?this.fill.color:zG.transparent,e.strokeColor=this.stroke.enabled&&this.stroke.thickness>0?this.stroke.color:zG.transparent,e.strokeMode="center",e.lineWidth=this.stroke.thickness}innerDraw(e){var t,i,n;(null===(t=this._fontHolder)||void 0===t?void 0:t.arrayBuffer)&&this._fontHolder.arrayBuffer.byteLength>1&&this.data.font&&e.registerFont(this._fontHolder.arrayBuffer,this.data.font);let r=this.data.textTransform,a=this.data.text.textValue.toString(),s=2===r?a.toUpperCase():3===r?a.toLowerCase():a,{height:o}=e.drawText(s,{x:0,y:0,width:this.width,height:this.height,fontSize:this.data.fontSize,lineHeight:null!==(i=this.data.lineHeight)&&void 0!==i?i:1,letterSpacing:null!==(n=this.data.letterSpacing)&&void 0!==n?n:0,horizontalAlign:this.data.horizontalAlign,verticalAlign:this.data.verticalAlign,font:this.data.font});this._textHeight=o}getCenter(){return[.5*this.width,.5*this.height]}getHalfSize(){return[.5*this.width,.5*this.height]}updateSizeState(e){let t=!1;void 0!==e.width&&(this.width="number"==typeof e.width?e.width:this.width,t=!0),void 0!==e.height&&(this.height="number"==typeof e.height?e.height:this.height,t=!0),t&&this.updateWorldMatrix(!0,!1,!0)}updateFontState(e,t){let{shared:i}=t;void 0!==e.font&&(this._fontHolder=i.getFont(e.font),this._fontHolder&&!this._fontHolder.isLoaded&&this._fontHolder.loadingPromise.then((()=>{this.requestRender()})))}updateState(e,t){super.updateState(e,t),this.updateSizeState(e),this.updateFontState(e,t)}clone(e){let t=new I4(this.uuid,this.data,e);return t.parent=void 0,t}},R4=class extends D4{constructor(e,t,i){super(e,t,i),this.uuid=e,this.data=t,this.curves=[],this.extremasBBox={min:[0,0],max:[0,0]},this.updateState(t,i)}computeExtremas(){0===this.curves.length&&this.computeCurves();let e=this.curves.map((e=>S4.extremas(e))),t=[1/0,1/0],i=[-1/0,-1/0];for(let n=0,r=e.length;n<r;n++){let r=e[n];r[0][0]<t[0]&&(t[0]=r[0][0]),r[0][1]<t[1]&&(t[1]=r[0][1]),r[1][0]>i[0]&&(i[0]=r[1][0]),r[1][1]>i[1]&&(i[1]=r[1][1])}return this.extremasBBox.min=[t[0],t[1]],this.extremasBBox.max=[i[0],i[1]],this.extremasBBox}computeCurves(){this.curves=[];for(let i=1,n=this.data.points.length;i<n;i++){let e=this.data.points[i].data,t=this.data.points[i-1].data,n={start:t.position,cp1:t.controlNext.position,cp2:e.controlPrevious.position,end:e.position};this.curves.push(n)}let e=this.data.points[0].data,t=this.data.points[this.data.points.length-1].data;if(this.data.isClosed){let i={start:t.position,cp1:t.controlNext.position,cp2:e.controlPrevious.position,end:e.position};this.curves.push(i)}}getCenter(){let[e,t]=this.extremasBBox.min,[i,n]=this.getHalfSize();return[e+i,t+n]}getHalfSize(){let{min:e,max:t}=this.extremasBBox;return[.5*(t[0]-e[0]),.5*(t[1]-e[1])]}innerDraw(e){for(let n=0,r=this.data.points.length;n<r;n++){let t=this.data.points[n].data;if(0===n){let[i,n]=t.position;e.moveTo(i,n)}else{let i=this.data.points[n-1].data,[r,a]=i.controlNext.position,[s,o]=t.controlPrevious.position,[l,c]=t.position,h={start:i.position,cp1:i.controlNext.position,cp2:t.controlPrevious.position,end:t.position};S4.derive(h),e.bezierCurveTo(r,a,s,o,l,c)}}let t=this.data.points[0].data,i=this.data.points[this.data.points.length-1].data;if(this.data.isClosed){let[n,r]=i.controlNext.position,[a,s]=t.controlPrevious.position,[o,l]=t.position;e.bezierCurveTo(n,r,a,s,o,l)}}updateState(e,t){super.updateState(e,t),this.computeExtremas()}clone(e){let t=new R4(this.uuid,this.data,e);return t.parent=void 0,t}};(e=>{function t(e,t,i){let n=e-2*t+i;if(0!==n){let r=-Math.sqrt(Math.abs(t*t-e*i)),a=-e+t;return[-(r+a)/n,-(-r+a)/n]}return t!==i&&0===n?[(2*t-i)/(2*(t-i))]:[]}e.derive=function(e){let t=e.start,i=e.cp1,n=e.cp2,r=e.end,a={start:[3*(i[0]-t[0]),3*(i[1]-t[1])],cp:[3*(n[0]-i[0]),3*(n[1]-i[1])],end:[3*(r[0]-n[0]),3*(r[1]-n[1])]};return e.derivative=a,a.derivative=E4.derive(a),a},e.droot=function(i){var n;let r=null!==(n=i.derivative)&&void 0!==n?n:e.derive(i),a=r.start,s=r.cp,o=r.end;return[t(a[0],s[0],o[0]),t(a[1],s[1],o[1])]},e.extremas=function(t){let[i,n]=e.droot(t),r=[t.start[0],t.end[0]],a=[t.start[1],t.end[1]];for(let s of i)r.push(e.compute(t,Math.min(1,Math.max(0,s)))[0]);for(let s of n)a.push(e.compute(t,Math.min(1,Math.max(0,s)))[1]);return r.sort(((e,t)=>e-t)),a.sort(((e,t)=>e-t)),[[r[0],a[0]],[r[r.length-1],a[a.length-1]]]},e.compute=function(e,t){if(0===t)return[...e.start];if(1===t)return[...e.end];let i=1-t,n=i*i,r=t*t,a=n*i,s=n*t*3,o=i*r*3,l=t*r;return[a*e.start[0]+s*e.cp1[0]+o*e.cp2[0]+l*e.end[0],a*e.start[1]+s*e.cp1[1]+o*e.cp2[1]+l*e.end[1]]}})(S4||(S4={})),(e=>{e.derive=function(e){let t=e.start,i=e.cp,n=e.end,r={start:[2*(i[0]-t[0]),2*(i[1]-t[1])],end:[2*(n[0]-i[0]),2*(n[1]-i[1])]};return r.derivative=C4.derive(r),e.derivative=r,r},e.droot=function(t){var i;let n=null!==(i=t.derivative)&&void 0!==i?i:e.derive(t),r=n.start,a=n.end;return[r[0]!==a[0]?r[0]/(r[0]-a[0]):0,r[1]!==a[1]?r[1]/(r[1]-a[1]):0]},e.compute=function(e,t){if(0===t)return[...e.start];if(1===t)return[...e.end];let i=1-t,n=i*i,r=i*t*2,a=t*t;return[n*e.start[0]+r*e.cp[0]+a*e.end[0],n*e.start[1]+r*e.cp[1]+a*e.end[1]]}})(E4||(E4={})),(e=>{e.derive=function(e){let t=e.start,i=e.end,n=[i[0]-t[0],i[1]-t[1]];return e.derivative=n,e.derivative},e.compute=function(e,t){if(0===t)return[...e.start];if(1===t)return[...e.end];let i=e.start,n=e.end;return[i[0]+(n[0]-i[0])*t,i[1]+(n[1]-i[1])*t]}})(C4||(C4={}));var L4=class extends a4{constructor(e,t,i){super(e,t,i),this.uuid=e,this.width=0,this.height=0,this.clipped=!0,this.background=new O4(e+"-background",VW.defaultData,i),this.background.parent=this,this.updateState(t,i)}get fill(){return this.background.fill}get stroke(){return this.background.stroke}get backgroundBlur(){return this.background.backgroundBlur}get layerBlur(){return this.background.layerBlur}get dropShadow(){return this.background.dropShadow}get innerShadow(){return this.background.innerShadow}get cornerRadius(){return this.background.cornerRadius}set cornerRadius(e){this.background.cornerRadius=e}updateLocalMatrix(){var e;super.updateLocalMatrix(),null===(e=this.background)||void 0===e||e.updateLocalMatrix()}updateWorldMatrix(e,t,i){var n;super.updateWorldMatrix(e,t,i),null===(n=this.background)||void 0===n||n.updateWorldMatrix(e,t,i)}draw(e){if(!this.visible)return;e.save();let t=this.width,i=this.height;this.applyTransforms(e),this.background.width=t,this.background.height=i,this.background.draw(e),this.clipped&&e.clipRect(0,0,t,i,...this.cornerRadius),this.innerDrawChildren(e),e.restore()}getCenter(){return[.5*this.width,.5*this.height]}getHalfSize(){return[.5*this.width,.5*this.height]}updateCornerState(e){void 0!==e.cornerRadius&&(this.cornerRadius=e.cornerRadius)}updateSizeState(e){let t=!1;void 0!==e.width&&(this.width="number"==typeof e.width?e.width:this.width,t=!0),void 0!==e.height&&(this.height="number"==typeof e.height?e.height:this.height,t=!0),t&&this.updateWorldMatrix(!0,!1,!0)}updateState(e,t){super.updateState(e,t),this.updateSizeState(e),this.updateCornerState(e),void 0!==e.fill&&this.fill.update(e.fill),void 0!==e.stroke&&this.stroke.update(e.stroke),void 0!==e.dropShadow&&this.dropShadow.update(e.dropShadow),void 0!==e.innerShadow&&this.innerShadow.update(e.innerShadow),void 0!==e.layerBlur&&this.layerBlur.update(e.layerBlur),void 0!==e.backgroundBlur&&this.backgroundBlur.update(e.backgroundBlur),void 0!==e.clipped&&(this.clipped=e.clipped)}requestRender(){super.requestRender(),this.dispatchEvent({type:"render"})}dispose(){this.removeEventListener("render")}updateByPatchedOp(e,t,i){super.updateByPatchedOp(e,t,i),0===e.type&&(VV(e.path,["fill"])?this.fill.update(e.props):VV(e.path,["stroke"])?this.stroke.update(e.props):VV(e.path,["dropShadow"])?this.dropShadow.update(e.props):VV(e.path,["innerShadow"])?this.innerShadow.update(e.props):VV(e.path,["layerBlur"])?this.layerBlur.update(e.props):VV(e.path,["backgroundBlur"])?this.backgroundBlur.update(e.props):this.resetBBoxNeedsUpdate())}clone(e){let t=new L4(this.uuid,this.data,e);t.parent=void 0;for(let i of this.children)t.add(i.clone(e));return t}},B4=J_(lS(),1),z4=class extends D4{constructor(e,t,i){super(e,t,i),this.uuid=e,this.data=t,this._pathBBox=new DOMRect,this.path="",this.updateState(t,i),this.autoClose=!1,this.computeSVGBBox()}computeSVGBBox(){let e=document.createElementNS("http://www.w3.org/2000/svg","svg"),t=document.createElementNS("http://www.w3.org/2000/svg","path");document.body.appendChild(e),t.setAttribute("d",this.path),e.appendChild(t),this._pathBBox=t.getBBox(),e.remove()}innerDraw(e){e.path(this.path)}intersectsInLocalSpace(e,t){return e>=this._pathBBox.x&&e<=this._pathBBox.x+this._pathBBox.width&&t>=this._pathBBox.y&&t<=this._pathBBox.y+this._pathBBox.height}getCenter(){return[(this._pathBBox.x+this._pathBBox.width)/2,(this._pathBBox.y+this._pathBBox.height)/2]}getHalfSize(){return[(this._pathBBox.x+this._pathBBox.width)/2,(this._pathBBox.y+this._pathBBox.height)/2]}updateState(e,t){super.updateState(e,t),void 0!==e.path&&(this.path=e.path,this.computeSVGBBox())}clone(e){let t=new z4(this.uuid,this.data,e);return t.parent=void 0,t}};var N4=class{constructor(e,t,i){this.uuid=e,this.data=t,this.group=new s4(N4.GROUP_ID,{...WW.defaultData},i),this.createChildrenObjects(t.objects,this.group,i)}createObject(e,t,i,n,r,a){let s=function(e,t,i){switch(t.type){case"ellipse2d":return new k4(e,t,i);case"rectangle2d":return new O4(e,t,i);case"text2d":return new I4(e,t,i);case"vector2d":return new R4(e,t,i);case"path2d":return new z4(e,t,i);case"frame2d":return new L4(e,t,i);default:return new s4(e,t,i)}}(e,t,a);s&&(n.add(s),n.children.splice(r,0,n.children.pop()),s.updateWorldMatrix(),i.length>0&&(s instanceof s4||s instanceof L4)&&this.createChildrenObjects(i,s,a))}createChildrenObjects(e,t,i){let n=0;for(let r of e)this.createObject(r.id,r.data,r.children,t,n,i),n+=1}draw(e){this.group.draw(e)}updateEntityByOp(e,t,i,n){let r=this.find(e);if(r)try{r.updateByOp(t,i,{shared:n})}catch(l){console.error(l)}}updateTreeByOp(e,t){if(0===e.path.length&&7===e.type){let i=null===e.parent?this.group:this.find(e.parent);void 0!==i&&i instanceof a4&&(this.createObject(e.id,e.data,e.children,i,e.localIndex,t),i.requestRender())}else if(0===e.path.length&&8===e.type){let t=this.find(e.id);if(void 0!==t&&void 0!==t.parent&&t.parent instanceof a4){let e=t.parent;t.resetBBoxNeedsUpdate(),null!==e&&void 0!==e&&e.remove(t),null===e||void 0===e||e.requestRender()}}else if(0===e.path.length&&9===e.type){let t=this.find(e.id);if(void 0!==t){let i=t.parent,n=null===e.parent?this:this.find(e.parent);if(n instanceof a4||n===this){n.add(t);let r=e.localIndex;n.children.splice(r,0,n.children.pop()),t.updateWorldMatrix(!0,!1,!0),null!==i&&void 0!==i&&i.requestRender(),t.requestRender()}t.resetBBoxNeedsUpdate()}}}add(e){this.group.add(e)}remove(e){this.group.remove(e)}traverse(e){this.group.traverse((t=>{t!==this.group&&e(t)}))}intersectsChildren(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];return this.group.intersectsChildren(e,t,i,n,r,!0)}find(e){return this.group.find(e)}get children(){return this.group.children}project(e,t){return this.group.project(e,t)}getWithSortKey(e){let t=this.find(e);if(void 0===t)return;let i=[],n=t;for(;n!==this.group;){let e=n;n=n.parent;let t=n.children.indexOf(e);i.splice(0,0,t)}return{entity:t,sortKey:i}}getAllSorted(e){let t=[];for(let i of e){let e=this.getWithSortKey(i.id);void 0!==e&&t.push(e)}return t.sort(((e,t)=>Oj(e.sortKey,t.sortKey))),t.map((e=>e.entity))}},F4=N4;function j4(e){let{constraints:t,newParentWidth:i,newParentHeight:n,initialParentWidth:r,initialParentHeight:a,objectInitialWidth:s,objectInitialHeight:o,objectInitialPosition:l}=e,{horizontalConstraint:c,verticalConstraint:h}=t,u=i-r,d=n-a,p=s,f=o,m=l[0],g=l[1];if(0!==c)if(1===c)m+=u;else if(3===c)m+=u/2;else if(2===c)p=Math.max(1,p+u);else if(4===c){let e=i/r;p*=e,m*=e}if(0!==h)if(1===h)g+=d;else if(3===h)g+=d/2;else if(2===h)f=Math.max(1,f+d);else if(4===h){let e=n/a;f*=e,g*=e}return{width:p,height:f,position:[m,g]}}F4.GROUP_ID="scene2d";J_(lS(),1);var V4=Y3.identity(),U4=class{constructor(e,t,i,n){this.uuid=e,this.width=t,this.height=i,this.context=n,this.enabled=!0,this.isScreenSpace=!1,this.isFrameDirty=!1,this.onRenderRequestedDownstream=()=>{this.isFrameDirty=!0,this.context.shared.requestRender()},this.onFrameOverrideObjectEvent=e=>{var t;if(void 0!==(null===(t=e.target)||void 0===t?void 0:t.uuid)){var i;let t=null===(i=this.frameRoot)||void 0===i?void 0:i.find(e.target.uuid);t&&t.dispatchEvent({...e,target:t})}},this.scene2d=new F4(cA.generateUUID(),YW.defaultData,{dpr:window.devicePixelRatio,shared:n.shared}),this.canvas=document.createElement("canvas"),this.renderer=new x4(this.canvas),n.shared.addCanvas(this.uuid,this.canvas),this.textureHolder=n.shared.canvas(this.uuid),this.promise=this.init()}async init(){this.renderer instanceof x4&&(this.renderer.wasmURL=$J.skiaWasmUrl),await this.renderer.init()}render(){var e,t;this.isFrameDirty&&(this.renderer.clear(),null!==(e=this.frameOverride)&&void 0!==e&&e.draw(this.renderer),this.renderer.render(),null!==(t=this.textureHolder)&&void 0!==t&&t.setNeedsUpdate(!0),this.isFrameDirty=!1)}updateEntity2DByOp(e,t,i,n){this.scene2d.updateEntityByOp(e,t,i,n),this.applySize()}updateTreeByOp(e,t){this.scene2d.updateTreeByOp(e,t),this.applySize()}applyOverrides(e){if(this.frameOverride&&this.frameRoot){var t,i;this.frameOverride.position=[0,0],this.frameOverride.rotation=0;let n=null!==(t=null===e||void 0===e?void 0:e.width)&&void 0!==t?t:this.width,r=null!==(i=null===e||void 0===e?void 0:e.height)&&void 0!==i?i:this.height;this.frameOverride.width=n,this.frameOverride.height=r,this.frameOverride.localMatrix=V4,this.isScreenSpace&&(this.frameOverride.fill.color=zG.from0to1([0,0,0,0])),this.frameOverride.data={...this.frameOverride.data,width:n,height:r},G4({objectOverride:this.frameOverride,objectRoot:this.frameRoot,newParentWidth:this.frameOverride.width,newParentHeight:this.frameOverride.height,initialParentWidth:this.frameRoot.width,initialParentHeight:this.frameRoot.height}),this.frameOverride.updateWorldMatrix(!0,!1,!0)}}applySize(e){var t,i,n,r;let a=null!==(t=null===e||void 0===e?void 0:e.width)&&void 0!==t?t:this.width,s=null!==(i=null===e||void 0===e?void 0:e.height)&&void 0!==i?i:this.height;this.width=a,this.height=s,this.renderer.dpr=this.isScreenSpace?window.devicePixelRatio:Math.floor(2048/Math.max(a,s)),this.renderer.setSize(a,s),null!==(n=this.textureHolder)&&void 0!==n&&n.dispose(),this.applyOverrides(e),null===(r=this.frameOverride)||void 0===r||r.requestRender()}applyFrame(e){var t,i,n;let r=this.context.scene.find2D(e);if(r&&r instanceof L4)return this.disposeFrameOverride(),this.frameRoot=r,this.frameOverride=r.clone({dpr:this.renderer.dpr,shared:this.context.shared}),this.scene2d.add(this.frameOverride),this.applySize(),null!==(t=this.textureHolder)&&void 0!==t&&t.dispose(),null!==(i=this.frame)&&void 0!==i&&i.addEventListener("render",this.onRenderRequestedDownstream),this.frameOverride.traverse((e=>{e.addEventListener("beginState",this.onFrameOverrideObjectEvent)})),this.frameOverride.traverse((e=>{e.addEventListener("completeState",this.onFrameOverrideObjectEvent)})),null!==(n=this.frame)&&void 0!==n&&n.requestRender(),r}get frame(){return this.frameOverride}get frameId(){var e;return null===(e=this.frame)||void 0===e?void 0:e.uuid}find(e){return this.scene2d.find(e)}get texture(){var e;return null===(e=this.textureHolder)||void 0===e?void 0:e.getTexture(1001)}disposeFrameOverride(){var e,t,i;null!==(e=this.frameOverride)&&void 0!==e&&e.removeEventListener("render",this.onRenderRequestedDownstream),null!==(t=this.frameOverride)&&void 0!==t&&t.traverse((e=>{e.removeEventListener("beginStateChange",this.onFrameOverrideObjectEvent)})),null!==(i=this.frameOverride)&&void 0!==i&&i.traverse((e=>{e.removeEventListener("completeState",this.onFrameOverrideObjectEvent)})),this.frameOverride&&this.scene2d.remove(this.frameOverride)}};function G4(e){let{objectOverride:t,objectRoot:i,newParentWidth:n,newParentHeight:r,initialParentWidth:a,initialParentHeight:s}=e;if(t instanceof L4&&i instanceof L4||t instanceof s4&&i instanceof s4)for(let o=0,l=t.children.length;o<l;o++){let e=t.children[o],l=i.children[o];e&&l&&e.uuid===l.uuid&&H4({objectOverride:e,objectRoot:l,newParentWidth:n,newParentHeight:r,initialParentWidth:a,initialParentHeight:s})}}function H4(e){let{objectOverride:t,objectRoot:i,newParentWidth:n,newParentHeight:r,initialParentWidth:a,initialParentHeight:s}=e,[o,l]=function(e){if(q4(e))return[e.width,e.height];if(e instanceof z4){let[t,i]=e.getHalfSize();return[2*t,2*i]}if(e instanceof s4){let[t,i]=e.recursiveBBox.getHalfSize();return[2*t,2*i]}return[0,0]}(i),{width:c,height:h,position:u}=j4({constraints:t.data,newParentWidth:n,newParentHeight:r,initialParentWidth:a,initialParentHeight:s,objectInitialWidth:o,objectInitialHeight:l,objectInitialPosition:i.position});if(t.position=u,t.data={...t.data,position:u},t.states)for(let d in t.states)W4({stateId:d,objectOverride:t,objectRoot:i,newParentWidth:n,newParentHeight:r,initialParentWidth:a,initialParentHeight:s});if(q4(t)||t instanceof s4)q4(t)&&(t.width=c,t.height=h,t.data={...t.data,width:c,height:h}),G4({objectOverride:t,objectRoot:i,newParentWidth:c,newParentHeight:h,initialParentWidth:o,initialParentHeight:l});else if(t instanceof z4){let e=i,n=0!==o?c/o:1,r=0!==l?h/l:1;t.path=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(t<=0||i<=0)return e;let n=(0,B4.parseSVG)(e).map((e=>{let n={...e};return"x"in n&&(n.x=n.x*t),"y"in n&&(n.y=n.y*i),"x1"in n&&(n.x1=n.x1*t),"x2"in n&&(n.x2=n.x2*t),"y1"in n&&(n.y1=n.y1*i),"y2"in n&&(n.y2=n.y2*i),"rx"in n&&(n.rx=n.rx*t),"ry"in n&&(n.ry=n.ry*i),n}));return function(e){let t,i=["rx","ry","xAxisRotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return e.map((e=>{let n=[];i.forEach((t=>{if(t in e){let i=1*e[t];n.length&&i>=0&&n.push(","),n.push(i)}}));let r=(t===e.code?n[0]<0?"":",":e.code)+n.join("");return t=e.code,r})).join("")}(n)}(e.path,n,r),t.data={...t.data,path:t.path}}}function W4(e){var t,i;let{stateId:n,objectOverride:r,objectRoot:a,newParentWidth:s,newParentHeight:o,initialParentWidth:l,initialParentHeight:c}=e,h=null===(t=r.states)||void 0===t?void 0:t[n],u=null===(i=a.states)||void 0===i?void 0:i[n];if(h&&u){let{width:e,height:t,position:i}=j4({constraints:r.data,newParentWidth:s,newParentHeight:o,initialParentWidth:l,initialParentHeight:c,objectInitialWidth:XW.isResizeable(u)?u.width:0,objectInitialHeight:XW.isResizeable(u)?u.height:0,objectInitialPosition:u.position});Object.assign(r.states[n],{position:i}),XW.isResizeable(h)&&Object.assign(r.states[n],{width:e,height:t})}}function q4(e){return e instanceof O4||e instanceof L4||e instanceof k4||e instanceof I4}var X4=class extends(iY(Dk)){constructor(e,t,i){super(),this.data=t,this.bgColor=new CK(1,1,1,1),this.fog=null,this.backupFog=new Pk(16777215,.1,2e3),this.fogUseBGColor=!1,this.isActive=!1,this.aoColor=new MA,this.penumbraSizeArrayCache=null,this.super_Entity(e,t),this.personalCamera=new F1(qG,{...GH.defaultData,...t.camera,name:"Personal Camera"}),this.personalCamera.objectHelper.visible=!1,this.add(this.personalCamera),this.activeCamera=this.personalCamera,this.ambientLight=new zI(13882323,8553090,.75),this.ambientLight.name="Default Ambient Light",this.ambientLight.layers.enable(3),this.ambientLight.removeFromParent(),this.add(this.ambientLight),t.uiScene?this.uiScene=new F4((Array.isArray(e)?e[0]:e)+"-ui",t.uiScene,{dpr:window.devicePixelRatio,shared:i.shared}):t.uiFrame&&this.createUICanvas(t.uiFrame,i)}get scene(){return this.parent}get postprocessing(){return this.data.postprocessing}get frameId(){return this.data.uiFrame}get frame(){var e;return null===(e=this.uiCanvas)||void 0===e?void 0:e.frame}createUICanvas(e,t){this.uiCanvas=new U4(this.uuid+"-uiscreen",window.innerWidth,window.innerHeight,t),this.uiCanvas.isScreenSpace=!0,this.uiCanvas.promise.then((()=>{var t,i;null!==(t=this.uiCanvas)&&void 0!==t&&t.applyFrame(e),null===(i=this.uiCanvas)||void 0===i||i.applySize()}))}updateVisible(){}setBackgroundColor(e){this.bgColor=e,!0===this.fogUseBGColor&&(this.backupFog.color=e)}entityChildrenCount(){return this.uiScene?this.uiScene.children.length:super.entityChildrenCount()}updateAmbientLight(e,t){void 0!==e.color&&(this.ambientLight.color=z$(e.color,t)),void 0!==e.intensity&&(this.ambientLight.intensity=e.intensity),void 0!==e.enabled&&(e.enabled?this.add(this.ambientLight):this.remove(this.ambientLight))}onDeactive(){this.isActive=!1}onActive(e){this.isActive=!0,e.fog=this.fog,this.traverseEntity((e=>{e instanceof H1&&e.recomputeBoolean()})),this.updateShadow(this.data.shadow)}forceMaterialsUpdate(){this.traverseEntity((e=>{if(e instanceof C0)if(Array.isArray(e.material))for(let t of e.material)t.needsUpdate=!0;else e.material.needsUpdate=!0,e.material.dispose()}))}updateShadow(e){void 0!==e.softShadowQuality&&this.isActive&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"medium";if(j3===e)return!1;j3=e;let t=(e=>{switch(e){case"low":return 8;case"medium":default:return 16;case"high":return 32}})(e);JT.shadowmap_pars_fragment=(e=>"\n\n// PCSS implementation based on:\n// https://www.gamedev.net/articles/programming/graphics/contact-hardening-soft-shadows-made-fast-r4906/\n// NOTE: This number affects how big the shadow blur can\n// possibly get. Bigger number == bigger blur, but less precise results\n\nconst float  gPenumbraFilterSize = 80.0;\nconst int   gPenumbraSamples = ".concat(e,";\nconst int gShadowSamples = ").concat(e,";\nconst float gShadowSamplesRpc = 1.0f / float(gShadowSamples);\n\n#ifdef USE_SHADOWMAP\n    #if NUM_DIR_LIGHT_SHADOWS > 0\n\n        uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n        varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\n        struct DirectionalLightShadow {\n            float shadowBias;\n            float shadowNormalBias;\n            float shadowRadius;\n            vec2 shadowMapSize;\n        };\n\n        uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\n    #endif\n\n    #if NUM_SPOT_LIGHT_SHADOWS > 0\n\n        uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n        varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\n        struct SpotLightShadow {\n            float shadowBias;\n            float shadowNormalBias;\n            float shadowRadius;\n            vec2 shadowMapSize;\n        };\n\n        uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\n    #endif\n\n    #if NUM_POINT_LIGHT_SHADOWS > 0\n\n        uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n        varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\n        struct PointLightShadow {\n            float shadowBias;\n            float shadowNormalBias;\n            float shadowRadius;\n            vec2 shadowMapSize;\n            float shadowCameraNear;\n            float shadowCameraFar;\n        };\n\n        uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\n    #endif\n\n    /*\n    #if NUM_RECT_AREA_LIGHTS > 0\n\n        // TODO (abelnation): create uniforms for area light shadows\n\n    #endif\n    */\n\nfloat computePenumbra(int index, sampler2D shadowMap, float temporalAngle, float texelSize, vec2 uv, float compare, float texelScalar, float shadowRadius)\n{\n    float penumbra = 1.0;\n    float blockerDepthAvg = 0.0;\n    float blockerCount = 0.0;\n\n    #pragma unroll_loop_start\n    for(int i = 0; i < gPenumbraSamples; i ++)\n    {\n        vec2 offset = (vogelDiskSample(i, gShadowSamples, temporalAngle) * texelSize) * texelScalar;\n        float depth = unpackRGBAToDepth( texture2D( shadowMap, uv + offset ) );\n\n        if(depth < compare + 0.0001)\n        {\n            blockerDepthAvg += depth;\n            blockerCount++;\n        }\n    }\n    #pragma unroll_loop_end\n\n    if (blockerCount > 0.0)\n    {\n        blockerDepthAvg /= blockerCount;\n\n        // Compute penumbra\n        penumbra = (compare - blockerDepthAvg) / (blockerDepthAvg);\n        penumbra *= penumbra;\n        penumbra *= 200.0 * penumbraSize[min(index, ",5," - 1)]; // Magic number that affects how quickly the penumbra grows\n\n        return clamp(penumbra, 0.00, 1.0);\n    }\n    return 0.0;\n}\n\nfloat vogelShadow(int index, sampler2D shadowMap, vec2 uv, float texelSize, float compare, float shadowRadius)\n{\n    float shadow         = 0.0f;\n\n    // NOTE: When using TAA, we should use screen space interleaved gradient noise\n    vec2 halton = haltonSequence[frameIndex];\n    float temporalOffset = getNoiseInterleavedGradient(gl_FragCoord.xy + halton);\n    float temporalAngle  = temporalOffset * PI2;\n\n    float texelScalar = (gPenumbraFilterSize) / (texelSize * 1024.);\n    float penumbra = computePenumbra(index, shadowMap, temporalAngle, texelSize, uv, compare, texelScalar, shadowRadius);\n    if (penumbra == -1.0) {\n        return 1.0;\n    }\n\n    #pragma unroll_loop_start\n    for (int i = 0; i < gShadowSamples; i++)\n    {\n        vec2 vogelSample =  vogelDiskSample(i, gShadowSamples, temporalAngle) * texelSize;\n        // Overall blurring offset\n        vec2 offset = vogelSample * (shadowRadius * 2.);\n\n        // Penumbra offset\n        offset += vogelSample * (penumbra * texelScalar);\n\n        shadow += step( compare, unpackRGBAToDepth( texture2D( shadowMap, uv + offset ) ) );\n    }\n    #pragma unroll_loop_end\n\n    return shadow * gShadowSamplesRpc;\n}\n\n\n    float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\n        return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\n    }\n\n    vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\n        return unpackRGBATo2Half( texture2D( shadow, uv ) );\n\n    }\n\n    float VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\n        float occlusion = 1.0;\n\n        vec2 distribution = texture2DDistribution( shadow, uv );\n\n        float hard_shadow = step( compare , distribution.x ); // Hard Shadow\n\n        if (hard_shadow != 1.0 ) {\n\n            float distance = compare - distribution.x ;\n            float variance = max( 0.00000, distribution.y * distribution.y );\n            float softness_probability = variance / (variance + distance * distance ); // Chebeyshevs inequality\n            softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); // 0.3 reduces light bleed\n            occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\n        }\n        return occlusion;\n\n    }\n\n    float getShadow( int i, sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\n        float shadow = 1.0;\n\n        shadowCoord.xyz /= shadowCoord.w;\n        shadowCoord.z += shadowBias;\n\n        // if ( something && something ) breaks ATI OpenGL shader compiler\n        // if ( all( something, something ) ) using this instead\n\n        bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n        bool inFrustum = all( inFrustumVec );\n\n        bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\n        bool frustumTest = all( frustumTestVec );\n\n        if ( frustumTest ) {\n\n        #if defined( SHADOWMAP_TYPE_PCF )\n\n            vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n            return vogelShadow(i, shadowMap, shadowCoord.xy, texelSize.x, shadowCoord.z, shadowRadius );\n\n        #elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n            vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n            float dx = texelSize.x;\n            float dy = texelSize.y;\n\n            vec2 uv = shadowCoord.xy;\n            vec2 f = fract( uv * shadowMapSize + 0.5 );\n            uv -= f * texelSize;\n\n            shadow = (\n                texture2DCompare( shadowMap, uv, shadowCoord.z ) +\n                texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n                texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n                texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n                mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n                     texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n                     f.x ) +\n                mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n                     texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n                     f.x ) +\n                mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n                     texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n                     f.y ) +\n                mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n                     texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n                     f.y ) +\n                mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n                          texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n                          f.x ),\n                     mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n                          texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n                          f.x ),\n                     f.y )\n            ) * ( 1.0 / 9.0 );\n\n        #elif defined( SHADOWMAP_TYPE_VSM )\n\n            shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\n        #else // no percentage-closer filtering:\n\n            shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\n        #endif\n\n        }\n\n        return shadow;\n\n    }\n\n    // cubeToUV() maps a 3D direction vector suitable for cube texture mapping to a 2D\n    // vector suitable for 2D texture mapping. This code uses the following layout for the\n    // 2D texture:\n    //\n    // xzXZ\n    //  y Y\n    //\n    // Y - Positive y direction\n    // y - Negative y direction\n    // X - Positive x direction\n    // x - Negative x direction\n    // Z - Positive z direction\n    // z - Negative z direction\n    //\n    // Source and test bed:\n    // https://gist.github.com/tschw/da10c43c467ce8afd0c4\n\n    vec2 cubeToUV( vec3 v, float texelSizeY ) {\n\n        // Number of texels to avoid at the edge of each square\n\n        vec3 absV = abs( v );\n\n        // Intersect unit cube\n\n        float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n        absV *= scaleToCube;\n\n        // Apply scale to avoid seams\n\n        // two texels less per square (one texel will do for NEAREST)\n        v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\n        // Unwrap\n\n        // space: -1 ... 1 range for each square\n        //\n        // #X##         dim    := ( 4 , 2 )\n        //  # #         center := ( 1 , 1 )\n\n        vec2 planar = v.xy;\n\n        float almostATexel = 1.5 * texelSizeY;\n        float almostOne = 1.0 - almostATexel;\n\n        if ( absV.z >= almostOne ) {\n\n            if ( v.z > 0.0 )\n                planar.x = 4.0 - v.x;\n\n        } else if ( absV.x >= almostOne ) {\n\n            float signX = sign( v.x );\n            planar.x = v.z * signX + 2.0 * signX;\n\n        } else if ( absV.y >= almostOne ) {\n\n            float signY = sign( v.y );\n            planar.x = v.x + 2.0 * signY + 2.0;\n            planar.y = v.z * signY - 2.0;\n\n        }\n\n        // Transform to UV space\n\n        // scale := 0.5 / dim\n        // translate := ( center + 0.5 ) / dim\n        return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\n    }\n\n    float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\n        float shadow = 1.0;\n        vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\n        // for point lights, the uniform @vShadowCoord is re-purposed to hold\n        // the vector from the light to the world-space position of the fragment.\n        vec3 lightToPosition = shadowCoord.xyz;\n\n        // dp = normalized distance from light to fragment position\n        float compare = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); // need to clamp?\n        compare += shadowBias;\n\n        // bd3D = base direction 3D\n        vec3 bd3D = normalize( lightToPosition );\n\n        vec2 halton = haltonSequence[frameIndex];\n        float temporalOffset = getNoiseInterleavedGradient(gl_FragCoord.xy + halton);\n        float temporalAngle  = temporalOffset * PI2;\n\n        #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_VSM )\n            for (int i = 0; i < gShadowSamples; i++) {\n                vec2 vogelSample = vogelDiskSample(i, gShadowSamples, temporalAngle) * texelSize;\n\n                // Overall blurring offset\n                vec3 offset = vec3(vogelSample.x, vogelSample.y, -vogelSample.x) * (shadowRadius + 5.);\n\n                // NOTE: Removed for now\n                // Penumbra offset\n                //offset += vec3(vogelSample.x, vogelSample.y, vogelSample.y)  * (penumbra * gPenumbraFilterSize);\n\n                shadow += texture2DCompare( shadowMap, cubeToUV( bd3D + offset, texelSize.y ), compare );\n\n            }\n            return shadow * gShadowSamplesRpc;\n\n        #elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n            for (int i = 0; i < 16; i++) {\n                vec2 vogelSample = vogelDiskSample(i, gShadowSamples, temporalAngle) * texelSize;\n\n                // Overall blurring offset\n                vec3 offset = vec3(vogelSample.x, vogelSample.y, -vogelSample.x) * (shadowRadius + 5.);\n\n                shadow += texture2DCompare( shadowMap, cubeToUV( bd3D + offset, texelSize.y ), compare );\n\n            }\n            return shadow * (1.0 / 16.0);\n        #else // no percentage-closer filtering\n\n            return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), compare );\n\n        #endif\n\n    }\n\n#endif\n"))(t);let i=N3.slice();i=i.replace("getShadow( spotShadowMap[ i ]","getShadow( UNROLLED_LOOP_INDEX + ".concat(3,", spotShadowMap[ i ]")),i=i.replace("getShadow( directionalShadowMap[ i ]","getShadow( UNROLLED_LOOP_INDEX, directionalShadowMap[ i ]"),JT.lights_fragment_begin=i;let n=F3.slice();return n=n.replaceAll("getShadow(","getShadow( UNROLLED_LOOP_INDEX, "),JT.shadowmask_pars_fragment=n,!0}(e.softShadowQuality)&&this.forceMaterialsUpdate()}updateFog(e,t){if(e.enabled?this.fog=this.backupFog:this.fog=null,this.isActive){this.scene.fog=this.fog}this.fogUseBGColor=e.useBackgroundColor,e.useBackgroundColor?this.backupFog.color.set(this.bgColor):this.backupFog.color=z$(e.color,t),this.backupFog.near=e.near,this.backupFog.far=e.far}updateAo(e,t){void 0!==e.aoColor&&(this.aoColor=z$(e.aoColor,t))}updateByOp(e,t,i,n){let r=this.data.uiFrame;super.updateByOp(e,t,i,n);let a=t;VV(e.path,["fog"])?this.updateFog(a.fog,i.shared):VV(e.path,["ao"])?this.updateAo(a.ao,i.shared):VV(e.path,["ambient"])?this.updateAmbientLight(a.ambient,i.shared):VV(e.path,["shadow"])?this.updateShadow(a.shadow):0===e.type&&0===e.path.length&&(void 0!==e.props.uiFrame||r!==a.uiFrame)&&this.updateUIFrame(e.props.uiFrame,i)}updateUIFrame(e,t){e?(this.uiCanvas||this.createUICanvas(e,t),this.uiCanvas.enabled=!0,this.uiCanvas.applyFrame(e)):this.uiCanvas&&(this.uiCanvas.enabled=!1)}updateState(e,t){this.updateState_Entity(e,t),void 0!==e.backgroundColor&&this.setBackgroundColor(z$(e.backgroundColor,t.shared)),void 0!==e.fog&&this.updateFog(e.fog,t.shared),void 0!==e.ambient&&this.updateAmbientLight(e.ambient,t.shared),void 0!==e.ao&&this.updateAo(e.ao,t.shared),void 0!==e.shadow&&this.updateShadow(e.shadow)}createFrame(e,t){}raycast(e,t){super.raycast(e,t)}switchActiveCamera(e){e&&e.isDescendantOf(this)&&(this.activeCamera!==this.personalCamera&&(this.activeCamera.objectHelper.visible=!0),this.activeCamera=e,e.objectHelper.visible=!1)}get playCamera(){var e,t;return null!==(e=null===(t=this.scene)||void 0===t?void 0:t.find(this.data.publish.playCamera))&&void 0!==e?e:this.personalCamera}switchToPlayCamera(){this.switchActiveCamera(this.playCamera)}get penumbraSizeArray(){return null===this.penumbraSizeArrayCache&&this.updatePenumbraSizeArray(),this.penumbraSizeArrayCache}updatePenumbraSizeArray(){this.penumbraSizeArrayCache=new Array(5).fill(.5);let e=0,t=0;this.traverseEntity((i=>{if(!i.visible)return!0;i instanceof Q3&&i.visible&&e<3&&(this.penumbraSizeArrayCache[e]=i.data.penumbraSize,e+=1),i instanceof $3&&i.visible&&e<2&&(this.penumbraSizeArrayCache[3+t]=i.data.penumbraSize,t+=1)}))}raycastWithClones(e){let t=[],i=n=>{for(let r of n.children){let n=r.cloner;IX.is(r)&&(r.visible||(null===n||void 0===n?void 0:n.object.data.visible))&&((q1(r)||Y1(r)&&this.scene.enableHelpers&&r.objectHelper.visible)&&(e.intersectObject(r,!1,t),S5(r,e,t,!0)),i(r))}};return i(this),t}updateEntity2DByOp(e,t,i,n){var r;null===(r=this.uiCanvas)||void 0===r||r.updateEntity2DByOp(e,t,i,n)}},Y4=class extends(W1(YI,W3)){constructor(e,t,i){super(),this.super_Entity(e,t),this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024,this.shadow.normalBias=1,this.layers.enable(3);let n=this.shadow.camera;n.fov=90,n.aspect=1,n.near=100,n.far=2500;let r=new FA(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),a=new FA(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z),s=new UA(r,a),o=new zR(s,new MA(16755200));o.visible=!1,this.gizmos.shadowmap=o,this.update()}update(){if(this.shadow&&(this.shadow.camera.updateProjectionMatrix(),this.gizmos))for(let e in this.gizmos){let t=this.gizmos[e];if(t instanceof zR){let e=this.shadow.camera,i=new FA(-e.far+this.position.x,-e.far+this.position.y,-e.far+this.position.z),n=new FA(e.far+this.position.x,e.far+this.position.y,e.far+this.position.z);t.box.set(i,n),t.updateMatrixWorld(!0)}}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.objectHelper&&this.objectHelper.update()}updateState(e,t){this.updateState_Light(e,t),void 0!==e.distance&&(this.distance=e.distance),void 0!==e.decay&&(this.decay=e.decay),void 0!==e.shadowRadius&&(this.shadow.radius=e.shadowRadius),void 0!==e.shadowResolution&&(this.shadow.mapSize.set(e.shadowResolution,e.shadowResolution),this.shadow.map&&(this.shadow.map.dispose(),this.shadow.map=null))}},Q4=class extends k0{get forceComputeSize(){return!0}get shape(){return this.geometry.userData.shape}updateEntityBoxSize(e,t){let i=this.geometry.getAttribute("position");void 0!==i?fK(i,this.geometry.drawRange.start,this.geometry.drawRange.count<1/0?this.geometry.drawRange.count:i.count,e,t):super.updateEntityBoxSize(e,t)}},Z4=class extends k0{constructor(e,t,i){super(e,t,i),this._shapeId=null,this._context=i}updateState(e,t){super.updateState(e,t),this.updateShape()}updateShape(){let e,t={...this.data.geometry.extrusion.shape};for(let r in t)"string"==typeof t[r]&&(t[r]=this._context.shared.getVariable(t[r],[this.uuid,"geometry","extrusion","shape",r]));if("Custom"===t.type){let n=t.shapeId;if(n!==this._shapeId&&this.detachShape(),n){var i;this._shapeId=n;let t=this._context.scene.find(n);null!==t&&void 0!==t&&t.data&&(t.attachedPaths.add(this),e=null===(i=t.geometry.userData)||void 0===i?void 0:i.shape),e||this._context.scene.addPendingCommand((()=>this.updateShape()))}}else{let i;switch(t.type){case"Rectangle":i=sZ;break;case"Ellipse":i=CQ;break;case"Polygon":i=tZ;break;case"Star":i=lZ;break;default:throw new Error("Unknown shape type: ".concat(t.type))}e=i.create({parameters:t}).userData.shape}let n=this.geometry;e&&n.inputs&&(n.inputs.shapeData=e,n.build(),this.attachedSurfaceCloners.forEach((e=>e.update())))}detachShape(){var e;null!==this._shapeId&&(null===(e=this._context.scene.find(this._shapeId))||void 0===e||e.attachedPaths.delete(this))}createGeometryDelayed(e){this.geometryCreateDeleyed=e.shared,this.updateShape(),this.refreshAttachedPaths(e)}updateTransformState(e,t){return super.updateTransformState(e,t)}updateGeometryInteractions(e,t){super.updateGeometryInteractions(e,t),this.updateShape()}updateEntityBoxSize(e,t){let i=this.geometry.getAttribute("position");void 0!==i?fK(i,this.geometry.drawRange.start,this.geometry.drawRange.count<1/0?this.geometry.drawRange.count:i.count,e,t):super.updateEntityBoxSize(e,t)}},K4=class extends(O1(wk,Q1)){constructor(e,t,i){super(),"Instance"===t.type&&"string"==typeof e&&(t=this.transformAssignData(t,i)),this.super_Entity(e,t),this.objectHelper.update()}get isComponentRoot(){return"Component"===this.data.type&&"string"==typeof this.identity}get isInstanceRoot(){return"Instance"===this.data.type&&"string"==typeof this.identity}transformAssignData(e,t){let i=kW.getComponentData({scene:t.scene.data,shared:t.shared.data},e.component);if(i){let t,n;for(let r of qH.rootOverrideProps)void 0===e[r]?(void 0===t&&(t={...e}),t[r]=i.data[r]):(void 0===n&&(n={}),n[r]=e[r],void 0===t&&(t={...e}),t[r]=hV.apply(i.data[r],e[r]));return this.overrideData=n,t}return{...zH.defaultData,...e,...wj(zH.defaultData,qH.rootOverrideProps)}}updateByOp(e,t,i,n){var r;let a;if(this.isInstanceRoot&&!n)if(t=this.transformAssignData(t,i),0===e.type&&0===e.path.length&&this.component)for(let s of qH.rootOverrideProps)s in e.props&&void 0===e.props[s]&&(void 0===a&&(a={...e,props:{...e.props}}),a.props[s]=this.component.data[s]);else if(0===e.type&&e.path.length>0&&qH.rootOverrideProps.includes(e.path[0])){let i=e.path[0];void 0===a&&(a={...e,path:[],props:{[i]:t[i]}})}super.updateByOp(null!==(r=a)&&void 0!==r?r:e,t,i,n)}updateState(e,t){this.updateState_Entity(e,t)}expandInstanceChildren(e){let t=this.data;if(void 0===this.component){var i;let n=null!==(i=e.scene.find(t.component))&&void 0!==i?i:null,r=!1;if(n!==this.oldComponent){if(this.oldComponent){let t=0;for(let i of this.children){if(!IX.is(i))break;e.scene.disposeAndUnregisterEntityRecursivelyIfNotReregistered(i),J4(i),t+=1}this.children.splice(0,t)}r=!0}if(n){let i={};e5(e,[this.uuid],t.overrides,this,n,n,0,r,i);for(let t of this.children)if(IX.is(t)){let n=t.data;"Empty"===n.type&&n.animations&&t.traverseEntity((t=>{if(t instanceof k0&&t.isSkinnedMesh){let n=t.dataPatched;if(n.bones&&n.boneInverses){let r=n.bones.map((t=>e.scene.find(i[t]))),a=n.boneInverses.map((e=>(new mM).fromArray(e))),s=new Nk(r,a);t.bind(s,t.bindMatrix)}}else t.matrixAutoUpdate=!0}))}}this.oldComponent=this.component}}};function J4(e){if(e.component){let t=e.component.instances.indexOf(e);t>=0&&e.component.instances.splice(t,1);for(let i of e.children)IX.is(i)&&J4(i)}}function $4(e,t,i,n){return e.component===t&&dj(e.identity,n)?e.overrideData===i?2:1:0}function e5(e,t,i,n,r,a,s,o,l){if(s>50)return!1;if(n.component!==r){if(n.component){let e=n.component.instances.indexOf(n);e>=0&&n.component.instances.splice(e,1)}r.instances.find((e=>e===n))||r.instances.push(n),n.component=r}r instanceof K4&&r.isInstanceRoot&&r.expandInstanceChildren(e);let c=0;for(let u of r.children)if(IX.is(u)){let r=[...t,..."string"==typeof u.identity?[u.identity]:u.identity],d=WH.resolve(i,r,1);null==d||d instanceof fV||(Object.setPrototypeOf(d,fV.prototype),console.error("wrong prototype"));let p,f=null;if(!o){var h;let t=n.children[c];if(f=IX.is(t)?t:null,null!==f){let e=$4(f,u,d,r);p=e>=1?f.stateSelection:void 0,2!==e&&(f=null)}if(null===f&&(f=null!==(h=e.scene.findInstance(r))&&void 0!==h?h:null,null!==f)){let t=$4(f,u,d,r);if(p=t>=1?f.stateSelection:void 0,2!==t)f=null;else{let t=f.parent.children.indexOf(f);f.parent.children.splice(t,1),n.children.splice(c,0,f),f.parent===n?t<=c&&console.error("not possible"):(f.parent=n,f.matrixWorldNeedsUpdate=!0,f.resetBBoxNeedsUpdate(),f.updateVisible(),e.pendingDeletes.delete(f))}}}if(null===f){let t=d?hV.apply(u.data,d):u.data;UG.is(t.type)&&(t={...t,type:"Empty"}),f=WX.createEntity(r,t,e),f.overrideData=d,n.add(f),n.children.splice(n.children.length-1,1),n.children.splice(c,0,f),f.updateState(f.data,e),p&&f.changeSelectedState(p,e),e.scene.registerInstanceAndSetUuid(f)}if(f.isBone){l[f.identity[f.identity.length-1]]=f.uuid}c+=1,e5(e,t,i,f,u,a,s+1,o,l)}if(!o){let t=c;for(;;){let t=n.children[c];if(!IX.is(t))break;e.pendingDeletes.add(t),c+=1}n.children.splice(t,c-t)}return!0}var t5=class extends(O1(Rk,Q1)){constructor(e,t){super(),this.super_Entity(e,t),this.objectHelper.update(),this.matrixAutoUpdate=!0}updateState(e,t){this.updateState_Entity(e,t)}},i5=class extends k0{constructor(e,t,i){super(e,t,i),this.onBeforeRender=()=>{this.uiCanvas.render()},this.uiCanvas=new U4(e+"-canvas",t.geometry.width,t.geometry.height,i),this.uiCanvas.promise.then((()=>{this.applyFrame(this.dataPatched.geometry.frame,i.shared)}))}updateByPatchedOpGeometry(e,t,i){super.updateByPatchedOpGeometry(e,t,i),0===e.type&&(void 0!==e.props.frame&&this.applyFrame(e.props.frame,i.shared),(void 0!==e.props.width||void 0!==e.props.height)&&this.applySize(e.props,i.shared))}applySize(e,t){var i,n;let r=null!==(i=null===e||void 0===e?void 0:e.width)&&void 0!==i?i:this.dataPatched.geometry.width,a=null!==(n=null===e||void 0===e?void 0:e.height)&&void 0!==n?n:this.dataPatched.geometry.height;this.uiCanvas.applySize({width:r,height:a}),this.applyGeometryParametersFromFrame(t)}applyFrame(e,t){this.uiCanvas.applyFrame(e),this.applyGeometryParametersFromFrame(t),this.applyMaterialParametersFromFrame({shared:t})}applyGeometryParametersFromFrame(e){var t;let i=this.frame;i&&(Object.assign(this.data,{geometry:Object.assign(this.data.geometry,{cornerRadius:i.cornerRadius,cornerType:0})}),Object.assign(this.dataPatched,{geometry:Object.assign(this.dataPatched.geometry,{cornerRadius:i.cornerRadius,cornerType:0})}),null!==(t=this.localGeometry)&&void 0!==t&&t.dispose(),this.localGeometry=kZ(this.dataPatched.geometry,e,this.data.flatShading,this))}applyMaterialParametersFromFrame(e){let t=this.frame;if(t){let i=t.data.backgroundBlur;Object.assign(this.data.material.layers[0].data.texture,{image:this.uiCanvas.uuid}),Object.assign(this.data.material.layers[1].data,{roughness:i.radius,alpha:i.enabled?1:0}),Object.assign(this.dataPatched.material.layers[0].data.texture,{image:this.uiCanvas.uuid}),Object.assign(this.dataPatched.material.layers[1].data,{roughness:i.radius,alpha:i.enabled?1:0}),this.material.reset(this.dataPatched.material,e,!0)}}updateEntity2DByOp(e,t,i,n){this.uiCanvas.updateEntity2DByOp(e,t,i,n),e===this.frameId&&0===t.type&&(void 0!==t.props.cornerRadius?this.applyGeometryParametersFromFrame(n):VV(t.path,["backgroundBlur"])&&this.applyMaterialParametersFromFrame({shared:n}))}get frame(){return this.uiCanvas.frame}get frameId(){var e;return null===(e=this.frame)||void 0===e?void 0:e.uuid}removeInteractionGeometry(e){super.removeInteractionGeometry(e),this.applySize({},e)}updateGeometryInteractions(e,t){super.updateGeometryInteractions(e,t),this.applySize({width:e.width,height:e.height},t)}},n5=class{constructor(e,t,i){this.variables=[],this.currentTextureIndex=0;let n=zE,r=new Dk,a=new BT;a.position.z=1;let s={passThruTexture:{value:null}},o=h("uniform sampler2D passThruTexture;\n\nvoid main() {\n\n\tvec2 uv = gl_FragCoord.xy / resolution.xy;\n\n\tgl_FragColor = texture2D( passThruTexture, uv );\n\n}\n",s),l=new TT(new KT(2,2),o);function c(i){i.defines.resolution="vec2( "+e.toFixed(1)+", "+t.toFixed(1)+" )"}function h(e,t){let i=new LT({uniforms:t=t||{},vertexShader:"void main()\t{\n\n\tgl_Position = vec4( position, 1.0 );\n\n}\n",fragmentShader:e});return c(i),i}r.add(l),this.setDataType=function(e){return n=e,this},this.addVariable=function(e,t,i){let n={name:e,initialValueTexture:i,material:this.createShaderMaterial(t),dependencies:null,renderTargets:[],wrapS:null,wrapT:null,minFilter:CE,magFilter:CE};return this.variables.push(n),n},this.setVariableDependencies=function(e,t){e.dependencies=t},this.init=function(){if(!1===i.capabilities.isWebGL2&&!1===i.extensions.has("OES_texture_float"))return"No OES_texture_float support for float textures.";if(0===i.capabilities.maxVertexTextures)return"No support for vertex shader textures.";for(let i=0;i<this.variables.length;i++){let n=this.variables[i];n.renderTargets[0]=this.createRenderTarget(e,t,n.wrapS,n.wrapT,n.minFilter,n.magFilter),n.renderTargets[1]=this.createRenderTarget(e,t,n.wrapS,n.wrapT,n.minFilter,n.magFilter),this.renderTexture(n.initialValueTexture,n.renderTargets[0]),this.renderTexture(n.initialValueTexture,n.renderTargets[1]);let r=n.material,a=r.uniforms;if(null!==n.dependencies)for(let e=0;e<n.dependencies.length;e++){let t=n.dependencies[e];if(t.name!==n.name){let e=!1;for(let i=0;i<this.variables.length;i++)if(t.name===this.variables[i].name){e=!0;break}if(!e)return"Variable dependency not found. Variable="+n.name+", dependency="+t.name}a[t.name]={value:null},r.fragmentShader="\nuniform sampler2D "+t.name+";\n"+r.fragmentShader}}return this.currentTextureIndex=0,null},this.compute=function(){let e=this.currentTextureIndex,t=0===this.currentTextureIndex?1:0;for(let i=0,n=this.variables.length;i<n;i++){let n=this.variables[i];if(null!==n.dependencies){let t=n.material.uniforms;for(let i=0,r=n.dependencies.length;i<r;i++){let r=n.dependencies[i];t[r.name].value=r.renderTargets[e].texture}}this.doRenderTarget(n.material,n.renderTargets[t])}this.currentTextureIndex=t},this.getCurrentRenderTarget=function(e){return e.renderTargets[this.currentTextureIndex]},this.getAlternateRenderTarget=function(e){return e.renderTargets[0===this.currentTextureIndex?1:0]},this.dispose=function(){l.geometry.dispose(),l.material.dispose();let e=this.variables;for(let t=0;t<e.length;t++){let i=e[t];i.initialValueTexture&&i.initialValueTexture.dispose();let n=i.renderTargets;for(let e=0;e<n.length;e++)n[e].dispose()}},this.addResolutionDefine=c,this.createShaderMaterial=h,this.createRenderTarget=function(i,r,a,s,o,l){return new LA(i=i||e,r=r||t,{wrapS:a=a||SE,wrapT:s=s||SE,minFilter:o=o||CE,magFilter:l=l||CE,format:GE,type:n,depthBuffer:!1})},this.createTexture=function(){let i=new Float32Array(e*t*4),n=new Lk(i,e,t,GE,zE);return n.needsUpdate=!0,n},this.renderTexture=function(e,t){s.passThruTexture.value=e,this.doRenderTarget(o,t),s.passThruTexture.value=null},this.doRenderTarget=function(e,t){let n=i.getRenderTarget(),s=i.xr.enabled,c=i.shadowMap.autoUpdate,h=i.outputEncoding,u=i.toneMapping;i.xr.enabled=!1,i.shadowMap.autoUpdate=!1,i.outputEncoding=zC,i.toneMapping=uE,l.material=e,i.setRenderTarget(t),i.render(r,a),l.material=o,i.xr.enabled=s,i.shadowMap.autoUpdate=c,i.outputEncoding=h,i.toneMapping=u,i.setRenderTarget(n)}}},r5=new KM,a5=new FA,s5=class{constructor(e){let t=e.geometry;if(!t.isBufferGeometry||3!==t.attributes.position.itemSize)throw new Error("THREE.MeshSurfaceSampler: Requires BufferGeometry triangle mesh.");t.index&&(console.warn("THREE.MeshSurfaceSampler: Converting geometry to non-indexed BufferGeometry."),t=t.toNonIndexed()),this.geometry=t,this.randomFunction=Math.random,this.positionAttribute=this.geometry.getAttribute("position"),this.colorAttribute=this.geometry.getAttribute("color"),this.weightAttribute=null,this.distribution=null}setWeightAttribute(e){return this.weightAttribute=e?this.geometry.getAttribute(e):null,this}build(){let e=this.positionAttribute,t=this.weightAttribute,i=new Float32Array(e.count/3);for(let r=0;r<e.count;r+=3){let n=1;t&&(n=t.getX(r)+t.getX(r+1)+t.getX(r+2)),r5.a.fromBufferAttribute(e,r),r5.b.fromBufferAttribute(e,r+1),r5.c.fromBufferAttribute(e,r+2),n*=r5.getArea(),i[r/3]=n}this.distribution=new Float32Array(e.count/3);let n=0;for(let r=0;r<i.length;r++)n+=i[r],this.distribution[r]=n;return this}setRandomGenerator(e){return this.randomFunction=e,this}sample(e,t,i){let n=this.distribution[this.distribution.length-1],r=this.binarySearch(this.randomFunction()*n);return this.sampleFace(r,e,t,i)}binarySearch(e){let t=this.distribution,i=0,n=t.length-1,r=-1;for(;i<=n;){let a=Math.ceil((i+n)/2);if(0===a||t[a-1]<=e&&t[a]>e){r=a;break}e<t[a]?n=a-1:i=a+1}return r}sampleFace(e,t,i,n){let r=this.randomFunction(),a=this.randomFunction();return r+a>1&&(r=1-r,a=1-a),r5.a.fromBufferAttribute(this.positionAttribute,3*e),r5.b.fromBufferAttribute(this.positionAttribute,3*e+1),r5.c.fromBufferAttribute(this.positionAttribute,3*e+2),t.set(0,0,0).addScaledVector(r5.a,r).addScaledVector(r5.b,a).addScaledVector(r5.c,1-(r+a)),void 0!==i&&r5.getNormal(i),void 0!==n&&void 0!==this.colorAttribute&&(r5.a.fromBufferAttribute(this.colorAttribute,3*e),r5.b.fromBufferAttribute(this.colorAttribute,3*e+1),r5.c.fromBufferAttribute(this.colorAttribute,3*e+2),a5.set(0,0,0).addScaledVector(r5.a,r).addScaledVector(r5.b,a).addScaledVector(r5.c,1-(r+a)),n.r=a5.x,n.g=a5.y,n.b=a5.z),this}};function o5(e,t){let i=e,n=new Float32Array(4*t*t);for(let a=0;a<t*t;a++)n[4*a]=i[3*a],n[4*a+1]=i[3*a+1],n[4*a+2]=i[3*a+2],n[4*a+3]=0;let r=new Lk(n,t,t,GE,zE);return r.needsUpdate=!0,r}var l5="\n// uniform sampler2D uCurrentPosition; // Pass in the variable from GPGPU\n// uniform sampler2D uCurrentVelocity; // Pass in the variable from GPGPU\n// uniform sampler2D uCurrentEmissionRate; // Pass in the variable from GPGPU\nuniform sampler2D uOriginalPosition;\nuniform sampler2D uDirections;     \nuniform vec3 uDirectionsAxis;\nuniform vec4 uWorldQuaternion;\nuniform vec3 uGravity;        \nuniform float uNoiseStrength;     // Variation of the noise\nuniform float uNoiseScale;        // Scale of the noise\nuniform float uNoiseSeed;         // Seed of the noise\nuniform float particleSize;\nuniform float uSpeed;     // update speed of the particles\nuniform float uRandomMassFactor;\n\n// COLLIDER\nuniform vec3 uColliderPos;                // Collider Position\nuniform vec3 uColliderSize;               // Collider Dimension\nuniform vec4 uColliderQuaternion;         // Collider Rotation\nuniform vec4 uColliderQuaternionInvert;   // Collider Rotation\nuniform float uBounce;                    // Bounce factor\nuniform float uForceDamping;\nuniform float uForceIntensity;\n\n\n\n\n    vec3 mod289(vec3 x) {\n      return x - floor(x * (1.0 / 289.0)) * 289.0;\n    }\n    \n    vec4 mod289(vec4 x) {\n    return x - floor(x * (1.0 / 289.0)) * 289.0;\n    }\n    \n    vec4 permute(vec4 x) {\n        return mod289(((x*34.0)+1.0)*x);\n    }\n    \n    vec4 taylorInvSqrt(vec4 r)\n    {\n    return 1.79284291400159 - 0.85373472095314 * r;\n    }\n    \n    vec3 fade(vec3 t) {\n  return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n\n    float snoise(vec3 v)\n    {\n    const vec2  C = vec2(1.0/6.0, 1.0/3.0) ;\n    const vec4  D = vec4(0.0, 0.5, 1.0, 2.0);\n    vec3 i  = floor(v + dot(v, C.yyy) );\n    vec3 x0 =   v - i + dot(i, C.xxx) ;\n    vec3 g = step(x0.yzx, x0.xyz);\n    vec3 l = 1.0 - g;\n    vec3 i1 = min( g.xyz, l.zxy );\n    vec3 i2 = max( g.xyz, l.zxy );\n    vec3 x1 = x0 - i1 + C.xxx;\n    vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n    vec3 x3 = x0 - D.yyy;      // -1.0+3.0*C.x = -0.5 = -D.y\n    \n    // Permutations\n    i = mod289(i);\n    vec4 p = permute( permute( permute(\n                i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n              + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n              + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n    \n    // Gradients: 7x7 points over a square, mapped onto an octahedron.\n    // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n    float n_ = 0.142857142857; // 1.0/7.0\n    vec3  ns = n_ * D.wyz - D.xzx;\n    \n    vec4 j = p - 49.0 * floor(p * ns.z * ns.z);  //  mod(p,7*7)\n    \n    vec4 x_ = floor(j * ns.z);\n    vec4 y_ = floor(j - 7.0 * x_ );    // mod(j,N)\n    \n    vec4 x = x_ *ns.x + ns.yyyy;\n    vec4 y = y_ *ns.x + ns.yyyy;\n    vec4 h = 1.0 - abs(x) - abs(y);\n    \n    vec4 b0 = vec4( x.xy, y.xy );\n    vec4 b1 = vec4( x.zw, y.zw );\n    \n    vec4 s0 = floor(b0)*2.0 + 1.0;\n    vec4 s1 = floor(b1)*2.0 + 1.0;\n    vec4 sh = -step(h, vec4(0.0));\n    \n    vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n    vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n    \n    vec3 p0 = vec3(a0.xy,h.x);\n    vec3 p1 = vec3(a0.zw,h.y);\n    vec3 p2 = vec3(a1.xy,h.z);\n    vec3 p3 = vec3(a1.zw,h.w);\n    \n    //Normalise gradients\n    vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n    p0 *= norm.x;\n    p1 *= norm.y;\n    p2 *= norm.z;\n    p3 *= norm.w;\n    \n    // Mix final noise value\n    vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n    m = m * m;\n    return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n                                  dot(p2,x2), dot(p3,x3) ) );\n    }\n    \n    vec3 snoiseVec3( vec3 x ){\n    \n      float s  = snoise(vec3( x ));\n      float s1 = snoise(vec3( x.y - 19.1 , x.z + 33.4 , x.x + 47.2 ));\n      float s2 = snoise(vec3( x.z + 74.2 , x.x - 124.5 , x.y + 99.4 ));\n      vec3 c = vec3( s , s1 , s2 );\n      return c;\n    \n    }\n    \n      \n    vec3 curlNoise( vec3 p, float seed){\n      p += seed;\n      const float e = .1;\n      vec3 dx = vec3( e   , 0.0 , 0.0 );\n      vec3 dy = vec3( 0.0 , e   , 0.0 );\n      vec3 dz = vec3( 0.0 , 0.0 , e   );\n    \n      vec3 p_x0 = snoiseVec3( p - dx );\n      vec3 p_x1 = snoiseVec3( p + dx );\n      vec3 p_y0 = snoiseVec3( p - dy );\n      vec3 p_y1 = snoiseVec3( p + dy );\n      vec3 p_z0 = snoiseVec3( p - dz );\n      vec3 p_z1 = snoiseVec3( p + dz );\n    \n      float x = p_y1.z - p_y0.z - p_z1.y + p_z0.y;\n      float y = p_z1.x - p_z0.x - p_x1.z + p_x0.z;\n      float z = p_x1.y - p_x0.y - p_y1.x + p_y0.x;\n    \n      const float divisor = 1.0 / ( 2.0 * e );\n      return normalize( vec3( x , y , z ) * divisor );\n    \n    }\n\n\n// Classic Perlin noise\nfloat cnoise(vec3 P)\n{\n  vec3 Pi0 = floor(P); // Integer part for indexing\n  vec3 Pi1 = Pi0 + vec3(1.0); // Integer part + 1\n  Pi0 = mod289(Pi0);\n  Pi1 = mod289(Pi1);\n  vec3 Pf0 = fract(P); // Fractional part for interpolation\n  vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n  vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n  vec4 iy = vec4(Pi0.yy, Pi1.yy);\n  vec4 iz0 = Pi0.zzzz;\n  vec4 iz1 = Pi1.zzzz;\n\n  vec4 ixy = permute(permute(ix) + iy);\n  vec4 ixy0 = permute(ixy + iz0);\n  vec4 ixy1 = permute(ixy + iz1);\n\n  vec4 gx0 = ixy0 * (1.0 / 7.0);\n  vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n  gx0 = fract(gx0);\n  vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n  vec4 sz0 = step(gz0, vec4(0.0));\n  gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n  gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n  vec4 gx1 = ixy1 * (1.0 / 7.0);\n  vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n  gx1 = fract(gx1);\n  vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n  vec4 sz1 = step(gz1, vec4(0.0));\n  gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n  gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n  vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n  vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n  vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n  vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n  vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n  vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n  vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n  vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n  vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n  g000 *= norm0.x;\n  g010 *= norm0.y;\n  g100 *= norm0.z;\n  g110 *= norm0.w;\n  vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n  g001 *= norm1.x;\n  g011 *= norm1.y;\n  g101 *= norm1.z;\n  g111 *= norm1.w;\n\n  float n000 = dot(g000, Pf0);\n  float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n  float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n  float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n  float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n  float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n  float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n  float n111 = dot(g111, Pf1);\n\n  vec3 fade_xyz = fade(Pf0);\n  vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n  vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n  float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); \n  return 2.2 * n_xyz;\n}\n\n\nvec3 fbm_vec3(vec3 p, float frequency, float offset)\n{\n  return vec3(\n    cnoise((p+vec3(offset))*frequency),\n    cnoise((p+vec3(offset+20.0))*frequency),\n    cnoise((p+vec3(offset-30.0))*frequency)\n  );\n}\n\n"+"\nfloat rand(vec2 co){\n    return fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453);\n}\nvec3 applyQuaternionToVector( vec4 q, vec3 v ){\n    return v + 2.0 * cross( q.xyz, cross( q.xyz, v ) + q.w * v );\n } \nvec3 applyForce(vec3 force, float mass) {\n  vec3 acceleration = force / mass;\n  \n  return acceleration;\n}\n\nvec4 conjugate(vec4 q) {\n  return vec4(q.w, -q.x, -q.y, -q.z);\n}\n\n// Function to compute the normal of the ellipsoid at a given point\nvec3 ellipsoidNormal(vec3 p, vec3 radii) {\n  return normalize(p / (radii * radii));\n}\n\nfloat friction = .3;\n\nvoid main() {\n    vec2 vUv = gl_FragCoord.xy / resolution.xy;\n    vec3 position = texture2D( uCurrentPosition, vUv ).xyz;\n    vec3 originalPosition = texture2D( uOriginalPosition, vUv ).xyz;\n    float timeLeft = texture2D( uCurrentPosition, vUv ).w;\n    vec3 directions = texture2D( uDirections, vUv ).xyz;    \n    vec3 velocity = texture2D( uCurrentVelocity, vUv ).xyz;\n    float mass = rand(originalPosition.xy) * 0.5 + 0.5;\n    float isSpawning = texture2D( uCurrentEmissionRate, vUv ).x;        // 1. = spawning, 0. = not spawning\n    float isActive = texture2D( uCurrentEmissionRate, vUv ).y;          // 1. = active, 0. = not active\n    float collisionFlag =texture2D( uCurrentVelocity, vUv ).w;          // Indicate collision\n\n    // Randomness Mass\n    mass = (1.0 - (uRandomMassFactor * mass));\n    \n    if (isActive == 1.0) {\n      // **************************************************************\n      // FORCES NOISES\n      // **************************************************************\n      #ifdef USE_CURL_NOISE\n        if (uNoiseScale > 0.0 ) {\n          velocity = curlNoise(position * uNoiseScale * .002, uNoiseSeed) * ( uNoiseStrength + 1.0) * .05 * uSpeed;\n        }\n        // Variation of the noise Over Time\n        if (uNoiseStrength > 0.0 && uNoiseScale == 0.0 ) {\n          velocity += curlNoise( position, uNoiseSeed)  * uNoiseStrength * 0.05 * uSpeed;\n        }\n      #endif\n      // **************************************************************\n      #ifdef USE_SIMPLEX_NOISE\n        if (uNoiseScale > 0.0 ) {\n          velocity = vec3(snoise(position * uNoiseScale * .001) * ( uNoiseStrength + 1.0) * .1);\n          velocity *= uSpeed;\n        }\n        // Variation of the noise Over Time\n        if (uNoiseStrength > 0.0 && uNoiseScale == 0.0) {\n          velocity += vec3(snoise(position * uNoiseStrength * .001) * .05 * uSpeed);\n        }\n      #endif\n      // ************************************************************** \n      #ifdef USE_FBM_NOISE\n        if (uNoiseScale > 0.0 ) {\n          float offset = 0.0;\n          velocity = fbm_vec3(position * uNoiseScale * .001, ( uNoiseStrength + 1.0), offset);\n          velocity *= uSpeed;\n        }\n        // Variation of the noise Over Time\n        if (uNoiseStrength > 0.0 && uNoiseScale == 0.0 ) {      \n          float offset = 0.0;\n          velocity += fbm_vec3(position * uNoiseStrength * .001, ( uNoiseStrength + 1.0), uNoiseSeed) * .1 * uSpeed;\n        }\n      #endif\n\n      // COLLIDER\n      ".concat("\n  #ifdef USE_COLLIDER\n    float restitution = max(uBounce * 2., .01); // Energy Loss\n    // SPHERE COLLIDER\n    // **************************************************************\n    #ifdef USE_SPHERE_COLLIDER       \n      // Convert collider size to radii (assuming uColliderSize is the diameter in each axis)\n      vec3 radii = uColliderSize;\n      // Adjust position relative to collider\n      vec3 relPos = position - uColliderPos;\n      // Apply rotation of the collider to the relative position\n      relPos = applyQuaternionToVector(uColliderQuaternionInvert, relPos);            \n      // Scale relative position by radii (for ellipsoid collision detection)\n      vec3 scaledPos = relPos / radii;\n      // Calculate ellipsoidal distance\n      float dist = length(scaledPos); // Distance in terms of ellipsoid\n      \n      // Check for collision\n      if (dist <= 1. + particleSize / length(radii) && collisionFlag == 0.0) {\n          // Compute the normal at the collision point, accounting for particle size\n        vec3 adjustedPos = scaledPos * (1.0 + particleSize / length(radii));          \n        // Compute the normal at the collision point\n        vec3 normal = ellipsoidNormal(adjustedPos, radii);\n        // Rotate the normal back to world space\n        normal = applyQuaternionToVector(uColliderQuaternion, normal);\n        // Reflect the velocity vector off the normal\n        velocity = reflect(velocity, normal) * restitution;\n\n        collisionFlag = 1.0;\n      } else {\n        collisionFlag = 0.0;\n      }\n    #endif\n\n    // BOX COLLIDER or PLANE COLLIDER \n    // **************************************************************\n    #ifdef USE_BOX_COLLIDER\n      // Box dimensions and repulsion variables\n      vec3 boxHalfSize = uColliderSize / 2.0;\n      // Convert world position to box's local space\n      vec3 localPos = applyQuaternionToVector(uColliderQuaternionInvert, position - uColliderPos);      \n      // Collision detection\n      vec3 localDistance = abs(localPos) - boxHalfSize;\n      float distToSurface = max(localDistance.x, max(localDistance.y, localDistance.z));    \n\n      // Collision Detected\n      if (distToSurface <= particleSize * 0.5 && collisionFlag == 0.0) {      \n        // Find the nearest face normal for bounce direction\n        vec3 normal;\n        if (localDistance.x > localDistance.y && localDistance.x > localDistance.z) {\n            normal = vec3(sign(localPos.x), 0.0, 0.0);\n        } else if (localDistance.y > localDistance.z) {\n            normal = vec3(0.0, sign(localPos.y), 0.0);\n        } else {\n            normal = vec3(0.0, 0.0, sign(localPos.z));\n        }            \n        // Rotate normal back to world space\n        normal = applyQuaternionToVector(uColliderQuaternion, normal);      \n        // Reflect velocity and apply repulsion force\n        velocity = reflect(velocity, normal) * restitution;\n        \n        collisionFlag = 1.0;\n      } else {\n        collisionFlag = 0.0;\n      }\n    #endif      \n  #endif      \n  // END COLLIDER    \n","\n      // ATTRACTION\n      ").concat("\n  #ifdef USE_ATTRACTOR\n\n      #ifdef USE_SPHERE_COLLIDER      \n        // Convert collider size to radii (assuming uColliderSize is the diameter in each axis)\n        vec3 radii = uColliderSize;\n        // Adjust position relative to collider\n        vec3 relPos = position - uColliderPos;\n        // Apply rotation of the collider to the relative position\n        relPos = applyQuaternionToVector(uColliderQuaternionInvert, relPos);            \n        // Scale relative position by radii (for ellipsoid collision detection)\n        vec3 scaledPos = relPos / radii;\n        // Calculate ellipsoidal distance\n        float distToSurface = length(scaledPos); // Distance in terms of ellipsoid\n        float insideCheck = 1.0;\n\n      #endif\n\n\n      #ifdef USE_BOX_COLLIDER\n        // Box dimensions\n        vec3 boxHalfSize = uColliderSize / 2.0;\n        // Convert world position to box's local space\n        vec3 localPos = applyQuaternionToVector(uColliderQuaternionInvert, position - uColliderPos);      \n        vec3 localDistance = abs(localPos) - boxHalfSize;\n        float distToSurface = max(localDistance.x, max(localDistance.y, localDistance.z));\n        float insideCheck = particleSize;\n      #endif      \n  \n      // Apply vortex force inside the Helper\n      #ifdef USE_FORCE_LOCAL_SPACE\n        if (distToSurface <= insideCheck ) {    \n            // Define parameters for the attractor field\n            #ifdef USE_SPHERE_COLLIDER      \n              float attractorStrength = (1.0 - distToSurface ) * uForceIntensity; // Adjust as needed\n            #endif\n\n            #ifdef USE_BOX_COLLIDER\n              float attractorStrength = max((1.0 - insideCheck / distToSurface), 0.) * uForceIntensity; // Adjust as needed\n              #endif\n\n            float attractorDamping = uForceDamping;  // Adjust as needed (higher values will attenuate velocity more)\n          \n            // Use the same radii calculation code as for the collider\n            vec3 attractorRadii = uColliderSize;\n            // Adjust position relative to attractor center\n            vec3 relPos = position - uColliderPos;\n            // Apply rotation of the collider to the relative position\n            relPos = applyQuaternionToVector(uColliderQuaternionInvert, relPos);            \n            // Scale relative position by radii (for ellipsoid attraction)\n            vec3 scaledPos = relPos / attractorRadii;\n\n            // Calculate ellipsoidal distance as attractor radius\n            float attractorRadius = length(scaledPos);\n            // Calculate the distance from the attractor center\n            vec3 relativePosition = position - uColliderPos;\n            // Calculate the force vector towards the attractor center\n            vec3 attractorForce = normalize(relativePosition) * attractorStrength;\n            // Apply the attractor force to the particle\n            velocity -= attractorForce;\n            // Attenuate the particle's velocity\n            velocity *= attractorDamping;\n        }\n      #else \n            // Calculate the distance from the attractor center\n            vec3 relativePosition = position - uColliderPos;\n            // Calculate the force vector towards the attractor center\n            vec3 attractorForce = normalize(relativePosition) * uForceIntensity;\n            // Apply the attractor force to the particle\n            velocity -= attractorForce;\n            // Attenuate the particle's velocity\n            velocity *= uForceDamping;\n      #endif    \n  #endif      \n","  \n      // VORTEX\n      ").concat("\n  #ifdef USE_VORTEX\n    // Box dimensions\n    vec3 boxHalfSize = uColliderSize / 2.0;\n    // Convert world position to box's local space\n    vec3 localPos = applyQuaternionToVector(uColliderQuaternionInvert, position - uColliderPos);      \n    vec3 localDistance = abs(localPos) - boxHalfSize;\n    float distToSurface = max(localDistance.x, max(localDistance.y, localDistance.z));\n\n    // Apply vortex force inside the box\n    if (distToSurface <= particleSize) {\n      float vortexStrength = uForceIntensity;\n      vec3 localTopCenter = vec3(0.0, 0., 0.0);\n\n      // Transform the local top center to the world space\n      vec3 vortexCenter = uColliderPos + applyQuaternionToVector(uColliderQuaternion, localTopCenter);\n      // Calculate the vector from particle to vortex center\n      vec3 vortexVector = vortexCenter - position;\n\n      // Calculate the rotation axis from the inverse of the collider's quaternion and the fixed up vector\n      // Note: important to add a tiny z component to the up vector to avoid instability\n      vec3 upVector = vec3(0.0, 1.0, 0.01);\n      vec3 rotationAxis = cross(upVector, applyQuaternionToVector(uColliderQuaternion, vortexVector));\n      rotationAxis = normalize(rotationAxis);\n\n      // Add rotational component to velocity\n      float rotationSpeed = length(vortexVector * vortexStrength * 3.0) ; \n\n      vec3 rotationVelocity = rotationAxis * rotationSpeed;\n      // velocity += rotationVelocity * 0.005 ;\n      velocity = rotationVelocity * 0.005 ;\n\n      // Calculate vortex force\n      // vec3 vortexForce = normalize(vortexVector) * uSpeed * .1 ;\n      // Apply the vortex force to the particle\n      vec3 originDirection = applyQuaternionToVector(uWorldQuaternion, directions);\n      velocity += applyForce( originDirection * uSpeed * (1. - uForceDamping) , mass * .5);\n    }\n  #endif      \n","\n    } \n    // End isActive\n\n    // SPAWN BIRTH \n    // **************************************************************\n    // if (isSpawning == 1.)\n    #ifdef USE_NORMALS\n      velocity = mix(velocity, applyQuaternionToVector(uWorldQuaternion, directions) * uSpeed, isSpawning);\n    #else\n      velocity = mix(velocity, applyQuaternionToVector(uWorldQuaternion, uDirectionsAxis) * uSpeed, isSpawning);    \n    #endif\n    \n    // if (collisionFlag == 0.0)\n    velocity += applyForce(uGravity, mass * .5) * (1.0 - collisionFlag);\n\n    gl_FragColor = vec4(velocity, collisionFlag);\n}\n"),c5="\n\n  // Linear Fade In\n  float linearFadeIn(float t) {\n    return t;\n  }\n\n\n  // linear fade out\n  float linearFadeOut(float t) {\n    return 1.0 - t;\n  }\n  \n  float linearInOut(float t) {\n    return t < 0.5 ? t :  (1.0 - t);  \n  }\n\n    // lerp\n    float lerp(float a, float b, float t) {\n      return a + (b - a) * t;\n    }\n\n  // Ease In Out Quart\n  float exponentialInOut(float t) {\n    return t < 0.4 ? lerp(0.0, 1.0, t / 0.4) :\n    t > 0.6 ? lerp(1.0, 0.0, (t - 0.6) / 0.4) :\n    1.0;\n   }\n\n  // constant\n  float constant(float t) {\n    return 1.0;\n  } \n",h5="\n  uniform sampler2D uPosition;\n  uniform float uSize;\n  uniform float uSizeEnd;\n  uniform vec3 uWorldOffset;\n  uniform vec4 uWorldQuaternion;\n  // Billboard Behavior - Currently at Zero, but we can change that\n  uniform float uRotation;\n  uniform float uRotationEnd;\n  uniform vec2 center;\n\n  // Randomness\n  uniform float uRandScaleFactor;\n  uniform float uRandRotationFactor;\n\n  attribute vec2 ref;\n\n  varying float v_LifeLeft;    // normalized lifetime 1 to 0\n  varying vec2 vUv;\n  varying vec2 vRef;\n\n  ".concat("\n\nfloat rand(vec3 co){\n  return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 applyQuaternionToVector( vec4 q, vec3 v ){\n  return v + 2.0 * cross( q.xyz, cross( q.xyz, v ) + q.w * v );\n}\n\nvec3 applyForce(vec3 force, float mass) {\n  vec3 acceleration = force / mass;\n    \n  return acceleration;\n}\n","\n  ").concat(c5,"\n"),u5="\n  uniform vec4 uColor;                // start color\n  uniform vec4 uColor2;               // end color\n  uniform sampler2D uTexture;         // texture\n  varying float v_LifeLeft;   // normalized lifetime 1 to 0\n  varying vec2 vUv;\n  varying vec2 vRef;\n\n  float random(vec2 co) {\n    return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n  }\n  "+c5+"  \n  ".concat("\nvec3 rgb2xyz (in vec3 rgb) {\n    float r = rgb.r;\n\tfloat g = rgb.g;\n\tfloat b = rgb.b;\n\n\tr = r > 0.04045 ? pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);\n\tg = g > 0.04045 ? pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);\n\tb = b > 0.04045 ? pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);\n\n\tfloat x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);\n\tfloat y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);\n\tfloat z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);\n    \n    vec3 xyz = vec3(\n        (r * 0.4124) + (g * 0.3576) + (b * 0.1805) * 100.0,\n        (r * 0.2126) + (g * 0.7152) + (b * 0.0722) * 100.0,\n        (r * 0.0193) + (g * 0.1192) + (b * 0.9505) * 100.0\n    );\n    return(xyz);\n}\n\nvec3 xyz2lab (in vec3 xyz) {\n\tfloat x = xyz.x / 95.047;\n\tfloat y = xyz.y / 100.0;\n\tfloat z = xyz.z / 108.883;\n\n\tx = x > 0.008856 ? pow(x, 1.0 / 3.0) : (7.787 * x) + (16.0 / 116.0);\n\ty = y > 0.008856 ? pow(y, 1.0 / 3.0) : (7.787 * y) + (16.0 / 116.0);\n\tz = z > 0.008856 ? pow(z, 1.0 / 3.0) : (7.787 * z) + (16.0 / 116.0);\n\n    vec3 lab = vec3((116.0 * y) - 16.0, 500.0 * (x - y), 200.0 * (y - z));\n    return(lab);\n}\n\nvec3 rgb2lab(in vec3 rgb) {\n    vec3 xyz = rgb2xyz(rgb);\n    vec3 lab = xyz2lab(xyz);\n    return(lab);\n}\n\nvec3 xyz2rgb (in vec3 xyz) {\n\tfloat x = xyz.x / 100.0;\n\tfloat y = xyz.y / 100.0;\n\tfloat z = xyz.z / 100.0;\n\t\n    \n\tfloat r = (x *  3.2406) + (y * -1.5372) + (z * -0.4986);\n\tfloat g = (x * -0.9689) + (y *  1.8758) + (z *  0.0415);\n\tfloat b = (x *  0.0557) + (y * -0.2040) + (z *  1.0570);\n\n\tr = r > 0.0031308 ? ((1.055 * pow(r, 1.0 / 2.4)) - 0.055) : r * 12.92;\n\tg = g > 0.0031308 ? ((1.055 * pow(g, 1.0 / 2.4)) - 0.055) : g * 12.92;\n\tb = b > 0.0031308 ? ((1.055 * pow(b, 1.0 / 2.4)) - 0.055) : b * 12.92;\n\n\tr = min(max(0.0, r), 1.0);\n\tg = min(max(0.0, g), 1.0);\n\tb = min(max(0.0, b), 1.0);\n\n\treturn(vec3(r, g, b));\n}\n\nvec3 lab2xyz (in vec3 lab) {\n    float l = lab.x;\n\tfloat a = lab.y;\n\tfloat b = lab.z;\n\n  \tfloat y = (l + 16.0) / 116.0;\n\tfloat x = a / 500.0 + y;\n\tfloat z = y - b / 200.0;\n\n\tfloat y2 = pow(y, 3.0);\n\tfloat x2 = pow(x, 3.0);\n\tfloat z2 = pow(z, 3.0);\n\n  \ty = y2 > 0.008856 ? y2 : (y - 16.0 / 116.0) / 7.787;\n\tx = x2 > 0.008856 ? x2 : (x - 16.0 / 116.0) / 7.787;\n\tz = z2 > 0.008856 ? z2 : (z - 16.0 / 116.0) / 7.787;\n\n\tx *= 95.047;\n\ty *= 100.0;\n\tz *= 108.883;\n\n\treturn(vec3(x, y, z));\n}\nvec3 lab2rgb (in vec3 lab) {\n    vec3 xyz = lab2xyz(lab);\n    vec3 rgb = xyz2rgb(xyz);\n    return(rgb);\n}\n\n","\n\n"),d5=class extends LT{constructor(e,t){super(),this.needsJitter=!0,this.type="ParticleMaterial",this.easeOpacity="linearFadeIn",this.easeSize="linearFadeIn",this.useSizeEnd=!1,this.isColoringRandom=!1,this.init(e,t),this.context=t}reset(){}init(e,t){this.transparent=!0,this.depthTest=!0,this.depthWrite=!1,this.easeOpacity=e.ease,this.easeSize=e.easeSize,this.layers=[],this.lightLayer=new K$(0,"",{...pH.defaultData("light","phong"),visible:!1},new e$,{},t.shared),this.build()}updateState(e){void 0!==e.coloring&&(this.isColoringRandom="random"===e.coloring),void 0!==e.color&&(e.color instanceof Array?this.uniforms.uColor.value=e.color:this.uniforms.uColor.value=this.context.shared.color(e.color)),void 0!==e.color2&&(e.color2 instanceof Array?this.uniforms.uColor2.value=e.color2:this.uniforms.uColor2.value=this.context.shared.color(e.color2)),void 0!==e.size&&(this.uniforms.uSize.value=e.size[0],this.uniforms.uSizeEnd.value=e.size[1],e.size[0]!==e.size[1]?this.useSizeEnd=!0:this.useSizeEnd=!1),void 0!==e.ease&&(this.easeOpacity=e.ease,this.build()),void 0!==e.easeSize&&(this.easeSize=e.easeSize,this.build()),this.needsUpdate=!0}onBeforeCompile(e){this.build(),e.defines=this.defines,e.uniforms=this.uniforms,e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader}build(){let e=new oJ;return e.needsJitter=this.needsJitter,e.addFragmentParsCode("\nlayout(location = 1) out vec4 gVelocity;\n"),e.buildShader("vertex",this.fragment),e.buildShader("fragment",this.fragment),e.addFragmentFinalCode("\n    // Discard fully transparent pixels \n    if (gl_FragColor.a <= 0.0) discard;\n\n    gVelocity = vec4(0.0, 0.0, 0.0, 1.0);\n"),this.isColoringRandom&&e.define("USE_RANDOM_COLORING"),this.useSizeEnd&&e.define("USE_SIZE_END"),e.addVertexParsCode(h5),e.addFragmentParsCode(u5),e.addVertexFinalCode((e=>{let{easeSize:t="linearFadeOut"}=e;return"\n  vUv = uv;  \n  vRef = ref;\n  // Normalized LifeTime 1 to 0\n  float lifeLeft = texture2D(uPosition, ref).w;\n  v_LifeLeft = lifeLeft;\n  // Position From DataTexture Simulation\n  vec3 pos = texture2D(uPosition, ref).rgb - uWorldOffset;\n  // Apply World Quaternion\n  pos = applyQuaternionToVector(uWorldQuaternion, pos);  \n            \n  #ifdef  USE_SIZE_END\n    // Scaled Over Time\n    float t = 1. - lifeLeft;\n    float currentSize = mix(uSize, uSizeEnd, t); // Linearly interpolate between uSize and uSizeEnd\n    vec3 scaledPosition = position * vec3(currentSize);\n  #else\n    // Change Size Behavior over LifeTime\n    float easeSize = ".concat(t,"(1. - lifeLeft);\n    // Scaled Over Time\n    vec3 scaledPosition = position * vec3(uSize * easeSize);\n  #endif\n\n  // Billboard Behavior\n  vec2 scale;\n  scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n  scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );    \n  // Randomness \n  float randRef = rand(ref);\n  scale *= (1.0 - (uRandScaleFactor * randRef));\n  // Rotation\n  float randRotation =  2.0 * PI * ( uRandRotationFactor * randRef);\n  float originalRotation = (1.0 - uRotation) * 2.0 * PI;\n  float originalRotationEnd = (1.0 - uRotationEnd) * 2.0 * PI;\n  // OverTime\n  float finalRotation = mix(originalRotation + randRotation, originalRotationEnd + randRotation, lifeLeft);\n\n  vec2 alignedPosition = ( scaledPosition.xy - ( center - vec2( 0.5 ) ) ) * scale;\n  vec2 rotatedPosition;\n  rotatedPosition.x = cos( finalRotation ) * alignedPosition.x - sin( finalRotation ) * alignedPosition.y;\n  rotatedPosition.y = sin( finalRotation ) * alignedPosition.x + cos( finalRotation ) * alignedPosition.y;\n  \n  mat4 instanceMatrix = mat4(\n    vec4(1.0, 0.0, 0.0, 0.0),\n    vec4(0.0, 1.0, 0.0, 0.0),\n    vec4(0.0, 0.0, 1.0, 0.0),\n    vec4(pos.x, pos.y, pos.z, 1.0)\n  );  \n\n  mvPosition = modelViewMatrix * instanceMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n  mvPosition.xy += rotatedPosition;\n  gl_Position = projectionMatrix  * mvPosition;   \n")})({easeSize:this.easeSize})),e.addFragmentFinalCode((e=>{let{easeOpacity:t="linearFadeOut"}=e;return"  \n  // if Particle is dead, hide it\n  if (v_LifeLeft <= 0.005 ) {\n    discard;\n  }\n\n  #ifdef USE_RANDOM_COLORING\n    float randVal = random(vRef); // Generate a random value based on the reference\n    vec4 color = mix(uColor, uColor2, randVal); // Interpolate between the two colors\n  #else\n    vec4 color = mix(uColor, uColor2, 1. - v_LifeLeft);\n  #endif\n\n  // Opacity over Life Time\n  float finalAlpha = ".concat(t,"(1. - v_LifeLeft);  \n  vec4 textureColor = texture2D(uTexture, vUv).rgba; \n  finalColor = textureColor.rgb * color.rgb;\n  finalAlpha = color.a * textureColor.a * finalAlpha;\n  \n  gl_FragColor = vec4(finalColor, finalAlpha);     \n\n")})({easeOpacity:this.easeOpacity})),this.vertexShader=e.getCode("vertex"),this.fragmentShader=e.getCode("fragment"),this.defines=e.defines,this.uniforms={...e.uniforms,...this.uniforms},this.extensions=e.extensions,this}get nodeMaterial(){return this}get fragment(){return this.lightLayer.node}getDefines(){return this.defines}nodeMaterialDispose(){this.layers.forEach((e=>e.dispose())),super.dispose()}},p5=class{constructor(e,t,i,n){var r;this.type="SphereEmitterShape",this.targetMesh=void 0,this.size=e,this.type=i,this.textureSize=function(e){let t=Math.ceil(Math.sqrt(e));return Math.max(t,1)}(t);this.targetMesh="Mesh"===(null===n||void 0===n?void 0:n.type)&&n?n:this.getMesh(i,1);let{positions:a,dataTexture:s,dataTextureNormals:o}=this.createPositions(this.textureSize,null!==(r=this.targetMesh)&&void 0!==r?r:this.getMesh(i,1));this.positionsTexture=s,this.positionsAttribute=a,this.directionsTexture=o}createPositions(e,t){let{positions:i,normals:n}=function(e,t){let i=new TT(e.geometry,e.material),n=[],r=[],a=new FA,s=new FA;null!==i.geometry.index&&(i.geometry=i.geometry.toNonIndexed());let o=new s5(i).build();for(let l=0;l<t;l++)o.sample(a,s),n.push(a.x,a.y,a.z),r.push(s.x,s.y,s.z);return{positions:new Float32Array(n),normals:new Float32Array(r)}}(t,e*e);return{dataTexture:o5(i,e),positions:i,dataTextureNormals:o5(n,e)}}getMesh(e,t){let i=null;switch(e){case"SphereEmitterShape":i=new rI(.5*t,32,32);break;case"TorusEmitterShape":i=new aI(.5*t,.3,15,40);break;case"ConeEmitterShape":i=new CO(t,t,15);break;case"BoxEmitterShape":i=new DT(t,t,t);break;case"PlaneEmitterShape":i=new KT(t,t),i.rotateX(-Math.PI/2);break;default:i=new rI(t,32,32)}return new TT(i,new eT({color:16711680}))}applyToShader(e,t){this.size=(new FA).fromArray(t.size),e.uEmitterSize.value=this.size}dispose(){this.positionsTexture.dispose(),this.directionsTexture.dispose(),this.positionsAttribute=new Float32Array}};function f5(e){let t={...e},i=JG.defaultData;t.forceFieldObjectId&&(t.colliderEntityId=t.forceFieldObjectId);let n={...i.shape,...t.shape},r={...i.renderMaterial,...t.renderMaterial};return{...i,...t,shape:n,renderMaterial:r}}var m5=class extends jM{constructor(e,t){var i,n,r,a;super(),this.type="ParticleEmitter",this.debugMode=!1,this.worldSpace=!0,this.rootObject=null,this.gpuCompute=null,this.positionSimRT=null,this.velocitySimRT=null,this.emissionRateSimRT=null,this.emitterShape=void 0,this.isEmitting=!1,this.hasBeenReset=!1,this.emittedParticlesAmount=0,this.lastEmitTime=0,this.globalTime=0,this.targetFPS=60,this.previousRatio=1,this.lerpFactor=.4,this.particlesAmount=0,this.noiseStrength=0,this.noiseScale=0,this.isBillboardBased=!0,this.simFeaturesDefinition={USE_COLLIDER:!1,USE_ATTRACTOR:!1,USE_VORTEX:!1,USE_SPHERE_COLLIDER:!1,USE_BOX_COLLIDER:!1,USE_FORCE_LOCAL_SPACE:!1,USE_NORMALS:!1,USE_CURL_NOISE:!0,USE_SIMPLEX_NOISE:!1,USE_FBM_NOISE:!1},this.textureLoader=new LI,this.currentWorldPosition=new FA,this.systemQuaternion=new NA,this.worldGravity=new FA(0,0,0),this.directionAxis=new FA(0,0,0),this.colliderV3=new FA(0,0,0),this.colliderQuaternion=new NA(0,0,0,1),this.matrixAutoUpdate=!0,this.renderer=e,this.system=t,this.shared=t.context.shared;let s=t.data;this.material=new d5(s.renderMaterial,t.context),this.material.uniforms={uSize:{value:0},uSizeEnd:{value:0},uColor:{value:s.renderMaterial.color},uColor2:{value:s.renderMaterial.color2},uPosition:{value:new FA(0,0,0)},uEmissionData:{value:new FA(0,0,0)},uTexture:{value:this.defaultTexture},uWorldOffset:{value:new FA(0,0,0)},uWorldQuaternion:{value:new RA(0,0,0,1)},uRandScaleFactor:{value:null!==(i=s.randomScale)&&void 0!==i?i:0},uRandRotationFactor:{value:null!==(n=s.randomRotation)&&void 0!==n?n:0},uRotation:{value:null!==(r=s.renderMaterial.spriteRotation[0])&&void 0!==r?r:0},uRotationEnd:{value:null!==(a=s.renderMaterial.spriteRotation[1])&&void 0!==a?a:0}},this.setTexture(this.material.uniforms,s.renderMaterial.texture),this.init(s)}setTexture(e,t){let i=t.data;if("string"==typeof t){let i=this.shared.image(t),n=new IA(i.img);return n.needsUpdate=!0,void(e.uTexture.value=n)}if("string"!=typeof i){let t=new Image;t.onload=()=>{let i=new IA(t);i.needsUpdate=!0,e.uTexture.value=i};let n=new Blob([i],{type:"image/*"}),r=URL.createObjectURL(n);t.src=r}}updateGeometryAttributes(e,t){var i;let n=function(e){let t=new Float32Array(e*e*2);for(let i=0;i<e;i++)for(let n=0;n<e;n++){let r=i*e+n;t[2*r+0]=i/(e-1),t[2*r+1]=n/(e-1)}return t}(t);null===(i=this.emitterShape)||void 0===i||!i.positionsAttribute||e.geometry.setAttribute("ref",new Fk(n,2))}applyWorldSpace(){if(!this.system.started||!this.worldSpace||!this.positionSimRT||!this.velocitySimRT)return;let e=this.system;e.getWorldQuaternion(this.systemQuaternion),this.systemQuaternion.invert(),e.getWorldPosition(this.currentWorldPosition),this.material.uniforms.uWorldOffset.value=this.currentWorldPosition,this.material.uniforms.uWorldQuaternion.value.copy(this.systemQuaternion.normalize()),this.positionSimRT.material.uniforms.uWorldOffset.value=this.currentWorldPosition,this.systemQuaternion.invert(),this.positionSimRT.material.uniforms.uWorldQuaternion.value.copy(this.systemQuaternion.normalize()),this.velocitySimRT.material.uniforms.uWorldQuaternion.value.copy(this.systemQuaternion.normalize())}update(e,t){var i;if(!this.gpuCompute||!this.positionSimRT||!this.velocitySimRT||!this.emissionRateSimRT||this.hasBeenReset)return;if(this.checkIfAllParticlesAreDead()&&!this.hasBeenReset)return void this.reset();this.applyWorldSpace(),this.globalTime=e,this.positionSimRT.material.uniforms.uTime.value=e,this.emissionRateSimRT.material.uniforms.uTime.value=e;let n=1e3/t,r=this.targetFPS/n,a=this.previousRatio+(r-this.previousRatio)*this.lerpFactor;this.positionSimRT.material.uniforms.uFPSRatio.value=a,this.previousRatio=a;let s=this.isEmitting?this.GoEmitSomeParticles(e,this.system.data.birthRatePerSec):0;this.emissionRateSimRT.material.uniforms.uLastIndexEmitted.value=this.emittedParticlesAmount,this.emissionRateSimRT.material.uniforms.uParticlesToEmit.value=s,this.material.uniforms.uPosition.value=null===(i=this.gpuCompute.getCurrentRenderTarget(this.positionSimRT))||void 0===i?void 0:i.texture,this.system.colliderEntities.length>0&&this.renderColliders(),this.gpuCompute.compute()}renderColliders(){if(!this.velocitySimRT)return;let e=this.system.colliderEntities[0];if(!e)return;e.getWorldPosition(this.colliderV3),0===this.colliderV3.y&&(this.colliderV3.y=1e-4),this.velocitySimRT.material.uniforms.uColliderPos.value.copy(this.colliderV3);let t=e.data.size;this.colliderV3.fromArray(t),this.velocitySimRT.material.uniforms.uColliderSize.value.copy(this.simFeaturesDefinition.USE_SPHERE_COLLIDER?this.colliderV3.multiplyScalar(.5):this.colliderV3),e.getWorldQuaternion(this.colliderQuaternion),this.velocitySimRT.material.uniforms.uColliderQuaternion.value.copy(this.colliderQuaternion.normalize()),this.velocitySimRT.material.uniforms.uColliderQuaternionInvert.value.copy(this.colliderQuaternion.normalize().invert())}updateState(e){!this.velocitySimRT||!this.positionSimRT||(e.renderMaterial&&this.updateMaterialState(e.renderMaterial),this.updateParticleState(e))}updateVariableState(e,t){if(!this.velocitySimRT||!this.positionSimRT)return;"size"===t[2]&&this.material.updateState({size:[e,this.material.uniforms.uSizeEnd.value]}),"sizeEnd"===t[2]&&this.material.updateState({size:[this.material.uniforms.uSize.value,e]});let i=(e,t)=>{let i=[...this.system.data.shape.size];i[e]=t,this.updateParticleState({shape:{...this.system.data.shape,size:i}})};"shape_size_0"===t[2]&&i(0,e),"shape_size_1"===t[2]&&i(1,e),"shape_size_2"===t[2]&&i(2,e),"speed"===t[2]&&(this.velocitySimRT.material.uniforms.uSpeed.value=e/10),"gravity"===t[2]&&this.worldGravity.set(0,e/100,0),"noiseStrength"===t[2]&&(this.noiseStrength=e,this.velocitySimRT.material.uniforms.uNoiseStrength.value=this.noiseStrength),"noiseScale"===t[2]&&(this.noiseScale=e,this.velocitySimRT.material.uniforms.uNoiseScale.value=this.noiseScale),"direction_x"===t[2]&&(this.directionAxis=this.getDirectionAxis([Number(e),this.system.data.direction[1],this.system.data.direction[2]])),"direction_y"===t[2]&&(this.directionAxis=this.getDirectionAxis([this.system.data.direction[0],Number(e),this.system.data.direction[2]])),"direction_z"===t[2]&&(this.directionAxis=this.getDirectionAxis([this.system.data.direction[0],this.system.data.direction[1],Number(e)]))}updateMaterialState(e){this.material.updateState({...e,size:e.size?[Number(this.shared.getVariable(e.size[0],[this.uuid,"particles","size"])),Number(this.shared.getVariable(e.size[1],[this.uuid,"particles","sizeEnd"]))]:[0,0]}),e.texture&&(this.setTexture(this.material.uniforms,e.texture),this.material.needsUpdate=!0)}updateParticleState(e){if(this.positionSimRT&&this.velocitySimRT){var t,i;if(this.shouldReInitGPUCompute(e)&&this.init(f5(this.system.data)),void 0!==e.life&&(this.positionSimRT.material.uniforms.uMaxLifeTime.value=e.life),void 0!==e.speed&&(this.velocitySimRT.material.uniforms.uSpeed.value=Number(this.shared.getVariable(e.speed,[this.uuid,"particles","speed"]))/10),void 0!==e.collisionBounce&&(this.velocitySimRT.material.uniforms.uBounce.value=e.collisionBounce),void 0!==e.noiseStrength&&(this.noiseStrength=Number(this.shared.getVariable(e.noiseStrength,[this.uuid,"particles","noiseStrength"])),this.velocitySimRT.material.uniforms.uNoiseStrength.value=this.noiseStrength),void 0!==e.noiseScale&&(this.noiseScale=Number(this.shared.getVariable(e.noiseScale,[this.uuid,"particles","noiseScale"])),this.velocitySimRT.material.uniforms.uNoiseScale.value=this.noiseScale),void 0!==e.noiseSeed&&(this.velocitySimRT.material.uniforms.uNoiseSeed.value=e.noiseSeed),void 0!==e.randomMass&&(this.velocitySimRT.material.uniforms.uRandomMassFactor.value=e.randomMass),void 0!==(null===(t=e.renderMaterial)||void 0===t?void 0:t.size)){let t=this.shared.getVariable(e.renderMaterial.size[0],[this.uuid,"particles","size"]);this.velocitySimRT.material.uniforms.particleSize.value=Number(t)}if(void 0!==(null===(i=e.renderMaterial)||void 0===i?void 0:i.spriteRotation)&&(this.material.uniforms.uRotation.value=e.renderMaterial.spriteRotation[0],this.material.uniforms.uRotationEnd.value=e.renderMaterial.spriteRotation[1]),void 0!==e.shape){var n,r;let t=null!==(n=e.shape.size)&&void 0!==n?n:this.system.data.shape.size,i=[Number(this.shared.getVariable(t[0],[this.uuid,"particles","shape_size_0"])),Number(this.shared.getVariable(t[1],[this.uuid,"particles","shape_size_1"])),Number(this.shared.getVariable(t[2],[this.uuid,"particles","shape_size_2"]))],a={...f5(this.system.data).shape,size:i};null===(r=this.emitterShape)||void 0===r||r.applyToShader(this.positionSimRT.material.uniforms,a)}if(void 0!==e.gravity&&(this.worldGravity.set(0,Number(this.shared.getVariable(this.system.data.gravity,[this.uuid,"particles","gravity"]))/100,0),this.velocitySimRT.material.uniforms.uGravity={value:this.worldGravity}),void 0!==e.direction){let t=this.getDirectionFromVariable(e.direction);this.directionAxis=this.getDirectionAxis(t),this.velocitySimRT.material.uniforms.uDirectionsAxis.value=this.directionAxis}void 0!==e.randomRotation&&(this.material.uniforms.uRandRotationFactor.value=e.randomRotation),void 0!==e.randomScale&&(this.material.uniforms.uRandScaleFactor.value=e.randomScale)}}updateForceFieldParameters(e){!this.velocitySimRT||(void 0!==e.forceIntensity&&(this.velocitySimRT.material.uniforms.uForceIntensity.value=e.forceIntensity),void 0!==e.forceDambing&&(this.velocitySimRT.material.uniforms.uForceDamping.value=e.forceDambing))}getDirectionAxis(e){let t=[Number(e[0])*cA.DEG2RAD,Number(e[1])*cA.DEG2RAD,Number(e[2])*cA.DEG2RAD],i=new CM(t[0],t[1],t[2],"XYZ");return this.directionAxis.set(0,1,0).applyEuler(i).normalize(),this.velocitySimRT&&(this.velocitySimRT.material.uniforms.uDirectionsAxis.value=this.directionAxis),this.directionAxis}shouldReInitGPUCompute(e){let{birthRatePerSec:t,rootObjectType:i,colliderEntityId:n,shape:r,emitTimeDuration:a,emitTimeCycle:s,life:o,directionMode:l,noiseType:c}=e;return void 0!==t||void 0!==i||n||null===n||void 0!==s||void 0!==r||void 0!==o||void 0!==a||void 0!==l||void 0!==c}init(e){this.dispose(),this.particlesAmount=this.getMaxParticlesAmount({birthRatePerSecond:e.birthRatePerSec,particleMaxLifeTime:e.life,loopDuration:"infinity"===e.emitTimeCycle?0:e.emitTimeDuration}),this.particlesAmount>1e5&&(console.warn("The maximum number of particles is limited to ".concat(1e5,".")),this.particlesAmount=1e5),this.emitterShape=this.createShape(e.shape,this.particlesAmount);let t=setInterval((()=>{if(this.emitterShape){if(isNaN(this.emitterShape.positionsTexture.source.data.data[0]))return void this.init(e);clearInterval(t)}}),100);if(!this.emitterShape)return;let i=new n5(this.emitterShape.textureSize,this.emitterShape.textureSize,this.renderer),n=this.updateSimulationDefinition(e),r=i.addVariable("uCurrentPosition",n+"\n// uniform sampler2D uCurrentPosition; // Pass in the variable from GPGPU\n// uniform sampler2D uCurrentVelocity; // Pass in the variable from GPGPU\n// uniform sampler2D uCurrentEmissionRate; // Pass in the variable from GPGPU\nuniform sampler2D uOriginalPosition;\nuniform float uTime;\nuniform float uSpeed;     // update speed of the particles\nuniform vec3 uWorldOffset;    \nuniform vec4 uWorldQuaternion;\nuniform float uMaxLifeTime;\nuniform vec3 uEmitterSize;\nuniform float uFPSRatio;     // 1  for 60 FPS\n\nfloat random (vec2 st) {\n    return fract(sin(dot(st.xy,\n        vec2(12.9898,78.233)))*\n        43758.5453123);\n}\nvec3 applyQuaternionToVector( vec4 q, vec3 v ){\n    return v + 2.0 * cross( q.xyz, cross( q.xyz, v ) + q.w * v );\n}\n\nvec3 applyForce(vec3 force, float mass) {\n    vec3 acceleration = force / mass;\n    \n    return acceleration;\n  }\n  \n\nvoid main() {\n    vec2 vUv = gl_FragCoord.xy / resolution.xy;\n    vec3 position = texture2D( uCurrentPosition, vUv ).xyz;\n    float currentLife = texture2D( uCurrentPosition, vUv ).w;   // from 1 to 0\n    float isSpawning = texture2D( uCurrentEmissionRate, vUv ).r;        // 1. = spawning, 0. = not spawning\n    float isActive = texture2D( uCurrentEmissionRate, vUv ).g;          // 1. = active, 0. = not active\n    float timeStart = texture2D( uCurrentEmissionRate, vUv ).b;         // timeStart in seconds when the particle was emitted\n    vec3 originalPosition = ((texture2D( uOriginalPosition, vUv ).xyz) * uEmitterSize);\n    vec3 velocity = texture2D( uCurrentVelocity, vUv ).xyz;\n    float collisionFlag = texture2D( uCurrentVelocity, vUv ).w;             // 1. = collided, 0. = not collided\n    float lifeTime = uMaxLifeTime;\n\n    // Calculate the position adjustment based on collision\n    //     if (collisionFlag > .5) {  \n    float isColliding = step(0.5, collisionFlag); // 1.0 if collisionFlag > 0.5, otherwise 0.0\n    float bounceOffset = 3.0 * isColliding; // Becomes 3.0 if colliding, 0.0 otherwise\n    vec3 collisionAdjustedVelocity = velocity * (1.0 + bounceOffset);\n\n    // Update position based on collision or normal movement\n    vec3 fpsVelocity = velocity * min(uFPSRatio, 5.0);\n    position += mix(fpsVelocity, collisionAdjustedVelocity, isColliding);\n\n    // EMISSION RATE - BIRTH\n    // if (isSpawning == 1.0) {\n    // Better Approach to avoid If statement\n    vec3 newPosition = applyQuaternionToVector(uWorldQuaternion, originalPosition) + uWorldOffset;\n    originalPosition = mix(originalPosition, newPosition, isSpawning);\n    position = mix(position, originalPosition, isSpawning);;\n    timeStart = mix(timeStart, uTime, isSpawning);\n\n    // Calculate timeLeft for life normalization\n    float timeLeft = max(lifeTime - (uTime - timeStart), 0.0);\n    float life_Normalize = timeLeft / lifeTime;\n\n    // Use isActive to blend between the calculated color and black\n    vec4 activeColor = vec4(position, life_Normalize);\n    // if (isActive == 1.0) {\n    gl_FragColor = mix(vec4(0.0), activeColor, isActive);\n\n}\n",this.emitterShape.positionsTexture),a=i.addVariable("uCurrentVelocity",n+l5,this.emitterShape.directionsTexture),s=i.addVariable("uCurrentEmissionRate","\n// uniform sampler2D uCurrentPosition; // Pass in the variable from GPGPU\n// uniform sampler2D uCurrentVelocity; // Pass in the variable from GPGPU\n// uniform sampler2D uCurrentEmissionRate; // Pass in the variable from GPGPU\n\nuniform sampler2D uIndex; // Texture with corresponding index\nuniform float uLastIndexEmitted; // Last emitted index\nuniform float uParticlesToEmit; // Number of particles to emit on that frame\nuniform float uTime;\n\nvoid main() {\n    vec2 vUv = gl_FragCoord.xy / resolution.xy;\n    float particleIndex = texture(uIndex, vUv).x;\n    float timeLeft = texture2D( uCurrentPosition, vUv ).w;\n    float isActive = texture2D( uCurrentEmissionRate, vUv ).g;    // 1. = active, 0. = not active\n    float timeStart = texture2D( uCurrentEmissionRate, vUv ).b;\n\n\n    // ********** Detect Colision to Create a flag and use it in position **********\n    // We are doing this here, so\n\n    // ********** Emit Particles **********\n    // X = isSpawning 0.0 or 1.0\n    // Y = isActive 0.0 or 1.0\n    // Check if the vertex index is between the first value and the last value\n    // if (particleIndex >= uLastIndexEmitted && particleIndex < uLastIndexEmitted + uParticlesToEmit) {\n    //     // Emit a particle by writing 1 to the red channel of the color output\n    //     // r: 1. == emit the particle\n    //     // g: 1. == particle is now active\n    //     timeStart = uTime;\n    //     gl_FragColor = vec4(1.0, 1.0, timeStart, 1.0);\n    // } else {\n    //     // The Particle is either already emitted or not in the range of the particles to emit\n    //     // Do not emit a particle by writing 0 to the red channel of the color output        \n    //     gl_FragColor = vec4(0.0, isActive, timeStart, 1.0);\n    // }\n    // Determine if the particle is within the emission range\n    float emitLowerBound = step(uLastIndexEmitted, particleIndex);\n    float emitUpperBound = step(particleIndex, uLastIndexEmitted + uParticlesToEmit - 1.0);\n    float emitParticle = emitLowerBound * emitUpperBound; // 1.0 if in range, 0.0 otherwise\n\n    // Set timeStart and color\n    timeStart = mix(timeStart, uTime, emitParticle);\n    gl_FragColor = vec4(emitParticle, mix(isActive, 1.0, emitParticle), timeStart, 1.0);\n\n\n}\n",function(e){let t=new Float32Array(4*e*e);for(let n=0;n<e*e;n++)t[4*n]=0,t[4*n+1]=0,t[4*n+2]=0,t[4*n+3]=0;let i=new Lk(t,e,e,GE,zE);return i.needsUpdate=!0,i}(this.emitterShape.textureSize));i.setVariableDependencies(r,[r,a,s]),i.setVariableDependencies(a,[r,a,s]),i.setVariableDependencies(s,[r,a,s]);let o=function(e){let{size:t}=e,i=new Float32Array(4*t*t);for(let r=0;r<t*t;r++)i[4*r]=r,i[4*r+1]=0,i[4*r+2]=0,i[4*r+3]=0;let n=new Lk(i,t,t,GE,zE);return n.needsUpdate=!0,n}({size:this.emitterShape.textureSize}),l={uOriginalPosition:{value:this.emitterShape.positionsTexture},uWorldOffset:{value:new FA(0,0,0)},uWorldQuaternion:{value:new RA(0,0,0,1)},uTime:{value:0},uFPSRatio:{value:1},uMaxLifeTime:{value:e.life},uEmitterSize:{value:new FA(Number(this.shared.getVariable(e.shape.size[0],[this.uuid,"particles","shape_size_0"])),Number(this.shared.getVariable(e.shape.size[1],[this.uuid,"particles","shape_size_1"])),Number(this.shared.getVariable(e.shape.size[2],[this.uuid,"particles","shape_size_2"])))},particleSize:{value:0}};r.material.uniforms=l;let c=this.getDirectionFromVariable(e.direction);this.directionAxis=this.getDirectionAxis(c),this.worldGravity.set(0,Number(this.shared.getVariable(this.system.data.gravity,[this.uuid,"particles","gravity"]))/100,0),this.noiseStrength=Number(this.shared.getVariable(e.noiseStrength,[this.uuid,"particles","noiseStrength"])),this.noiseScale=Number(this.shared.getVariable(e.noiseScale,[this.uuid,"particles","noiseScale"]));let h=e.colliderEntityId&&this.system.getColliderData(e.colliderEntityId),u={uOriginalPosition:{value:this.emitterShape.positionsTexture},uDirections:{value:this.emitterShape.directionsTexture},uDirectionsAxis:{value:this.directionAxis},uWorldQuaternion:{value:new RA(0,0,0,1)},uColliderPos:{value:new FA(0,0,0)},uColliderSize:{value:new FA(0,0,0)},uForceIntensity:{value:h?h.forceIntensity:0},uForceDamping:{value:h?h.forceDambing:0},uColliderQuaternion:{value:new RA(0,0,0,1)},uColliderQuaternionInvert:{value:new RA(0,0,0,1)},particleSize:{value:0},uGravity:{value:this.worldGravity},uNoiseStrength:{value:this.noiseStrength},uNoiseScale:{value:this.noiseScale},uNoiseSeed:{value:e.noiseSeed},uRandomMassFactor:{value:e.randomMass},uBounce:{value:e.collisionBounce},uSpeed:{value:Number(this.shared.getVariable(e.speed,[this.uuid,"particles","speed"]))/10}};a.material.uniforms=u;let d={uIndex:{value:o},uTime:{value:0},uLastIndexEmitted:{value:0},uParticlesToEmit:{value:0}};s.material.uniforms=d;let p=[Number(this.shared.getVariable(e.shape.size[0],[this.uuid,"particles","shape_size_0"])),Number(this.shared.getVariable(e.shape.size[1],[this.uuid,"particles","shape_size_1"])),Number(this.shared.getVariable(e.shape.size[2],[this.uuid,"particles","shape_size_2"]))],f={...f5(this.system.data).shape,size:p};this.emitterShape.applyToShader(r.material.uniforms,f),i.init(),this.gpuCompute=i,this.positionSimRT=r,this.velocitySimRT=a,this.emissionRateSimRT=s,this.rootObject=this.createPrimaryEmitter(this.emitterShape.textureSize),this.add(this.rootObject),this.material.needsUpdate=!0}getDirectionFromVariable(e){return[Number(this.shared.getVariable(e[0],[this.uuid,"particles","direction_x"])),Number(this.shared.getVariable(e[1],[this.uuid,"particles","direction_y"])),Number(this.shared.getVariable(e[2],[this.uuid,"particles","direction_z"]))]}updateSimulationDefinition(e){if(this.simFeaturesDefinition.USE_COLLIDER=!1,this.simFeaturesDefinition.USE_ATTRACTOR=!1,this.simFeaturesDefinition.USE_VORTEX=!1,this.simFeaturesDefinition.USE_SPHERE_COLLIDER=!1,this.simFeaturesDefinition.USE_BOX_COLLIDER=!1,this.simFeaturesDefinition.USE_FORCE_LOCAL_SPACE=!1,this.simFeaturesDefinition.USE_NORMALS=!1,this.simFeaturesDefinition.USE_CURL_NOISE=!1,this.simFeaturesDefinition.USE_SIMPLEX_NOISE=!1,this.simFeaturesDefinition.USE_FBM_NOISE=!1,e.colliderEntityId&&this.system.colliderEntities.length>0){let t=this.system.getColliderData(e.colliderEntityId);switch(null===t||void 0===t?void 0:t.forceType){case"attractor":this.simFeaturesDefinition.USE_ATTRACTOR=!0;break;case"collider":this.simFeaturesDefinition.USE_COLLIDER=!0;break;case"vortex":this.simFeaturesDefinition.USE_VORTEX=!0}let i=null===t||void 0===t?void 0:t.colliderType;"sphere"===i&&(this.simFeaturesDefinition.USE_SPHERE_COLLIDER=!0),"box"===i&&(this.simFeaturesDefinition.USE_BOX_COLLIDER=!0),"helper"===(null===t||void 0===t?void 0:t.forceRange)&&(this.simFeaturesDefinition.USE_FORCE_LOCAL_SPACE=!0)}"normals"===e.directionMode&&(this.simFeaturesDefinition.USE_NORMALS=!0),"curl"===e.noiseType&&(this.simFeaturesDefinition.USE_CURL_NOISE=!0),"simplex"===e.noiseType&&(this.simFeaturesDefinition.USE_SIMPLEX_NOISE=!0),"fbm"===e.noiseType&&(this.simFeaturesDefinition.USE_FBM_NOISE=!0);let t="";for(let[i,n]of Object.entries(this.simFeaturesDefinition))n&&(t+="#define ".concat(i,"\n"));return t}createShape(e,t){this.emitterShape&&this.emitterShape.dispose();let i=new FA(Number(this.shared.getVariable(e.size[0],[this.uuid,"particles","shape_size_0"])),Number(this.shared.getVariable(e.size[1],[this.uuid,"particles","shape_size_1"])),Number(this.shared.getVariable(e.size[2],[this.uuid,"particles","shape_size_2"])));if("MeshEmitterShape"===e.type){let n=null;return this.system.context.scene.traverseEntity((t=>{t.uuid===e.fromMeshId&&(n=t)})),n?new p5(i,t,e.type,n):new p5(i,t,"SphereEmitterShape")}return new p5(i,t,e.type)}createPrimaryEmitter(e){let t,i=e*e;return t=new Wk(new KT(1,1,1),this.material,i),this.updateGeometryAttributes(t,e),this.material.needsUpdate=!0,t.onBeforeRender=()=>{this.applyWorldSpace()},t}getMaxParticlesAmount(e){let{birthRatePerSecond:t,particleMaxLifeTime:i,loopDuration:n=0}=e;return Math.ceil(t*(i+n))}dispose(){var e,t;!this.gpuCompute||(null!==(e=this.rootObject)&&void 0!==e&&null!==(e=e.parent)&&void 0!==e&&e.remove(this.rootObject),this.gpuCompute.dispose(),this.material.nodeMaterialDispose(),null===(t=this.emitterShape)||void 0===t||t.dispose())}GoEmitSomeParticles(e,t){let i=e-this.lastEmitTime,n=1/t;if(i>=n){let t=Math.max(1,Math.floor(i/n));return this.lastEmitTime=e,this.emittedParticlesAmount+t>this.particlesAmount&&(this.emittedParticlesAmount=0),this.emittedParticlesAmount+=t,t}return 0}checkIfAllParticlesAreDead(){return this.lastEmitTime+this.system.data.life+1<this.globalTime}reset(){this.hasBeenReset=!0,this.lastEmitTime=0,this.emittedParticlesAmount=0,this.gpuCompute&&this.init(f5(this.system.data))}startEmitting(e){this.isEmitting=!0,this.hasBeenReset=!1,this.lastEmitTime=e}stopEmitting(){this.isEmitting=!1}},g5=class extends vK{constructor(e,t,i){super(e,t),this.type="ParticleSystem",this.geometry=new fT,this.actualTime=0,this.currentLoopTime=0,this.started=!1,this.stopped=!1,this.isFrozen=!1,this.isIdle=!0,this.emitter=null,this.colliderEntities=[],this.renderer=null,this.isPreWarm=!1,this._hasOnAfterRenderBeenCalled=!1,this.onAfterRender=e=>{this._hasOnAfterRenderBeenCalled||(this._hasOnAfterRenderBeenCalled=!0,this.init(e))},this.context=i,this.data={...t,...f5(t)},this.geometry.setAttribute("position",new sT([],3)),this.material=new eT({colorWrite:!1}),this.frustumCulled=!1}init(e){this.renderer=e,this.emitter=new m5(e,this),this.add(this.emitter),this.updateParticleState(this.data)}update(e){if(!this.isReady||!this.started||this.isFrozen||this.isIdle)return;this.actualTime+=e,this.stopped||(this.currentLoopTime+=e);let t="one_time"===this.data.emitTimeCycle;if(("loop"===this.data.emitTimeCycle||t)&&this.currentLoopTime>1e3*this.data.emitTimeDuration&&(this.stopped||(this.stop(),t||this.start("start"===this.data.emitTimeLoopDelayStart?0:1e3*this.data.emitTimeDelay))),this.emitter&&this.started){let t=this.actualTime/1e3;this.emitter.update(t,e)}this.scale.set(1,1,1),this.updateMatrix()}isReady(){return!!this.emitter}hasCollider(e){return this.colliderEntities.some((t=>t.identity===e))}getColliderData(e){let t=this.colliderEntities.find((t=>t.identity===e));return t?t.data:null}updateByPatchedOp(e,t,i){super.updateByPatchedOp(e,t,i),VV(e.path,["renderMaterial"])&&this.updateParticleState({renderMaterial:{...this.data.renderMaterial,...dV.drop(e,1).props}}),VV(e.path,["shape"])&&this.updateParticleState({shape:{...this.data.shape,...dV.drop(e,1).props}})}updateState(e,t){super.updateState(e,t),this.updateParticleState(e)}updateParticleState(e){if(this.emitter){if(void 0!==e.colliderEntityId&&null!==e.colliderEntityId){let t=this.context.scene.find(e.colliderEntityId);this.colliderEntities=t?[t]:[]}null===e.colliderEntityId&&(this.colliderEntities=[]),this.emitter.updateState(e),e.emitTimeCycle&&this.started&&this.start()}}updateFromColliderEntity(e){!this.emitter||(this.emitter.updateForceFieldParameters(e),this.stop(),this.start())}start(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.currentLoopTime=0,t?setTimeout((()=>{this.start(0)}),t):(this.started=!0,this.stopped=!1,this.isFrozen=!1,null===(e=this.emitter)||void 0===e||e.startEmitting(this.actualTime/1e3))}froze(){this.isFrozen=!0}unFroze(){this.isFrozen=!1}stop(){var e;this.stopped=!0,this.currentLoopTime=0,null===(e=this.emitter)||void 0===e||e.stopEmitting()}reset(){var e;this.started=!1,this.stopped=!1,null===(e=this.emitter)||void 0===e||e.reset()}wakeUp(){this.isIdle=!1}sleep(){this.isIdle=!0,this.reset()}};function v5(e,t,i){return console.assert(void 0!==t.type),"Mesh"===t.type?function(e,t,i){let n;return"TextGeometry"===t.geometry.type?new o1(e,t,i):(n="SubdivGeometry"===t.geometry.type?new z0(e,t,i):"PathGeometry"===t.geometry.type?new Z4(e,t,i):"VectorGeometry"===t.geometry.type?new Q4(e,t,i):"BooleanGeometry"===t.geometry.type?new H1(e,t,i):"UIGeometry"===t.geometry.type?new i5(e,t,i):new k0(e,t,i),n)}(e,t,i):"Empty"===t.type?new Z1(e,t):"Particle"===t.type?new g5(e,t,i):"ParticleCollider"===t.type?new K1(e,t,i):"Splat"===t.type?new Z1(e,t):"Bone"===t.type?new t5(e,t):"Page"===t.type?new X4(e,t,i):"PointLight"===t.type?new Y4(e,t,i):"SpotLight"===t.type?new $3(e,t,i):"DirectionalLight"===t.type?new Q3(e,t,i):"Component"===t.type||"Instance"===t.type?new K4(e,t,i):UG.is(t.type)?new F1(e,t):(console.error(t),new Z1(e,t))}function y5(e,t){let i=!1,n=t.getLayersOfType("transmission"),r=t.getLayersOfType("outline");return r.length>0&&(e.layers.set(8),n.length>0&&e.layers.enable(3),i=!0,I0(e),O0(e)),0===n.length&&0===r.length&&e.layers.set(0),e instanceof C0&&e.needsAO&&e.layers.enable(5),i}function b5(e,t){if(!t.layers)return!1;let i=!1,n=t.getLayersOfType("transmission").filter((e=>e.data.visible)),r=t.getLayersOfType("outline").filter((e=>e.data.visible));return n.length>0&&(e.layers.set(3),r.length>0&&e.layers.enable(8),i=!0),0===n.length&&0===r.length&&e.layers.set(0),e.needsAO&&e.layers.enable(5),i}WX.createEntity=v5,WX.changeEntityProptotype=function(e,t,i){let n=v5(e.identity,t,i),r=e.children,a=e.attachedPaths,s=e.parent,o=e.component,l=e.instances,c=e.overrideData,h=e.uuid,u=e.stateSelection;e.dispose();for(let d of Object.keys(e))delete e[d];Object.setPrototypeOf(e,Object.getPrototypeOf(n));for(let d of Object.keys(n))e[d]=n[d];e.children=[...e.children,...r],e.attachedPaths=a,e.parent=s,e.component=o,e.instances=l,e.uuid=h,e.overrideData=c,e.updateState(e.data,i),u&&e.changeSelectedState(u,i),e.resetBBoxNeedsUpdate()},WX.Cloner=x1;var x5=new vR,w5=new mM,_5=new fM;function S5(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=e.cloner;if(r)for(let a of r.children){let r=w5.copy(a.matrixWorld).invert(),s=_5.copy(t.ray).applyMatrix4(r),o=e.matrixWorld;s.applyMatrix4(o);let l=x5;l.set(s.origin,s.direction),l.near=t.near,l.far=t.far;let c=l.intersectObject(e,!1);c.length>0&&i.push({...c[0],object:n?a:e})}}var E5=class{constructor(){this._constraints=new Map}setConstraint(e,t){null===t?this._constraints.delete(e):this._constraints.set(e,t)}removeDependencies(e){this._constraints.delete(e)}applyConstraints(e){let t=new Set;this._constraints.forEach(((i,n)=>{let r=[n,i],a=i;for(;this._constraints.has(a);)a=this._constraints.get(a),t.has(a)||r.push(a);for(let s=r.length-2;s>=0;s--)if(!t.has(r[s])){let i=e.find(r[s]);i?i.applyPathSnapping(e):console.warn("missing entity ".concat(r[s])),t.add(r[s])}}))}findDependency(e,t){let i=e;for(;this._constraints.has(i);)if(i=this._constraints.get(i),i===t)return!0;return!1}},C5=J_(uS()),A5=J_(gS()),M5=J_(uS()),T5=J_(gS()),P5=class{constructor(e,t,i){this._dataNormalized=e,this._minD=t,this._maxD=i}static createFromUnnormalized(e){let t=T5.sup(e),i=T5.inf(e),n=(0,M5.default)(new Float32Array(e.size),e.shape),r=t-i;return r<1e-4?T5.assigns(n,0):(T5.subs(n,e,i),T5.divs(n,n,r)),new P5(n,i,t)}get data(){return this._dataNormalized}get minD(){return this._minD}get maxD(){return this._maxD}denormalize(){let e=(0,M5.default)(new Float32Array(this._dataNormalized.size),this._dataNormalized.shape);return T5.muls(e,this._dataNormalized,this._maxD-this._minD),T5.adds(e,e,this._minD),e}},D5=class{constructor(e,t){this._quantized=e,this._method=t}get quantized(){return this._quantized}static maxIntBits(e){return 2**e-1}static fromNormalized(e,t){let i,n=e.data;if("norm8x"===t){let e=D5.maxIntBits(8),t=(0,M5.default)(new Float32Array(n.size),n.shape);T5.muls(t,n,e),T5.roundeq(t),i=(0,M5.default)(new Uint8Array(t.data),n.shape)}else if("norm565"===t){let e=(0,M5.default)(new Float32Array(n.size),n.shape);T5.assign(e,n),T5.mulseq(e.pick(null,0),D5.maxIntBits(5)),T5.mulseq(e.pick(null,1),D5.maxIntBits(6)),T5.mulseq(e.pick(null,2),D5.maxIntBits(5)),T5.roundeq(e);let t=(0,M5.default)(new Uint16Array(e.data),n.shape),r=(0,M5.default)(new Uint16Array(n.shape[0]),[n.shape[0]]),a=(0,M5.default)(new Uint16Array(n.shape[0]),[n.shape[0]]);T5.lshifts(r,t.pick(null,0),11),T5.lshifts(a,t.pick(null,1),5),T5.boreq(r,a),T5.boreq(r,t.pick(null,2)),i=r}else{let e=(0,M5.default)(new Float32Array(n.size),n.shape);T5.assign(e,n),T5.mulseq(e.pick(null,0),D5.maxIntBits(11)),T5.mulseq(e.pick(null,1),D5.maxIntBits(10)),T5.mulseq(e.pick(null,2),D5.maxIntBits(11)),T5.roundeq(e);let t=(0,M5.default)(new Uint32Array(e.data),n.shape),r=(0,M5.default)(new Uint32Array(n.shape[0]),[n.shape[0]]),a=(0,M5.default)(new Uint32Array(n.shape[0]),[n.shape[0]]);T5.lshifts(r,t.pick(null,0),21),T5.lshifts(a,t.pick(null,1),11),T5.boreq(r,a),T5.boreq(r,t.pick(null,2)),i=r}return new D5(i,t)}dequantize(e,t){let i,n=this._method,r=this._quantized;if("norm8x"===n){let e=D5.maxIntBits(8);i=(0,M5.default)(new Float32Array(r.size),r.shape),T5.muls(i,r,1/e)}else if("norm565"===n){let e=(0,M5.default)(new Uint8Array(r.shape[0]),[r.shape[0]]),t=(0,M5.default)(new Uint8Array(r.shape[0]),[r.shape[0]]),n=(0,M5.default)(new Uint8Array(r.shape[0]),[r.shape[0]]);T5.rrshifts(e,r,11),T5.rrshifts(t,r,5),T5.bandseq(t,D5.maxIntBits(6)),T5.bands(n,r,D5.maxIntBits(5)),i=(0,M5.default)(new Float32Array(3*r.shape[0]),[r.shape[0],3]),T5.muls(i.pick(null,0),e,1/D5.maxIntBits(5)),T5.muls(i.pick(null,1),t,1/D5.maxIntBits(6)),T5.muls(i.pick(null,2),n,1/D5.maxIntBits(5))}else{let e=(0,M5.default)(new Uint16Array(r.shape[0]),[r.shape[0]]),t=(0,M5.default)(new Uint16Array(r.shape[0]),[r.shape[0]]),n=(0,M5.default)(new Uint16Array(r.shape[0]),[r.shape[0]]);T5.rrshifts(e,r,21),T5.rrshifts(t,r,11),T5.bandseq(t,D5.maxIntBits(10)),T5.bands(n,r,D5.maxIntBits(11)),i=(0,M5.default)(new Float32Array(3*r.shape[0]),[r.shape[0],3]),T5.muls(i.pick(null,0),e,1/D5.maxIntBits(11)),T5.muls(i.pick(null,1),t,1/D5.maxIntBits(10)),T5.muls(i.pick(null,2),n,1/D5.maxIntBits(11))}return new P5(i,e,t)}},k5=class{constructor(e,t,i,n,r){let a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];this._quantized=e,this._minMaxMatrix=t,this._chunkSize=i,this._quantizationMethod=n,this._variableChunkSize=r,this._isDynamicChunks=a}get length(){return this._quantized.shape[0]}get nchunks(){return this._minMaxMatrix.shape[0]}get quantized(){return this._quantized}get method(){return this._quantizationMethod}get minmaxMatrix(){return this._minMaxMatrix}_createPrunedMinMax(e){let t=e.length,i=this.minmaxMatrix.shape[0]-t,n=(0,C5.default)(new Float32Array(2*i),[i,2]),r=0,a=i,s=0,o=this.minmaxMatrix.shape[0];for(let l=0;l<e.length;l++)o=e[l],a=o-s+r,a>r&&A5.assign(n.hi(a,2).lo(r,0),this.minmaxMatrix.hi(o,2).lo(s,0)),r=a,s=o+1;return r<i&&A5.assign(n.lo(r,0),this.minmaxMatrix.lo(s,0)),n}_createPrunedQuantized(e){let t,i,n=e.length,r=this.quantized.shape[0]-n,a=this._quantizationMethod;if("norm8x"===a){i=this._quantized.shape[1];let e=i?r*i:r;t=(0,C5.default)(new Uint8Array(e),i?[r,i]:[r,1])}else t="norm565"===a?(0,C5.default)(new Uint16Array(r),[r]):(0,C5.default)(new Uint32Array(r),[r]);let s=0,o=r,l=0,c=t.shape[0];for(let h=0;h<e.length;h++)c=e[h],o=c-l+s,o>s&&(i?A5.assign(t.hi(o,i).lo(s,0),this._quantized.hi(c,i).lo(l,0)):A5.assign(t.hi(o).lo(s),this._quantized.hi(c).lo(l))),s=o,l=c+1;return s<r&&(i?A5.assign(t.lo(s,0),this._quantized.lo(l,0)):A5.assign(t.lo(s),this._quantized.lo(l))),t}pruneFeature(e,t,i){let n=this._createPrunedQuantized(e),r=this._createPrunedMinMax(t);return new k5(n,r,this._chunkSize,this._quantizationMethod,i,!0)}static getRequiredNChunks(e,t){return Math.floor(e/t)}static fromArray(e,t,i){let n,r=e.shape[0],a=Math.floor(r/i),s=(0,C5.default)(new Float32Array(2*a),[a,2],[2,1]);n="norm8x"===t?(0,C5.default)(new Uint8Array(e.size),e.shape):"norm565"===t?(0,C5.default)(new Uint16Array(e.shape[0]),[e.shape[0]]):(0,C5.default)(new Uint32Array(e.shape[0]),[e.shape[0]]);for(let o=0;o<a;o++){let l,c=o*i,h=o+1<a?(o+1)*i:r;l=e.shape.length>1?P5.createFromUnnormalized(e.hi(h,e.shape[1]).lo(c,0)):P5.createFromUnnormalized(e.hi(h).lo(c)),s.set(o,0,l.minD),s.set(o,1,l.maxD),n.shape.length>1?A5.assign(n.hi(h,n.shape[1]).lo(c,0),D5.fromNormalized(l,t).quantized):A5.assign(n.hi(h).lo(c),D5.fromNormalized(l,t).quantized)}return new k5(n,s,i,t)}denormDequant(){let e,t,i=this._minMaxMatrix.shape[0],n=this._quantized,r=n.shape[0],a=this._quantizationMethod,s=this._chunkSize;if(this._isDynamicChunks){if(!this._variableChunkSize)throw new Error("variable chunk must exists if chunkSize isDynamic");e=this._variableChunkSize}t="norm8x"===a?(0,C5.default)(new Float32Array(n.size),n.shape):(0,C5.default)(new Float32Array(3*r),[r,3]);let o=0,l=s;for(let c=0;c<i;c++){let[s,h]=[this._minMaxMatrix.get(c,0),this._minMaxMatrix.get(c,1)];this._isDynamicChunks&&(l=e[c]);let u,d=c+1<i?o+l:r;u=n.shape.length>1?new D5(n.hi(d,n.shape[1]).lo(o,0),a):new D5(n.hi(d).lo(o),a),A5.assign(t.hi(d,t.shape[1]).lo(o,0),u.dequantize(s,h).denormalize()),o=d}return t}static async fetchArrayBuffer(e){return await(await fetch(e,{mode:"cors"})).arrayBuffer()}},O5=J_(uS()),I5=J_(gS()),R5=J_(uS()),L5=J_(gS()),B5=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9];function z5(e){return e<1e5?e<100?e<10?0:1:e<1e4?e<1e3?2:3:4:e<1e7?e<1e6?5:6:e<1e9?e<1e8?7:8:9}function N5(e,t){if(e===t)return 0;if(~~e===e&&~~t===t){if(0===e||0===t)return e<t?-1:1;if(e<0||t<0){if(t>=0)return-1;if(e>=0)return 1;e=-e,t=-t}let i=z5(e),n=z5(t),r=0;return i<n?(e*=B5[n-i-1],t/=10,r=-1):i>n&&(t*=B5[i-n-1],e/=10,r=1),e===t?r:e<t?-1:1}let i=String(e),n=String(t);return i===n?0:i<n?-1:1}function F5(e,t,i,n){let r=t+1;if(r===i)return 1;if(n(e[r++],e[t])<0){for(;r<i&&n(e[r],e[r-1])<0;)r++;!function(e,t,i){for(i--;t<i;){let n=e[t];e[t++]=e[i],e[i--]=n}}(e,t,r)}else for(;r<i&&n(e[r],e[r-1])>=0;)r++;return r-t}function j5(e,t,i,n,r){for(n===t&&n++;n<i;n++){let i=e[n],a=t,s=n;for(;a<s;){let t=a+s>>>1;r(i,e[t])<0?s=t:a=t+1}let o=n-a;switch(o){case 3:e[a+3]=e[a+2];case 2:e[a+2]=e[a+1];case 1:e[a+1]=e[a];break;default:for(;o>0;)e[a+o]=e[a+o-1],o--}e[a]=i}}function V5(e,t,i,n,r,a){let s=0,o=0,l=1;if(a(e,t[i+r])>0){for(o=n-r;l<o&&a(e,t[i+r+l])>0;)s=l,l=1+(l<<1),l<=0&&(l=o);l>o&&(l=o),s+=r,l+=r}else{for(o=r+1;l<o&&a(e,t[i+r-l])<=0;)s=l,l=1+(l<<1),l<=0&&(l=o);l>o&&(l=o);let n=s;s=r-l,l=r-n}for(s++;s<l;){let n=s+(l-s>>>1);a(e,t[i+n])>0?s=n+1:l=n}return l}function U5(e,t,i,n,r,a){let s=0,o=0,l=1;if(a(e,t[i+r])<0){for(o=r+1;l<o&&a(e,t[i+r-l])<0;)s=l,l=1+(l<<1),l<=0&&(l=o);l>o&&(l=o);let n=s;s=r-l,l=r-n}else{for(o=n-r;l<o&&a(e,t[i+r+l])>=0;)s=l,l=1+(l<<1),l<=0&&(l=o);l>o&&(l=o),s+=r,l+=r}for(s++;s<l;){let n=s+(l-s>>>1);a(e,t[i+n])<0?l=n:s=n+1}return l}var G5=class{constructor(e,t){$_(this,"array",null),$_(this,"compare",null),$_(this,"minGallop",7),$_(this,"length",0),$_(this,"tmpStorageLength",256),$_(this,"stackLength",0),$_(this,"runStart",null),$_(this,"runLength",null),$_(this,"stackSize",0),this.array=e,this.compare=t,this.length=e.length,this.length<512&&(this.tmpStorageLength=this.length>>>1),this.tmp=new Array(this.tmpStorageLength),this.stackLength=this.length<120?5:this.length<1542?10:this.length<119151?19:40,this.runStart=new Array(this.stackLength),this.runLength=new Array(this.stackLength)}pushRun(e,t){this.runStart[this.stackSize]=e,this.runLength[this.stackSize]=t,this.stackSize+=1}mergeRuns(){for(;this.stackSize>1;){let e=this.stackSize-2;if(e>=1&&this.runLength[e-1]<=this.runLength[e]+this.runLength[e+1]||e>=2&&this.runLength[e-2]<=this.runLength[e]+this.runLength[e-1])this.runLength[e-1]<this.runLength[e+1]&&e--;else if(this.runLength[e]>this.runLength[e+1])break;this.mergeAt(e)}}forceMergeRuns(){for(;this.stackSize>1;){let e=this.stackSize-2;e>0&&this.runLength[e-1]<this.runLength[e+1]&&e--,this.mergeAt(e)}}mergeAt(e){let t=this.compare,i=this.array,n=this.runStart[e],r=this.runLength[e],a=this.runStart[e+1],s=this.runLength[e+1];this.runLength[e]=r+s,e===this.stackSize-3&&(this.runStart[e+1]=this.runStart[e+2],this.runLength[e+1]=this.runLength[e+2]),this.stackSize--;let o=U5(i[a],i,n,r,0,t);n+=o,r-=o,0!==r&&(s=V5(i[n+r-1],i,a,s,s-1,t),0!==s&&(r<=s?this.mergeLow(n,r,a,s):this.mergeHigh(n,r,a,s)))}mergeLow(e,t,i,n){let r=this.compare,a=this.array,s=this.tmp,o=0;for(o=0;o<t;o++)s[o]=a[e+o];let l=0,c=i,h=e;if(a[h++]=a[c++],0===--n){for(o=0;o<t;o++)a[h+o]=s[l+o];return}if(1===t){for(o=0;o<n;o++)a[h+o]=a[c+o];return void(a[h+n]=s[l])}let u=this.minGallop;for(;;){let e=0,i=0,d=!1;do{if(r(a[c],s[l])<0){if(a[h++]=a[c++],i++,e=0,0===--n){d=!0;break}}else if(a[h++]=s[l++],e++,i=0,1===--t){d=!0;break}}while((e|i)<u);if(d)break;do{if(e=U5(a[c],s,l,t,0,r),0!==e){for(o=0;o<e;o++)a[h+o]=s[l+o];if(h+=e,l+=e,(t-=e)<=1){d=!0;break}}if(a[h++]=a[c++],0===--n){d=!0;break}if(i=V5(s[l],a,c,n,0,r),0!==i){for(o=0;o<i;o++)a[h+o]=a[c+o];if(h+=i,c+=i,0===(n-=i)){d=!0;break}}if(a[h++]=s[l++],1===--t){d=!0;break}u--}while(e>=7||i>=7);if(d)break;u<0&&(u=0),u+=2}if(this.minGallop=u,u<1&&(this.minGallop=1),1===t){for(o=0;o<n;o++)a[h+o]=a[c+o];a[h+n]=s[l]}else{if(0===t)throw new Error("mergeLow preconditions were not respected");for(o=0;o<t;o++)a[h+o]=s[l+o]}}mergeHigh(e,t,i,n){let r=this.compare,a=this.array,s=this.tmp,o=0;for(o=0;o<n;o++)s[o]=a[i+o];let l=e+t-1,c=n-1,h=i+n-1,u=0,d=0;if(a[h--]=a[l--],0===--t){for(u=h-(n-1),o=0;o<n;o++)a[u+o]=s[o];return}if(1===n){for(h-=t,l-=t,d=h+1,u=l+1,o=t-1;o>=0;o--)a[d+o]=a[u+o];return void(a[h]=s[c])}let p=this.minGallop;for(;;){let i=0,f=0,m=!1;do{if(r(s[c],a[l])<0){if(a[h--]=a[l--],i++,f=0,0===--t){m=!0;break}}else if(a[h--]=s[c--],f++,i=0,1===--n){m=!0;break}}while((i|f)<p);if(m)break;do{if(i=t-U5(s[c],a,e,t,t-1,r),0!==i){for(h-=i,l-=i,t-=i,d=h+1,u=l+1,o=i-1;o>=0;o--)a[d+o]=a[u+o];if(0===t){m=!0;break}}if(a[h--]=s[c--],1===--n){m=!0;break}if(f=n-V5(a[l],s,0,n,n-1,r),0!==f){for(h-=f,c-=f,n-=f,d=h+1,u=c+1,o=0;o<f;o++)a[d+o]=s[u+o];if(n<=1){m=!0;break}}if(a[h--]=a[l--],0===--t){m=!0;break}p--}while(i>=7||f>=7);if(m)break;p<0&&(p=0),p+=2}if(this.minGallop=p,p<1&&(this.minGallop=1),1===n){for(h-=t,l-=t,d=h+1,u=l+1,o=t-1;o>=0;o--)a[d+o]=a[u+o];a[h]=s[c]}else{if(0===n)throw new Error("mergeHigh preconditions were not respected");for(u=h-(n-1),o=0;o<n;o++)a[u+o]=s[o]}}};function H5(e){let t=(0,R5.default)(new Int32Array(e.shape[0]),[e.shape[0]]),i=(0,R5.default)(new Int32Array(e.shape[0]),[e.shape[0]]);return L5.bands(t,e,1023),L5.lshifts(i,t,16),L5.bxoreq(t,i),L5.bandseq(t,4278190335),L5.lshifts(i,t,8),L5.bxoreq(t,i),L5.bandseq(t,50393103),L5.lshifts(i,t,4),L5.bxoreq(t,i),L5.bandseq(t,51130563),L5.lshifts(i,t,2),L5.bxoreq(t,i),L5.bandseq(t,153391689),t}function W5(e,t){if(e.shape[0]!==t.shape[0])throw new Error("wrong length");let i=(0,R5.default)(new Float32Array(e.size),e.shape,e.stride,e.offset);for(let n=0;n<t.shape[0];n++){let r=t.get(n);if(e.shape.length>1)for(let t=0;t<e.shape[1];t++)i.set(n,t,e.get(r,t));else i.set(n,e.get(r))}return i}function q5(e){let t=L5.sup(e),i=L5.inf(e),n=1e3/Math.min(1e3,t-i),r=(0,R5.default)(new Float32Array(e.data),e.shape);L5.mulseq(r,n);let a=function(e){let t=H5(e.pick(null,0)),i=H5(e.pick(null,1));L5.lshiftseq(i,1);let n=H5(e.pick(null,2));return L5.lshiftseq(n,2),L5.boreq(t,i),L5.boreq(t,n),t}((0,R5.default)(new Int32Array(r.data),e.shape)),s=Array.from(a.data).map(((e,t)=>[e,t]));!function(e,t,i,n){if(!Array.isArray(e))throw new TypeError("Can only sort arrays");t?"function"!=typeof t&&(n=i,i=t,t=N5):t=N5,i||(i=0),n||(n=e.length);let r=n-i;if(r<2)return;let a=0;if(r<32)return a=F5(e,i,n,t),void j5(e,i,n,i+a,t);let s=new G5(e,t),o=function(e){let t=0;for(;e>=32;)t|=1&e,e>>=1;return e+t}(r);do{if(a=F5(e,i,n,t),a<o){let n=r;n>o&&(n=o),j5(e,i,i+n,i+a,t),a=n}s.pushRun(i,a),s.mergeRuns(),r-=a,i+=a}while(0!==r);s.forceMergeRuns()}(s,((e,t)=>e[0]-t[0]));let o=s.map((e=>{let[t,i]=e;return i}));return(0,R5.default)(Uint32Array.from(o))}var X5=class{constructor(e,t,i,n,r,a,s,o,l,c){this.propertyDescs=e,this.format=t,this.nsplats=i,this.xyz=n,this.colors=r,this.harmonics=a,this.opacity=s,this.scaling=o,this.rotation=l,this.maxSHDegree=c}getPlyBinary(){let e=X5._generateHeaderString(this.propertyDescs,this.format,this.nsplats),t=(new TextEncoder).encode(e),i=Object.keys(this.propertyDescs).length,n=(0,O5.default)(new Float32Array(this.nsplats*i),[this.nsplats,i]);if(I5.assign(n.pick(null,this.propertyDescs.x.index),this.xyz.pick(null,0)),I5.assign(n.pick(null,this.propertyDescs.y.index),this.xyz.pick(null,1)),I5.assign(n.pick(null,this.propertyDescs.z.index),this.xyz.pick(null,2)),I5.assign(n.pick(null,this.propertyDescs.f_dc_0.index),this.colors.pick(null,0)),I5.assign(n.pick(null,this.propertyDescs.f_dc_1.index),this.colors.pick(null,1)),I5.assign(n.pick(null,this.propertyDescs.f_dc_2.index),this.colors.pick(null,2)),I5.assign(n.pick(null,this.propertyDescs.opacity.index),this.opacity.pick(null,0)),I5.assign(n.pick(null,this.propertyDescs.scale_0.index),this.scaling.pick(null,0)),I5.assign(n.pick(null,this.propertyDescs.scale_1.index),this.scaling.pick(null,1)),I5.assign(n.pick(null,this.propertyDescs.scale_2.index),this.scaling.pick(null,2)),I5.assign(n.pick(null,this.propertyDescs.rot_0.index),this.rotation.pick(null,0)),I5.assign(n.pick(null,this.propertyDescs.rot_1.index),this.rotation.pick(null,1)),I5.assign(n.pick(null,this.propertyDescs.rot_2.index),this.rotation.pick(null,2)),I5.assign(n.pick(null,this.propertyDescs.rot_3.index),this.rotation.pick(null,3)),this.harmonics&&this.harmonics.length>0)for(let s=0;s<this.harmonics.length;s++){let e=3*s;I5.assign(n.pick(null,this.propertyDescs["f_rest_".concat(e)].index),this.harmonics[s].pick(null,0)),I5.assign(n.pick(null,this.propertyDescs["f_rest_".concat(e+1)].index),this.harmonics[s].pick(null,1)),I5.assign(n.pick(null,this.propertyDescs["f_rest_".concat(e+2)].index),this.harmonics[s].pick(null,2))}let r=new Uint8Array(n.data.buffer),a=new Uint8Array(r.length+t.length);return a.set(t),a.set(r,t.length),a.buffer}save(e,t){let i=this.getPlyBinary(),n=new Blob([i],{type:"application/octet-stream"}),r=new File([n],e),a=new FormData;a.append("file",r),a.append("filename",e),a.append("basedir",t),fetch("".concat("http://127.0.0.1:8000","/push_file"),{method:"POST",body:a})}static async loadFile(e){return await(await fetch(e)).arrayBuffer()}mortonPositionSplatsSort(){let e=q5(this.xyz),t=W5(this.xyz,e),i=W5(this.colors,e),n=W5(this.opacity,e),r=W5(this.scaling,e),a=W5(this.rotation,e),s=[];for(let o=0;o<this.harmonics.length;o++)s.push(W5(this.harmonics[o],e));return new X5(this.propertyDescs,this.format,this.nsplats,t,i,s,n,r,a,this.maxSHDegree)}static _generateHeaderString(e,t,i){let n="ply\nformat ".concat(t.format," ").concat(t.version,"\nelement vertex ").concat(i),r=Object.keys(e).length,a=Array(r);for(let s in e){let t=e[s];a[t.index]={name:s,dtype:t.dtype}}for(let s=0;s<a.length;s++)n="".concat(n,"\nproperty ").concat(a[s].dtype," ").concat(a[s].name);return"".concat(n,"\nend_header\n")}static fromArrayBuffer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,{splatCount:i,vertexData:n,propertiesDesc:r,format:a}=X5.decodeHeader(e),s=n.buffer.slice(n.byteOffset),o=Object.keys(r).length,l=(0,O5.default)(new Float32Array(s),[i,o]),c=0,h={},u={double:8,int:4,uint:4,float:4,short:2,ushort:2,uchar:1};for(let b in r)if(r.hasOwnProperty(b)){let e=r[b].dtype;h[b]=c,c+=u[e]}let d=(0,O5.default)(new Float32Array(3*i),[i,3]);I5.assign(d.pick(null,0),l.pick(null,h.x/4)),I5.assign(d.pick(null,1),l.pick(null,h.y/4)),I5.assign(d.pick(null,2),l.pick(null,h.z/4));let p=(0,O5.default)(new Float32Array(3*i),[i,3]);I5.assign(p.pick(null,0),l.pick(null,h.scale_0/4)),I5.assign(p.pick(null,1),l.pick(null,h.scale_1/4)),I5.assign(p.pick(null,2),l.pick(null,h.scale_2/4));let f=(0,O5.default)(new Float32Array(3*i),[i,3]);I5.assign(f.pick(null,0),l.pick(null,h.f_dc_0/4)),I5.assign(f.pick(null,1),l.pick(null,h.f_dc_1/4)),I5.assign(f.pick(null,2),l.pick(null,h.f_dc_2/4));let m=(0,O5.default)(new Float32Array(4*i),[i,4]);I5.assign(m.pick(null,0),l.pick(null,h.rot_1/4)),I5.assign(m.pick(null,1),l.pick(null,h.rot_2/4)),I5.assign(m.pick(null,2),l.pick(null,h.rot_3/4)),I5.assign(m.pick(null,3),l.pick(null,h.rot_0/4));for(let b=0;b<i;b++){let e=m.pick(b,null),t=Math.sqrt(e.get(0)**2+e.get(1)**2+e.get(2)**2+e.get(3)**2);I5.divseq(e,t)}let g=(0,O5.default)(new Float32Array(1*i),[i,1]);I5.assign(g.pick(null,0),l.pick(null,h.opacity/4));let v=(Math.min(Math.max(t,0),3)+1)**2-1,y=[];for(let b=0;b<v;b++){let e=(0,O5.default)(new Float32Array(3*i),[i,3]),t=3*b;I5.assign(e.pick(null,0),l.pick(null,h["f_rest_".concat(t)]/4)),I5.assign(e.pick(null,1),l.pick(null,h["f_rest_".concat(t+1)]/4)),I5.assign(e.pick(null,2),l.pick(null,h["f_rest_".concat(t+2)]/4)),y.push(e)}return new X5(r,a,i,d,f,y,g,p,m,t)}static async fromPLYFile(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,i=await X5.loadFile(e);return X5.fromArrayBuffer(i,t)}static decodeHeader(e){let t=new TextDecoder,i=0,n="",r=100;for(;;){if(i+r>=e.byteLength)throw new Error("End of file reached while searching for end of header");let a=new Uint8Array(e,i,r);n+=t.decode(a),i+=r;let s=i-200,o=new Uint8Array(e,Math.max(0,s),s>0?200:r);if(t.decode(o).includes("end_header"))break}let a,s=n.split("\n"),o=0,l={},c={},h=0;for(let d=0;d<s.length;d++){let e=s[d].trim();if(e.startsWith("element vertex")){let t=e.match(/\d+/);t&&(o=parseInt(t[0]))}else if(e.startsWith("property")){let t=e.match(/(\w+)\s+(\w+)\s+(\w+)/);if(t){let e=t[2],i=t[3];l[i]=h,c[i]={dtype:e,index:h},h++}}else if(e.startsWith("format")){let t=e.match(/(\w+)\s+(\w+)\s+(\d+\.?\d*)/);t&&(a={format:t[2],version:t[3]})}else if("end_header"===e)break}let u=n.indexOf("end_header")+10+1;return{splatCount:o,vertexData:new DataView(e,u),headerOffset:i,propertiesDesc:c,format:a}}},Y5=class{constructor(e,t,i,n,r,a,s,o){this.config=e,this.xyz=t,this.scaling=i,this.color=n,this.opacity=r,this.harmonics=s,this.quaternion=a,this.variableChunkSize=o}get isDynamicChunks(){return this.variableChunkSize&&this.variableChunkSize.length>0}get nchunks(){return this.xyz.nchunks}get nsplats(){return this.xyz.length}get chunkSize(){return this.config.chunkSize}static compressFromGaussianData(e,t){let i=k5.fromArray(e.xyz,t.xyz,t.chunkSize),n=k5.fromArray(e.scaling,t.scaling,t.chunkSize),r=k5.fromArray(e.colors,t.color,t.chunkSize),a=k5.fromArray(e.opacity,t.opacity,t.chunkSize),s=k5.fromArray(e.rotation,t.quaternion,t.chunkSize),o=e.harmonics,l=[];if(t.harmonics)for(let c=0;c<o.length;c++){let e=k5.fromArray(o[c],t.harmonics,t.chunkSize);l.push(e)}return new Y5(t,i,n,r,a,s,l)}_countIndexesInChunks(e){let t=[],i=this.nchunks,n=this.chunkSize,r=this.nsplats;if(i===k5.getRequiredNChunks(r,n))for(let a=0;a<e.length;a++){let i=e[a],n=Math.floor(i/this.chunkSize);n in t?t[n].push(i):t[n]=[i]}else{let r=this.variableChunkSize,a={},s=0;for(let e=0;e<i;e++)a[e]=s,s+=r[e];for(let o=0;o<e.length;o++){let s=e[o],l=Math.min(Math.floor(s/n),i-1);for(;s>=a[l]+r[l];)l++;l in t?t[l].push(s):t[l]=[s]}}return t}pruneSplats(e){let t,i=this._countIndexesInChunks(e),n=[];return i.length>0&&(t=this.variableChunkSize?[...this.variableChunkSize]:Array(this.nchunks).fill(this.chunkSize),i.forEach(((e,i)=>{t[i]-=e.length,t[i]<=0&&n.push(i)})),t=t.filter((e=>e>0))),new Y5(this.config,this.xyz.pruneFeature(e,n,t),this.scaling.pruneFeature(e,n,t),this.color.pruneFeature(e,n,t),this.opacity.pruneFeature(e,n,t),this.quaternion.pruneFeature(e,n,t),this.harmonics?this.harmonics.map((t=>t.pruneFeature(e,n,this.variableChunkSize))):void 0,t)}static async loadConfig(e){return await(await fetch(e,{method:"GET",mode:"cors",headers:{Accept:"application/json"}})).json()}toGaussians(){var e;let t={},i=0;if(t.x={dtype:"float",index:i},i++,t.y={dtype:"float",index:i},i++,t.z={dtype:"float",index:i},i++,t.f_dc_0={dtype:"float",index:i},i++,t.f_dc_1={dtype:"float",index:i},i++,t.f_dc_2={dtype:"float",index:i},i++,this.harmonics&&this.harmonics.length>0)for(let r=0;r<this.harmonics.length;r++)t["f_rest_".concat(r)]={dtype:"float",index:i},i++,t["f_rest_".concat(r+1)]={dtype:"float",index:i},i++,t["f_rest_".concat(r+2)]={dtype:"float",index:i},i++;t.opacity={dtype:"float",index:i},i++,t.scale_0={dtype:"float",index:i},i++,t.scale_1={dtype:"float",index:i},i++,t.scale_2={dtype:"float",index:i},i++,t.rot_0={dtype:"float",index:i},i++,t.rot_1={dtype:"float",index:i},i++,t.rot_2={dtype:"float",index:i},i++,t.rot_3={dtype:"float",index:i},i++;let n=null===(e=this.harmonics)||void 0===e?void 0:e.map((e=>e.denormDequant()));return new X5(t,{format:"binary_little_endian",version:"1.0"},this.xyz.length,this.xyz.denormDequant(),this.color.denormDequant(),n||[],this.opacity.denormDequant(),this.scaling.denormDequant(),this.quaternion.denormDequant(),3)}},Q5=J_(uS()),Z5=J_(gS()),K5={xyz:3,color:3,opacity:1,scaling:3,quaternion:4,harmonics:3},J5=class{constructor(e){this._buffer=e}get buffer(){return this._buffer}get decoded(){return this._decoded||(this._decoded=this.decodeBuffer()),this._decoded}get colorsA(){let e=this.decoded.color.denormDequant(),t=this.decoded.opacity.denormDequant(),i=(0,Q5.default)(new Float32Array(4*e.shape[0]),[e.shape[0],4]);return Z5.mulseq(e,.28209479177387814),Z5.addseq(e,.5),Z5.mulseq(e,255),Z5.maxseq(e,0),Z5.minseq(e,255),Z5.negeq(t),Z5.expeq(t),Z5.addseq(t,1),Z5.recipeq(t),Z5.mulseq(t,255),Z5.assign(i.hi(e.shape[0],3).lo(0,0),e),Z5.assign(i.hi(e.shape[0],4).lo(0,3),t),(0,Q5.default)(new Uint8Array(i.data),[e.shape[0],4]).data}get nsplats(){return this.decoded.nsplats}getSplatCount(){return this.decoded.nsplats}get precomputedCovarianceBufferData(){return this._precomputedCovarianceBufferData}decodeBuffer(){let{splatCount:e,chunkCount:t,chunkSize:i,typeChunks:n,vertexData:r,propertiesDesc:a}=this.decodeHeader(),s={xyz:a.xyz.compressionMethod,color:a.color.compressionMethod,opacity:a.opacity.compressionMethod,scaling:a.scaling.compressionMethod,quaternion:a.quaternion.compressionMethod,chunkSize:i};a.harmonics_0&&(s.harmonics=a.harmonics_0.compressionMethod);let o=r.byteOffset,l=Array(Object.keys(a).length);for(let g in a)l[a[g].index]={name:g,method:a[g].compressionMethod};let c,h=2*t*4,u=o,d="dynamic"===n?2*t:0,p=!1;if(d>0){let e=new Uint16Array(r.buffer.slice(u,u+d));u+=d,c=Array.from(e),p=!0}let f={};for(let g of l){let n,a=0,s=!0;if("norm8x"===g.method)a=1*e*K5[g.name];else if("norm11"===g.method)a=4*e;else{if("norm565"!==g.method)throw s=!1,new Error("Not Implemented format: ".concat(g.method));a=2*e}if(!s)throw new Error("loading chunk byt hasnot minmax!");{let e=r.buffer.slice(u,u+h);n=(0,Q5.default)(new Float32Array(e),[t,2]),u+=h}let o,l=r.buffer.slice(u,u+a);if(u+=a,"norm8x"===g.method)o=(0,Q5.default)(new Uint8Array(l),[e,K5[g.name]]);else if("norm11"===g.method)o=(0,Q5.default)(new Uint32Array(l));else{if("norm565"!==g.method)throw new Error("Not Implemented format: ".concat(g.method));o=(0,Q5.default)(new Uint16Array(l))}f[g.name]=new k5(o,n,i,g.method,c,p)}let m=[];for(let g=0;g<15;g++){let e=f["harmonics_".concat(g)];e&&(m.push(e),delete f["harmonics_".concat(g)])}return m.length>0&&(f.harmonics=m),new Y5(s,f.xyz,f.scaling,f.color,f.opacity,f.quaternion,f.harmonics,c)}buildPreComputedBuffers(){let e=this.decoded,t=e.nsplats,i=new ArrayBuffer(24*t),n=new Float32Array(i),r=e.scaling.denormDequant(),a=e.quaternion.denormDequant(),s=new NA,o=new uA,l=new uA,c=new uA,h=new mM;for(let u=0;u<t;u++){h.makeScale(Math.exp(r.get(u,0)),Math.exp(r.get(u,1)),Math.exp(r.get(u,2))),l.setFromMatrix4(h),s.set(a.get(u,0),a.get(u,1),a.get(u,2),a.get(u,3)),h.makeRotationFromQuaternion(s),o.setFromMatrix4(h),c.copy(o).multiply(l);let e=c.elements;n[6*u]=e[0]*e[0]+e[3]*e[3]+e[6]*e[6],n[6*u+1]=e[0]*e[1]+e[3]*e[4]+e[6]*e[7],n[6*u+2]=e[0]*e[2]+e[3]*e[5]+e[6]*e[8],n[6*u+3]=e[1]*e[1]+e[4]*e[4]+e[7]*e[7],n[6*u+4]=e[1]*e[2]+e[4]*e[5]+e[7]*e[8],n[6*u+5]=e[2]*e[2]+e[5]*e[5]+e[8]*e[8]}this._precomputedCovarianceBufferData=i}decodeHeader(){let e=this._buffer,t=new TextDecoder,i=0,n="",r=100;for(;;){if(i+r>=e.byteLength)throw new Error("End of file reached while searching for end of header");let a=new Uint8Array(e,i,r);n+=t.decode(a),i+=r;let s=i-200,o=new Uint8Array(e,Math.max(0,s),s>=0?200:r);if(t.decode(o).includes("end_header"))break}let a=n.split("\n"),s=0,o=0,l=0,c=0,h="",u={};for(let p=0;p<a.length;p++){let e=a[p].trim();if(e.startsWith("element vertex")){let t=e.match(/\d+/);t&&(s=parseInt(t[0]))}else if(e.startsWith("property")){let t=e.match(/(\w+)\s+(\w+)\s+(\w+)/);if(t){let e=t[2],i=t[3];u[e]={compressionMethod:i,index:c},c++}}else if(e.startsWith("element chunks")){let t=e.match(/\d+/);t&&(o=parseInt(t[0]))}else if(e.startsWith("element chunkSize")){let t=e.match(/\d+/);t&&(l=parseInt(t[0]))}else if(e.startsWith("element typeChunks")){let t=e.match(/(\w+)\s+(\w+)\s+(\w+)/);t&&(h=t[3])}else if("end_header"===e)break}let d=n.indexOf("end_header")+10+1;return{splatCount:s,chunkCount:o,chunkSize:l,typeChunks:h,vertexData:new DataView(e,d),propertiesDesc:u}}pruneSplats(e){let t=this.decodeBuffer().pruneSplats(e);return J5.fromCompressedGaussianSplats(t)}static fromCompressedGaussianSplats(e){let t=e.xyz.length,i=e.xyz.nchunks,n="gspline\nelement vertex ".concat(t,"\nelement chunks ").concat(i,"\nelement chunkSize ").concat(e.chunkSize,"\nelement typeChunks ").concat(e.isDynamicChunks?"dynamic":"static","\nproperty xyz ").concat(e.xyz.method,"\nproperty color ").concat(e.color.method,"\nproperty opacity ").concat(e.opacity.method,"\nproperty scaling ").concat(e.scaling.method,"\nproperty quaternion ").concat(e.quaternion.method);if(e.harmonics&&e.harmonics.length>0)for(let S=0;S<e.harmonics.length;S++)n="".concat(n,"\nproperty harmonics_").concat(S," ").concat(e.harmonics[S].method);n="".concat(n,"\nend_header\n");let r=(new TextEncoder).encode(n),a=2*i*4,s=e.xyz.quantized.data.buffer.byteLength,o=e.xyz instanceof k5?a:0,l=e.color.quantized.data.buffer.byteLength,c=e.color instanceof k5?a:0,h=e.opacity.quantized.data.buffer.byteLength,u=e.opacity instanceof k5?a:0,d=e.scaling.quantized.data.buffer.byteLength,p=e.scaling instanceof k5?a:0,f=e.quaternion.quantized.data.buffer.byteLength,m=e.quaternion instanceof k5?a:0,g=e.variableChunkSize?Uint16Array.from(e.variableChunkSize):void 0,v=g?g.byteLength:0,y=r.byteLength+v+s+o+l+c+h+u+d+p+f+m,b=0,x=0;if(e.harmonics&&e.harmonics.length>0)for(let S=0;S<e.harmonics.length;S++)b+=e.harmonics[S].quantized.data.buffer.byteLength,x+=e.harmonics[S]instanceof k5?a:0;b=0,x=0,y+=b+x;let w=new Uint8Array(y),_=0;if(w.set(r,_),_+=r.byteLength,v>0&&(w.set(new Uint8Array(g.buffer),_),_+=v),e.xyz instanceof k5&&(w.set(new Uint8Array(e.xyz.minmaxMatrix.data.buffer),_),_+=a),w.set(new Uint8Array(e.xyz.quantized.data.buffer),_),_+=s,e.color instanceof k5&&(w.set(new Uint8Array(e.color.minmaxMatrix.data.buffer),_),_+=a),w.set(new Uint8Array(e.color.quantized.data.buffer),_),_+=l,e.opacity instanceof k5&&(w.set(new Uint8Array(e.opacity.minmaxMatrix.data.buffer),_),_+=a),w.set(new Uint8Array(e.opacity.quantized.data.buffer),_),_+=h,e.scaling instanceof k5&&(w.set(new Uint8Array(e.scaling.minmaxMatrix.data.buffer),_),_+=a),w.set(new Uint8Array(e.scaling.quantized.data.buffer),_),_+=d,e.quaternion instanceof k5&&(w.set(new Uint8Array(e.quaternion.minmaxMatrix.data.buffer),_),_+=a),w.set(new Uint8Array(e.quaternion.quantized.data.buffer),_),_+=f,b>0&&e.harmonics&&e.harmonics.length>0)for(let S=0;S<e.harmonics.length;S++){let t=e.harmonics[S];t instanceof k5&&(w.set(new Uint8Array(t.minmaxMatrix.data.buffer),_),_+=a),w.set(new Uint8Array(t.quantized.data.buffer),_),_+=t.quantized.data.byteLength}return new J5(w.buffer)}},$5=class{};function e6(e){let t,i,n,r,a,s,o,l,c,h,u,d,p,f,m,g;function v(e,t,s){let o=new Float32Array(h,a,3*i);n=0;let l=new Uint32Array(h,r,i);for(let i=0;i<s.length-1;i++){let r=t[i],a=e[i].elements,c=r.filter((e=>e.enabled&&"Include"===e.mode)).map((e=>"Box"===e.type?b(e):w(e))),h=r.filter((e=>e.enabled&&"Exclude"===e.mode)).map((e=>"Box"===e.type?b(e):w(e)));for(let e=s[i];e<s[i+1];e++){let t=p[3*e],i=p[3*e+1],r=p[3*e+2];if((0===c.length||y(t,i,r,c))&&(0===h.length||!y(t,i,r,h))){let s=1/(a[3]*t+a[7]*i+a[11]*r+a[15]);o[3*n]=(a[0]*t+a[4]*i+a[8]*r+a[12])*s,o[3*n+1]=(a[1]*t+a[5]*i+a[9]*r+a[13])*s,o[3*n+2]=(a[2]*t+a[6]*i+a[10]*r+a[14])*s,l[n]=e,n++}}}}function y(e,t,i,n,r){return n["Intersect"===r?"every":"some"]((n=>{let r=function(e,t,i,n,r){let a=e-r[0],s=t-r[1],o=i-r[2],l=1/(n[3]*a+n[7]*s+n[11]*o+n[15]);return{x:(n[0]*a+n[4]*s+n[8]*o+n[12])*l+r[0],y:(n[1]*a+n[5]*s+n[9]*o+n[13])*l+r[1],z:(n[2]*a+n[6]*s+n[10]*o+n[14])*l+r[2]}}(e,t,i,n.invRotationMatrix,n.cropCenter);return Array.isArray(n)?function(e,t,i,n){return e>=n[0]&&e<=n[3]&&t>=n[1]&&t<=n[4]&&i>=n[2]&&i<=n[5]}(r.x,r.y,r.z,n):function(e,t,i,n){let r=(e-n.cropCenter[0])*n.invRadiusX,a=(t-n.cropCenter[1])*n.invRadiusY,s=(i-n.cropCenter[2])*n.invRadiusZ;return r*r+a*a+s*s<=1}(r.x,r.y,r.z,n)}))}function b(e){let t=e.cropSize[0]/2,i=e.cropSize[1]/2,n=e.cropSize[2]/2,r=[e.cropCenter[0]-t,e.cropCenter[1]-i,e.cropCenter[2]-n,e.cropCenter[0]+t,e.cropCenter[1]+i,e.cropCenter[2]+n],a=x(e.cropRotation);return Object.assign(r,{invRotationMatrix:a,cropCenter:e.cropCenter})}function x(e){let t=[],i=e[0]*Math.PI/180,n=e[1]*Math.PI/180,r=e[2]*Math.PI/180,a=Math.cos(i),s=Math.sin(i),o=Math.cos(n),l=Math.sin(n),c=Math.cos(r),h=Math.sin(r),u=a*c,d=a*h,p=s*c,f=s*h;return t[0]=o*c,t[1]=-o*h,t[2]=l,t[4]=d+p*l,t[5]=u-f*l,t[6]=-s*o,t[8]=f-u*l,t[9]=p+d*l,t[10]=a*o,t[12]=0,t[13]=0,t[14]=0,t[3]=0,t[7]=0,t[11]=0,t[15]=1,t}function w(e){let t=2/e.cropSize[0],i=2/e.cropSize[1],n=2/e.cropSize[2],r=x(e.cropRotation);return{invRadiusX:t,invRadiusY:i,invRadiusZ:n,cropCenter:e.cropCenter,invRotationMatrix:r}}e.onmessage=x=>{if(x.data.getCroppedIndexes){let t=new Uint32Array(function(e,t){let i=[],n=t.filter((e=>e.enabled&&"Include"===e.mode)).map((e=>"Box"===e.type?b(e):w(e))),r=t.filter((e=>e.enabled&&"Exclude"===e.mode)).map((e=>"Box"===e.type?b(e):w(e))),a=e.length;for(let s=0;s<a;s+=3){let t=e[s],a=e[s+1],o=e[s+2];(0===n.length||y(t,a,o,n))&&(0===r.length||!y(t,a,o,r))||i.push(s/3)}return console.log(i),i}(new Float32Array(x.data.positions),x.data.crops)).buffer;e.postMessage({outOfBoundsIndexes:t},[t])}else if(x.data.positions)u=x.data.positions,p=new Float32Array(u),m=x.data.meshMatrixWorlds,g=x.data.cropsArray,f=x.data.meshIndexIntervals,v(m,g,f),e.postMessage({sortSetupComplete:!0});else if(x.data.sort||x.data.newMatrixWorlds||x.data.newCropsArray)(x.data.newMatrixWorlds||x.data.newCropsArray)&&(g=x.data.newCropsArray||g,m=x.data.newMatrixWorlds||m,v(m,g,f)),function(u){let p,f=new Float64Array(h,s,16);for(let e=0;e<16;e++)f[e]=u[e];if(n>1){t.exports.sortIndexes(r,a,c,s,o,l,d.DepthMapRange,n);let e=new Uint32Array(n);p=e.buffer,e.set(new Uint32Array(h,l,n))}else if(1===n){let e=new Uint32Array(n);e[0]=new Uint32Array(h,r,i)[0],p=e.buffer}else p=new ArrayBuffer(0);e.postMessage({sortDone:!0,indexesBuffer:p},[p])}(x.data.sort.view,x.data.sort.cameraPosition);else if(x.data.init){d=x.data.init.Constants,i=x.data.init.splatCount;let n=d.BytesPerInt,u=3*d.BytesPerFloat,p=new Uint8Array(x.data.init.sorterWasmBytes),f=i*(n+u)+(i*d.BytesPerInt*2+d.DepthMapRange*d.BytesPerInt*2)+32*d.MemoryPageSize,m=Math.floor(f/d.MemoryPageSize)+1,g={module:{},env:{memory:new WebAssembly.Memory({initial:2*m,maximum:3*m,shared:!0})}};WebAssembly.compile(p).then((e=>WebAssembly.instantiate(e,g))).then((p=>{t=p,r=0,a=i*n,s=a+i*u,c=s+16*d.BytesPerFloat*2,o=c+i*d.BytesPerInt,l=o+d.DepthMapRange*d.BytesPerInt,h=g.env.memory.buffer,e.postMessage({sortSetupPhase1Complete:!0})}))}}}$_($5,"DepthMapRange",65536),$_($5,"MemoryPageSize",65536),$_($5,"BytesPerFloat",4),$_($5,"BytesPerInt",4);var t6=function(){let e=new Float32Array(1),t=new Int32Array(e.buffer);return function(i){return e[0]=i,t[0]}}(),i6=function(e,t,i,n){return e+(t<<8)+(i<<16)+(n<<24)},n6=new hA,r6=class extends TT{constructor(e,t,i,n){let r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,s=arguments.length>6?arguments[6]:void 0,o=arguments.length>7?arguments[7]:void 0;super(i,n),this.splatCount=t,this.meshIndexIntervals=s,this.meshMatrixWorlds=o,this.splatBuffers=e,this.geometry=i,this.material=n,this.splatDataTextures=null,this.halfPrecisionCovariancesOnGPU=r,this.devicePixelRatio=a,this.resetLocalSplatDataAndTexturesFromSplatBuffer()}static buildMesh(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,s=r6.buildGeomtery(t),o=r6.buildMaterial(r);return new r6(e,t,s,o,i,n,r,a)}static buildMaterial(e){let t={covariancesTexture:{type:"t",value:null},centersColorsTexture:{type:"t",value:null},meshIndexIntervals:{value:e},meshMatrixWorldsTexture:{type:"t",value:null},focal:{type:"v2",value:new hA},viewport:{type:"v2",value:new hA},basisViewport:{type:"v2",value:new hA},debugColor:{type:"v3",value:new MA},covariancesTextureSize:{type:"v2",value:new hA(1024,1024)},centersColorsTextureSize:{type:"v2",value:new hA(1024,1024)},orthoZoom:{type:"f",value:-1}};return new LT({uniforms:t,vertexShader:"\n            precision highp float;\n            #include <common>\n\n            attribute uint splatIndex;\n\n            uniform highp sampler2D covariancesTexture;\n            uniform highp usampler2D centersColorsTexture;\n            uniform vec2 focal;\n            uniform vec2 viewport;\n            uniform vec2 basisViewport;\n            uniform vec2 covariancesTextureSize;\n            uniform vec2 centersColorsTextureSize;\n\t\t\t\t\t\tuniform highp sampler2D meshMatrixWorldsTexture;\n\t\t\t\t\t\tuniform uint meshIndexIntervals[257];\n\t\t\t\t\t\tuniform float orthoZoom;\n\n            varying vec4 vColor;\n            varying vec2 vUv;\n\n            varying vec2 vPosition;\n\n            const vec4 encodeNorm4 = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0);\n            const uvec4 mask4 = uvec4(uint(0x000000FF), uint(0x0000FF00), uint(0x00FF0000), uint(0xFF000000));\n            const uvec4 shift4 = uvec4(0, 8, 16, 24);\n            vec4 uintToRGBAVec (uint u) {\n               uvec4 urgba = mask4 & u;\n               urgba = urgba >> shift4;\n               vec4 rgba = vec4(urgba) * encodeNorm4;\n               return rgba;\n            }\n\n            vec2 getDataUV(in int stride, in int offset, in vec2 dimensions) {\n                vec2 samplerUV = vec2(0.0, 0.0);\n                float d = float(splatIndex * uint(stride) + uint(offset)) / dimensions.x;\n                samplerUV.y = float(floor(d)) / dimensions.y;\n                samplerUV.x = fract(d);\n                return samplerUV;\n            }\n\n            void main () {\n                uvec4 sampledCenterColor = texture(centersColorsTexture, getDataUV(1, 0, centersColorsTextureSize));\n                vec3 splatCenter = uintBitsToFloat(uvec3(sampledCenterColor.gba));\n                vColor = uintToRGBAVec(sampledCenterColor.r);\n\n                vPosition = position.xy * 2.0;\n\n\t\t\t\t\t\t\t\tuint meshIndex;\n\t\t\t\t\t\t\t\tfor (int i = 1; i < 257; i++) {\n\t\t\t\t\t\t\t\t\tif (splatIndex < meshIndexIntervals[i]) {\n\t\t\t\t\t\t\t\t\t\tmeshIndex = uint(i - 1);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tfloat strideMulmeshIndex = float(4u*meshIndex);\n\t\t\t\t\t\t\t\tfloat meshMatrixWorldsTextureLength = float(256*4);\n\n\t\t\t\t\t\t\t\tmat4 modelMat = mat4(\n\t\t\t\t\t\t\t\t\ttexture(meshMatrixWorldsTexture, vec2((strideMulmeshIndex+0.0)/meshMatrixWorldsTextureLength, 0)),\n\t\t\t\t\t\t\t\t\ttexture(meshMatrixWorldsTexture, vec2((strideMulmeshIndex+1.0)/meshMatrixWorldsTextureLength, 0)),\n\t\t\t\t\t\t\t\t\ttexture(meshMatrixWorldsTexture, vec2((strideMulmeshIndex+2.0)/meshMatrixWorldsTextureLength, 0)),\n\t\t\t\t\t\t\t\t\ttexture(meshMatrixWorldsTexture, vec2((strideMulmeshIndex+3.0)/meshMatrixWorldsTextureLength, 0))\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tmat4 modelViewMat = viewMatrix * modelMat;\n\t\t\t\t\t\t\t\tvec4 viewCenter = modelViewMat * vec4(splatCenter, 1.0); \n                vec4 clipCenter = projectionMatrix * viewCenter;\n\n                vec2 sampledCovarianceA = texture(covariancesTexture, getDataUV(3, 0, covariancesTextureSize)).rg;\n                vec2 sampledCovarianceB = texture(covariancesTexture, getDataUV(3, 1, covariancesTextureSize)).rg;\n                vec2 sampledCovarianceC = texture(covariancesTexture, getDataUV(3, 2, covariancesTextureSize)).rg;\n\n                vec3 cov3D_M11_M12_M13 = vec3(sampledCovarianceA.rg, sampledCovarianceB.r);\n                vec3 cov3D_M22_M23_M33 = vec3(sampledCovarianceB.g, sampledCovarianceC.rg);\n\n                // Compute the 2D covariance matrix from the upper-right portion of the 3D covariance matrix\n                mat3 Vrk = mat3(\n                    cov3D_M11_M12_M13.x, cov3D_M11_M12_M13.y, cov3D_M11_M12_M13.z,\n                    cov3D_M11_M12_M13.y, cov3D_M22_M23_M33.x, cov3D_M22_M23_M33.y,\n                    cov3D_M11_M12_M13.z, cov3D_M22_M23_M33.y, cov3D_M22_M23_M33.z\n                );\n                float s = 1.0 / (viewCenter.z * viewCenter.z);\n\n                mat3 W = transpose(mat3(modelViewMat));\n                mat3 T = orthoZoom > 0.0 ? W : W * mat3(\n\t\t\t\t\t\t\t\t\tfocal.x / viewCenter.z, 0., -(focal.x * viewCenter.x) * s,\n\t\t\t\t\t\t\t\t\t0., focal.y / viewCenter.z, -(focal.y * viewCenter.y) * s,\n\t\t\t\t\t\t\t\t\t0., 0., 0.\n\t\t\t\t\t\t\t\t);\n                mat3 cov2Dm = transpose(T) * Vrk * T;\n                cov2Dm[0][0] += 0.3;\n                cov2Dm[1][1] += 0.3;\n\n                // We are interested in the upper-left 2x2 portion of the projected 3D covariance matrix because\n                // we only care about the X and Y values. We want the X-diagonal, cov2Dm[0][0],\n                // the Y-diagonal, cov2Dm[1][1], and the correlation between the two cov2Dm[0][1]. We don't\n                // need cov2Dm[1][0] because it is a symetric matrix.\n                vec3 cov2Dv = vec3(cov2Dm[0][0], cov2Dm[0][1], cov2Dm[1][1]);\n\n                vec3 ndcCenter = clipCenter.xyz / clipCenter.w;\n\n                // We now need to solve for the eigen-values and eigen vectors of the 2D covariance matrix\n                // so that we can determine the 2D basis for the splat. This is done using the method described\n                // here: https://people.math.harvard.edu/~knill/teaching/math21b2004/exhibits/2dmatrices/index.html\n                //\n                // This is a different approach than in the original work at INRIA. In that work they compute the\n                // max extents of the 2D covariance matrix in screen space to form an axis aligned bounding rectangle\n                // which forms the geometry that is actually rasterized. They then use the inverse 2D covariance\n                // matrix (called 'conic') to determine fragment opacity.\n                float a = cov2Dv.x;\n                float d = cov2Dv.z;\n                float b = cov2Dv.y;\n                float D = a * d - b * b;\n                float trace = a + d;\n                float traceOver2 = 0.5 * trace;\n                float term2 = sqrt(trace * trace / 4.0 - D);\n                float eigenValue1 = traceOver2 + term2;\n\t\t\t\t\t\t\t\tfloat eigenValue2 = max(traceOver2 - term2, 0.00); // prevent negative eigen value\n\n                const float maxSplatSize = 1024.0;\n                vec2 eigenVector1 = normalize(vec2(b, eigenValue1 - a));\n                // since the eigen vectors are orthogonal, we derive the second one from the first\n                vec2 eigenVector2 = vec2(eigenVector1.y, -eigenVector1.x);\n                vec2 basisVector1 = eigenVector1 * min(sqrt(2.0 * eigenValue1), maxSplatSize);\n                vec2 basisVector2 = eigenVector2 * min(sqrt(2.0 * eigenValue2), maxSplatSize);\n\n                vec2 ndcOffset = vec2(vPosition.x * basisVector1 + vPosition.y * basisVector2) * basisViewport;\n\n\t\t\t\t\t\t\t\tif (orthoZoom > 0.0) {\n\t\t\t\t\t\t\t\t\tndcOffset *= orthoZoom;\n\t\t\t\t\t\t\t\t}\n\n                gl_Position = vec4(ndcCenter.xy + ndcOffset, ndcCenter.z, 1.0);\n            }",fragmentShader:"\n            precision highp float;\n            #include <common>\n\n            uniform vec3 debugColor;\n\n            varying vec4 vColor;\n            varying vec2 vUv;\n\n            varying vec2 vPosition;\n\t\t\t\t\t\tlayout(location = 1) out vec4 gVelocity; \n\n            void main () {\n                // compute the negative squared distance from the center of the splat to the\n                // current fragment in the splat's local space.\n                float A = -dot(vPosition, vPosition);\n                if (A < -4.0) discard;\n                vec3 color = vColor.rgb;\n                A = exp(A) * vColor.a;\n                gl_FragColor = vec4(color.rgb, A);\n\t\t\t\t\t\t\t\tgVelocity = vec4(0.0); // so it is ignored by TAA\n            }",transparent:!0,alphaTest:1,blending:IS,depthTest:!0,depthWrite:!1,side:kS})}static buildGeomtery(e){let t=new fT;t.setIndex([0,1,2,0,2,3]);let i=new Float32Array(12),n=new nT(i,3);t.setAttribute("position",n),n.setXYZ(0,-1,-1,0),n.setXYZ(1,-1,1,0),n.setXYZ(2,1,1,0),n.setXYZ(3,1,-1,0),n.needsUpdate=!0;let r=(new KI).copy(t),a=new Uint32Array(e),s=new Fk(a,1,!1);return s.setUsage(35048),r.setAttribute("splatIndex",s),r.instanceCount=e,r}resetLocalSplatDataAndTexturesFromSplatBuffer(){this.updateLocalSplatDataFromSplatBuffer(),this.allocateAndStoreLocalSplatDataInTextures()}updateLocalSplatDataFromSplatBuffer(){this.splatBuffers.forEach((e=>e.buildPreComputedBuffers())),this.covariances=new Float32Array(6*this.splatCount),this.colors=new Uint8Array(4*this.splatCount),this.centers=new Float32Array(3*this.splatCount);let e=0,t=0,i=0;for(let n of this.splatBuffers){let r=n.nsplats;this.colors.subarray(e,e+4*r).set(n.colorsA),e+=4*r,this.centers.subarray(t,t+3*r).set(n.decoded.xyz.denormDequant().data),t+=3*r,this.covariances.subarray(i,i+6*r).set(new Float32Array(n.precomputedCovarianceBufferData)),i+=6*r}}allocateAndStoreLocalSplatDataInTextures(){let e=this.splatCount,t=new hA(4096,1024);for(;t.x*t.y*2<6*e;)t.y*=2;let i,n,r=new hA(4096,1024);for(;r.x*r.y*4<4*e;)r.y*=2;if(this.halfPrecisionCovariancesOnGPU){n=new Uint16Array(t.x*t.y*2);for(let e=0;e<this.covariances.length;e++)n[e]=jR.toHalfFloat(this.covariances[e]);i=new Lk(n,t.x,t.y,ZE,NE)}else n=new Float32Array(t.x*t.y*2),n.set(this.covariances),i=new Lk(n,t.x,t.y,ZE,zE);i.needsUpdate=!0,this.material.uniforms.covariancesTexture.value=i,this.material.uniforms.covariancesTextureSize.value.copy(t);let a=new Uint32Array(r.x*r.y*4);for(let c=0;c<e;c++){let e=4*c,t=3*c,i=4*c;a[i]=i6(this.colors[e],this.colors[e+1],this.colors[e+2],this.colors[e+3]),a[i+1]=t6(this.centers[t]),a[i+2]=t6(this.centers[t+1]),a[i+3]=t6(this.centers[t+2])}let s=new Lk(a,r.x,r.y,JE,BE);s.internalFormat="RGBA32UI",s.needsUpdate=!0,this.material.uniforms.centersColorsTexture.value=s,this.material.uniforms.centersColorsTextureSize.value.copy(r);let o=new Float32Array(4096);for(let c=0;c<this.meshMatrixWorlds.length;c++)o.set(this.meshMatrixWorlds[c].elements,16*c);let l=new Lk(o,1024,1,GE,zE);l.needsUpdate=!0,this.material.uniforms.meshMatrixWorldsTexture.value=l,this.material.uniformsNeedUpdate=!0,this.splatDataTextures={covariances:{data:n,texture:i,size:t},centerColors:{data:a,texture:s,size:r},meshMatrixWorlds:{data:o,texture:l}}}updateIndexes(e){let t=this.geometry;t.attributes.splatIndex.set(e),t.attributes.splatIndex.needsUpdate=!0,t.instanceCount=e.length}updateUniforms(e,t,i,n){this.splatCount>0&&(n6.set(e.x*this.devicePixelRatio,e.y*this.devicePixelRatio),this.material.uniforms.viewport.value.copy(n6),this.material.uniforms.basisViewport.value.set(2/n6.x,2/n6.y),this.material.uniforms.focal.value.set(t,i),this.material.uniforms.orthoZoom.value=n,this.material.uniformsNeedUpdate=!0)}getSplatDataTextures(){return this.splatDataTextures}getSplatCount(){return this.splatCount}getCenters(){return this.centers}getColors(){return this.colors}getCovariances(){return this.covariances}dispose(){this.geometry.dispose(),this.material.dispose(),this.splatDataTextures&&(this.splatDataTextures.covariances.texture.dispose(),this.splatDataTextures.centerColors.texture.dispose(),this.splatDataTextures.meshMatrixWorlds.texture.dispose())}},a6=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};$_(this,"updateSplatMeshUniforms",function(){let e=new hA;return function(){null!==this.splatMesh&&this.splatMesh.getSplatCount()>0&&(this.renderer.getSize(e),this.cameraFocalLengthX=this.camera.projectionMatrix.elements[0]*this.devicePixelRatio*e.x*.45,this.cameraFocalLengthY=this.camera.projectionMatrix.elements[5]*this.devicePixelRatio*e.y*.45,this.splatMesh.updateUniforms(e,this.cameraFocalLengthX,this.cameraFocalLengthY,this.camera.isPerspectiveCamera?-1:this.camera.zoom*this.devicePixelRatio))}}()),$_(this,"updateView",function(){let e=new mM,t=[],i=new FA(0,0,-1),n=new FA(0,0,-1),r=new FA,a=new FA;return function(){let s=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=this.updateMatrixWorldsInWorkerIfNeeded(),l=this.cropsChanged();if(!s){n.set(0,0,-1).applyQuaternion(this.camera.quaternion);let e=!1,t=!1;if(n.dot(i)<=.95&&(e=!0),a.copy(this.camera.position).sub(r).length()>=1&&(t=!0),!e&&!t&&!o&&!l)return}r.copy(this.camera.position),i.copy(n),e.copy(this.camera.matrixWorld).invert(),e.premultiply(this.camera.perspCamera.projectionMatrix),t[0]=this.camera.position.x,t[1]=this.camera.position.y,t[2]=this.camera.position.z;let c={sort:{view:e.elements,cameraPosition:t,splatRenderCount:this.splatRenderCount,splatSortCount:this.splatRenderCount},...o?{newMatrixWorlds:this.meshMatrixWorlds}:{},...l?{newCropsArray:this.cropsArray}:{}};this.sortRunning?this.queuedMessage=c:(this.queuedMessage=null,this.sortRunning=!0,this.sortWorker.postMessage(c))}}()),this.scene=e.scene,this.currentPage=null,this.renderer=e.renderer,this.devicePixelRatio=window.devicePixelRatio,this.sortWorker=null,this.splatRenderCount=0,this.splatSortCount=0,this.splatMesh=null,this.sortRunning=!1,this.splatRenderingInitialized=!1,this.meshMatrixWorlds=null,this.meshMatrixWorldsOld=null,this.cropsArray=null,this.splatEntries=null,this.queuedMessage=null}get camera(){return this.scene.activeCamera}reloadSplats(){this.splatRenderingInitialized=!1;let e=this.loadSplat();this.renderer.pipeline.opaquePass.splatViewer=e?this:null}loadSplat(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.activePage=this.scene.activePage,e.position&&(e.position=(new FA).fromArray(e.position)),e.orientation&&(e.orientation=(new NA).fromArray(e.orientation)),e.halfPrecisionCovariances=!!e.halfPrecisionCovariances;let t=[];if(this.splatEntries=t,this.activePage.traverseEntity((e=>{if("Splat"===e.data.type){let i=e.visible;e.traverseAncestors((e=>{i&&(i=e.visible)})),i&&t.push(e)}})),this.splatMesh&&this.splatMesh.dispose(),0===t.length)return this.splatMesh=null,!1;this.meshMatrixWorlds=t.map((e=>e.matrixWorld)),this.meshMatrixWorldsOld=t.map((e=>e.matrixWorld.clone())),this.cropsArray=t.map((e=>e.data.crops.map((e=>e.data))));let i=t.map((e=>new J5(new Uint8Array(e.data.buffer).buffer))),n=0,r=[0];for(let a of i)n+=a.getSplatCount(),r.push(n);return this.setupSplatMesh(i,n,e.position,e.orientation,e.halfPrecisionCovariances,this.devicePixelRatio,r,this.meshMatrixWorlds),this.setupSortWorker(n),!0}updateMatrixWorldsInWorkerIfNeeded(){let e=this.splatDataTextures.meshMatrixWorlds.data;for(let t=0;t<this.meshMatrixWorlds.length;t++)e.set(this.meshMatrixWorlds[t].elements,16*t);return this.splatDataTextures.meshMatrixWorlds.texture.needsUpdate=!0,!this.meshMatrixWorlds.every(((e,t)=>e.equals(this.meshMatrixWorldsOld[t])))&&(this.meshMatrixWorldsOld=this.meshMatrixWorlds.map((e=>e.clone())),!0)}cropsChanged(){let e=!1;return this.splatEntries.forEach(((t,i)=>{var n;t.data.crops.forEach(((t,n)=>{void 0===this.cropsArray[i][n]?(e=!0,this.cropsArray[i][n]=t.data):Object.entries(t.data).forEach((t=>{var r;let[a,s]=t;(Array.isArray(s)&&s.some(((e,t)=>e!==this.cropsArray[i][n][a][t]))||s!==(null===(r=this.cropsArray[i][n])||void 0===r?void 0:r[a]))&&(e=!0,this.cropsArray[i][n][a]=s)}))})),t.data.crops.length!==(null===(n=this.cropsArray[i])||void 0===n?void 0:n.length)&&(this.cropsArray[i].length=t.data.crops.length,e=!0)})),e}setupSplatMesh(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new FA,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new NA,r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,s=arguments.length>6?arguments[6]:void 0,o=arguments.length>7?arguments[7]:void 0;this.splatMesh=r6.buildMesh(e,t,r,a,s,o),this.splatMesh.position.copy(i),this.splatMesh.quaternion.copy(n),this.splatMesh.frustumCulled=!1,this.splatMesh.renderOrder=10,this.updateSplatMeshUniforms(),this.splatRenderCount=t}setupSortWorker(e){this.sortWorker=function(e){let t=new Worker(URL.createObjectURL(new Blob(["(",e6.toString(),")(self)"],{type:"application/javascript"}))),i=atob("AGFzbQEAAAAADwhkeWxpbmsuMAEEAAAAAAETA2AAAGAIf39/f39/f38AYAABfwISAQNlbnYGbWVtb3J5AgMAgIAEAwQDAAECBzkDEV9fd2FzbV9jYWxsX2N0b3JzAAALc29ydEluZGV4ZXMAARNlbXNjcmlwdGVuX3Rsc19pbml0AAIK3gMDAwABC9IDAwF/BnwBfgJAIAdFDQAgAysDUCEMIAMrAzAhDSADKwMQIQ5BACEDRP///////+9/IQtEAAAAAAAAEAAhCgNAIAIgA0ECdGoCfyAOIAEgA0EMbGoiCCoCALuiIA0gCCoCBLuioCAMIAgqAgi7oqBEAAAAAAAAsECiIgmZRAAAAAAAAOBBYwRAIAmqDAELQYCAgIB4CzYCACAJIAsgCSALYxshCyAJIAogCSAKZBshCiADQQFqIgMgB0cNAAsgB0UNACAGuCAKIAuhoyEJQQAhAwNAAn8gCSACIANBAnRqIgEoAgC3IAuhoiIKmUQAAAAAAADgQWMEQCAKqgwBC0GAgICAeAshCCABIAg2AgAgBCAIQQJ0aiIBIAEoAgBBAWo2AgAgA0EBaiIDIAdHDQALCyAGQQJPBEAgBCgCACEIQQEhAwNAIAQgA0ECdGoiASABKAIAIAhqIgg2AgAgA0EBaiIDIAZHDQALCyAHQQFrIgGtIQ8DQCAEIAIgD6dBAnQiA2ooAgBBAnRqIgcgBygCAEEBayIHNgIAIAUgASAHa0ECdGogACADaigCADYCACAPUCEDIA9CAX0hDyADRQ0ACyAGBEAgBEEAIAZBAnT8CwALCwQAQQAL"),n=new Uint8Array(i.length);for(let r=0;r<i.length;r++)n[r]=i.charCodeAt(r);return t.postMessage({init:{sorterWasmBytes:n.buffer,splatCount:e,Constants:{BytesPerFloat:$5.BytesPerFloat,BytesPerInt:$5.BytesPerInt,DepthMapRange:$5.DepthMapRange,MemoryPageSize:$5.MemoryPageSize}}}),t}(e),this.sortWorker.onmessage=e=>{var t;e.data.sortDone?(this.sortRunning=!1,null!==(t=this.splatMesh)&&void 0!==t&&t.updateIndexes(new Uint32Array(e.data.indexesBuffer)),this.lastSortTime=e.data.sortTime,this.queuedMessage&&(this.sortWorker.postMessage(this.queuedMessage),this.queuedMessage=null)):e.data.sortCanceled?this.sortRunning=!1:e.data.sortSetupPhase1Complete?this.sortWorker.postMessage({positions:this.splatMesh.getCenters().buffer,meshMatrixWorlds:this.splatMesh.meshMatrixWorlds,meshIndexIntervals:this.splatMesh.meshIndexIntervals,cropsArray:this.cropsArray}):e.data.sortSetupComplete&&(this.splatDataTextures=this.splatMesh.getSplatDataTextures(),this.updateView(!0,!0),this.splatRenderingInitialized=!0)}}update(){!1!==this.splatRenderingInitialized&&(this.updateSplatMeshUniforms(),this.updateView())}getSplatMesh(){return this.splatMesh}},s6=new eT;s6.wireframe=!0;var o6=new FA,l6=class extends Dk{constructor(e,t){super(),this.data=e,this.sharedAssets=t,this.enableHelpers=!1,this.wireframeState=!1,this.needsTransmissionDirty=!0,this.needsNormalDirty=!0,this._needsTransmission=!1,this._needsNormal=!1,this.geometryCacheChanged=!1,this.splatViewer=null,this.entityByUuid={},this.entityIdentityToEntity={},this.toExpandCloner=new Set,this.toUpdateCloner=new Set,this.pendingCommands=[],this.pathConstraints=new E5,this.invisibleObjects=new Z1("jflkdsafjasdifjaslk",{...NH.defaultData,visible:!1,name:"buildin invisible"}),this.needsRecomputeInstances=!1,this.init(e,t),this.matrixAutoUpdate=!1,this.errorPage=new X4("fdasfa",{...XH.defaultData,name:""},{shared:t,scene:this})}markGeometryCacheDirty(){this.geometryCacheChanged=!0}markNeedsUpdateRendererDirty(){this.needsTransmissionDirty=!0,this.needsNormalDirty=!0}needsTransmission(){return this.needsTransmissionDirty&&(this._needsTransmission=function(e){let t=!1;return e.traverseEntity((e=>{if(e instanceof C0)if(Array.isArray(e.material))for(let i=0;i<e.material.length;i++)b5(e,e.material[i])&&(t=!0);else b5(e,e.material)&&(t=!0)})),t}(this),this.needsTransmissionDirty=!1),this._needsTransmission}needsNormal(){return this.needsNormalDirty&&(this._needsNormal=function(e){let t=!1;return e.traverseEntity((e=>{if(e instanceof C0)if(Array.isArray(e.material))for(let i=0;i<e.material.length;i++)y5(e,e.material[i])&&(t=!0);else y5(e,e.material)&&(t=!0)})),t}(this),this.needsNormalDirty=!1),this._needsNormal}registerInstanceAndSetUuid(e){let t=e.identity.join("-"),i=this.entityIdentityToEntity[t];i&&(e.uuid=i.uuid),this.entityIdentityToEntity[t]=e,this.entityByUuid[e.uuid]=e}markPenumbraSizeDirty(){for(let e of this.children)e instanceof X4&&(e.penumbraSizeArrayCache=null)}findInstance(e){return this.entityIdentityToEntity[e.join("-")]}get bgColor(){return this.activePage.bgColor}get postprocessing(){return this.activePage.data.postprocessing}getWithSortKey(e){let t=this.find(e);if(void 0===t)return;let i=[],n=t;for(;n!==this;){let e=n;n=n.parent;let t=n.children.indexOf(e);i.splice(0,0,t)}return{entity:t,sortKey:i}}getAllSorted(e){let t=[];for(let i of e){let e=this.getWithSortKey(i.id);void 0!==e&&t.push(e)}return t.sort(((e,t)=>Oj(e.sortKey,t.sortKey))),t.map((e=>e.entity))}nonExistOrDescendantOf(e,t){let i=this.find(e);if(void 0===i)return!0;for(;i;){if(i.uuid===t)return!0;i=i.parent}return!1}find(e){if(this.activePage&&this.activePage.personalCamera.parent){if("f23858d0-4a3b-4bd8-8173-66ed0af7f6fb-personalCamera"===e)return this.activePage.personalCamera;if(e===qG)return this.activePage.personalCamera}if(""===e||void 0===e)return;let t=this.entityByUuid[e];return void 0===t?this.getObjectByProperty("uuid",e):t}find2D(e){for(let t of this.children)if(t instanceof X4&&t.uiScene){let i=t.uiScene.find(e);if(i)return i}}findScene2DfromObject2D(e){for(let t of this.children)if(t instanceof X4&&t.uiScene&&t.uiScene.find(e))return t.uiScene}find2DInUIObjects(e){let t;return this.traverseEntity((i=>{void 0===t&&i instanceof i5&&(t=i.uiCanvas.find(e))})),t}traverse2D(e){for(let t of this.children)t instanceof X4&&t.uiScene&&t.uiScene.traverse(e)}debugEnsureEntity(e){let t=this.find(e);t?Array.isArray(t.identity)&&void 0===this.findInstance(t.identity)&&console.error("not found instance"):console.error("not found")}addPendingExpandCloner(e){this.toExpandCloner.add(e)}addPendingUpdateCloner(e){this.toUpdateCloner.add(e)}markToExpandCloner(e){this.toExpandCloner.add(e),e.traverseEntityAncestors((e=>{this.toExpandCloner.add(e)}))}doPendingExpandCloner(){this.toExpandCloner.forEach((e=>{e.expandCloner(this)})),this.toExpandCloner.clear()}doPendingUpdateCloner(){this.toUpdateCloner.forEach((e=>{var t;null===(t=e.cloner)||void 0===t||t.update()})),this.toUpdateCloner.clear()}doPendingUpdates(){this.doPendingExpandCloner(),this.doPendingUpdateCloner(),this.applyPendingCommands()}addPendingCommand(e){this.pendingCommands.push(e)}applyPendingCommands(){this.pendingCommands.forEach((e=>e())),this.pendingCommands.length=0}updateByLibOp(e,t){1===e.path.length&&"components"===e.path[0]&&1===e.type&&this.createChildrenObjects([{...e.data.asset,id:e.id}],this.invisibleObjects,t)}updateTreeByOp(e,t){if(0===e.path.length&&7===e.type){let i=null===e.parent?this:this.find(e.parent);if(void 0===i)throw new Error("unexpected");let n=this.createObject(e.id,e.data,e.children,i,e.localIndex,t);n.updateVisible(this),n.resetBBoxNeedsUpdate(),q1(n)&&X1(n.parent)&&(n.invalidateUpstreamBooleanData(),n.parent.invalidateDownstreamBooleanData().recomputeBoolean()),this.markNeedsRecomputeInstancesForAncessors(i),this.markNeedsRecomputeInstancesForChildren(n),this.markToExpandCloner(n),this.markPenumbraSizeDirty(),n.updatePathSnapping()}else if(0===e.path.length&&8===e.type){let t=this.find(e.id);if(void 0===t)throw new Error("unexpected");this.markToExpandCloner(t),t.resetBBoxNeedsUpdate(),this.unregisterObject(t);let i=t.parent;this.markNeedsRecomputeInstancesForAncessors(i),this.markNeedsRecomputeInstancesForChildren(t),this.markPenumbraSizeDirty(),t.parent.remove(t),X1(t.parent)&&(t.parent.invalidateUpstreamBooleanData(),t.parent.invalidateDownstreamBooleanData().recomputeBoolean()),q1(t)&&(t.freeBooleanPointer(),i instanceof H1&&i.invalidateDownstreamBooleanData().recomputeBoolean()),t instanceof Z4&&t.detachShape(),this.disposeAndUnregisterEntityRecursivelyIfNotReregistered(t),this.pathConstraints.removeDependencies(t.uuid),t.updatePathSnapping()}else if(0===e.path.length&&9===e.type){var i;let t=this.find(e.id);if(void 0===t)throw new Error("unexpected");this.markNeedsRecomputeInstancesForChildren(t);let n=t.parent;this.markNeedsRecomputeInstancesForAncessors(n),null!==(i=t.cloner)&&void 0!==i&&i.resetOnMove(),this.markToExpandCloner(t);let r=null===e.parent?this:this.find(e.parent);if(void 0===r)throw new Error("unexpected");r.add(t),this.markNeedsRecomputeInstancesForAncessors(r),this.markToExpandCloner(t),t.invalidateClonerTransform(t),t.updateVisible(this),t.resetBBoxNeedsUpdate(),this.markPenumbraSizeDirty();let a=e.localIndex;r.children.splice(a,0,r.children.pop()),q1(t)&&(t.invalidateUpstreamBooleanData(),X1(t.parent)?t.parent.invalidateDownstreamBooleanData().recomputeBoolean():n instanceof H1&&n.invalidateDownstreamBooleanData().recomputeBoolean()),t.updatePathSnapping()}this.markNeedsUpdateRendererDirty(),this.markGeometryCacheDirty()}get playPage(){var e;return null!==(e=this.find(this.data.publish.playPage))&&void 0!==e?e:this.errorPage}updatePage(e){var t;this.activePage&&this.activePage.onDeactive(),this.activePage=this.errorPage;for(let i of this.children)i instanceof X4&&(i.visible=i.uuid===e,i.visible&&(this.activePage=i,this.activePage.onActive(this)));this.activePage!==(null===(t=this.splatViewer)||void 0===t?void 0:t.activePage)&&this.reloadSplats()}updateEntityByOp(e,t,i,n){if(0===t.type){if(("overrides"in t.props||"component"in t.props)&&this.markNeedsRecomputeInstances(),"visible"in t.props&&this.markPenumbraSizeDirty(),t.path.includes("overrides")&&"states"in t.props){let{rest:e}=t.props;t={...t,props:e},this.markNeedsRecomputeInstances()}"pathSnapping"===t.path[0]&&void 0!==t.props.pathId&&this.pathConstraints.setConstraint(e,t.props.pathId)}let r=this.find(e);if(r)try{(function(e,t,i,n){e.updateByOp(t,i,n,!1)})(r,t,i,{scene:this,shared:n}),r instanceof k0&&r.updateGeometryGroupsIfNeeded()}catch(h){console.error(h)}}updateEntity2DByOp(e,t,i,n,r){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[];e.updateEntityByOp(t,i,n,r),this.traverseEntity((e=>{var s;(e instanceof i5||e instanceof X4)&&(a.includes(null!==(s=e.frameId)&&void 0!==s?s:"")||e.frameId===t)&&e.updateEntity2DByOp(t,i,n,r)}))}get activeCamera(){return this.activePage.activeCamera}switchActiveCamera(e){this.activePage.switchActiveCamera(e)}isInvisibleObjects(e){return e===this.invisibleObjects||e.hasAnccestor(this.invisibleObjects)}init(e,t){let i=Object.entries(t.data.lib.components).map(((e,t)=>({data:e[1].asset.data,children:e[1].asset.children,id:e[0],fi:t})));this.invisibleObjects.updateState(this.invisibleObjects.data,{scene:this,shared:t}),this.add(this.invisibleObjects),this.createChildrenObjects(i,this.invisibleObjects,t),this.createChildrenObjects(e.objects,this,t),this.updatePage(e.publish.playPage),this.activePage.switchToPlayCamera(),this.expandInstances(t,!0),this.traverseEntity((e=>{e instanceof F1&&e.updateUp()})),this.doPendingExpandCloner(),this.applyPendingCommands()}markNeedsRecomputeInstances(){this.needsRecomputeInstances=!0}markNeedsRecomputeInstancesForChildren(e){e.traverseEntity((e=>{("Component"===e.data.type||"Instance"===e.data.type)&&this.markNeedsRecomputeInstances()}))}markNeedsRecomputeInstancesForAncessors(e){IX.is(e)&&("Component"===e.data.type&&this.markNeedsRecomputeInstances(),e.traverseAncestors((e=>{IX.is(e)&&"Component"===e.data.type&&this.markNeedsRecomputeInstances()})))}relativeizeInner(e,t,i,n,r,a,s){if(e){let o=n.find(e);o&&o!==n&&r.forInstancesRec((n=>{n.data=FV(n.data,(r=>{let o=r.events.data(s.id),l=n.goUp(a);if(l){let n=[...kj(l.identity),e].join("-"),r=this.entityIdentityToEntity[n];if(r){let e=r.uuid;LV.zoom(o,t)[i]=e}else console.warn("cannot find instance")}})).data}))}}rewriteActions(e,t,i,n,r,a){e.forEach((e=>{("Transition"===e.data.type||"Animation"===e.data.type)&&this.relativeizeInner(e.data.object,[...t,e.id],"object",i,n,r,a)}))}rewriteEventsBeforeGoToPlayMode(){this.traverseEntity((e=>{if(e instanceof K4&&"string"==typeof e.identity&&"Component"===e.data.type)return e.traverseEntity(((t,i)=>{t.data.events.forEach((n=>{if("GameControl"===n.data.type){let r=!1;if(t.forInstancesRec((e=>{e.data=FV(e.data,(t=>{e.isInstanceRoot||(t.events.delete(n.id),r=!0)})).data})),!1===r)for(let a of uW.list)this.rewriteActions(n.data.gameActions[a],["gameActions",a],e,t,i,n)}else"Conditional"===n.data.type?("Distance"===n.data.condition.type?(this.relativeizeInner(n.data.condition.fromObject,["condition"],"fromObject",e,t,i,n),this.relativeizeInner(n.data.condition.toObject,["condition"],"toObject",e,t,i,n)):"State"===n.data.condition.type?this.relativeizeInner(n.data.condition.object,["condition"],"object",e,t,i,n):"Comparison"===n.data.condition.type&&("Property"===n.data.condition.lOperand.type&&this.relativeizeInner(n.data.condition.lOperand.value[0],["condition","lOperand","value"],0,e,t,i,n),"Property"===n.data.condition.rOperand.type&&this.relativeizeInner(n.data.condition.rOperand.value[0],["condition","rOperand","value"],0,e,t,i,n)),this.rewriteActions(n.data.inActions,["inActions"],e,t,i,n),this.rewriteActions(n.data.outActions,["outActions"],e,t,i,n)):"actions"in n.data&&this.rewriteActions(n.data.actions,["actions"],e,t,i,n)}))})),!0}))}expandInstances(e,t,i){let n=new Set;this.traverseEntity((r=>{if(r instanceof K4&&r.isInstanceRoot)return r.expandInstanceChildren({scene:this,shared:e,pendingDeletes:n}),t||r.resetBBoxNeedsUpdate(),i&&r.traverseEntity((e=>{i.addClip(e)})),!0}));for(let r of n)this.disposeAndUnregisterEntityRecursivelyIfNotReregistered(r),J4(r)}recomputeInstances(e,t){this.needsRecomputeInstances&&(this.needsRecomputeInstances=!1,this.traverseEntity((e=>{e instanceof K4&&e.isInstanceRoot&&(e.component=void 0)})),this.expandInstances(e,!1,t))}disposeAndUnregisterEntityRecursivelyIfNotReregistered(e){e.traverseEntity((e=>{let t="string"==typeof e.identity?e.identity:e.identity.join("-");this.entityIdentityToEntity[t]===e&&(delete this.entityByUuid[e.uuid],delete this.entityIdentityToEntity[t]),e.dispose()}))}clearScene(){for(let e of this.children)IX.is(e)&&e.disposeRecursively();this.children.length=0}resetAfterClear(e,t){this.init(e,t)}raycast(e){return this.raycast1(e,!1)}raycast1(e,t){let i=[],n=r=>{for(let a of r.children){let r=a.cloner;if(IX.is(a)&&!a.raycastLock&&(a.visible||null!==r&&void 0!==r&&r.object.data.visible))if(!0===t&&a.isInstanceRoot){let t=[];if(e.intersectObject(a,!0,t),t.length){let e=t[0];e.object=a,e.point.applyMatrix4(e.object.matrixWorld);let n=a.matrixWorld.clone().invert();e.point.applyMatrix4(n),i.push(e)}}else(q1(a)||Y1(a)&&this.enableHelpers&&a.objectHelper.visible)&&(e.intersectObject(a,!1,i),S5(a,e,i)),n(a)}};return n(this.activePage),i}raycastWithClones(e){let t=[],i=n=>{for(let r of n.children){let n=r.cloner;IX.is(r)&&(r.visible||(null===n||void 0===n?void 0:n.object.data.visible))&&((q1(r)||Y1(r)&&this.enableHelpers&&r.objectHelper.visible)&&(e.intersectObject(r,!1,t),S5(r,e,t,!0)),i(r))}};return i(this),t}forEachEntity(e){for(let t of this.children)IX.is(t)&&e(t)}traverseConcreteEntity(e){for(let t of this.children)IX.is(t)&&t.isConcreteEntity&&t.traverseEntity(e)}traverseEntity(e){for(let t of this.children)IX.is(t)&&t.traverseEntity(e)}updateFont(e,t){this.traverseEntity((i=>{if(i instanceof k0&&"Mesh"===i.data.type&&"TextGeometry"===i.data.geometry.type&&i.data.geometry.font===e){let n=i.geometry,r=i.data.geometry;n.updateFont(e,t).then((()=>{n.update(r);let e=i.invalidateDownstreamBooleanData();X1(e)&&e.recomputeBoolean()}))}}))}traverseObject(e){for(let t of this.children)AX.is(t)&&t.traverseObject(e)}traverseVisibleEntity(e){for(let t of this.children)IX.is(t)&&t.visible&&t.traverseVisibleEntity(e)}dispose(){this.clearScene()}createChildrenObjects(e,t,i){let n=0;for(let r of e)this.createObject(r.id,r.data,r.children,t,n,i),n+=1}registerObjectCreatedInLegacy(e){this.entityByUuid[e.uuid]=e}unregisterObject(e){delete this.entityByUuid[e.uuid];for(let t of e.children)this.unregisterObject(t)}createObject(e,t,i,n,r,a){var s;let o={scene:this,shared:a},l=v5(e,t,o);return l&&(this.entityByUuid[e]=l,n.add(l),n.children.splice(r,0,n.children.pop()),i.length>0&&(l.isInstanceRoot?console.error("instance should not have children!"):this.createChildrenObjects(i,l,a)),l.updateState(t,o),l instanceof k0&&l.updateGeometryGroupsIfNeeded(),l.updateVisible(this),l.cloner&&this.toExpandCloner.add(l),null!==(s=t.pathSnapping)&&void 0!==s&&s.pathId&&this.pathConstraints.setConstraint(e,t.pathSnapping.pathId)),"Empty"===t.type&&t.animations&&l.traverseEntity((e=>{let t=e.dataPatched;if(e instanceof k0&&t.bones&&t.boneInverses){let i=t.bones.map((e=>this.find(e))),n=t.boneInverses.map((e=>(new mM).fromArray(e))),r=new Nk(i,n);e.bind(r,e.bindMatrix)}else e.matrixAutoUpdate=!0})),l}getCenter(e){let t=[];for(let n=0,r=e.length;n<r;++n){let{id:i,recursive:r}=e[n],a=this.find(i),s=r?a.recursiveBBox:a.singleBBox;t.push(...s.vertices)}let i=new UA;return i.setFromPoints(t),i.getCenter(o6),o6}copyMatrixWorld(e,t){if(null===e)return void t.identity();let i=this.find(e);i?t.copy(i.matrixWorld):t.identity()}copyParentMatrixWorld(e,t){var i;if(null===e)return void t.identity();let n=null===(i=this.find(e))||void 0===i?void 0:i.parent;n?t.copy(n.matrixWorld):t.identity()}traverseMaterial(e){this.traverseEntity((t=>{if(t instanceof vK)if(Array.isArray(t.material))for(let i=0;i<t.material.length;i++)t.material[i]instanceof t0&&e(t.material[i]);else t.material instanceof t0&&e(t.material)}))}updateViewPlaneSize(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.traverseConcreteEntity((n=>{n instanceof F1&&n.setViewplaneSize(e,t,i)}))}initializeSplatViewer(e){this.splatViewer=new a6({scene:this,renderer:e}),this.reloadSplats()}reloadSplats(){var e;null===(e=this.splatViewer)||void 0===e||e.reloadSplats()}},c6=(e,t)=>{let i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)},h6=e=>e*(Math.PI/180),u6=e=>e*(180/Math.PI),d6=new Map,p6=e=>{d6.has(e)&&clearTimeout(d6.get(e)),d6.set(e,setTimeout(e,100))},f6=(e,t,i)=>{let n,r=t.split(/[ ,]+/g);for(let a=0;a<r.length;a+=1)n=r[a],e.addEventListener?e.addEventListener(n,i,!1):e.attachEvent&&e.attachEvent(n,i)},m6=(e,t,i)=>{let n,r=t.split(/[ ,]+/g);for(let a=0;a<r.length;a+=1)n=r[a],e.removeEventListener?e.removeEventListener(n,i):e.detachEvent&&e.detachEvent(n,i)},g6=e=>(e.preventDefault(),e.type.match(/^touch/)?e.changedTouches:e),v6=()=>{if(typeof window>"u")return;return{x:void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,y:void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop}},y6=(e,t)=>{t.top||t.right||t.bottom||t.left?(e.style.top=t.top,e.style.right=t.right,e.style.bottom=t.bottom,e.style.left=t.left):(e.style.left=t.x+"px",e.style.top=t.y+"px")},b6=(e,t,i)=>{let n=x6(e);for(let r in n)if(n.hasOwnProperty(r))if("string"==typeof t)n[r]=t+" "+i;else{let e="";for(let n=0,r=t.length;n<r;n+=1)e+=t[n]+" "+i+", ";n[r]=e.slice(0,-2)}return n},x6=e=>{let t={};return t[e]="",["webkit","Moz","o"].forEach((function(i){t[i+e.charAt(0).toUpperCase()+e.slice(1)]=""})),t},w6=(e,t)=>{for(let i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},_6=(e,t)=>{if(e.length)for(let i=0,n=e.length;i<n;i+=1)t(e[i]);else t(e)};typeof window<"u"&&(S6="ontouchstart"in window,E6=!!window.PointerEvent,C6=!!window.MSPointerEvent);var S6,E6,C6,A6,M6={start:"mousedown",move:"mousemove",end:"mouseup"},T6={};function P6(){}E6?A6={start:"pointerdown",move:"pointermove",end:"pointerup, pointercancel"}:C6?A6={start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:S6?(A6={start:"touchstart",move:"touchmove",end:"touchend, touchcancel"},T6=M6):A6=M6,P6.prototype.on=function(e,t){var i,n=this,r=e.split(/[ ,]+/g);n._handlers_=n._handlers_||{};for(var a=0;a<r.length;a+=1)i=r[a],n._handlers_[i]=n._handlers_[i]||[],n._handlers_[i].push(t);return n},P6.prototype.off=function(e,t){var i=this;return i._handlers_=i._handlers_||{},void 0===e?i._handlers_={}:void 0===t?i._handlers_[e]=null:i._handlers_[e]&&i._handlers_[e].indexOf(t)>=0&&i._handlers_[e].splice(i._handlers_[e].indexOf(t),1),i},P6.prototype.trigger=function(e,t){var i,n=this,r=e.split(/[ ,]+/g);n._handlers_=n._handlers_||{};for(var a=0;a<r.length;a+=1)i=r[a],n._handlers_[i]&&n._handlers_[i].length&&n._handlers_[i].forEach((function(e){e.call(n,{type:i,target:n},t)}))},P6.prototype.config=function(e){var t=this;t.options=t.defaults||{},e&&(t.options=((e,t)=>{let i={};for(let n in e)e.hasOwnProperty(n)&&t.hasOwnProperty(n)?i[n]=t[n]:e.hasOwnProperty(n)&&(i[n]=e[n]);return i})(t.options,e))},P6.prototype.bindEvt=function(e,t){var i=this;return i._domHandlers_=i._domHandlers_||{},i._domHandlers_[t]=function(){"function"==typeof i["on"+t]?i["on"+t].apply(i,arguments):console.warn('[WARNING] : Missing "on'+t+'" handler.')},f6(e,A6[t],i._domHandlers_[t]),T6[t]&&f6(e,T6[t],i._domHandlers_[t]),i},P6.prototype.unbindEvt=function(e,t){var i=this;return i._domHandlers_=i._domHandlers_||{},m6(e,A6[t],i._domHandlers_[t]),T6[t]&&m6(e,T6[t],i._domHandlers_[t]),delete i._domHandlers_[t],this};var D6=P6;function k6(e,t){return this.identifier=t.identifier,this.position=t.position,this.frontPosition=t.frontPosition,this.collection=e,this.defaults={size:100,threshold:.1,color:"white",fadeTime:250,dataOnly:!1,restJoystick:!0,restOpacity:1,mode:"dynamic",zone:document.body,lockX:!1,lockY:!1,shape:"circle"},this.config(t),"dynamic"===this.options.mode&&(this.options.restOpacity=0),this.id=k6.id,k6.id+=1,this.buildEl().stylize(),this.instance={el:this.ui.el,on:this.on.bind(this),off:this.off.bind(this),show:this.show.bind(this),hide:this.hide.bind(this),add:this.addToDom.bind(this),remove:this.removeFromDom.bind(this),destroy:this.destroy.bind(this),setPosition:this.setPosition.bind(this),resetDirection:this.resetDirection.bind(this),computeDirection:this.computeDirection.bind(this),trigger:this.trigger.bind(this),position:this.position,frontPosition:this.frontPosition,ui:this.ui,identifier:this.identifier,id:this.id,options:this.options},this.instance}k6.prototype=new D6,k6.constructor=k6,k6.id=0,k6.prototype.buildEl=function(e){return this.ui={},this.options.dataOnly||(this.ui.el=document.createElement("div"),this.ui.back=document.createElement("div"),this.ui.front=document.createElement("div"),this.ui.el.className="nipple collection_"+this.collection.id,this.ui.back.className="back",this.ui.front.className="front",this.ui.el.setAttribute("id","nipple_"+this.collection.id+"_"+this.id),this.ui.el.appendChild(this.ui.back),this.ui.el.appendChild(this.ui.front)),this},k6.prototype.stylize=function(){if(this.options.dataOnly)return this;var e=this.options.fadeTime+"ms",t=((e,t)=>{let i=x6(e);for(let n in i)i.hasOwnProperty(n)&&(i[n]=t);return i})("borderRadius","50%"),i=b6("transition","opacity",e),n={};return n.el={position:"absolute",opacity:this.options.restOpacity,display:"block",zIndex:999},n.back={position:"absolute",display:"block",width:this.options.size+"px",height:this.options.size+"px",marginLeft:-this.options.size/2+"px",marginTop:-this.options.size/2+"px",background:"rgba(255, 255, 255, .4)",border:"solid 2px rgba(0, 0, 0, .1)"},n.front={width:this.options.size/2+"px",height:this.options.size/2+"px",position:"absolute",display:"block",marginLeft:-this.options.size/4+"px",marginTop:-this.options.size/4+"px",background:"rgba(255, 255, 255, .8)",border:"solid 2px rgba(0, 0, 0, .1)"},w6(n.el,i),"circle"===this.options.shape&&w6(n.back,t),w6(n.front,t),this.applyStyles(n),this},k6.prototype.applyStyles=function(e){for(var t in this.ui)if(this.ui.hasOwnProperty(t))for(var i in e[t])this.ui[t].style[i]=e[t][i];return this},k6.prototype.addToDom=function(){return this.options.dataOnly||document.body.contains(this.ui.el)||this.options.zone.appendChild(this.ui.el),this},k6.prototype.removeFromDom=function(){return this.options.dataOnly||!document.body.contains(this.ui.el)||this.options.zone.removeChild(this.ui.el),this},k6.prototype.destroy=function(){clearTimeout(this.removeTimeout),clearTimeout(this.showTimeout),clearTimeout(this.restTimeout),this.trigger("destroyed",this.instance),this.removeFromDom(),this.off()},k6.prototype.show=function(e){var t=this;return t.options.dataOnly||(clearTimeout(t.removeTimeout),clearTimeout(t.showTimeout),clearTimeout(t.restTimeout),t.addToDom(),t.restCallback(),setTimeout((function(){t.ui.el.style.opacity=1}),0),t.showTimeout=setTimeout((function(){t.trigger("shown",t.instance),"function"==typeof e&&e.call(this)}),t.options.fadeTime)),t},k6.prototype.hide=function(e){var t=this;if(t.options.dataOnly)return t;if(t.ui.el.style.opacity=t.options.restOpacity,clearTimeout(t.removeTimeout),clearTimeout(t.showTimeout),clearTimeout(t.restTimeout),t.removeTimeout=setTimeout((function(){var i="dynamic"===t.options.mode?"none":"block";t.ui.el.style.display=i,"function"==typeof e&&e.call(t),t.trigger("hidden",t.instance)}),t.options.fadeTime),t.options.restJoystick){let i=t.options.restJoystick,n={};n.x=!0===i||!1!==i.x?0:t.instance.frontPosition.x,n.y=!0===i||!1!==i.y?0:t.instance.frontPosition.y,t.setPosition(e,n)}return t},k6.prototype.setPosition=function(e,t){var i=this;i.frontPosition={x:t.x,y:t.y};var n=i.options.fadeTime+"ms",r={};r.front=b6("transition",["top","left"],n);var a={front:{}};a.front={left:i.frontPosition.x+"px",top:i.frontPosition.y+"px"},i.applyStyles(r),i.applyStyles(a),i.restTimeout=setTimeout((function(){"function"==typeof e&&e.call(i),i.restCallback()}),i.options.fadeTime)},k6.prototype.restCallback=function(){var e=this,t={};t.front=b6("transition","none",""),e.applyStyles(t),e.trigger("rested",e.instance)},k6.prototype.resetDirection=function(){this.direction={x:!1,y:!1,angle:!1}},k6.prototype.computeDirection=function(e){var t,i,n,r=e.angle.radian,a=Math.PI/4,s=Math.PI/2;if(r>a&&r<3*a&&!e.lockX?t="up":r>-a&&r<=a&&!e.lockY?t="left":r>3*-a&&r<=-a&&!e.lockX?t="down":e.lockY||(t="right"),e.lockY||(i=r>-s&&r<s?"left":"right"),e.lockX||(n=r>0?"up":"down"),e.force>this.options.threshold){var o,l={};for(o in this.direction)this.direction.hasOwnProperty(o)&&(l[o]=this.direction[o]);var c={};for(o in this.direction={x:i,y:n,angle:t},e.direction=this.direction,l)l[o]===this.direction[o]&&(c[o]=!0);if(c.x&&c.y&&c.angle)return e;(!c.x||!c.y)&&this.trigger("plain",e),c.x||this.trigger("plain:"+i,e),c.y||this.trigger("plain:"+n,e),c.angle||this.trigger("dir dir:"+t,e)}else this.resetDirection();return e};var O6=k6;function I6(e,t){var i=this;i.nipples=[],i.idles=[],i.actives=[],i.ids=[],i.pressureIntervals={},i.manager=e,i.id=I6.id,I6.id+=1,i.defaults={zone:document.body,multitouch:!1,maxNumberOfNipples:10,mode:"dynamic",position:{top:0,left:0},catchDistance:200,size:100,threshold:.1,color:"white",fadeTime:250,dataOnly:!1,restJoystick:!0,restOpacity:1,lockX:!1,lockY:!1,shape:"circle",dynamicPage:!1,follow:!1},i.config(t),("static"===i.options.mode||"semi"===i.options.mode)&&(i.options.multitouch=!1),i.options.multitouch||(i.options.maxNumberOfNipples=1);let n=getComputedStyle(i.options.zone.parentElement);return n&&"flex"===n.display&&(i.parentIsFlex=!0),i.updateBox(),i.prepareNipples(),i.bindings(),i.begin(),i.nipples}I6.prototype=new D6,I6.constructor=I6,I6.id=0,I6.prototype.prepareNipples=function(){var e=this,t=e.nipples;t.on=e.on.bind(e),t.off=e.off.bind(e),t.options=e.options,t.destroy=e.destroy.bind(e),t.ids=e.ids,t.id=e.id,t.processOnMove=e.processOnMove.bind(e),t.processOnEnd=e.processOnEnd.bind(e),t.get=function(e){if(void 0===e)return t[0];for(var i=0,n=t.length;i<n;i+=1)if(t[i].identifier===e)return t[i];return!1}},I6.prototype.bindings=function(){var e=this;e.bindEvt(e.options.zone,"start"),e.options.zone.style.touchAction="none",e.options.zone.style.msTouchAction="none"},I6.prototype.begin=function(){var e=this,t=e.options;if("static"===t.mode){var i=e.createNipple(t.position,e.manager.getIdentifier());i.add(),e.idles.push(i)}},I6.prototype.createNipple=function(e,t){var i=this,n=i.manager.scroll,r={},a=i.options,s=i.parentIsFlex?n.x:n.x+i.box.left,o=i.parentIsFlex?n.y:n.y+i.box.top;if(e.x&&e.y)r={x:e.x-s,y:e.y-o};else if(e.top||e.right||e.bottom||e.left){var l=document.createElement("DIV");l.style.display="hidden",l.style.top=e.top,l.style.right=e.right,l.style.bottom=e.bottom,l.style.left=e.left,l.style.position="absolute",a.zone.appendChild(l);var c=l.getBoundingClientRect();a.zone.removeChild(l),r=e,e={x:c.left+n.x,y:c.top+n.y}}var h=new O6(i,{color:a.color,size:a.size,threshold:a.threshold,fadeTime:a.fadeTime,dataOnly:a.dataOnly,restJoystick:a.restJoystick,restOpacity:a.restOpacity,mode:a.mode,identifier:t,position:e,zone:a.zone,frontPosition:{x:0,y:0},shape:a.shape});return a.dataOnly||(y6(h.ui.el,r),y6(h.ui.front,h.frontPosition)),i.nipples.push(h),i.trigger("added "+h.identifier+":added",h),i.manager.trigger("added "+h.identifier+":added",h),i.bindNipple(h),h},I6.prototype.updateBox=function(){this.box=this.options.zone.getBoundingClientRect()},I6.prototype.bindNipple=function(e){var t,i=this,n=function(e,n){t=e.type+" "+n.id+":"+e.type,i.trigger(t,n)};e.on("destroyed",i.onDestroyed.bind(i)),e.on("shown hidden rested dir plain",n),e.on("dir:up dir:right dir:down dir:left",n),e.on("plain:up plain:right plain:down plain:left",n)},I6.prototype.pressureFn=function(e,t,i){var n=this,r=0;clearInterval(n.pressureIntervals[i]),n.pressureIntervals[i]=setInterval(function(){var i=e.force||e.pressure||e.webkitForce||0;i!==r&&(t.trigger("pressure",i),n.trigger("pressure "+t.identifier+":pressure",i),r=i)}.bind(n),100)},I6.prototype.onstart=function(e){var t=this,i=t.options,n=e;e=g6(e),t.updateBox();return _6(e,(function(r){t.actives.length<i.maxNumberOfNipples?t.processOnStart(r):n.type.match(/^touch/)&&(Object.keys(t.manager.ids).forEach((function(i){if(Object.values(n.touches).findIndex((function(e){return e.identifier===i}))<0){var r=[e[0]];r.identifier=i,t.processOnEnd(r)}})),t.actives.length<i.maxNumberOfNipples&&t.processOnStart(r))})),t.manager.bindDocument(),!1},I6.prototype.processOnStart=function(e){var t,i=this,n=i.options,r=i.manager.getIdentifier(e),a=e.force||e.pressure||e.webkitForce||0,s={x:e.pageX,y:e.pageY},o=i.getOrCreate(r,s);o.identifier!==r&&i.manager.removeIdentifier(o.identifier),o.identifier=r;var l=function(t){t.trigger("start",t),i.trigger("start "+t.id+":start",t),t.show(),a>0&&i.pressureFn(e,t,t.identifier),i.processOnMove(e)};if((t=i.idles.indexOf(o))>=0&&i.idles.splice(t,1),i.actives.push(o),i.ids.push(o.identifier),"semi"!==n.mode)l(o);else{if(!(c6(s,o.position)<=n.catchDistance))return o.destroy(),void i.processOnStart(e);l(o)}return o},I6.prototype.getOrCreate=function(e,t){var i,n=this,r=n.options;return/(semi|static)/.test(r.mode)?(i=n.idles[0])?(n.idles.splice(0,1),i):"semi"===r.mode?n.createNipple(t,e):(console.warn("Coudln't find the needed nipple."),!1):i=n.createNipple(t,e)},I6.prototype.processOnMove=function(e){var t=this,i=t.options,n=t.manager.getIdentifier(e),r=t.nipples.get(n),a=t.manager.scroll;if((e=>isNaN(e.buttons)?0!==e.pressure:0!==e.buttons)(e)){if(!r)return console.error("Found zombie joystick with ID "+n),void t.manager.removeIdentifier(n);if(i.dynamicPage){var s=r.el.getBoundingClientRect();r.position={x:a.x+s.left,y:a.y+s.top}}r.identifier=n;var o=r.options.size/2,l={x:e.pageX,y:e.pageY};i.lockX&&(l.y=r.position.y),i.lockY&&(l.x=r.position.x);var c,h,u=c6(l,r.position),d=((e,t)=>{let i=t.x-e.x,n=t.y-e.y;return u6(Math.atan2(n,i))})(l,r.position),p=h6(d),f=u/o,m={distance:u,position:l};if("circle"===r.options.shape?(c=Math.min(u,o),h=((e,t,i)=>{let n={x:0,y:0};return i=h6(i),n.x=e.x-t*Math.cos(i),n.y=e.y-t*Math.sin(i),n})(r.position,c,d)):(h=((e,t,i)=>({x:Math.min(Math.max(e.x,t.x-i),t.x+i),y:Math.min(Math.max(e.y,t.y-i),t.y+i)}))(l,r.position,o),c=c6(h,r.position)),i.follow){if(u>o){let e=l.x-h.x,i=l.y-h.y;r.position.x+=e,r.position.y+=i,r.el.style.top=r.position.y-(t.box.top+a.y)+"px",r.el.style.left=r.position.x-(t.box.left+a.x)+"px",u=c6(l,r.position)}}else l=h,u=c;var g=l.x-r.position.x,v=l.y-r.position.y;r.frontPosition={x:g,y:v},i.dataOnly||y6(r.ui.front,r.frontPosition);var y={identifier:r.identifier,position:l,force:f,pressure:e.force||e.pressure||e.webkitForce||0,distance:u,angle:{radian:p,degree:d},vector:{x:g/o,y:-v/o},raw:m,instance:r,lockX:i.lockX,lockY:i.lockY};(y=r.computeDirection(y)).angle={radian:h6(180-d),degree:180-d},r.trigger("move",y),t.trigger("move "+r.id+":move",y)}else this.processOnEnd(e)},I6.prototype.processOnEnd=function(e){var t=this,i=t.options,n=t.manager.getIdentifier(e),r=t.nipples.get(n),a=t.manager.removeIdentifier(r.identifier);!r||(i.dataOnly||r.hide((function(){"dynamic"===i.mode&&(r.trigger("removed",r),t.trigger("removed "+r.id+":removed",r),t.manager.trigger("removed "+r.id+":removed",r),r.destroy())})),clearInterval(t.pressureIntervals[r.identifier]),r.resetDirection(),r.trigger("end",r),t.trigger("end "+r.id+":end",r),t.ids.indexOf(r.identifier)>=0&&t.ids.splice(t.ids.indexOf(r.identifier),1),t.actives.indexOf(r)>=0&&t.actives.splice(t.actives.indexOf(r),1),/(semi|static)/.test(i.mode)?t.idles.push(r):t.nipples.indexOf(r)>=0&&t.nipples.splice(t.nipples.indexOf(r),1),t.manager.unbindDocument(),/(semi|static)/.test(i.mode)&&(t.manager.ids[a.id]=a.identifier))},I6.prototype.onDestroyed=function(e,t){var i=this;i.nipples.indexOf(t)>=0&&i.nipples.splice(i.nipples.indexOf(t),1),i.actives.indexOf(t)>=0&&i.actives.splice(i.actives.indexOf(t),1),i.idles.indexOf(t)>=0&&i.idles.splice(i.idles.indexOf(t),1),i.ids.indexOf(t.identifier)>=0&&i.ids.splice(i.ids.indexOf(t.identifier),1),i.manager.removeIdentifier(t.identifier),i.manager.unbindDocument()},I6.prototype.destroy=function(){var e=this;for(var t in e.unbindEvt(e.options.zone,"start"),e.nipples.forEach((function(e){e.destroy()})),e.pressureIntervals)e.pressureIntervals.hasOwnProperty(t)&&clearInterval(e.pressureIntervals[t]);e.trigger("destroyed",e.nipples),e.manager.unbindDocument(),e.off()};var R6=I6;function L6(e){var t=this;t.ids={},t.index=0,t.collections=[],t.scroll=v6(),t.config(e),t.prepareCollections();var i=function(){var e;t.collections.forEach((function(i){i.forEach((function(i){e=i.el.getBoundingClientRect(),i.position={x:t.scroll.x+e.left,y:t.scroll.y+e.top}}))}))};if(typeof window>"u")return t.collections;f6(window,"resize",(function(){p6(i)}));var n=function(){t.scroll=v6()};return f6(window,"scroll",(function(){p6(n)})),t.collections}L6.prototype=new D6,L6.constructor=L6,L6.prototype.prepareCollections=function(){var e=this;e.collections.create=e.create.bind(e),e.collections.on=e.on.bind(e),e.collections.off=e.off.bind(e),e.collections.destroy=e.destroy.bind(e),e.collections.get=function(t){var i;return e.collections.every((function(e){return!(i=e.get(t))})),i}},L6.prototype.create=function(e){return this.createCollection(e)},L6.prototype.createCollection=function(e){var t=this,i=new R6(t,e);return t.bindCollection(i),t.collections.push(i),i},L6.prototype.bindCollection=function(e){var t,i=this,n=function(e,n){t=e.type+" "+n.id+":"+e.type,i.trigger(t,n)};e.on("destroyed",i.onDestroyed.bind(i)),e.on("shown hidden rested dir plain",n),e.on("dir:up dir:right dir:down dir:left",n),e.on("plain:up plain:right plain:down plain:left",n)},L6.prototype.bindDocument=function(){var e=this;e.binded||(e.bindEvt(document,"move").bindEvt(document,"end"),e.binded=!0)},L6.prototype.unbindDocument=function(e){var t=this;(!Object.keys(t.ids).length||!0===e)&&(t.unbindEvt(document,"move").unbindEvt(document,"end"),t.binded=!1)},L6.prototype.getIdentifier=function(e){var t;return e?void 0===(t=void 0===e.identifier?e.pointerId:e.identifier)&&(t=this.latest||0):t=this.index,void 0===this.ids[t]&&(this.ids[t]=this.index,this.index+=1),this.latest=t,this.ids[t]},L6.prototype.removeIdentifier=function(e){var t={};for(var i in this.ids)if(this.ids[i]===e){t.id=i,t.identifier=this.ids[i],delete this.ids[i];break}return t},L6.prototype.onmove=function(e){return this.onAny("move",e),!1},L6.prototype.onend=function(e){return this.onAny("end",e),!1},L6.prototype.oncancel=function(e){return this.onAny("end",e),!1},L6.prototype.onAny=function(e,t){var i,n=this,r="processOn"+e.charAt(0).toUpperCase()+e.slice(1);t=g6(t);var a=function(e,t,i){i.ids.indexOf(t)>=0&&(i[r](e),e._found_=!0)};return _6(t,(function(e){i=n.getIdentifier(e),_6(n.collections,a.bind(null,e,i)),e._found_||n.removeIdentifier(i)})),!1},L6.prototype.destroy=function(){var e=this;e.unbindDocument(!0),e.ids={},e.index=0,e.collections.forEach((function(e){e.destroy()})),e.off()},L6.prototype.onDestroyed=function(e,t){var i=this;if(i.collections.indexOf(t)<0)return!1;i.collections.splice(i.collections.indexOf(t),1)};var B6=new L6,z6=function(e){return B6.create(e)},N6=new Map,F6=new Map,j6=class{constructor(e,t,i,n){this.data=t;let{audio:r,volume:a,delay:s,loop:o}=t;if(!r)throw new Error("Missing property");let l="string"==typeof r?n.getAudio(r).src:r.data;this.audioPlayer=new h0({src:l,volume:a,delay:s,loop:o}),F6.has(i.uuid)?F6.get(i.uuid).push(this):F6.set(i.uuid,[this]),N6.set(e,this)}playByToggle(){"stop"===this.data.toggle?"playing"===this.audioPlayer.status?this.audioPlayer.stop():(this.audioPlayer.stop(),this.audioPlayer.play()):"pause"===this.data.toggle?"playing"===this.audioPlayer.status?this.audioPlayer.pause():this.audioPlayer.play():(this.audioPlayer.stop(),this.audioPlayer.play())}dispose(){this.audioPlayer.stop()}},V6=class{constructor(e){this.data=e}dispatch(){this.data.playAudio?this.pauseAudio(this.data.playAudio):this.data.object?this.pauseAllAudiosFromObject(this.data.object):this.pauseAllAudios()}pauseAudio(e){let t=N6.get(e);!t||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout((()=>{t.audioPlayer[this.data.interaction](),this.disposeDelay()}),this.data.delay)):t.audioPlayer[this.data.interaction]())}pauseAllAudiosFromObject(e){let t=F6.get(e);null===t||void 0===t||!t.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout((()=>{t.forEach((e=>e.audioPlayer[this.data.interaction]())),this.disposeDelay()}),this.data.delay)):t.forEach((e=>e.audioPlayer[this.data.interaction]())))}pauseAllAudios(){let e=[...F6.values()];!e.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout((()=>{e.forEach((e=>{e.forEach((e=>{e.audioPlayer[this.data.interaction]()}))})),this.disposeDelay()}),this.data.delay)):e.forEach((e=>{e.forEach((e=>{e.audioPlayer[this.data.interaction]()}))})))}disposeDelay(){clearTimeout(this.timeoutId),delete this.timeoutId}dispose(){clearTimeout(this.timeoutId),delete this.timeoutId}},U6=class{constructor(e,t,i,n,r){if(this.data=t,this.shared=n,this.condition=r,"play"===t.interaction)this.interaction=new j6(e,t,i,n);else{if("pause"!==t.interaction&&"stop"!==t.interaction)throw new Error("Missing property");this.interaction=new V6(t)}}dispatchBasic(){if(!1===W9(this.shared,this.condition))return!1;this.interaction instanceof j6?this.interaction.playByToggle():this.interaction.dispatch()}dispatchConditional(){if(!1===W9(this.shared,this.condition))return!1;this.interaction instanceof j6?this.interaction.audioPlayer.play():this.interaction.dispatch()}dispatchGameControl(e){if(!1===W9(this.shared,this.condition))return!1;this.interaction instanceof j6&&("start"===e?this.interaction.audioPlayer.play():this.interaction.audioPlayer.stop())}dispose(){this.interaction.dispose()}},G6=class{constructor(e,t,i,n){this.data=e,this.page=t,this.shared=i,this.condition=n,this.delay=0,this.emission=e.emission,void 0!==e.delay&&(this.delay=e.delay),this.particleSystem=this.page.scene.find(this.data.emitterObjectId)}toggleEmitting(){this.particleSystem.started&&!this.particleSystem.stopped?this.stop():this.start(this.delay)}toggleFroze(){this.particleSystem.started&&!this.particleSystem.isFrozen?this.freeze():this.unFreeze()}start(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)?this.delayTimerId=window.setTimeout((()=>{this.start(0),this.clearDelay()}),this.delay):this.particleSystem.start()}stop(){this.particleSystem.stop(),this.clearDelay()}freeze(){this.particleSystem.froze(),this.clearDelay()}unFreeze(){this.particleSystem.unFroze(),this.clearDelay()}reset(){this.particleSystem.reset(),this.clearDelay()}reverseFromCurrent(){switch(this.emission){case"emitToggle":this.toggleEmitting();break;case"pauseToggle":this.toggleFroze()}}dispatchBasic(){if(!1===W9(this.shared,this.condition)||!this.particleSystem)return!1;switch(this.emission){case"start":this.start(this.delay);break;case"emitToggle":this.toggleEmitting();break;case"pause":this.freeze();break;case"pauseToggle":this.toggleFroze();break;case"stop":this.stop();break;case"reset":this.reset()}}dispatchConditional(){if(!1===W9(this.shared,this.condition)||!this.particleSystem)return!1;switch(this.emission){case"start":this.particleSystem.start();break;case"stop":this.particleSystem.stop();break;case"reset":this.particleSystem.reset()}}dispatchGameControl(e){if(!1===W9(this.shared,this.condition)||!this.particleSystem)return!1;"start"===e?this.particleSystem.start():this.particleSystem.stop()}dispose(){!this.particleSystem||(this.particleSystem.reset(),this.clearDelay())}clearDelay(){this.delayTimerId&&(clearTimeout(this.delayTimerId),delete this.delayTimerId)}},H6=(e,t)=>t.some((t=>t instanceof RegExp?t.test(e):t===e));function W6(e,t){if(t={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...t},e=e.trim(),/^data:/i.test(e))return((e,t)=>{let{stripHash:i}=t,n=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(e);if(!n)throw new Error("Invalid URL: ".concat(e));let{type:r,data:a,hash:s}=n.groups,o=r.split(";");s=i?"":s;let l=!1;"base64"===o[o.length-1]&&(o.pop(),l=!0);let c=(o.shift()||"").toLowerCase(),h=[...o.map((e=>{let[t,i=""]=e.split("=").map((e=>e.trim()));return"charset"===t&&(i=i.toLowerCase(),"us-ascii"===i)?"":"".concat(t).concat(i?"=".concat(i):"")})).filter(Boolean)];return l&&h.push("base64"),(h.length>0||c&&"text/plain"!==c)&&h.unshift(c),"data:".concat(h.join(";"),",").concat(l?a.trim():a).concat(s?"#".concat(s):"")})(e,t);if(/^view-source:/i.test(e))throw new Error("`view-source:` is not supported as it is a non-standard protocol");let i=e.startsWith("//");!i&&/^\.*\//.test(e)||(e=e.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,t.defaultProtocol));let n=new URL(e);if(t.forceHttp&&t.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(t.forceHttp&&"https:"===n.protocol&&(n.protocol="http:"),t.forceHttps&&"http:"===n.protocol&&(n.protocol="https:"),t.stripAuthentication&&(n.username="",n.password=""),t.stripHash?n.hash="":t.stripTextFragment&&(n.hash=n.hash.replace(/#?:~:text.*?$/i,"")),n.pathname){let e=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g,t=0,i="";for(;;){let r=e.exec(n.pathname);if(!r)break;let a=r[0],s=r.index;i+=n.pathname.slice(t,s).replace(/\/{2,}/g,"/"),i+=a,t=s+a.length}i+=n.pathname.slice(t,n.pathname.length).replace(/\/{2,}/g,"/"),n.pathname=i}if(n.pathname)try{n.pathname=decodeURI(n.pathname)}catch{}if(!0===t.removeDirectoryIndex&&(t.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(t.removeDirectoryIndex)&&t.removeDirectoryIndex.length>0){let e=n.pathname.split("/"),i=e[e.length-1];H6(i,t.removeDirectoryIndex)&&(e=e.slice(0,-1),n.pathname=e.slice(1).join("/")+"/")}if(n.hostname&&(n.hostname=n.hostname.replace(/\.$/,""),t.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(n.hostname)&&(n.hostname=n.hostname.replace(/^www\./,""))),Array.isArray(t.removeQueryParameters))for(let a of[...n.searchParams.keys()])H6(a,t.removeQueryParameters)&&n.searchParams.delete(a);if(!0===t.removeQueryParameters&&(n.search=""),t.sortQueryParameters){n.searchParams.sort();try{n.search=decodeURIComponent(n.search)}catch{}}t.removeTrailingSlash&&(n.pathname=n.pathname.replace(/\/$/,""));let r=e;return e=n.toString(),!t.removeSingleSlash&&"/"===n.pathname&&!r.endsWith("/")&&""===n.hash&&(e=e.replace(/\/$/,"")),(t.removeTrailingSlash||"/"===n.pathname)&&""===n.hash&&t.removeSingleSlash&&(e=e.replace(/\/$/,"")),i&&!t.normalizeProtocol&&(e=e.replace(/^http:\/\//,"//")),t.stripProtocol&&(e=e.replace(/^(?:https?:)?\/\//,"")),e}var q6=class{constructor(e,t,i,n){let{url:r,context:a}=e;if(this.controlsManager=t,this.shared=i,this.condition=n,!r)throw new Error("Missing property");this.url=r.startsWith("mailto:")?r:W6(r,{removeTrailingSlash:!1,removeSingleSlash:!1}),this.context=null!==a&&void 0!==a?a:"tab"}dispatch(){var e;if(!1===W9(this.shared,this.condition))return!1;Aj?window.location.assign(this.url):("tab"===this.context?window.open(this.url,"_blank"):"window"===this.context?window.open(this.url,"_blank","width=".concat(window.innerWidth,", height=").concat(window.innerHeight)):window.open(this.url,"_parent"),null!==(e=this.controlsManager.orbitControls)&&void 0!==e&&e.onPointerUp(Rj[0]),Rj.splice(0,Rj.length))}},X6=class{constructor(e,t,i,n,r){this.data=e,this.page=t,this.controlsManager=i,this.shared=n,this.condition=r,this.timeoutIdQueue=[],this.dispatchInner=()=>{this.objects.forEach(this.destroyCallback)},this.destroyCallback=e=>{var t;this.timeoutIdQueue.shift();let i=this.page.scene.find(e);if(void 0===i)return;let n=this.controlsManager.sharedGameControlGlobals.rapierWorld,r=!n||(null===(t=i.dataPatched.physics)||void 0===t?void 0:t.fusedBody);if(i.cloner){for(let e of i.cloner.children){var a;r?(e.playModeVisible=!1,e.rigidBody&&"positioned"===(null===(a=i.dataPatched.physics)||void 0===a?void 0:a.rigidBody)&&(this.controlsManager.sharedGameControlGlobals.colliderToEntity.delete(e.rigidBody.collider(0).handle),n.removeRigidBody(e.rigidBody),e.rigidBody=void 0),e.bvhGeometry&&(e.bvhGeometry=void 0)):void 0===this.clone||this.clone===e?(e.playModeVisible=!1,e.rigidBody&&(this.controlsManager.sharedGameControlGlobals.colliderToEntity.delete(e.rigidBody.collider(0).handle),n.removeRigidBody(e.rigidBody),e.rigidBody=void 0)):void 0===e.playModeVisible&&(e.playModeVisible=!0)}(r||void 0===this.clone||!1===this.clone)&&(i.visible=!1,i.rigidBody&&(this.controlsManager.sharedGameControlGlobals.colliderToEntity.delete(i.rigidBody.collider(0).handle),n.removeRigidBody(i.rigidBody),i.rigidBody=void 0),i.bvhGeometry&&(i.bvhGeometry=void 0))}else i.rigidBody&&(this.controlsManager.sharedGameControlGlobals.colliderToEntity.delete(i.rigidBody.collider(0).handle),n.removeRigidBody(i.rigidBody),i.rigidBody=void 0),i.bvhGeometry&&(i.bvhGeometry=void 0),i.visible=!1;this.controlsManager.sharedGameControlGlobals.entitiesWithTransformAnim=void 0===n?this.controlsManager.sharedGameControlGlobals.entitiesWithTransformAnim.filter((e=>void 0!==e.bvhGeometry)):this.controlsManager.sharedGameControlGlobals.entitiesWithTransformAnim.filter((e=>void 0!==e.rigidBody)),i.destroyedInAction=!0,this.controlsManager.requestRender()},this.objects=[...e.objects]}dispatch(e){if(!1===W9(this.shared,this.condition))return!1;this.clone=e,this.data.delay?this.timeoutIdQueue.push(window.setTimeout(this.dispatchInner,1e3*this.data.delay)):this.dispatchInner()}dispatchFromStart(){if(!1===W9(this.shared,this.condition))return!1;this.timeoutIdQueue.push(window.setTimeout(this.dispatchInner,1e3*this.data.delay))}dispose(){this.timeoutIdQueue.forEach((e=>window.clearTimeout(e)))}},Y6=class{constructor(e,t,i,n,r){this.data=e,this.page=t,this.shared=i,this.eventManager=n,this.condition=r,this.shared=i}dispatch(){var e;if(!1===W9(this.shared,this.condition))return!1;clearTimeout(this.timeoutId),delete this.timeoutId,this.timeoutId=window.setTimeout((()=>{var e;this.shared.reset(this.shared.data,!0),M9(this.page,this.shared,!0),this.eventManager.reset(),null!==(e=this.eventManager.controlsManager.gameControl)&&void 0!==e&&e.reset(!0),this.page.switchToPlayCamera(),this.eventManager.controlsManager.requestRender(),delete this.timeoutId}),1e3*(null!==(e=this.data.delay)&&void 0!==e?e:0))}dispose(){clearTimeout(this.timeoutId),delete this.timeoutId}},Q6={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,timelineChangeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0,rewind:!0},Z6={duration:1e3,delay:0,endDelay:0,startOnceDelay:0,pingPongDelayCorrection:0,pingPongEndDelayCorrection:0,easing:"easeOutElastic(1, .5)",round:0},K6=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],J6={CSS:{},springs:{}};function $6(e,t,i){return Math.min(Math.max(e,t),i)}function e8(e,t){return e.indexOf(t)>-1}function t8(e,t){return e.apply(null,t)}var i8={arr:function(e){return Array.isArray(e)},obj:function(e){return e8(Object.prototype.toString.call(e),"Object")},pth:function(e){return i8.obj(e)&&e.hasOwnProperty("totalLength")},svg:function(e){return e instanceof SVGElement},inp:function(e){return e instanceof HTMLInputElement},dom:function(e){return!("isNode"in e)&&(e.nodeType||i8.svg(e))},str:function(e){return"string"==typeof e},fnc:function(e){return"function"==typeof e},und:function(e){return typeof e>"u"},hex:function(e){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e)},rgb:function(e){return/^rgb/.test(e)},hsl:function(e){return/^hsl/.test(e)},col:function(e){return i8.hex(e)||i8.rgb(e)||i8.hsl(e)},key:function(e){return!Q6.hasOwnProperty(e)&&!Z6.hasOwnProperty(e)&&"targets"!==e&&"keyframes"!==e}};function n8(e){var t=/\(([^)]+)\)/.exec(e);return t?t[1].split(",").map((function(e){return parseFloat(e)})):[]}function r8(e,t){var i=n8(e),n=$6(i8.und(i[0])?1:i[0],.1,100),r=$6(i8.und(i[1])?100:i[1],.1,100),a=$6(i8.und(i[2])?10:i[2],.1,100),s=$6(i8.und(i[3])?0:i[3],.1,100),o=Math.sqrt(r/n),l=a/(2*Math.sqrt(r*n)),c=l<1?o*Math.sqrt(1-l*l):0,h=1,u=l<1?(l*o-s)/c:-s+o;function d(e){var i=t?t*e/1e3:e;return i=l<1?Math.exp(-i*l*o)*(h*Math.cos(c*i)+u*Math.sin(c*i)):(h+u*i)*Math.exp(-i*o),0===e||1===e?e:1-i}return t?d:function(){var t=J6.springs[e];if(t)return t;for(var i=1/6,n=0,r=0;;)if(1===d(n+=i)){if(++r>=16)break}else r=0;var a=n*i*1e3;return J6.springs[e]=a,a}}function a8(e){return void 0===e&&(e=10),function(t){return Math.ceil($6(t,1e-6,1)*e)*(1/e)}}var s8=function(){var e=.1;function t(e,t){return 1-3*t+3*e}function i(e,t){return 3*t-6*e}function n(e){return 3*e}function r(e,r,a){return((t(r,a)*e+i(r,a))*e+n(r))*e}function a(e,r,a){return 3*t(r,a)*e*e+2*i(r,a)*e+n(r)}return function(t,i,n,s){if(0<=t&&t<=1&&0<=n&&n<=1){var o=new Float32Array(11);if(t!==i||n!==s)for(var l=0;l<11;++l)o[l]=r(l*e,t,n);return function(e){return t===i&&n===s||0===e||1===e?e:r(c(e),i,s)}}function c(i){for(var s=0,l=1;10!==l&&o[l]<=i;++l)s+=e;--l;var c=s+(i-o[l])/(o[l+1]-o[l])*e,h=a(c,t,n);return h>=.001?function(e,t,i,n){for(var s=0;s<4;++s){var o=a(t,i,n);if(0===o)return t;t-=(r(t,i,n)-e)/o}return t}(i,c,t,n):0===h?c:function(e,t,i,n,a){var s,o,l=0;do{(s=r(o=t+(i-t)/2,n,a)-e)>0?i=o:t=o}while(Math.abs(s)>1e-7&&++l<10);return o}(i,s,s+e,t,n)}}}(),o8=function(){var e={linear:function(){return function(e){return e}}},t={Sine:function(){return function(e){return 1-Math.cos(e*Math.PI/2)}},Circ:function(){return function(e){return 1-Math.sqrt(1-e*e)}},Back:function(){return function(e){return e*e*(3*e-2)}},Bounce:function(){return function(e){for(var t,i=4;e<((t=Math.pow(2,--i))-1)/11;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-e,2)}},Elastic:function(e,t){void 0===e&&(e=1),void 0===t&&(t=.5);var i=$6(e,1,10),n=$6(t,.1,2);return function(e){return 0===e||1===e?e:-i*Math.pow(2,10*(e-1))*Math.sin((e-1-n/(2*Math.PI)*Math.asin(1/i))*(2*Math.PI)/n)}}};return["Quad","Cubic","Quart","Quint","Expo"].forEach((function(e,i){t[e]=function(){return function(e){return Math.pow(e,i+2)}}})),Object.keys(t).forEach((function(i){var n=t[i];e["easeIn"+i]=n,e["easeOut"+i]=function(e,t){return function(i){return 1-n(e,t)(1-i)}},e["easeInOut"+i]=function(e,t){return function(i){return i<.5?n(e,t)(2*i)/2:1-n(e,t)(-2*i+2)/2}}})),e}();function l8(e,t){if(i8.fnc(e))return e;var i=e.split("(")[0],n=o8[i],r=n8(e);switch(i){case"spring":return r8(e,t);case"cubicBezier":return t8(s8,r);case"steps":return t8(a8,r);default:return t8(n,r)}}function c8(e){try{return document.querySelectorAll(e)}catch{return}}function h8(e,t){for(var i=e.length,n=arguments.length>=2?arguments[1]:void 0,r=[],a=0;a<i;a++)if(a in e){var s=e[a];t.call(n,s,a,e)&&r.push(s)}return r}function u8(e){return e.reduce((function(e,t){return e.concat(i8.arr(t)?u8(t):t)}),[])}function d8(e){return i8.arr(e)?e:(i8.str(e)&&(e=c8(e)||e),e instanceof NodeList||e instanceof HTMLCollection?[].slice.call(e):[e])}function p8(e,t){return e.some((function(e){return e===t}))}function f8(e){var t={};for(var i in e)t[i]=e[i];return t}function m8(e,t){var i=f8(e);for(var n in e)i[n]=t.hasOwnProperty(n)?t[n]:e[n];return i}function g8(e,t){var i=f8(e);for(var n in t)i[n]=i8.und(e[n])?t[n]:e[n];return i}function v8(e){return i8.rgb(e)?function(e){var t=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(e);return t?"rgba("+t[1]+",1)":e}(e):i8.hex(e)?function(e){var t=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,i,n){return t+t+i+i+n+n})),i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return"rgba("+parseInt(i[1],16)+","+parseInt(i[2],16)+","+parseInt(i[3],16)+",1)"}(e):i8.hsl(e)?function(e){var t,i,n,r=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(e),a=parseInt(r[1],10)/360,s=parseInt(r[2],10)/100,o=parseInt(r[3],10)/100,l=r[4]||1;function c(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}if(0==s)t=i=n=o;else{var h=o<.5?o*(1+s):o+s-o*s,u=2*o-h;t=c(u,h,a+1/3),i=c(u,h,a),n=c(u,h,a-1/3)}return"rgba("+255*t+","+255*i+","+255*n+","+l+")"}(e):void 0}function y8(e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(e);if(t)return t[1]}function b8(e,t){return i8.fnc(e)?e(t.target,t.id,t.total):e}function x8(e,t){return e.getAttribute(t)}function w8(e,t,i){if(p8([i,"deg","rad","turn"],y8(t)))return t;var n=J6.CSS[t+i];if(!i8.und(n))return n;var r=document.createElement(e.tagName),a=e.parentNode&&e.parentNode!==document?e.parentNode:document.body;a.appendChild(r),r.style.position="absolute",r.style.width=100+i;var s=100/r.offsetWidth;a.removeChild(r);var o=s*parseFloat(t);return J6.CSS[t+i]=o,o}function _8(e,t,i){if(t in e.style){var n=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=e.style[t]||getComputedStyle(e).getPropertyValue(n)||"0";return i?w8(e,r,i):r}}function S8(e,t){return i8.dom(e)&&!i8.inp(e)&&(x8(e,t)||i8.svg(e)&&e[t])?"attribute":i8.dom(e)&&p8(K6,t)?"transform":i8.dom(e)&&"transform"!==t&&_8(e,t)?"css":null!=e[t]?"object":void 0}function E8(e){if(i8.dom(e)){for(var t,i=e.style.transform||"",n=/(\w+)\(([^)]*)\)/g,r=new Map;t=n.exec(i);)r.set(t[1],t[2]);return r}}function C8(e,t,i,n){var r=e8(t,"scale")?1:0+function(e){return e8(e,"translate")||"perspective"===e?"px":e8(e,"rotate")||e8(e,"skew")?"deg":void 0}(t),a=E8(e).get(t)||r;return i&&(i.transforms.list.set(t,a),i.transforms.last=t),n?w8(e,a,n):a}function A8(e,t,i,n){switch(S8(e,t)){case"transform":return C8(e,t,n,i);case"css":return _8(e,t,i);case"attribute":return x8(e,t);default:return e[t]||0}}function M8(e,t){var i=/^(\*=|\+=|-=)/.exec(e);if(!i)return e;var n=y8(e)||0,r=parseFloat(t),a=parseFloat(e.replace(i[0],""));switch(i[0][0]){case"+":return r+a+n;case"-":return r-a+n;case"*":return r*a+n}}function T8(e,t){if(i8.col(e))return v8(e);if(/\s/g.test(e))return e;var i=y8(e),n=i?e.substr(0,e.length-i.length):e;return t?n+t:n}function P8(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function D8(e){for(var t,i=e.points,n=0,r=0;r<i.numberOfItems;r++){var a=i.getItem(r);r>0&&(n+=P8(t,a)),t=a}return n}function k8(e){if(e.getTotalLength)return e.getTotalLength();switch(e.tagName.toLowerCase()){case"circle":return function(e){return 2*Math.PI*x8(e,"r")}(e);case"rect":return function(e){return 2*x8(e,"width")+2*x8(e,"height")}(e);case"line":return function(e){return P8({x:x8(e,"x1"),y:x8(e,"y1")},{x:x8(e,"x2"),y:x8(e,"y2")})}(e);case"polyline":return D8(e);case"polygon":return function(e){var t=e.points;return D8(e)+P8(t.getItem(t.numberOfItems-1),t.getItem(0))}(e)}}function O8(e,t){var i=t||{},n=i.el||function(e){for(var t=e.parentNode;i8.svg(t)&&i8.svg(t.parentNode);)t=t.parentNode;return t}(e),r=n.getBoundingClientRect(),a=x8(n,"viewBox"),s=r.width,o=r.height,l=i.viewBox||(a?a.split(" "):[0,0,s,o]);return{el:n,viewBox:l,x:l[0]/1,y:l[1]/1,w:s/l[2],h:o/l[3]}}function I8(e,t){function i(i){void 0===i&&(i=0);var n=t+i>=1?t+i:0;return e.el.getPointAtLength(n)}var n=O8(e.el,e.svg),r=i(),a=i(-1),s=i(1);switch(e.property){case"x":return(r.x-n.x)*n.w;case"y":return(r.y-n.y)*n.h;case"angle":return 180*Math.atan2(s.y-a.y,s.x-a.x)/Math.PI}}function R8(e,t){var i=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,n=T8(i8.pth(e)?e.totalLength:e,t)+"";return{original:n,numbers:n.match(i)?n.match(i).map(Number):[0],strings:i8.str(e)||t?n.split(i):[]}}function L8(e){return h8(e?u8(i8.arr(e)?e.map(d8):d8(e)):[],(function(e,t,i){return i.indexOf(e)===t}))}function B8(e){var t=L8(e);return t.map((function(e,i){return{target:e,id:i,total:t.length,transforms:{list:E8(e)}}}))}function z8(e,t){var i=f8(t);if(/^spring/.test(i.easing)&&(i.duration=r8(i.easing)),i8.arr(e)){var n=e.length;2===n&&!i8.obj(e[0])?e={value:e}:i8.fnc(t.duration)||(i.duration=t.duration/n)}var r=i8.arr(e)?e:[e];return r.map((function(e,i){var n=i8.obj(e)&&!i8.pth(e)?e:{value:e};return i8.und(n.delay)&&(n.delay=i?0:t.delay),i8.und(n.endDelay)&&(n.endDelay=i===r.length-1?t.endDelay:0),n})).map((function(e){return g8(e,i)}))}function N8(e,t){var i=[],n=t.keyframes;for(var r in n&&(t=g8(function(e){for(var t=h8(u8(e.map((function(e){return Object.keys(e)}))),(function(e){return i8.key(e)})).reduce((function(e,t){return e.indexOf(t)<0&&e.push(t),e}),[]),i={},n=function(n){var r=t[n];i[r]=e.map((function(e){var t={};for(var i in e)i8.key(i)?i==r&&(t.value=e[i]):t[i]=e[i];return t}))},r=0;r<t.length;r++)n(r);return i}(n),t)),t)i8.key(r)&&i.push({name:r,tweens:z8(t[r],e)});return i}function F8(e,t){var i;return e.tweens.map((function(n){var r=function(e,t){var i={};for(var n in e){var r=b8(e[n],t);i8.arr(r)&&(r=r.map((function(e){return b8(e,t)})),1===r.length&&(r=r[0])),i[n]=r}return i.duration=parseFloat(i.duration),i.delay=parseFloat(i.delay),i}(n,t),a=r.value,s=i8.arr(a)?a[1]:a,o=y8(s),l=A8(t.target,e.name,o,t),c=i?i.to.original:l,h=i8.arr(a)?a[0]:c,u=y8(h)||y8(l),d=o||u;return i8.und(s)&&(s=c),r.from=R8(h,d),r.to=R8(M8(s,h),d),r.start=i?i.end:0,r.end=r.start+r.delay+r.duration+r.endDelay,r.easing=l8(r.easing,r.duration),r.isPath=i8.pth(a),r.isColor=i8.col(r.from.original),r.isColor&&(r.round=1),i=r,r}))}var j8={css:function(e,t,i){return e.style[t]=i},attribute:function(e,t,i){return e.setAttribute(t,i)},object:function(e,t,i){return e[t]=i},transform:function(e,t,i,n,r){if(n.list.set(t,i),t===n.last||r){var a="";n.list.forEach((function(e,t){a+=t+"("+e+") "})),e.style.transform=a}}};function V8(e,t){B8(e).forEach((function(e){for(var i in t){var n=b8(t[i],e),r=e.target,a=y8(n),s=A8(r,i,a,e),o=M8(T8(n,a||y8(s)),s),l=S8(r,i);j8[l](r,i,o,e.transforms,!0)}}))}function U8(e,t){return h8(u8(e.map((function(e){return t.map((function(t){return function(e,t){var i=S8(e.target,t.name);if(i){var n=F8(t,e),r=n[n.length-1];return{type:i,property:t.name,animatable:e,tweens:n,duration:r.end,delay:n[0].delay,endDelay:r.endDelay}}}(e,t)}))}))),(function(e){return!i8.und(e)}))}function G8(e,t){var i=e.length,n=function(e){return e.timelineOffset?e.timelineOffset:0},r={};return r.duration=i?Math.max.apply(Math,e.map((function(e){var t,i,r,a;let s=null!==(t=e.startOnceDelay)&&void 0!==t?t:0,o=null!==(i=e.pingPongDelayCorrection)&&void 0!==i?i:0,l=null!==(r=e.pingPongEndDelayCorrection)&&void 0!==r?r:0;return n(e)+s+o+l+e.duration*(null!==(a=e.loop)&&void 0!==a?a:1)}))):t.duration,r.delay=i?Math.min.apply(Math,e.map((function(e){var t,i;let r=null!==(t=e.startOnceDelay)&&void 0!==t?t:0,a=null!==(i=e.pingPongDelayCorrection)&&void 0!==i?i:0;return n(e)+r+a+e.delay}))):t.delay,r.endDelay=i?r.duration-Math.max.apply(Math,e.map((function(e){var t,i,r,a;let s=null!==(t=e.startOnceDelay)&&void 0!==t?t:0,o=null!==(i=e.pingPongDelayCorrection)&&void 0!==i?i:0,l=null!==(r=e.pingPongEndDelayCorrection)&&void 0!==r?r:0;return n(e)+s+o+e.duration*(null!==(a=e.loop)&&void 0!==a?a:1)-e.endDelay-l}))):t.endDelay,r}var H8=0;var W8,q8=[],X8=[],Y8=function(){function e(){W8=requestAnimationFrame(t)}function t(t){var i=q8.length;if(i){for(var n=0;n<i;){var r=q8[n];r.paused?(q8.splice(n,1),i-=1):(r.tick(t),n++)}e()}else W8=cancelAnimationFrame(W8)}return e}();function Q8(e){void 0===e&&(e={});var t,i,n=0,r=0,a=0,s=0,o=null;function l(e){var t=window.Promise&&new Promise((function(e){return o=e}));return e.finished=t,t}var c=function(e){var t=m8(Q6,e),i=m8(Z6,e),n=N8(i,e),r=B8(e.targets),a=U8(r,n),s=G8(a,i),o=H8;return H8++,g8(t,{id:o,children:[],animatables:r,animations:a,duration:s.duration,delay:s.delay,endDelay:s.endDelay,startOnceDelay:i.startOnceDelay,pingPongDelayCorrection:i.pingPongDelayCorrection,pingPongEndDelayCorrection:i.pingPongEndDelayCorrection})}(e);l(c);function h(){var e=c.direction;"alternate"!==e&&(c.direction="normal"!==e?"normal":"reverse"),c.reversed=!c.reversed,i.forEach((function(e){(1===e.loop||e.loop%2===0)&&(e.reversed=c.reversed)}))}function u(e){return c.reversed?c.duration-e:e}function d(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t&&(c.reversed?t.seek(t.duration*t.loop-(e-t.timelineOffset-t.pingPongDelayCorrection),i):t.seek(e-t.timelineOffset-t.startOnceDelay-t.pingPongDelayCorrection,i))}function p(e){var t=0,i=c.animations,n=i.length;for("alternate"!==c.direction&&"alternate"===(null===(r=c.parent)||void 0===r?void 0:r.direction)?!1===(null===(a=c.parent)||void 0===a?void 0:a.rewind)&&!0===c.reversePlayback&&!1===c.rewind&&(e=null!==(s=c.parent)&&void 0!==s&&s.reversed&&"alternate"===c.direction?c.duration-c.delay+c.endDelay-e:c.duration+c.delay-c.endDelay-e):g(!1,null===(o=c.parent)||void 0===o?void 0:o.rewind,c.rewind,null===(l=c.parent)||void 0===l?void 0:l.reversePlayback,c.reversePlayback)&&(e=null!==(h=c.parent)&&void 0!==h&&h.reversed&&"alternate"===c.direction?c.duration-c.delay+c.endDelay-e:c.duration+c.delay-c.endDelay-e);t<n;){var r,a,s,o,l,h,u,d=i[t],p=d.animatable,f=d.tweens,m=f.length-1,v=f[m];let n;m&&(v=h8(f,(function(t){return e<t.end}))[0]||v),n=null!==(u=c.parent)&&void 0!==u&&u.reversed&&"alternate"===c.direction?$6(e-v.start-v.endDelay,0,v.duration)/v.duration:$6(e-v.start-v.delay,0,v.duration)/v.duration;for(var y=isNaN(n)?1:v.easing(n),b=v.to.strings,x=v.round,w=[],_=v.to.numbers.length,S=void 0,E=0;E<_;E++){var C,A,M,T=void 0;let e,t;"alternate"!==c.direction?!1===(null===(C=c.parent)||void 0===C?void 0:C.rewind)&&!0===c.reversePlayback&&!1===c.rewind?(e=v.to.numbers[E],t=v.from.numbers[E]||0):(t=v.to.numbers[E],e=v.from.numbers[E]||0):g(!0,null===(A=c.parent)||void 0===A?void 0:A.rewind,c.rewind,null===(M=c.parent)||void 0===M?void 0:M.reversePlayback,c.reversePlayback)?(e=v.to.numbers[E],t=v.from.numbers[E]||0):(t=v.to.numbers[E],e=v.from.numbers[E]||0),T=v.isPath?I8(v.value,y*t):e+y*(t-e),x&&(v.isColor&&E>2||(T=Math.round(T*x)/x)),w.push(T)}var P=b.length;if(P){S=b[0];for(var D=0;D<P;D++){b[D];var k=b[D+1],O=w[D];isNaN(O)||(S+=k?O+k:O+" ")}}else S=w[0];j8[d.type](p.target,d.property,S,p.transforms),d.currentValue=S,t++}}function f(e){c[e]&&!c.passThrough&&c[e](c)}let m={0:!1,1:!0,2:!1,3:!0,4:!1,5:!1,6:!1,7:!1,8:!1,9:!0,10:!0,11:!1,12:!1,13:!1,14:!0,15:!0,16:!1,17:!0,18:!0,19:!1,20:!1,21:!1,22:!0,23:!0,24:!1,25:!0,26:!1,27:!0,28:!1,29:!1,30:!1,31:!1};function g(e,t,i,n,r){return m[e<<4|t<<3|i<<2|n<<1|r]}function v(e){var t;let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var a=c.duration;let m=c.delay,g=a-c.endDelay;(null===(t=c.parent)||void 0===t?void 0:t.reversed)&&"alternate"===c.direction&&(m=c.endDelay,g=a-c.delay);var v=u(e);if(c.progress=$6(v/a*100,0,100),r||(c.reversePlayback=v<c.currentTime),s&&function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(c.reversed)for(var n=s;n--;)d(e,i[n],t);else for(var r=0;r<s;r++)d(e,i[r],t)}(v,r),!c.began&&c.currentTime>=0&&(c.began=!0,f("begin")),!c.loopBegan&&c.currentTime>0&&(c.loopBegan=!0,f("loopBegin")),(c.reversed||v>=0)&&v<=m&&0!==c.currentTime&&(p(0),f("change")),(v>=g&&c.currentTime!==a+c.pingPongDelayCorrection||!a)&&(p(a),f("change")),v>m&&v<g?(c.changeBegan||(c.changeBegan=!0,c.changeCompleted=!1,f("changeBegin")),p(v),f("change")):c.changeBegan?(c.changeCompleted=!0,c.changeBegan=!1,f("change"),s&&f("timelineChangeComplete")):c.began&&v>g&&f("changeComplete"),c.currentTime=$6(v,0,a+c.pingPongDelayCorrection),c.began&&f("update"),e>=a)if(c.remaining&&!0!==c.remaining&&c.remaining--,c.remaining){n+=s?c.duration/Q8.speed:c.duration;for(let e of i)e.setStartTime(0),e.remaining=e.loop;f("loopComplete"),c.loopBegan=!1,"alternate"===c.direction?h():s&&(c.direction="normal",c.reversed=!1,i.forEach((function(e){return e.reversed=!1})))}else c.paused=!0,c.completed||(c.completed=!0,f("loopComplete"),f("complete"),!c.passThrough&&"Promise"in window&&(o(),l(c)))}return c.reset=function(){var e=c.direction;c.passThrough=!1,c.currentTime=0,c.progress=0,c.paused=!0,c.began=!1,c.loopBegan=!1,c.changeBegan=!1,c.completed=!1,c.changeCompleted=!1,c.reversePlayback=!1,c.reversed="reverse"===e,c.remaining=c.loop,i=c.children;for(var t=s=i.length;t--;)c.children[t].reset();p(c.reversed?c.duration:0)},c.setStartTime=function(e){n=e},c.set=function(e,t){return V8(e,t),c},c.tick=function(e){a=e,n||(n=a),v((a+(r-n))*Q8.speed)},c.seek=function(e){v(e-n,arguments.length>1&&void 0!==arguments[1]&&arguments[1])},c.pause=function(e){c.paused=!0,s&&(t=null!==e&&void 0!==e?e:performance.now())},c.play=function(e){!c.paused||(c.completed&&c.reset(),c.paused=!1,q8.push(c),s&&void 0!==t&&(n+=(null!==e&&void 0!==e?e:performance.now())-t),W8||Y8())},c.reverse=function(){h(),c.completed=!c.reversed,n=0,r=u(c.currentTime)*(1/Q8.speed)},c.restart=function(){c.reset(),c.play()},c.reset(),c.autoplay&&c.play(),c}function Z8(e,t){for(var i=t.length;i--;)p8(e,t[i].animatable.target)&&t.splice(i,1)}typeof document<"u"&&document.addEventListener("visibilitychange",(function(e){document.hidden?(q8.forEach((function(t){return t.pause(e.timeStamp)})),X8=q8.slice(0),Q8.running=q8=[]):X8.forEach((function(t){return t.play(e.timeStamp)}))})),Q8.version="3.2.0",Q8.speed=1,Q8.running=q8,Q8.remove=function(e){for(var t=L8(e),i=q8.length;i--;){var n=q8[i],r=n.animations,a=n.children;Z8(t,r);for(var s=a.length;s--;){var o=a[s],l=o.animations;Z8(t,l),!l.length&&!o.children.length&&a.splice(s,1)}!r.length&&!a.length&&n.pause()}},Q8.get=A8,Q8.set=V8,Q8.convertPx=w8,Q8.path=function(e,t){var i=i8.str(e)?c8(e)[0]:e,n=t||100;return function(e){return{property:e,el:i,svg:O8(i),totalLength:k8(i)*(n/100)}}},Q8.setDashoffset=function(e){var t=k8(e);return e.setAttribute("stroke-dasharray",t),t},Q8.stagger=function(e,t){void 0===t&&(t={});var i=t.direction||"normal",n=t.easing?l8(t.easing):null,r=t.grid,a=t.axis,s=t.from||0,o="first"===s,l="center"===s,c="last"===s,h=i8.arr(e),u=parseFloat(h?e[0]:e),d=h?parseFloat(e[1]):0,p=y8(h?e[1]:e)||0,f=t.start||0+(h?u:0),m=[],g=0;return function(e,t,v){if(o&&(s=0),l&&(s=(v-1)/2),c&&(s=v-1),!m.length){for(var y=0;y<v;y++){if(r){var b=l?(r[0]-1)/2:s%r[0],x=l?(r[1]-1)/2:Math.floor(s/r[0]),w=b-y%r[0],_=x-Math.floor(y/r[0]),S=Math.sqrt(w*w+_*_);"x"===a&&(S=-w),"y"===a&&(S=-_),m.push(S)}else m.push(Math.abs(s-y));g=Math.max.apply(Math,m)}n&&(m=m.map((function(e){return n(e/g)*g}))),"reverse"===i&&(m=m.map((function(e){return a?e<0?-1*e:-e:Math.abs(g-e)})))}return f+(h?(d-u)/g:u)*(Math.round(100*m[t])/100)+p}},Q8.timeline=function(e){void 0===e&&(e={});var t=Q8(e);return t.duration=0,t.add=function(i,n){var r=q8.indexOf(t),a=t.children;function s(e){e.passThrough=!0}r>-1&&q8.splice(r,1);for(var o=0;o<a.length;o++)s(a[o]);var l=g8(i,m8(Z6,e));l.targets=l.targets||e.targets;var c=t.duration;l.autoplay=!1,l.timelineOffset=i8.und(n)?c:M8(n,c),s(t);var h=Q8(l);s(h),a.push(h),h.parent=t;var u=G8(a,e);return t.delay=u.delay,t.endDelay=u.endDelay,t.duration=u.duration,!0===h.loop&&(t.duration=1/0),t.seek(0),t.reset(),t.autoplay&&t.play(),t},t},Q8.easing=l8,Q8.penner=o8,Q8.random=function(e,t){return Math.floor(Math.random()*(t-e+1))+e};var K8=Q8,J8=new FA,$8=new FA,e9=new NA;function t9(e,t,i,n,r,a){var s,o;let l=i[e]?i[e]:void 0,c=n[e];if(null==c)return;let h=null!=l?"string"==typeof l?Number(null!==(s=r.getVariable(l))&&void 0!==s?s:0):l:t[e],u="string"==typeof c?Number(null!==(o=r.getVariable(c))&&void 0!==o?o:0):c;return h!==u?{update:i=>{let n=cA.lerp(h,u,i);t[e]=a?Math.trunc(n):n},start:()=>{t[e]=h},end:()=>{t[e]=u}}:void 0}function i9(e,t,i,n,r,a){let s=i[e]?i[e]:void 0,o=n[e];if(!o)return;let l=t[e],c=[...null!==s&&void 0!==s?s:l].map((e=>{var t;return"string"==typeof e?Number(null!==(t=r.getVariable(e))&&void 0!==t?t:0):e})),h=[...o].map((e=>{var t;return"string"==typeof e?Number(null!==(t=r.getVariable(e))&&void 0!==t?t:0):e}));return c.length!==h.length||dj(c,h)?void 0:{update:i=>{c.forEach(((n,r)=>{let s=cA.lerp(n,h[r],i);t[e][r]=a?Math.trunc(s):s}))},start:()=>{Object.assign(t[e],c)},end:()=>{Object.assign(t[e],h)}}}function n9(e,t,i){return t.forEach(((t,n)=>{var r;e.setComponent(n,"string"==typeof t?Number(null!==(r=i.getVariable(t))&&void 0!==r?r:0):t)})),e}function r9(e,t,i,n,r){let a=i[e]?i[e]:void 0,s=n[e];if(!s)return;let o=t[e],l=a?n9(new FA,a,r):o.clone(),c=n9(new FA,s,r);return l.equals(c)?void 0:{update:e=>{o.lerpVectors(l,c,e)},start:()=>{o.copy(l)},end:()=>{o.copy(c)}}}function a9(e,t,i){return t.forEach(((t,n)=>{var r;e.setComponent(n,"string"==typeof t?Number(null!==(r=i.getVariable(t))&&void 0!==r?r:0):t)})),e}function s9(e,t,i,n,r){let a=i[e]?i[e]:void 0,s=n[e];if(!s)return;let o=t[e],l=!(o instanceof hA),c=o instanceof hA?o:(new hA).fromArray(o),h=a?a9(new hA,a,r):c.clone(),u=a9(new hA,s,r);return h.equals(u)?void 0:{update:i=>{c.lerpVectors(h,u,i),l&&(t[e]=c.toArray())},start:()=>{c.copy(h),l&&(t[e]=c.toArray())},end:()=>{c.copy(u),l&&(t[e]=c.toArray())}}}function o9(e,t,i,n,r){let a=i[e]?i[e]:void 0,s=n[e];if(!s)return;let o=t[e],l=new CK(o.r,o.g,o.b,o.a),c=a?"string"==typeof a?r.getColor(a).clone():new CK(a.r,a.g,a.b,a.a):l.clone(),h="string"==typeof s?r.getColor(s).clone():new CK(s.r,s.g,s.b,s.a);return c.equals(h)?void 0:{update:i=>{l.lerpColors(c,h,i);let n=cA.lerp(c.a,h.a,i);l.a=n,t[e]={r:l.r,g:l.g,b:l.b,a:l.a}},start:()=>{l.copy(c)},end:()=>{l.copy(h)}}}function l9(e,t,i,n,r){return"number"==typeof t[e]?t9(e,t,null!==i&&void 0!==i?i:{},n,r):Array.isArray(t[e])?i9(e,t,null!==i&&void 0!==i?i:{},n,r):void 0}function c9(e,t,i,n){let r=[];if(!("geometry"in i))return r;let a=e.geometry.userData.parameters,s="geometry"in t?t.geometry:{},o=i.geometry;if(e instanceof z0){let t=function(e,t,i,n){var r;if(void 0===i.scaleBaked)return;let a=(null!==(r=t.scaleBaked)&&void 0!==r?r:e.data.geometry.scaleBaked).map((e=>{var t;return"string"==typeof e?Number(null!==(t=n.getVariable(e))&&void 0!==t?t:0):e})),s=i.scaleBaked.map((e=>{var t;return"string"==typeof e?Number(null!==(t=n.getVariable(e))&&void 0!==t?t:0):e}));if(IG.isEqual(a,s))return;let o=[];return o.push({update:t=>{e.updateGeometryInteractions({scaleBaked:[cA.lerp(a[0],s[0],t),cA.lerp(a[1],s[1],t),cA.lerp(a[2],s[2],t)]},n),e.invalidateDownstreamBooleanData()},start:()=>{e.updateGeometryInteractions({scaleBaked:a},n),e.invalidateDownstreamBooleanData()},end:()=>{e.updateGeometryInteractions({scaleBaked:s},n),e.invalidateDownstreamBooleanData()}}),o}(e,s,o,n);t&&r.push(...t)}else{let t={};if(Object.assign(t,wj(a,pW)),pW.forEach((e=>{let i=l9(e,t,s,o,n);i&&r.push(i)})),e instanceof Z4){Object.assign(t,{extrusion:{...a.extrusion}});let e=function(e,t,i,n){var r;if(!i.extrusion)return;let a=e.extrusion,s=null!==(r=t.extrusion)&&void 0!==r?r:{},o=i.extrusion,l=[];return CH.forEach((e=>{let t=l9(e,a,s,o,n);t&&l.push(t)})),l}(t,s,o,n);e&&r.push(...e)}r.length&&r.push({update:i=>{e.updateGeometryInteractions(t,n),e.updateGeometryGroupsIfNeeded()},start:i=>{e.updateGeometryInteractions(t,n),e.updateGeometryGroupsIfNeeded()},end:i=>{e.updateGeometryInteractions(t,n),e.updateGeometryGroupsIfNeeded()}})}return r}function h9(e,t,i,n){let r=[];if(void 0!==i.intensity){let a=t9("intensity",e,t,i,n);a&&r.push(a)}if(void 0!==i.color){let a=function(e,t,i,n,r){let a=i[e]?i[e]:void 0,s=n[e];if(!s)return;let o=t[e],l=a?"string"==typeof a?r.getColor(a).clone():(new MA).setRGB(a.r,a.g,a.b):o.clone(),c="string"==typeof s?r.getColor(s).clone():(new MA).setRGB(s.r,s.g,s.b);if(l.equals(c))return;let h=o.clone();return t[e]=h,{update:e=>{h.lerpColors(l,c,e)},start:()=>{h.copy(l)},end:()=>{h.copy(c)}}}("color",e,t,i,n);a&&r.push(a)}return r}function u9(e,t,i,n){let r=[],a=e0(i,n)||!!t.layers&&e0(t,n);r.push(function(e,t){return{update:()=>{e.transparent=t}}}(e,a));for(let c of e.layers){var s,o,l;let e=null===(s=t.layers)||void 0===s?void 0:s.data(c.uuid),a=i.layers.data(c.uuid);if(!a||"light"!==c.type&&(null!==(o=c.visible)&&void 0!==o&&!o||null!==(l=a.visible)&&void 0!==l&&!l))continue;let h=c.getNames().filter((e=>!vH.some((t=>e.includes(t)))));for(let t of h)try{let i,s=c.getValue(t);if("colors"===t)i=y9(c,e,a,t);else if(Array.isArray(s))"steps"===t&&(i=v9(c,e,a,t));else if("number"==typeof s)i=d9(c,e,a,t,n);else{if("boolean"==typeof s)continue;s instanceof hA?i=p9(c,e,a,t):s instanceof FA?i=f9(c,e,a,t,n):s instanceof CK?i=g9(c,e,a,t,n):s instanceof MA?i=m9(c,e,a,t,n):"isTexture"in s&&(i=b9(c,e,a,t))}i&&(Array.isArray(i)?r.push(...i):r.push(i))}catch(y){console.error("lerpMaterial: unexpected material layer for ".concat(t),y)}}return r}function d9(e,t,i,n,r){var a,s;if(!e.hasValue(n)||!(n in i))return;let o=t?t[n]:e.getValue(n),l=i[n],c="string"==typeof o?Number(null!==(a=r.getVariable(o))&&void 0!==a?a:0):o,h="string"==typeof l?Number(null!==(s=r.getVariable(l))&&void 0!==s?s:0):l;return c!==h?{update:t=>{e.setValue(n,cA.lerp(c,h,t))},start:()=>{e.setValue(n,c)},end:()=>{e.setValue(n,h)}}:void 0}function p9(e,t,i,n){if(!e.hasValue(n)||!(n in i))return;let r=e.getValue(n),a=t?(new hA).fromArray(t[n]):r.clone(),s=(new hA).fromArray(i[n]);return a.equals(s)?void 0:{update:e=>{r.lerpVectors(a,s,e)},start:()=>{r.copy(a)},end:()=>{r.copy(s)}}}function f9(e,t,i,n,r){if(!e.hasValue(n)||!(n in i))return;let a=e.getValue(n),s=t?t[n]:void 0,o=i[n],l=s?n9(new FA,s,r):a.clone(),c=n9(new FA,o,r);return l.equals(c)?void 0:{update:e=>{a.lerpVectors(l,c,e)},start:()=>{a.copy(l)},end:()=>{a.copy(c)}}}function m9(e,t,i,n,r){if(!e.hasValue(n)||!(n in i))return;let a=t?t[n]:void 0,s=i[n],o=e.getValue(n),l=a?"string"==typeof a?r.getColor(a).clone():(new MA).setRGB(a.r,a.g,a.b):o.clone(),c="string"==typeof s?r.getColor(s).clone():(new MA).setRGB(s.r,s.g,s.b);if(l.equals(c))return;let h=o.clone();return{update:t=>{e.getValue(n)!==h&&e.setValue(n,h),h.lerpColors(l,c,t)},start:()=>{h.copy(l)},end:()=>{h.copy(c)}}}function g9(e,t,i,n,r){if(!e.hasValue(n)||!(n in i))return;let a=t?t[n]:void 0,s=i[n],o=e.getValue(n),l=a?"string"==typeof a?r.getColor(a).clone():(new MA).setRGB(a.r,a.g,a.b):o.clone(),c="string"==typeof s?r.getColor(s).clone():new CK(s.r,s.g,s.b,s.a);if(l.equals(c))return;let h=o.clone();return{update:t=>{e.getValue(n)!==h&&e.setValue(n,h),h.lerpColors(l,c,t)},start:()=>{h.copy(l)},end:()=>{h.copy(c)}}}function v9(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"steps";if(!e.hasValue(n)||!(n in i))return;let r=[],a=e.getValue(n),s=t?t[n]:a,o=i[n];for(let l=0;l<a.length;++l){let e=s[l],t=o[l];e!==t&&r.push({update:i=>{a[l]=cA.lerp(e,t,i)},start:()=>{a[l]=e},end:()=>{a[l]=t}})}return r.length?r:void 0}function y9(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"colors";if(!e.hasValue(n)||!(n in i))return;let r=[],a=e.getValue(n),s=t?t[n]:a.map((e=>e.toArray())),o=i[n];for(let l=0;l<a.length;++l){let e=[...s[l]],t=[...o[l]];RG.isEqual(e,t)||r.push({update:i=>{a[l].fromArray(RG.lerp(e,t,i))},start:()=>{a[l].fromArray(e)},end:()=>{a[l].fromArray(t)}})}return r.length?r:void 0}function b9(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"texture";if(!e.hasValue(n)||!(n in i))return;let r=e.getNode("mat");if(!r)return;let a=t?t[n]:r,s=i[n],o=[...a.repeat],l=[...a.offset],c=[...s.repeat],h=[...s.offset];return OG.isEqual(o,c)&&OG.isEqual(l,h)?void 0:{update:e=>{r.repeat=OG.lerp(o,c,e),r.offset=OG.lerp(l,h,e),r.updateMatrix()},start:()=>{r.repeat=[...o],r.offset=[...l],r.updateMatrix()},end:()=>{r.repeat=[...c],r.offset=[...h],r.updateMatrix()}}}var x9=new FA,w9=new CM;function _9(e,t,i,n,r){var a,s,o,l,c,h,u,d,p,f,m,g,v,y,b,x,w,_;let S,E,C,A,M,T,P,D,k=[];if(e instanceof r4?(S=s9("position",e,t,i,r),S&&k.push(S),C=t9("rotation",e,t,i,r),C&&k.push(C),A=s9("shear",e,t,i,r),A&&k.push(A)):(D={slide:null!==(a=null!==(s=null!==(o=null===(l=t.pathSnapping)||void 0===l?void 0:l.slide)&&void 0!==o?o:null===(c=e.updatedPathSnapping)||void 0===c?void 0:c.slide)&&void 0!==s?s:null===(h=e.dataPatched.pathSnapping)||void 0===h?void 0:h.slide)&&void 0!==a?a:0,offset:null!==(u=null!==(d=null!==(p=null===(f=t.pathSnapping)||void 0===f?void 0:f.offset)&&void 0!==p?p:null===(m=e.updatedPathSnapping)||void 0===m?void 0:m.offset)&&void 0!==d?d:null===(g=e.dataPatched.pathSnapping)||void 0===g?void 0:g.offset)&&void 0!==u?u:0},T=t9("slide",D,null!==(v=null!==(y=t.pathSnapping)&&void 0!==y?y:e.updatedPathSnapping)&&void 0!==v?v:e.dataPatched.pathSnapping,null!==(b=i.pathSnapping)&&void 0!==b?b:e.dataPatched.pathSnapping,r),T&&k.push(T),P=t9("offset",D,null!==(x=null!==(w=t.pathSnapping)&&void 0!==w?w:e.updatedPathSnapping)&&void 0!==x?x:e.dataPatched.pathSnapping,null!==(_=i.pathSnapping)&&void 0!==_?_:e.dataPatched.pathSnapping,r),P&&k.push(P),!T&&!P&&(S=r9("position",e,t,i,r),S&&k.push(S),E=r9("scale",e,t,i,r),E&&k.push(E),C=function(e,t,i,n,r){var a;let s=null!==t&&void 0!==t&&t.rotation?t.rotation.map((e=>{var t;return("string"==typeof e?Number(null!==(t=r.getVariable(e))&&void 0!==t?t:0):e)*cA.DEG2RAD})):void 0,o=null===(a=i.rotation)||void 0===a?void 0:a.map((e=>{var t;return("string"==typeof e?Number(null!==(t=r.getVariable(e))&&void 0!==t?t:0):e)*cA.DEG2RAD}));if(!o)return;let l=s?(new FA).fromArray(s):(new FA).setFromEuler(e.rotation),c=(new FA).fromArray(o);if(l.equals(c))return;let h=x9.subVectors(c,l);if(n&&h.toArray().every((e=>Math.abs(e)<2*Math.PI))){let t=(new NA).setFromEuler(w9.setFromVector3(l)),i=(new NA).setFromEuler(w9.setFromVector3(c));return{update:n=>{!function(e,t,i,n){if(0===n)return i.copy(e);if(1===n)return i.copy(t);let r=e.w*t.w+e.x*t.x+e.y*t.y+e.z*t.z;if(r>=1)return i.copy(e);let a=1-r*r;if(a<=Number.EPSILON){let r=1-n;return i.w=r*e.w+n*t.w,i.x=r*e.x+n*t.x,i.y=r*e.y+n*t.y,i.z=r*e.z+n*t.z,i.normalize(),i}let s=Math.sqrt(a),o=Math.atan2(s,r),l=Math.sin((1-n)*o)/s,c=Math.sin(n*o)/s;i.w=e.w*l+t.w*c,i.x=e.x*l+t.x*c,i.y=e.y*l+t.y*c,i.z=e.z*l+t.z*c}(t,i,e.quaternion,n)},start:()=>{e.rotation.setFromVector3(l)},end:()=>{e.rotation.setFromVector3(c)}}}return{update:t=>{x9.lerpVectors(l,c,t),e.rotation.setFromVector3(x9)},start:()=>{e.rotation.setFromVector3(l)},end:()=>{e.rotation.setFromVector3(c)}}}(e,t,i,n,r),C&&k.push(C),M=function(e,t,i,n){let r=i[e]?i[e]:void 0,a=n[e];if(!a)return;let s=t[e],o=r?(new mM).fromArray(r):s.clone(),l=new FA,c=new NA,h=new FA;o.decompose(l,c,h);let u=(new mM).fromArray(a),d=new FA,p=new NA,f=new FA;return u.decompose(d,p,f),o.equals(u)?void 0:{update:e=>{e9.slerpQuaternions(c,p,e),J8.lerpVectors(l,d,e),$8.lerpVectors(h,f,e),s.compose(J8,e9,$8)},start:()=>{s.compose(l,c,h)},end:()=>{s.compose(d,p,f)}}}("hiddenMatrix",e,t,i),M&&k.push(M))),S||E||C||M||T||P){let i=e instanceof r4?()=>{e.updateWorldMatrix(!0)}:()=>{var i;e.updateMatrix(),e.hasNonUniformScale&&(e.updateMatrixWorld(),e.updateMatrixWorldSVD()),null!==(i=e.parent)&&void 0!==i&&i.matrixWorldFusedFalse&&(e.matrixWorld.multiplyMatrices(e.parent.matrixWorldFusedFalse,e.matrix),e.matrixWorldNeedsUpdate=!1),q1(e)&&X1(e.parent)&&e.invalidateDownstreamBooleanData(!0),e.updatePathSnapping(Object.assign({},t.pathSnapping,D))};k.push({update:i,start:i,end:i})}return k}function S9(e,t,i,n){let r=[];if(!("cloner"in i)||!e.cloner)return r;let a=e.cloner,s="cloner"in t?t.cloner:{},o=i.cloner;oH.forEach((e=>{let t;t="count"===e?t9("count",a.parameters,s,o,n,!0):l9(e,a.parameters,null!==s&&void 0!==s?s:{},o,n),t&&r.push(t)}));let l=function(e,t,i,n){if("radial"!==e.parameters.type)return;let r=t.radial,a=i.radial;if(!a)return;let s=e.parameters.radial,o=[];return lH.forEach((e=>{let t=l9(e,s,null!==r&&void 0!==r?r:{},a,n);t&&o.push(t)})),o}(a,s,o,n);(null===l||void 0===l?void 0:l.length)&&r.push(...l);let c=function(e,t,i,n){if("linear"!==e.parameters.type)return;let r=t.linear,a=i.linear;if(!a)return;let s=[],o=e.parameters.linear;return cH.forEach((e=>{let t=l9(e,o,null!==r&&void 0!==r?r:{},a,n);t&&s.push(t)})),s}(a,s,o,n);(null===c||void 0===c?void 0:c.length)&&r.push(...c);let h=function(e,t,i,n){if("grid"!==e.parameters.type)return;let r=t.grid,a=i.grid;if(!a)return;let s=[],o=e.parameters.grid;return hH.forEach((e=>{let t;t="count"===e?i9(e,o,null!==r&&void 0!==r?r:{},a,n,!0):l9(e,o,null!==r&&void 0!==r?r:{},a,n),t&&s.push(t)})),s}(a,s,o,n);(null===h||void 0===h?void 0:h.length)&&r.push(...h);let u=function(e,t,i,n){if("toObject"!==e.parameters.type)return;let r=t.toObject,a=i.toObject;if(!a)return;let s=[],o=e.parameters.toObject;return uH.forEach((e=>{let t;t="count"===e?t9(e,o,null!==r&&void 0!==r?r:{},a,n,!0):l9(e,o,null!==r&&void 0!==r?r:{},a,n),t&&s.push(t)})),s}(a,s,o,n);(null===u||void 0===u?void 0:u.length)&&r.push(...u);let d=function(e,t,i,n){if(!e.parameters.randomness)return;let r=t.randomnessObject,a=i.randomnessObject;if(!a)return;let s=[],o=e.parameters.randomnessObject;return dH.forEach((e=>{let t=l9(e,o,null!==r&&void 0!==r?r:{},a,n);t&&s.push(t)})),s}(a,s,o,n);return null!==d&&void 0!==d&&d.length&&r.push(...d),r.length&&r.push({update:()=>{a.update()}}),r}function E9(e,t,i,n,r){let a,s,o,l,c,h,u,d,p,f,m,g,v,y,b,x=[];if("width"in e&&(a=t9("width",e,t,i,r),a&&x.push(a)),"height"in e&&(s=t9("height",e,t,i,r),s&&x.push(s)),e instanceof D4||e instanceof L4){let n={...t.fill},a={...i.fill};void 0!==n.enabled&&n.enabled!==a.enabled&&(x.push(function(e,t){return{update:()=>{e instanceof D4&&(e.fill.enabled=t)}}}(e,!0)),n.enabled||Object.assign(n,{enabled:!0,color:{...n.color,a:0}}),a.enabled||Object.assign(a,{enabled:!0,color:{...a.color,a:0}})),o=o9("color",e.fill,n,a,r),o&&x.push(o)}if(e instanceof D4){let n={...t.stroke},a={...i.stroke};(n.enabled||a.enabled)&&(x.push(function(e,t){return{update:()=>{e instanceof D4&&(e.stroke.enabled=t)}}}(e,!0)),n.enabled||Object.assign(n,{enabled:!0,color:{...n.color,a:0}}),a.enabled||Object.assign(a,{enabled:!0,color:{...a.color,a:0}})),l=o9("color",e.stroke,n,a,r),l&&x.push(l),c=t9("thickness",e.stroke,n,a,r),c&&x.push(c)}if(e instanceof D4){let n={...t.dropShadow},a={...i.dropShadow};(n.enabled||a.enabled)&&(x.push(function(e,t){return{update:()=>{e instanceof D4&&(e.dropShadow.enabled=t)}}}(e,!0)),n.enabled||Object.assign(n,{enabled:!0,color:{...n.color,a:0}}),a.enabled||Object.assign(a,{enabled:!0,color:{...a.color,a:0}})),h=o9("color",e.dropShadow,n,a,r),h&&x.push(h),u=t9("blurRadius",e.dropShadow,n,a,r),u&&x.push(u),p=t9("spread",e.dropShadow,n,a,r),p&&x.push(p),d=s9("offset",e.dropShadow,n,a,r),d&&x.push(d)}if(e instanceof D4){let n={...t.innerShadow},a={...i.innerShadow};(n.enabled||a.enabled)&&(x.push(function(e,t){return{update:()=>{e instanceof D4&&(e.innerShadow.enabled=t)}}}(e,!0)),n.enabled||Object.assign(n,{enabled:!0,color:{...n.color,a:0}}),a.enabled||Object.assign(a,{enabled:!0,color:{...a.color,a:0}})),f=o9("color",e.innerShadow,n,a,r),f&&x.push(f),m=t9("blurRadius",e.innerShadow,n,a,r),m&&x.push(m),v=t9("spread",e.innerShadow,n,a,r),v&&x.push(v),g=s9("offset",e.innerShadow,n,a,r),g&&x.push(g)}if(e instanceof D4||e instanceof L4){let n={...t.backgroundBlur},a={...i.backgroundBlur};(n.enabled||a.enabled)&&(x.push(function(e,t){return{update:()=>{e instanceof D4&&(e.backgroundBlur.enabled=t)}}}(e,!0)),n.enabled||Object.assign(n,{enabled:!0,radius:0}),a.enabled||Object.assign(a,{enabled:!0,radius:0})),y=t9("radius",e.backgroundBlur,n,a,r),y&&x.push(y)}if(e instanceof D4){let n={...t.layerBlur},a={...i.layerBlur};(n.enabled||a.enabled)&&(x.push(function(e,t){return{update:()=>{e instanceof D4&&(e.layerBlur.enabled=t)}}}(e,!0)),n.enabled||Object.assign(n,{enabled:!0,radius:0}),a.enabled||Object.assign(a,{enabled:!0,radius:0})),b=t9("radius",e.layerBlur,n,a,r),b&&x.push(b)}if(e instanceof L4||e instanceof O4){let n=i9("cornerRadius",e,t,i,r);n&&x.push(n)}return x}function C9(e,t,i,n,r){let a=[];return e.data.visible&&a.push(..._9(e,t,i,r,n)),e instanceof r4?a.push(...E9(e,t,i,0,n)):(e.data.visible&&a.push(...S9(e,t,i,n)),q1(e)?(e instanceof k0&&e.data.visible&&a.push(...c9(e,t,i,n)),e.data.visible&&a.push(...function(e,t,i,n){let r=[];if(Array.isArray(e.material)){if(!("materials"in i)||!i.materials)return r;let a="materials"in t&&t.materials?t.materials:[],s=i.materials;e.material.forEach(((e,t)=>{var i;if(!s[t])return;let o=null!==(i=a[t])&&void 0!==i?i:{},l=s[t];"string"==typeof o||"string"==typeof l||r.push(...u9(e,o,l,n))}))}else{if(!("material"in i)||!i.material)return r;let a="material"in t&&t.material?t.material:{},s=i.material;if("string"==typeof a||"string"==typeof s)return r;r.push(...u9(e.material,a,s,n))}return r}(e,t,i,n))):(e=>G1.is(e))(e)?e.data.visible&&a.push(...h9(e,t,i,n)):(e=>e instanceof F1)(e)&&a.push(...function(e,t,i,n){var r,a,s,o;let l=[],c="OrthographicCamera"===e.cameraType?null===(r=t.orthographic)||void 0===r?void 0:r.zoom:null===(a=t.perspective)||void 0===a?void 0:a.zoom,h="OrthographicCamera"===e.cameraType?null===(s=i.orthographic)||void 0===s?void 0:s.zoom:null===(o=i.perspective)||void 0===o?void 0:o.zoom;if(void 0!==h){let t=null!==c&&void 0!==c?c:e.zoom,i=h;t!==i&&l.push({update:n=>{e.zoom=cA.lerp(t,i,n),e.updateProjectionMatrix()},start:()=>{e.zoom=t,e.updateProjectionMatrix()},end:()=>{e.zoom=i,e.updateProjectionMatrix()}})}if(void 0!==i.targetOffset){let r=t9("targetOffset",e,t,i,n);r&&l.push(r)}return l}(e,t,i,n))),a.length?{update:e=>{a.forEach((t=>t.update(e)))},start:e=>{a.forEach((t=>{var i;return null===(i=t.start)||void 0===i?void 0:i.call(t,e)}))},end:e=>{a.forEach((t=>{var i;return null===(i=t.end)||void 0===i?void 0:i.call(t,e)}))}}:void 0}var A9=new FA;function M9(e,t){var i;let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[],a=i=>{let n=i.data;delete i.states,i.currentState=null,i.reversibleToState=null,i.currentTransitionEvent=null;for(let e of n.states){let t={...e.data};i.states||(i.states={}),i.states[e.id]=BW.patch(n,t)}P9(e.scene,i,null,t,void 0!==n.events.find((e=>"Follow"===e.data.type||"LookAt"===e.data.type))),T9(e)};e.scene.traverse2D(a),e.traverseChildren((i=>{var s,o,l,c,h,u;if(n&&(null!==(s=i.rigidBody)&&void 0!==s&&s.setTranslation(i.position0,!0),null!==(o=i.rigidBody)&&void 0!==o&&o.setRotation(i.rotation0,!0),null!==(l=i.rigidBody)&&void 0!==l&&l.setLinvel(A9,!0),null!==(c=i.rigidBody)&&void 0!==c&&c.setAngvel(A9,!0)),!IX.is(i))return;let d=i.uuid,p=i.data;if(delete i.states,i.uuid===qG)return;let f=!1;r.some((t=>{var i;return null===(i=e.scene.find(d))||void 0===i?void 0:i.isDescendantOf(t)}))?f=!0:!0===(null===(h=p.physics)||void 0===h?void 0:h.fusedBody)&&"dynamic"===p.physics.rigidBody&&r.push(d),i.data=p,i.currentState=null,i.reversibleToState=null,i.currentTransitionEvent=null;for(let t of p.states){let n={...t.data};!0===e.data.globalPhysics.usePhysics&&p.physics&&("dynamic"===p.physics.rigidBody||f)&&(void 0!==t.data.position&&delete n.position,void 0!==t.data.rotation&&delete n.rotation,void 0!==t.data.hiddenMatrix&&delete n.hiddenMatrix),i.states||(i.states={}),i.states[t.id]=QH.patch(p,n)}P9(e.scene,i,null,t,void 0!==p.events.find((e=>"Follow"===e.data.type||"LookAt"===e.data.type))),T9(e),i instanceof i5&&i.frame&&(i.frame.traverse((e=>a(e))),null===(u=i.uiCanvas)||void 0===u||u.applySize())})),e.frame&&(e.frame.traverse((e=>a(e))),null===(i=e.uiCanvas)||void 0===i||i.applySize())}function T9(e){e.traverseEntity((t=>{for(let i of t.data.events){let t=[];switch(i.data.type){case"Follow":case"MouseHover":case"Scroll":case"MouseDown":case"MouseUp":case"MousePress":case"KeyUp":case"KeyDown":case"KeyPress":case"Collision":t.push(...i.data.actions);break;case"GameControl":for(let e of Object.values(i.data.gameActions))t.push(...e);break;case"DragDrop":t.push(...i.data.dragDropActions.drag,...i.data.dragDropActions.drop);break;case"Conditional":t.push(...i.data.inActions,...i.data.outActions)}for(let i of t)if("Create"===i.data.type&&"Yes"===i.data.hideBase){let t=e.scene.find(i.data.object);t&&(t.visible=!1)}}}))}function P9(e,t,i,n){let r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(t instanceof k0&&t.removeInteractionGeometry(n),t instanceof r4?t.changeSelectedState(i,{shared:n},r):t.changeSelectedState(i,{scene:e,shared:n},r),t instanceof k0&&t.updateGeometryGroupsIfNeeded(),t instanceof F1&&t.updateCameraState(t.dataPatched,{scene:e,shared:n}),!(t instanceof r4)){if(t.cloner)for(let e of t.cloner.children)e.playModeVisible=void 0;t.updateVisible(e)}}function D9(e){let t;if(5===e.easing){let{control1:i,control2:n}=e;t="cubicBezier(\n\t\t\t".concat(i[0],", ").concat(i[1],", ").concat(n[0],", ").concat(n[1],"\n\t\t)")}else if(6===e.easing){let{mass:i,stiffness:n,damping:r,velocity:a}=e;t="spring( ".concat(i,", ").concat(n,", ").concat(r,", ").concat(a," )")}else{let i;switch(e.easing){case 0:default:i=VG.linear;break;case 1:i=VG.ease;break;case 2:i=VG.easeIn;break;case 3:i=VG.easeOut;break;case 4:i=VG.easeInOut}let[n,r,a,s]=i;t="cubicBezier( ".concat(n,", ").concat(r,", ").concat(a,", ").concat(s," )")}return{duration:Math.max(e.duration,1e-4),easing:t}}function k9(e){let t={delay:0,loop:-1===e.repeat||e.repeat+1};if(0===e.repeat)t.direction="normal",t.rewind=!1;else switch(e.direction){case"pingpong":t.direction="alternate",t.rewind=!1;break;case"pingpong-rewind":t.direction="alternate",t.rewind=!0;break;default:t.direction="normal",t.rewind=!1}switch(t.delay=0,t.endDelay=0,t.startOnceDelay=0,t.pingPongDelayCorrection=0,t.pingPongEndDelayCorrection=0,e.delayDirection){case"start-once":t.startOnceDelay=e.delay;break;case"start":t.delay=e.delay;break;case"end":t.endDelay=e.delay;break;case"start-end":case void 0:t.delay=e.delay,t.endDelay=e.delay}return"alternate"===t.direction&&(t.delay/=2,t.endDelay/=2,"start"===e.delayDirection?(t.pingPongDelayCorrection=t.delay,"number"==typeof t.loop&&t.loop%2===0&&(t.pingPongEndDelayCorrection=t.delay)):"end"===e.delayDirection?"number"==typeof t.loop&&t.loop%2!==0&&(t.pingPongEndDelayCorrection=t.endDelay):"start-end"===e.delayDirection&&(t.pingPongDelayCorrection=t.delay,t.pingPongEndDelayCorrection=t.endDelay)),t}var O9={type:"beginState"},I9={type:"completeState",isfromEntity:!1},R9=class{constructor(e,t,i,n,r,a){if(this.object=e,this.data=n,this.sharedAssets=r,this.allowSlerp=a,this.targets={t:0},this.firstLoop=!0,this._changeBegan=!1,this._changeCompleted=!0,this.onChange=()=>{this.callback&&(this.callback.update(this.targets.t),this.object.requestRender()),0===this.targets.t||1===this.targets.t?this._changeCompleted||(this._changeCompleted=!0,this._changeBegan=!1,this.onChangeComplete()):(this._changeCompleted&&(this._changeCompleted=!1),this._changeBegan||(this._changeBegan=!0,this.onChangeBegin()))},this.onChangeBegin=()=>{this.object.reversibleToState=this.to.id;let e=this.targets.t>.5?this.from.id:this.to.id;this.object.prevState!==this.object.currentState&&(this.object.prevState=this.object.currentState),this.object.currentState=e,this.object.dispatchEvent({type:"beginState",state:e}),this.object instanceof r4||this.object.traverseEntity((e=>{e!==this.object&&e instanceof F1&&e.dispatchEvent(O9)}))},this.onChangeComplete=()=>{this.firstLoop&&(this.onFirstLoop(),this.firstLoop=!1),this.object.reversibleToState=this.to.id;let e=this.targets.t<.5?this.from.id:this.to.id;this.object.prevState!==this.object.currentState&&(this.object.prevState=this.object.currentState),this.object.currentState=e,this.object.dispatchEvent({type:"completeState",state:e}),this.object instanceof r4||this.object.traverseEntity((e=>{e!==this.object&&e instanceof F1&&e.dispatchEvent(I9)}))},this.onFirstLoop=()=>{this.useCurrentState&&(this.callback=C9(this.object,this.from.data,this.to.data,this.sharedAssets,this.allowSlerp))},void 0===t){let e=B9(this.object,this.object.currentState===i?this.object.prevState:this.object.currentState);if(!e)throw new Error("Missing property");this.from=e}else{let e=B9(this.object,t);if(!e)throw new Error("Missing property");this.from=e}if(void 0===i)throw new Error("Missing property");{let e=B9(this.object,i);if(!e)throw new Error("Missing property");this.to=e}this.useCurrentState=void 0===t||void 0===i,this.params={targets:this.targets,t:1,autoplay:!1,...k9(n),...D9(n),change:this.onChange},this.callback=C9(this.object,void 0===t?{}:this.from.data,void 0===i?{}:this.to.data,this.sharedAssets,this.allowSlerp)}get changeBegan(){return this._changeBegan}get changeCompleted(){return this._changeCompleted}},L9=class extends QC{constructor(e,t,i,n){var r,a,s;if(super(),this.data=e,this.page=t,this.shared=i,this.condition=n,this.toggleIsForward=!1,this.timelineNeedsRebuild=!1,this.useToggle=!1,this.onTimelineChangeComplete=()=>{var e;"normal"!==this.data.tweens[0].data.direction&&(this.toggleIsForward=!this.toggleIsForward),!1!==this.timelineNeedsRebuild&&(null!==(e=this.timeline)&&void 0!==e&&e.pause(),this.buildTimeline({isForward:this.toggleIsForward,needsRebuild:!1,isRebuild:!0}),this.timeline.play())},!e.object)throw new Error("Missing property");let o=null!==(r=null!==(a=this.page.scene.find(e.object))&&void 0!==a?a:null===(s=this.page.uiCanvas)||void 0===s?void 0:s.find(e.object))&&void 0!==r?r:this.page.scene.find2DInUIObjects(e.object);if(!o)throw new Error("Missing property");if(!o.states)throw new Error("Missing property");if(this.object=o,e.tweens.length<2)throw new Error("Missing property");this.tweens=Array(this.data.tweens.length-1),this.startOnceDelay="start-once"===e.tweens[0].data.delayDirection?e.tweens[0].data.delay:0,this.init()}get playing(){var e;return!1===(null===(e=this.timeline)||void 0===e?void 0:e.paused)}get changeBegan(){var e;return null!==(e=this.tweens.some((e=>e.changeBegan)))&&void 0!==e&&e}init(){this.initialCurrentState=B9(this.object,this.object.currentState).id,this.toggleIsForward=!1}get currentState(){return this.useToggle?this.initialCurrentState:this.object.currentState}buildTimeline(){var e;let{isForward:t=!0,needsRebuild:i=!1,isRebuild:n=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var r;let e=k9(this.data.tweens[0].data);n&&"number"==typeof e.loop&&e.loop--,null!==(r=this.timeline)&&void 0!==r&&r.pause(),this.timeline=K8.timeline({autoplay:!1,...e,...!0===e.loop||e.loop>1?{timelineChangeComplete:this.onTimelineChangeComplete}:{}});let c=this.tweens.findIndex((e=>null===e||void 0===e?void 0:e.changeBegan));if(!0===i&&(this.timelineNeedsRebuild=!0),t){let t=-1===c?0:c;for(let i=t;i<this.data.tweens.length-1;i++){var a,s;let n,r=this.data.tweens[i],o=this.data.tweens[i+1];i!==t||!0!==this.object.wasMovedByUser&&!0!==(null===(a=this.object.previousAction)||void 0===a?void 0:a.changeBegan)?n=void 0===r.data.state?this.currentState:r.data.state:(n=void 0,this.object instanceof F1&&(this.object.wasMovedByUser=!1));let l=new R9(this.object,n,void 0===o.data.state?this.currentState:o.data.state,o.data,this.shared,null!==(s=this.data.allowSlerp)&&void 0!==s&&s);-1!==c&&i===t&&Object.assign(l.params,{startOnceDelay:0}),this.tweens[i]=l,this.timeline.add(l.params,this.timeline.duration+(i===t?e.delay:0))}this.timeline.duration+=e.endDelay}else{let t=-1===c?this.data.tweens.length-1:c+1;for(let i=t;i>0;i--){var o,l;let n,r=this.data.tweens[i],a=this.data.tweens[i-1];i!==t||!0!==this.object.wasMovedByUser&&!0!==(null===(o=this.object.previousAction)||void 0===o?void 0:o.changeBegan)?n=void 0===r.data.state?this.currentState:r.data.state:(n=void 0,this.object instanceof F1&&(this.object.wasMovedByUser=!1));let s=new R9(this.object,n,void 0===a.data.state?this.currentState:a.data.state,r.data,this.shared,null!==(l=this.data.allowSlerp)&&void 0!==l&&l);-1!==c&&i===t&&Object.assign(s.params,{startOnceDelay:0}),this.tweens[i-1]=s,this.timeline.add(s.params,this.timeline.duration+(i===t?e.endDelay:0))}this.timeline.duration+=e.delay}}catch(p){p instanceof Error&&console.error(p.message)}!0===(null===(e=this.object.previousAction)||void 0===e?void 0:e.playing)&&this.object.previousAction.pause(),this.object.previousAction=this}play(){if(!1===W9(this.shared,this.condition)||this.playing)return!1;clearTimeout(this.timeoutId);let e=k9(this.data.tweens[0].data).pingPongDelayCorrection;this.timeoutId=window.setTimeout((()=>{try{this.buildTimeline(),this.timeline.play()}catch(a){a instanceof Error&&console.error(a.message)}}),this.startOnceDelay+e)}pause(){var e;null!==(e=this.timeline)&&void 0!==e&&e.pause(),clearTimeout(this.timeoutId),this.tweens=Array(this.data.tweens.length-1),delete this.timeoutId}stop(){this.pause();let e=void 0===this.data.tweens[0].data.state?this.initialCurrentState:this.data.tweens[0].data.state;this.object instanceof r4?this.object.changeSelectedState(e,{shared:this.shared}):this.object.changeSelectedState(e,{scene:this.page.scene,shared:this.shared}),this.object.currentState=e}seek(e){var t;void 0===this.timeline&&this.buildTimeline(),null===(t=this.timeline)||void 0===t||t.seek(e*this.timeline.duration,!0)}toggle(e){var t;if(!1===W9(this.shared,this.condition))return!1;this.useToggle=!0,clearTimeout(this.timeoutId),this.toggleIsForward=null!==e&&void 0!==e?e:!this.toggleIsForward,this.playing?(null!==(t=this.timeline)&&void 0!==t&&t.pause(),this.buildTimeline({isForward:this.toggleIsForward,needsRebuild:!0}),this.timeline.play()):this.timeoutId=window.setTimeout((()=>{var e;null!==(e=this.timeline)&&void 0!==e&&e.pause(),this.buildTimeline({isForward:this.toggleIsForward}),this.timeline.play()}),this.startOnceDelay)}playFromCurrent(){this.toggle(!0)}reverseFromCurrent(){this.toggle(!1)}dispose(){this.pause()}};function B9(e,t){var i;let n,r;if("string"==typeof t?(n=t,r=null===(i=e.states)||void 0===i?void 0:i[n]):null===t&&(n=null,r=e.data),void 0!==n&&void 0!==r)return{id:n,data:r}}var z9={type:"beginState"},N9={type:"completeState",isfromEntity:!1},F9={type:"requestRender"},j9=class extends QC{constructor(e,t,i,n){super(),this.data=e,this.page=t,this.shared=i,this.condition=n,this.toggleIsForward=!1,this.useToggle=!1,this.posStart=new FA,this.posEnd=new FA,this.qStart=new NA,this.qEnd=new NA,this.zoomStart=1,this.zoomEnd=1}init(){}get playing(){return this.animation&&this.animation.began&&!this.animation.completed}buildAnimation(){if(!this.data.animate)return;let e=this.page.scene.find(this.data.targetCamera);if(!e||!e.visible)throw new ReferenceError("Target camera not founded or not visible");let t={t:0};this.posStart.copy(this.page.activeCamera.position),this.qStart.copy(this.page.activeCamera.quaternion),this.zoomStart=this.page.activeCamera.zoom,this.animation=K8({targets:t,t:1,...D9(this.data),update:()=>{0===t.t&&(this.useToggle&&!this.toggleIsForward?(this.posEnd.copy(this.fromCamera.position),this.qEnd.copy(this.fromCamera.quaternion),this.zoomEnd=this.fromCamera.zoom,this.switchCamera(this.fromCamera.uuid)):(this.posEnd.copy(e.position),this.qEnd.copy(e.quaternion),this.zoomEnd=e.zoom,this.fromCamera=this.page.activeCamera,this.switchCamera(e.uuid)),this.page.activeCamera.dispatchEvent(z9));let i=this.page.activeCamera;i.position.lerpVectors(this.posStart,this.posEnd,t.t),i.quaternion.slerpQuaternions(this.qStart,this.qEnd,t.t),i.zoom=this.zoomStart+(this.zoomEnd-this.zoomStart)*t.t,i.wasMovedBySwitchCameraAction=!0,i.updateMatrix(),i.updateMatrixWorld(),i.updateProjectionMatrix(),i.dispatchEvent(F9),1===t.t&&i.dispatchEvent(N9)}})}switchCamera(e){let t=this.page.activeCamera,i=this.page.scene.find(e);if(!i||!i.visible)throw new ReferenceError("Target camera not founded or not visible");this.page.switchActiveCamera(i),t.dispatchEvent({type:"cameraChange",camera:i})}play(){if(!1===W9(this.shared,this.condition))return!1;if(!this.playing&&this.page.activeCamera.uuid!==this.data.targetCamera)try{clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout((()=>{var e;delete this.timeoutId,this.data.animate?(this.buildAnimation(),null===(e=this.animation)||void 0===e||e.play()):this.switchCamera(this.data.targetCamera)}),1e3*this.data.delay)}catch{}}pause(){var e;null!==(e=this.animation)&&void 0!==e&&e.pause(),clearTimeout(this.timeoutId),delete this.timeoutId}toggle(e){if(!1===W9(this.shared,this.condition))return!1;this.useToggle=!0,clearTimeout(this.timeoutId),this.toggleIsForward=null!==e&&void 0!==e?e:!this.toggleIsForward;try{var t,i;this.playing?(null!==(t=this.animation)&&void 0!==t&&t.pause(),this.buildAnimation(!0),null===(i=this.animation)||void 0===i||i.play()):this.timeoutId=window.setTimeout((()=>{var e,t;delete this.timeoutId,this.data.animate?(null!==(e=this.animation)&&void 0!==e&&e.pause(),this.buildAnimation(),null===(t=this.animation)||void 0===t||t.play()):(this.toggleIsForward?(this.fromCamera=this.page.activeCamera,this.switchCamera(this.data.targetCamera)):this.switchCamera(this.fromCamera.uuid),this.page.activeCamera.dispatchEvent(N9),this.page.activeCamera.dispatchEvent(F9))}),1e3*this.data.delay)}catch{}}playFromCurrent(){this.toggle(!0)}reverseFromCurrent(){this.toggle(!1)}dispose(){this.pause(),this.toggleIsForward=!1}},V9=class extends QC{constructor(e,t,i,n,r){var a,s,o,l;super(),this.page=t,this.animationControls=i,this.shared=n,this.condition=r,this.startOnceDelay=0,this.toggleIsForward=!1;let c=e.object,h=t.scene.find(e.object);h&&Array.isArray(h.identity)&&(c=h.identity[0]),this.data={...e,object:c};let u=this.animationControls.clipIdToAction[e.clipId+"/"+c];this.duration=null!==(a=null===u||void 0===u||null===(s=u.getClip())||void 0===s?void 0:s.duration)&&void 0!==a?a:1;let d=null!==(o=null===u||void 0===u||null===(l=u.getClip())||void 0===l||null===(l=l.tracks[0])||void 0===l?void 0:l.times.length)&&void 0!==o?o:1/0;this.leftFrameTime=this.data.crop[0]/d*this.duration,this.rightFrameTime=this.data.crop[1]/d*this.duration,this.startOnceDelay=e.delay}get playing(){var e,t;return null!==(e=null===(t=this.threeAnimAction)||void 0===t?void 0:t.isRunning())&&void 0!==e&&e}play(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!1===W9(this.shared,this.condition))return!1;window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout((()=>{var t;if(this.threeAnimAction=this.animationControls.play(this.data),!this.threeAnimAction)return;this.threeAnimAction.reset(),this.threeAnimAction.time=this.leftFrameTime,this.threeAnimAction._clip.start=this.leftFrameTime,this.threeAnimAction._clip.duration=this.rightFrameTime;let i=this.data.object;Object.entries(this.animationControls.clipIdToAction).forEach((t=>{let[n,r]=t,a=n.split("/")[1];this.threeAnimAction!==r&&a===i&&r.isRunning()&&(e?r.fadeOut(.2):r.stop())})),e&&(null===(t=this.threeAnimAction)||void 0===t||t.fadeIn(.2))}),this.startOnceDelay)}pause(){this.threeAnimAction&&(this.threeAnimAction.paused=!0),window.clearTimeout(this.timeoutId),delete this.timeoutId}stop(){var e;null===(e=this.threeAnimAction)||void 0===e||e.fadeOut(.2)}seek(e){this.threeAnimAction=this.animationControls.play(this.data),this.threeAnimAction&&(this.threeAnimAction.paused=!0,this.threeAnimAction.time=cA.clamp(this.threeAnimAction.time+1/60*e,this.leftFrameTime,this.rightFrameTime-16e-5),this.animationControls.needsUpdate=!0,this.animationControls.requestRender())}toggle(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!1===W9(this.shared,this.condition))return!1;this.toggleIsForward=null!==e&&void 0!==e?e:!this.toggleIsForward,this.threeAnimAction&&(this.threeAnimAction._loopCount=0),this.playing?this.threeAnimAction&&(this.threeAnimAction.timeScale=this.toggleIsForward?1:-1,this.toggleIsForward?(this.threeAnimAction._clip.start=this.leftFrameTime,this.threeAnimAction._clip.duration=this.rightFrameTime):(this.threeAnimAction._clip.start=this.rightFrameTime,this.threeAnimAction._clip.duration=this.leftFrameTime)):this.timeoutId=window.setTimeout((()=>{if(this.threeAnimAction=this.animationControls.play(this.data),this.threeAnimAction){var e;this.toggleIsForward?(this.threeAnimAction.time=this.leftFrameTime,this.threeAnimAction._clip.start=this.leftFrameTime,this.threeAnimAction._clip.duration=this.rightFrameTime):(this.threeAnimAction.time=this.rightFrameTime,this.threeAnimAction._clip.start=this.rightFrameTime,this.threeAnimAction._clip.duration=this.leftFrameTime),this.threeAnimAction.paused=!1,this.threeAnimAction.timeScale=this.toggleIsForward?1:-1;let i=this.data.clipId.split("/")[1];Object.entries(this.animationControls.clipIdToAction).forEach((e=>{let[n,r]=e,a=n.split("/")[1];this.threeAnimAction!==r&&a===i&&r.isRunning()&&(t?r.fadeOut(.2):r.stop())})),t&&(null===(e=this.threeAnimAction)||void 0===e||e.fadeIn(.2))}}),this.startOnceDelay)}playFromCurrent(){this.toggle(!0)}reverseFromCurrent(){this.toggle(!1)}dispose(){var e;let t=null===(e=this.animationControls.clipIdToAction[this.data.clipId+"/"+this.data.object])||void 0===e?void 0:e.getClip();t&&(t.duration=this.duration),this.pause()}},U9=class{constructor(e,t,i,n,r){this.data=e,this.page=t,this.eventManager=i,this.shared=n,this.condition=r,this.timeOutId=-1,this.scene=t.scene}dispatch(){if(!1===W9(this.shared,this.condition))return!1;this.data.target!==this.page.uuid&&(window.clearTimeout(this.timeOutId),this.timeOutId=window.setTimeout((()=>{this.play()}),1e3*this.data.delay))}dispose(){window.clearTimeout(this.timeOutId)}play(){if(this.scene.children.every((e=>e.uuid!==this.data.target)))return;"fade"===this.data.transition&&this.data.duration>0&&this.eventManager.eventContext.renderer.renderFromSceneForSceneTransitionPass(this.scene,this.scene.activeCamera,1e3*this.data.duration),this.eventManager.deactivate(),this.eventManager.controlsManager.deactivate();let e=this.scene.activeCamera;this.scene.updatePage(this.data.target),this.scene.traverseVisibleEntity((e=>{"ParticleSystem"===e.type&&(e.sleep(),e.wakeUp(),e.data.autoPlay?e.start():e.stop())})),this.scene.activePage.switchToPlayCamera(),this.scene.activeCamera.copyViewPlaneSize(e),M9(this.scene.activePage,this.shared),this.eventManager.activate(),this.eventManager.controlsManager.activate(this.eventManager)}},G9=class{constructor(e,t,i,n){this.data=e,this.page=t,this.shared=i,this.condition=n,this.evaluatedCondition=!1}checkConditions(){this.evaluatedCondition=W9(this.shared,this.condition)}dispatch(){if(!1===this.evaluatedCondition)return!1;let e=this.shared.getVariable(this.data.variableId),t=vZ(this.data.expression,this.shared,aW.typeOfVariable(e));void 0!==t&&this.shared.updateVariable(this.data.variableId,"string"==typeof t?{textValue:t}:t)}dispose(){}},H9=class{constructor(e,t,i,n){this.data=e,this.page=t,this.shared=i,this.condition=n,this.timeoutId=null}dispatchInner(){if(!1===W9(this.shared,this.condition))return!1;let e=this.shared.getDynamicVariablePlayState(this.data.variableId);if("PlayPause"===this.data.mode)void 0===this.shared.getDynamicVariableToggleIsForward(this.data.variableId)&&this.shared.setDynamicVariableToggleIsForward(this.data.variableId,!0),this.shared.setDynamicVariablePlayState(this.data.variableId,"Playing"===e?"Paused":"Playing");else if("Play"===this.data.mode&&"Playing"!==e)void 0===this.shared.getDynamicVariableToggleIsForward(this.data.variableId)&&this.shared.setDynamicVariableToggleIsForward(this.data.variableId,!0),this.shared.setDynamicVariablePlayState(this.data.variableId,"Playing");else if("Stop"===this.data.mode&&"Stopped"!==e)this.shared.setDynamicVariablePlayState(this.data.variableId,"Stopped");else if("Pause"===this.data.mode&&"Paused"!==e)this.shared.setDynamicVariablePlayState(this.data.variableId,"Paused");else if("Restart"===this.data.mode)this.shared.setDynamicVariablePlayState(this.data.variableId,"Restarted");else if("Toggle"===this.data.mode){let t=this.shared.getDynamicVariableToggleIsForward(this.data.variableId);"Playing"===e?this.shared.setDynamicVariableToggleIsForward(this.data.variableId,void 0!==t&&!t):(this.shared.setDynamicVariableToggleIsForward(this.data.variableId,!t),this.shared.setDynamicVariablePlayState(this.data.variableId,"Playing"))}}dispatch(){let e=this.data.delay,t=this.shared.getDynamicVariablePlayState(this.data.variableId);"PlayPause"===this.data.mode&&"Playing"===t&&(e=this.data.pauseDelay),0!==e?(this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout((()=>{this.timeoutId=null,this.dispatchInner()}),e)):this.dispatchInner()}dispose(){this.timeoutId&&window.clearTimeout(this.timeoutId)}};function W9(e,t){if(void 0===t)return!0;if(0===t.expression.length)return!1;let i=vZ(t.expression,e,"boolean");return t.negate?!i:!!i}function q9(e,t,i,n,r,a){let s={Audio:[],Video:[],Particles:[],Link:[],Destroy:[],Create:[],Reset:[],Transition:[],SwitchCamera:[],Animation:[],SceneTransition:[],SetVariable:[],DynamicVariablePlay:[]},o=t=>l=>{let{id:c,data:h}=l;try{"Audio"===h.type?kG[e.type].includes("Audio")&&s.Audio.push(new U6(c,h,a,n,t)):"Video"!==h.type||a instanceof r4?"Particles"===h.type?kG[e.type].includes("Particles")&&s.Particles.push(new G6(h,i,n,t)):"Link"===h.type?kG[e.type].includes("Link")&&s.Link.push(new q6(h,r.controlsManager,n,t)):"Create"===h.type?kG[e.type].includes("Create")&&s.Create.push(new r7(h,i,r.controlsManager,n,t)):"Destroy"===h.type?kG[e.type].includes("Destroy")&&s.Destroy.push(new X6(h,i,r.controlsManager,n,t)):"Reset"===h.type?kG[e.type].includes("Reset")&&s.Reset.push(new Y6(h,i,n,r,t)):"Transition"===h.type?kG[e.type].includes("Transition")&&s.Transition.push(new L9(h,i,n,t)):"SwitchCamera"===h.type?kG[e.type].includes("SwitchCamera")&&s.SwitchCamera.push(new j9(h,i,n,t)):"SceneTransition"===h.type?kG[e.type].includes("SceneTransition")&&s.SceneTransition.push(new U9(h,i,r,n,t)):"Animation"===h.type?kG[e.type].includes("Animation")&&s.Animation.push(new V9(h,i,r.animationControls,n,t)):"SetVariable"===h.type?kG[e.type].includes("SetVariable")&&s.SetVariable.push(new G9(h,i,n,t)):"DynamicVariablePlay"===h.type?kG[e.type].includes("DynamicVariablePlay")&&s.DynamicVariablePlay.push(new H9(h,i,n,t)):"Conditional"===h.type&&kG[e.type].includes("Conditional")&&(h.ifActions.forEach(o({expression:h.condition,negate:!1})),h.elseActions.forEach(o({expression:h.condition,negate:!0}))):kG[e.type].includes("Video")&&s.Video.push(new J9(c,h,a,n,t))}catch(y){}};return t.forEach(o()),s}function X9(e){Object.values(e).forEach((e=>{e.forEach((e=>{(e instanceof U6||e instanceof J9||e instanceof G6||e instanceof V9||e instanceof L9||e instanceof r7||e instanceof X6||e instanceof j9||e instanceof U9||e instanceof Y6||e instanceof G9||e instanceof H9)&&e.dispose()}))}))}var Y9=new Map,Q9=new Map,Z9=class{constructor(e,t,i){this.data=t,this.delay=0,this.status="stopped";let{layerId:n,loop:r,volume:a,delay:s}=t;if(this.object=i,void 0===n)throw new Error("Missing property");let o=function(e,t){let i;if("material"in e){let n=e.material;i=Array.isArray(n)?e.material[0].layers.find((e=>e.uuid===t)):e.material.layers.find((e=>e.uuid===t))}if(i)return i.color.texture.image.img instanceof HTMLVideoElement?i.color.texture.image.img:void 0}(i,n);o&&(this.videoElement=o,this.videoElement.loop=r===1/0,Aj&&(this.videoElement.autoplay=!0),void 0!==a&&(this.videoElement.volume=a)),void 0!==s&&(this.delay=s),Q9.has(i.uuid)?Q9.get(i.uuid).push(this):Q9.set(i.uuid,[this]),Y9.set(e,this),this.pause()}mute(){!this.videoElement||(this.videoElement.muted=!0)}unMute(){!this.videoElement||(this.videoElement.muted=!1)}play(e){if(!this.videoElement)return;let t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);e?(this.mute(),this.delay+=150):t?(this.mute(),window.setTimeout((()=>{this.unMute()}),100)):this.unMute(),this.delayTimerId=window.setTimeout((()=>{if(!this.videoElement)return;let e=this.videoElement.play();void 0!==e&&e.then((e=>{})).catch((e=>{this.play()})),this.clearDelay()}),this.delay),this.status="playing"}clearDelay(){this.delayTimerId&&(clearTimeout(this.delayTimerId),delete this.delayTimerId)}pause(){!this.videoElement||(this.videoElement.pause(),this.status="paused")}stop(){!this.videoElement||(this.videoElement.pause(),this.videoElement.currentTime=0,this.status="stopped",this.clearDelay())}playByToggle(){"stop"===this.data.toggle?"playing"===this.status?this.stop():(this.stop(),this.play()):"pause"===this.data.toggle?"playing"===this.status?this.pause():this.play():(this.stop(),this.play())}dispose(){!this.videoElement||(this.stop(),this.videoElement.muted=!0)}},K9=class{constructor(e){this.data=e}dispatch(){this.data.playVideo?this.pauseVideo(this.data.playVideo):this.data.object?this.pauseAllVideosFromObject(this.data.object):this.pauseAllVideos()}pauseVideo(e){let t=Y9.get(e);!t||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout((()=>{t[this.data.interaction](),this.disposeDelay()}),this.data.delay)):t[this.data.interaction]())}pauseAllVideosFromObject(e){let t=Q9.get(e);null===t||void 0===t||!t.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout((()=>{t.forEach((e=>e[this.data.interaction]())),this.disposeDelay()}),this.data.delay)):t.forEach((e=>e[this.data.interaction]())))}pauseAllVideos(){let e=[...Q9.values()];!e.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout((()=>{e.forEach((e=>{e.forEach((e=>{e[this.data.interaction]()}))})),this.disposeDelay()}),this.data.delay)):e.forEach((e=>{e.forEach((e=>{e[this.data.interaction]()}))})))}disposeDelay(){clearTimeout(this.timeoutId),delete this.timeoutId}dispose(){clearTimeout(this.timeoutId),delete this.timeoutId}},J9=class{constructor(e,t,i,n,r){if(this.data=t,this.shared=n,this.condition=r,"play"===t.interaction)this.interaction=new Z9(e,t,i);else{if("pause"!==t.interaction&&"stop"!==t.interaction)throw new Error("Missing property");this.interaction=new K9(t)}}dispatchBasic(){if(!1===W9(this.shared,this.condition))return!1;this.interaction instanceof Z9?this.interaction.playByToggle():this.interaction.dispatch()}dispatchConditional(){if(!1===W9(this.shared,this.condition))return!1;this.interaction instanceof Z9?this.interaction.play():this.interaction.dispatch()}dispose(){this.interaction.dispose()}},$9=(()=>{let e,t,i,n;function r(i){var r;!e&&!e7()&&(null===(r=t)||void 0===r?void 0:r.sharedGameControlGlobals.createdObjects.length)>0&&(e=requestAnimationFrame(a)),i&&(t=i,n=i.requestRender)}function a(r){let s=i?r-i:0,o=t.sharedGameControlGlobals.createdObjects,l=t.sharedGameControlGlobals.nCreatedPerAction,c=o.length,h=0;for(;h<c;){let e=o[h];void 0===e.userData.createdTime&&(e.userData.createdTime=r),void 0===e.userData.lifetime&&void 0===e.userData.quantity||e.userData.lifetime&&r-e.userData.createdTime<e.userData.lifetime||e.userData.quantity&&l[e.userData.actionId]<=e.userData.quantity?(e.userData.velocity&&(e.position.addScaledVector(e.userData.velocity,s/1e3),e.updateMatrix(),n()),h++):(l[e.userData.actionId]>e.userData.quantity&&l[e.userData.actionId]--,o.splice(h,1),e.removeFromParent(),t.sharedGameControlGlobals.rapierWorld&&e.rigidBody?(t.sharedGameControlGlobals.colliderToEntity.delete(e.rigidBody.collider(0).handle),t.sharedGameControlGlobals.rapierWorld.removeRigidBody(e.rigidBody)):(e.bvhGeometry=void 0,t.sharedGameControlGlobals.entitiesWithTransformAnim=t.sharedGameControlGlobals.entitiesWithTransformAnim.filter((e=>void 0!==e.bvhGeometry))),c--,n())}e=h>0?requestAnimationFrame(a):void 0,i=h>0?r:void 0}return typeof document<"u"&&document.addEventListener("visibilitychange",(function(){e7()?e&&(cancelAnimationFrame(e),e=void 0,i=void 0):r()})),r})();function e7(){return!!document&&document.hidden}var t7=new NA,i7=new FA,n7=new FA,r7=class{constructor(e,t,i,n,r){this.data=e,this.page=t,this.controlsManager=i,this.shared=n,this.condition=r,this.intervalId=null,this.timeoutIdQueue=[],this.uniqueId=cA.generateUUID(),this.dispatch=()=>{if(!1===W9(this.shared,this.condition))return!1;this.data.delay?this.timeoutIdQueue.push(window.setTimeout(this.dispatchInner,1e3*this.data.delay)):this.dispatchInner()},this.dispatchFromStart=()=>{if(!1===W9(this.shared,this.condition))return!1;this.timeoutIdQueue.push(window.setTimeout(this.dispatchInner,1e3*this.data.delay))},this.dispatchThrottled=_j(this.dispatch,1e3/this.data.creationSpeed),this.dispatchStart=()=>{null===this.intervalId&&(this.intervalId=window.setInterval(this.dispatch,1e3/this.data.creationSpeed))},this.dispatchStop=()=>{null!==this.intervalId&&(window.clearInterval(this.intervalId),this.intervalId=null)},this.dispatchInner=()=>{this.timeoutIdQueue.shift();let e=new BX(this.object);if(e.playModeVisible=!0,e.expand(),"world"!==this.data.coordinateSystem){let t=this.data.coordinateSystem,i=this.page.scene.find(t);i&&(i.updateMatrixWorldSVD(),e.hiddenMatrix.copy(i.matrixWorldRigid))}e.position.fromArray(this.data.position),e.rotation.fromArray(this.data.rotation),e.updateMatrix(),this.page.add(e);let t=this.controlsManager.sharedGameControlGlobals;t.createdObjects.push(e),void 0===t.nCreatedPerAction[this.uniqueId]?t.nCreatedPerAction[this.uniqueId]=1:t.nCreatedPerAction[this.uniqueId]++,e.updateWorldMatrix(!0,!0),e.traverseObject(this.traverseObjectCB),$9(),this.controlsManager.requestRender()},this.traverseObjectCB=e=>{var t,i,n;let r;if(e.hasNonUniformScale&&e.updateMatrixWorldSVD(),this.controlsManager.sharedGameControlGlobals.rapierWorld){var a;if(e instanceof x1){if(!e.objectForSample)return!0===e.object.dataPatched.physics.fusedBody&&"dynamic"===e.object.dataPatched.physics.rigidBody||void 0;if(e.objectForSample.dataPatched.physics.fusedBody)return;r=e.object}else if(e instanceof BX)r=e.object;else if(r=e,null!==(a=r.dataPatched.cloner)&&void 0!==a&&a.hideBase)return!0}else{if(e instanceof x1)return;r=e instanceof BX?e.object:e}"Time"===this.data.destroy?e.userData.lifetime=1e3*this.data.lifetime:"Quantity"===this.data.destroy&&(e.userData.quantity=this.data.destroyAfterQuantity,e.userData.actionId=this.uniqueId);let s=(new FA).fromArray(this.data.velocity),o=r.dataPatched;if(!("visibility"===o.physics.enabled?!o.visible:!o.physics.enabled)&&(this.controlsManager.sharedGameControlGlobals.rapierWorld?(this.controlsManager.addRigidBody(e,r,{fromCreate:!0,dynamic:this.data.dynamic}),"Collision"===this.data.destroy&&(null!==(t=e.rigidBody)&&void 0!==t&&t.collider(0).setActiveEvents(1),e.userData.hasCollisionDestroy=!0),e.matrixWorld.decompose(i7,t7,n7),s.applyQuaternion(t7),this.data.velocity.some((e=>0!==e))&&this.data.dynamic&&(null===(i=e.rigidBody)||void 0===i||i.setLinvel(s.divideScalar(this.controlsManager.pixelsPerMeter),!0))):("geometry"in e.object&&this.controlsManager.addBoundsTree(e),this.data.velocity.some((e=>0!==e))&&this.data.dynamic&&(e.userData.velocity=s)),!0===(null===(n=r.dataPatched.physics)||void 0===n?void 0:n.fusedBody)))return!0};let a=this.page.scene.find(this.data.object);if(!a)throw new Error("Missing Property");if(this.object=a,"world"!==this.data.coordinateSystem&&!this.page.scene.find(this.data.coordinateSystem))throw new Error("Missing Property");$9(i)}dispose(){null!==this.intervalId&&(window.clearInterval(this.intervalId),this.intervalId=null),this.timeoutIdQueue.forEach((e=>window.clearTimeout(e))),this.dispatchThrottled.cancel(),this.page.remove(...this.controlsManager.sharedGameControlGlobals.createdObjects),this.controlsManager.sharedGameControlGlobals.createdObjects=[]}},a7=.02,s7=(new FA,new FA),o7=new FA,l7=new FA,c7=new FA,h7=new FA,u7=new FA,d7=new mM,p7=new mM,f7=new mM,m7=(new mM,new NA),g7=new NA,v7=new CM(0,0,0,"YXZ"),y7=new FA(1,0,0),b7=new FA(0,1,0),x7=new FA(0,0,1),w7=new FA(1,1,1),_7=(new sM,new CR),S7=new UA,E7={type:"requestRender"},C7={type:"updateMatrix"},A7=Math.PI/6,M7=class extends QC{constructor(e,t,i,n,r,a,s,o,l){var c,h,u,d,p,f,m,g,v,y,b,x,w,_,S,E,C,A,M;super(),this.object=e,this.domElement=t,this.data=i,this.gloabalPhysics=n,this.controlsManager=r,this.cameraFollow=a,this.camera=s,this.page=o,this.sharedAssets=l,this.enableDamping=!0,this.hiddenMatrix0=new mM,this.target0=new FA,this.zoom0=1,this.rotForce=1,this.moveForce=1,this.pixelsPerMeter=200,this.euler0=new CM(0,0,0,"YXZ"),this.position0Cam=new FA,this.quat0Cam=new NA,this.scale0Cam=new FA,this.hiddenMatrix0Cam=new mM,this.threshEndTranslate=.01,this.threshEndRotate=1e-8,this.threshEndRotVel=.005,this.collider={type:"capsule",radius:40,segment:new CR(new FA(0,-40,0),new FA(0,40,0)),matrix:new mM,position:new FA,rotation:new NA},this.euler=new CM(0,0,0,"YXZ"),this.eulerDelta=new FA,this.lastPosition=new FA,this.lastCameraQuaternion=new NA,this.lastCameraPosition=new FA,this.PI_2=Math.PI/2,this.prevMouse=new hA,this.velocityTarget=new FA,this.velocity=new FA,this.directionXZ=new FA,this.rotVelocityStick=new FA,this.rotVelocityTarget=new FA,this.rotVelocity=new FA,this.rotDirection=new FA,this.nonColliderRotOffset=new mM,this.nonColliderPosOffset=new mM,this.firstPointerId=-1,this.rot=new FA,this.path=[],this.movementState={moveNegZ:0,movePosZ:0,moveNegX:0,movePosX:0,moveNegY:0,movePosY:0,rotPosX:0,rotNegX:0,rotPosY:0,rotNegY:0,jump:0,run:0},this.vrEulerYOffset=0,this.onObject=!1,this.actionState={},this.keyAssignments=[["moveNegZ","W"],["moveNegX","A"],["movePosZ","S"],["movePosX","D"],["rotPosX","ArrowUp"],["rotPosY","ArrowLeft"],["rotNegX","ArrowDown"],["rotNegY","ArrowRight"],["jump"," "]],this.collisionEnabled=!0,this.offsetMatrix=new mM,this.objectToTarget=new FA,this.objectToTarget0=new FA,this.objectToCamXZ=new FA,this.objectToCamXZ0=new FA,this.targetToCamera=new FA,this.targetToCamera0=new FA,this.cameraPolarAxis0=new FA,this.targetPos=new FA,this.targetQuat=new NA,this.lerpFactorPos=(new FA).setScalar(.3),this.lerpFactorPosStart=.3,this.lerpFactorPosEnd=.3,this.lerpFactorRotStart=.3,this.lerpFactorRotEnd=.3,this.lerpFactorPosCamera=.3,this.lerpFactorRotCamera=.3,this.objXZQuat=new NA,this.objXZQuatInv=new NA,this.objXZRotMat=new mM,this.isFirstPerson=!1,this.didHit=!1,this.groundVelocity=new FA,this.pushedVelocity=new FA,this.groundYRotation=0,this.objectRealQuat=new NA,this.colliderWorldQuat=new NA,this.groundNormal=new FA,this.groundTilt=new NA,this.groundTiltInv=new NA,this.lastHitObj=null,this.isFirstFrame=!0,this.rotationAccumWhenOrientWithCamera=0,this.navMeshPathDest=null,this.position=new FA,this.quaternion=new NA,this.scale=new FA,this.initialAction=!0,this.onPointerDown=e=>{e.target!==this.domElement||-1!==this.firstPointerId||(this.firstPointerId=e.pointerId,this.domElement.ownerDocument.addEventListener("pointermove",this.onPointerMove),this.domElement.ownerDocument.addEventListener("pointerup",this.onPointerUp),"keys"!==this.rotBy&&!Tj&&(!Pj||Dj>=15.5)&&this.domElement.requestPointerLock(),this.prevMouse.set(e.clientX,e.clientY))},this.onPointerUp=e=>{this.firstPointerId=-1,this.domElement.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this.onPointerUp),"mouse"===e.pointerType&&this.domElement.ownerDocument.exitPointerLock()},this.onPointerMove=e=>{if(e.pointerId!==this.firstPointerId)return;let t=e.clientX-this.prevMouse.x,i=e.clientY-this.prevMouse.y;this.prevMouse.set(e.clientX,e.clientY),"mouse"===e.pointerType&&"keys"!==this.rotBy&&(Pj&&Dj<15.5&&!Tj?(this.eulerDelta.y=-t*this.mouseOrbitSensitivity,this.eulerDelta.x=-i*this.mouseOrbitSensitivity):(this.eulerDelta.y=-e.movementX*this.mouseOrbitSensitivity,this.eulerDelta.x=-e.movementY*this.mouseOrbitSensitivity)),"mouse"!==e.pointerType&&"drag"===this.rotByTouch&&(this.eulerDelta.y=-t*this.mouseOrbitSensitivity*5,this.eulerDelta.x=-i*this.mouseOrbitSensitivity*5),this.controlsManager.requestRender()},this.onPointerlockChange=e=>{this.domElement.ownerDocument.pointerLockElement===this.domElement?M7.isLocked=!0:M7.isLocked=!1},this.onPointerlockError=()=>{console.error("SPE.GameControls: Unable to use Pointer Lock API")},this.handleVisibilityChange=()=>{var e;if(null!==(e=document)&&void 0!==e&&e.hidden)for(let t in this.movementState)this.movementState[t]=0},this.onKeyDown=e=>{!(e.target instanceof HTMLInputElement)&&("ArrowLeft"===e.code||"ArrowUp"===e.code||"ArrowRight"===e.code||"ArrowDown"===e.code||"Space"===e.code)&&e.preventDefault();for(let t of this.keyAssignments)if(e.key.toUpperCase()===t[1]||e.key===t[1]){this.movementState[t[0]]=1;break}this.controlsManager.requestRender()},this.onKeyUp=e=>{for(let t of this.keyAssignments)if(e.key.toUpperCase()===t[1]||e.key===t[1]||e.code.slice(3,e.code.length).toUpperCase()===t[1]){this.movementState[t[0]]=0;break}},this.copyVRGamePadValues=(e,t)=>{for(let i=2;i<4;i++){let n=e.axes[i];0===t?2===i?this.movementState.movePosX=n:this.movementState.movePosZ=n:(e.buttons[3].pressed?this.movementState.jump=1:this.movementState.jump=0,2===i?(Math.abs(this.movementState.rotPosY)<.3&&Math.abs(n)>=.3&&(this.vrEulerYOffset+=n<0?1:-1),this.movementState.rotPosY=n):"fly"===this.moveMode&&(this.movementState.moveNegY=n))}},this.sharedGameControlGlobals=r.sharedGameControlGlobals,e===s&&(this.isFirstPerson=!0),this.hiddenMatrix0.copy(this.object.hiddenMatrix),this.object.parent?this.object.hiddenMatrix.copy(this.object.parent.matrixWorld).invert():this.object.hiddenMatrix.identity(),this.object.matrix.copy(this.object.matrixWorld),this.object.matrix.decompose(this.position,this.quaternion,this.scale),this.euler0.setFromQuaternion(this.quaternion,"YXZ");let T=this.euler0.clone(),P=T.y;if(this.objectRealQuat.copy(this.quaternion),T.y=0,this.quaternion.setFromEuler(T),this.objXZQuat.copy(this.quaternion),this.objXZQuatInv.copy(this.objXZQuat).invert(),this.objXZRotMat.makeRotationFromQuaternion(this.quaternion),T.set(0,P,0),this.quaternion.setFromEuler(T),this.rot.setFromEuler(T),this.object.matrixAutoUpdate=!1,(this.isFirstPerson||!0===this.cameraFollow)&&(this.target0.copy(this.camera.getTarget()),this.zoom0=this.camera.zoom),!0===this.cameraFollow){var D;this.position0Cam.copy(this.camera.position),this.quat0Cam.copy(this.camera.quaternion),this.scale0Cam.copy(this.camera.scale),this.hiddenMatrix0Cam.copy(this.camera.hiddenMatrix),this.camera.parent?(this.camera.hiddenMatrix.copy(null===(D=this.camera)||void 0===D?void 0:D.parent.matrixWorld),this.camera.matrix.copy(this.camera.matrixWorld)):this.camera.hiddenMatrix.identity(),this.camera.matrix.copy(this.camera.matrixWorld),this.camera.matrix.decompose(this.camera.position,this.camera.quaternion,this.camera.scale),this.camera.matrixAutoUpdate=!1,this.offsetMatrix.copy(this.object.matrix).invert().multiply(this.camera.matrix);let e,t,i=new FA(0,0,-1).applyQuaternion(this.camera.quaternion),n=(new FA).subVectors(this.position,this.camera.position);this.objectToCamXZ.copy(n),this.objectToCamXZ.y=0,this.objectToCamXZ0.copy(this.objectToCamXZ),Math.abs(i.y)<1e-6?(n.y=0,i.y=0,t=n.projectOnVector(i)):t=n.y/i.y>0?i.multiplyScalar(n.y/i.y):i.multiplyScalar(n.length()),this.targetToCamera0.copy(t).negate(),e=this.camera.position.clone().add(t),this.objectToTarget0.subVectors(e,this.position);let r=(new CM).setFromQuaternion(this.camera.quaternion,"YXZ");this.cameraPolarOffset=-r.x,r.x=0,r.z=0,r.y-=Math.PI/2,this.cameraPolarAxis0.set(0,0,-1).applyEuler(r)}if(this.object instanceof F1&&(this.object.matrixAutoUpdate=!1),this.euler.setFromQuaternion(this.quaternion,"YXZ"),this.rotByTouch=null!==(c=i.rotByTouch)&&void 0!==c?c:"joystick",this.rotBy=null!==(h=i.rotBy)&&void 0!==h?h:"keys",this.rotationMode=null!==(u=i.rotationMode)&&void 0!==u?u:"normal",this.moveMode=null!==(d=i.moveMode)&&void 0!==d?d:"walk",this.collisionEnabled=i.collisionEnabled,this.speedTranslate=1*(null!==(p=i.speedTranslate)&&void 0!==p?p:250),this.speedOrbit=.025*(null!==(f=i.speedRotate)&&void 0!==f?f:100),this.mouseOrbitSensitivity=16e-6*(null!==(m=i.speedRotate)&&void 0!==m?m:100),this.keyAssignments=i.keyAssignments.map((e=>{let t=[e[0],e[1]];return"\u25b2"===t[1]?t[1]="ArrowUp":"\u25c0"===t[1]?t[1]="ArrowLeft":"\u25bc"===t[1]?t[1]="ArrowDown":"\u25b6"===t[1]?t[1]="ArrowRight":"\u21e7"===t[1]?t[1]="Shift":"\u21b5"===t[1]?t[1]="Enter":"Space"===t[1]?t[1]=" ":"\u2318"===t[1]?t[1]="Meta":"Ctrl"===t[1]?t[1]="Control":"Esc"===t[1]&&(t[1]="Escape"),t})),"mouse"===i.rotBy){let e;e=this.keyAssignments.findIndex((e=>"rotNegX"===e[0])),-1!==e&&(this.keyAssignments[e][1]=""),e=this.keyAssignments.findIndex((e=>"rotPosX"===e[0])),-1!==e&&(this.keyAssignments[e][1]=""),e=this.keyAssignments.findIndex((e=>"rotPosY"===e[0])),-1!==e&&(this.keyAssignments[e][1]=""),e=this.keyAssignments.findIndex((e=>"rotNegY"===e[0])),-1!==e&&(this.keyAssignments[e][1]="")}this.lerpFactorPosStart=1-.02**(1/(60*(null!==(g=i.delayPos[0])&&void 0!==g?g:.3))),this.lerpFactorPosEnd=1-.02**(1/(60*(null!==(v=i.delayPos[1])&&void 0!==v?v:.3))),this.lerpFactorPos.setScalar(this.lerpFactorPosStart),this.lerpFactorRotStart=1-.02**(1/(60*(null!==(y=i.delayRot[0])&&void 0!==y?y:.3))),this.lerpFactorRotEnd=1-.02**(1/(60*(null!==(b=i.delayRot[1])&&void 0!==b?b:.3))),this.lerpFactorPosCamera=1-.02**(1/(60*(null!==(x=i.delayPosCamera)&&void 0!==x?x:.3))),this.lerpFactorRotCamera=1-.02**(1/(60*(null!==(w=i.delayRotCamera)&&void 0!==w?w:.3))),this.gravity=12*(null!==(_=this.gloabalPhysics.gravity)&&void 0!==_?_:kH.defaultData.gravity),this.usePhysics=null!==(S=this.gloabalPhysics.usePhysics)&&void 0!==S?S:kH.defaultData.usePhysics,this.jumpPower=20*i.jumpPower,this.resetYPosition=this.position.y+Math.abs(i.resetYPosition)*(this.gravity>0?1:-1),this.alignToGround=null!==(E=i.alignToGround)&&void 0!==E&&E,this.orientMode=i.autoOrientMove?i.orientMode:"none",this.orientWith=null!==(C=i.orientWith)&&void 0!==C?C:dW.defaultDataThirdPerson.orientWith,this.slopeThresh=65*Math.PI/180,"capsule"===i.collider.type?(this.collider.radius=i.collider.radius,this.collider.segment.start.y=i.collider.height/2-i.collider.radius,this.collider.segment.end.y=-this.collider.segment.start.y,this.offset=i.collider.height*a7/this.pixelsPerMeter,this.stepThresh=.3*i.collider.height/this.pixelsPerMeter,this.colliderHeight=i.collider.height):"sphere"===i.collider.type?(this.collider.radius=i.collider.radius,this.collider.segment.start.y=0,this.collider.segment.end.y=0,this.offset=2*i.collider.radius*a7/this.pixelsPerMeter,this.stepThresh=2*i.collider.radius*.3/this.pixelsPerMeter,this.colliderHeight=2*i.collider.radius):(this.offset=i.collider.height*a7/this.pixelsPerMeter,this.stepThresh=.3*i.collider.height/this.pixelsPerMeter,this.colliderHeight=i.collider.height),this.collider.type=i.collider.type;let k=(new FA).fromArray(i.collider.position),O=(new NA).setFromEuler((new CM).fromArray([...i.collider.rotation,"XYZ"]));this.collider.position.copy(k).multiply(this.scale),this.collider.rotation.copy(O),this.collider.matrix.compose(k,O,w7),void 0!==i.cameraXAxis&&(this.cameraXAxis=i.cameraXAxis,this.cameraYAxis=i.cameraYAxis,this.minPolarAngle=i.cameraRotXLimits[0],this.maxPolarAngle=i.cameraRotXLimits[1],this.minAzimuthAngleRel=i.cameraRotYLimits[0],this.maxAzimuthAngleRel=i.cameraRotYLimits[1]),this.forwardDir=null!==(A=i.forwardDirection)&&void 0!==A?A:"-z",this.isFirstPerson&&(this.forwardDir="-z"),this.runMultiplier=null!==(M=i.runMultiplier)&&void 0!==M?M:2;let I=2*i.navmesh.destinationHelperRadius;if(I>0){let e=new lV;e.push({fi:0,data:{...pH.defaultData("light","phong"),alpha:0},id:"layer1"}),e.push({fi:0,data:{...pH.defaultData("color"),color:i.navmesh.destinationHelperColor,alpha:i.navmesh.destinationHelperColor.a},id:"layer2"});let t=new n0({layers:e},{scene:this.page.scene,shared:this.sharedAssets});this.navMeshPathDest=new TT(nY.create({parameters:{width:I,height:I/10,hollow:.7}}),t),this.navMeshPathDest.material.userData.opacity0=i.navmesh.destinationHelperColor.a}this.activate()}reset(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.object.hiddenMatrix.copy(this.hiddenMatrix0),e){this.object.updateMatrix(),this.object.updateMatrixWorld(),this.object.matrix.copy(this.object.matrixWorld),this.object.matrix.decompose(this.position,this.quaternion,this.scale),this.object.parent?this.object.hiddenMatrix.copy(this.object.parent.matrixWorld).invert():this.object.hiddenMatrix.identity();let e=(new CM).setFromQuaternion(this.quaternion,"YXZ"),t=e.y;this.objectRealQuat.copy(this.quaternion),e.y=0,this.quaternion.setFromEuler(e),this.objXZQuat.copy(this.quaternion),this.objXZQuatInv.copy(this.objXZQuat).invert(),this.objXZRotMat.makeRotationFromQuaternion(this.quaternion),e.set(0,t,0),this.quaternion.setFromEuler(e),this.rot.setFromEuler(e),this.euler.setFromQuaternion(this.quaternion,"YXZ"),this.velocityTarget.set(0,0,0),this.velocity.set(0,0,0)}else this.object instanceof F1?this.object.matrixAutoUpdate=!0:this.object.updateMatrix();!0===this.cameraFollow&&(this.camera.quaternion.copy(this.quat0Cam),this.camera.position.copy(this.position0Cam),this.camera.scale.copy(this.scale0Cam),this.camera.hiddenMatrix.copy(this.hiddenMatrix0Cam),this.camera.matrixAutoUpdate=!0),this.controlsManager.requestRender()}activate(){this.instantiateActions(),this.domElement.ownerDocument.addEventListener("pointerdown",this.onPointerDown),this.domElement.ownerDocument.addEventListener("keydown",this.onKeyDown),this.domElement.ownerDocument.addEventListener("keyup",this.onKeyUp),this.domElement.ownerDocument.addEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.addEventListener("pointerlockerror",this.onPointerlockError),this.domElement.ownerDocument.addEventListener("visibilitychange",this.handleVisibilityChange)}deactivate(){this.disposeActions(),this.domElement.ownerDocument.removeEventListener("pointerdown",this.onPointerDown),this.domElement.ownerDocument.removeEventListener("keydown",this.onKeyDown),this.domElement.ownerDocument.removeEventListener("keyup",this.onKeyUp),this.domElement.ownerDocument.removeEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.removeEventListener("pointerlockerror",this.onPointerlockError),this.domElement.ownerDocument.removeEventListener("visibilitychange",this.handleVisibilityChange)}dispose(){var e;this.deactivate(),(null===(e=this.navMeshPathDest)||void 0===e?void 0:e.parent)&&this.page.remove(this.navMeshPathDest)}instantiateActions(){let e=this.data,t=this.sharedAssets;void 0!==e.gameActions&&(this.actions={},uW.list.forEach((i=>{this.actions[i]=q9({...e,disabled:!1,type:"GameControl"},e.gameActions[i],this.page,t,this.controlsManager.eventManager,this.object)}))),this.dispatchStopEvent("move"),this.dispatchStopEvent("run"),this.dispatchStopEvent("jump"),this.dispatchStartEvent("idle"),this.initialAction&&(this.initialAction=!1)}disposeActions(){this.initialAction=!1,this.dispatchStopEvent("idle"),this.dispatchStopEvent("move"),this.dispatchStopEvent("run"),this.dispatchStopEvent("jump"),X9(this.actions.idle),X9(this.actions.move),X9(this.actions.run),X9(this.actions.jump)}dispatchStartEvent(e){void 0!==this.actions[e]&&(this.actionState[e]||(this.actionState[e]=!0,this.actions[e].Transition.forEach((e=>{e.play()})),this.actions[e].Animation.forEach((e=>{e.play(!1===this.initialAction)})),this.actions[e].Create.forEach((e=>{e.dispatchStart()})),this.actions[e].Audio.forEach((e=>{e.dispatchGameControl("start")})),this.actions[e].Particles.forEach((e=>{e.dispatchGameControl("start")}))))}dispatchStopEvent(e){void 0!==this.actions[e]&&(!this.actionState[e]||(this.actionState[e]=!1,this.actions[e].Transition.forEach((e=>{e.stop(),null!==e.object.currentState&&e.object.changeSelectedState(null,{scene:this.page.scene,shared:this.sharedAssets})})),this.actions[e].Create.forEach((e=>{e.dispatchStop()})),this.actions[e].Audio.forEach((e=>{e.dispatchGameControl("stop")})),this.actions[e].Particles.forEach((e=>{e.dispatchGameControl("stop")}))))}get colliderWorldPosition(){return c7.copy(this.collider.position).applyQuaternion(this.objectRealQuat).add(this.position)}update(e,t,i){var n;if(this.gravity<0?this.position.y<this.resetYPosition:this.position.y>this.resetYPosition)return this.reset(!0),!0;this.sharedGameControlGlobals.gamePads.forEach(this.copyVRGamePadValues);let r=(this.isFirstFrame?16.6:e)/1e3;this.isFirstFrame&&(this.isFirstFrame=!1);let a=60*r,s=!1;if(this.usePhysics&&this.collisionEnabled){var o;let e=h7.set(0,(0===this.velocity.y?this.pixelsPerMeter*Math.max(Math.abs(this.gravity)/120,1)*(this.gravity>0?1:-1):this.velocity.y)*r,0).divideScalar(this.pixelsPerMeter),t=this.sharedGameControlGlobals.rapierWorld.castShape(this.colliderWorldPosition.divideScalar(this.pixelsPerMeter),this.colliderWorldQuat,e,null===(o=this.object.rigidBody)||void 0===o?void 0:o.collider(0).shape,1,!1,16,void 0,void 0,this.object.rigidBody);if(t){var l;this.onObject=!0,this.groundNormal.set(t.normal2.x,t.normal2.y,t.normal2.z).applyQuaternion(this.colliderWorldQuat).negate(),this.alignToGround&&this.groundTiltAdjustment(this.groundNormal),Math.acos(this.groundNormal.y)<this.slopeThresh&&(s=!0),0===(null===(l=t.collider.parent())||void 0===l?void 0:l.bodyType())&&Math.acos(this.groundNormal.y)*(180/Math.PI)>45&&(this.onObject=!1);let e=t.collider.parent();this.groundYRotation=0,this.groundVelocity.set(0,0,0);for(let t of this.sharedGameControlGlobals.entitiesWithTransformAnim)if(t.rigidBody===e&&t.userData.isFollowingObj!==this.object.uuid){(t.hasNonUniformScale?t.matrixWorldRigid:t.matrixWorld).decompose(c7,g7,h7),this.groundVelocity.subVectors(c7,t.prevT),this.object.getWorldPosition(h7).add(this.collider.position).sub(c7),this.groundYRotation=v7.setFromQuaternion(g7).y-t.prevR.y,u7.copy(h7).applyAxisAngle(b7,this.groundYRotation),this.groundVelocity.add(u7.sub(h7)).divideScalar(r);break}}else this.onObject=!1}if("walk"===this.moveMode&&this.collisionEnabled&&(1===this.movementState.jump&&this.onObject&&(this.velocityTarget.y=this.jumpPower,this.movementState.jump=0,this.dispatchStopEvent("idle"),this.dispatchStopEvent("move"),this.dispatchStopEvent("run"),this.dispatchStopEvent("jump"),this.dispatchStartEvent("jump"),this.onObject=!1),this.onObject?this.velocityTarget.y/=2:this.velocityTarget.y+=this.gravity*a),"fly"===this.moveMode&&(this.velocityTarget.y=(this.movementState.movePosY-this.movementState.moveNegY)*this.speedTranslate),this.directionXZ.z=this.movementState.movePosZ-this.movementState.moveNegZ,this.directionXZ.x=this.movementState.movePosX-this.movementState.moveNegX,"+z"===this.forwardDir&&this.directionXZ.multiplyScalar(-1),this.directionXZ.manhattanLength()>0&&(this.path=[]),this.navMeshPathDest){let e=this.navMeshPathDest.material;if("walk"===this.moveMode&&this.path.length>1){this.navMeshPathDest.position.copy(this.path[this.path.length-1]),this.navMeshPathDest.parent||this.page.add(this.navMeshPathDest);let t=c7.subVectors(this.path[1],this.position),i=h7.subVectors(this.path[1],this.path[0]);t.dot(i)<0?this.path.shift():(this.directionXZ.x=i.x,this.directionXZ.z=i.z),e.opacity=e.userData.opacity0}else e.opacity-=.05*e.userData.opacity0,this.navMeshPathDest.material.opacity<=0&&this.navMeshPathDest.parent&&this.page.remove(this.navMeshPathDest)}this.directionXZ.normalize(),this.movementState.run?this.moveForce=this.runMultiplier:this.moveForce=1,this.velocityTarget.z=this.directionXZ.z*this.speedTranslate*this.moveForce,this.velocityTarget.x=this.directionXZ.x*this.speedTranslate*this.moveForce,("walk"===this.moveMode?this.velocityTarget.x+this.velocityTarget.z===0:0===this.velocityTarget.manhattanLength())?this.lerpFactorPos.setScalar(this.lerpFactorPosEnd):this.lerpFactorPos.setScalar(this.lerpFactorPosStart),"walk"===this.moveMode&&(this.lerpFactorPos.y=1),!1===this.didHit&&0===this.pushedVelocity.manhattanLength()||!1===this.usePhysics?(this.velocity.x+=(this.velocityTarget.x-this.velocity.x)*(1-(1-this.lerpFactorPos.x)**a),this.velocity.y+=(this.velocityTarget.y-this.velocity.y)*(1-(1-this.lerpFactorPos.y)**a),this.velocity.z+=(this.velocityTarget.z-this.velocity.z)*(1-(1-this.lerpFactorPos.z)**a)):this.velocity.copy(this.velocityTarget),("walk"===this.moveMode?this.velocity.x**2+this.velocity.z**2<this.speedTranslate:this.velocity.lengthSq()<this.speedTranslate)?(this.dispatchStopEvent("move"),this.dispatchStopEvent("run"),this.onObject&&(this.dispatchStopEvent("jump"),this.dispatchStartEvent("idle"))):(this.dispatchStopEvent("idle"),this.onObject&&(this.dispatchStopEvent("jump"),this.movementState.run?(this.dispatchStopEvent("move"),this.dispatchStartEvent("run")):(this.dispatchStopEvent("run"),this.dispatchStartEvent("move"))));let c=l7.copy(this.velocity);if("none"!==this.orientMode&&!1===this.isFirstPerson){let e=h7.copy(c);e.y=0,c.set(0,c.y,e.length()*("+z"===this.forwardDir?1:-1))}if(this.directionXZ.manhattanLength()>0&&"none"!==this.orientMode&&!1===this.isFirstPerson)if("camera"===this.orientWith&&this.path.length<=1){let e=c7;this.camera.getWorldDirection(e);let t=u7.copy(b7).multiplyScalar(e.dot(b7));e.sub(t);let i=h7.copy(this.directionXZ);i.x*=-1,this.rot.y=e.angleTo(i)*(e.cross(i).y>0?-1:1)+this.rotationAccumWhenOrientWithCamera}else this.rot.y=(this.path.length>1?0:this.euler.y)+Math.atan2(-this.directionXZ.z,this.directionXZ.x)+Math.PI/2*("+z"===this.forwardDir?1:-1);if(v7.setFromVector3(this.rot),"walk"===this.moveMode&&(v7.x=0),c.applyEuler(v7),s&&(g7.setFromUnitVectors(b7,this.groundNormal),c.applyQuaternion(g7)),i){let e=v7.set(0,this.vrEulerYOffset*A7,0);i.applyEuler(e),c.x+=i.x,c.z+=i.z,this.nonColliderPosOffset.elements[13]+=i.y*r}if(!0===this.usePhysics){let e=h7;this.pushedVelocity.set(0,0,0);for(let t of this.sharedGameControlGlobals.entitiesWithTransformAnim){let i=u7.setFromMatrixPosition(t.matrixWorld).sub(t.prevT).divideScalar(r).divideScalar(this.pixelsPerMeter),n=t.rigidBody.collider(0).castCollider(i,this.object.rigidBody.collider(0),c7.copy(c).divideScalar(this.pixelsPerMeter),r,!1);i.multiplyScalar(this.pixelsPerMeter);let a=IX.is(t)?t:t.object;if(null!==n&&this.lastHitObj!==a){let e;t instanceof BX&&(e=t);let i=this.sharedGameControlGlobals.entityToCollisionEvents[a.uuid];if(i)for(let t of i)"character"===t.data.target&&(t.dispatch(e),a.dispatchEvent(Kte));this.lastHitObj=a}if(null!==n){this.pushedVelocity.copy(i),e.copy(n.normal1).applyQuaternion(t.quaternion);break}}if(0!==this.pushedVelocity.manhattanLength()){let t=e.dot(c);t<0&&c.addScaledVector(e,-t),c.add(this.pushedVelocity)}else c.add(this.groundVelocity)}if(this.rotDirection.y=Number(this.movementState.rotPosY)-Number(this.movementState.rotNegY),this.rotDirection.x=Number(this.movementState.rotPosX)-Number(this.movementState.rotNegX),this.rotDirection.normalize(),"normal"===this.rotationMode&&(this.movementState.rotPosX||this.movementState.rotNegX)||"steer"===this.rotationMode&&(this.movementState.rotPosX||this.movementState.rotNegX)&&(this.movementState.movePosZ||this.movementState.moveNegZ||"walk"===this.moveMode)?this.rotVelocityStick.x=-this.rotDirection.x*this.speedOrbit*this.rotForce:this.rotVelocityStick.x=0,"normal"===this.rotationMode&&(this.movementState.rotPosY||this.movementState.rotNegY)||"steer"===this.rotationMode&&(this.movementState.rotPosY||this.movementState.rotNegY)&&(this.movementState.movePosZ||this.movementState.moveNegZ)?this.rotVelocityStick.y=-this.rotDirection.y*this.speedOrbit*this.rotForce:this.rotVelocityStick.y=0,this.rotVelocityTarget.subVectors(this.eulerDelta.divideScalar(r),this.rotVelocityStick),0===this.rotVelocityTarget.manhattanLength()?this.rotVelocity.lerp(this.rotVelocityTarget,1-(1-this.lerpFactorRotEnd)**a):this.rotVelocity.lerp(this.rotVelocityTarget,1-(1-this.lerpFactorRotStart)**a),this.euler.x+=this.rotVelocity.x*r,this.euler.y+=this.rotVelocity.y*r+this.groundYRotation,0===this.rotVelocityTarget.y&&0===this.directionXZ.manhattanLength()?this.rotationAccumWhenOrientWithCamera=0:(!1===this.cameraFollow||"Locked"===this.cameraYAxis)&&(this.rotationAccumWhenOrientWithCamera+=this.rotVelocity.y*r),!1===this.isFirstPerson&&"none"!==this.orientMode&&this.directionXZ.manhattanLength()>0){if("radial"===this.orientMode){this.objectToCamXZ.copy(this.objectToCamXZ0).applyAxisAngle(b7,this.euler.y-this.euler0.y);let e=h7.copy(this.objectToCamXZ).normalize(),t=u7.copy(c).multiplyScalar(r);t.y=0;let i=t.sub(c7.copy(e).multiplyScalar(t.dot(e))).cross(e).y;this.euler.y-=Math.atan2(i,this.objectToCamXZ.length())}}else this.rot.y+=this.rotVelocity.y*r+this.groundYRotation,0!==this.rotVelocityTarget.y&&(!1===this.cameraFollow||"Locked"===this.cameraYAxis)&&(this.euler.y=this.rot.y);if(!0===this.cameraFollow&&("walk"===this.moveMode?"Limit"===this.cameraXAxis?this.euler.x=cA.clamp(this.euler.x,-this.maxPolarAngle+this.cameraPolarOffset+1e-6,-this.minPolarAngle+this.cameraPolarOffset-1e-6):this.euler.x=cA.clamp(this.euler.x,-this.PI_2+this.cameraPolarOffset,this.PI_2+this.cameraPolarOffset):"Limit"===this.cameraXAxis&&(this.euler.x=cA.clamp(this.euler.x,-this.PI_2,this.PI_2))),"fly"===this.moveMode?this.rot.x=this.euler.x:this.isFirstPerson&&(t?(v7.copy(t),v7.y=0):(v7.copy(this.euler),v7.y=0),this.nonColliderRotOffset.makeRotationFromEuler(v7)),t&&("walk"===this.moveMode?(this.rot.y=t.y,this.rot.x=0,this.rot.z=0):this.rot.setFromEuler(t),this.rot.y+=this.vrEulerYOffset*A7),m7.setFromAxisAngle(y7,this.rot.x),g7.setFromAxisAngle(b7,this.rot.y),g7.multiply(m7),m7.setFromAxisAngle(x7,this.rot.z),g7.multiply(m7),this.quaternion.copy(g7),this.objectRealQuat.multiplyQuaternions(this.quaternion,this.objXZQuat),this.colliderWorldQuat.copy(this.objectRealQuat).multiply(this.collider.rotation),this.collisionEnabled)if(this.usePhysics){var h,u;let e=h7.copy(c).multiplyScalar(r/this.pixelsPerMeter),t=null;this.didHit=!1;let i=new FA;for(let n=0;n<5;n++){var d;let r=e.length(),a=u7.copy(e).normalize();if(t=this.sharedGameControlGlobals.rapierWorld.castShape(this.colliderWorldPosition.divideScalar(this.pixelsPerMeter).add(i),this.colliderWorldQuat,a,null===(d=this.object.rigidBody)||void 0===d?void 0:d.collider(0).shape,r,!1,24,void 0,void 0,this.object.rigidBody),null===t){0===n&&0!==this.directionXZ.manhattanLength()&&(this.lastHitObj=null),i.add(e);break}{this.didHit=!0;let s=this.sharedGameControlGlobals.colliderToEntity.get(t.collider.handle);if(s!==this.lastHitObj&&0===n){this.lastHitObj=s;let e=this.sharedGameControlGlobals.entityToCollisionEvents[null===s||void 0===s?void 0:s.uuid];if(e)for(let i of e)if("character"===i.data.target){var p;let e,n=(null===(p=this.sharedGameControlGlobals.rapierWorld)||void 0===p?void 0:p.getCollider(t.collider.handle))._parent;if(s.cloner)for(let t of s.cloner.children)if(t.rigidBody===n){e=t;break}i.dispatch(e),s.dispatchEvent(Kte)}}let o=s7.set(t.normal2.x,t.normal2.y,t.normal2.z).applyQuaternion(this.colliderWorldQuat),l=o7.copy(a).multiplyScalar(t.toi).dot(o),c=t.toi;if(0===c&&(this.position.y+=this.offset*this.pixelsPerMeter),l>this.offset&&(c=t.toi*(l-this.offset)/l,i.addScaledVector(a,c)),e.copy(a).multiplyScalar(r-c),Math.acos(-o.y)>this.slopeThresh){var f;let n=this.colliderWorldPosition.divideScalar(this.pixelsPerMeter).add(i),r=u7.copy(t.witness2).applyQuaternion(this.colliderWorldQuat);r.y=0;let a=n.add(r);a.y+=this.stepThresh;let s=this.sharedGameControlGlobals.rapierWorld.castShape(a,this.colliderWorldQuat,e,null===(f=this.object.rigidBody)||void 0===f?void 0:f.collider(0).shape,1,!1,24,void 0,void 0,this.object.rigidBody);null!==s&&0===s.toi&&(o.y=0,o.normalize())}e.addScaledVector(o,-e.dot(o))}}this.position.addScaledVector(i,this.pixelsPerMeter),null!==(h=this.object.rigidBody)&&void 0!==h&&h.setTranslation(c7.copy(this.position).divideScalar(this.pixelsPerMeter),!0),null===(u=this.object.rigidBody)||void 0===u||u.setRotation(m7.copy(this.quaternion).premultiply(this.groundTilt).multiply(this.objXZQuat),!0)}else{let e=this.onObject?1:5,t=c.multiplyScalar(r/e);for(let i=0;i<e;i++)this.position.add(t),this.collisionAdjustment(r/e)}else this.position.addScaledVector(c,r);if("walk"===this.moveMode&&this.onObject&&(this.velocityTarget.y=0,this.velocity.y=0),this.quaternion.premultiply(this.groundTilt).multiply(this.objXZQuat),this.object.matrix.compose(this.position,this.quaternion,this.scale),this.object.matrixWorldNeedsUpdate=!0,this.object.matrix.multiply(this.nonColliderPosOffset).multiply(this.nonColliderRotOffset),this.quaternion.premultiply(this.groundTiltInv).multiply(this.objXZQuatInv),!0===this.cameraFollow){this.updateFollowArms();let e=this.objectToTarget.add(this.position),t=this.targetToCamera.add(e);d7.lookAt(t,e,b7).setPosition(t),d7.decompose(this.targetPos,this.targetQuat,c7),this.camera.quaternion.slerp(this.targetQuat,1-(1-this.lerpFactorRotCamera)**a),this.camera.position.lerp(this.targetPos,1-(1-this.lerpFactorPosCamera)**a),this.camera.updateMatrix(),this.camera.updateMatrixWorld(),"Limit"===this.cameraYAxis&&"cartesian"===this.orientMode&&(this.euler.y=cA.clamp(this.euler.y,this.minAzimuthAngleRel,this.maxAzimuthAngleRel)),this.euler.x=cA.clamp(this.euler.x,-this.PI_2+(this.cameraPolarOffset<0?this.cameraPolarOffset:0),this.PI_2+(this.cameraPolarOffset>0?this.cameraPolarOffset:0))}return this.eulerDelta.set(0,0,0),this.object.dispatchEvent(C7),(!(this.path.length<2&&this.lastPosition.distanceToSquared(this.position)<this.threshEndTranslate&&Math.abs(this.rotVelocity.x)<this.threshEndRotVel&&Math.abs(this.rotVelocity.y)<this.threshEndRotVel&&(void 0===this.camera||this.isFirstPerson||this.lastCameraPosition.distanceToSquared(this.camera.position)<this.threshEndTranslate&&8*(1-this.lastCameraQuaternion.dot(this.camera.quaternion))<this.threshEndRotate))||"fly"!==this.moveMode&&!0!==this.onObject&&!1!==this.collisionEnabled||!(null===this.navMeshPathDest||this.navMeshPathDest.material.opacity<-.04*(null===(n=this.navMeshPathDest)||void 0===n||null===(n=n.material)||void 0===n?void 0:n.userData.opacity0)))&&(this.camera&&(this.lastCameraPosition.copy(this.camera.position),this.lastCameraQuaternion.copy(this.camera.quaternion)),this.lastPosition.copy(this.position),this.object.dispatchEvent(E7),!0)}updateFollowArms(){this.objectToTarget.copy(this.objectToTarget0),this.targetToCamera.copy(this.targetToCamera0);let e,t=m7.setFromAxisAngle(b7,"Limit"===this.cameraYAxis&&"radial"!==this.orientMode?cA.clamp(this.euler.y-this.euler0.y,this.minAzimuthAngleRel,this.maxAzimuthAngleRel):this.euler.y-this.euler0.y);("Locked"!==this.cameraYAxis||"radial"===this.orientMode)&&this.objectToTarget.applyQuaternion(t),e="Limit"===this.cameraXAxis?cA.clamp(this.euler.x,-this.maxPolarAngle+this.cameraPolarOffset+1e-6,-this.minPolarAngle+this.cameraPolarOffset-1e-6):cA.clamp(this.euler.x,-this.PI_2+this.cameraPolarOffset+1e-6,this.PI_2+this.cameraPolarOffset-1e-6);let i=c7.copy(this.cameraPolarAxis0);("Locked"!==this.cameraYAxis||"radial"===this.orientMode)&&i.applyQuaternion(t);let n=g7.setFromAxisAngle(i,e);"Locked"!==this.cameraYAxis&&this.targetToCamera.applyQuaternion(t),"Locked"!==this.cameraXAxis&&this.targetToCamera.applyQuaternion(n)}groundTiltAdjustment(e){180*b7.angleTo(e)/Math.PI<15||180*b7.angleTo(e)/Math.PI>85?m7.identity():m7.setFromUnitVectors(b7,e),this.groundTilt.slerp(m7,.06),this.groundTiltInv.copy(this.groundTilt).invert()}collisionAdjustment(e){var t;let i=o7.set(0,0,0);this.object.matrix.compose(this.position,this.quaternion,this.scale);let n=d7.multiplyMatrices(this.object.matrix,this.objXZRotMat).multiply(this.collider.matrix).decompose(c7,m7,h7).compose(c7,m7,w7);this.sharedGameControlGlobals.entitiesWithTransformAnim.forEach((e=>{if(e===this.object||e.isDescendantOf(this.object))return;S7.makeEmpty(),e.updateMatrixWorldSVD();let t=e.matrixWorldRigid,r=p7.copy(t).invert(),a=f7.copy(p7).multiply(n);_7.copy(this.collider.segment),_7.start.applyMatrix4(a),_7.end.applyMatrix4(a);let s=s7.copy(this.position).applyMatrix4(r);S7.expandByPoint(_7.start),S7.expandByPoint(_7.end),S7.min.addScalar(-this.collider.radius),S7.max.addScalar(this.collider.radius),e.bvhGeometry.boundsTree.shapecast({traverseBoundsOrder:e=>e.distanceToPoint(_7.end),intersectsBounds:e=>e.intersectsBox(S7),intersectsTriangle:e=>{let n=c7,r=h7,a=e.closestPointToSegment(_7,n,r);if(a<this.collider.radius){let e=this.collider.radius-a,o=r.sub(n).normalize(),l=u7.copy(s);l.addScaledVector(o,e);let c=l.applyMatrix4(t).sub(this.position);i.add(c),_7.start.addScaledVector(o,e),_7.end.addScaledVector(o,e)}}})})),S7.makeEmpty(),_7.copy(this.collider.segment),_7.start.applyMatrix4(n),_7.end.applyMatrix4(n),S7.expandByPoint(_7.start),S7.expandByPoint(_7.end),S7.min.addScalar(-this.collider.radius),S7.max.addScalar(this.collider.radius),null!==(t=this.sharedGameControlGlobals.staticMeshBVH)&&void 0!==t&&t.shapecast({traverseBoundsOrder:e=>e.distanceToPoint(_7.end),intersectsBounds:e=>e.intersectsBox(S7),intersectsTriangle:e=>{let t=c7,n=h7,r=e.closestPointToSegment(_7,t,n);if(r<this.collider.radius){let e=this.collider.radius-r,a=n.sub(t).normalize();this.alignToGround&&this.groundTiltAdjustment(a),i.addScaledVector(a,e),_7.start.addScaledVector(a,e),_7.end.addScaledVector(a,e)}}}),this.onObject=Math.abs(i.y)>Math.abs(e*this.velocity.y*.25),this.onObject&&this.dispatchStopEvent("jump");let r=Math.max(0,i.length()-1e-5);i.normalize().multiplyScalar(r),this.position.add(i)}},T7=M7;T7.isLocked=!1;var P7=J_(tS());function D7(e,t){let i=new fT;if(!e.getAttribute("position"))return i.setAttribute("position",new sT([],3)),i.setIndex([]),i;let{positions:n,triIndices:r}=UZ(e.getAttribute("position"),e.getIndex());return i.setAttribute("position",new sT(n,3)),i.setIndex(r),t&&i.applyMatrix4(t),i}var k7=new mM,O7=new mM,I7=[[0,0,0],[0,0,0],[0,0,0]];function R7(e){let t=e.elements;I7[0][0]=t[0],I7[0][1]=t[4],I7[0][2]=t[8],I7[1][0]=t[1],I7[1][1]=t[5],I7[1][2]=t[9],I7[2][0]=t[2],I7[2][1]=t[6],I7[2][2]=t[10];let{u:i,v:n}=(0,P7.SVD)(I7),r=k7.set(i[0][0],i[0][1],i[0][2],0,i[1][0],i[1][1],i[1][2],0,i[2][0],i[2][1],i[2][2],0,0,0,0,1),a=O7.set(n[0][0],n[0][1],n[0][2],0,n[1][0],n[1][1],n[1][2],0,n[2][0],n[2][1],n[2][2],0,0,0,0,1);return r.multiply(a.transpose())}var L7=class extends vR{constructor(){super(),this.layers.enable(3),this.layers.enable(8)}setFromCamera(e,t){t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):t.isPerspectiveCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):console.error("Raycaster: Unsupported camera type.")}intersectVisibleObjects(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return e.forEach((e=>{e.visible&&this.intersectObject(e,t,i)})),i}createRaycastLineHelper(){let e=new qk({color:65280,linewidth:10}),t=new FA(this.ray.origin.x,this.ray.origin.y,this.ray.origin.z),i=new FA(this.ray.direction.x,this.ray.direction.y,this.ray.direction.z),n=this.camera.far-this.camera.near,r=(new FA).addVectors(t,i.multiplyScalar(n)),a=new fT;return a.setFromPoints([t,r]),new Jk(a,e)}},B7=e=>e instanceof Z1||e instanceof K4;function z7(e,t){return e.distance-t.distance}function N7(e,t,i){if(KX(t)&&t.visible){q1(t)&&t.raycast(e,i);for(let n of t.children)N7(e,n,i)}}function F7(e,t,i){if(!(arguments.length>3&&void 0!==arguments[3]&&arguments[3])&&!i.some((t=>void 0!==U7(e,t))))return[];let n=[];return t.children.forEach((t=>N7(e,t,n))),n.sort(z7),n}function j7(e){let t=[];if(e.length){let i=e[0].object;KX(i)&&t.push(i);let n=i.parent;for(;n;)B7(n)&&t.push(n),n=n.parent}return t}function V7(e,t,i,n){let r=e.frame;if(r){let e=t[0]*r.width,a=(1-t[1])*r.height;for(let t of i){let i=t===r.uuid?r:r.find(t);if(null!==i&&void 0!==i&&i.intersects(e,a))return n(i),!0}}return!1}function U7(e,t){if(q1(t)){if(t.visible){let i=[];return t.raycast(e,i),i.length?i[0]:void 0}}else if(B7(t))return G7(e,t)}function G7(e,t){if(KX(t)&&t.visible){if(q1(t)){let i=[];if(t.raycast(e,i),i.length)return i[0]}for(let i of t.children){let t=G7(e,i);if(t)return t}}}var H7=class{constructor(e,t,i,n,r,a,s,o){this.renderer=e,this.publish=t,this.scene=i,this.getCamera=n,this.sharedAssets=r,this.requestRender=a,this.isExport=s,this.frame=o,this.raycaster=new L7,this._useWindowEvents=!1,this.pointerWorld={x:0,y:0},this.pointerScreen={x:0,y:0},this._useWindowEvents="window"===t.mouseEventTarget,this.domElement=e.domElement,this.eventElement=this._useWindowEvents?window:e.domElement,this._domRect=this.domElement.getBoundingClientRect()}get stopRaycast(){return this.publish.stopRaycast}get page(){return this.scene.activePage}set useWindowEvents(e){this._useWindowEvents=e,this.eventElement=e?window:this.renderer.domElement}get useWindowEvents(){return this._useWindowEvents}set domRect(e){this._domRect=e}get domRect(){return this._domRect}updateRaycaster(e){var t;let{pageX:i,pageY:n}=(null===(t=e.touches)||void 0===t?void 0:t.length)>0?e.touches[0]:e;this.pointerWorld=function(e,t,i){return{x:(e-(i.left+window.scrollX))/i.width*2-1,y:-(t-(i.top+window.scrollY))/i.height*2+1}}(i,n,this._domRect),this.pointerScreen=function(e,t,i){return{x:(e-(i.left+window.scrollX))/i.width,y:1-(t-(i.top+window.scrollY))/i.height}}(i,n,this._domRect),this.raycaster.setFromCamera(this.pointerWorld,this.getCamera())}},W7=class{constructor(e){this.eventContext=e,this.domEventsNeeded=new Set,this.hasVideoAction=!1}connect(){}disconnect(){}},q7=[["start","Start"],["keyDown","KeyDown"],["keyUp","KeyUp"],["mouseDown","MouseDown"],["mouseUp","MouseUp"],["mouseHover","MouseHover"],["collision","Collision"],["lookAt","LookAt"],["follow","Follow"],["scroll","Scroll"]],X7=e=>{var t;return null===(t=q7.find((t=>{let[i,n]=t;return n===e})))||void 0===t?void 0:t[0]},Y7=e=>{var t;return null===(t=q7.find((t=>{let[i]=t;return i===e})))||void 0===t?void 0:t[1]},Q7=(e,t)=>{let i=X7(e);if(i){let e=new CustomEvent(i,{bubbles:!0});return Object.defineProperty(e,"target",{writable:!1,value:t}),e}},Z7=class extends W7{constructor(e){super(e),this.objectsPerEvents=new Map,this.splineEvents={},this.onBeginEvent=e=>{var t;if(!e.eventName||!e.target||"Scroll"===e.eventName)return;let i=null===(t=this.splineEvents[X7(e.eventName)])||void 0===t?void 0:t[e.target.uuid];if(!i)return;"Scroll"===e.eventName&&void 0!==e.deltaY&&Object.assign(i,{deltaY:e.deltaY});let{domElement:n}=this.eventContext;n.dispatchEvent(i)};let{page:t}=this.eventContext;t.traverseEntity((e=>{var t;if(null!==(t=e.data)&&void 0!==t&&t.events.length)for(let[n,r]of q7)if(e.data.events.some((e=>e.data.type===r&&!e.data.disabled))){var i;this.objectsPerEvents.has(n)?null===(i=this.objectsPerEvents.get(n))||void 0===i||i.push(e):this.objectsPerEvents.set(n,[e]);let t={id:e.uuid,name:e.name},a=Q7(r,t),s=this.splineEvents[n];s?s[e.uuid]=a:this.splineEvents[n]={[e.uuid]:a}}}))}connect(){this.objectsPerEvents.forEach((e=>{e.forEach((e=>{e.addEventListener("beginEvent",this.onBeginEvent)}))}))}disconnect(){this.objectsPerEvents.forEach((e=>{e.forEach((e=>{e.removeEventListener("beginEvent",this.onBeginEvent)}))}))}},K7=class{constructor(e,t,i,n,r,a){if(this.id=e,this.data=t,this.object=i,this.entered=!1,this.alreadyPlayedNonTogglingActions=new Set,this.useToggle="Toggle"===t.runMode,("KeyDown"===t.type||"KeyUp"===t.type||"KeyPress"===t.type)&&!t.key)throw new Error("Missing property");this.actions=q9(t,t.actions,n,r,a,i)}disconnect(){X9(this.actions)}dispatchHeld(e){this.actions.Create.forEach((t=>{e&&t.dispatchThrottled.cancel(),t.dispatchThrottled()}))}dispatch(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.actions.Transition.forEach((e=>{e.object.currentTransitionEvent!==this?(e.object.currentTransitionEvent=this,e.init()):"Once"===this.data.runMode&&this.alreadyPlayedNonTogglingActions.add(e)})),this.useToggle?(this.actions.Transition.forEach((e=>{e.toggle()})),this.actions.Animation.forEach((e=>{e.toggle()})),this.actions.SwitchCamera.forEach((e=>{e.toggle()}))):"MousePress"===this.data.type||"KeyPress"===this.data.type?this.entered||(this.entered=!0,this.actions.Transition.forEach((e=>e.playFromCurrent())),this.actions.Animation.forEach((e=>e.playFromCurrent())),this.actions.SwitchCamera.forEach((e=>e.playFromCurrent())),this.actions.Create.forEach((e=>e.dispatchStart()))):(this.actions.Transition.some((e=>e.playing))||this.actions.Transition.forEach((e=>{!1===this.alreadyPlayedNonTogglingActions.has(e)&&e.play()})),this.actions.SwitchCamera.some((e=>e.playing))||this.actions.SwitchCamera.forEach((e=>{e.play()})),this.actions.Animation.forEach((e=>{e.play()}))),this.actions.Link.forEach((e=>{e.dispatch()})),this.actions.SceneTransition.forEach((e=>{e.dispatch()})),!1===e&&this.actions.Create.forEach((e=>{e.dispatch()})),this.actions.Destroy.forEach((e=>{e.dispatch()})),this.actions.Reset.forEach((e=>{e.dispatch()})),this.actions.Audio.forEach((e=>{e.dispatchBasic()})),this.actions.Video.forEach((e=>{e.dispatchBasic()})),this.actions.Particles.forEach((e=>{e.dispatchBasic()})),this.actions.SetVariable.forEach((e=>e.checkConditions())),this.actions.SetVariable.forEach((e=>e.dispatch())),this.actions.DynamicVariablePlay.forEach((e=>e.dispatch()))}dispatchRelease(){this.entered&&(this.entered=!1,this.actions.Transition.forEach((e=>e.reverseFromCurrent())),this.actions.Particles.forEach((e=>e.reverseFromCurrent())),this.actions.Animation.forEach((e=>e.reverseFromCurrent())),this.actions.SwitchCamera.forEach((e=>e.reverseFromCurrent())),this.actions.Create.forEach((e=>e.dispatchStop())))}dispatchUserEvent(e){this.actions.Transition.forEach((e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this,e.init())})),e?(this.actions.Transition.forEach((e=>e.reverseFromCurrent())),this.actions.Animation.forEach((e=>e.reverseFromCurrent())),this.actions.SwitchCamera.forEach((e=>e.reverseFromCurrent()))):(this.actions.Transition.forEach((e=>e.playFromCurrent())),this.actions.Animation.forEach((e=>e.playFromCurrent())),this.actions.SwitchCamera.forEach((e=>e.playFromCurrent()))),this.actions.Link.forEach((e=>{e.dispatch()})),this.actions.SceneTransition.forEach((e=>{e.dispatch()})),this.actions.Create.forEach((e=>{e.dispatch()})),this.actions.Destroy.forEach((e=>{e.dispatch()})),this.actions.Reset.forEach((e=>{e.dispatch()})),this.actions.Audio.forEach((e=>{e.dispatchBasic()})),this.actions.Video.forEach((e=>{e.dispatchBasic()})),this.actions.Particles.forEach((e=>{e.dispatchBasic()})),this.actions.SetVariable.forEach((e=>e.checkConditions())),this.actions.SetVariable.forEach((e=>e.dispatch())),this.actions.DynamicVariablePlay.forEach((e=>e.dispatch()))}},J7=class extends W7{constructor(e,t,i){super(e),this.useForRaycastProperty=i,this.objectsPerTypes={MouseDown:[],MouseUp:[],MousePress:[],KeyDown:[],KeyUp:[],KeyPress:[]},this.canvasMouseEvents=[],this.eventsPerObjects={MouseDown:{},MouseUp:{},MousePress:{},KeyDown:{},KeyUp:{},KeyPress:{}},this.heldKeys={},this.heldKeysPress={},this._prevObjects=[],this.sceneInterects=null,this.onCanvasRaycast=e=>{if(!0===this.useForRaycastProperty&&null===this.sceneInterects){this.eventContext.updateRaycaster(e);let{raycaster:t,page:i}=this.eventContext,n=F7(t,i,[],!0);this.sceneInterects=n,n.length&&(this.eventContext.sharedAssets.raycastProperty={x:n[0].point.x,y:n[0].point.y,z:n[0].point.z,objX:n[0].object.matrixWorld.elements[12],objY:n[0].object.matrixWorld.elements[13],objZ:n[0].object.matrixWorld.elements[14]})}},this.onCanvasMouseDown=e=>{(e.target===this.eventContext.domElement||"SPLINE-VIEWER"===e.target.tagName)&&this.canvasMouseEvents.forEach((t=>{("MouseDown"===t.data.type||"MousePress"===t.data.type)&&(this.onCanvasRaycast(e),t.dispatch())}))},this.onCanvasMouseUp=e=>{(e.target===this.eventContext.domElement||"SPLINE-VIEWER"===e.target.tagName)&&this.canvasMouseEvents.forEach((t=>{"MouseUp"===t.data.type?(this.onCanvasRaycast(e),t.dispatch()):"MousePress"===t.data.type&&t.dispatchRelease()}))},this.onMouseDown=e=>{Rj.length>1||(this.eventContext.updateRaycaster(e),this.handleMouseEvent("MouseDown"))},this.onMouseUp=e=>{Rj.length>1||(this.eventContext.updateRaycaster(e),this.handleMouseEvent("MouseUp"))},this.onMousePressDown=e=>{Rj.length>1||(this.eventContext.updateRaycaster(e),this.handleMousePressEvent())},this.onMousePressRelease=e=>{Rj.length>1||(this.eventContext.updateRaycaster(e),this.handleMousePressEvent(!0))},this.onKeyDown=e=>{this.heldKeys[e.key]||(this.handleKeyEvent(e,"KeyDown"),this.handleKeyEventHeld(e,"KeyDown",!0)),this.heldKeys[e.key]=!0},this.onKeyUp=e=>{this.handleKeyEvent(e,"KeyUp"),this.handleKeyEventHeld(e,"KeyUp",!0)},this.onKeyPressDown=e=>{this.heldKeysPress[e.key]?this.handleKeyEventHeld(e,"KeyPress"):(this.handleKeyEvent(e,"KeyPress"),this.handleKeyEventHeld(e,"KeyPress",!0)),this.heldKeysPress[e.key]=!0},this.onKeyPressUp=e=>{this.handleKeyEvent(e,"KeyPress",!0)},this.releaseHeldKey=e=>{delete this.heldKeys[e.key]},this.releaseHeldKeyPress=e=>{delete this.heldKeysPress[e.key]},this._onUserEvent=e=>{var t,i;let{eventName:n,target:r,reverse:a}=e;if(!n||!r)return;let s=Y7(n);s&&("MouseDown"===s||"MouseUp"===s||"MousePress"===s?(r.dispatchEvent({type:"beginEvent",eventName:s}),null===(t=this.eventsPerObjects[s])||void 0===t||null===(t=t[r.uuid])||void 0===t||t.forEach((e=>{e.dispatchUserEvent(a)}))):("KeyDown"===s||"KeyUp"===s||"KeyPress"===s)&&(r.dispatchEvent({type:"beginEvent",eventName:s}),null===(i=this.eventsPerObjects[s])||void 0===i||null===(i=i[r.uuid])||void 0===i||i.forEach((e=>{e.dispatchUserEvent()}))))};let{page:n,sharedAssets:r}=this.eventContext,a=(e,i)=>{var a;if(null===(a=e.data)||void 0===a||!a.events.length)return;let s=["MouseDown","MouseUp","MousePress","KeyDown","KeyUp","KeyPress"];for(let l of s){var o;let a=this.eventsPerObjects[l];e.data.events.filter((e=>{let{data:t}=e;return t.type===l&&!0!==t.disabled})).forEach((i=>{let{id:s,data:o}=i;try{let i=new K7(s,o,e,n,r,t);i.actions.Video.length&&(this.hasVideoAction=!0),"MouseDown"!==o.type&&"MouseUp"!==o.type&&"MousePress"!==o.type||"Canvas"!==o.mode&&"Window"!==o.mode?a[e.uuid]?a[e.uuid].some((e=>e.id===i.id))||a[e.uuid].push(i):a[e.uuid]=[i]:this.canvasMouseEvents.push(i)}catch(w){}})),(null===(o=a[e.uuid])||void 0===o?void 0:o.length)&&this.objectsPerTypes[l].push(e instanceof r4&&("MouseDown"===l||"MouseUp"===l||"MousePress"===l)?i:e)}};n.traverseEntity((e=>{var t;(e instanceof i5||e instanceof X4)&&null!==(t=e.frame)&&void 0!==t&&t.traverse((t=>{a(t,e)})),a(e)}))}connect(){var e,t,i,n,r,a;let{domElement:s}=this.eventContext;this.heldKeys={},this.heldKeysPress={},this.domEventsNeeded.clear(),s.addEventListener("pointerdown",this.onCanvasMouseDown),s.addEventListener("pointerup",this.onCanvasMouseUp),(null!==(e=this.objectsPerTypes.MouseDown)&&void 0!==e&&e.length||this.useForRaycastProperty)&&(this.domEventsNeeded.add("pointerdown"),s.addEventListener("pointerdown",this.onMouseDown)),null!==(t=this.objectsPerTypes.MouseUp)&&void 0!==t&&t.length&&(this.domEventsNeeded.add("pointerup"),s.addEventListener("pointerup",this.onMouseUp)),null!==(i=this.objectsPerTypes.MousePress)&&void 0!==i&&i.length&&(this.domEventsNeeded.add("pointerdown"),s.addEventListener("pointerdown",this.onMousePressDown),this.domEventsNeeded.add("pointerup"),s.addEventListener("pointerup",this.onMousePressRelease)),null!==(n=this.objectsPerTypes.KeyDown)&&void 0!==n&&n.length&&(this.domEventsNeeded.add("keydown"),document.addEventListener("keydown",this.onKeyDown),document.addEventListener("keyup",this.releaseHeldKey)),null!==(r=this.objectsPerTypes.KeyUp)&&void 0!==r&&r.length&&(this.domEventsNeeded.add("keyup"),document.addEventListener("keyup",this.onKeyUp)),null!==(a=this.objectsPerTypes.KeyPress)&&void 0!==a&&a.length&&(this.domEventsNeeded.add("keydown"),document.addEventListener("keydown",this.onKeyPressDown),document.addEventListener("keyup",this.releaseHeldKeyPress),this.domEventsNeeded.add("keyup"),document.addEventListener("keyup",this.onKeyPressUp)),Object.entries(this.objectsPerTypes).forEach((e=>{let[t,i]=e;i.forEach((e=>{e.addEventListener("userEvent",this._onUserEvent)}))}))}disconnect(){let{domElement:e}=this.eventContext;this.domEventsNeeded.clear(),this.heldKeys={},this.heldKeysPress={},e.removeEventListener("pointerdown",this.onCanvasMouseDown),e.removeEventListener("pointerup",this.onCanvasMouseUp),e.removeEventListener("pointerdown",this.onMouseDown),e.removeEventListener("pointerdown",this.onMousePressDown),e.removeEventListener("pointerup",this.onMouseUp),e.removeEventListener("pointerup",this.onMousePressRelease),document.removeEventListener("keydown",this.onKeyDown),document.removeEventListener("keyup",this.onKeyUp),document.removeEventListener("keydown",this.onKeyPressDown),document.removeEventListener("keyup",this.onKeyPressUp),document.removeEventListener("keyup",this.releaseHeldKey),Object.values(this.eventsPerObjects).forEach((e=>{Object.values(e).forEach((e=>{e.forEach((e=>{e.disconnect()}))}))})),this.canvasMouseEvents.forEach((e=>{e.disconnect()})),Object.entries(this.objectsPerTypes).forEach((e=>{let[t,i]=e;i.forEach((e=>{e.removeEventListener("userEvent",this._onUserEvent)}))}))}handleMouseEvent(e){let{stopRaycast:t,raycaster:i,page:n,pointerScreen:r}=this.eventContext,a=this.objectsPerTypes[e],s=a.filter((e=>!(e instanceof r4)));if((a.length||this.useForRaycastProperty)&&(!n.uiCanvas||!V7(n,[r.x,r.y],Object.keys(this.eventsPerObjects[e]),(t=>{this.handleObjectMouseEventDispatch(t,e)})))){if(t||this.useForRaycastProperty){let r;if(null===this.sceneInterects?r=F7(i,n,s,this.useForRaycastProperty):(r=this.sceneInterects,this.sceneInterects=null),this.useForRaycastProperty&&r.length&&(this.eventContext.sharedAssets.raycastProperty={x:r[0].point.x,y:r[0].point.y,z:r[0].point.z,objX:r[0].object.matrixWorld.elements[12],objY:r[0].object.matrixWorld.elements[13],objZ:r[0].object.matrixWorld.elements[14]}),t){var o,l,c,h;let t=[null!==(o=null===(l=r[0])||void 0===l||null===(l=l.uv)||void 0===l?void 0:l.x)&&void 0!==o?o:0,null!==(c=null===(h=r[0])||void 0===h||null===(h=h.uv)||void 0===h?void 0:h.y)&&void 0!==c?c:0];j7(r).forEach((i=>{i instanceof i5&&V7(i,t,Object.keys(this.eventsPerObjects[e]),(t=>{this.handleObjectMouseEventDispatch(t,e)})),this.eventsPerObjects[e][i.uuid]&&this.handleObjectMouseEventDispatch(i,e)}))}}t||s.forEach((t=>{var n,r,a,s;let o=U7(i,t);o&&(this.handleObjectMouseEventDispatch(t,e),t instanceof i5&&V7(t,[null!==(n=null===o||void 0===o||null===(r=o.uv)||void 0===r?void 0:r.x)&&void 0!==n?n:0,null!==(a=null===o||void 0===o||null===(s=o.uv)||void 0===s?void 0:s.y)&&void 0!==a?a:0],Object.keys(this.eventsPerObjects[e]),(t=>{this.handleObjectMouseEventDispatch(t,e)})))}))}}handleMousePressEvent(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t="MousePress",i=this.objectsPerTypes[t],n=i.filter((e=>!(e instanceof r4))),r=[];if(i.length){if(!e){let{stopRaycast:e,raycaster:i,page:a,pointerScreen:s}=this.eventContext,o=!1;if(a.uiCanvas&&(o=V7(a,[s.x,s.y],Object.keys(this.eventsPerObjects[t]),(e=>{r.push(e)}))),e&&!o){let e=F7(i,a,n);r=j7(e),e.forEach((e=>{var i,n,a,s;e.object instanceof i5&&V7(e.object,[null!==(i=null===e||void 0===e||null===(n=e.uv)||void 0===n?void 0:n.x)&&void 0!==i?i:0,null!==(a=null===e||void 0===e||null===(s=e.uv)||void 0===s?void 0:s.y)&&void 0!==a?a:0],Object.keys(this.eventsPerObjects[t]),(e=>{r.push(e)}))}))}else n.forEach((e=>{var n,a,s,o;let l=U7(i,e);l&&(r.push(e),e instanceof i5&&V7(e,[null!==(n=null===l||void 0===l||null===(a=l.uv)||void 0===a?void 0:a.x)&&void 0!==n?n:0,null!==(s=null===l||void 0===l||null===(o=l.uv)||void 0===o?void 0:o.y)&&void 0!==s?s:0],Object.keys(this.eventsPerObjects[t]),(e=>{r.push(e)})))}))}this._prevObjects.length&&this._prevObjects.forEach((e=>{r.includes(e)||this.handleObjectMouseEventDispatchRelease(e,t)})),r.length&&r.forEach((e=>{this.handleObjectMouseEventDispatch(e,t)})),this._prevObjects=r}}handleObjectMouseEventDispatch(e,t){var i;e.dispatchEvent({type:"beginEvent",eventName:t}),null===(i=this.eventsPerObjects[t])||void 0===i||null===(i=i[e.uuid])||void 0===i||i.forEach((e=>{e.dispatch()}))}handleObjectMouseEventDispatchRelease(e,t){var i;e.dispatchEvent({type:"beginEvent",eventName:t}),null===(i=this.eventsPerObjects[t])||void 0===i||null===(i=i[e.uuid])||void 0===i||i.forEach((e=>{e.dispatchRelease()}))}handleKeyEvent(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.objectsPerTypes[t].forEach((n=>{let r=this.eventsPerObjects[t][n.uuid];r.some((t=>{let{data:i}=t;return"key"in i&&i.key===e.key}))&&n.dispatchEvent({type:"beginEvent",eventName:t}),r.forEach((t=>{"key"in t.data&&t.data.key===e.key&&(i?t.dispatchRelease():t.dispatch(!0))}))}))}handleKeyEventHeld(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.objectsPerTypes[t].forEach((n=>{this.eventsPerObjects[t][n.uuid].forEach((t=>{"key"in t.data&&t.data.key===e.key&&t.dispatchHeld(i)}))}))}},$7=new FA,eee=new FA,tee=class{constructor(e,t,i,n,r){this.actionsIn=q9(e,e.inActions,i,n,r,t),this.actionsOut=q9(e,e.outActions,i,n,r,t)}disconnect(){X9(this.actionsIn),X9(this.actionsOut)}},iee=class extends tee{constructor(e,t,i,n,r,a){super(t,i,n,r,a),this.id=e,this.data=t,this.object=i,this.stage="out",this.objects=[],this.onUpdateMatrixWorld=()=>{for(let n of this.objects)if(!n.visible)return;let e=$7.setFromMatrixPosition(this.objects[0].matrixWorld),t=eee.setFromMatrixPosition(this.objects[1].matrixWorld),i=e.distanceTo(t)<=this.distance?"in":"out";if(this.stage!==i){this.stage=i;let e="in"===i?this.actionsIn:this.actionsOut;e.Audio.forEach((e=>e.dispatchConditional())),e.Particles.forEach((e=>e.dispatchConditional())),e.Video.forEach((e=>e.dispatchConditional())),e.Link.forEach((e=>e.dispatch())),e.Create.forEach((e=>e.dispatch())),e.Destroy.forEach((e=>e.dispatch())),e.Reset.forEach((e=>e.dispatch())),e.Transition.forEach((e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this),e.init()})),e.Transition.forEach((e=>e.play())),e.Animation.forEach((e=>e.play())),e.SwitchCamera.forEach((e=>e.play())),e.SceneTransition.forEach((e=>e.dispatch())),e.SetVariable.forEach((e=>e.checkConditions())),e.SetVariable.forEach((e=>e.dispatch())),e.DynamicVariablePlay.forEach((e=>e.dispatch()))}};let{distance:s,fromObject:o,toObject:l}=t.condition;this.distance=s;for(let c of[o,l]){if(!c)throw new Error("Missing property");let e=n.find(c);if(!e)throw new Error("Missing property");this.objects.push(e)}}connect(){window.setTimeout((()=>{this.objects.forEach((e=>{e.addEventListener("updateMatrixWorld",this.onUpdateMatrixWorld)})),this.onUpdateMatrixWorld()}),0)}disconnect(){super.disconnect(),this.stage="out",this.objects.forEach((e=>{e.removeEventListener("updateMatrixWorld",this.onUpdateMatrixWorld)}))}},nee=class extends tee{constructor(e,t,i,n,r,a){var s,o;super(t,i,n,r,a),this.id=e,this.data=t,this.object=i,this.onBegin=e=>{let{target:t,state:i}=e;this.toState!==i&&(this.actionsOut.Audio.forEach((e=>e.dispatchConditional())),this.actionsOut.Particles.forEach((e=>e.dispatchConditional())),this.actionsOut.Video.forEach((e=>e.dispatchConditional())),this.actionsOut.Link.forEach((e=>e.dispatch())),this.actionsOut.Create.forEach((e=>e.dispatch())),this.actionsOut.Destroy.forEach((e=>e.dispatch())),this.actionsOut.Reset.forEach((e=>e.dispatch())),this.actionsIn.Transition.forEach((e=>e.pause())),this.object.currentTransitionEvent=this,this.actionsOut.Transition.forEach((e=>e.play())),this.actionsOut.Animation.forEach((e=>e.play())),this.actionsIn.SwitchCamera.forEach((e=>e.pause())),this.actionsOut.SwitchCamera.forEach((e=>e.play())),this.actionsOut.SceneTransition.forEach((e=>e.dispatch())),this.actionsOut.SetVariable.forEach((e=>e.checkConditions())),this.actionsOut.SetVariable.forEach((e=>e.dispatch())),this.actionsOut.DynamicVariablePlay.forEach((e=>e.dispatch())))},this.onComplete=e=>{let{target:t,state:i}=e;this.toState===i&&(this.actionsIn.Audio.forEach((e=>e.dispatchConditional())),this.actionsIn.Particles.forEach((e=>e.dispatchConditional())),this.actionsIn.Video.forEach((e=>e.dispatchConditional())),this.actionsIn.Link.forEach((e=>e.dispatch())),this.actionsIn.Create.forEach((e=>e.dispatch())),this.actionsIn.Destroy.forEach((e=>e.dispatch())),this.actionsIn.Reset.forEach((e=>e.dispatch())),this.actionsOut.Transition.forEach((e=>e.pause())),this.actionsOut.Transition.forEach((e=>e.pause())),this.object.currentTransitionEvent=this,this.actionsIn.Transition.forEach((e=>e.play())),this.actionsIn.Animation.forEach((e=>e.play())),this.actionsOut.SwitchCamera.forEach((e=>e.pause())),this.actionsIn.SwitchCamera.forEach((e=>e.play())),this.actionsIn.SceneTransition.forEach((e=>e.dispatch())),this.actionsIn.SetVariable.forEach((e=>e.checkConditions())),this.actionsIn.SetVariable.forEach((e=>e.dispatch())),this.actionsIn.DynamicVariablePlay.forEach((e=>e.dispatch())))};let{condition:l}=t;if(!l.object)throw new Error("Missing property");let c=null!==(s=n.find(l.object))&&void 0!==s?s:n.scene.find2D(l.object);if(!c)throw new Error("Missing property");if(this.toObject=c,l.state&&(null===(o=this.toObject.states)||void 0===o||!o[l.state]))throw new Error("Missing property");this.toState=l.state}connect(){xz(this.actionsOut).forEach((e=>{var t;(null===(t=this.actionsOut[e])||void 0===t?void 0:t.length)&&this.toObject.addEventListener("beginState",this.onBegin)})),xz(this.actionsIn).forEach((e=>{var t;(null===(t=this.actionsIn[e])||void 0===t?void 0:t.length)&&this.toObject.addEventListener("completeState",this.onComplete)}))}disconnect(){super.disconnect(),xz(this.actionsOut).forEach((e=>{var t;(null===(t=this.actionsIn[e])||void 0===t?void 0:t.length)&&this.toObject.removeEventListener("beginState",this.onBegin)})),xz(this.actionsIn).forEach((e=>{var t;(null===(t=this.actionsIn[e])||void 0===t?void 0:t.length)&&this.toObject.removeEventListener("completeState",this.onComplete)}))}},ree=class extends W7{constructor(e,t){super(e),this.eventsPerConditions={Comparison:[],Distance:[],State:[]},this.hasVideoAction=!1;let{page:i,sharedAssets:n}=this.eventContext;i.traverseEntity((e=>{var r;if(null!==(r=e.data)&&void 0!==r&&r.events.length)for(let{id:a,data:s}of e.data.events)if(!s.disabled&&"Conditional"===s.type)try{let r;"Comparison"===s.condition.type||("Distance"===s.condition.type?r=new iee(a,s,e,i,n,t):"State"===s.condition.type&&(r=new nee(a,s,e,i,n,t))),r&&(this.eventsPerConditions[s.condition.type].push(r),(r.actionsIn.Video.length||r.actionsOut.Video.length)&&(this.hasVideoAction=!0))}catch(c){}}))}connect(){super.connect(),Object.values(this.eventsPerConditions).forEach((e=>e.forEach((e=>e.connect()))))}disconnect(){super.disconnect(),Object.values(this.eventsPerConditions).forEach((e=>e.forEach((e=>e.disconnect()))))}},aee=new FA,see=new FA,oee=new FA,lee=new WT,cee=new FA,hee=new FA,uee=new FA,dee=new NA,pee=new CM,fee=new mM,mee=new uA,gee=new FA,vee=new FA,yee=.2;function bee(e,t){!t||(t[0]<t[1]&&(e.x=Math.min(Math.max(e.x,t[0]),t[1])),t[2]<t[3]&&(e.y=Math.min(Math.max(e.y,t[2]),t[3])),t[4]<t[5]&&(e.z=Math.min(Math.max(e.z,t[4]),t[5])))}var xee=function(){let e=new mM;return(t,i,n)=>{let r=t.obj;e.copy(r.hiddenMatrix),null!==r.parent&&e.premultiply(r.parent.matrixWorld),e.invert(),r.position.copy(i),"global"===t.reference&&bee(r.position,t.limits),r.position.applyMatrix4(e),"parent"===t.reference?bee(r.position,t.limits):"local"===t.reference&&(dee.copy(t.quat0).invert(),r.position.sub(t.position0),r.position.applyQuaternion(dee),bee(r.position,t.limits),dee.invert(),r.position.applyQuaternion(dee),r.position.add(t.position0)),e.multiply(null!==n&&void 0!==n?n:r.matrixWorld).decompose(cee,r.quaternion,hee),r.updateMatrix(),r.hasNonUniformScale&&(r.updateMatrixWorld(),r.updateMatrixWorldSVD()),r instanceof vK&&X1(r.parent)&&r.invalidateDownstreamBooleanData(!0)}}(),wee=class{constructor(e,t,i,n,r,a){this.object=e,this.data=t,this.dropDestIds=[],this.activeIdx=null,this.wasDragEventTriggered=!1,this.resetDampingFactor=0===this.data.resetSpeed?1:8/this.data.resetSpeed+1,this.snapDampingFactor=0===this.data.snapSpeed?1:8/this.data.snapSpeed+1,this.actionsDrag=q9(t,t.dragDropActions.drag,i,n,r,this.object),this.actionsDrop=q9(t,t.dragDropActions.drop,i,n,r,this.object);let s=[];this.data.objects.forEach((e=>{let t=i.find(e);!t||!1!==t.data.visible&&(s.push(t),a[t.uuid]&&a[t.uuid].forEach((e=>{let t=i.find(e);!t||!1!==t.data.visible&&s.push(t)})))})),this.data.dropDestinations.forEach((e=>{let t=i.find(e);!t||!1!==t.data.visible&&(this.dropDestIds.push(t.uuid),a[t.uuid]&&a[t.uuid].forEach((e=>{let t=i.find(e);!t||!1!==t.data.visible&&this.dropDestIds.push(t.uuid)})))})),this.dragItems=s.map((e=>("locked"===this.data.planeMode&&(e.userData.lockedPlane=!0),e.userData.worldPosition0=(new FA).setFromMatrixPosition(e.matrixWorld),{obj:e,fromPosition:(new FA).setFromMatrixPosition(e.matrixWorld),pointStart:new FA,pointEnd:new FA,paused:!0,currentDampingFactor:this.data.dampingFactor,reset:!1,position0:(new FA).copy(e.position),quat0:(new NA).copy(e.quaternion),snapped:!1,orientationMatrix:new mM,limits:this.data.limits,reference:this.data.referenceFrame})))}get activeDragItem(){return null!==this.activeIdx?this.dragItems[this.activeIdx]:null}dispose(){X9(this.actionsDrag),X9(this.actionsDrop),this.dragItems.forEach((e=>{e.fromPosition.copy(e.obj.userData.worldPosition0),e.pointStart.copy(e.fromPosition),e.pointEnd.copy(e.pointStart),e.obj.recursiveBBoxNeedsUpdate=!0,e.obj.userData.lockedPlane=void 0,e.obj.position.copy(e.position0),e.obj.quaternion.copy(e.quat0),e.obj.updateMatrix()}))}},_ee=class extends W7{constructor(e,t){super(e),this.eventManager=t,this.events=[],this.lastDropDestination=null,this.dragTimeout=null,this.onPointerDown=e=>{if(Rj.length>1)return;this.eventContext.updateRaycaster(e);let{raycaster:t,page:i}=this.eventContext,n=i.raycastWithClones(t);if(this.lastDropDestination=null,0!==n.length){for(let e of this.events){let t=0;for(let{obj:i,pointEnd:a,pointStart:s}of e.dragItems){if(i===n[0].object||i===n[0].object.object||IX.is(i)&&i.isAncestorOf(n[0].object.uuid)){var r;if(e.activeIdx=t,e.activeDragItem.reset=!1,e.activeDragItem.currentDampingFactor=e.data.dampingFactor,e.activeDragItem.snapped=!1,"hand"===e.data.cursor&&this.setCursor("grabbing"),this.eventManager.controlsManager.usePhysics){e.activeDragItem.obj.rigidBody&&e.activeDragItem.obj.rigidBody.setBodyType(2,!0);let t=e.activeDragItem.obj;i.hasNonUniformScale&&i.updateMatrixWorldSVD(),(t.hasNonUniformScale?t.matrixWorldRigid:t.matrixWorld).decompose(cee,dee,hee),pee.setFromQuaternion(dee),void 0===t.prevR?(t.prevR=pee.clone(),t.prevT=cee.clone()):(t.prevR.copy(pee),t.prevT.copy(cee)),this.eventManager.controlsManager.sharedGameControlGlobals.entitiesWithTransformAnim.push(e.activeDragItem.obj)}return this.calcPlaneIntersectPos(i,s,e.data.plane,e.data.referenceFrame),a.copy(s),(this.eventManager.controlsManager.usePhysics&&"dynamic"===(null===(r=i.data.physics)||void 0===r?void 0:r.rigidBody)||!1===e.data.drop||!1===e.data.resetOnSnapFail)&&e.activeDragItem.fromPosition.setFromMatrixPosition(e.activeDragItem.obj.matrixWorld),this.activeEvent=e,void(this.eventManager.controlsManager.orbitControls&&(this.eventManager.controlsManager.orbitControls.enabled=!1))}t++}}this.activeEvent=null}else this.activeEvent=null},this.onPointerMove=e=>{if(Rj.length>1)return;this.eventContext.updateRaycaster(e);let{raycaster:t,page:i}=this.eventContext,n=i.raycastWithClones(t);if(0!==Rj.length){if(this.activeEvent&&this.activeEvent.activeDragItem){let e,t=this.activeEvent.activeDragItem;if(t.snapped=!1,this.activeEvent.data.drop&&(e=n.filter((e=>t.obj!==e.object&&!t.obj.isAncestorOf(e.object.uuid)&&!(e.object instanceof Z1)&&("all"===this.activeEvent.data.dropOn||this.activeEvent.dropDestIds.some((t=>t===e.object.uuid||i.scene.find(t).isAncestorOf(e.object.uuid))))))[0]),e){let i=uee.copy(e.face.normal).applyMatrix3(mee.getNormalMatrix(e.object.matrixWorld));if("center"===this.activeEvent.data.snapTo)t.fromPosition.setFromMatrixPosition(e.object.matrixWorld);else if("surface"===this.activeEvent.data.snapTo){if(t.fromPosition.copy(e.point),"bbox"===this.activeEvent.data.snapSurfaceMode){cee.copy(i).applyMatrix3(mee.setFromMatrix4(t.obj.matrixWorld).transpose());let e=t.obj;cee.x>yee?hee.x=-e.recursiveBBox.min.x:cee.x<-yee&&(hee.x=-e.recursiveBBox.max.x),cee.y>yee?hee.y=-e.recursiveBBox.min.y:cee.y<-yee&&(hee.y=-e.recursiveBBox.max.y),cee.z>yee?hee.z=-e.recursiveBBox.min.z:cee.z<-yee&&(hee.z=-e.recursiveBBox.max.z),hee.applyMatrix3(mee.invert())}else hee.copy(i).multiplyScalar(this.activeEvent.data.snapSurfaceOffset);t.fromPosition.add(hee)}this.activeEvent.data.autoOrient&&(cee.set(0,1,0).cross(i),cee.length()<1e-4&&cee.set(-1,0,0).cross(i),hee.crossVectors(uee,cee),t.orientationMatrix.makeBasis(cee,hee,i)),t.pointStart.copy(t.fromPosition),t.pointEnd.copy(t.pointStart),t.currentDampingFactor=this.activeEvent.snapDampingFactor,t.snapped=!0,this.lastDropDestination!==e.object&&(this.lastDropDestination=e.object,this.activeEvent.actionsDrop.Transition.forEach((e=>{e.play()})),this.activeEvent.actionsDrop.Animation.forEach((e=>{e.play()})),this.activeEvent.actionsDrop.Audio.forEach((e=>{e.dispatchGameControl("start")})),this.activeEvent.actionsDrop.Particles.forEach((e=>{e.dispatchGameControl("start")})),this.activeEvent.actionsDrop.Create.forEach((e=>{e.dispatchThrottled()})))}else t.orientationMatrix.makeRotationFromQuaternion(t.quat0),this.lastDropDestination=null,t.currentDampingFactor=this.activeEvent.data.dampingFactor,this.calcPlaneIntersectPos(t.obj,t.pointEnd,this.activeEvent.data.plane,this.activeEvent.data.referenceFrame),this.activeEvent.actionsDrop.Transition.forEach((e=>{e.stop(),null!==e.object.currentState&&e.object.changeSelectedState(null,{scene:this.eventContext.page.scene,shared:this.eventContext.sharedAssets})})),this.activeEvent.actionsDrop.Animation.forEach((e=>{e.stop()})),this.activeEvent.actionsDrop.Audio.forEach((e=>{e.dispatchGameControl("stop")})),this.activeEvent.actionsDrop.Particles.forEach((e=>{e.dispatchGameControl("stop")}));this.activeEvent.actionsDrag.Create.forEach((e=>{e.dispatchThrottled()})),this.activeEvent.actionsDrag.SetVariable.forEach((e=>e.checkConditions())),this.activeEvent.actionsDrag.SetVariable.forEach((e=>e.dispatch())),this.activeEvent.actionsDrag.DynamicVariablePlay.forEach((e=>e.dispatch())),!1===this.activeEvent.wasDragEventTriggered&&(this.activeEvent.wasDragEventTriggered=!0,this.activeEvent.actionsDrag.Transition.forEach((e=>{e.play()})),this.activeEvent.actionsDrag.Animation.forEach((e=>{e.play()})),this.activeEvent.actionsDrag.Audio.forEach((e=>{e.dispatchGameControl("start")})),this.activeEvent.actionsDrag.Particles.forEach((e=>{e.dispatchGameControl("start")}))),this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout((()=>{!this.activeEvent||(this.activeEvent.wasDragEventTriggered=!1,this.activeEvent.actionsDrag.Audio.forEach((e=>{e.dispatchGameControl("stop")})),this.activeEvent.actionsDrag.Particles.forEach((e=>{e.dispatchGameControl("stop")})),this.activeEvent.actionsDrag.Transition.forEach((e=>{e.stop(),null!==e.object.currentState&&e.object.changeSelectedState(null,{scene:this.eventContext.page.scene,shared:this.eventContext.sharedAssets})})),this.activeEvent.actionsDrag.Animation.forEach((e=>{e.stop()})))}),500),this.updateDragItem(t),t.obj.dispatchEvent({type:"requestRender"})}}else{let e=!1;for(let t of this.events){for(let{obj:i}of t.dragItems){var r,a,s;if(i===(null===(r=n[0])||void 0===r?void 0:r.object)||i===(null===(a=n[0])||void 0===a||null===(a=a.object)||void 0===a?void 0:a.object)||IX.is(i)&&i.isAncestorOf(null===(s=n[0])||void 0===s?void 0:s.object.uuid)){switch(e=!0,t.data.cursor){case"hand":this.setCursor("grab");break;case"move":this.setCursor("move")}break}}if(e)break}e||this.setCursor("default")}},this.onPointerUp=e=>{if(this.activeEvent&&this.activeEvent.activeDragItem){var t;"hand"===this.activeEvent.data.cursor&&this.setCursor("grab");let e="dynamic"===(null===(t=this.activeEvent.activeDragItem.obj.data.physics)||void 0===t?void 0:t.rigidBody);!1===this.activeEvent.activeDragItem.snapped&&this.activeEvent.data.drop&&this.activeEvent.data.resetOnSnapFail&&(!1===this.eventManager.controlsManager.usePhysics||!e)&&(this.activeEvent.activeDragItem.reset=this.activeEvent.data.resetOnSnapFail,this.activeEvent.activeDragItem.paused=!1,this.activeEvent.activeDragItem.currentDampingFactor=this.activeEvent.resetDampingFactor),this.eventManager.controlsManager.usePhysics&&e&&(this.eventManager.controlsManager.sharedGameControlGlobals.entitiesWithTransformAnim.pop(),this.activeEvent.activeDragItem.obj.rigidBody.setBodyType(0,!0),this.activeEvent.activeDragItem.paused=!0),!0===this.activeEvent.wasDragEventTriggered&&(this.activeEvent.wasDragEventTriggered=!1,this.activeEvent.actionsDrag.Transition.forEach((e=>{e.stop(),null!==e.object.currentState&&e.object.changeSelectedState(null,{scene:this.eventContext.page.scene,shared:this.eventContext.sharedAssets})})),this.activeEvent.actionsDrag.Animation.forEach((e=>{e.stop()})),this.activeEvent.actionsDrag.Audio.forEach((e=>{e.dispatchGameControl("stop")})),this.activeEvent.actionsDrag.Particles.forEach((e=>{e.dispatchGameControl("stop")})),this.activeEvent.actionsDrop.SetVariable.forEach((e=>e.checkConditions())),this.activeEvent.actionsDrop.SetVariable.forEach((e=>e.dispatch())),this.activeEvent.actionsDrop.DynamicVariablePlay.forEach((e=>e.dispatch()))),this.eventManager.controlsManager.orbitControls&&(this.eventManager.controlsManager.orbitControls.enabled=!0)}};let i={};e.page.traverseEntity((e=>{e.component&&(i[e.component.uuid]?i[e.component.uuid].push(e.uuid):i[e.component.uuid]=[e.uuid])})),e.page.traverseEntity((n=>{var r;null===(r=n.data)||void 0===r||r.events.filter((e=>"DragDrop"===e.data.type&&!e.data.disabled)).forEach((r=>{this.events.push(new wee(n,r.data,e.page,e.sharedAssets,t,i))}))}))}connect(){if(!this.events.length)return;this.domEventsNeeded.clear(),this.domEventsNeeded.add("pointerdown");let e=this.eventContext.domElement;e.addEventListener("pointerdown",this.onPointerDown),e.addEventListener("pointermove",this.onPointerMove),e.addEventListener("pointerup",this.onPointerUp),this.domEventsNeeded.add("pointermove")}disconnect(){if(!this.events.length)return;this.domEventsNeeded.clear();let e=this.eventContext.domElement;e.removeEventListener("pointerdown",this.onPointerDown),e.removeEventListener("pointermove",this.onPointerMove),e.removeEventListener("pointerup",this.onPointerUp),this.events.forEach((e=>e.dispose()))}setCursor(e){this.eventContext.domElement.style.cursor=e}onAnimationFrameDamping(){for(let e of this.events)for(let t of e.dragItems)t.paused||this.updateDragItem(t,!0)}calcPlaneIntersectPos(e,t,i,n){let{getCamera:r,raycaster:a}=this.eventContext;r().getWorldDirection(see),see.negate();let s=dee.identity();switch("parent"===n?fee.multiplyMatrices(e.parent.matrixWorld,e.hiddenMatrix).decompose(cee,s,hee):"local"===n&&e.matrixWorld.decompose(cee,s,hee),i){case"x":cee.set(1,0,0).applyQuaternion(s),gee.copy(see).cross(cee),vee.copy(cee).cross(gee);break;case"y":cee.set(0,1,0).applyQuaternion(s),gee.copy(see).cross(cee),vee.copy(cee).cross(gee);break;case"z":cee.set(0,0,1).applyQuaternion(s),gee.copy(see).cross(cee),vee.copy(cee).cross(gee);break;case"xy":vee.set(0,0,1).applyQuaternion(s);break;case"yz":vee.set(1,0,0).applyQuaternion(s);break;case"xz":vee.set(0,1,0).applyQuaternion(s);break;case"adaptive":see.angleTo(hee.set(0,1,0))>Math.PI/6?(cee.crossVectors(hee.set(0,1,0),see),vee.crossVectors(cee,hee)):vee.set(0,1,0);break;default:vee.copy(see)}oee.setFromMatrixPosition(e.matrixWorld);let o=e.userData.lockedPlane?e.userData.worldPosition0:oee;if(lee.setFromNormalAndCoplanarPoint(vee,o),a.ray.intersectPlane(lee,t)&&("x"===i||"y"===i||"z"===i)){let e=hee.subVectors(t,o).dot(cee);t.copy(o).addScaledVector(cee,e)}}updateDragItem(e){var t,i;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];oee.setFromMatrixPosition(e.obj.matrixWorld),"current"===e.reset?aee.subVectors(e.fromPosition,oee).divideScalar(e.currentDampingFactor):"original"===e.reset?(aee.subVectors(e.obj.userData.worldPosition0,oee).divideScalar(e.currentDampingFactor),e.fromPosition.copy(e.obj.userData.worldPosition0),e.pointStart.copy(e.fromPosition),e.pointEnd.copy(e.pointStart)):aee.subVectors(e.pointEnd,e.pointStart).add(e.fromPosition).sub(oee).divideScalar(e.currentDampingFactor),e.paused=!(e.currentDampingFactor>1)||aee.length()<.01,(this.activeEvent&&1===this.activeEvent.data.dampingFactor||n)&&xee(e,aee.add(oee),null!==(t=this.activeEvent)&&void 0!==t&&t.data.drop&&null!==(i=this.activeEvent)&&void 0!==i&&i.data.autoOrient?e.orientationMatrix:null),e.obj.dispatchEvent({type:"beginEvent",eventName:"DragDrop"}),this.eventManager.requestRender()}},See=new FA,Eee=new FA,Cee=new FA,Aee=new FA,Mee=new WT,Tee={type:"requestRender"},Pee=function(){let e=new FA,t=new FA;return(i,n,r)=>r>0?(e.subVectors(i,n),e.length()<=r?i:t.copy(n).add(e.normalize().multiplyScalar(r))):n}(),Dee=function(){let e=new mM;return(t,i)=>{t.position.copy(i),null!==t.parent&&(e.copy(t.parent.matrixWorld).invert(),t.position.applyMatrix4(e)),e.copy(t.hiddenMatrix).invert(),t.position.applyMatrix4(e),t.updateMatrix(),t.hasNonUniformScale&&(t.updateMatrixWorld(),t.updateMatrixWorldSVD()),t instanceof vK&&X1(t.parent)&&t.invalidateDownstreamBooleanData(!0)}}(),kee=class{constructor(e,t,i,n,r){this.data=e,this.object=t,this.paused=!1,this.currentDampingFactor=1,this.snapComplete=!1,this.isReset=!1,this.worldPosition0=new FA,this.timeoutId=null,this.delayFinished=!0,this.wasOutside=!1,this.data={..._G.defaultData,...e,...void 0===e.resetOnPointerLeave&&{resetOnPointerLeave:!1}},void 0===e.target||"cursor"===e.target||(this.target=i.find(e.target)),this.data.dampingFactor&&(this.currentDampingFactor=this.data.dampingFactor),this.resetDampingFactor=80/this.data.resetSpeed+1,this.object.getWorldPosition(this.worldPosition0),this.actions=q9(e,e.actions,i,n,r,t)}},Oee=class extends W7{constructor(e,t){super(e),this.events=[],this.pairOfEventListeners=[],this.onMouseMove=e=>{if(!(Rj.length>1)){this.eventContext.updateRaycaster(e);for(let e of this.events)void 0===e.target&&this.updateSingleEvent(e)}},this.onMouseEnter=e=>{for(let t of this.events)void 0===t.target&&(t.isReset=!1,t.currentDampingFactor=t.data.dampingFactor)},this.onMouseLeave=e=>{for(let t of this.events)void 0===t.target&&(t.data.resetOnPointerLeave&&(t.isReset=!0,t.currentDampingFactor=t.resetDampingFactor),this.updateSingleEvent(t))},this.onTargetChange=e=>()=>{this.updateSingleEvent(e)};let{page:i}=this.eventContext;i.traverseEntity((n=>{var r,a;let s=null===(r=n.data)||void 0===r?void 0:r.events.find((e=>"Follow"===e.data.type&&!e.data.disabled));s&&(!i.data.globalPhysics.usePhysics||"dynamic"!==(null===(a=n.dataPatched.physics)||void 0===a?void 0:a.rigidBody))&&this.events.push(new kee(s.data,n,i,e.sharedAssets,t))}))}connect(){if(!this.events.length)return;let{domElement:e,eventElement:t}=this.eventContext;this.domEventsNeeded.clear(),Tj&&(this.domEventsNeeded.add("pointerdown"),e.addEventListener("pointerdown",this.onMouseMove)),this.domEventsNeeded.add("pointermove"),t.addEventListener("pointermove",this.onMouseMove),this.eventContext.useWindowEvents||(e.addEventListener("pointerenter",this.onMouseEnter),e.addEventListener("pointerleave",this.onMouseLeave));for(let i of this.events)if(void 0!==i.target){let e=i.target,t=this.onTargetChange(i);this.pairOfEventListeners.push([e,t]),e.addEventListener("requestRender",t)}}disconnect(){if(!this.events.length)return;let{domElement:e,eventElement:t}=this.eventContext;this.domEventsNeeded.clear(),Tj&&e.removeEventListener("pointerdown",this.onMouseMove),t.removeEventListener("pointermove",this.onMouseMove),e.removeEventListener("pointerenter",this.onMouseEnter),e.removeEventListener("pointerleave",this.onMouseLeave);for(let[i,n]of this.pairOfEventListeners)i.removeEventListener("requestRender",n);for(let i of this.events)i.paused=!0,i.isReset=!1,X9(i.actions)}onAnimationFrameDamping(){for(let e of this.events)e.paused||this.updateSingleEvent(e,!0)}updateSingleEvent(e){var t;let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.events.forEach((e=>{e.actions.Create.forEach((e=>{e.dispatchThrottled()}))}));let{plane:n,limitDistance:r,limitDistanceEnabled:a}=e.data;if(e.object.getWorldPosition(Cee),e.isReset)Aee.copy(e.worldPosition0);else if(e.target)e.target.getWorldPosition(Aee);else{let{getCamera:e,raycaster:t}=this.eventContext;if("custom"===n?(e().getWorldDirection(Eee),Eee.negate(),See.copy(Eee)):"xy"===n?See.set(0,0,1):"xz"===n?See.set(0,1,0):"yz"===n&&See.set(1,0,0),Mee.setFromNormalAndCoplanarPoint(See,Cee),!t.ray.intersectPlane(Mee,Aee))return}if(!e.isReset)if(Aee.distanceTo(e.worldPosition0)>r&&a&&e.target){if(e.snapComplete=!1,e.data.snapDelay&&(e.delayFinished=!1,typeof window<"u"&&null!==e.timeoutId&&(window.clearTimeout(e.timeoutId),e.timeoutId=null)),e.wasOutside=!0,!e.data.resetAfterDistanceLimit)return;Aee.copy(e.worldPosition0),e.currentDampingFactor=e.resetDampingFactor}else if(e.wasOutside&&(e.data.snapDelay&&typeof window<"u"&&(e.timeoutId=window.setTimeout((()=>{e.delayFinished=!0,e.paused=!1,this.updateSingleEvent(e)}),1e3*e.data.snapDelay)),e.currentDampingFactor=e.data.dampingFactor,e.wasOutside=!1),!1===e.delayFinished)return;!1===e.data.enabledTranslation[0]&&(Aee.x=Cee.x),!1===e.data.enabledTranslation[1]&&(Aee.y=Cee.y),!1===e.data.enabledTranslation[2]&&(Aee.z=Cee.z);let s=Pee(Cee,Aee,e.wasOutside?0:e.data.maxDelta);if(e.currentDampingFactor>1){let t=See.subVectors(s,Cee).divideScalar(e.currentDampingFactor);Cee.add(t),i&&Dee(e.object,Cee),e.paused=t.length()<.01}else Dee(e.object,s),e.paused=!0;null!==(t=e.object)&&void 0!==t&&t.dispatchEvent({type:"beginEvent",eventName:"Follow"}),e.object.dispatchEvent(Tee)}},Iee=new FA,Ree=new FA,Lee=new mM,Bee=new NA,zee=new NA,Nee=new FA,Fee=new FA,jee=new FA,Vee=new FA,Uee=new WT,Gee={type:"requestRender"},Hee={type:"changeRotation"},Wee=function(){let e=new mM;return function(t,i){null!==t.parent?e.multiplyMatrices(t.parent.matrixWorld,t.hiddenMatrix):e.copy(t.hiddenMatrix),i.premultiply(R7(e).invert()),t.rotation.setFromRotationMatrix(i),t.updateMatrix(),t instanceof vK&&X1(t.parent)&&t.invalidateDownstreamBooleanData(!0)}}(),qee=class{constructor(e,t,i){this.object=t,this.paused=!1,this.currentDampingFactor=1,this.isReset=!1,this.worldQuaternion0=new NA,this.timeoutId=null,this.delayFinished=!0,this.wasOutside=!1,this.data={...SG.defaultData,...e,...void 0===e.resetOnPointerLeave&&{resetOnPointerLeave:!1}},void 0===e.target||"cursor"===e.target||(this.target=i.find(e.target)),this.data.dampingFactor&&(this.currentDampingFactor=this.data.dampingFactor),this.object.getWorldQuaternion(this.worldQuaternion0),this.resetDampingFactor=80/this.data.resetSpeed+1}},Xee=class extends W7{constructor(e){super(e),this.events=[],this.pairOfEventListeners=[],this.pairOfUserEventListeners=[],this.onMouseMove=e=>{if(!(Rj.length>1)){this._lastMouseEvent=e,this.eventContext.updateRaycaster(e);for(let e of this.events)void 0===e.target&&this.updateSingleEvent(e)}},this.onMouseEnter=e=>{for(let t of this.events)void 0===t.target&&(t.isReset=!1,t.currentDampingFactor=t.data.dampingFactor)},this.onMouseLeave=e=>{for(let t of this.events)void 0===t.target&&(t.data.resetOnPointerLeave&&(t.isReset=!0,t.currentDampingFactor=t.resetDampingFactor),this.updateSingleEvent(t))},this.onScroll=e=>{if(this._lastMouseEvent){let e=new PointerEvent("pointermove",{clientX:this._lastMouseEvent.clientX,clientY:this._lastMouseEvent.clientY,bubbles:!0,cancelable:!0,view:window});this.eventContext.eventElement.dispatchEvent(e)}},this.onTargetChange=e=>()=>{this.updateSingleEvent(e)},this.createUserEventListener=e=>t=>{let{eventName:i,target:n}=t;if(!i||!n)return;let r=Y7(i);r&&"LookAt"===r&&this.updateSingleEvent(e)};let{page:t}=this.eventContext;t.traverseEntity((e=>{var i,n;let r=null===(i=e.data)||void 0===i?void 0:i.events.find((e=>"LookAt"===e.data.type&&!e.data.disabled));r&&(!t.data.globalPhysics.usePhysics||"dynamic"!==(null===(n=e.dataPatched.physics)||void 0===n?void 0:n.rigidBody))&&this.events.push(new qee(r.data,e,t))}))}connect(){if(!this.events.length)return;let{domElement:e,eventElement:t}=this.eventContext;this.domEventsNeeded.clear(),Tj&&(this.domEventsNeeded.add("pointerdown"),e.addEventListener("pointerdown",this.onMouseMove)),this.domEventsNeeded.add("pointermove"),t.addEventListener("pointermove",this.onMouseMove),this.eventContext.useWindowEvents?t.addEventListener("scroll",this.onScroll):(e.addEventListener("pointerenter",this.onMouseEnter),e.addEventListener("pointerleave",this.onMouseLeave));for(let i of this.events){if(void 0!==i.target){let e=this.onTargetChange(i),t=i.target;this.pairOfEventListeners.push([t,e]),t.addEventListener("requestRender",e)}let e=this.createUserEventListener(i),t=i.object;this.pairOfUserEventListeners.push([t,e]),t.addEventListener("userEvent",e)}}disconnect(){if(!this.events.length)return;let{domElement:e,eventElement:t}=this.eventContext;this.domEventsNeeded.clear(),Tj&&e.removeEventListener("pointerdown",this.onMouseMove),t.removeEventListener("pointermove",this.onMouseMove),e.removeEventListener("pointerenter",this.onMouseEnter),e.removeEventListener("pointerleave",this.onMouseLeave),t.removeEventListener("scroll",this.onScroll);for(let[i,n]of this.pairOfEventListeners)i.removeEventListener("requestRender",n);for(let[i,n]of this.pairOfUserEventListeners)i.removeEventListener("userEvent",n);for(let i of this.events)i.paused=!0,i.isReset=!1}onAnimationFrameDamping(){for(let e of this.events)e.paused||this.updateSingleEvent(e)}updateSingleEvent(e){var t;let{tilt:i,axis:n,distance:r,plane:a,limitDistance:s,enabledRotation:o,limitDistanceEnabled:l}=e.data,{getCamera:c,raycaster:h}=this.eventContext,{object:u,target:d}=e;if(u.getWorldPosition(Nee),!e.isReset)if(e.target)e.target.getWorldPosition(Fee);else{if("custom"===a?(c().getWorldDirection(Ree),Ree.negate(),Uee.setFromNormalAndCoplanarPoint(Ree,Nee)):("xy"===a?Iee.set(0,0,1):"xz"===a?Iee.set(0,1,0):"yz"===a&&Iee.set(1,0,0),Uee.setFromNormalAndCoplanarPoint(Iee,Nee)),!h.ray.intersectPlane(Uee,Fee))return;r>0&&("custom"===a||void 0===a)&&Fee.addScaledVector(Ree,r)}if(e.isReset||(d?"target"===i?jee.copy(d.up).applyMatrix4(Lee.extractRotation(d.matrixWorld)).normalize():o.some((e=>!1===e))?("x"===n?(Vee.set(0,0,1),!1===o[2]&&Vee.set(0,1,0)):"y"===n?(Vee.set(1,0,0),!1===o[0]&&Vee.set(0,0,1)):(Vee.set(0,1,0),!1===o[1]&&Vee.set(1,0,0)),jee.copy(Vee).applyQuaternion(e.worldQuaternion0).normalize()):jee.set(0,1,0):"custom"===a?jee.set(0,1,0):jee.copy(Iee)),e.isReset)zee.copy(e.worldQuaternion0);else if(Nee.distanceTo(Fee)>s&&l&&d){if(e.data.snapDelay&&(e.delayFinished=!1,typeof window<"u"&&null!==e.timeoutId&&(window.clearTimeout(e.timeoutId),e.timeoutId=null)),e.wasOutside=!0,!e.data.resetAfterDistanceLimit)return;zee.copy(e.worldQuaternion0),e.currentDampingFactor=e.resetDampingFactor}else{if(e.wasOutside&&(e.data.snapDelay&&typeof window<"u"&&(e.timeoutId=window.setTimeout((()=>{e.delayFinished=!0,e.paused=!1,this.updateSingleEvent(e)}),1e3*e.data.snapDelay)),e.currentDampingFactor=e.data.dampingFactor,e.wasOutside=!1),!1===e.delayFinished)return;(function(e,t,i,n,r,a){let s=e.elements;Zee.subVectors(t,i),0===Zee.lengthSq()&&(Zee.z=1),Zee.normalize(),Qee.crossVectors(n,Zee),0===Qee.lengthSq()&&(1===Math.abs(n.z)?Zee.x+=1e-4:Zee.z+=1e-4,Zee.normalize(),Qee.crossVectors(n,Zee)),Qee.normalize(),Yee.crossVectors(Zee,Qee),"x"===r?1===a.z?[Qee,Yee,Zee]=[Zee,Qee,Yee]:(Qee.negate(),[Qee,Zee]=[Zee,Qee]):"y"===r?1===a.x?[Qee,Yee,Zee]=[Yee,Zee,Qee]:(Qee.negate(),[Yee,Zee]=[Zee,Yee]):1===a.x&&(Qee.negate(),[Qee,Yee]=[Yee,Qee]),s[0]=Qee.x,s[4]=Yee.x,s[8]=Zee.x,s[1]=Qee.y,s[5]=Yee.y,s[9]=Zee.y,s[2]=Qee.z,s[6]=Yee.z,s[10]=Zee.z})(Lee,Fee,Nee,jee,n,Vee),zee.setFromRotationMatrix(Lee),Bee.setFromUnitVectors(Vee.applyQuaternion(zee),jee),o.some((e=>!1===e))&&"target"!==i&&zee.premultiply(Bee).normalize()}e.currentDampingFactor>1?(u.updateWorldMatrix(!0,!1),Bee.setFromRotationMatrix(R7(u.matrixWorld)),Bee.slerp(zee,1/e.currentDampingFactor),Wee(u,Lee.makeRotationFromQuaternion(Bee)),e.paused=8*(1-Bee.dot(zee))<1e-6):(Wee(u,Lee.makeRotationFromQuaternion(zee)),e.paused=!0),null!==(t=e.object)&&void 0!==t&&t.dispatchEvent({type:"beginEvent",eventName:"LookAt"}),u.dispatchEvent(Gee),u.dispatchEvent(Hee)}},Yee=new FA,Qee=new FA,Zee=new FA;var Kee=class{constructor(e,t,i,n,r,a){this.id=e,this.data=t,this.object=i,this.entered=!1,this.actions=q9(t,t.actions,n,r,a,i)}disconnect(){X9(this.actions)}dispatchEnter(){this.actions.Transition.forEach((e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this,e.init())})),this.entered||(this.entered=!0,this.actions.Transition.forEach((e=>e.playFromCurrent())),this.actions.Animation.forEach((e=>e.play())),this.actions.Create.forEach((e=>e.dispatch())),this.actions.Particles.forEach((e=>e.dispatchBasic())),this.actions.Destroy.forEach((e=>e.dispatch())),this.actions.SwitchCamera.forEach((e=>e.playFromCurrent())),this.actions.SceneTransition.forEach((e=>e.dispatch())),this.actions.SetVariable.forEach((e=>e.checkConditions())),this.actions.SetVariable.forEach((e=>e.dispatch())),this.actions.DynamicVariablePlay.forEach((e=>e.dispatch())))}dispatchLeave(){this.actions.Transition.forEach((e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this,e.init())})),this.entered&&(this.entered=!1,this.actions.Transition.forEach((e=>e.reverseFromCurrent())),this.actions.Particles.forEach((e=>e.reverseFromCurrent())),this.actions.SwitchCamera.forEach((e=>e.reverseFromCurrent())))}dispatchUserEvent(e){this.actions.Transition.forEach((e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this,e.init())})),e?(this.actions.Transition.forEach((e=>e.reverseFromCurrent())),this.actions.Particles.forEach((e=>e.reverseFromCurrent())),this.actions.Animation.forEach((e=>e.reverseFromCurrent())),this.actions.SwitchCamera.forEach((e=>e.reverseFromCurrent()))):(this.actions.Transition.forEach((e=>e.playFromCurrent())),this.actions.Animation.forEach((e=>e.playFromCurrent())),this.actions.Create.forEach((e=>e.dispatch())),this.actions.Particles.forEach((e=>e.dispatchBasic())),this.actions.Destroy.forEach((e=>e.dispatch())),this.actions.SwitchCamera.forEach((e=>e.playFromCurrent()))),this.actions.SceneTransition.forEach((e=>e.dispatch())),this.actions.SetVariable.forEach((e=>e.checkConditions())),this.actions.SetVariable.forEach((e=>e.dispatch())),this.actions.DynamicVariablePlay.forEach((e=>e.dispatch()))}},Jee=class extends W7{constructor(e,t){super(e),this.eventsPerObjects={},this.objects=[],this.objects2D=[],this._prevObjects=[],this.onMouseDown=e=>{Rj.length>1||(this.eventContext.updateRaycaster(e),this.handleMouseHoverEvent())},this.onMouseUp=e=>{Rj.length>1||this.handleMouseHoverEvent(!0)},this.onMouseMove=e=>{Rj.length>1||(this.eventContext.updateRaycaster(e),this.handleMouseHoverEvent())},this.onUserEvent=e=>{var t;let{eventName:i,target:n,reverse:r}=e;if(!i||!n)return;let a=Y7(i);a&&"MouseHover"===a&&(n.dispatchEvent({type:"beginEvent",eventName:"MouseHover"}),null===(t=this.eventsPerObjects[n.uuid])||void 0===t||t.forEach((e=>e.dispatchUserEvent(r))))};let{page:i,sharedAssets:n}=this.eventContext,r=(e,r)=>{var a;if(e.visible&&null!==(a=e.data)&&void 0!==a&&a.events.length){var s;for(let{id:r,data:a}of e.data.events)if(!a.disabled&&"MouseHover"===a.type)try{let s=new Kee(r,a,e,i,n,t);this.eventsPerObjects[e.uuid]?this.eventsPerObjects[e.uuid].push(s):this.eventsPerObjects[e.uuid]=[s]}catch(y){}(null===(s=this.eventsPerObjects[e.uuid])||void 0===s?void 0:s.length)&&this.objects.push(e instanceof r4?r:e)}};i.traverseEntity((e=>{var t;(e instanceof i5||e instanceof X4)&&null!==(t=e.frame)&&void 0!==t&&t.traverse((t=>{r(t,e)})),r(e)}))}connect(){if(!this.objects.length)return;let{domElement:e}=this.eventContext;this.domEventsNeeded.clear(),Tj&&(this.domEventsNeeded.add("pointerdown"),e.addEventListener("pointerdown",this.onMouseDown),this.domEventsNeeded.add("pointerup"),e.addEventListener("pointerup",this.onMouseUp)),this.domEventsNeeded.add("pointermove"),e.addEventListener("pointermove",this.onMouseMove),this.objects.forEach((e=>{e.addEventListener("userEvent",this.onUserEvent)}))}disconnect(){if(!this.objects.length)return;let{domElement:e}=this.eventContext;this.domEventsNeeded.clear(),Tj&&(e.removeEventListener("pointerdown",this.onMouseDown),e.removeEventListener("pointerup",this.onMouseUp)),e.removeEventListener("pointermove",this.onMouseMove),Object.values(this.eventsPerObjects).forEach((e=>{e.forEach((e=>{e.disconnect()}))})),this.objects.forEach((e=>{e.removeEventListener("userEvent",this.onUserEvent)}))}handleMouseHoverEvent(){let e=[];if(!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])){let{stopRaycast:t,raycaster:i,page:n,pointerScreen:r}=this.eventContext,a=!1;if(n.uiCanvas&&(a=V7(n,[r.x,r.y],Object.keys(this.eventsPerObjects),(t=>{e.push(t)}))),t&&!a){let t=F7(i,n,this.objects);e=j7(t),t.forEach((t=>{var i,n,r,a;t.object instanceof i5&&V7(t.object,[null!==(i=null===t||void 0===t||null===(n=t.uv)||void 0===n?void 0:n.x)&&void 0!==i?i:0,null!==(r=null===t||void 0===t||null===(a=t.uv)||void 0===a?void 0:a.y)&&void 0!==r?r:0],Object.keys(this.eventsPerObjects),(t=>{e.push(t)}))}))}else this.objects.forEach((t=>{var n,r,a,s;let o=U7(i,t);o&&(e.push(t),t instanceof i5&&V7(t,[null!==(n=null===o||void 0===o||null===(r=o.uv)||void 0===r?void 0:r.x)&&void 0!==n?n:0,null!==(a=null===o||void 0===o||null===(s=o.uv)||void 0===s?void 0:s.y)&&void 0!==a?a:0],Object.keys(this.eventsPerObjects),(t=>{e.push(t)})))}))}this._prevObjects.length&&this._prevObjects.forEach((t=>{var i;e.includes(t)||(t.dispatchEvent({type:"beginEvent",eventName:"MouseHover"}),null===(i=this.eventsPerObjects[t.uuid])||void 0===i||i.forEach((e=>e.dispatchLeave())))})),e.length&&e.forEach((e=>{var t;e.dispatchEvent({type:"beginEvent",eventName:"MouseHover"}),null===(t=this.eventsPerObjects[e.uuid])||void 0===t||t.forEach((e=>e.dispatchEnter()))})),this._prevObjects=e}},$ee=class{constructor(e,t,i,n,r,a){this.id=e,this.data=t,this.object=i,this.scrollCounter=0,this.actions=q9(t,t.actions,n,r,a,i)}connect(){this.scrollCounter=0}disconnect(){X9(this.actions)}dispatch(e){this.actions.Transition.forEach((e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this,e.init())}));let t=e>0?1:-1;this.scrollCounter+=t,this.scrollCounter=Math.min(Math.max(this.scrollCounter,0),this.data.steps);let i=this.scrollCounter/this.data.steps;this.actions.Transition.forEach((e=>e.seek(i))),this.actions.Animation.forEach((e=>e.seek(t))),this.actions.Create.forEach((e=>e.dispatchThrottled())),this.actions.SetVariable.forEach((e=>e.checkConditions())),this.actions.SetVariable.forEach((e=>e.dispatch())),this.actions.DynamicVariablePlay.forEach((e=>e.dispatch()))}dispatchUserEvent(e){this.actions.Transition.forEach((e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this,e.init())})),e?(this.actions.Transition.forEach((e=>e.reverseFromCurrent())),this.actions.Animation.forEach((e=>e.reverseFromCurrent()))):(this.actions.Transition.forEach((e=>{e.playFromCurrent()})),this.actions.Animation.forEach((e=>{e.playFromCurrent()}))),this.actions.Create.forEach((e=>e.dispatchThrottled())),this.actions.SetVariable.forEach((e=>e.checkConditions())),this.actions.SetVariable.forEach((e=>e.dispatch())),this.actions.DynamicVariablePlay.forEach((e=>e.dispatch()))}},ete=class{constructor(e,t,i,n,r,a,s){this.id=e,this.data=t,this.object=i,this.domElement=a,this.eventManager=s,this.scrollStart=0,this.scrollEnd=0,this.actions=q9(t,t.actions,n,r,s,i)}computeScrollBounds(){var e,t;let i=this.domElement.getBoundingClientRect(),n=document.body,r=document.documentElement,a=window.pageYOffset||r.scrollTop||n.scrollTop,s=r.clientTop||n.clientTop||0,o=Math.round(i.top+a-s);if("enter"===this.data.startFrom){let e=window.innerHeight,t=i.height,n=this.data.enterAnchor,r="top"===n?e:"bottom"===n?e-t:e-.5*t;this.scrollStart=o-r}else this.scrollStart=0;this.scrollStart+=null!==(e=this.data.startOffset)&&void 0!==e?e:0,this.scrollEnd=this.scrollStart+(null!==(t=this.data.endAfter)&&void 0!==t?t:400),this.box=i,this.computeScroll({x:window.scrollX,y:window.scrollY})}connect(){this.computeScrollBounds()}disconnect(){X9(this.actions)}handleResize(){this.computeScrollBounds()}get isInvalidBox(){return void 0===this.box||0===this.box.width&&0===this.box.height&&0===this.box.top&&0===this.box.bottom}computeScroll(e){let{x:t,y:i}=e;this.actions.Transition.forEach((e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this,e.init())}));let n=this.scrollEnd-this.scrollStart,r=Math.min(1,Math.max(0,(i-this.scrollStart)/n));this.actions.Transition.forEach((e=>e.seek(r))),this.actions.Animation.forEach((e=>e.seek(r))),this.actions.Create.forEach((e=>e.dispatchThrottled())),this.actions.SetVariable.forEach((e=>e.checkConditions())),this.actions.SetVariable.forEach((e=>e.dispatch())),this.actions.DynamicVariablePlay.forEach((e=>e.dispatch()))}dispatch(e){this.isInvalidBox&&this.computeScrollBounds(),this.computeScroll(e)}dispatchUserEvent(e){this.actions.Transition.forEach((e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this,e.init())})),e?(this.actions.Transition.forEach((e=>e.reverseFromCurrent())),this.actions.Animation.forEach((e=>e.reverseFromCurrent()))):(this.actions.Transition.forEach((e=>{e.playFromCurrent()})),this.actions.Animation.forEach((e=>{e.playFromCurrent()}))),this.actions.Create.forEach((e=>e.dispatchThrottled())),this.actions.SetVariable.forEach((e=>e.checkConditions())),this.actions.SetVariable.forEach((e=>e.dispatch())),this.actions.DynamicVariablePlay.forEach((e=>e.dispatch()))}},tte=class extends W7{constructor(e,t){super(e),this.wheelEventsPerObject=new Map,this.scrollEventsPerObject=new Map,this.isInview=!0,this.handleResize=()=>{[...this.scrollEventsPerObject.entries()].forEach((e=>{let[t,i]=e;i.forEach((e=>e.handleResize()))}))},this.onScroll=e=>{if(!this.isInview)return;let t={y:window.scrollY,x:window.scrollX};[...this.scrollEventsPerObject.entries()].forEach((e=>{let[i,n]=e;i.dispatchEvent({type:"beginEvent",eventName:"Scroll",scroll:t}),n.forEach((e=>e.dispatch(t)))}))},this.onWheel=e=>{!this.isInview||e.ctrlKey||[...this.wheelEventsPerObject.entries()].forEach((t=>{let[i,n]=t;i.dispatchEvent({type:"beginEvent",eventName:"Scroll",deltaY:e.deltaY}),n.forEach((t=>t.dispatch(e.deltaY)))}))},this.onUserEvent=e=>{var t;let{eventName:i,target:n,reverse:r}=e;if(!i||!n)return;let a=Y7(i);a&&"Scroll"===a&&(n.dispatchEvent({type:"beginEvent",eventName:"Scroll"}),null===(t=this.wheelEventsPerObject.get(n))||void 0===t||t.forEach((e=>{e.dispatchUserEvent(r)})))};let{page:i,sharedAssets:n,domElement:r,isExport:a}=this.eventContext,s=e=>{var s;if(null!==(s=e.data)&&void 0!==s&&s.events.length)for(let{id:c,data:h}of e.data.events)if(!h.disabled&&"Scroll"===h.type)if("load"!==h.trigger&&a){var o;let a=new ete(c,h,e,i,n,r,t);this.scrollEventsPerObject.has(e)?null===(o=this.scrollEventsPerObject.get(e))||void 0===o||o.push(a):this.scrollEventsPerObject.set(e,[a])}else{var l;let r=new $ee(c,h,e,i,n,t);this.wheelEventsPerObject.has(e)?null===(l=this.wheelEventsPerObject.get(e))||void 0===l||l.push(r):this.wheelEventsPerObject.set(e,[r])}};i.traverseEntity((e=>{var t;(e instanceof i5||e instanceof X4)&&null!==(t=e.frame)&&void 0!==t&&t.traverse((e=>{s(e)})),s(e)})),this.intersectionObserver=new IntersectionObserver((e=>{let t=e[0];t&&(this.isInview=t.isIntersecting)}),{root:null})}connect(){this.intersectionObserver.observe(this.eventContext.domElement),[...this.wheelEventsPerObject.entries()].forEach((e=>{let[t,i]=e;i.forEach((e=>e.connect())),t.addEventListener("userEvent",this.onUserEvent)})),[...this.scrollEventsPerObject.entries()].forEach((e=>{let[t,i]=e;i.forEach((e=>e.connect())),t.addEventListener("userEvent",this.onUserEvent)})),[...this.wheelEventsPerObject.values()].some((e=>e.length))&&(this.domEventsNeeded.add("wheel"),window.addEventListener("wheel",this.onWheel)),[...this.scrollEventsPerObject.values()].some((e=>e.length))&&(this.domEventsNeeded.add("scroll"),window.addEventListener("scroll",this.onScroll),window.addEventListener("resize",this.handleResize))}disconnect(){window.removeEventListener("wheel",this.onWheel),window.removeEventListener("scroll",this.onScroll),window.removeEventListener("resize",this.handleResize),this.intersectionObserver.unobserve(this.eventContext.domElement),this.domEventsNeeded.clear(),[...this.wheelEventsPerObject.entries()].forEach((e=>{let[t,i]=e;i.forEach((e=>e.disconnect())),t.removeEventListener("userEvent",this.onUserEvent)})),[...this.scrollEventsPerObject.entries()].forEach((e=>{let[t,i]=e;i.forEach((e=>e.disconnect())),t.removeEventListener("userEvent",this.onUserEvent)}))}},ite=class{constructor(e,t,i,n,r,a){this.id=e,this.data=t,this.object=i,this.actions=q9(t,t.actions,n,r,a,i)}disconnect(){X9(this.actions)}dispatch(){this.actions.Transition.forEach((e=>{e.play()})),this.actions.Animation.forEach((e=>{e.play()})),this.actions.SwitchCamera.forEach((e=>{e.play()})),this.actions.SceneTransition.forEach((e=>{e.dispatch()})),this.actions.Reset.forEach((e=>e.dispatch())),this.actions.SetVariable.forEach((e=>e.checkConditions())),this.actions.SetVariable.forEach((e=>e.dispatch())),this.actions.DynamicVariablePlay.forEach((e=>e.dispatch())),this.actions.Create.forEach((e=>{e.dispatchFromStart()})),this.actions.Destroy.forEach((e=>{e.dispatchFromStart()}))}dispatchAfter(e){this.actions.Audio.forEach((t=>{var i;(null!==(i=t.interaction.data.triggerAfter)&&void 0!==i?i:"any")===e&&(t.interaction instanceof j6?t.interaction.audioPlayer.play():t.interaction instanceof V6&&t.interaction.dispatch())})),this.actions.Video.forEach((t=>{var i;let n=null!==(i=t.interaction.data.triggerAfter)&&void 0!==i?i:"autoplay";n===e&&(t.interaction instanceof Z9?t.interaction.play("autoplay"===n):t.interaction instanceof K9&&t.interaction.dispatch())})),this.actions.Particles.forEach((t=>{var i;(null!==(i=t.data.triggerAfter)&&void 0!==i?i:"any")===e&&t.dispatchBasic()}))}dispatchUserEvent(e){this.actions.Transition.forEach((e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this,e.init())})),e?(this.actions.Transition.forEach((e=>e.reverseFromCurrent())),this.actions.Animation.forEach((e=>e.reverseFromCurrent())),this.actions.SwitchCamera.forEach((e=>e.reverseFromCurrent()))):(this.actions.Transition.forEach((e=>e.playFromCurrent())),this.actions.Animation.forEach((e=>e.playFromCurrent())),this.actions.SwitchCamera.forEach((e=>e.playFromCurrent()))),this.actions.SceneTransition.forEach((e=>e.dispatch())),this.actions.Reset.forEach((e=>e.dispatch())),this.actions.SetVariable.forEach((e=>e.checkConditions())),this.actions.SetVariable.forEach((e=>e.dispatch())),this.actions.DynamicVariablePlay.forEach((e=>e.dispatch())),this.actions.Create.forEach((e=>{e.dispatch()})),this.actions.Destroy.forEach((e=>{e.dispatch()})),this.actions.Audio.forEach((e=>{e.interaction instanceof j6?e.interaction.audioPlayer.play():e.interaction instanceof V6&&e.interaction.dispatch()})),this.actions.Video.forEach((e=>{e.interaction instanceof Z9?e.interaction.play():e.interaction instanceof K9&&e.interaction.dispatch()})),this.actions.Particles.forEach((e=>{e.dispatchBasic()}))}},nte=class extends W7{constructor(e,t){super(e),this.eventManager=t,this.eventsPerObject=new Map,this.eventsAfterPerObject=new Map,this.onMouseDown=()=>{[...this.eventsAfterPerObject.entries()].forEach((e=>{let[t,i]=e;t.dispatchEvent({type:"beginEvent",eventName:"Start"}),i.forEach((e=>{e.dispatchAfter("mouseDown")}))}))},this.onKeyDown=()=>{[...this.eventsAfterPerObject.entries()].forEach((e=>{let[t,i]=e;t.dispatchEvent({type:"beginEvent",eventName:"Start"}),i.forEach((e=>{e.dispatchAfter("keyDown")}))}))},this.onAny=()=>{let{domElement:e,isExport:t}=this.eventContext;(t?document:e).removeEventListener("pointerdown",this.onAny),document.removeEventListener("keydown",this.onAny),[...this.eventsAfterPerObject.entries()].forEach((e=>{let[t,i]=e;t.dispatchEvent({type:"beginEvent",eventName:"Start"}),i.forEach((e=>{e.dispatchAfter("any")}))}))},this.onSceneTransitionAudioVideoPlay=()=>{[...this.eventsAfterPerObject.entries()].forEach((e=>{let[t,i]=e;t.dispatchEvent({type:"beginEvent",eventName:"Start"}),i.forEach((e=>{e.actions.Audio.forEach((e=>{e.interaction instanceof j6&&e.interaction.audioPlayer.play()})),e.actions.Video.forEach((e=>{var t;let i=null!==(t=e.interaction.data.triggerAfter)&&void 0!==t?t:"autoplay";e.interaction instanceof Z9&&e.interaction.play("autoplay"===i)})),e.actions.Particles.forEach((e=>{e.dispatchBasic()}))}))}))},this.onPlay=()=>{[...this.eventsAfterPerObject.entries()].forEach((e=>{let[t,i]=e;t.dispatchEvent({type:"beginEvent",eventName:"Start"}),i.forEach((e=>{e.dispatchAfter("autoplay")}))}))},this.onUserEvent=e=>{var t,i;let{eventName:n,target:r,reverse:a}=e;if(!n||!r)return;let s=Y7(n);s&&"Start"===s&&(r instanceof r4||r.dispatchEvent({type:"beginEvent",eventName:"Start"}),null!==(t=this.eventsPerObject.get(r))&&void 0!==t&&t.forEach((e=>{e.dispatchUserEvent(a)})),null===(i=this.eventsAfterPerObject.get(r))||void 0===i||i.forEach((e=>{e.dispatchUserEvent(a)})))}}connect(){let{sharedAssets:e,page:t}=this.eventContext,i=i=>{var n;if(null!==(n=i.data)&&void 0!==n&&n.events.length)for(let{id:l,data:c}of i.data.events){var r,a,s,o;if(c.disabled||"Start"!==c.type)continue;let n=new ite(l,c,i,t,e,this.eventManager);(n.actions.Transition.length||n.actions.Animation.length||n.actions.SwitchCamera.length||n.actions.Create.length||n.actions.Destroy.length||n.actions.SceneTransition.length||n.actions.Reset.length||n.actions.SetVariable.length||n.actions.DynamicVariablePlay.length)&&(this.eventsPerObject.has(i)?null===(r=this.eventsPerObject.get(i))||void 0===r||r.push(n):this.eventsPerObject.set(i,[n])),n.actions.Audio.length&&(this.eventsAfterPerObject.has(i)?null===(a=this.eventsAfterPerObject.get(i))||void 0===a||a.push(n):this.eventsAfterPerObject.set(i,[n])),n.actions.Video.length&&(this.hasVideoAction=!0,this.eventsAfterPerObject.has(i)?null===(s=this.eventsAfterPerObject.get(i))||void 0===s||s.push(n):this.eventsAfterPerObject.set(i,[n])),n.actions.Particles.length&&(this.eventsAfterPerObject.has(i)?null===(o=this.eventsAfterPerObject.get(i))||void 0===o||o.push(n):this.eventsAfterPerObject.set(i,[n]))}};if(t.traverseEntity((e=>{var t;(e instanceof i5||e instanceof X4)&&null!==(t=e.frame)&&void 0!==t&&t.traverse((e=>{i(e)})),i(e)})),[...this.eventsAfterPerObject.values()].some((e=>e.length))){if(0===this.eventManager.activateCount){let{domElement:e,isExport:t}=this.eventContext,i=t?document:e;i.addEventListener("pointerdown",this.onMouseDown,{once:!0}),i.addEventListener("mousedown",this.onMouseDown,{once:!0}),document.addEventListener("keydown",this.onKeyDown,{once:!0}),i.addEventListener("pointerdown",this.onAny),i.addEventListener("mousedown",this.onAny),document.addEventListener("keydown",this.onAny),[...this.eventsAfterPerObject.entries()].forEach((e=>{let[t,i]=e;t.addEventListener("userEvent",this.onUserEvent)}))}else this.onSceneTransitionAudioVideoPlay();this.onPlay()}[...this.eventsPerObject.entries()].forEach((e=>{let[t,i]=e;t.dispatchEvent({type:"beginEvent",eventName:"Start"}),i.forEach((e=>e.dispatch())),t.addEventListener("userEvent",this.onUserEvent)}))}disconnect(){if([...this.eventsAfterPerObject.values()].some((e=>e.length))){let{domElement:e,isExport:t}=this.eventContext,i=t?document:e;i.removeEventListener("pointerdown",this.onMouseDown),i.removeEventListener("mousedown",this.onMouseDown),document.removeEventListener("keydown",this.onKeyDown),i.removeEventListener("pointerdown",this.onAny),i.removeEventListener("mousedown",this.onAny),document.removeEventListener("keydown",this.onAny),[...this.eventsAfterPerObject.entries()].forEach((e=>{let[t,i]=e;t.removeEventListener("userEvent",this.onUserEvent),i.forEach((e=>e.disconnect()))}))}[...this.eventsPerObject.entries()].forEach((e=>{let[t,i]=e;t.removeEventListener("userEvent",this.onUserEvent),i.forEach((e=>e.disconnect()))})),this.eventsPerObject.clear(),this.eventsAfterPerObject.clear()}},rte=class{constructor(e,t,i,n,r,a){this.id=e,this.data=t,this.object=i,this.disabled=!1,this.alreadyPlayedNonTogglingActions=new Set,this.actions=q9(t,t.actions,n,r,a,i),this.target=t.target,this.useToggle="Toggle"===t.runMode}disconnect(){X9(this.actions)}dispatch(e){this.disabled||(this.actions.Transition.forEach((e=>{e.object.currentTransitionEvent!==this?(e.object.currentTransitionEvent=this,e.init()):"Once"===this.data.runMode&&this.alreadyPlayedNonTogglingActions.add(e)})),this.object.dispatchEvent({type:"beginEvent",eventName:"Collision"}),this.useToggle?(this.actions.Transition.forEach((e=>{e.toggle()})),this.actions.Animation.forEach((e=>{e.toggle()}))):(this.actions.Transition.forEach((e=>{!1===this.alreadyPlayedNonTogglingActions.has(e)&&e.play()})),this.actions.Animation.forEach((e=>{e.play()}))),this.actions.Reset.forEach((e=>{e.dispatch()})),this.actions.Link.forEach((e=>{e.dispatch()})),this.actions.Reset.forEach((e=>{e.dispatch()})),this.actions.Create.forEach((e=>{e.dispatch()})),this.actions.Destroy.forEach((t=>{t.dispatch(null!==e&&void 0!==e&&e)})),this.actions.SetVariable.forEach((e=>e.checkConditions())),this.actions.SetVariable.forEach((e=>e.dispatch())),this.actions.DynamicVariablePlay.forEach((e=>e.dispatch())),this.actions.Audio.forEach((e=>{e.dispatchBasic()})),this.actions.Particles.forEach((e=>{e.dispatchBasic()})),this.actions.Video.forEach((e=>{e.dispatchBasic()})))}},ate=class extends W7{constructor(e,t,i,n,r){super(e),this.sharedVariables=t,this.eventManager=i,this.needsMouse=n,this.needsRaycast=r,this.dynamicVars=[],this.variablesToWatch=[],this.prevMouseProperty=null,this.prevRaycastProperty=null,this.pauseTime=0,this.events=[],this.onFrame=e=>{this.rafId=window.requestAnimationFrame(this.onFrame);let t=new Date,i=[],n=[];for(let l=0;l<this.propertiesToWatch.length;l++){let{objectId:e,property:t,prevValue:i}=this.propertiesToWatch[l],r=this.eventContext.scene.find(e),a=DG.propertyPaths[t];if("width"===a[0]||"height"===a[0]||"depth"===a[0])r=r.geometry.userData.parameters[a[0]];else for(let n=0;n<a.length;n++)r=r[a[n]];null===i?this.propertiesToWatch[l].prevValue=r instanceof FA?r.clone():r:(r instanceof FA?!r.equals(i):i!==r)&&(n.push({objId:e,property:t}),r instanceof FA?this.propertiesToWatch[l].prevValue.copy(r):this.propertiesToWatch[l].prevValue=r)}for(let l=0;l<this.variablesToWatch.length;l++){let{id:e,prevValue:t}=this.variablesToWatch[l],n=this.shared.getVariable(e);n!==t&&(i.push(e),this.variablesToWatch[l].prevValue=n)}for(let l=0;l<this.dynamicVars.length;l++){let{id:n,expectedTime:s,last:o,data:c,timerSeconds:h,startValue:u}=this.dynamicVars[l],d=1e3;if("timer"!==c.dynamicVariableType&&"stopwatch"!==c.dynamicVariableType||"number3decimal"!==c.format?"counter"===c.dynamicVariableType?d=c.updateInterval:"random"===c.dynamicVariableType&&(d=c.isStatic?1/0:c.updateInterval):d=1,-1!==s){if("Stopped"!==this.shared.getDynamicVariablePlayState(n)&&"Restarted"!==this.shared.getDynamicVariablePlayState(n)||(this.dynamicVars[l].last=e,this.dynamicVars[l].expectedTime=e+d,"counter"===c.dynamicVariableType&&this.shared.getVariable(n)!==u&&(this.shared.updateVariable(n,u),this.eventManager.requestRender()),("timer"===c.dynamicVariableType||"stopwatch"===c.dynamicVariableType)&&this.dynamicVars[l].timerSeconds!==u&&(this.dynamicVars[l].timerSeconds=u,this.shared.updateVariable(n,hW.getFormattedTimerTime(u,c)),this.eventManager.requestRender()),"Restarted"===this.shared.getDynamicVariablePlayState(n)&&this.shared.setDynamicVariablePlayState(n,"Playing"),"Stopped"!==this.shared.getDynamicVariablePlayState(n))){if("Paused"===this.shared.getDynamicVariablePlayState(n)){void 0===this.dynamicVars[l].deltaToExpectedTime&&(this.dynamicVars[l].deltaToExpectedTime=Math.max(this.dynamicVars[l].expectedTime-e,0)),this.dynamicVars[l].last=e-(d-this.dynamicVars[l].deltaToExpectedTime),this.dynamicVars[l].expectedTime=e+this.dynamicVars[l].deltaToExpectedTime;continue}if(this.dynamicVars[l].deltaToExpectedTime=void 0,e>=s)if(this.dynamicVars[l].last=e,this.dynamicVars[l].expectedTime+=d,"random"===c.dynamicVariableType){let e=c.min+Math.random()*(c.max-c.min),t=c.decimals;e=Math.round(e*Math.pow(10,t))/Math.pow(10,t),this.shared.updateVariable(n,e),i.push(n),this.eventManager.requestRender()}else if("counter"===c.dynamicVariableType){var r;if(0===c.increment)continue;let e=this.shared.getVariable(n),t=null===(r=this.shared.getDynamicVariableToggleIsForward(n))||void 0===r||r,a=this.shared.getVariable(n)+c.increment*(t?1:-1);c.hasEnd&&(a=c.increment>0?cA.clamp(a,u,c.endValue):cA.clamp(a,c.endValue,u),a===u&&this.shared.setDynamicVariableToggleIsForward(n,void 0),c.repeat?a===c.endValue&&(a=u):(a===u||a===c.endValue)&&this.shared.setDynamicVariablePlayState(n,"Paused")),a!==e&&(i.push(n),this.shared.updateVariable(n,a),this.eventManager.requestRender())}else if("time"===c.dynamicVariableType)this.shared.updateVariable(n,N$(t,c)),i.push(n),this.eventManager.requestRender();else{var a;let t=aW.isTextValue(c.endValue)?ote(c.endValue.textValue):c.endValue,r=null===(a=this.shared.getDynamicVariableToggleIsForward(n))||void 0===a||a,s=h+(e-o)/1e3*("timer"===c.dynamicVariableType?-1:1)*(r?1:-1);s=Math.max(s,0),c.hasEnd&&(s="stopwatch"===c.dynamicVariableType?cA.clamp(s,u,t):cA.clamp(s,t,u),s===u&&this.shared.setDynamicVariableToggleIsForward(n,void 0),c.repeat?Math.abs(s-t)<("number3decimal"===c.format?1e-4:.1)&&(s=u):(Math.abs(s-u)<("number3decimal"===c.format?1e-4:.1)||Math.abs(s-t)<("number3decimal"===c.format?1e-4:.1))&&this.shared.setDynamicVariablePlayState(n,"Paused")),s!==h&&(i.push(n),this.dynamicVars[l].timerSeconds=s,this.shared.updateVariable(n,hW.getFormattedTimerTime(s,c)),this.eventManager.requestRender())}}}else this.dynamicVars[l].last=e,this.dynamicVars[l].expectedTime=e+d}this.needsMouse&&this.shared.mouseProperty!==this.prevMouseProperty&&(this.prevMouseProperty=this.shared.mouseProperty,this.events.forEach((e=>{"mouseProperty"===e.data.variableId&&(e.dispatch(),this.eventManager.requestRender())})));let s=!1;this.shared.mouseProperty!==this.prevMouseProperty&&(this.prevMouseProperty=this.shared.mouseProperty,s=!0);let o=!1;this.shared.raycastProperty!==this.prevRaycastProperty&&(this.prevRaycastProperty=this.shared.raycastProperty,o=!0),this.events.forEach((e=>{(i.includes(e.data.variableId)||n.find((t=>t.objId===e.data.objectId&&t.property===e.data.property))||"mouseProperty"===e.data.variableId&&s||"raycastProperty"===e.data.variableId&&o)&&(e.dispatch(),this.eventManager.requestRender())}))},this.onBlur=()=>{this.pause()},this.onFocus=()=>{this.resume()},e.page.traverseEntity((t=>{var n;null===(n=t.data)||void 0===n||n.events.filter((e=>"VariableChange"===e.data.type&&!e.data.disabled)).forEach((n=>{this.events.push(new ste(t.uuid,n.data,t,e.page,e.sharedAssets,i))}))})),this.propertiesToWatch=this.events.filter((e=>"objectProperty"===e.data.variableId&&null!==e.data.objectId)).map((e=>({objectId:e.data.objectId,property:e.data.property,prevValue:null}))),this.shared=e.sharedAssets,this.sharedVariables.forEach((e=>{let t,{id:i,data:n}=e;if("dynamicVariableType"in n)if("timer"===n.dynamicVariableType||"stopwatch"===n.dynamicVariableType){let e;if(aW.isTextValue(n.value)&&Array.isArray(n.value.textValue)){let t=n.value.textValue;e=3===t.length?t[2]+60*t[1]+3600*t[0]:t[1]+60*t[0]}else e=n.value;t=e,this.dynamicVars.push({id:i,last:-1,expectedTime:-1,data:n,timerSeconds:e,startValue:t})}else"time"===n.dynamicVariableType&&this.shared.updateVariable(i,N$(new Date,n)),"counter"===n.dynamicVariableType&&(t=aW.isTextValue(n.value)?ote(n.value.textValue):n.value),this.dynamicVars.push({id:i,last:-1,expectedTime:-1,data:n,startValue:t});else this.events.find((e=>e.data.variableId===i))&&this.variablesToWatch.push({id:i,prevValue:this.shared.getVariable(i)})}))}pause(){this.pauseTime=Date.now()}resume(){let e=Date.now()-this.pauseTime;for(let t=0;t<this.dynamicVars.length;t++)this.dynamicVars[t].last+=e,this.dynamicVars[t].expectedTime+=e}connect(){this.rafId=window.requestAnimationFrame(this.onFrame),window.addEventListener("blur",this.onBlur),window.addEventListener("focus",this.onFocus)}disconnect(){window.removeEventListener("blur",this.onBlur),window.removeEventListener("focus",this.onFocus),this.rafId&&(window.cancelAnimationFrame(this.rafId),this.rafId=void 0),this.events.forEach((e=>e.dispose()))}},ste=class{constructor(e,t,i,n,r,a){this.id=e,this.data=t,this.object=i,this.actions=q9(t,t.actions,n,r,a,i)}dispatch(){let e=this.actions;e.Audio.forEach((e=>e.dispatchConditional())),e.Particles.forEach((e=>e.dispatchConditional())),e.Video.forEach((e=>e.dispatchConditional())),e.Create.forEach((e=>e.dispatch())),e.Destroy.forEach((e=>e.dispatch())),e.Reset.forEach((e=>e.dispatch())),e.Transition.forEach((e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this),e.init()})),e.Transition.forEach((e=>e.play())),e.Animation.forEach((e=>e.play())),e.SwitchCamera.forEach((e=>e.play())),e.SceneTransition.forEach((e=>e.dispatch())),e.SetVariable.forEach((e=>e.checkConditions())),e.SetVariable.forEach((e=>e.dispatch())),e.DynamicVariablePlay.forEach((e=>e.dispatch()))}dispose(){X9(this.actions)}};function ote(e){return 3===e.length?e[2]+60*e[1]+3600*e[0]:e[1]+60*e[0]}var lte,cte,hte,ute="\n(async function() {\n\tconst [wasmImport, wasmBinary] = await Promise.all([\n\t\timport('".concat("https://unpkg.com/@splinetool/runtime@1.0.53/build/","' + 'navmesh.js'),\n\t\tfetch('").concat("https://unpkg.com/@splinetool/navmesh-wasm@1.0.53/build/","' + 'navmesh.wasm').then((res) => res.arrayBuffer()),\n\t]);\n\tconst wasmModule = wasmImport.default;\n\tself.module = await wasmModule({ wasmBinary });\n\tpostMessage('ready');\n})();\n"),dte={cs:6,ch:2,walkableSlopeAngle:90,walkableHeight:20,walkableClimb:5,walkableRadius:0,maxEdgeLen:12,maxSimplificationError:1.3,minRegionArea:8,mergeRegionArea:20,maxVertsPerPoly:6,detailSampleDist:6,detailSampleMaxError:1};qj.then((e=>{lte=e,cte=new e.Vec3,hte=new e.Vec3}));var pte=new FA,fte=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.usePhysics=e,this.isExport=t,this.onPointerDown=e=>{if(1!==Rj.length)return;let{raycaster:t,page:i}=this.eventContext;this.eventContext.updateRaycaster(e);let n=i.raycastWithClones(t);if(0!==n.length){if(this.gameControl){let e=pte.copy(this.gameControl.colliderWorldPosition);e.y-=this.gameControl.colliderHeight/2,this.gameControl.path=this.computePath(e,n[0].point)}this.eventContext.requestRender()}},this.traverseWithPhysics=(e,t)=>i=>{var n,r,a,s,o,l;let c;if(i instanceof x1){if(!i.objectForSample)return!0===i.object.dataPatched.physics.fusedBody&&"dynamic"===i.object.dataPatched.physics.rigidBody||void 0;if(i.objectForSample.dataPatched.physics.fusedBody)return;c=i.object}else if(i instanceof BX)c=i.object;else if(c=i,!1===(null===(n=c.dataPatched.cloner)||void 0===n?void 0:n.disabled)&&null!==(r=c.dataPatched.cloner)&&void 0!==r&&r.hideBase&&!0!==(null===(a=c.dataPatched.physics)||void 0===a?void 0:a.fusedBody))return!0;if(t&&!c.userData.navmesh)return;let h=c.dataPatched;if(!h.visible&&!0!==(null===(s=h.physics)||void 0===s?void 0:s.enabled))return!0;i.updateMatrixWorldSVD();let u=$te(h),d=c.userData.hasDestroy,p=c.userData.hasDrag,f=!1,m=!1;for(let e of h.events)!0!==e.data.disabled&&("GameControl"===e.data.type?f=!0:"Follow"===e.data.type&&(m=!0));if(f||u||m||d||p)return!0;var g;if(this.usePhysics&&"dynamic"===(null===(o=h.physics)||void 0===o?void 0:o.rigidBody)){if(this.usePhysics&&null!==(g=h.physics)&&void 0!==g&&g.fusedBody)return!0}else if("geometry"in i&&i.geometry&&e.push(D7(i.geometry,i.matrixWorld)),this.usePhysics&&null!==(l=h.physics)&&void 0!==l&&l.fusedBody)return i.traverseObject(((t,i)=>{var n,r;if(0===i)return;let a;if(t instanceof x1){if(!t.objectForSample)return!0===t.object.dataPatched.physics.fusedBody&&"dynamic"===t.object.dataPatched.physics.rigidBody||void 0;if(t.objectForSample.dataPatched.physics.fusedBody)return;a=t.object}else if(t instanceof BX)a=t.object;else if(a=t,null!==(n=t.dataPatched.cloner)&&void 0!==n&&n.hideBase)return!0;let s=a.dataPatched;if(!s.visible&&!0!==(null===(r=s.physics)||void 0===r?void 0:r.enabled))return!0;"geometry"in t&&t.geometry&&e.push(D7(t.geometry,t.matrixWorld))})),!0},this.traverseNoPhysics=(e,t)=>i=>{let n;if(i instanceof x1)return;n=i instanceof BX?i.object:i;let r=n.dataPatched;if("visibility"===r.physics.enabled?!r.visible:!r.physics.enabled)return!0;if(t&&!n.userData.navmesh)return;let a=i.geometry,s=!0===n.userData.hasDestroy,o=!0===n.userData.hasDrag;if($te(r)||s||o||n.dataPatched.events.some((e=>!0!==e.data.disabled&&"GameControl"===e.data.type)))return!0;a&&e.push(D7(a,i.matrixWorld))},this.navmeshWasm=lte,this.navMesh=new this.navmeshWasm.NavMesh,this._workerURL=URL.createObjectURL(new Blob([(t?ute:"\n(async function() {\n\tconst [wasmImport, wasmBinary] = await Promise.all([\n\t\timport(self.location.origin + '/_libraries/navmesh.js'),\n\t\tfetch(self.location.origin + '/_libraries/navmesh.wasm').then((res) => res.arrayBuffer()),\n\t]);\n\tconst wasmModule = wasmImport.default;\n\tself.module = await wasmModule({ wasmBinary });\n\tpostMessage('ready');\n})();\n")+"\n\nonmessage = function(messageEvent) {\n\tconst meshData = messageEvent.data;\n\tconst positions = meshData[0];\n\tconst offset = meshData[1];\n\tconst indices = meshData[2];\n\tconst indicesLength = meshData[3];\n\tconst parameters = meshData[4];\n\n\tconst module = self.module;\n\tconst rc = new module.rcConfig();\n\trc.cs = parameters.cs;\n\trc.ch = parameters.ch;\n\trc.borderSize = parameters.borderSize ? parameters.borderSize : 0;\n\trc.tileSize = parameters.tileSize ? parameters.tileSize : 0;\n\trc.walkableSlopeAngle = parameters.walkableSlopeAngle;\n\trc.walkableHeight = parameters.walkableHeight;\n\trc.walkableClimb = parameters.walkableClimb;\n\trc.walkableRadius = parameters.walkableRadius;\n\trc.maxEdgeLen = parameters.maxEdgeLen;\n\trc.maxSimplificationError = parameters.maxSimplificationError;\n\trc.minRegionArea = parameters.minRegionArea;\n\trc.mergeRegionArea = parameters.mergeRegionArea;\n\trc.maxVertsPerPoly = parameters.maxVertsPerPoly;\n\trc.detailSampleDist = parameters.detailSampleDist;\n\trc.detailSampleMaxError = parameters.detailSampleMaxError;\n\n\tif (!self.navMesh) {\n\t\tself.navMesh = new module.NavMesh();\n\t}\n\tself.navMesh.build(positions, offset, indices, indicesLength, rc);\n\n\tconst navmeshData = navMesh.getNavmeshData();\n\tconst arrView = new Uint8Array(module.HEAPU8.buffer, navmeshData.dataPointer, navmeshData.size);\n\tconst ret = new Uint8Array(navmeshData.size);\n\tret.set(arrView);\n\tnavMesh.freeNavmeshData(navmeshData);\n\n\tpostMessage(ret);\n}\n"])),this._worker=new Worker(this._workerURL)}init(e,t,i){this.gameControl=t,this.eventContext=i,this.resolution=e.ch,this.setDefaultQueryExtent((new FA).setScalar(e.ch*e.walkableRadius*1.2)),this._worker.onmessage=()=>{this.createNavMesh(i.page,e,(e=>{this.buildFromNavmeshData(e.data)}))},this.eventContext.renderer.domElement.addEventListener("pointerdown",this.onPointerDown)}createNavMesh(e,t,i){t.objects.forEach((t=>{var i;let n=e.scene.find(t);n.traverseEntity((e=>{e.userData.navmesh=!0})),null===(i=n.cloner)||void 0===i||i.traverseObject((e=>{e.userData.navmesh=!0}))}));let n=[],r=(this.usePhysics?this.traverseWithPhysics:this.traverseNoPhysics)(n,"custom"===t.zones);if(e.traverseChildren(r),t.objects.forEach((t=>{var i;let n=e.scene.find(t);n.traverseEntity((e=>{e.userData.navmesh=void 0})),null===(i=n.cloner)||void 0===i||i.traverseObject((e=>{e.userData.navmesh=void 0}))})),0===n.length)return!1;let a=$W(n),{positions:s,triIndices:o}=UZ(a.getAttribute("position"),a.getIndex());return this._worker.postMessage([s,s.length/3,o,o.length,{...dte,...t}]),this._worker.onmessage=i,!0}createDebugNavGeometry(){let e,t,i=this.navMesh.getDebugNavMesh(),n=i.getTriangleCount(),r=new Uint32Array(3*n),a=new Float32Array(3*n*3);for(e=0;e<3*n;e++)r[e]=e;for(e=0;e<n;e++)for(t=0;t<3;t++){let n=i.getTriangle(e).getPoint(t);a[9*e+3*t+0]=n.x,a[9*e+3*t+1]=n.y,a[9*e+3*t+2]=n.z}let s=new fT;return s.setIndex(new nT(r,1)),s.setAttribute("position",new nT(a,3)),s}getClosestPoint(e){return cte.x=e.x,cte.y=e.y,cte.z=e.z,this.navMesh.getClosestPoint(cte)}getClosestPointToRef(e,t){cte.x=e.x,cte.y=e.y,cte.z=e.z;let i=this.navMesh.getClosestPoint(cte);t.set(i.x,i.y,i.z)}getRandomPointAround(e,t){return cte.x=e.x,cte.y=e.y,cte.z=e.z,this.navMesh.getRandomPointAround(cte,t)}getRandomPointAroundToRef(e,t,i){cte.x=e.x,cte.y=e.y,cte.z=e.z;let n=this.navMesh.getRandomPointAround(cte,t);i.set(n.x,n.y,n.z)}moveAlong(e,t){return cte.x=e.x,cte.y=e.y,cte.z=e.z,hte.x=t.x,hte.y=t.y,hte.z=t.z,this.navMesh.moveAlong(cte,hte)}moveAlongToRef(e,t,i){return cte.x=e.x,cte.y=e.y,cte.z=e.z,hte.x=t.x,hte.y=t.y,hte.z=t.z,this.navMesh.moveAlong(cte,hte)}computePath(e,t){let i=this.getClosestPoint(t);hte.x=i.x,hte.y=i.y,hte.z=i.z,this.getClosestPoint(e);let n=this.navMesh.computePath(cte,hte),r=n.getPointCount(),a=[];for(let s=0;s<r;s++){let e=n.getPoint(s);a.push(new FA(e.x,e.y,e.z))}return a}createCrowd(e,t){return new mte(this,e,t)}setDefaultQueryExtent(e){cte.x=e.x,cte.y=e.y,cte.z=e.z,this.navMesh.setDefaultQueryExtent(cte)}getDefaultQueryExtent(){return this.navMesh.getDefaultQueryExtent()}buildFromNavmeshData(e){let t=e.length*e.BYTES_PER_ELEMENT,i=this.navmeshWasm._malloc(t),n=new Uint8Array(this.navmeshWasm.HEAPU8.buffer,i,t);n.set(e);let r=new this.navmeshWasm.NavmeshData;r.dataPointer=n.byteOffset,r.size=e.length,this.navMesh.buildFromNavmeshData(r),this.navmeshWasm._free(n.byteOffset)}getNavmeshData(){let e=this.navMesh.getNavmeshData(),t=new Uint8Array(this.navmeshWasm.HEAPU8.buffer,e.dataPointer,e.size),i=new Uint8Array(e.size);return i.set(t),this.navMesh.freeNavmeshData(e),i}getDefaultQueryExtentToRef(e){let t=this.navMesh.getDefaultQueryExtent();e.set(t.x,t.y,t.z)}dispose(){var e;this.navMesh.destroy(),this._worker.terminate(),URL.revokeObjectURL(this._workerURL),null===(e=this.eventContext)||void 0===e||e.renderer.domElement.removeEventListener("pointerdown",this.onPointerDown)}addCylinderObstacle(e,t,i){return cte.x=e.x,cte.y=e.y,cte.z=e.z,this.navMesh.addCylinderObstacle(cte,t,i)}addBoxObstacle(e,t,i){return cte.x=e.x,cte.y=e.y,cte.z=e.z,hte.x=t.x,hte.y=t.y,hte.z=t.z,this.navMesh.addBoxObstacle(cte,hte,i)}removeObstacle(e){this.navMesh.removeObstacle(e)}isSupported(){return void 0!==this.navmeshWasm}},mte=class{constructor(e,t,i){this.navmeshWasmWrapper=e,this.transforms=[],this.agents=new Array,this.reachRadii=new Array,this._agentDestinationArmed=new Array,this._agentDestination=new Array,this.crowd=new this.navmeshWasmWrapper.navmeshWasm.Crowd(t,i,this.navmeshWasmWrapper.navMesh.getNavMesh())}onReachTarget(e,t){}addAgent(e,t,i){let n=new this.navmeshWasmWrapper.navmeshWasm.dtCrowdAgentParams;n.radius=t.radius,n.height=t.height,n.maxAcceleration=t.maxAcceleration,n.maxSpeed=t.maxSpeed,n.collisionQueryRange=t.collisionQueryRange,n.pathOptimizationRange=t.pathOptimizationRange,n.separationWeight=t.separationWeight,n.updateFlags=7,n.obstacleAvoidanceType=0,n.queryFilterType=0,n.userData=0;let r=this.crowd.addAgent(new this.navmeshWasmWrapper.navmeshWasm.Vec3(e.x,e.y,e.z),n);return this.transforms.push(i),this.agents.push(r),this.reachRadii.push(t.reachRadius?t.reachRadius:t.radius),this._agentDestinationArmed.push(!1),this._agentDestination.push(new FA(0,0,0)),r}getAgentPosition(e){return this.crowd.getAgentPosition(e)}getAgentPositionToRef(e,t){let i=this.crowd.getAgentPosition(e);t.set(i.x,i.y,i.z)}getAgentVelocity(e){return this.crowd.getAgentVelocity(e)}getAgentVelocityToRef(e,t){let i=this.crowd.getAgentVelocity(e);t.set(i.x,i.y,i.z)}getAgentNextTargetPath(e){return this.crowd.getAgentNextTargetPath(e)}getAgentNextTargetPathToRef(e,t){let i=this.crowd.getAgentNextTargetPath(e);t.set(i.x,i.y,i.z)}getAgentState(e){return this.crowd.getAgentState(e)}overOffmeshConnection(e){return this.crowd.overOffmeshConnection(e)}agentGoto(e,t){this.crowd.agentGoto(e,new this.navmeshWasmWrapper.navmeshWasm.Vec3(t.x,t.y,t.z));let i=this.agents.indexOf(e);i>-1&&(this._agentDestinationArmed[i]=!0,this._agentDestination[i].set(t.x,t.y,t.z))}agentTeleport(e,t){this.crowd.agentTeleport(e,new this.navmeshWasmWrapper.navmeshWasm.Vec3(t.x,t.y,t.z))}updateAgentParameters(e,t){let i=this.crowd.getAgentParameters(e);void 0!==t.radius&&(i.radius=t.radius),void 0!==t.height&&(i.height=t.height),void 0!==t.maxAcceleration&&(i.maxAcceleration=t.maxAcceleration),void 0!==t.maxSpeed&&(i.maxSpeed=t.maxSpeed),void 0!==t.collisionQueryRange&&(i.collisionQueryRange=t.collisionQueryRange),void 0!==t.pathOptimizationRange&&(i.pathOptimizationRange=t.pathOptimizationRange),void 0!==t.separationWeight&&(i.separationWeight=t.separationWeight),this.crowd.setAgentParameters(e,i)}removeAgent(e){this.crowd.removeAgent(e);let t=this.agents.indexOf(e);t>-1&&(this.agents.splice(t,1),this.transforms.splice(t,1),this.reachRadii.splice(t,1),this._agentDestinationArmed.splice(t,1),this._agentDestination.splice(t,1))}getAgents(){return this.agents}update(e){if(this.navmeshWasmWrapper.navMesh.update(),e<=.001)return;let t=1/60;{let i=Math.floor(e/t);i>10&&(i=10),i<1&&(i=1);let n=e/i;for(let e=0;e<i;e++)this.crowd.update(n)}for(let i=0;i<this.agents.length;i++){let e=this.agents[i],t=this.getAgentPosition(e);if(this.transforms[i].copy(t),this._agentDestinationArmed[i]){let n=t.x-this._agentDestination[i].x,r=t.z-this._agentDestination[i].z,a=this.reachRadii[i],s=this._agentDestination[i].y-this.reachRadii[i],o=this._agentDestination[i].y+this.reachRadii[i],l=n*n+r*r;t.y>s&&t.y<o&&l<a*a&&(this.onReachTarget(e,this._agentDestination[i]),this._agentDestinationArmed[i]=!1)}}}setDefaultQueryExtent(e){let t=new this.navmeshWasmWrapper.navmeshWasm.Vec3(e.x,e.y,e.z);this.crowd.setDefaultQueryExtent(t)}getDefaultQueryExtent(){return this.crowd.getDefaultQueryExtent()}getDefaultQueryExtentToRef(e){let t=this.crowd.getDefaultQueryExtent();e.set(t.x,t.y,t.z)}getCorners(e){let t,i=this.crowd.getCorners(e),n=i.getPointCount(),r=[];for(t=0;t<n;t++){let e=i.getPoint(t);r.push(new FA(e.x,e.y,e.z))}return r}dispose(){this.crowd.destroy()}};function gte(e){let t=!1;return e.scene.objects.forEach((i=>{"Page"===i.data.type&&!t&&i.data.publish.gameControlObject&&tW.traverseModuleInstances(e,i.id,((e,i,n)=>{for(let r of n)"GameControl"===r.data.type&&r.data.navmesh.enabled&&(t=!0)}))})),t}var vte={type:"change"},yte={type:"changeZoom"},bte={type:"changePan"},xte={type:"start"},wte={type:"end",changed:!0},_te={type:"end",changed:!1},Ste=new NA,Ete=new hA,Cte=2*Math.PI,Ate=new FA,Mte=new hA,Tte=new FA,Pte=new NA,Dte=new mM,kte={type:"requestRender"},Ote=class extends QC{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{isPlayMode:!1,isExport:!1};super(),this.object=e,this.domElement=t,this.options=i,this.enabled=!0,this.useKeyEvents=!0,this.enableDamping=!1,this.enableZoom=!0,this.enableRotate=!0,this.enablePan=!0,this.autoRotate=!1,this.rotationLimitsMode=0,this.panLimitsMode=0,this.rotationSoftLimit=2,this.panSoftLimit=2,this.hoverRotatePanMode=0,this.zoomLimitsEnabled=!1,this.mouseButtons=[0,5],this.mouseButtonsPlay=[3,4,5],this.touches=[null,_S,xS],this.offset=new FA,this.eye=new FA,this.lastPosition=new FA,this.lastQuaternion=new NA,this.current=new hA,this.overShoot=new hA,this.overRatio=new hA,this.spherical=new xR,this.sphericalDelta=new xR,this.panOffset=new FA,this.panLeftV=new FA,this.panUpV=new FA,this.panV=new FA,this.rotateStart=new hA,this.rotateEnd=new hA,this.rotateDelta=new hA,this.panStart=new hA,this.panEnd=new hA,this.panDelta=new hA,this.dollyStart=new hA,this.dollyEnd=new hA,this.dollyDelta=new hA,this.rotationRangeFactor=new hA,this.panRangeFactor=new hA,this.state=-1,this.zoomChanged=!1,this.isPointerDown=!1,this.isThetaFlipped=!1,this.prevScale=0,this.scale=1,this.gesture=!1,this.timer=-1,this.timerHover=-1,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPhi=0,this.maxPhi=Math.PI,this.minTheta=-1/0,this.maxTheta=1/0,this.minH=0,this.maxH=Math.PI,this.minV=-1/0,this.maxV=1/0,this.autoRotateClockwise=!0,this.isPanOverShoot=!1,this.isRotateOverShoot=!1,this.resetHoverEffectOnPointerLeave=!1,this.hasChange=!1,this.useWindowEvents=!1,this.isTouchZoom=!0,this.autoRotateSpeed=2,this.dampingFactor=.125,this.zoomSpeed=2,this.rotateSpeed=1,this.panSpeed=1,this.hoverRotatePanStrength=.1,this.hoverRotateDamping=this.dampingFactor,this.thetaIsFree=!1,this.phiIsFree=!1,this.needsUpdate=!0,this.onCameraChange=e=>{this.object.removeEventListener("beginState",this.onBeginState),this.object.removeEventListener("completeState",this.onCompleteState),this.object.removeEventListener("cameraChange",this.onCameraChange),this.object=e.camera,this.object.addEventListener("beginState",this.onBeginState),this.object.addEventListener("completeState",this.onCompleteState),this.object.addEventListener("cameraChange",this.onCameraChange)},this.update=()=>{this.object.updateWorldMatrix(!0,!1),this.object.matrixWorld.decompose(Tte,Pte,Ate),this.offset.copy(Tte).sub(this.target),this.spherical.setFromVector3(this.offset),this.object.isUpVectorFlipped&&(this.spherical.phi*=-1,this.spherical.theta-=Math.PI),this.autoRotate&&-1===this.state&&this.rotateLeft((!0===this.autoRotateClockwise?1:-1)*this.getAutoRotationAngle()),0!==this.rotationLimitsMode&&this.applyLimits(this.sphericalDelta,this.rotationLimitsMode,this.rotationSoftLimit,this.maxTheta,this.minTheta,this.maxPhi,this.minPhi,this.rotationRangeFactor),2!==this.rotationLimitsMode&&(this.spherical.phi+=this.sphericalDelta.phi),(1!==this.rotationLimitsMode||!0===this.autoRotate)&&(this.spherical.theta+=this.sphericalDelta.theta),this.spherical.radius*=this.scale,this.zoomLimitsEnabled&&(this.spherical.radius=Math.max(this.minDistance,Math.min(this.maxDistance,this.spherical.radius))),0!==this.panLimitsMode&&(this.target.applyQuaternion(Ste.copy(Pte).invert()),this.panOffset.applyQuaternion(Ste),this.applyLimits(this.panOffset,this.panLimitsMode,this.panSoftLimit,this.maxH,this.minH,this.maxV,this.minV,this.panRangeFactor),this.target.applyQuaternion(Pte),this.panOffset.applyQuaternion(Pte)),2===this.panLimitsMode&&(this.panOffset.y=0),1===this.panLimitsMode&&(this.panOffset.x=0),-1!==this.state||this.gesture?(this.target.add(this.panOffset),this.panOffset.set(0,0,0)):(this.panOffset.multiplyScalar(1-this.dampingFactor),this.target.add(this.panOffset)),this.offset.setFromSpherical(this.spherical),Tte.copy(this.target).add(this.offset),this.object.position.copy(this.target).add(this.offset),this.object.parent&&(Dte.copy(this.object.parent.matrixWorld).invert(),this.object.position.applyMatrix4(Dte));let e=this.spherical.phi%Cte;if(this.eye.copy(this.offset).normalize(),this.object.up.copy(jM.DEFAULT_UP).applyAxisAngle(this.eye,this.object.angleOffsetFromUp),e>0&&e>Math.PI||e<0&&e>-Math.PI?(this.object.up.negate(),this.object.lookAt(this.target),this.object.isUpVectorFlipped=!0):(this.object.lookAt(this.target),this.object.isUpVectorFlipped=!1),-1===this.state||!0===this.enableDamping){let e=1===this.hoverRotatePanMode?this.hoverRotateDamping:this.dampingFactor;this.sphericalDelta.theta*=1-e,this.sphericalDelta.phi*=1-e}else this.sphericalDelta.set(0,0,0);return this.scale=1,this.zoomChanged||this.lastPosition.distanceToSquared(this.object.position)>.01||8*(1-this.lastQuaternion.dot(this.object.quaternion))>1e-8?(this.dispatchEvent(vte),this.object.dispatchEvent(kte),this.lastPosition.copy(this.object.position),this.lastQuaternion.copy(this.object.quaternion),this.zoomChanged=!1,!0):(this.isPanOverShoot=!1,this.isRotateOverShoot=!1,this.object.wasMovedBySwitchCameraAction=!1,this.sphericalDelta.set(0,0,0),this.panOffset.set(0,0,0),!1)},this.onPointerDown=e=>{!1!==this.enabled&&("touch"===e.pointerType||"pen"===e.pointerType&&Tj?this.onPointerDownTouch(e):this.onPointerDownMouse(e),-1!==this.state&&(this.isPointerDown=!0,this.dispatchEvent(xte),this.domElement.addEventListener("pointermove",this.onPointerMove),this.domElement.addEventListener("pointerup",this.onPointerUp),e.stopPropagation(),"touch"===e.pointerType||"pen"===e.pointerType&&Tj||this.domElement.setPointerCapture(e.pointerId)))},this.onPointerLeave=e=>{this.resetHoverEffectOnPointerLeave&&!this.useWindowEvents?(1===this.hoverRotatePanMode?(this.sphericalDelta.theta=-this.spherical.theta,this.sphericalDelta.phi=-this.spherical.phi,Ate.subVectors(this.position0,this.target0),this.spherical.setFromVector3(Ate),this.sphericalDelta.theta+=this.spherical.theta,this.sphericalDelta.phi+=this.spherical.phi,this.sphericalDelta.theta/=8,this.sphericalDelta.phi/=8):2===this.hoverRotatePanMode&&this.panOffset.subVectors(this.target0,this.target).divideScalar(8),this.update()):this.pointerLeaveEvent=e},this.onPointerEnter=e=>{this.resetHoverEffectOnPointerLeave||void 0===this.pointerLeaveEvent?Mte.set(e.clientX-this.domElement.clientWidth/2,e.clientY-this.domElement.clientHeight/2):Mte.set(e.clientX-this.pointerLeaveEvent.clientX,e.clientY-this.pointerLeaveEvent.clientY),1===this.hoverRotatePanMode?(this.rotateDelta.copy(Mte).multiplyScalar(this.rotateSpeed*this.hoverRotatePanStrength).rotateAround(Ete,-this.object.angleOffsetFromUp),this.rotateLeft(2*Math.PI*this.rotateDelta.x/this.domElement.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/this.domElement.clientHeight),this.rotateStart.set(e.clientX,e.clientY)):2===this.hoverRotatePanMode&&(this.panDelta.copy(Mte).multiplyScalar(this.panSpeed*this.hoverRotatePanStrength),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.set(e.clientX,e.clientY)),this.update()},this.onPointerMove=e=>{!1!==this.enabled&&(this.checkRaycastLock()||("touch"===e.pointerType||"pen"===e.pointerType&&Tj?this.onPointerMoveTouch(e):this.onPointerMoveMouse(e),e.stopPropagation()))},this.onPointerUp=e=>{this.isPointerDown=!1,0===Rj.length&&(this.domElement.removeEventListener("pointermove",this.onPointerMove),this.domElement.removeEventListener("pointerup",this.onPointerUp)),Rj.length>1&&e.preventDefault(),this.hasChange?this.dispatchEvent(wte):this.dispatchEvent(_te),this.state=-1,e&&(e.stopPropagation(),"touch"===e.pointerType||"pen"===e.pointerType&&Tj||this.domElement.releasePointerCapture(e.pointerId))},this.onPointerDownMouse=e=>{let t;switch(t=this.useKeyEvents?this.mouseButtons[e.button]:this.mouseButtonsPlay[e.button],t){case 0:if(!0!==e.altKey||e.shiftKey||Ij(e)){if(" "===this.key){if(!1===this.enablePan)return;this.handleMouseDownPan(e),this.state=2}}else{if(!1===this.enableRotate)return;this.handleMouseDownRotate(e),this.state=0}break;case 4:if(!1===this.enablePan)return;this.handleMouseDownPan(e),this.state=2;break;case 3:if(Ij(e)||e.shiftKey){if(!1===this.enablePan)return;this.handleMouseDownPan(e),this.state=2}else{if(!1===this.enableRotate)return;this.handleMouseDownRotate(e),this.state=0}break;case 5:if(Ij(e)||e.shiftKey){if(!1===this.enableRotate)return;this.handleMouseDownRotate(e),this.state=0}else{if(!1===this.enablePan)return;this.handleMouseDownPan(e),this.state=2}break;default:this.state=-1}},this.onPointerMoveMouse=e=>{switch(this.state){case 0:if(!1===this.enableRotate)return;this.handleMouseMoveRotate(e);break;case 1:if(!1===this.enableZoom)return;this.handleMouseMoveDolly(e);break;case 2:if(!1===this.enablePan)return;this.handleMouseMovePan(e)}this.object.wasMovedByUser=!0},this.onPointerDownTouch=e=>{switch(Rj.length>1&&e.preventDefault(),this.touches[Rj.length-1]){case bS:if(!1===this.enableRotate)return void(this.state=-1);this.handleTouchStartRotate(),this.state=3;break;case xS:if(!1===this.enablePan)return void(this.state=-1);this.handleTouchStartPan(),this.state=4;break;case wS:if(!1===this.enableZoom&&!1===this.enablePan)return;this.handleTouchStartDollyPan(),this.state=5;break;case _S:if(!1===this.enableZoom&&!1===this.enableRotate)return;this.handleTouchStartDollyRotate(),this.state=6;break;default:this.state=-1}},this.onPointerMoveTouch=e=>{switch(Rj.length>1&&e.preventDefault(),this.state){case 3:if(!1===this.enableRotate)return;this.handleTouchMoveRotate(e),this.update();break;case 4:if(!1===this.enablePan)return;this.handleTouchMovePan(e),this.update();break;case 5:if(!1===this.enableZoom&&!1===this.enablePan)return;this.handleTouchMoveDollyPan(e),this.update();break;case 6:if(!1===this.enableZoom&&!1===this.enableRotate)return;this.handleTouchMoveDollyRotate(e),this.update();break;default:this.state=-1}this.object.wasMovedByUser=!0},this.dispatchEndDebounced=cj((()=>this.dispatchEvent(wte)),33),this.onMouseWheel=e=>{!1===this.enabled||!1===this.enableZoom&&!1===this.enablePan||this.checkRaycastLock()||(!this.options.isExport&&this.domElement.clientHeight===document.body.clientHeight&&this.domElement.clientWidth===document.body.clientWidth&&e.preventDefault(),this.dispatchEvent(xte),this.handleMouseWheel(e),this.dispatchEndDebounced(),this.object.wasMovedByUser=!0)},this.onGesture=e=>{if(e.preventDefault(),!1!==this.enabled&&!this.checkRaycastLock()&&!Aj)if("gesturechange"===e.type){if(!1===this.enableZoom||!1===this.isTouchZoom)return;this.dispatchEvent(xte),e.scale>this.prevScale?this.dollyIn(this.getZoomScale()):e.scale<this.prevScale&&this.dollyOut(this.getZoomScale()),this.prevScale=e.scale,this.update(),this.object.wasMovedByUser=!0}else this.dispatchEvent(wte)},this.onContextMenu=e=>{e.preventDefault()},this.onTouchEnd=e=>{e.preventDefault()},this.onKeyDown=e=>{!1!==this.enabled&&(this.key=e.key," "===e.key&&this.dispatchEvent(xte))},this.onKeyUp=e=>{!1!==this.enabled&&(this.key=void 0,-1!==this.state&&"Alt"===e.key&&this.onPointerUp(Rj[0])," "===e.key&&this.dispatchEvent(wte))},this.onPointerHover=e=>{"mouse"!==e.pointerType||!1===this.enabled||-1!==this.state||2===this.hoverRotatePanMode&&this.isPanOverShoot||1===this.hoverRotatePanMode&&this.isRotateOverShoot||(this.isPointerDown=!0,2===this.hoverRotatePanMode?this.handleMouseMovePan(e,this.hoverRotatePanStrength):1===this.hoverRotatePanMode&&this.handleMouseMoveRotate(e,this.hoverRotatePanStrength))},this.onBeginState=()=>{this.enabled=!1,this.needsUpdate=!1},this.onCompleteState=e=>{e.isfromEntity&&this.options.isPlayMode||(this.enabled=!0,this.needsUpdate=!0,this.object.updateUp(),this.object.getTarget(this.target))},this.target=this.object.getTarget(),this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.quat0=this.object.quaternion.clone(),this.isUpVectorFlipped0=this.object.isUpVectorFlipped,this.offset.copy(this.object.position).sub(this.target),this.spherical.setFromVector3(this.offset),this.object.isUpVectorFlipped&&(this.spherical.phi*=-1,this.spherical.theta-=Math.PI),this.addEventListenersToCamera()}dispatchEvent(e){"start"===e.type?this.hasChange=!1:this.hasChange=!0,super.dispatchEvent(e)}addEventListenersToCamera(){this.object.addEventListener("beginState",this.onBeginState),this.object.addEventListener("completeState",this.onCompleteState),this.object.addEventListener("cameraChange",this.onCameraChange)}removeEventListenersFromCamera(){this.object.removeEventListener("beginState",this.onBeginState),this.object.removeEventListener("completeState",this.onCompleteState),this.object.removeEventListener("cameraChange",this.onCameraChange)}updateUseWindowEvents(e){if(window.removeEventListener("pointermove",this.onPointerHover),this.domElement.removeEventListener("pointermove",this.onPointerHover),this.useWindowEvents=e,0!==this.hoverRotatePanMode&&(this.useWindowEvents?window.addEventListener("pointermove",this.onPointerHover):this.domElement.addEventListener("pointermove",this.onPointerHover)),this.domElement.removeEventListener("pointerleave",this.onPointerLeave),this.domElement.removeEventListener("pointerenter",this.onPointerEnter),window.removeEventListener("pointerleave",this.onPointerLeave),window.removeEventListener("pointerenter",this.onPointerEnter),0!==this.hoverRotatePanMode&&!this.useWindowEvents){let e=this.useWindowEvents?window:this.domElement;e.addEventListener("pointerleave",this.onPointerLeave),e.addEventListener("pointerenter",this.onPointerEnter)}}fromJSON(e,t){var i,n;this.setEnableDampingSpeed(e.enableDamping),this.enablePan=e.enablePan,this.enableZoom=e.enableZoom,this.enableRotate=e.enableRotate,this.rotationLimitsMode=e.rotationLimitsMode,this.thetaIsFree=e.rotationHorizontalOffset.min===e.rotationHorizontalOffset.max&&e.rotationHorizontalOffset.min===Math.PI,this.phiIsFree=e.rotationVerticalOffset.min===e.rotationVerticalOffset.max&&e.rotationVerticalOffset.min===Math.PI,this.panLimitsMode=e.panLimitsMode,this.panSoftLimit=e.panSoftLimit,this.rotationSoftLimit=e.rotationSoftLimit,this.hoverRotatePanMode=e.hoverRotatePanMode,this.hoverRotateDamping=null!==(i=e.hoverRotateDamping)&&void 0!==i?i:this.dampingFactor,this.useWindowEvents="window"===t,0!==this.hoverRotatePanMode&&(this.useWindowEvents?window.addEventListener("pointermove",this.onPointerHover):this.domElement.addEventListener("pointermove",this.onPointerHover));let r=e.hoverRotatePanStrength/100;this.hoverRotatePanStrength=r**2,this.zoomLimitsEnabled=e.zoomLimitsEnabled,this.minZoom=e.zoomLimits.min,this.maxZoom=Math.max(e.zoomLimits.min,e.zoomLimits.max),this.minDistance=1e3/e.zoomLimits.max,this.maxDistance=Math.max(this.minDistance,1e3/e.zoomLimits.min),this.autoRotate=e.autoRotate,this.autoRotateSpeed=e.autoRotateSpeed,this.autoRotateClockwise=e.autoRotateClockwise;let a=this.object.getTarget().applyQuaternion(Ste.copy(this.object.quaternion).invert());this.minV=-e.panVerticalOffset.min+a.y,this.maxV=e.panVerticalOffset.max+a.y,this.minH=-e.panHorizontalOffset.min+a.x,this.maxH=e.panHorizontalOffset.max+a.x,this.panRangeFactor.set(this.maxH-this.minH,this.maxV-this.minV).divideScalar(2),this.rotationRangeFactor.setScalar(Math.PI).divideScalar(4),this.minPhi=Ite(this.spherical.phi-e.rotationVerticalOffset.min),this.maxPhi=Ite(this.spherical.phi+e.rotationVerticalOffset.max),this.minTheta=Ite(Ite(this.spherical.theta)-e.rotationHorizontalOffset.min),this.maxTheta=Ite(Ite(this.spherical.theta)+e.rotationHorizontalOffset.max),this.isThetaFlipped=this.minTheta>this.maxTheta,1===e.orbitTouches&&(this.touches[0]=bS),1===e.panTouches&&(this.touches[0]=xS),2===e.orbitTouches&&(this.touches[1]=_S),2===e.panTouches&&(this.touches[1]=wS),3===e.orbitTouches&&(this.touches[2]=bS),3===e.panTouches&&(this.touches[2]=xS),this.isTouchZoom=e.isTouchZoom,this.resetHoverEffectOnPointerLeave=null!==(n=e.resetHoverEffectOnPointerLeave)&&void 0!==n&&n}connect(){if(this.domElement.addEventListener("contextmenu",this.onContextMenu),this.domElement.addEventListener("pointerdown",this.onPointerDown),this.domElement.addEventListener("wheel",this.onMouseWheel),window.addEventListener("keydown",this.onKeyDown,!1),window.addEventListener("keyup",this.onKeyUp,!1),this.domElement.addEventListener("gesturestart",this.onGesture),this.domElement.addEventListener("gesturechange",this.onGesture),this.domElement.addEventListener("gestureend",this.onGesture),this.domElement.addEventListener("touchend",this.onTouchEnd),0!==this.hoverRotatePanMode&&!this.useWindowEvents){let e=this.useWindowEvents?window:this.domElement;e.addEventListener("pointerleave",this.onPointerLeave),e.addEventListener("pointerenter",this.onPointerEnter)}this.pointerLeaveEvent=void 0}dispose(){this.removeEventListenersFromCamera(),this.domElement.removeEventListener("contextmenu",this.onContextMenu),this.domElement.removeEventListener("pointerdown",this.onPointerDown),this.domElement.removeEventListener("wheel",this.onMouseWheel),window.removeEventListener("keydown",this.onKeyDown,!1),window.removeEventListener("keyup",this.onKeyUp,!1),this.domElement.removeEventListener("pointermove",this.onPointerHover),window.removeEventListener("pointermove",this.onPointerHover),this.domElement.removeEventListener("gesturestart",this.onGesture),this.domElement.removeEventListener("gesturechange",this.onGesture),this.domElement.removeEventListener("gestureend",this.onGesture),this.domElement.removeEventListener("touchend",this.onTouchEnd),this.domElement.removeEventListener("pointerleave",this.onPointerLeave),this.domElement.removeEventListener("pointerenter",this.onPointerEnter),window.removeEventListener("pointerleave",this.onPointerLeave),window.removeEventListener("pointerenter",this.onPointerEnter),this.domElement.removeEventListener("pointermove",this.onPointerMove),this.domElement.removeEventListener("pointerup",this.onPointerUp)}applyLimits(e,t,i,n,r,a,s,o){let l,c,h;this.overShoot.set(0,0),e instanceof FA?(l=e.x,c=e.y,this.current.set(this.target.x,this.target.y),h=!0):(l=e.theta,c=e.phi,this.current.set(Ite(this.spherical.theta),Ite(this.spherical.phi)),h=!1),0===i&&(this.current.x+=l,this.current.y+=c),(3===t||2===t)&&(!h&&this.isThetaFlipped?this.current.x>n&&this.current.x<0?this.overShoot.x=n-this.current.x:this.current.x<r&&this.current.x>0&&(this.overShoot.x=r-this.current.x):this.current.x>n?this.overShoot.x=n-this.current.x:this.current.x<r&&(this.overShoot.x=r-this.current.x)),(3===t||1===t)&&(this.current.y>a?this.overShoot.y=a-this.current.y:this.current.y<s&&(this.overShoot.y=s-this.current.y)),h||(this.overShoot.x=Ite(this.overShoot.x),this.overShoot.y=Ite(this.overShoot.y)),0!==i?(this.overRatio.copy(this.overShoot).divide(o),this.overRatio.x=Math.min(Math.abs(this.overRatio.x),1),this.overRatio.y=Math.min(Math.abs(this.overRatio.y),1),1===i&&(this.overRatio.x=Rte(Math.abs(this.overRatio.x)),this.overRatio.y=Rte(Math.abs(this.overRatio.y))),this.isPointerDown||1===i?2===i&&(this.overRatio.x>.9&&!this.thetaIsFree||this.overRatio.y>.9&&!this.phiIsFree)?this.isPointerDown=!1:(l*this.overShoot.x<0&&!this.thetaIsFree&&(l*=1-this.overRatio.x),c*this.overShoot.y<0&&!this.phiIsFree&&(c*=1-this.overRatio.y)):2===i&&(!h&&(this.overRatio.x>.002&&!this.thetaIsFree||this.overRatio.y>.002&&!this.phiIsFree)||h&&(Math.abs(this.overShoot.x)>2||Math.abs(this.overShoot.y)>2)?(this.thetaIsFree||(l=.05*this.overShoot.x),this.phiIsFree||(c=.05*this.overShoot.y),h?this.isPanOverShoot=!0:this.isRotateOverShoot=!0):h?this.isPanOverShoot=!1:this.isRotateOverShoot=!1)):(l+=this.overShoot.x,c+=this.overShoot.y),e instanceof FA?(e.x=l,e.y=c):(this.thetaIsFree||(e.theta=l),this.phiIsFree||(e.phi=c))}setEnableDampingSpeed(e){this.enableDamping=e,this.rotateSpeed=!0===e?.2:1}stopDamping(){this.sphericalDelta.theta=0,this.sphericalDelta.phi=0}getAutoRotationAngle(){return 2*Math.PI/60/60*this.autoRotateSpeed}getZoomScale(){return Math.pow(.95,this.zoomSpeed)}rotateLeft(e){this.sphericalDelta.theta-=e}rotateUp(e){this.sphericalDelta.phi-=e}panLeft(e,t){this.panLeftV.setFromMatrixColumn(t,0),this.panLeftV.multiplyScalar(-e),this.panOffset.add(this.panLeftV)}panUp(e,t){this.panUpV.setFromMatrixColumn(t,1),this.panUpV.multiplyScalar(e),this.panOffset.add(this.panUpV)}pan(e,t){let i=this.domElement;if(i&&this.object.isPerspectiveCamera){let n=this.object.position;this.panV.copy(n).sub(this.target);let r=this.panV.length();r*=Math.tan(this.object.fov/2*Math.PI/180),this.panLeft(2*e*r/i.clientHeight,this.object.matrixWorld),this.panUp(2*t*r/i.clientHeight,this.object.matrixWorld)}else i&&this.object.isOrthographicCamera&&(this.panLeft(e*(this.object.right-this.object.left)/this.object.zoom/i.clientWidth,this.object.matrixWorld),this.panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/i.clientHeight,this.object.matrixWorld));this.dispatchEvent(bte)}dollyOut(e){this.object.isPerspectiveCamera?this.scale/=e:this.object.isOrthographicCamera&&(this.object.zoom*=e,this.zoomLimitsEnabled&&(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom))),this.object.updateProjectionMatrix(),this.zoomChanged=!0),this.dispatchEvent(yte)}dollyIn(e){this.object.isPerspectiveCamera?this.scale*=e:this.object.isOrthographicCamera&&(this.object.zoom/=e,this.zoomLimitsEnabled&&(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom))),this.object.updateProjectionMatrix(),this.zoomChanged=!0),this.dispatchEvent(yte)}zoomOut(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getZoomScale();this.dispatchEvent(xte),this.dollyOut(e),this.dispatchEvent(wte)}zoomIn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getZoomScale();this.dispatchEvent(xte),this.dollyIn(e),this.dispatchEvent(wte)}handleMouseDownRotate(e){this.rotateStart.set(e.clientX,e.clientY)}handleMouseDownDolly(e){this.dollyStart.set(e.clientX,e.clientY)}handleMouseDownPan(e){this.panStart.set(e.clientX,e.clientY)}handleMouseMoveRotate(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;void 0!==e.movementX?this.rotateDelta.set(e.movementX,e.movementY):(this.rotateEnd.set(e.clientX,e.clientY),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart),this.rotateStart.copy(this.rotateEnd)),this.rotateDelta.multiplyScalar(this.rotateSpeed*t).rotateAround(Ete,-this.object.angleOffsetFromUp);let i=this.domElement,n=this.useWindowEvents?window.innerHeight:i.clientHeight,r=2*Math.PI*this.rotateDelta.x/n,a=2*Math.PI*this.rotateDelta.y/n;this.rotateLeft(r),this.rotateUp(a),this.update()}handleMouseMoveDolly(e){this.dollyEnd.set(e.clientX,e.clientY),this.dollyDelta.subVectors(this.dollyEnd,this.dollyStart),this.dollyDelta.y>0?this.dollyOut(this.getZoomScale()):this.dollyDelta.y<0&&this.dollyIn(this.getZoomScale()),this.dollyStart.copy(this.dollyEnd),this.update()}handleMouseMovePan(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;void 0!==e.movementX?this.panDelta.set(e.movementX,e.movementY):(this.panEnd.set(e.clientX,e.clientY),this.panDelta.subVectors(this.panEnd,this.panStart),this.panStart.copy(this.panEnd)),this.panDelta.multiplyScalar(this.panSpeed*t),this.pan(this.panDelta.x,this.panDelta.y),this.update()}handleMouseWheel(e){if(!1===Mj&&!1===Ij(e)&&!0===function(e){return 0===e.wheelDeltaY||0===e.deltaY?!(Cj&&e.shiftKey&&Math.abs(e.wheelDeltaX)>=120)&&(e.wheelDeltaX?e.wheelDeltaX===-3*e.deltaX||e.wheelDeltaX===-3*window.devicePixelRatio*e.deltaX:0===e.deltaMode):e.wheelDeltaY?e.wheelDeltaY===-3*e.deltaY||e.wheelDeltaY===-3*window.devicePixelRatio*e.deltaY:0===e.deltaMode}(e)){if(!1===this.enablePan)return;this.gesture?(this.panDelta.set(-e.deltaX,-e.deltaY).multiplyScalar(this.panSpeed),this.panDelta.x=Math.min(Math.abs(this.panDelta.x),100)*(this.panDelta.x<0?-1:1),this.panDelta.y=Math.min(Math.abs(this.panDelta.y),100)*(this.panDelta.y<0?-1:1),e.altKey?this.pan(0,this.panDelta.y):e.shiftKey?this.pan(this.panDelta.x,0):this.pan(this.panDelta.x,this.panDelta.y),this.update()):(this.gesture=!0,this.isPointerDown=!0),window.clearTimeout(this.timer),this.timer=window.setTimeout((()=>{this.gesture=!1,this.isPointerDown=!1}),30)}else{if(!1===this.enableZoom)return;0===e.deltaY?e.deltaX<0?this.dollyIn(this.getZoomScale()):e.deltaX>0&&this.dollyOut(this.getZoomScale()):e.deltaY<0?this.dollyIn(this.getZoomScale()):e.deltaY>0&&this.dollyOut(this.getZoomScale()),this.update(),this.gesture=!1,this.isPointerDown=!1}}handleTouchStartRotate(){if(2===Rj.length){let e=.5*(Rj[0].pageX+Rj[1].pageX),t=.5*(Rj[0].pageY+Rj[1].pageY);this.rotateStart.set(e,t)}else this.rotateStart.set(Rj[0].pageX,Rj[0].pageY)}handleTouchStartPan(){if(2===Rj.length){let e=.5*(Rj[0].pageX+Rj[1].pageX),t=.5*(Rj[0].pageY+Rj[1].pageY);this.panStart.set(e,t)}else this.panStart.set(Rj[0].pageX,Rj[0].pageY)}handleTouchStartDolly(){let e=Rj[0].pageX-Rj[1].pageX,t=Rj[0].pageY-Rj[1].pageY,i=Math.sqrt(e*e+t*t);this.dollyStart.set(0,i)}handleTouchStartDollyPan(){this.enableZoom&&!0===this.isTouchZoom&&this.handleTouchStartDolly(),this.enablePan&&this.handleTouchStartPan()}handleTouchStartDollyRotate(){this.enableZoom&&!0===this.isTouchZoom&&this.handleTouchStartDolly(),this.enableRotate&&this.handleTouchStartRotate()}handleTouchMoveRotate(e){if(2===Rj.length){let t=Vj(e),i=.5*(e.pageX+t.x),n=.5*(e.pageY+t.y);this.rotateEnd.set(i,n)}else{if(e.pointerId!==Rj[0].pointerId)return;this.rotateEnd.set(e.pageX,e.pageY)}this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;t&&(this.rotateLeft(2*Math.PI*this.rotateDelta.x/t.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/t.clientHeight)),this.rotateStart.copy(this.rotateEnd)}handleTouchMovePan(e){if(2===Rj.length){let t=Vj(e),i=.5*(e.pageX+t.x),n=.5*(e.pageY+t.y);this.panEnd.set(i,n)}else{if(e.pointerId!==Rj[0].pointerId)return;this.panEnd.set(e.pageX,e.pageY)}this.panDelta.subVectors(this.panEnd,this.panStart).multiplyScalar(this.panSpeed),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.copy(this.panEnd)}handleTouchMoveDolly(e){let t=Vj(e),i=e.pageX-t.x,n=e.pageY-t.y,r=Math.sqrt(i*i+n*n);this.dollyEnd.set(0,r),this.dollyDelta.set(0,Math.pow(this.dollyEnd.y/this.dollyStart.y,this.zoomSpeed)),this.dollyOut(this.dollyDelta.y),this.dollyStart.copy(this.dollyEnd)}handleTouchMoveDollyPan(e){this.enableZoom&&!0===this.isTouchZoom&&this.handleTouchMoveDolly(e),this.enablePan&&this.handleTouchMovePan(e)}handleTouchMoveDollyRotate(e){this.enableZoom&&!0===this.isTouchZoom&&this.handleTouchMoveDolly(e),this.enableRotate&&this.handleTouchMoveRotate(e)}checkRaycastLock(){if(this.object.data.raycastLock){if(this.options.isPlayMode)return!1;{var e;let t=null===(e=this.options)||void 0===e?void 0:e.showCameraLock;return t&&t(),!0}}return!1}};function Ite(e){let t=2*Math.PI;for(;e<=-Math.PI;)e+=t;for(;e>Math.PI;)e-=t;return e}function Rte(e){return 1-Math.pow(1-e,4)}var Lte,Bte=class{constructor(e,t,i,n,r,a){this.id=e,this.data=t,this.object=i,this.page=n,this.currentIntersectedObjects=[],this.disabled=!1,this.alreadyPlayedNonTogglingActions=new Set,this.actions=q9(t,t.actions,n,r,a,i),this.target=t.target,this.useToggle="Toggle"===t.runMode,this.triggeringObjects=t.triggeringObjects.map((e=>n.scene.find(e)))}isValidTriggeringObject(e){return"all"===this.target||this.triggeringObjects.some((t=>t===e||t.isAncestorOf(e.uuid)||e.isAncestorOf(t.uuid)))}disconnect(){X9(this.actions)}dispatch(){this.disabled||this.object.destroyedInAction||(this.actions.Transition.forEach((e=>{e.object.currentTransitionEvent!==this?(e.object.currentTransitionEvent=this,e.init()):"Once"===this.data.runMode&&this.alreadyPlayedNonTogglingActions.add(e)})),this.object.dispatchEvent({type:"beginEvent",eventName:"Trigger"}),this.useToggle?(this.actions.Transition.forEach((e=>{e.toggle()})),this.actions.SwitchCamera.forEach((e=>{e.toggle()}))):(this.actions.Transition.forEach((e=>{!1===this.alreadyPlayedNonTogglingActions.has(e)&&e.play()})),this.actions.SwitchCamera.forEach((e=>{e.play()}))),this.actions.Link.forEach((e=>{e.dispatch()})),this.actions.Reset.forEach((e=>{e.dispatch()})),this.actions.Create.forEach((e=>{e.dispatch()})),this.actions.Destroy.forEach((e=>{e.dispatch(!1)})),this.actions.Audio.forEach((e=>{e.dispatchBasic()})),this.actions.Particles.forEach((e=>{e.dispatchBasic()})),this.actions.Video.forEach((e=>{e.dispatchBasic()})),this.actions.SceneTransition.forEach((e=>{e.dispatch()})),this.actions.SetVariable.forEach((e=>e.checkConditions())),this.actions.SetVariable.forEach((e=>e.dispatch())),this.actions.DynamicVariablePlay.forEach((e=>e.dispatch())))}};Zj.then((e=>Lte=e));var zte=new FA,Nte=new NA,Fte=new FA,jte=new CM(0,0,0,"YXZ"),Vte=new CM(0,0,0,"XYZ"),Ute=new FA,Gte=new FA,Hte=new FA(1,1,1),Wte=new NA,qte=new mM,Xte=new mM,Yte={type:"updateMatrix"},Qte=new NA,Zte=new sM,Kte={type:"beginEvent",eventName:"Collision"},Jte={type:"beginEvent",eventName:"Trigger"};var $te=e=>e.states.some((e=>void 0!==e.data.position||void 0!==e.data.rotation||void 0!==e.data.hiddenMatrix||void 0!==e.data.cloner||void 0!==e.data.pathSnapping)),eie=class{constructor(e){this.eventContext=e,this.isEnabled=!1,this.gameControl=null,this.joysticks=[],this.joystickToGameControls=[],this.sharedGameControlGlobals={entitiesWithTransformAnim:[],entityToCollisionEvents:{},colliderToEntity:new Map,triggers:[],gamePads:[],createdObjects:[],nCreatedPerAction:{}},this.sensorToTriggerEvent={},this.eventManager=void 0,this.needsCollisionDetection=!1,this.initializationCounter=-1,this.rigidBodyToMesh=new Map,this.nActiveRigidBodies=0,this.collisionEvents=[],this.isExport=!1,this.processRigidBody=e=>{if(e.bodyType()!==Lte.RigidBodyType.Dynamic)return;e.isSleeping()||this.nActiveRigidBodies++;let[t,i,n]=this.rigidBodyToMesh.get(e.handle);if(zte.copy(e.translation()).multiplyScalar(this.pixelsPerMeter),Nte.copy(e.rotation()),t.matrixWorld.compose(zte,Nte,i),t.hasNonUniformScale&&t.matrixWorld.multiply(t.shearScale),t.dispatchEvent(Yte),n){let e=t.cloner;if(e&&void 0===e.objectForSample){e.matrixWorld.copy(t.matrixWorld);for(let t of e.children)t.updateMatrixWorld(!0)}for(let i of t.children)i.updateMatrixWorld(!0)}},this.accumulator=0,this.handleCollisionEvents=(e,t,i)=>{var n,r;if(!1===i)return;let a,s;if(this.sensorToTriggerEvent[e]?(a=this.sensorToTriggerEvent[e],s=this.sharedGameControlGlobals.colliderToEntity.get(t)):this.sensorToTriggerEvent[t]&&(a=this.sensorToTriggerEvent[t],s=this.sharedGameControlGlobals.colliderToEntity.get(e)),a&&s&&a.isValidTriggeringObject(s))a.dispatch();else{for(let i=this.sharedGameControlGlobals.createdObjects.length-1;i>=0;i--){var o,l;let n=this.sharedGameControlGlobals.createdObjects[i];if(n.userData.hasCollisionDestroy&&((null===(o=n.rigidBody)||void 0===o?void 0:o.collider(0).handle)===e||(null===(l=n.rigidBody)||void 0===l?void 0:l.collider(0).handle)===t)){this.sharedGameControlGlobals.createdObjects.splice(i,1),n.removeFromParent(),requestAnimationFrame((()=>{var e;return null===(e=this.sharedGameControlGlobals.rapierWorld)||void 0===e?void 0:e.removeRigidBody(n.rigidBody)}));break}}if((null===(n=this.gameControl)||void 0===n?void 0:n.object)===this.sharedGameControlGlobals.colliderToEntity.get(e)){let e=this.sharedGameControlGlobals.colliderToEntity.get(t),i=this.sharedGameControlGlobals.entityToCollisionEvents[e.uuid];if(void 0===i)return;for(let n of i)"character"===n.data.target&&this.dispatchCollisionEvent(n,e,t)}else if((null===(r=this.gameControl)||void 0===r?void 0:r.object)===this.sharedGameControlGlobals.colliderToEntity.get(t)){let t=this.sharedGameControlGlobals.colliderToEntity.get(e),i=this.sharedGameControlGlobals.entityToCollisionEvents[t.uuid];if(void 0===i)return;for(let n of i)"character"===n.data.target&&this.dispatchCollisionEvent(n,t,e)}else{let i=this.sharedGameControlGlobals.colliderToEntity.get(e),n=this.sharedGameControlGlobals.entityToCollisionEvents[i.uuid];if(void 0!==n)for(let t of n)"scene"===t.data.target&&this.dispatchCollisionEvent(t,i,e);let r=this.sharedGameControlGlobals.colliderToEntity.get(t),a=this.sharedGameControlGlobals.entityToCollisionEvents[null===r||void 0===r?void 0:r.uuid];if(void 0!==a)for(let e of a)"scene"===e.data.target&&this.dispatchCollisionEvent(e,r,t)}}},this.isExport=e.isExport,this.sharedAssets=e.sharedAssets,this.renderer=e.renderer,this.requestRender=e.requestRender,this.domElement=this.renderer.domElement,this.pixelsPerMeter=200,this.gravity=this.page.data.globalPhysics.gravity}get page(){return this.eventContext.page}attachVRControllers(e){e.forEach((e=>{e.addEventListener("connected",(e=>{"gamepad"in e.data&&"axes"in e.data.gamepad&&this.sharedGameControlGlobals.gamePads.push(e.data.gamepad)}))}))}markIsDestroyTarget(){this.page.traverseVisibleEntity((e=>{let t=e.dataPatched;for(let n of t.events){var i;if(!0===n.data.disabled)continue;let e=null===(i=n.data.actions)||void 0===i||null===(i=i.find((e=>"Destroy"===e.data.type)))||void 0===i?void 0:i.data;if(e)for(let t of e.objects){let e=this.page.scene.find(t);e&&(e.userData.hasDestroy=!0)}}}))}markIsDragObject(){this.page.traverseVisibleEntity((e=>{let t=e.dataPatched;for(let i of t.events)if(!0!==i.data.disabled&&"DragDrop"===i.data.type)for(let e of i.data.objects){let t=this.page.scene.find(e);t&&(t.userData.hasDrag=!0)}}))}initBVH(){let e=[];if(this.page.traverseChildren((t=>{var i,n;let r;if(t instanceof x1||t instanceof K1||t instanceof g5)return;r=t instanceof BX?t.object:t;let a=r.dataPatched;if("visibility"===(null===(i=a.physics)||void 0===i?void 0:i.enabled)?!a.visible:null===(n=a.physics)||void 0===n||!n.enabled)return!0;let s=t.geometry,o=!0===r.userData.hasDestroy,l=!0===r.userData.hasDrag;if($te(a)||o||l||r.dataPatched.events.some((e=>!0!==e.data.disabled&&"GameControl"===e.data.type)))return t.updateMatrixWorldSVD(),this.addBoundsTree(t),!0;s&&e.push(D7(s,t.matrixWorld))})),e.length>0){let t=$W(e,!1);this.sharedGameControlGlobals.staticMeshBVH=new gX(t)}}addRigidBody(e,t,i){let n=[],r="geometry"in e?e.geometry:void 0,a=t.dataPatched;if(void 0!==(null===r||void 0===r?void 0:r.getAttribute("position"))&&n.push(D7(r,e.shearScale)),a.physics.fusedBody){let t=this.gatherChildrenGeom(e,n);e.traverseObject(t),e.children.forEach((e=>e.updateMatrixWorld(!0)));let i=e.cloner;i&&void 0===i.objectForSample&&"dynamic"===a.physics.rigidBody&&(i.traverseObject(t),i.children.forEach((e=>e.updateMatrixWorld(!0))))}if(n.length>0){let s,o=!i.fromCreate&&"dynamic"===a.physics.rigidBody||i.fromCreate&&i.dynamic;o?(s=Lte.RigidBodyDesc.dynamic(),s.setLinearDamping(a.physics.damping).setAngularDamping(a.physics.damping).setAdditionalMass(1e-9).setGravityScale(a.physics.gravityScale).enabledRotations(...a.physics.enabledRotation).enabledTranslations(...a.physics.enabledTranslation)):(i.hasTransformAnim||i.hasFollow||i.hasDrag)&&!i.fromCreate?(s=Lte.RigidBodyDesc.kinematicPositionBased(),this.sharedGameControlGlobals.entitiesWithTransformAnim.push(e)):s=Lte.RigidBodyDesc.fixed();let l=$W(n);(e.hasNonUniformScale?e.matrixWorldRigid:e.matrixWorld).decompose(zte,Nte,Fte),e.position0=zte.clone().divideScalar(this.pixelsPerMeter),e.rotation0=Nte.clone(),zte.divideScalar(this.pixelsPerMeter),s.setTranslation(zte.x,zte.y,zte.z).setRotation(Nte),r?null===l||void 0===l||l.scale(1/this.pixelsPerMeter,1/this.pixelsPerMeter,1/this.pixelsPerMeter):null===l||void 0===l||l.scale(Fte.x/this.pixelsPerMeter,Fte.y/this.pixelsPerMeter,Fte.z/this.pixelsPerMeter);let c=this.sharedGameControlGlobals.rapierWorld.createRigidBody(s);o&&this.rigidBodyToMesh.set(c.handle,[e,Fte.clone(),a.physics.fusedBody]);let h=!(void 0===a.geometry||"SubdivGeometry"===a.geometry.type||"NonParametricGeometry"===a.geometry.type||"BooleanGeometry"===a.geometry.type||"VectorGeometry"===a.geometry.type||"StarGeometry"===a.geometry.type||"RectangleGeometry"===a.geometry.type||"EllipseGeometry"===a.geometry.type||"TriangleGeometry"===a.geometry.type||"TorusGeometry"===a.geometry.type||"HelixGeometry"===a.geometry.type);try{this.addCollider(c,a.physics,l,t,h)}catch{try{this.addCollider(c,a.physics,l,t,!1)}catch(u){console.error(u)}}e.rigidBody=c}}addBoundsTree(e){var t,i;let n=[];if(void 0!==(null===(t=e.geometry)||void 0===t?void 0:t.getAttribute("position"))&&(null===(i=e.geometry)||void 0===i?void 0:i.getAttribute("position").count)>0&&n.push(D7(e.geometry,e.shearScale)),e.traverseObject(this.gatherChildrenGeom(e,n)),e.children.forEach((e=>e.updateMatrixWorld(!0))),n.length>0){let t=$W(n,!1);e.bvhGeometry=t,e.bvhGeometry.boundsTree=new gX(t),this.sharedGameControlGlobals.entitiesWithTransformAnim.push(e)}}addCollider(e,t,i,n){var r,a;let s,o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(0===(null===i||void 0===i?void 0:i.getAttribute("position").count)||0===(null===i||void 0===i||null===(r=i.getIndex())||void 0===r?void 0:r.count))return;i&&(s="trimesh"===t.colliderType?Lte.ColliderDesc.trimesh(i.getAttribute("position").array,i.getIndex().array):Lte.ColliderDesc.convexMesh(i.getAttribute("position").array,o?i.getIndex().array:void 0)),s.setFrictionCombineRule(Lte.CoefficientCombineRule.Average).setRestitutionCombineRule(Lte.CoefficientCombineRule.Average).setDensity(t.density).setFriction(t.friction).setRestitution(t.restitution);let l=this.sharedGameControlGlobals.rapierWorld.createCollider(s,e);this.sharedGameControlGlobals.colliderToEntity.set(l.handle,n),(null===(a=this.sharedGameControlGlobals.entityToCollisionEvents[n.uuid])||void 0===a?void 0:a.some((e=>"scene"===e.target)))&&l.setActiveEvents(Lte.ActiveEvents.COLLISION_EVENTS)}gatherChildrenGeom(e,t){return(i,n)=>{var r;if(0===n)return;let a;if(i instanceof x1){if(!i.objectForSample)return!0===i.object.dataPatched.physics.fusedBody&&"dynamic"===i.object.dataPatched.physics.rigidBody||void 0;if(i.objectForSample.dataPatched.physics.fusedBody)return;a=i.object}else if(i instanceof BX)a=i.object;else if(a=i,null!==(r=a.dataPatched.cloner)&&void 0!==r&&r.hideBase)return!0;let s=a.dataPatched;if("visibility"===s.physics.enabled?!s.visible:!s.physics.enabled)return!0;1===n?e.hasNonUniformScale?i.matrixWorld.multiplyMatrices(e.shearScale,i.hiddenMatrix):i.matrixWorld.copy(i.hiddenMatrix):i.matrixWorld.multiplyMatrices(i.parent.matrixWorld,i.hiddenMatrix),i.matrixWorld.multiply(i.matrix);let o=i.geometry;void 0!==(null===o||void 0===o?void 0:o.getAttribute("position"))&&t.push(D7(o,i.matrixWorld))}}activate(e){if(this.isEnabled)return;this.isEnabled=!0,this.eventManager=e,this.usePhysics=this.page.data.globalPhysics.usePhysics;let t=this.page.playCamera,i=!1,n=5,r=8,a=9,s="drag",o=this.page.data.publish.gameControlObject,l=null!==o?this.page.find(o):null,c=null;if(l)for(let f of l.data.events){if(f.data.disabled||"GameControl"!==f.data.type)break;let e=l;for(;this.usePhysics&&null!==(null===(h=e=e.parent)||void 0===h?void 0:h.parent)&&(null===(u=e.data.physics)||void 0===u||!u.fusedBody);)var h,u;f.data.collisionEnabled&&(this.needsCollisionDetection=!0),null===c&&(c=f.data)}if(this.page.traverseEntity((e=>{for(let t of e.dataPatched.events)if(!1===t.data.disabled&&"Trigger"===t.data.type)return this.needsCollisionDetection=!0,!0})),l&&c){i=i||c.camera===t.uuid||l.uuid===t.uuid;let e=new T7(l,this.renderer.domElement,c,this.eventContext.page.data.globalPhysics,this,l.uuid!==t.uuid&&c.camera===t.uuid,t,this.page,this.sharedAssets);this.gameControl=e,n=c.joystickPosLoc,r=c.joystickRotLoc,a=c.jumpTouchButtonLoc,s=c.rotByTouch,Tj&&c.touchControl&&(this.joystickToGameControls[n]="pos","walk"===c.moveMode&&(this.joystickToGameControls[a]="jmp"),"joystick"===s&&(this.joystickToGameControls[r]="rot"))}if(this.gameControl&&this.gameControl.data.navmesh.enabled){let e=this.gameControl.data;if(!this.navigationMeshWrapper){let t;this.navigationMeshWrapper=new fte(this.usePhysics,this.isExport),t="sphere"===e.collider.type?2*e.collider.radius:e.collider.height,t=Math.floor(t/e.navmesh.ch-1),this.navigationMeshWrapper.init({...e.navmesh,walkableHeight:t},this.gameControl,this.eventContext)}}if(!1===i){let{enableRotate:e,enablePan:i,enableZoom:n,autoRotate:r,hoverRotatePanMode:a}=this.eventManager.publish.orbitControls;(e||i||n||r||0!==a)&&(this.orbitControls=new Ote(t,this.renderer.domElement,{isExport:this.isExport,isPlayMode:!0}),this.orbitControls.addEventListener("change",this.requestRender),this.orbitControls.addEventListener("end",this.requestRender),this.orbitControls.addEventListener("start",this.requestRender),this.orbitControls.fromJSON(this.eventManager.publish.orbitControls,this.eventManager.publish.mouseEventTarget),this.orbitControls.useKeyEvents=!1,this.orbitControls.addEventListenersToCamera(),this.orbitControls.connect(),this.orbitControls.update())}let d=this.renderer.domElement.width/this.renderer.getPixelRatio(),p=this.renderer.domElement.height/this.renderer.getPixelRatio();this.joystickToGameControls.forEach(((e,t)=>{let i=document.body.appendChild(document.createElement("div")),[n,r,a]=this.eventManager.eventContext.publish.joystickSizeAndXYOffset[t],s=(d-5*n)/4+n,o={},l="jmp"===e,c=l?0:n;t<10?(t<5?o.top=c/2:o.bottom=c/2,o.left=c/2+t%5*s):10===t?(o.left=c/2,o.top=p/2):(o.right=c/2,o.top=p/2),o.top?o.top-=r[1]:o.bottom+=r[1],o.left?o.left+=r[0]:o.right-=r[0];for(let d in o)o[d]+="px";if(l){let e=i.appendChild(document.createElement("div"));Object.assign(e.style,o,{position:"absolute",width:n+"px",height:n+"px",backgroundColor:"rgba(255,255,255,".concat("show"===a?.4:0,")"),zIndex:"9999",borderRadius:n+"px",border:"show"===a?"solid 2px rgba(0, 0, 0, .1)":"none",display:"flex",alignItems:"center",justifyContent:"center",touchAction:"none"});let r=n/16*16*.4;return"show"===a&&(e.innerHTML='\n\t\t\t\t\t\t<svg width="'.concat(r,'" height="').concat(.4*n,'" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t\t\t<path d="M2 10L8 4L14 10" stroke="black" stroke-opacity="40%" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t')),e.addEventListener("pointerdown",(()=>{this.gameControl.movementState.jump=1,this.requestRender()})),e.addEventListener("touchend",(e=>e.preventDefault())),void(this.joysticks[t]=[void 0,i])}let h={zone:i,mode:"static",position:o,size:n};"hide"===a&&(h.restOpacity=0);let u=z6(h);u.on("move",((t,i)=>{let n=this.gameControl;"pos"===e?i.force<.2?n.moveForce=0:(n.movementState.movePosZ=Math.sin(-i.angle.radian),n.movementState.movePosX=Math.cos(-i.angle.radian),i.force>1.2?n.movementState.run=1:n.movementState.run=0,i.force<.3?n.moveForce=(i.force-.2)/.1:n.moveForce=1):"rot"===e&&(i.force<.2?n.rotForce=0:(n.movementState.rotPosX=i.vector.y,n.movementState.rotPosY=-i.vector.x,i.force<.3?n.rotForce=(i.force-.2)/.1:n.rotForce=1)),this.requestRender()})),u.on("end",((t,i)=>{let n=this.gameControl;"pos"===e?(n.movementState.movePosZ=0,n.movementState.movePosX=0,n.moveForce=1):"rot"===e&&(n.movementState.rotPosX=0,n.movementState.rotPosY=0,n.rotForce=1)})),this.joysticks[t]=[u,i]})),this.markIsDestroyTarget(),this.markIsDragObject(),this.rebuildBVH(),this.initializationCounter++,window.setTimeout((()=>{this.collisionEvents.forEach((e=>e.disabled=!1))}),80)}initPhysics(){var e;null!==(e=this.sharedGameControlGlobals.rapierWorld)&&void 0!==e&&e.free(),this.sharedGameControlGlobals.rapierWorld=new Lte.World(new Lte.Vector3(0,this.gravity,0)),this.events=new Lte.EventQueue(!0);let t=[],i=[];if(this.page.traverseChildren((e=>{var n;let r;if(e instanceof x1){if(!e.objectForSample)return!0===e.object.dataPatched.physics.fusedBody&&"dynamic"===e.object.dataPatched.physics.rigidBody||void 0;if(e.objectForSample.dataPatched.physics.fusedBody)return;r=e.object}else if(e instanceof BX)r=e.object;else{var a,s,o;if(e instanceof g5||e instanceof K1)return;if(r=e,!1===(null===(a=r.dataPatched.cloner)||void 0===a?void 0:a.disabled)&&null!==(s=r.dataPatched.cloner)&&void 0!==s&&s.hideBase&&!0!==(null===(o=r.dataPatched.physics)||void 0===o?void 0:o.fusedBody))return!0}let l,c=r.dataPatched;for(let t of c.events)!0!==t.data.disabled&&"GameControl"===t.data.type&&(l=t.data);if(!c.physics||("visibility"===c.physics.enabled?!c.visible:!c.physics.enabled))return!0;e.updateMatrixWorldSVD();let h=$te(c),u=!1,d=r.userData.hasDestroy,p=r.userData.hasDrag,f=!1;for(let t of c.events)if(!0!==t.data.disabled)if("Collision"===t.data.type){u=!0;let e=new rte(t.id,t.data,r,this.page,this.sharedAssets,this.eventManager);e.disabled=!0,this.collisionEvents.push(e),this.sharedGameControlGlobals.entityToCollisionEvents[r.uuid]&&this.sharedGameControlGlobals.entityToCollisionEvents[r.uuid].every((e=>e.id!==t.id))?this.sharedGameControlGlobals.entityToCollisionEvents[r.uuid].push(e):this.sharedGameControlGlobals.entityToCollisionEvents[r.uuid]=[e]}else if("Follow"===t.data.type){f=!0;let i=t.data.target;e.traverseVisible((e=>{e.userData.isFollowingObj=i}))}"dynamic"===c.physics.rigidBody&&!1===c.physics.fusedBody&&(e.matrixWorldFusedFalse=e.matrixWorld.clone());let m=e.geometry;if(void 0!==l){let t=Lte.RigidBodyDesc.kinematicPositionBased();(e.hasNonUniformScale?e.matrixWorldRigid:e.matrixWorld).decompose(zte,Nte,Fte),e.position0=zte.clone().divideScalar(this.pixelsPerMeter),e.rotation0=Nte.clone(),zte.divideScalar(this.pixelsPerMeter),t.setTranslation(zte.x,zte.y,zte.z).setRotation(Nte);let i,n=this.sharedGameControlGlobals.rapierWorld.createRigidBody(t);e.rigidBody=n,i="sphere"===l.collider.type?Lte.ColliderDesc.ball(l.collider.radius/this.pixelsPerMeter):"capsule"===l.collider.type?Lte.ColliderDesc.capsule((l.collider.height/2-l.collider.radius)/this.pixelsPerMeter,l.collider.radius/this.pixelsPerMeter):Lte.ColliderDesc.cuboid(l.collider.width/this.pixelsPerMeter/2,l.collider.height/this.pixelsPerMeter/2,l.collider.depth/this.pixelsPerMeter/2),i.setFrictionCombineRule(Lte.CoefficientCombineRule.Average).setRestitutionCombineRule(Lte.CoefficientCombineRule.Average).setDensity(c.physics.density).setFriction(c.physics.friction).setRestitution(c.physics.restitution);let a=this.sharedGameControlGlobals.rapierWorld.createCollider(i,n);this.sharedGameControlGlobals.colliderToEntity.set(a.handle,r),zte.fromArray(l.collider.position).multiply(Fte.setFromMatrixScale(r.matrixWorld)).divideScalar(this.pixelsPerMeter),a.setTranslationWrtParent(zte);let s=(new NA).setFromEuler((new CM).setFromVector3((new FA).fromArray(l.collider.rotation)));a.setRotationWrtParent(s),a.setActiveEvents(Lte.ActiveEvents.COLLISION_EVENTS),this.generateSensorColliderDescs(r,!0)}else"dynamic"===c.physics.rigidBody||h||f||d||p||u?(this.addRigidBody(e,r,{hasFollow:f,hasTransformAnim:h,hasDrag:p}),this.generateSensorColliderDescs(r,c.physics.fusedBody)):(m&&t.push(D7(m,e.matrixWorld)),c.physics.fusedBody&&e.traverseObject(((e,i)=>{if(0===i)return;let n;if(e instanceof x1){if(!e.objectForSample)return!0===e.object.dataPatched.physics.fusedBody&&"dynamic"===e.object.dataPatched.physics.rigidBody||void 0;if(e.objectForSample.dataPatched.physics.fusedBody)return;n=e.object}else{var r;if(e instanceof g5||e instanceof K1)return;if(e instanceof BX)n=e.object;else if(n=e,null!==(r=n.dataPatched.cloner)&&void 0!==r&&r.hideBase)return!0}let a=n.dataPatched;if("visibility"===a.physics.enabled?!a.visible:!a.physics.enabled)return!0;let s=e.geometry;void 0!==(null===s||void 0===s?void 0:s.getAttribute("position"))&&t.push(D7(s,e.matrixWorld))})),this.generateSensorColliderDescs(r,c.physics.fusedBody,i));return!(!0!==(null===(n=c.physics)||void 0===n?void 0:n.fusedBody)&&!l)||void 0})),0===t.length)return;let n=$W(t);n.scale(1/this.pixelsPerMeter,1/this.pixelsPerMeter,1/this.pixelsPerMeter);let r=Lte.RigidBodyDesc.fixed(),a=this.sharedGameControlGlobals.rapierWorld.createRigidBody(r),s=Lte.ColliderDesc.trimesh(n.getAttribute("position").array,n.getIndex().array).setFrictionCombineRule(Lte.CoefficientCombineRule.Multiply).setRestitutionCombineRule(Lte.CoefficientCombineRule.Multiply).setFriction(1).setRestitution(1);this.sharedGameControlGlobals.rapierWorld.createCollider(s,a);for(let[o,l]of i){let e=this.sharedGameControlGlobals.rapierWorld.createCollider(o,a);this.sensorToTriggerEvent[e.handle]=l}}updatePositions(){return this.nActiveRigidBodies=0,this.sharedGameControlGlobals.rapierWorld.forEachRigidBody(this.processRigidBody),this.nActiveRigidBodies>0}rebuildBVH(){this.usePhysics?this.initPhysics():(this.page.traverseEntity((e=>{for(let t of e.dataPatched.events)if("Trigger"===t.data.type&&!0!==t.data.disabled){let i=new Bte(t.id,t.data,e,this.page,this.sharedAssets,this.eventManager),n=(new mM).compose(Ute.fromArray(t.data.position),Wte.setFromEuler(Vte.fromArray(t.data.rotation)),Hte);if("box"===t.data.triggerZone){let r=new UA;r.min.fromArray(t.data.size).multiplyScalar(-.5),r.max.fromArray(t.data.size).multiplyScalar(.5),this.sharedGameControlGlobals.triggers.push([r,n,e,i])}else this.sharedGameControlGlobals.triggers.push([t.data.radius,n,e,i])}})),this.needsCollisionDetection&&this.initBVH())}disconnectEvents(){this.collisionEvents.forEach((e=>e.disconnect())),this.sharedGameControlGlobals.triggers.forEach((e=>e[3].disconnect())),this.sharedGameControlGlobals.triggers.length=0}deactivate(){if(this.isEnabled){var e,t,i,n;this.isEnabled=!1,this.page.traverse((e=>{let t=e;t.matrixWorldFusedFalse&&(t.matrixWorldFusedFalse=void 0),t.rigidBody&&(t.rigidBody=void 0),t.position0&&(t.position0=void 0),t.rotation0&&(t.rotation0=void 0)})),null!==(e=this.sharedGameControlGlobals.rapierWorld)&&void 0!==e&&e.free(),this.sharedGameControlGlobals.rapierWorld=void 0,this.sharedGameControlGlobals.staticMeshBVH=void 0,this.accumulator=0,this.sharedGameControlGlobals.entitiesWithTransformAnim=[],this.disconnectEvents(),null!==(t=this.gameControl)&&void 0!==t&&t.reset(),null!==(i=this.gameControl)&&void 0!==i&&i.dispose(),this.gameControl=null,this.initializationCounter=-1,this.joysticks.forEach((e=>{let[t,i]=e;null!==t&&void 0!==t&&t.destroy(),i.remove()})),this.joystickToGameControls=[],this.joysticks=[],this.orbitControls&&(this.orbitControls.dispose(),this.orbitControls=void 0),null!==(n=this.navigationMeshWrapper)&&void 0!==n&&n.dispose(),this.navigationMeshWrapper=void 0;for(let e of Object.values(this.sharedGameControlGlobals.entityToCollisionEvents))e.forEach((e=>e.disconnect()));this.sharedGameControlGlobals.entityToCollisionEvents={},this.page.updateMatrixWorld(!0)}}update(e,t,i){if(!this.isEnabled)return!0;let n=!0;if(void 0!==this.orbitControls&&this.orbitControls.needsUpdate&&(n=!this.orbitControls.update()),this.initializationCounter>=0&&this.initializationCounter<2?(this.initializationCounter++,n=!1):2===this.initializationCounter&&this.gameControl&&(n=!this.gameControl.update(e,t,i)&&n),!1===this.usePhysics&&this.checkTrigger(),this.usePhysics){let t=.016666666666666666;if(0===e)n=this.stepPhysics()&&n;else{let i=e/1e3;i<t&&i>.55*t&&(i=t),this.accumulator+=i;let r=performance.now(),a=0,s=6;for(;this.accumulator>=t&&a<s&&(n=this.stepPhysics()&&n,this.accumulator-=t,a++,!(performance.now()-r>1e3*t)););this.accumulator=this.accumulator%t}}return n}stepPhysics(){var e;for(let t of this.sharedGameControlGlobals.entitiesWithTransformAnim){(t.hasNonUniformScale?t.matrixWorldRigid:t.matrixWorld).decompose(zte,Nte,Fte),jte.setFromQuaternion(Nte);let e=t;void 0===e.prevR?(e.prevR=jte.clone(),e.prevT=zte.clone()):(e.prevR.copy(jte),e.prevT.copy(zte)),t.rigidBody&&(t.rigidBody.setNextKinematicTranslation(zte.divideScalar(this.pixelsPerMeter)),t.rigidBody.setNextKinematicRotation(Nte))}return this.sharedGameControlGlobals.rapierWorld.step(this.events),null!==(e=this.events)&&void 0!==e&&e.drainCollisionEvents(this.handleCollisionEvents),!this.updatePositions()}dispatchCollisionEvent(e,t,i){var n;let r,a=(null===(n=this.sharedGameControlGlobals.rapierWorld)||void 0===n?void 0:n.getCollider(i))._parent;if(t.cloner)for(let s of t.cloner.children)if(s.rigidBody===a){r=s;break}e.dispatch(r),t.dispatchEvent(Kte)}updateUseWindowEvents(e){var t;null===(t=this.orbitControls)||void 0===t||t.updateUseWindowEvents(e)}generateSensorColliderDescs(e,t,i){let n=Xte.copy(e.matrixWorld).invert();e.traverseEntity(((r,a)=>{if(!1===t&&1===a)return!0;for(let t of r.dataPatched.events)if("Trigger"===t.data.type&&!0!==t.data.disabled){let a,s=new Bte(t.id,t.data,r,this.page,this.sharedAssets,this.eventManager);if(a="box"===t.data.triggerZone?Lte.ColliderDesc.cuboid(...t.data.size.map((e=>e/(2*this.pixelsPerMeter)))):Lte.ColliderDesc.ball(t.data.radius/this.pixelsPerMeter),a.setDensity(0).setSensor(!0).setActiveEvents(Lte.ActiveEvents.COLLISION_EVENTS),Ute.fromArray(t.data.position),Wte.setFromEuler(Vte.fromArray(t.data.rotation)),qte.compose(Ute,Wte,Hte).premultiply(r.matrixWorld),i?(qte.decompose(Ute,Wte,Gte),a.setActiveCollisionTypes(Lte.ActiveCollisionTypes.KINEMATIC_FIXED|Lte.ActiveCollisionTypes.DYNAMIC_FIXED)):(qte.premultiply(n).decompose(Ute,Wte,Gte),e.rigidBody.bodyType()===Lte.RigidBodyType.Dynamic||(e.rigidBody.bodyType()===Lte.RigidBodyType.Fixed?a.setActiveCollisionTypes(Lte.ActiveCollisionTypes.KINEMATIC_FIXED|Lte.ActiveCollisionTypes.DYNAMIC_FIXED):a.setActiveCollisionTypes(Lte.ActiveCollisionTypes.KINEMATIC_KINEMATIC|Lte.ActiveCollisionTypes.DYNAMIC_KINEMATIC))),Ute.divideScalar(this.pixelsPerMeter),a.setTranslation(Ute.x,Ute.y,Ute.z),a.setRotation(Wte),i)i.push([a,s]);else{let t=this.sharedGameControlGlobals.rapierWorld.createCollider(a,e.rigidBody);this.sensorToTriggerEvent[t.handle]=s}}}))}checkTrigger(){let e;for(let t=0;t<this.sharedGameControlGlobals.triggers.length;t++){let[i,n,r,a]=this.sharedGameControlGlobals.triggers[t];for(let t=0;t<this.sharedGameControlGlobals.entitiesWithTransformAnim.length;t++){let s=this.sharedGameControlGlobals.entitiesWithTransformAnim[t];if(r===s||!1===a.isValidTriggeringObject(IX.is(s)?s:s.object))continue;let o=Xte.copy(r.matrixWorld).decompose(Ute,Qte,Gte).compose(Ute,Qte,Hte).multiply(n),l=qte.copy(s.matrixWorld).invert().multiply(o);i instanceof UA?e=s.bvhGeometry.boundsTree.intersectsBox(i,l):(Zte.radius=i,Zte.center.setFromMatrixPosition(l),e=s.bvhGeometry.boundsTree.intersectsSphere(Zte)),e?-1===a.currentIntersectedObjects.indexOf(s)&&(a.currentIntersectedObjects.push(s),a.dispatch(),r.dispatchEvent(Jte)):a.currentIntersectedObjects=a.currentIntersectedObjects.filter((e=>e!==s))}}}};function tie(e){var t;let i=this._clip.duration,n=null!==(t=this._clip.start)&&void 0!==t?t:0,r=this.loop,a=this.time+e,s=this._loopCount,o=r===PC;if(0===e)return-1===s?a:o&&1===(1&s)?i-(a-n):a;if(2200===r){-1===s&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(a>=i)a=i;else{if(!(a<0)){this.time=a;break e}a=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=a,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===s&&(e>=0?(s=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),a>=i||a<n){let t=Math.floor((a-n)/(i-n));a-=(i-n)*t,s+=Math.abs(t);let r=this.repetitions-s;if(r<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,o||(a=e>0?i:n,1===this.repetitions&&(a=i)),this.time=a,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===r){let t=e<0;this._setEndings(t,!t,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=a,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:t})}}else this.time=a;if(o&&1===(1&s))return i-(a-n)}return a}var iie,nie=!1,rie=class{constructor(e,t,i,n){this.scene=e,this.requestRender=t,this.updateDisplayProgress=i,this.animationInspectorState=n,this.clipIdToAction={},this.activeClip=null,this.needsUpdate=!1,this.addClip=e=>{"Empty"===e.data.type&&e.data.animations&&e.data.animations.forEach(((t,i)=>{let n=t[0]+"/";if(Array.isArray(e.identity)?n+=e.identity[0]:n+=e.uuid,this.clipIdToAction[n])return;let r=CI.parse(JSON.parse(t[2]));e.animations[i]=r;let a=this.mixer.clipAction(r,e);!1===nie&&(Object.getPrototypeOf(a)._updateTime=tie,nie=!0),a.clampWhenFinished=!0,this.clipIdToAction[n]=a}))},this.mixer=new mR(e),this.scene.traverseEntity(this.addClip)}deleteClip(e,t){let i=this.scene.find(t);if(!i)return;let n=i.animations.find((t=>t.uuid===e));if(!n)return;let r=this.clipIdToAction[e];!r||(r.stop(),this.mixer.uncacheClip(n),delete this.clipIdToAction[e],i.animations=i.animations.filter((t=>t.uuid!==e)))}get isPlaying(){return Object.values(this.clipIdToAction).some((e=>e.isRunning()))}playFromInspector(e){this.mixer.stopAllAction();let t=this.clipIdToAction[e];!t||(t.play(),this.activeClip=t.getClip(),this.requestRender())}onExitPlayMode(){Object.values(this.clipIdToAction).forEach((e=>{e.repetitions=1/0,e.loop=2201})),this.mixer.stopAllAction(),this.requestRender()}play(e){let t=e.clipId+"/"+e.object,i=this.clipIdToAction[t];if(i)return e&&(e.repeat>=0&&(i.repetitions=e.repeat+1),"pingpong"===e.direction&&0!==e.repeat&&(i.loop=PC)),i.play(),i.paused=!1,this.requestRender(),i}resumeFromInspector(e){let t=this.clipIdToAction[e];!t||(t.play(),t.paused=!1,this.requestRender())}pauseFromInspector(e){let t=this.clipIdToAction[e];!t||(t.paused=!0)}stop(){this.mixer.stopAllAction(),this.requestRender()}update(e){var t;if(this.needsUpdate)this.needsUpdate=!1;else if(!1===this.isPlaying||null!==(t=this.animationInspectorState)&&void 0!==t&&t.isScrubbing)return;this.mixer.update(e/1e3),this.activeClip&&this.updateDisplayProgress(Math.round(this.mixer.time/this.activeClip.duration*this.maxFrames%this.maxFrames)),this.requestRender()}get maxFrames(){var e,t;return null!==(e=null===(t=this.activeClip)||void 0===t||null===(t=t.tracks[0])||void 0===t?void 0:t.times.length)&&void 0!==e?e:0}setProgressFromInspector(e,t){if(!this.clipIdToAction[t])return;this.activeClip!==this.clipIdToAction[t].getClip()&&this.playFromInspector(t);let i=this.clipIdToAction[t].paused;this.clipIdToAction[t].paused=!1,this.mixer.setTime(Math.min(this.maxFrames?e/this.maxFrames:0,.9999)*this.activeClip.duration),this.requestRender(),i&&(this.clipIdToAction[t].paused=!0)}},aie=new WeakMap,sie=class extends DI{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,i,n){let r=new II(this.manager);r.setPath(this.path),r.setResponseType("arraybuffer"),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,(e=>{this.decodeDracoFile(e,t).catch(n)}),i,n)}decodeDracoFile(e,t,i,n){let r={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:n||this.defaultAttributeTypes,useUniqueIDs:!!i};return this.decodeGeometry(e,r).then(t)}decodeGeometry(e,t){let i=JSON.stringify(t);if(aie.has(e)){let t=aie.get(e);if(t.key===i)return t.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let n,r=this.workerNextTaskID++,a=e.byteLength,s=this._getWorker(r,a).then((i=>(n=i,new Promise(((i,a)=>{n._callbacks[r]={resolve:i,reject:a},n.postMessage({type:"decode",id:r,taskConfig:t,buffer:e},[e])}))))).then((e=>this._createGeometry(e.geometry)));return s.catch((()=>!0)).then((()=>{n&&r&&this._releaseTask(n,r)})),aie.set(e,{key:i,promise:s}),s}_createGeometry(e){let t=new fT;e.index&&t.setIndex(new nT(e.index.array,1));for(let i=0;i<e.attributes.length;i++){let n=e.attributes[i],r=n.name,a=n.array,s=n.itemSize;t.setAttribute(r,new nT(a,s))}return t}_loadLibrary(e,t){let i=new II(this.manager);return i.setPath(this.decoderPath),i.setResponseType(t),i.setWithCredentials(this.withCredentials),new Promise(((t,n)=>{i.load(e,t,void 0,n)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then((t=>{let i=t[0];e||(this.decoderConfig.wasmBinary=t[1]);let n=oie.toString(),r=["/* draco decoder */",i,"","/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([r]))})),this.decoderPending}_getWorker(e,t){return this._initDecoder().then((()=>{if(this.workerPool.length<this.workerLimit){let e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:"init",decoderConfig:this.decoderConfig}),e.onmessage=function(t){let i=t.data;switch(i.type){case"decode":e._callbacks[i.id].resolve(i);break;case"error":e._callbacks[i.id].reject(i);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+i.type+'"')}},this.workerPool.push(e)}else this.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));let i=this.workerPool[this.workerPool.length-1];return i._taskCosts[e]=t,i._taskLoad+=t,i}))}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map((e=>e._taskLoad)))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,""!==this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),this}};function oie(){let e,t;function i(e,t,i,n,r,a){let s=a.num_components(),o=i.num_points()*s,l=o*r.BYTES_PER_ELEMENT,c=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,r),h=e._malloc(l);t.GetAttributeDataArrayForAllPoints(i,a,c,l,h);let u=new r(e.HEAPF32.buffer,h,o).slice();return e._free(h),{name:n,array:u,itemSize:s}}onmessage=function(n){let r=n.data;switch(r.type){case"init":e=r.decoderConfig,t=new Promise((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"decode":let n=r.buffer,a=r.taskConfig;t.then((e=>{let t=e.draco,s=new t.Decoder,o=new t.DecoderBuffer;o.Init(new Int8Array(n),n.byteLength);try{let e=function(e,t,n,r){let a,s,o=r.attributeIDs,l=r.attributeTypes,c=t.GetEncodedGeometryType(n);if(c===e.TRIANGULAR_MESH)a=new e.Mesh,s=t.DecodeBufferToMesh(n,a);else{if(c!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");a=new e.PointCloud,s=t.DecodeBufferToPointCloud(n,a)}if(!s.ok()||0===a.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+s.error_msg());let h={index:null,attributes:[]};for(let u in o){let n,s,c=self[l[u]];if(r.useUniqueIDs)s=o[u],n=t.GetAttributeByUniqueId(a,s);else{if(s=t.GetAttributeId(a,e[o[u]]),-1===s)continue;n=t.GetAttribute(a,s)}h.attributes.push(i(e,t,a,u,c,n))}return c===e.TRIANGULAR_MESH&&(h.index=function(e,t,i){let n=3*i.num_faces(),r=4*n,a=e._malloc(r);t.GetTrianglesUInt32Array(i,r,a);let s=new Uint32Array(e.HEAPF32.buffer,a,n).slice();return e._free(a),{array:s,itemSize:1}}(e,t,a)),e.destroy(a),h}(t,s,o,a),n=e.attributes.map((e=>e.array.buffer));e.index&&n.push(e.index.array.buffer),self.postMessage({type:"decode",id:r.id,geometry:e},n)}catch(m){console.error(m),self.postMessage({type:"error",id:r.id,error:m.message})}finally{t.destroy(o),t.destroy(s)}}))}}}async function lie(e){if(iie){let t,i={attributeIDs:iie.defaultAttributeIDs,attributeTypes:iie.defaultAttributeTypes,useUniqueIDs:!1};try{t=await iie.decodeGeometry(new Int8Array(e).buffer,i)}catch(a){console.error(a)}if(t)return{index:t.index?{array:t.index.array}:void 0,attributes:Object.entries(t.attributes).map((e=>{let[t,i]=e;return{name:t,itemSize:i.itemSize,array:i.array}}))}}return null}async function cie(e,t){let[i,n]=NV(sG.deserialize(new Uint8Array(e)));JW(i);let r=[];i.scene.objects.traverse(((e,t)=>{"Mesh"===t.type&&"NonParametricGeometry"===t.geometry.type&&void 0!==t.geometry.data.draco&&r.push(t)})),r.length&&await(iie||(iie=new sie).setDecoderPath("https://www.gstatic.com/draco/versioned/decoders/1.5.2/").preload(),iie.decoderPending);for(let a of r){let e=await lie(jV(a.geometry.data.draco));if(e){e.index&&(a.geometry.data.index={array:e.index.array,itemSize:1,normalized:!1,type:"Uint32Array"});let t={};e.attributes.forEach((e=>{let{name:i,array:n,itemSize:r}=e;t[i]={array:n,itemSize:r,type:"Float32Array",normalized:!1}})),a.geometry.data.attributes=t,a.geometry.data.draco=void 0}}return t&&t(i),n.result().data}var hie=class{constructor(e,t,i,n,r,a,s){this.id=e,this.data=t,this.dataEvent=i,this.object=n,this.stage=!1,this.actions=q9(i,t.actions,r,a,s,n)}disconnect(){X9(this.actions)}dispatchIn(){this.actions.Audio.forEach((e=>e.dispatchBasic())),this.actions.Particles.forEach((e=>e.dispatchBasic())),this.actions.Video.forEach((e=>e.dispatchBasic())),this.actions.Create.forEach((e=>e.dispatch())),this.actions.Destroy.forEach((e=>e.dispatch())),this.actions.Reset.forEach((e=>e.dispatch())),this.actions.Link.forEach((e=>e.dispatch())),this.actions.Transition.forEach((e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this,e.init())})),this.actions.Transition.forEach((e=>e.toggle())),this.actions.Animation.forEach((e=>e.play())),this.actions.SwitchCamera.forEach((e=>e.play())),this.actions.SceneTransition.forEach((e=>e.dispatch())),this.actions.SetVariable.forEach((e=>e.checkConditions())),this.actions.SetVariable.forEach((e=>e.dispatch())),this.actions.DynamicVariablePlay.forEach((e=>e.dispatch()))}dispatchOut(){this.actions.Transition.forEach((e=>{e.toggle()}))}},uie=class extends W7{constructor(e,t){super(e),this.eventManager=t,this.breakpoints=[],this.resize=(e,t)=>{this.breakpoints.forEach((i=>{let n,r=PG.deviceToSize(i.data.size),a="horizontal"===i.dataEvent.orientation?e:t;switch(i.data.operator){case"<":n=a<r[0];break;case">":n=a>r[0];break;case"<>":n=a>r[0]&&a<r[1]}i.stage!==n&&(i.stage=n,i.stage?i.dispatchIn():i.dispatchOut())}))},this.onResizeObserver=new ResizeObserver((e=>{for(let t of e){let{width:e,height:i}=t.contentRect;this.resize(e,i)}}))}connect(){let{page:e,sharedAssets:t,domElement:i}=this.eventContext;this.onResizeObserver.observe(i);let n=i=>{var n;if(i.visible&&null!==(n=i.data)&&void 0!==n&&n.events.length)for(let{data:r}of i.data.events)r.disabled||"Resize"===r.type&&r.breakpoints.forEach((n=>{let{data:a,id:s}=n;try{let n=new hie(s,a,r,i,e,t,this.eventManager);this.breakpoints.push(n)}catch(d){}}))};e.traverseEntity((e=>{var t;(e instanceof i5||e instanceof X4)&&null!==(t=e.frame)&&void 0!==t&&t.traverse((e=>{n(e)})),n(e)}))}disconnect(){this.onResizeObserver.disconnect(),this.breakpoints.forEach((e=>{e.disconnect()})),this.breakpoints=[]}},die=class{constructor(e,t,i,n,r){this.publish=e,this.controlsManager=t,this.animationControls=i,this.eventContext=n,this.sharedVariables=r,this.isEnabled=!1,this.activateCount=0,this.needsMouse=!1,this.needsRaycast=!1,this.onTouchMovePreventScroll=e=>{(e.touches.length>1||this.preventTouchScroll)&&e.preventDefault()},this.onMouseWheelPreventScroll=e=>{this.preventScroll&&e.preventDefault()},this.onMouseMove=e=>{this.eventContext.sharedAssets.mouseProperty={...this.getMousePosition(e),pressed:e.buttons>0}},this.onMouseDown=e=>{this.eventContext.sharedAssets.mouseProperty={...this.getMousePosition(e),pressed:!0}},this.onMouseUp=e=>{this.eventContext.sharedAssets.mouseProperty={...this.getMousePosition(e),pressed:!1}},this.getMousePosition=e=>{var t;let{domRect:i}=this.eventContext,{pageX:n,pageY:r}=(null===(t=e.touches)||void 0===t?void 0:t.length)>0?e.touches[0]:e;return{x:n-(i.left+window.scrollX),y:r-(i.top+window.scrollY)}},this.stopRaycast=e.stopRaycast,this.preventScroll=e.preventScroll,this.preventTouchScroll=e.preventTouchScroll,this.hideCursor=e.hideCursor,this.requestRender=n.requestRender}activate(){if(this.isEnabled)return;this.isEnabled=!0,this.initializeActionsDependentStates(),this.needsMouse&&(this.eventContext.domElement.addEventListener("pointermove",this.onMouseMove),this.eventContext.domElement.addEventListener("pointerdown",this.onMouseDown)),this.handlers={Spline:new Z7(this.eventContext),DynamicVariable:new ate(this.eventContext,this.sharedVariables,this,this.needsMouse,this.needsRaycast),Conditional:new ree(this.eventContext,this),Start:new nte(this.eventContext,this),Basic:new J7(this.eventContext,this,this.needsRaycast),MouseHover:new Jee(this.eventContext,this),Scroll:new tte(this.eventContext,this),Follow:new Oee(this.eventContext,this),DragDrop:new _ee(this.eventContext,this),LookAt:new Xee(this.eventContext),Resize:new uie(this.eventContext,this)};let{page:e,domElement:t}=this.eventContext;this.hideCursor&&(t.style.cursor="none"),e.traverseEntity((e=>{e.addEventListener("requestRender",this.requestRender)})),Object.values(this.handlers).forEach((e=>e.connect())),t.addEventListener("wheel",this.onMouseWheelPreventScroll),t.addEventListener("touchmove",this.onTouchMovePreventScroll),this.activateCount++}deactivate(){var e;if(!this.isEnabled)return;this.isEnabled=!1,this.eventContext.domElement.removeEventListener("pointermove",this.onMouseMove),this.eventContext.domElement.removeEventListener("pointerdown",this.onMouseDown),this.eventContext.domElement.removeEventListener("pointerup",this.onMouseUp),this.eventContext.sharedAssets.mouseProperty=null,this.eventContext.sharedAssets.raycastProperty=null;let{page:t,domElement:i}=this.eventContext;i.style.cursor="",Object.values(this.handlers).forEach((e=>e.disconnect())),null!==(e=this.controlsManager.gameControl)&&void 0!==e&&e.disposeActions(),this.controlsManager.disconnectEvents(),t.traverseEntity((e=>{e.removeEventListener("requestRender",this.requestRender),e.destroyedInAction=!1})),i.removeEventListener("touchmove",this.onTouchMovePreventScroll),i.removeEventListener("wheel",this.onMouseWheelPreventScroll),this.animationControls.onExitPlayMode()}get isPaused(){return this.isEnabled}pause(){this.deactivate()}resume(){this.activate()}reset(){this.deactivate(),this.activate(),this.controlsManager.page.updateMatrixWorld(!0),this.controlsManager.rebuildBVH()}updateUseWindowEvents(e){let t=this.isEnabled;t&&this.deactivate(),this.eventContext.useWindowEvents=e,t&&this.activate()}initializeActionsDependentStates(){let e=this.eventContext.sharedAssets;e.resetDynamicVariablePlayState();let t=i=>{if("Conditional"===i.data.type&&(i.data.ifActions.forEach(t),i.data.elseActions.forEach(t)),"Conditional"===i.data.type||"SetVariable"===i.data.type)for(let e of"Conditional"===i.data.type?i.data.condition:i.data.expression)"id"in e&&Array.isArray(e.id)&&("mouse"===e.id[0]&&(this.needsMouse=!0),"raycast"===e.id[0]&&(this.needsRaycast=!0));"DynamicVariablePlay"===i.data.type&&""!==i.data.variableId&&("Play"===i.data.mode||"PlayPause"===i.data.mode||"Toggle"===i.data.mode)&&e.setDynamicVariablePlayState(i.data.variableId,"Stopped")};this.eventContext.page.traverseEntity((e=>{var i;if(null!==(i=e.data)&&void 0!==i&&i.events.length)for(let n of e.data.events)if(!n.data.disabled)if("VariableChange"===n.data.type&&("mouseProperty"===n.data.variableId&&(this.needsMouse=!0),"raycastProperty"===n.data.variableId&&(this.needsRaycast=!0)),"Conditional"===n.data.type)for(let e of["inActions","outActions"])n.data[e].forEach(t);else if("DragDrop"===n.data.type)for(let e of["drag","drop"])n.data.dragDropActions[e].forEach(t);else if("GameControl"===n.data.type)for(let e of["idle","move","jump","run"])n.data.gameActions[e].forEach(t);else if("Resize"===n.data.type)for(let e of n.data.breakpoints)e.data.actions.forEach(t);else"LookAt"===n.data.type||n.data.actions.forEach(t)}))}},pie=class{constructor(e,t,i,n,r){this._aspect=1,this.enableResponsive=!1,this._renderer=e,this._camera=t,this._frameSize=(new hA).copy(i),this._editorSize=(new hA).copy(n),this._aspect=t.aspect,this._fov=null!==r&&void 0!==r?r:t.fov}set frameSize(e){this._frameSize.copy(e)}updateRenderer(){!this._renderer||this._renderer.setSize(this._frameSize.x,this._frameSize.y)}updateViewport(){if(!this._renderer||!this._camera||"PerspectiveCamera"!==this._camera.cameraType)return;let e=this._frameSize.x,t=this._frameSize.y,i=this._editorSize.y;this._aspect=e/t,t<=i&&(this._camera.zoom*=i/t),this._renderer.setViewport(0,0,e,t)}updateCamera(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this._camera)if("PerspectiveCamera"===this._camera.cameraType){let t=this._frameSize.y,i=this._editorSize.y,n=this._fov;if(e&&t>i){let e=function(e,t,i,n,r){return(e-t)/(i-t)*(r-n)+n}(t,1080,2160,1,15)/100;n*=t/i,n*=1-e}this._camera.aspect=this._aspect,this._camera.fov=n,this._camera.updateProjectionMatrix()}else this._camera.setViewplaneSize(this._frameSize.x,this._frameSize.y,this.enableResponsive)}setCamera(e){this._camera=e,this._aspect=e.aspect,this._fov=e.fov}revert(){let e=window.innerWidth,t=window.innerHeight;this._renderer&&(this._renderer.setViewport(0,0,e,t),this._renderer.setSize(e,t)),this._camera&&(this._camera.aspect=e/t,this._camera.fov=this._fov,this._camera.setViewplaneSize(e,t,this.enableResponsive),this._camera.updateProjectionMatrix())}};var fie=class{get sharedAssets(){return this.shared}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.shared=new E0(e.shared,t),this.scene=new l6(e.scene,this.sharedAssets),this.shared.setEntityOpContext({scene:this.scene,shared:this.shared})}reset(e,t){this.scene.clearScene(),this.sharedAssets.reset(e.shared),this.scene.resetAfterClear(e.scene,this.sharedAssets)}resetPersonalCameraFromDocumentData(){for(let e of this.scene.children)e instanceof X4&&!e.uiScene&&e.personalCamera.updateState(e.data.camera,{scene:this.scene,shared:this.shared})}dispose(){this.scene.dispose(),this.shared.dispose()}gc(){this.shared.geometryCache.startGc(),this.shared.geometryCache2.startGc(),this.scene.traverseEntity((e=>{e instanceof k0&&e.markGeometryAsReachable(this.shared)})),this.shared.geometryCache.endGc(),this.shared.geometryCache2.endGc()}},mie=class{constructor(e){let{x:t=10,y:i=10}=e;this._startTime=0;let n=document.getElementById("spe-perfs");n?this.element=n:(this.element=document.createElement("div"),document.body.appendChild(this.element),this.element.style.position="absolute",this.element.style.zIndex="10000",this.element.style.fontFamily="monospace",this.element.style.background="black",this.element.style.color="white",this.element.style.padding="10px",this.element.style.opacity="0.5",this.element.style.fontSize="11px",this.element.setAttribute("id","spe-perfs")),this.element.style.left="".concat(t,"px"),this.element.style.top="".concat(i,"px")}dispose(){var e;null===(e=this.element.parentElement)||void 0===e||e.removeChild(this.element)}start(){this._startTime=performance.now()}end(){let e=performance.now()-this._startTime;this.element.innerHTML=e.toFixed(3)+" ms"}};function gie(e){let t;if(e.index)for(let i=0;i<e.index.array.length;i+=3)t=e.index.array[i],e.index.array[i]=e.index.array[i+2],e.index.array[i+2]=t}function vie(e){return e instanceof z0?"SubdivObject":"NonParametricGeometry"===e.geometry.type?"NonParametric":"Mesh"}function yie(e,t){let i=function(e,t){let i={};return e.traverseEntity((e=>{if(!e.visible||!(e instanceof vK)||"Mesh"!==e.type||Array.isArray(e.material)||e.states&&Object.keys(e.states).length)return;let n=e.parent;for(;n;){if(n instanceof vK&&e.states&&Object.keys(e.states).length)return;n=n.parent}let r=e.material.uuid,a=t.shared.materials[r];if(a){if(!fH.isMergable(a))return}else{var s;let i=null===(s=t.scene.objects.get(e.uuid))||void 0===s?void 0:s.data;if(i&&"material"in i&&"string"!=typeof i.material){if(!fH.isMergable(i.material))return;r=fH.getHash(i.material)}}i[r]||(i[r]={});let o=i[r][vie(e)];if(o){if(o.push(e),e.cloner)for(let t of e.cloner.children)o.push(t)}else if(i[r][vie(e)]=[e],e.cloner)for(let t of e.cloner.children)i[r][vie(e)].push(t)})),i}(t,e),n=function(e){let t=0;return Object.values(e).forEach((e=>{Object.values(e).forEach((e=>{let i=e.length;i>t&&(t=i)}))})),t}(i),r=new Array(n),a=0,s=new Array(n),o=0,l=new Array(n),c=0,h=new Array(n),u=0;for(let[d,p]of Object.entries(i))for(let e of Object.values(p)){if(o=0,c=0,e.forEach((e=>{e instanceof vK&&(s[o++]=e.geometry.clone(),l[c++]=e)})),c<2)continue;for(let e=0;e<c;e++)l[e].updateWorldMatrix(!0,!1),s[e].applyMatrix4(l[e].matrixWorld),l[e].matrixWorld.determinant()<0&&gie(s[e]);let n=$W(s.slice(0,o),!1);if(n){let e;if("SubdivObject"===d)console.warn("Turning subdiv object into mesh"),e=new TT(n,l[0].material);else e=new TT(n,l[0].material);e.castShadow=l[0].castShadow,e.receiveShadow=l[0].receiveShadow,t.add(e);let s=e=>{u=0;for(let t of e)t.children&&s(t.children),t instanceof vK&&(Array.isArray(t.material)||i[t.material.uuid]&&i[t.material.uuid][vie(t)]&&i[t.material.uuid][vie(t)].length>1||(h[u++]=t));for(let i=0;i<u;i++)t.attach(h[i])};for(let t=0;t<c;t++){let e=l[t];s(e.children),r[a++]=e}}}for(let d=0;d<a;d++)r[d].removeFromParent()}var bie=J_(vS(),1),xie=new hA;var wie,_ie=class{constructor(e){let{renderOnDemand:t,renderMode:i="auto"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._viewportMode=1,this._viewportWidth=window.innerWidth,this._viewportHeight=window.innerHeight,this._proxyObjectCache=new Map,this._variablesCache=new Map,this._isPaused=!1,this._renderRequested=!1,this._skipRender=!1,this.time=performance.now(),this.dt=0,this.currentTAAFrame=0,this.disposed=!1,this._requestRenderAutoMode=()=>{this._skipRender=!1},this.requestRender=()=>{this._renderRequested=!0},this.render=e=>{var t,i,n,r,a,s,o,l,c,h,u,d;if(this.time=e,this._lastTime&&(this.dt=this.time-this._lastTime),this._lastTime=this.time,null!==(t=this._perfs)&&void 0!==t&&t.start(),this._renderer)if(this._isPaused||!("manual"===this.renderMode&&!this._renderRequested||"auto"===this.renderMode&&this._skipRender)){if(this._renderRequested=!1,this._skipRender=!0,this._controls&&(this._skipRender=this._controls.update(this.dt)),this._eventManager&&(null!==(i=this._eventManager.handlers)&&void 0!==i&&i.Start.hasVideoAction||null!==(n=this._eventManager.handlers)&&void 0!==n&&n.Basic.hasVideoAction||null!==(r=this._eventManager.handlers)&&void 0!==r&&r.Conditional.hasVideoAction)&&(this._skipRender=!1),null!==(a=this._animationControls)&&void 0!==a&&a.update(this.dt),this._skipRender?(this.currentTAAFrame++,this.currentTAAFrame<32?this._skipRender=!1:this.currentTAAFrame=0):this.currentTAAFrame=0,null!==(s=this._scene)&&void 0!==s&&s.traverseVisibleEntity((e=>{"ParticleSystem"===e.type&&(e.update(this.dt),this._skipRender=!1)})),this._scene&&this._scene.activeCamera!==this._camera&&(this._camera=this._scene.activeCamera),null!==(o=this._eventManager)&&void 0!==o&&o.isEnabled&&((null===(l=this._eventManager.handlers)||void 0===l?void 0:l.Follow).onAnimationFrameDamping(),(null===(c=this._eventManager.handlers)||void 0===c?void 0:c.LookAt).onAnimationFrameDamping(),(null===(h=this._eventManager.handlers)||void 0===h?void 0:h.DragDrop).onAnimationFrameDamping()),this._scene&&this._camera){if(this._scene.pathConstraints.applyConstraints(this._scene),this._renderer.sceneTransitionTimeRemaining>0){this._renderer.sceneTransitionTimeRemaining-=this.dt;let e=1-this._renderer.sceneTransitionTimeRemaining/this._renderer.sceneTransitionDuration;this._renderer.pipeline.sceneTransitionPass.uniforms.mixRatio.value=e,this._skipRender=!1}else this._renderer.pipeline.sceneTransitionFromTexture=null;this._renderer.renderSplineScene(this._scene,this._camera)}this.canvas.dispatchEvent(this._renderedEvent),null===(u=this._perfs)||void 0===u||u.end()}else{var p;null===(p=this._perfs)||void 0===p||p.end()}else null===(d=this._perfs)||void 0===d||d.end()},this._resize=()=>{if(this._renderer){var e,t,i,n,r,a,s,o;if(1===this._viewportMode&&this._frameView&&(this._frameView.frameSize=xie.set(this._viewportWidth,this._viewportHeight)),this._renderer.setSize(this._viewportWidth,this._viewportHeight,!1),this._camera=null===(e=this._scene)||void 0===e?void 0:e.activeCamera,null!==(t=this._scene)&&void 0!==t&&t.updateViewPlaneSize(null!==(i=null===(n=this._frameView)||void 0===n||null===(n=n.frameSize)||void 0===n?void 0:n.x)&&void 0!==i?i:this._viewportWidth,null!==(r=null===(a=this._frameView)||void 0===a||null===(a=a.frameSize)||void 0===a?void 0:a.y)&&void 0!==r?r:this._viewportHeight,null!==(s=null===(o=this._frameView)||void 0===o?void 0:o.enableResponsive)&&void 0!==s&&s),this._camera){var l,c,h,u,d;let e=null!==(l=Object.values(null!==(c=null===(h=this._data)||void 0===h?void 0:h.frames)&&void 0!==c?c:{})[0].preset)&&void 0!==l?l:"fullscreen";null!==(u=this._frameView)&&void 0!==u&&u.setCamera(this._camera),null!==(d=this._frameView)&&void 0!==d&&d.updateCamera("fullscreen"!==e),"PerspectiveCamera"===this._camera.cameraType&&(this._camera.aspect=this._viewportWidth/this._viewportHeight),this._camera.updateProjectionMatrix()}this.eventManager&&(this.eventManager.eventContext.domRect=this.canvas.getBoundingClientRect()),this._requestRenderAutoMode()}},this._debouncedResize=cj(this._resize,10),this._onScroll=e=>{this.eventManager&&(this.eventManager.eventContext.domRect=this.canvas.getBoundingClientRect())},this.canvas=e,this.renderMode=t?"auto":i,this._renderedEvent=new CustomEvent("rendered",{bubbles:!0}),Object.defineProperty(this._renderedEvent,"target",{writable:!1,value:this}),window.location.search.includes("perfs")&&(this._perfs=new mie({x:10,y:10})),function(e){e.addEventListener("pointerdown",Nj,!0),e.addEventListener("pointerdown",jj,!0),e.addEventListener("pointermove",jj,!0),e.addEventListener("pointerup",Fj,!0),e.addEventListener("pointercancel",Fj,!0),e.addEventListener("pointerleave",Fj,!0),window.addEventListener("keydown",Uj,!0),window.addEventListener("keyup",Gj,!0)}(e)}async load(e,t,i){(function(e){let t="The Spline Runtime only accepts .splinecode files that are generated from Spline export panel.";e.endsWith(".spline")?console.warn(t+" The .spline files are only meant to be used by the Editor."):e.endsWith(".splinecode")||console.warn(t)})(e),this.disposed=!1;let n=await(await fetch(e,i)).arrayBuffer();await this.start(n,{variables:t})}async start(e){var t,i,n,r,a;let{interactive:s=!0,variables:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.disposed)return;let l=await cie(e);this._data=l,l.version&&(0,bie.default)(l.version,"1.0.53")>0&&console.warn("Your .splinecode file is more recent than the library. Please upgrade @splinetool/runtime to the latest version."),await Promise.all([U1(l)&&eK(),B0(l)&&PZ(),tW.physicsEnabled(l.scene.objects)&&Kj(),i1(l)&&m0(),y4(l)&&v4(),gte(l)&&Xj()].filter(Boolean)),null!==(t=this._eventManager)&&void 0!==t&&t.deactivate(),null!==(i=this._controls)&&void 0!==i&&i.deactivate(),null===(n=this._scene)||void 0===n||n.dispose();let c=new fie(l);if(c.resetPersonalCameraFromDocumentData(),this._scene=c.scene,this._sharedAssetsManager=c.sharedAssets,this._camera=this._scene.activeCamera,window.location.search.includes("merge-geometries")){let e=performance.now();yie(l,c.scene);let t=performance.now();console.log("Merged geometries in ",t-e," ms")}U1(l)&&this._scene.traverse((e=>{X1(e)&&e.recomputeBoolean()})),this._sharedAssetsManager.setRequestRender((()=>{var e;this._requestRenderAutoMode(),null===(e=this._scene)||void 0===e||e.traverse((e=>{e instanceof x1&&e.pendingMediaLoad&&e.update()}))})),null===(r=this._scene)||void 0===r||r.traverse((e=>{"ParticleSystem"===e.type&&(e.wakeUp(),e.data.autoPlay?e.start():e.stop())}));let h=Object.keys(l.shared.fonts).map((e=>this._sharedAssetsManager.getFont(e).loadingPromise));if(Promise.all(h).then((()=>{c.scene.markNeedsUpdateRendererDirty(),this._requestRenderAutoMode()})),i1(l)&&function(e){if(tW.physicsEnabled(e.scene.objects))return!0;let t=!1;return e.scene.objects.traverse(((e,i)=>{if(i.events)if(Array.isArray(i.events)){for(let n of i.events)if(!0!==n.data.disabled&&"GameControl"===n.data.type&&n.data.collisionEnabled){t=!0;break}}else for(let n of Object.values(i.events))if(!0!==n.disabled&&"GameControl"===n.type&&n.collisionEnabled){t=!0;break}})),t}(l)&&await Promise.all(h),y4(l)){let e=[];this._scene.traverseEntity((t=>{(t instanceof i5||t instanceof X4)&&t.uiCanvas&&e.push(t.uiCanvas)})),await Promise.all(e.map((e=>e.promise)))}this._scene.rewriteEventsBeforeGoToPlayMode(),M9(this._scene.activePage,this._sharedAssetsManager),this._renderer||(this._renderer=new G3({canvas:this.canvas,antialias:!1,alpha:!0,stencil:!1,depth:!1,powerPreference:"high-performance"}),this._renderer.hdTransmission=!0===l.scene.publish.hdTransmission,this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.pipeline.enableUIOverlay(),this._renderer.pipeline.addEventListener("smaaloaded",this._requestRenderAutoMode)),this._scene.initializeSplatViewer(this._renderer),void 0!==l.scene.blueNoiseTextureData&&this._renderer.pipeline.updateBlueNoiseTexture(l.scene.blueNoiseTextureData);let u=Object.values(l.frames)[0];if(this._frameView?this._frameView.setCamera(this._camera):("fullscreen"===u.preset?(this._viewportMode=1,this.canvas.style.display="block",this.canvas.parentElement&&(this._viewportWidth=this.canvas.parentElement.clientWidth||300,this.canvas.style.width="100%"),this.canvas.parentElement&&(this._viewportHeight=this.canvas.parentElement.clientHeight||150,this.canvas.style.height="100%")):(this._viewportMode=2,this._viewportWidth=u.size[0],this._viewportHeight=u.size[1],this.canvas.style.width="".concat(this._viewportWidth,"px"),this.canvas.style.height="".concat(this._viewportHeight,"px")),this._renderer.setSize(this._viewportWidth,this._viewportHeight,!1),this._frameView=new pie(this._renderer,this._camera,new hA(this._viewportWidth,this._viewportHeight),new hA(window.innerWidth,window.innerHeight)),this._frameView.enableResponsive=null!==(a=u.allowResponsive)&&void 0!==a&&a&&"fullscreen"===u.preset),s){let e=new H7(this._renderer,this.data.scene.publish,this._scene,(()=>this._scene.activeCamera),this._sharedAssetsManager,this._requestRenderAutoMode,!0,u);this._scene.updateMatrixWorld(!0),this._controls=new eie(e),this._animationControls=new rie(this._scene,this._requestRenderAutoMode),this._eventManager=new die(l.scene.publish,this._controls,this._animationControls,e,l.shared.variables),this._eventManager.activate(),this._controls.activate(this._eventManager)}this._resize(),void 0!==o&&this.setVariables(o),0===this.dt&&(this.render(performance.now()),setTimeout((()=>{var e;null===(e=this._renderer)||void 0===e||e.setAnimationLoop(this.render)}),0)),this._resizeObserverTimeout=setTimeout((()=>{!this._resizeObserver&&this.canvas.parentElement&&(this._resizeObserver=new ResizeObserver((()=>{this._viewportWidth=this.canvas.clientWidth,this._viewportHeight=this.canvas.clientHeight,this._debouncedResize()})),this._resizeObserver.observe(this.canvas.parentElement))}),300),document.addEventListener("scroll",this._onScroll)}setVariables(e){if(void 0!==this._data){let t=Object.entries(e);for(let[e,i]of t)this.setVariable(e,i)}}setVariable(e,t){let i=this._getVariableByName(e);if(i&&!("dynamicVariableType"in i.data)){var n;let e=t;"number"==typeof i.data.value?e="number"==typeof t?t:"boolean"==typeof t?!0===t?1:0:parseFloat(t):"boolean"==typeof i.data.value?e="number"==typeof t?!!t:"boolean"==typeof t?t:"false"!==t.toLocaleLowerCase()&&!!t:"string"!=typeof i.data.value&&void 0!==i.data.value.textValue&&(e=t.toString());let r="string"==typeof e?{textValue:e}:e;null!==(n=this._sharedAssetsManager)&&void 0!==n&&n.updateVariable(i.id,r),this.requestRender(),this._requestRenderAutoMode()}else void 0===i?console.warn("No variable named ".concat(e," was found in your Spline file. Make sure to create it from Spline editor.")):"dynamicVariableType"in i.data&&console.warn("Dynamic variables like ".concat(e," cannot be updated from code."))}getVariables(){let e={};return this._data&&this._data.shared.variables.forEach((t=>{void 0===e[t.data.name]&&(e[t.data.name]=this._getVariableValue(this._sharedAssetsManager.getVariable(t.id)))})),e}getVariable(e){let t=this._getVariableByName(e);if(t){let e=this._sharedAssetsManager.getVariable(t.id);return this._getVariableValue(e)}}_getVariableValue(e){return"string"!=typeof e&&aW.isTextValue(e)?aW.getDisplayedValue(e):e}_getVariableByName(e){if(this._data){if(this._variablesCache.has(e))return this._variablesCache.get(e);let t=this._data.shared.variables.find((t=>t.data.name===e));return t&&this._variablesCache.set(e,t),t}}findObjectById(e){var t;let i=null===(t=this._scene)||void 0===t?void 0:t.getObjectByProperty("uuid",e);return this._createProxyObject(i)}findObjectByName(e){var t;let i=null===(t=this._scene)||void 0===t?void 0:t.getObjectByName(e);return this._createProxyObject(i)}getAllObjects(){var e;let t=[];return null!==(e=this._scene)&&void 0!==e&&e.traverseEntity((e=>{if(e.uuid!==qG&&!this._scene.isInvisibleObjects(e)&&!(e instanceof X4)){let i=this._createProxyObject(e);i&&t.push(i)}})),t}getSplineEvents(){var e;return(null===(e=this._eventManager)||void 0===e||null===(e=e.handlers)||void 0===e?void 0:e.Spline).splineEvents}emitEvent(e,t){var i;null===(i=this.findObjectById(t)||this.findObjectByName(t))||void 0===i||i.emitEvent(e)}emitEventReverse(e,t){var i;null===(i=this.findObjectById(t)||this.findObjectByName(t))||void 0===i||i.emitEventReverse(e)}addEventListener(e,t){this.canvas.addEventListener(e,t)}removeEventListener(e,t){this.canvas.removeEventListener(e,t)}setZoom(e){var t,i;(null===(t=this._controls)||void 0===t?void 0:t.orbitControls)instanceof Ote&&(null===(i=this._controls)||void 0===i||i.orbitControls.zoomOut(e))}get eventManager(){return this._eventManager}get controls(){return this._controls}setSize(e,t){this._viewportWidth=e,this._viewportHeight=t,this._viewportMode=2,this._resize()}setBackgroundColor(e){var t;let{r:i,g:n,b:r,a:a}={r:0,g:0,b:0,a:1},s=new CK(i,n,r,a);try{s.setStyle(e)}catch{console.error("This is not a valid css color",e)}null!==(t=this._scene)&&void 0!==t&&t.activePage.setBackgroundColor(s),this._requestRenderAutoMode()}dispose(){var e,t,i,n,r,a,s;this.disposed=!0,null!==(e=this._eventManager)&&void 0!==e&&e.deactivate(),null!==(t=this._scene)&&void 0!==t&&t.dispose(),null!==(i=this._sharedAssetsManager)&&void 0!==i&&i.dispose(),this._proxyObjectCache.forEach((e=>{SL.unsubscribe(e)})),this._variablesCache.clear(),null!==(n=this._renderer)&&void 0!==n&&n.setAnimationLoop(null),null!==(r=this._renderer)&&void 0!==r&&r.dispose(),this._renderer=void 0,null!==(a=this._sharedAssetsManager)&&void 0!==a&&a.dispose(),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=void 0),void 0!==this._resizeObserverTimeout&&clearTimeout(this._resizeObserverTimeout),this.canvas.style.width="",this.canvas.style.height="",this.canvas.removeAttribute("width"),this.canvas.removeAttribute("height"),this._frameView&&(this._frameView=void 0),null!==(s=this._controls)&&void 0!==s&&s.deactivate(),function(e){e.removeEventListener("pointerdown",Nj,!0),e.removeEventListener("pointerdown",jj,!0),e.removeEventListener("pointermove",jj,!0),e.removeEventListener("pointerup",Fj,!0),e.removeEventListener("pointercancel",Fj,!0),e.removeEventListener("pointerleave",Fj,!0),window.removeEventListener("keydown",Uj,!0),window.removeEventListener("keyup",Gj,!0)}(this.canvas),document.removeEventListener("scroll",this._onScroll)}get isStopped(){return this._isPaused}stop(){var e,t,i;this._isPaused||(null!==(e=this._renderer)&&void 0!==e&&e.setAnimationLoop(null),this._isPaused=!0,null!==(t=this._eventManager)&&void 0!==t&&t.pause(),(null===(i=this._controls)||void 0===i?void 0:i.orbitControls)&&(this._controls.orbitControls.enabled=!1))}play(){var e,t,i;!this._isPaused||(this._isPaused=!1,null!==(e=this._eventManager)&&void 0!==e&&e.resume(),null!==(t=this._controls)&&void 0!==t&&t.orbitControls&&(this._controls.orbitControls.enabled=!0),null===(i=this._renderer)||void 0===i||i.setAnimationLoop(this.render))}setGlobalEvents(e){var t;null===(t=this._eventManager)||void 0===t||t.updateUseWindowEvents(e)}get data(){return this._data}_createProxyObject(e){var t;if(null==e)return;if(this._proxyObjectCache.has(e.uuid))return this._proxyObjectCache.get(e.uuid);let i;e.traverseAncestors((e=>{e instanceof X4&&(i=e.name)}));let n={name:e.name,uuid:e.uuid,visible:e.visible,intensity:e.intensity,position:e.position,rotation:e.rotation,scale:e.scale,type:e.data.type,page:i,parentUuid:e.parent instanceof X4||e instanceof l6||null===(t=e.parent)||void 0===t?void 0:t.uuid,emitEvent(t){e.dispatchEvent({type:"userEvent",eventName:t})},emitEventReverse(t){e.dispatchEvent({type:"userEvent",eventName:t,reverse:!0})}},r=SL(n,((t,i)=>{var n;"object"!=typeof e[t]&&null!==(n=Object.getOwnPropertyDescriptor(e,t))&&void 0!==n&&n.writable&&(e[t]=i),this._requestRenderAutoMode(),e.updateMatrix()}));return this._proxyObjectCache.set(e.uuid,r),r}setUIWasmUrl(e){$J.skiaWasmUrl=e}},Sie=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Eie={},Cie={get exports(){return Eie},set exports(e){Eie=e}},Aie={};!function(e){e.exports=function(){if(wie)return Aie;wie=1;var e=t,i=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(e,t,n){var o,l={},c=null,h=null;for(o in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(h=t.ref),t)r.call(t,o)&&!s.hasOwnProperty(o)&&(l[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===l[o]&&(l[o]=t[o]);return{$$typeof:i,type:e,key:c,ref:h,props:l,_owner:a.current}}return Aie.Fragment=n,Aie.jsx=o,Aie.jsxs=o,Aie}()}(Cie);const Mie=Eie.jsx;var Tie=NaN,Pie="[object Symbol]",Die=/^\s+|\s+$/g,kie=/^[-+]0x[0-9a-f]+$/i,Oie=/^0b[01]+$/i,Iie=/^0o[0-7]+$/i,Rie=parseInt,Lie="object"==typeof Sie&&Sie&&Sie.Object===Object&&Sie,Bie="object"==typeof self&&self&&self.Object===Object&&self,zie=Lie||Bie||Function("return this")(),Nie=Object.prototype.toString,Fie=Math.max,jie=Math.min,Vie=function(){return zie.Date.now()};function Uie(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Gie(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&Nie.call(e)==Pie}(e))return Tie;if(Uie(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Uie(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Die,"");var i=Oie.test(e);return i||Iie.test(e)?Rie(e.slice(2),i?2:8):kie.test(e)?Tie:+e}var Hie=function(e,t,i){var n,r,a,s,o,l,c=0,h=!1,u=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var i=n,a=r;return n=r=void 0,c=t,s=e.apply(a,i)}function f(e){var i=e-l;return void 0===l||i>=t||i<0||u&&e-c>=a}function m(){var e=Vie();if(f(e))return g(e);o=setTimeout(m,function(e){var i=t-(e-l);return u?jie(i,a-(e-c)):i}(e))}function g(e){return o=void 0,d&&n?p(e):(n=r=void 0,s)}function v(){var e=Vie(),i=f(e);if(n=arguments,r=this,l=e,i){if(void 0===o)return function(e){return c=e,o=setTimeout(m,t),h?p(e):s}(l);if(u)return o=setTimeout(m,t),p(l)}return void 0===o&&(o=setTimeout(m,t)),s}return t=Gie(t)||0,Uie(i)&&(h=!!i.leading,a=(u="maxWait"in i)?Fie(Gie(i.maxWait)||0,t):a,d="trailing"in i?!!i.trailing:d),v.cancel=function(){void 0!==o&&clearTimeout(o),c=0,n=l=r=o=void 0},v.flush=function(){return void 0===o?s:g(Vie())},v};function Wie(e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}const qie=[],Xie={width:"100%",height:"100%"},Yie=(0,t.forwardRef)((function(e,i){let{className:n,children:r,debounceTime:a=300,ignoreDimensions:s=qie,parentSizeStyles:o,enableDebounceLeadingCall:l=!0,resizeObserverPolyfill:c,...h}=e;const u=(0,t.useRef)(null),d=(0,t.useRef)(0),[p,f]=(0,t.useState)({width:0,height:0,top:0,left:0}),m=(0,t.useMemo)((()=>{const e=Array.isArray(s)?s:[s];return Hie((t=>{f((i=>Object.keys(i).filter((e=>i[e]!==t[e])).every((t=>e.includes(t)))?i:t))}),a,{leading:l})}),[a,l,s]);return(0,t.useEffect)((()=>{const e=new(c||window.ResizeObserver)((e=>{e.forEach((e=>{var t;const{left:i,top:n,width:r,height:a}=null!==(t=null==e?void 0:e.contentRect)&&void 0!==t?t:{};d.current=window.requestAnimationFrame((()=>{m({width:r,height:a,top:n,left:i})}))}))}));return u.current&&e.observe(u.current),()=>{window.cancelAnimationFrame(d.current),e.disconnect(),m.cancel()}}),[m,c]),Mie("div",{style:{...Xie,...o},ref:Wie([i,u]),className:n,...h,children:r({...p,ref:u.current,resize:m})})})),Qie=(0,t.forwardRef)(((e,i)=>{let{scene:n,style:r,onMouseDown:a,onMouseUp:s,onMouseHover:o,onKeyDown:l,onKeyUp:c,onStart:h,onLookAt:u,onFollow:d,onWheel:p,onLoad:f,renderOnDemand:m=!0,...g}=e;const v=(0,t.useRef)(null),[y,b]=(0,t.useState)(!0);return(0,t.useEffect)((()=>{let e;b(!0);const t=[{name:"mouseDown",cb:a},{name:"mouseUp",cb:s},{name:"mouseHover",cb:o},{name:"keyDown",cb:l},{name:"keyUp",cb:c},{name:"start",cb:h},{name:"lookAt",cb:u},{name:"follow",cb:d},{name:"scroll",cb:p}];if(v.current){async function i(){await e.load(n);for(let i of t)i.cb&&e.addEventListener(i.name,i.cb);b(!1),null==f||f(e)}e=new _ie(v.current,{renderOnDemand:m}),i()}return()=>{for(let i of t)i.cb&&e.removeEventListener(i.name,i.cb);e.dispose()}}),[n]),Mie(Yie,{ref:i,parentSizeStyles:r,debounceTime:50,...g,children:()=>Mie("canvas",{ref:v,style:{display:y?"none":"block"}})})})),Zie=e=>{let{image:t,numbers:i,description:n,index:r}=e;return(0,$o.jsxs)("div",{className:"solution-card solution-card--".concat(r+1),children:[(0,$o.jsx)("img",{src:t,alt:t}),(0,$o.jsx)("div",{className:"solution-card__title",children:i}),(0,$o.jsx)("p",{className:"body1",children:n})]})};qd.registerPlugin(ag);const Kie=()=>{const{first_screen_title:e,banner_title:i,fs_title_background:n,banner_cards:r=[]}=us(ir),a=us(Mr),s=(0,t.useRef)(null),[o,l]=(0,t.useState)(!1);(0,t.useEffect)((()=>{s&&s.current&&s.current.play().catch((e=>{console.error("Error attempting to play",e)}))}),[]);const c=(0,t.useRef)();return Jd((()=>{let e=qd.timeline({scrollTrigger:{trigger:".hero",start:"top top",end:"+=500px",scrub:1}});e.fromTo(".information-wrapper__news-wrapper",{marginRight:-8},{marginRight:-382}),e.to(".information-wrapper__box-for-border",{translateX:382},"<"),e.to(".information-wrapper__offer-section",{height:"780px"},"<"),e.fromTo("canvas",{translateX:"35%",translateY:"-32%",scale:.6},{translateX:"0%",translateY:"0",scale:1},"<"),e.to(".test-helper",{height:"0"},"<");let t=qd.timeline({scrollTrigger:{trigger:".test",start:"top 90px",end:"bottom",scrub:1,pin:!0}});t.to(".solution-card--1",{yPercent:-200},"<"),t.to(".solution-card--2",{yPercent:-170},"<"),t.to(".solution-card--3",{yPercent:-130},"<"),t.to(".solution-card--4",{yPercent:-170},"<")}),{scope:c,dependencies:[o]}),(0,$o.jsxs)("section",{className:"container",ref:c,style:{overflow:"hidden"},children:[(0,$o.jsxs)("div",{className:"hero",children:[(0,$o.jsx)("video",{playsInline:!0,loop:!0,muted:!0,src:n,ref:s}),(0,$o.jsx)(ol,{textColor:"white",className:"has-animation",children:(0,$o.jsx)("h1",{dangerouslySetInnerHTML:{__html:e}})})]}),(0,$o.jsx)("div",{className:"test",children:(0,$o.jsxs)("div",{className:"information-wrapper",children:[(0,$o.jsxs)("div",{className:"information-wrapper__offer-section",children:[(0,$o.jsx)("div",{className:"asdasdasdasd",children:(0,$o.jsx)(ol,{size:"super-small",textColor:"white",className:"has-animation",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:i}})})}),(0,$o.jsx)(Qie,{className:"canvas-container ".concat(o?"loaded":""),scene:"https://prod.spline.design/QMHsLmTlrQlLNtn5/scene.splinecode",onLoad:e=>{e.findObjectById("8ee353d4-07de-46c1-86d1-53b653da295e")&&l(!0)}})]}),(0,$o.jsx)("div",{className:"information-wrapper__box-for-border"}),(0,$o.jsx)("div",{className:"information-wrapper__box-for-border radius16"}),(0,$o.jsx)("div",{className:"information-wrapper__box-for-border location-left"}),(0,$o.jsx)("div",{className:"information-wrapper__box-for-border location-left radius16"}),(0,$o.jsx)("div",{className:"information-wrapper__news-wrapper",children:(0,$o.jsx)(G_,{className:"slider-head",children:null===a||void 0===a?void 0:a.map((e=>(0,$o.jsx)(Uw,{children:(0,$o.jsx)(H_,{card:e,array:a})},e.slug)))})}),r.map(((e,t)=>(0,$o.jsx)(Zie,{index:t,image:e.icon,numbers:e.title,description:e.text},e.title)))]})}),(0,$o.jsx)("div",{className:"test-helper"})]})},Jie=()=>{const{discover_information_description:e,discover_information_title:t,discover_nutrition_background:i,discover_nutrition_description:n,discover_nutrition_title:r,discover_trial_description:a,discover_trial_image:s,discover_trial_title:o,discover_title:l}=us(ir);return(0,$o.jsx)($o.Fragment,{children:(0,$o.jsx)("section",{className:"container",children:(0,$o.jsxs)("div",{className:"trial-results",children:[(0,$o.jsx)(ol,{size:"middle",textColor:"white",className:"has-animation",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:l}})}),(0,$o.jsxs)("div",{className:"discover",children:[(0,$o.jsxs)("div",{className:"discover-1 discover-item",children:[(0,$o.jsx)("img",{src:s,alt:"charts"}),(0,$o.jsxs)("div",{className:"discover-1-content",children:[(0,$o.jsx)("div",{className:"discover-title",children:o}),(0,$o.jsx)("p",{className:"discover-text",children:a}),(0,$o.jsx)(al,{href:Xo.trialResults,type:"learn-more-arrow"})]})]}),(0,$o.jsxs)("div",{className:"discover-2 discover-item",style:{backgroundImage:'url("'.concat(i,'")')},children:[(0,$o.jsx)("div",{className:"discover-title",children:r}),(0,$o.jsx)("p",{className:"discover-text",children:n}),(0,$o.jsx)(al,{href:Xo.cropNutritionPrograms,type:"learn-more-arrow"})]}),(0,$o.jsxs)("div",{className:"discover-3 discover-item",children:[(0,$o.jsx)("div",{className:"discover-title",children:t}),(0,$o.jsx)("p",{className:"discover-text",children:e}),(0,$o.jsx)(al,{href:Xo.informationMaterials,type:"learn-more-arrow"})]})]})]})})})},$ie=()=>{const{news_button:e,news_description:t,news_tag:i,news_title:n}=us(ir),r=us(Mr),a=[qw],s=Lv("max-width: 1023px");return(0,$o.jsxs)("section",{className:"container",children:[(0,$o.jsx)("div",{className:"inner-container type-3",children:(0,$o.jsxs)("div",{className:"main-text-container with-absolute-label",children:[(0,$o.jsx)(ll,{children:i}),(0,$o.jsx)("div",{className:"offset-left-4",children:(0,$o.jsx)(ol,{size:"middle",className:"has-animation",children:(0,$o.jsx)("h2",{children:n})})})]})}),(0,$o.jsx)(Ly,{containerType:"type-2",Sidebar:(0,$o.jsxs)("div",{className:"homepage-news-text has-animation",children:[(0,$o.jsx)(ol,{size:"super-small",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:t}})}),(0,$o.jsx)(al,{href:Xo.news,type:"learn-more-arrow",children:e})]}),children:s?(0,$o.jsx)("div",{className:"news-slider homepage-news-slider has-animation",children:(0,$o.jsx)(Vw,{pagination:!0,modules:a,breakpoints:{320:{slidesPerView:1},768:{slidesPerView:2}},spaceBetween:8,children:r.map((e=>(0,$o.jsx)(Uw,{children:(0,$o.jsx)(gx,{data:e})},e.slug)))})}):(0,$o.jsx)("div",{className:"latest-cards-container has-animation",children:r.map((e=>(0,$o.jsx)(gx,{data:e},e.slug)))})})]})};qd.registerPlugin(ag);const ene=()=>{const{banner_cards:e=[],banner_title:i}=us(ir),n=(0,t.useRef)(),r=Lv("max-width: 1023px")?[-250,-180,-220,-270]:[-300,-200,-150,-270];return Jd((()=>{qd.utils.toArray([".solution-card"]).forEach(((e,t)=>{qd.to(e,{yPercent:r[t],ease:"none",scrollTrigger:{trigger:".solutions",scrub:1}})}))}),{scope:n}),(0,$o.jsx)("section",{id:"information-wrapper",className:"container",ref:n,children:(0,$o.jsxs)("div",{className:"solutions",children:[(0,$o.jsx)(ol,{size:"super-small",textColor:"white",className:"has-animation",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:i}})}),(0,$o.jsx)("div",{children:e.map(((e,t)=>(0,$o.jsx)(Zie,{index:t,image:e.icon,numbers:e.title,description:e.text},e.title)))})]})})},tne=()=>{const{about_button:e,about_tag:t,about_text:i,about_title:n}=us(ir);return(0,$o.jsx)("section",{className:"container",children:(0,$o.jsx)("div",{className:"inner-container type-2",children:(0,$o.jsxs)("div",{className:"main-text-container",children:[(0,$o.jsx)(ll,{children:t}),(0,$o.jsx)(ol,{className:"has-animation",children:(0,$o.jsx)("p",{dangerouslySetInnerHTML:{__html:n}})}),(0,$o.jsxs)("div",{className:"offset-left-4 has-animation",children:[(0,$o.jsx)(ol,{size:"small",children:(0,$o.jsx)("p",{dangerouslySetInnerHTML:{__html:i}})}),(0,$o.jsx)(al,{href:Xo.aboutUs,type:"learn-more-arrow",className:"business-philosophy-button",children:e})]})]})})})},ine=e=>{let{data:t,index:i}=e;const{logo:n,preview_title:r,preview_image:a,slug:s}=t;return(0,$o.jsxs)(Ho,{to:Xo.products+"/"+s,className:"product-link",children:[(0,$o.jsxs)("div",{className:"product-link__name",children:[r,(0,$o.jsx)("div",{className:"gradient-number dark",children:(0,$o.jsx)("span",{children:i+1})})]}),(0,$o.jsx)("div",{className:"product-link__image",style:{backgroundImage:'url("'.concat(a,'")')},children:(0,$o.jsx)("div",{className:"product-link__image-logo",children:(0,$o.jsx)("img",{src:n,alt:"product-logo"})})}),(0,$o.jsx)("div",{className:"button learn-more-arrow",children:(0,$o.jsx)("div",{})})]})},nne=()=>{const{products_tag:e,products_title:t}=us(ir),i=us(yn);return(0,$o.jsxs)("section",{className:"container our-products",children:[(0,$o.jsx)("div",{className:"inner-container type-3",children:(0,$o.jsxs)("div",{className:"main-text-container with-absolute-label",children:[(0,$o.jsx)(ll,{children:e}),(0,$o.jsx)("div",{className:"offset-left-4",children:(0,$o.jsx)(ol,{size:"middle has-animation",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:t}})})})]})}),(0,$o.jsx)(Ly,{containerType:"type-2",Sidebar:(0,$o.jsx)($o.Fragment,{}),breakpoint:"lg",children:(0,$o.jsx)("div",{className:"homepage-product-items",children:i.map(((e,t)=>(0,$o.jsx)(ine,{index:t,data:e},e.slug)))})})]})};const rne=__webpack_require__.p+"static/media/heart.7f0d0494172e4d5ca95e16472d329a90.svg";const ane=__webpack_require__.p+"static/media/comment.a0080a94965b4a5f588fc8b43ef373ed.svg";const sne=__webpack_require__.p+"static/media/share.0ba99cc410690f8c77939ff15d8d46ad.svg";const one=__webpack_require__.p+"static/media/bookmark.1a80f3d05501f22cc15e1f6e562c70dd.svg",lne=e=>{let{image:t}=e;return(0,$o.jsxs)("div",{className:"instagram-card",children:[(0,$o.jsx)("img",{src:t,alt:"instagram card"}),(0,$o.jsxs)("div",{className:"icons-wrapper",children:[(0,$o.jsxs)("div",{className:"left-icons-wrapper",children:[(0,$o.jsx)("img",{src:rne,alt:"heart icon"}),(0,$o.jsx)("img",{src:ane,alt:"comment icon"}),(0,$o.jsx)("img",{src:sne,alt:"share icon"})]}),(0,$o.jsx)("img",{src:one,alt:"bookmark icon"})]})]})};const cne=__webpack_require__.p+"static/media/blackInstagram.3253bd5a30f342eac2856fea4729bfd4.svg";qd.registerPlugin(ag);const hne=()=>{const{instagram_photo_1:e,instagram_photo_2:i,instagram_photo_3:n,instagram_photo_4:r,instagram_title:a}=us(ir),{footer_instagram_link:s}=us(Pa),o=(0,t.useRef)(),l=Lv("max-width: 1023px"),c=l?[-250,-180,-100,-150]:[-300,-230,-200,-270];return Jd((()=>{qd.utils.toArray([".insta-anim-card"]).forEach(((e,t)=>{qd.to(e,{yPercent:c[t],ease:"none",scrollTrigger:{trigger:".instagram-news",scrub:1}})}))}),{scope:o}),Jd((()=>{let e=qd.timeline({scrollTrigger:{trigger:".instagram-news",start:"top 70%",end:"top",scrub:1}});e.from(".h1",{opacity:0,y:10}),e.fromTo(".instagram-news",{backgroundSize:"0%"},{backgroundSize:l?"95%":"63%"})}),{scope:o}),(0,$o.jsx)("section",{className:"container",ref:o,children:(0,$o.jsxs)("div",{className:"instagram-news",children:[(0,$o.jsxs)("div",{className:"instagram-image-wrapper",children:[(0,$o.jsx)("div",{className:"h1",children:a}),(0,$o.jsx)(Ho,{target:"_blank",to:s,children:(0,$o.jsx)("img",{src:cne,alt:"instagram"})})]}),(0,$o.jsx)("div",{className:"first-instagram-card insta-anim-card",children:(0,$o.jsx)(lne,{image:e})}),(0,$o.jsx)("div",{className:"second-instagram-card insta-anim-card",children:(0,$o.jsx)(lne,{image:i})}),(0,$o.jsx)("div",{className:"third-instagram-card insta-anim-card",children:(0,$o.jsx)(lne,{image:n})}),(0,$o.jsx)("div",{className:"fourth-instagram-card insta-anim-card",children:(0,$o.jsx)(lne,{image:r})})]})})},une=()=>{const[e,i]=t.useState({width:void 0,height:void 0});return t.useEffect((()=>{const e=()=>i({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",e),e(),()=>{window.removeEventListener("resize",e)}}),[]),e},dne=()=>{const{first_screen_title:e,banner_title:i,fs_title_background:n}=us(ir),r=us(Mr),a=(0,t.useRef)(null);(0,t.useEffect)((()=>{a&&a.current&&a.current.play().catch((e=>{console.error("Error attempting to play",e)}))}),[]);return(0,$o.jsxs)("section",{className:"container hero-mobile",children:[(0,$o.jsxs)("div",{className:"hero",children:[(0,$o.jsx)("video",{playsInline:!0,loop:!0,muted:!0,src:n,ref:a}),(0,$o.jsx)(ol,{textColor:"white",className:"has-animation",children:(0,$o.jsx)("h1",{dangerouslySetInnerHTML:{__html:e}})})]}),(0,$o.jsxs)("div",{className:"information-wrapper",children:[(0,$o.jsxs)("div",{className:"information-wrapper__offer-section",children:[(0,$o.jsx)(ol,{size:"super-small",textColor:"white",className:"has-animation",children:(0,$o.jsx)("span",{dangerouslySetInnerHTML:{__html:i}})}),(0,$o.jsx)(al,{type:"white-arrow",onClick:()=>ja("solutions",100)})]}),(0,$o.jsx)("div",{className:"information-wrapper__box-for-border"}),(0,$o.jsx)("div",{className:"information-wrapper__box-for-border radius16"}),(0,$o.jsx)("div",{className:"information-wrapper__box-for-border location-left"}),(0,$o.jsx)("div",{className:"information-wrapper__box-for-border location-left radius16"}),(0,$o.jsx)("div",{className:"information-wrapper__news-wrapper",children:(0,$o.jsx)(G_,{className:"slider-head",children:null===r||void 0===r?void 0:r.map((e=>(0,$o.jsx)(Uw,{children:(0,$o.jsx)(H_,{card:e,array:r})},e.slug)))})})]})]})},pne=()=>{const e=us(nr),{mission_background_image:i,mission_cards:n,mission_title:r}=us(ir),{width:a}=une(),s=(0,t.useRef)();return xg({items:[],container:s,dependencies:[e]}),wg({item:".discover-item",trigger:".discover",container:s,dependencies:[e]}),wg({item:".product-link",trigger:".homepage-product-items",container:s,dependencies:[e]}),(0,$o.jsxs)("div",{ref:s,children:[a>=1024?(0,$o.jsx)(Kie,{}):(0,$o.jsxs)($o.Fragment,{children:[(0,$o.jsx)(dne,{}),(0,$o.jsx)(ene,{})]}),(0,$o.jsx)(tne,{}),(0,$o.jsx)(tx,{loading:e,background:i,title:r,data:n}),(0,$o.jsx)(nne,{}),(0,$o.jsx)(Jie,{}),(0,$o.jsx)($ie,{}),(0,$o.jsx)(hne,{}),(0,$o.jsx)(Qy,{})]})},fne=()=>{const e=xs(),i=us(nr),n=us(Da),r=us(Tr),a=us(ur),[s,o]=(0,t.useState)(!0);return xb((()=>{o(!1)}),2e3),(0,t.useEffect)((()=>{(async()=>{await e(ar()),await e(sr()),e(Ma()),e(_r({limit:4})),e(un()),e(er())})()}),[e]),n||i||s||r||a?(0,$o.jsx)(pv,{main:!0}):(0,$o.jsx)($o.Fragment,{children:(0,$o.jsx)(Lo,{children:(0,$o.jsxs)(Io,{path:Xo.base,element:(0,$o.jsx)(Ry,{}),children:[(0,$o.jsx)(Io,{path:Xo.base,element:(0,$o.jsx)(pne,{})}),(0,$o.jsx)(Io,{path:Xo.products,element:(0,$o.jsx)(fv,{})}),(0,$o.jsx)(Io,{path:Xo.products+"/:slug",element:(0,$o.jsx)(Cb,{})}),(0,$o.jsx)(Io,{path:Xo.resources,element:(0,$o.jsx)(mv,{})}),(0,$o.jsx)(Io,{path:Xo.trialResults,element:(0,$o.jsx)(Mb,{})}),(0,$o.jsx)(Io,{path:Xo.trialResults+"/:slug",element:(0,$o.jsx)(Ub,{})}),(0,$o.jsx)(Io,{path:Xo.cropNutritionPrograms,element:(0,$o.jsx)(Ab,{})}),(0,$o.jsx)(Io,{path:Xo.cropNutritionPrograms+"/:slug",element:(0,$o.jsx)(jb,{})}),(0,$o.jsx)(Io,{path:Xo.informationMaterials,element:(0,$o.jsx)(Gb,{})}),(0,$o.jsx)(Io,{path:Xo.aboutUs,element:(0,$o.jsx)(rx,{})}),(0,$o.jsx)(Io,{path:Xo.news,element:(0,$o.jsx)(_x,{})}),(0,$o.jsx)(Io,{path:Xo.news+"/:slug",element:(0,$o.jsx)($w,{})}),(0,$o.jsx)(Io,{path:Xo.career,element:(0,$o.jsx)(D_,{})}),(0,$o.jsx)(Io,{path:Xo.career+"/:slug",element:(0,$o.jsx)(C_,{})}),(0,$o.jsx)(Io,{path:Xo.termsAndConditions,element:(0,$o.jsx)(I_,{})}),(0,$o.jsx)(Io,{path:Xo.legalInfo,element:(0,$o.jsx)(R_,{})}),(0,$o.jsx)(Io,{path:Xo.contacts,element:(0,$o.jsx)(j_,{})}),(0,$o.jsx)(Io,{path:"*",element:(0,$o.jsx)(U_,{})})]})})})},mne=()=>{const{pathname:e}=fo();return(0,t.useEffect)((()=>{window.scrollTo(0,0)}),[e]),null},gne=()=>{const e=xs(),{cookie_icon:t,cookie_title:i,cookie_description:n,cookie_btn:r}=us(Pa);return!us(Ha)&&(0,$o.jsxs)("div",{className:"cookie-popup",children:[(0,$o.jsxs)("div",{className:"cookie-popup-content",children:[(0,$o.jsxs)("div",{className:"cookie-popup__title",children:[(0,$o.jsx)("img",{src:t,alt:""}),i]}),(0,$o.jsx)("div",{className:"cookie-popup__text",dangerouslySetInnerHTML:{__html:n}})]}),(0,$o.jsx)("button",{className:"button-submit",onClick:()=>e(Xa()),children:r})]})};n.createRoot(document.getElementById("root")).render((0,$o.jsx)(gs,{store:Qa,children:(0,$o.jsxs)(Vo,{children:[(0,$o.jsx)(mne,{}),(0,$o.jsx)(fne,{}),(0,$o.jsx)(gne,{})]})}))})()})();
//# sourceMappingURL=main.5ff86fab.js.map