@perceptimagery/dita-configurator-staging 0.3.6018 → 0.3.6020

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +17 -17
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /* (c) 2023, Abhishek Deb (vikz91.deb@gmail.com) */
2
2
  (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('@import"https://fonts.googleapis.com/css2?family=Work+Sans:wght@200;300;400;500;600;700;800&display=swap";#Sprie-config-html{font-size:87.5%}#Sprie-config-html,#Sprie-config-body{width:100%;height:100%;margin:0;padding:0;font-family:Work Sans,sans-serif;box-sizing:border-box}#Sprie-config-body *{box-sizing:border-box;margin:0;padding:0}.sprie-config-loadingBox{position:fixed;width:100%;height:100%;display:flex;align-items:center;justify-content:center;text-align:center;font-size:24px;font-weight:500;z-index:10000;background:#f2f2f2}.drawer.drawer--full.hidden-phone.lens-customizer .drawer__header{display:none!important}.drawer.drawer--full.hidden-phone.lens-customizer .drawer__content.drawer__content--padded-start{padding-top:0!important}.popover.hidden-lap-and-up.popover-full .popover__header{display:none!important}#dita-3dconfig-element{height:100%!important}#sprie-config-main-container{width:100%;height:100%}#sprie-config-main-header{border-bottom:.5px solid #aeaeae;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:.5rem}.sprie-config-main-header-close{position:absolute;right:2%;width:3rem;height:3rem;background-color:transparent;border:none}#sprie-config-header-content{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:.5rem}#sprie-config-header-content .sprie-config-mainHeader-frameName{color:#373737;font-size:1.3rem;font-weight:400;line-height:1.5275rem;letter-spacing:-.05rem;text-transform:uppercase}#sprie-config-viewer-container{position:relative;width:100%;img {position: absolute; top: 2rem; left: 2rem;}}.sprie-config-loadingFrame{position:absolute;width:100%;height:100%;display:flex;align-items:center;justify-content:center;text-align:center;font-size:24px;font-weight:500;z-index:1000;background:#fafafa;opacity:.7}.sprie-config-loader{border:8px solid #222222;width:60px;padding:8px;aspect-ratio:1;border-radius:50%;background:#222222;--_m: conic-gradient(#0000 10%, #000), linear-gradient(#000 0 0) content-box;-webkit-mask:var(--_m);mask:var(--_m);-webkit-mask-composite:source-out;mask-composite:subtract;animation:spin 1s infinite linear}@keyframes spin{to{transform:rotate(1turn)}}#Sprie-config-Customisation-block{background-color:#f2f2f2;border-top:1px solid #91847e;position:relative;flex-grow:1}.sprie-config-price-block{position:absolute;bottom:100%;right:0;z-index:1000;display:flex;flex-direction:column;align-items:end;gap:.4rem;p {font-size: 1.5rem; font-weight: 500; color: #121212;}}.frameName{color:#4d4d4d;font-size:.875rem;font-weight:500;line-height:1.5275rem;letter-spacing:-.05rem;text-transform:uppercase}.price-tag{color:#222;font-size:1.3125rem;font-weight:400;line-height:2.275rem}@media (max-width: 576px){#Sprie-config-Viewer-Container{img {position: absolute; top: 1.2rem; left: 1.2rem;}}}.sprie-config-palette{display:flex;gap:1.5rem;justify-content:flex-start;overflow-x:auto}.sprie-config-palette-img-box{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center}.sprie-config-palette-img-box .sprie-config-image{width:60px;height:60px}.sprie-config-palette-img-box .sprie-config-image.mobile-view{width:45px;height:45px}.sprie-config-palette-img-box>button{background-color:transparent}.sprie-config-palette-img-text{position:absolute;z-index:100;bottom:-1rem}.sprie-config-palette-img-text .sprie-config-palette-imgName{white-space:nowrap;z-index:100}.sprie-config-palette-img-text .sprie-config-price-tag{text-align:center;font-size:small;white-space:nowrap;z-index:100}.sprie-config-engraving-block{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;gap:.8rem}.sprie-config-engraving-checkbox[type=checkbox]{width:1rem;height:1rem;accent-color:#000;border:.25rem solid #000;border-radius:.5rem;background-color:transparent}.sprie-config-engraving-inputField-block{width:25rem;position:relative}.sprie-config-engraving-inputField{width:100%;font-size:.8rem;font-weight:500;background:transparent;border-width:1px}.sprie-config-engraving-inputInfo{position:absolute;white-space:nowrap;font-size:.6rem;bottom:.2rem;right:.4rem;color:#686868}.sprie-config-engraving-link{position:absolute;white-space:nowrap;font-size:.7rem;bottom:-1.2rem;right:0;color:#686868;text-decoration:underline;cursor:pointer}@media (max-width: 576px){.sprie-config-engraving-inputField-block{width:70%}}.carousel{position:relative;overflow:hidden;width:100%;height:100%;display:flex;flex-direction:column;align-items:center}.carousel-container{width:80%;height:100%;display:flex;position:relative;overflow:hidden}.carousel-item{display:flex;align-items:start;justify-content:center;min-width:100%;transition-property:transform;transition-timing-function:cubic-bezier(0,0,.2,1);transition-duration:.5s}.carousel-header{display:flex;align-items:center;justify-content:center;gap:2rem}.carousel-header .step-syntax{font-size:1rem;font-weight:600;line-height:1.5rem;color:#4d4d4d}.carousel-header .select-syntax{font-size:1rem;font-weight:400;line-height:1.5rem;color:#91847e}.carousel-btn{border:none;display:flex;align-items:center;justify-content:center;cursor:pointer;background-color:transparent}.arrow{border:solid #91847e;border-width:0 3px 3px 0;display:inline-block}.right-arrow{transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}.left-arrow{transform:rotate(135deg);-webkit-transform:rotate(135deg)}.step-tracker-block{display:flex;flex-direction:column;justify-content:center;align-items:center;border-bottom:1px solid #aeaeae;width:26.25rem}.step-tracker{display:flex;gap:1rem}.step-circle{width:10px;height:10px;border-radius:50%;border:1px solid #7d7d7d;background-color:transparent;display:flex;justify-content:center;align-items:center;margin-right:10px;font-size:14px}.step-circle.active{background-color:#000;border-color:#000}@media (max-width: 576px){.carousel-container{width:100%}.step-tracker-block{width:80%}}.sprie-config-add-to-cart-block{width:14.5rem;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:.5rem}.sprie-config-add-to-cart-btn{width:100%;height:2.75rem;background-color:#000;display:flex;align-items:center;justify-content:center;cursor:pointer;border:0;font-size:.875rem;letter-spacing:.1rem;font-weight:500;color:#fff}#Sprie-Config-return-policy-label{display:flex;justify-content:center;width:16rem;p {font-size: .8rem; text-align:center; margin: .05rem .08rem .05rem .5rem;}}#Sprie-Config-return-policy-checkbox[type=checkbox]{align-self:center;width:1rem;height:1rem;accent-color:#000;border:.25rem solid #000;border-radius:.5rem;background-color:#efefef}.sprie-config-add-to-cart-btn:disabled,.sprie-config-add-to-cart-btn [disabled]{background-color:#504f4f;cursor:default}@media (max-width: 576px){.sprie-config-add-to-cart-block{width:100%}.sprie-config-add-to-cart-btn{width:100%;height:4rem}#Sprie-Config-return-policy-label{width:100%;margin-bottom:.5rem}}.sprie-3d-snap-button-block{position:absolute;top:1.5rem;right:2rem;display:flex;flex-direction:column}.sprie-3d-snap-button{cursor:pointer!important;border:none;font-size:.9rem;padding:.5rem 1.5rem!important;margin:.5rem 0rem!important;text-align:center}@media (max-width: 576px){.sprie-3d-snap-button-block{top:1rem;right:1.3rem;gap:0}.sprie-3d-snap-button{font-size:.7rem;padding:.3rem 1rem!important;margin:.2rem 0!important}}')),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
3
- var IQ=Object.defineProperty;var CQ=(Va,os,ls)=>os in Va?IQ(Va,os,{enumerable:!0,configurable:!0,writable:!0,value:ls}):Va[os]=ls;var Bt=(Va,os,ls)=>(CQ(Va,typeof os!="symbol"?os+"":os,ls),ls);(function(){var VI,jI;"use strict";class Va{constructor(e){Bt(this,"config");this.config=e}IsTokenExpired(){if(!this.config.EXPIRES)return!1;const e=this.config.EXPIRES;if(!e)return!0;const t=new Date().getTime(),i=new Date(e).getTime()-t;return e===""||i<=0}IsConfigExpired(){return this.LoadConfig(),!this.config.JWT||!this.config.ORGID}RequestOptions(e,t){return{method:e,headers:{...{Accept:"application/json","Content-Type":"application/json"},...this.config.JWT&&{Authorization:this.config.JWT}},...e==="POST"&&{body:JSON.stringify(t)}}}async Get(e){return await(await fetch(this.config.HOST+e,this.RequestOptions("GET"))).json()}async Post(e,t){return await(await fetch(this.config.HOST+e,this.RequestOptions("POST",t||{}))).json()}StoreConfig(e){e.JWT&&(localStorage.setItem(`${this.config.STORE_PREFIX}jwtToken`,e.JWT),this.config.JWT=e.JWT),e.EXPIRES&&(localStorage.setItem(`${this.config.STORE_PREFIX}expires`,e.EXPIRES),this.config.EXPIRES=e.EXPIRES),e.ORGID&&(localStorage.setItem(`${this.config.STORE_PREFIX}orgId`,e.ORGID),this.config.ORGID=e.ORGID)}LoadConfig(){const e=localStorage.getItem(`${this.config.STORE_PREFIX}jwtToken`);e&&(this.config.JWT=e);const t=localStorage.getItem(`${this.config.STORE_PREFIX}orgId`);t&&(this.config.ORGID=t);const n=localStorage.getItem(`${this.config.STORE_PREFIX}expires`);return n&&(this.config.EXPIRES=n),this.config}}const os={storePrefix:{NODE_ENV:"production"}.STORE_PREFIX||"sprie-embed-",host:"https://api.sprie.io"},ls=Object.freeze(os),AM="0.3.6018";function gM(r,e){const t=r.findIndex(n=>n.sku===e.sku);return t!==-1?[e,...r.slice(0,t),...r.slice(t+1)]:r}class mM{constructor(e,t){Bt(this,"isAuthenticated");Bt(this,"fetcher");Bt(this,"shopifyAPI");Bt(this,"org");Bt(this,"apiKey");Bt(this,"dataVariants");this.isAuthenticated=!1,this.fetcher=e,this.shopifyAPI=t,this.dataVariants=[]}async Authenticate(e){if(this.fetcher.LoadConfig(),(this.fetcher.IsTokenExpired()||this.fetcher.IsConfigExpired())&&await this.AuthServiceApi(e),this.isAuthenticated=!(this.fetcher.IsTokenExpired()&&this.fetcher.IsConfigExpired()),this.org=this.fetcher.config.ORGID,this.apiKey=e,!this.isAuthenticated)throw new Error("Sprie Authentication failed!")}async AuthServiceApi(e){const t=`/v1/widget/auth?api=${e}`,n=await this.fetcher.Get(t);if(!n.access||!n.orgId)throw new Error("SPRIE key Not Authorised");this.fetcher.StoreConfig({...this.fetcher.config,JWT:n.access,ORGID:n.orgId,EXPIRES:n.expires})}async FetchAssetBySKUOrBarcode(e){let t="/v1/widget/variants/";if(e.barcode)t+=`${e.barcode}`;else if(e.sku)t+=`${e.sku}`;else throw new Error("Need either sku or barcode.");return t+="?populate-customisation=true",await this.fetcher.Get(t)}async FetchCustomisationList(e){const t=`/v1/widget/list-customisation?search=type:${e},org:${this.fetcher.config.ORGID},usage:customizer&limit=50`,n=await this.fetcher.Get(t),i=n.data.find(o=>o.sku===`${e.toLowerCase()}-default`);return{...n,data:i?gM(n.data,i):n.data}}async DownloadMA(e){try{const t=`/v1/widget/org/${e.orgId}/asset/${e.assetsId}/universal-full-encrypted`,n=await this.fetcher.Get(t),i=`org/${e.orgId}/asset/${e.assetsId}`;if(!n)throw new Error("Failed to download model asset.");return{asset:n,decryptionKey:i}}catch{throw new Error("Failed to download model asset.")}}async HandleAssetUsage(e){if(!this.fetcher.IsConfigExpired()&&e){const t={org:this.fetcher.config.ORGID,asset:e,timestamp:new Date().toISOString()},n="/v1/analytics/trigger";await this.fetcher.Post(n,t)}}async PopulateDataList(e){var n;const t=(n=document.querySelector(`#${e}`))==null?void 0:n.textContent;if(t){const i=await JSON.parse(t);return Object.values(i)[0]}return null}async HandleShopifyAddToCart(e){e.forEach(i=>{var o;const s=(o=i.properties)==null?void 0:o.customText;s&&(delete i.properties.customText,Object.assign(i.properties,{"custom-laser-etching":"Add Laser Engraving"}),Object.assign(i.properties,{"custom-text":s}),Object.assign(i.properties,{"This customized item cannot be returned or exchanged":"I agree"}))});let t={items:e,sections:"mini-cart"};const n=await this.shopifyAPI.Post(t);if(n){const i=await this.shopifyAPI.Get();document.querySelector("#shopify-section-mini-cart").outerHTML=n.sections["mini-cart"],document.querySelector(".header__cart-count").textContent=i.item_count;const s=document.querySelector(".drawer.drawer--full");s&&s.hasAttribute("open")&&s.removeAttribute("open");const o=document.querySelector(".popover.hidden-lap-and-up.popover-full");o&&o.hasAttribute("open")&&o.removeAttribute("open"),document.querySelector(".mini-cart.drawer.drawer--large").setAttribute("open","")}}}var Ip=(r=>(r.Init="init",r.Preparing="preparing",r.Authenticating="authenticating",r.Fetching="fetching",r.Loading="loading",r.Done="done",r))(Ip||{});class _M{constructor({log:e,logErr:t,apiService:n,metaData:i,config:s}){Bt(this,"log");Bt(this,"logErr");Bt(this,"metaData");Bt(this,"loaderName");Bt(this,"apiKey");Bt(this,"scriptStreamEncoderId");Bt(this,"rawNodeList");Bt(this,"targetNodeList");Bt(this,"status");Bt(this,"isLoaded");Bt(this,"loadCount");Bt(this,"mutationObserver");Bt(this,"config");Bt(this,"apiService");this.config=s,this.apiService=n,this.metaData=i,this.apiKey=null,this.scriptStreamEncoderId=`sprie-embed🔴${Date.now().toString()}`,this.rawNodeList=document.getElementsByClassName(this.metaData.targetClassName),this.targetNodeList=[],this.status=Ip.Init,this.isLoaded=!1,this.loadCount=0,this.loaderName="sprie-embed-loader",this.log=e.bind(this),this.logErr=t.bind(this),this.mutationObserver=null}scanApiKeyFromCurrentScriptTag(){const e=document.currentScript;if(!e)return;const t=e==null?void 0:e.getAttribute("src");if(!t)return;const n=new URLSearchParams(t.substring(t.indexOf("?")));this.apiKey=(n==null?void 0:n.get("apikey"))||(n==null?void 0:n.get("apiKey")),this.apiKey&&(e==null||e.setAttribute("data-enc-stream-id",this.scriptStreamEncoderId))}async authenticate(){if(this.status=Ip.Authenticating,!this.apiService.isAuthenticated){if(!this.apiKey)throw new Error("Sprie: Unable to authenticate. Need APIKey.");await this.apiService.Authenticate(this.apiKey),this.apiService.isAuthenticated||this.logErr("Authentication failed! Check apikey and/or expiration.")}}async Init(){try{return this.scanApiKeyFromCurrentScriptTag(),await this.authenticate(),!0}catch(e){return this.log("SprieEmbed Loading failed."),this.logErr(e),this.isLoaded=!1,!1}}}function vM(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var T1={exports:{}},Tc={},B1={exports:{}},vt={};/**
3
+ var IQ=Object.defineProperty;var CQ=(Va,os,ls)=>os in Va?IQ(Va,os,{enumerable:!0,configurable:!0,writable:!0,value:ls}):Va[os]=ls;var Bt=(Va,os,ls)=>(CQ(Va,typeof os!="symbol"?os+"":os,ls),ls);(function(){var VI,jI;"use strict";class Va{constructor(e){Bt(this,"config");this.config=e}IsTokenExpired(){if(!this.config.EXPIRES)return!1;const e=this.config.EXPIRES;if(!e)return!0;const t=new Date().getTime(),i=new Date(e).getTime()-t;return e===""||i<=0}IsConfigExpired(){return this.LoadConfig(),!this.config.JWT||!this.config.ORGID}RequestOptions(e,t){return{method:e,headers:{...{Accept:"application/json","Content-Type":"application/json"},...this.config.JWT&&{Authorization:this.config.JWT}},...e==="POST"&&{body:JSON.stringify(t)}}}async Get(e){return await(await fetch(this.config.HOST+e,this.RequestOptions("GET"))).json()}async Post(e,t){return await(await fetch(this.config.HOST+e,this.RequestOptions("POST",t||{}))).json()}StoreConfig(e){e.JWT&&(localStorage.setItem(`${this.config.STORE_PREFIX}jwtToken`,e.JWT),this.config.JWT=e.JWT),e.EXPIRES&&(localStorage.setItem(`${this.config.STORE_PREFIX}expires`,e.EXPIRES),this.config.EXPIRES=e.EXPIRES),e.ORGID&&(localStorage.setItem(`${this.config.STORE_PREFIX}orgId`,e.ORGID),this.config.ORGID=e.ORGID)}LoadConfig(){const e=localStorage.getItem(`${this.config.STORE_PREFIX}jwtToken`);e&&(this.config.JWT=e);const t=localStorage.getItem(`${this.config.STORE_PREFIX}orgId`);t&&(this.config.ORGID=t);const n=localStorage.getItem(`${this.config.STORE_PREFIX}expires`);return n&&(this.config.EXPIRES=n),this.config}}const os={storePrefix:{NODE_ENV:"production"}.STORE_PREFIX||"sprie-embed-",host:"https://api.sprie.io"},ls=Object.freeze(os),AM="0.3.6020";function gM(r,e){const t=r.findIndex(n=>n.sku===e.sku);return t!==-1?[e,...r.slice(0,t),...r.slice(t+1)]:r}class mM{constructor(e,t){Bt(this,"isAuthenticated");Bt(this,"fetcher");Bt(this,"shopifyAPI");Bt(this,"org");Bt(this,"apiKey");Bt(this,"dataVariants");this.isAuthenticated=!1,this.fetcher=e,this.shopifyAPI=t,this.dataVariants=[]}async Authenticate(e){if(this.fetcher.LoadConfig(),(this.fetcher.IsTokenExpired()||this.fetcher.IsConfigExpired())&&await this.AuthServiceApi(e),this.isAuthenticated=!(this.fetcher.IsTokenExpired()&&this.fetcher.IsConfigExpired()),this.org=this.fetcher.config.ORGID,this.apiKey=e,!this.isAuthenticated)throw new Error("Sprie Authentication failed!")}async AuthServiceApi(e){const t=`/v1/widget/auth?api=${e}`,n=await this.fetcher.Get(t);if(!n.access||!n.orgId)throw new Error("SPRIE key Not Authorised");this.fetcher.StoreConfig({...this.fetcher.config,JWT:n.access,ORGID:n.orgId,EXPIRES:n.expires})}async FetchAssetBySKUOrBarcode(e){let t="/v1/widget/variants/";if(e.barcode)t+=`${e.barcode}`;else if(e.sku)t+=`${e.sku}`;else throw new Error("Need either sku or barcode.");return t+="?populate-customisation=true",await this.fetcher.Get(t)}async FetchCustomisationList(e){const t=`/v1/widget/list-customisation?search=type:${e},org:${this.fetcher.config.ORGID},usage:customizer&limit=50`,n=await this.fetcher.Get(t),i=n.data.find(o=>o.sku===`${e.toLowerCase()}-default`);return{...n,data:i?gM(n.data,i):n.data}}async DownloadMA(e){try{const t=`/v1/widget/org/${e.orgId}/asset/${e.assetsId}/universal-full-encrypted`,n=await this.fetcher.Get(t),i=`org/${e.orgId}/asset/${e.assetsId}`;if(!n)throw new Error("Failed to download model asset.");return{asset:n,decryptionKey:i}}catch{throw new Error("Failed to download model asset.")}}async HandleAssetUsage(e){if(!this.fetcher.IsConfigExpired()&&e){const t={org:this.fetcher.config.ORGID,asset:e,timestamp:new Date().toISOString()},n="/v1/analytics/trigger";await this.fetcher.Post(n,t)}}async PopulateDataList(e){var n;const t=(n=document.querySelector(`#${e}`))==null?void 0:n.textContent;if(t){const i=await JSON.parse(t);return Object.values(i)[0]}return null}async HandleShopifyAddToCart(e){e.forEach(i=>{var o;const s=(o=i.properties)==null?void 0:o.customText;s&&(delete i.properties.customText,Object.assign(i.properties,{"custom-laser-etching":"Add Laser Engraving"}),Object.assign(i.properties,{"custom-text":s}),Object.assign(i.properties,{"This customized item cannot be returned or exchanged":"I agree"}))});let t={items:e,sections:"mini-cart"};const n=await this.shopifyAPI.Post(t);if(n){const i=await this.shopifyAPI.Get();document.querySelector("#shopify-section-mini-cart").outerHTML=n.sections["mini-cart"],document.querySelector(".header__cart-count").textContent=i.item_count;const s=document.querySelector(".drawer.drawer--full");s&&s.hasAttribute("open")&&s.removeAttribute("open");const o=document.querySelector(".popover.hidden-lap-and-up.popover-full");o&&o.hasAttribute("open")&&o.removeAttribute("open"),document.querySelector(".mini-cart.drawer.drawer--large").setAttribute("open","")}}}var Ip=(r=>(r.Init="init",r.Preparing="preparing",r.Authenticating="authenticating",r.Fetching="fetching",r.Loading="loading",r.Done="done",r))(Ip||{});class _M{constructor({log:e,logErr:t,apiService:n,metaData:i,config:s}){Bt(this,"log");Bt(this,"logErr");Bt(this,"metaData");Bt(this,"loaderName");Bt(this,"apiKey");Bt(this,"scriptStreamEncoderId");Bt(this,"rawNodeList");Bt(this,"targetNodeList");Bt(this,"status");Bt(this,"isLoaded");Bt(this,"loadCount");Bt(this,"mutationObserver");Bt(this,"config");Bt(this,"apiService");this.config=s,this.apiService=n,this.metaData=i,this.apiKey=null,this.scriptStreamEncoderId=`sprie-embed🔴${Date.now().toString()}`,this.rawNodeList=document.getElementsByClassName(this.metaData.targetClassName),this.targetNodeList=[],this.status=Ip.Init,this.isLoaded=!1,this.loadCount=0,this.loaderName="sprie-embed-loader",this.log=e.bind(this),this.logErr=t.bind(this),this.mutationObserver=null}scanApiKeyFromCurrentScriptTag(){const e=document.currentScript;if(!e)return;const t=e==null?void 0:e.getAttribute("src");if(!t)return;const n=new URLSearchParams(t.substring(t.indexOf("?")));this.apiKey=(n==null?void 0:n.get("apikey"))||(n==null?void 0:n.get("apiKey")),this.apiKey&&(e==null||e.setAttribute("data-enc-stream-id",this.scriptStreamEncoderId))}async authenticate(){if(this.status=Ip.Authenticating,!this.apiService.isAuthenticated){if(!this.apiKey)throw new Error("Sprie: Unable to authenticate. Need APIKey.");await this.apiService.Authenticate(this.apiKey),this.apiService.isAuthenticated||this.logErr("Authentication failed! Check apikey and/or expiration.")}}async Init(){try{return this.scanApiKeyFromCurrentScriptTag(),await this.authenticate(),!0}catch(e){return this.log("SprieEmbed Loading failed."),this.logErr(e),this.isLoaded=!1,!1}}}function vM(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var T1={exports:{}},Tc={},B1={exports:{}},vt={};/**
4
4
  * @license React
5
5
  * react.production.min.js
6
6
  *
@@ -16,7 +16,7 @@ var IQ=Object.defineProperty;var CQ=(Va,os,ls)=>os in Va?IQ(Va,os,{enumerable:!0
16
16
  *
17
17
  * This source code is licensed under the MIT license found in the
18
18
  * LICENSE file in the root directory of this source tree.
19
- */var R1;function EM(){if(R1)return Tc;R1=1;var r=gt,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(c,h,u){var d,A={},p=null,g=null;u!==void 0&&(p=""+u),h.key!==void 0&&(p=""+h.key),h.ref!==void 0&&(g=h.ref);for(d in h)n.call(h,d)&&!s.hasOwnProperty(d)&&(A[d]=h[d]);if(c&&c.defaultProps)for(d in h=c.defaultProps,h)A[d]===void 0&&(A[d]=h[d]);return{$$typeof:e,type:c,key:p,ref:g,props:A,_owner:i.current}}return Tc.Fragment=t,Tc.jsx=o,Tc.jsxs=o,Tc}T1.exports=EM();var Te=T1.exports;const MQ="";var xM=Object.defineProperty,wM=(r,e,t)=>e in r?xM(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,kt=(r,e,t)=>(wM(r,typeof e!="symbol"?e+"":e,t),t);const IM={storePrefix:{NODE_ENV:"production"}.STORE_PREFIX||"3d-configurator-",host:"https://api.sprie.io"},D1=Object.freeze(IM);class CM{constructor(e){kt(this,"baseURL"),kt(this,"JWT"),this.baseURL=e.baseURL}setJWT(e){this.JWT=e}RequestOptions(e,t){return{method:e,headers:{Accept:"application/json","Content-Type":"application/json",...this.JWT&&{Authorization:this.JWT}},...e==="POST"&&{body:JSON.stringify(t)}}}async Get(e){return await(await fetch(this.baseURL+e,this.RequestOptions("GET"))).json()}async Post(e,t){return await(await fetch(this.baseURL+e,this.RequestOptions("POST",t||{}))).json()}}const Bc=new CM({baseURL:D1.host});function MM(r,e){const t=r.findIndex(n=>n.sku===e.sku);return t!==-1?[e,...r.slice(0,t),...r.slice(t+1)]:r}class SM{constructor(){}async AuthServiceApi(e){const t=`/v1/widget/auth?api=${e}`,n=await Bc.Get(t);if(!n.access||!n.orgId)throw new Error("SPRIE key Not Authorised");return n}async FetchAssetBySKUOrBarcode(e){let t="/v1/widget/variants/";if(e.barcode)t+=`${e.barcode}`;else if(e.sku)t+=`${e.sku}`;else throw new Error("Need either sku or barcode.");return t+="?populate-customisation=true",await Bc.Get(t)}async FetchCustomisationList(){const e="/v1/widget/list-customisation?search=type:Lens,usage:customizer&limit=50",t=await Bc.Get(e),n=t.data.find(i=>i.sku==="lens-default");return{...t,data:MM(t.data,n)}}async DownloadMA(e){try{const t=`/v1/widget/org/${e.orgId}/asset/${e.assetsId}/universal-full-encrypted`,n=await Bc.Get(t),i=`org/${e.orgId}/asset/${e.assetsId}`;if(!n)throw new Error("Failed to download model asset.");return{asset:n,decryptionKey:i}}catch{throw new Error("Failed to download model asset.")}}}const Cp=new SM;class TM{constructor(e){kt(this,"prefix"),this.prefix=e}makeKey(e){return`${this.prefix}${e}`}getItem(e){return localStorage.getItem(this.makeKey(e))}setItem(e,t){return localStorage.setItem(this.makeKey(e),t)}}const bc=new TM(D1.storePrefix);class BM{constructor(){kt(this,"authPayload"),kt(this,"apiKey"),kt(this,"isAuthenticated"),this.isAuthenticated=!1,this.authPayload={}}async Init(e){try{return this.apiKey=e,await this.authenticate(),this.isAuthenticated=!0,!0}catch(t){return console.log(t),this.isAuthenticated=!1,!1}}scanApiKeyFromCurrentScriptTag(){const e=document.currentScript;if(!e)return;const t=e==null?void 0:e.getAttribute("src");if(!t)return;const n=new URLSearchParams(t.substring(t.indexOf("?")));this.apiKey=(n==null?void 0:n.get("apikey"))||(n==null?void 0:n.get("apiKey")),this.apiKey}async authenticate(){if(this.isAuthenticated)return;if(!this.apiKey)throw new Error("Spire: Unable to authenticate . Need APIKey.");const e=await Cp.AuthServiceApi(this.apiKey);this.setAuthConfig({EXPIRES:e.expires,JWT:e.access,ORGID:e.orgId})}setAuthConfig(e){e.JWT&&(bc.setItem("jwtToken",e.JWT),this.authPayload.JWT=e.JWT),e.EXPIRES&&(bc.setItem("expires",e.EXPIRES),this.authPayload.EXPIRES=e.EXPIRES),e.ORGID&&(bc.setItem("orgId",e.ORGID),this.authPayload.ORGID=e.ORGID)}LoadConfig(){const e=bc.getItem("jwtToken");e&&(this.authPayload.JWT=e);const t=bc.getItem("orgId");t&&(this.authPayload.ORGID=t);const n=localStorage.getItem("expires");return n&&(this.authPayload.EXPIRES=n),this.authPayload}}var mt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bM(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function RM(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var Mp={exports:{}},Go=typeof Reflect=="object"?Reflect:null,L1=Go&&typeof Go.apply=="function"?Go.apply:function(r,e,t){return Function.prototype.apply.call(r,e,t)},Th;Go&&typeof Go.ownKeys=="function"?Th=Go.ownKeys:Object.getOwnPropertySymbols?Th=function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:Th=function(r){return Object.getOwnPropertyNames(r)};function DM(r){console&&console.warn&&console.warn(r)}var N1=Number.isNaN||function(r){return r!==r};function Qt(){Qt.init.call(this)}Mp.exports=Qt,Mp.exports.once=PM,Qt.EventEmitter=Qt,Qt.prototype._events=void 0,Qt.prototype._eventsCount=0,Qt.prototype._maxListeners=void 0;var U1=10;function Bh(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(Qt,"defaultMaxListeners",{enumerable:!0,get:function(){return U1},set:function(r){if(typeof r!="number"||r<0||N1(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");U1=r}}),Qt.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Qt.prototype.setMaxListeners=function(r){if(typeof r!="number"||r<0||N1(r))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+r+".");return this._maxListeners=r,this};function P1(r){return r._maxListeners===void 0?Qt.defaultMaxListeners:r._maxListeners}Qt.prototype.getMaxListeners=function(){return P1(this)},Qt.prototype.emit=function(r){for(var e=[],t=1;t<arguments.length;t++)e.push(arguments[t]);var n=r==="error",i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var c=i[r];if(c===void 0)return!1;if(typeof c=="function")L1(c,this,e);else for(var h=c.length,u=z1(c,h),t=0;t<h;++t)L1(u[t],this,e);return!0};function k1(r,e,t,n){var i,s,o;if(Bh(t),s=r._events,s===void 0?(s=r._events=Object.create(null),r._eventsCount=0):(s.newListener!==void 0&&(r.emit("newListener",e,t.listener?t.listener:t),s=r._events),o=s[e]),o===void 0)o=s[e]=t,++r._eventsCount;else if(typeof o=="function"?o=s[e]=n?[t,o]:[o,t]:n?o.unshift(t):o.push(t),i=P1(r),i>0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=r,c.type=e,c.count=o.length,DM(c)}return r}Qt.prototype.addListener=function(r,e){return k1(this,r,e,!1)},Qt.prototype.on=Qt.prototype.addListener,Qt.prototype.prependListener=function(r,e){return k1(this,r,e,!0)};function LM(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Q1(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},i=LM.bind(n);return i.listener=t,n.wrapFn=i,i}Qt.prototype.once=function(r,e){return Bh(e),this.on(r,Q1(this,r,e)),this},Qt.prototype.prependOnceListener=function(r,e){return Bh(e),this.prependListener(r,Q1(this,r,e)),this},Qt.prototype.removeListener=function(r,e){var t,n,i,s,o;if(Bh(e),n=this._events,n===void 0)return this;if(t=n[r],t===void 0)return this;if(t===e||t.listener===e)--this._eventsCount===0?this._events=Object.create(null):(delete n[r],n.removeListener&&this.emit("removeListener",r,t.listener||e));else if(typeof t!="function"){for(i=-1,s=t.length-1;s>=0;s--)if(t[s]===e||t[s].listener===e){o=t[s].listener,i=s;break}if(i<0)return this;i===0?t.shift():NM(t,i),t.length===1&&(n[r]=t[0]),n.removeListener!==void 0&&this.emit("removeListener",r,o||e)}return this},Qt.prototype.off=Qt.prototype.removeListener,Qt.prototype.removeAllListeners=function(r){var e,t,n;if(t=this._events,t===void 0)return this;if(t.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):t[r]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete t[r]),this;if(arguments.length===0){var i=Object.keys(t),s;for(n=0;n<i.length;++n)s=i[n],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(e=t[r],typeof e=="function")this.removeListener(r,e);else if(e!==void 0)for(n=e.length-1;n>=0;n--)this.removeListener(r,e[n]);return this};function O1(r,e,t){var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?UM(i):z1(i,i.length)}Qt.prototype.listeners=function(r){return O1(this,r,!0)},Qt.prototype.rawListeners=function(r){return O1(this,r,!1)},Qt.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):F1.call(r,e)},Qt.prototype.listenerCount=F1;function F1(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}Qt.prototype.eventNames=function(){return this._eventsCount>0?Th(this._events):[]};function z1(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n];return t}function NM(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()}function UM(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}function PM(r,e){return new Promise(function(t,n){function i(o){r.removeListener(e,s),n(o)}function s(){typeof r.removeListener=="function"&&r.removeListener("error",i),t([].slice.call(arguments))}H1(r,e,s,{once:!0}),e!=="error"&&kM(r,i,{once:!0})})}function kM(r,e,t){typeof r.on=="function"&&H1(r,"error",e,t)}function H1(r,e,t,n){if(typeof r.on=="function")n.once?r.once(e,t):r.on(e,t);else if(typeof r.addEventListener=="function")r.addEventListener(e,function i(s){n.once&&r.removeEventListener(e,i),t(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r)}var QM=Mp.exports;const G1=class S1 extends QM.EventEmitter{emitEvent(e,t){Object.keys(S1.EVENTS).includes(e)&&this.emit(S1.EVENTS[e],t)}};kt(G1,"EVENTS",{onAddToCart:"add-to-cart"});let OM=G1;var V1={exports:{}};function FM(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var j1={exports:{}};const zM={},HM=Object.freeze(Object.defineProperty({__proto__:null,default:zM},Symbol.toStringTag,{value:"Module"})),GM=RM(HM);var W1;function wt(){return W1||(W1=1,function(r,e){(function(t,n){r.exports=n()})(mt,function(){var t=t||function(n,i){var s;if(typeof window<"u"&&window.crypto&&(s=window.crypto),typeof self<"u"&&self.crypto&&(s=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(s=globalThis.crypto),!s&&typeof window<"u"&&window.msCrypto&&(s=window.msCrypto),!s&&typeof mt<"u"&&mt.crypto&&(s=mt.crypto),!s&&typeof FM=="function")try{s=GM}catch{}var o=function(){if(s){if(typeof s.getRandomValues=="function")try{return s.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof s.randomBytes=="function")try{return s.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},c=Object.create||function(){function w(){}return function(x){var I;return w.prototype=x,I=new w,w.prototype=null,I}}(),h={},u=h.lib={},d=u.Base=function(){return{extend:function(w){var x=c(this);return w&&x.mixIn(w),(!x.hasOwnProperty("init")||this.init===x.init)&&(x.init=function(){x.$super.init.apply(this,arguments)}),x.init.prototype=x,x.$super=this,x},create:function(){var w=this.extend();return w.init.apply(w,arguments),w},init:function(){},mixIn:function(w){for(var x in w)w.hasOwnProperty(x)&&(this[x]=w[x]);w.hasOwnProperty("toString")&&(this.toString=w.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),A=u.WordArray=d.extend({init:function(w,x){w=this.words=w||[],x!=i?this.sigBytes=x:this.sigBytes=w.length*4},toString:function(w){return(w||g).stringify(this)},concat:function(w){var x=this.words,I=w.words,R=this.sigBytes,S=w.sigBytes;if(this.clamp(),R%4)for(var T=0;T<S;T++){var D=I[T>>>2]>>>24-T%4*8&255;x[R+T>>>2]|=D<<24-(R+T)%4*8}else for(var b=0;b<S;b+=4)x[R+b>>>2]=I[b>>>2];return this.sigBytes+=S,this},clamp:function(){var w=this.words,x=this.sigBytes;w[x>>>2]&=4294967295<<32-x%4*8,w.length=n.ceil(x/4)},clone:function(){var w=d.clone.call(this);return w.words=this.words.slice(0),w},random:function(w){for(var x=[],I=0;I<w;I+=4)x.push(o());return new A.init(x,w)}}),p=h.enc={},g=p.Hex={stringify:function(w){for(var x=w.words,I=w.sigBytes,R=[],S=0;S<I;S++){var T=x[S>>>2]>>>24-S%4*8&255;R.push((T>>>4).toString(16)),R.push((T&15).toString(16))}return R.join("")},parse:function(w){for(var x=w.length,I=[],R=0;R<x;R+=2)I[R>>>3]|=parseInt(w.substr(R,2),16)<<24-R%8*4;return new A.init(I,x/2)}},v=p.Latin1={stringify:function(w){for(var x=w.words,I=w.sigBytes,R=[],S=0;S<I;S++){var T=x[S>>>2]>>>24-S%4*8&255;R.push(String.fromCharCode(T))}return R.join("")},parse:function(w){for(var x=w.length,I=[],R=0;R<x;R++)I[R>>>2]|=(w.charCodeAt(R)&255)<<24-R%4*8;return new A.init(I,x)}},E=p.Utf8={stringify:function(w){try{return decodeURIComponent(escape(v.stringify(w)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(w){return v.parse(unescape(encodeURIComponent(w)))}},m=u.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new A.init,this._nDataBytes=0},_append:function(w){typeof w=="string"&&(w=E.parse(w)),this._data.concat(w),this._nDataBytes+=w.sigBytes},_process:function(w){var x,I=this._data,R=I.words,S=I.sigBytes,T=this.blockSize,D=T*4,b=S/D;w?b=n.ceil(b):b=n.max((b|0)-this._minBufferSize,0);var M=b*T,L=n.min(M*4,S);if(M){for(var P=0;P<M;P+=T)this._doProcessBlock(R,P);x=R.splice(0,M),I.sigBytes-=L}return new A.init(x,L)},clone:function(){var w=d.clone.call(this);return w._data=this._data.clone(),w},_minBufferSize:0});u.Hasher=m.extend({cfg:d.extend(),init:function(w){this.cfg=this.cfg.extend(w),this.reset()},reset:function(){m.reset.call(this),this._doReset()},update:function(w){return this._append(w),this._process(),this},finalize:function(w){w&&this._append(w);var x=this._doFinalize();return x},blockSize:16,_createHelper:function(w){return function(x,I){return new w.init(I).finalize(x)}},_createHmacHelper:function(w){return function(x,I){return new _.HMAC.init(w,I).finalize(x)}}});var _=h.algo={};return h}(Math);return t})}(j1)),j1.exports}var Y1={exports:{}},q1;function bh(){return q1||(q1=1,function(r,e){(function(t,n){r.exports=n(wt())})(mt,function(t){return function(n){var i=t,s=i.lib,o=s.Base,c=s.WordArray,h=i.x64={};h.Word=o.extend({init:function(u,d){this.high=u,this.low=d}}),h.WordArray=o.extend({init:function(u,d){u=this.words=u||[],d!=n?this.sigBytes=d:this.sigBytes=u.length*8},toX32:function(){for(var u=this.words,d=u.length,A=[],p=0;p<d;p++){var g=u[p];A.push(g.high),A.push(g.low)}return c.create(A,this.sigBytes)},clone:function(){for(var u=o.clone.call(this),d=u.words=this.words.slice(0),A=d.length,p=0;p<A;p++)d[p]=d[p].clone();return u}})}(),t})}(Y1)),Y1.exports}var X1={exports:{}},K1;function VM(){return K1||(K1=1,function(r,e){(function(t,n){r.exports=n(wt())})(mt,function(t){return function(){if(typeof ArrayBuffer=="function"){var n=t,i=n.lib,s=i.WordArray,o=s.init,c=s.init=function(h){if(h instanceof ArrayBuffer&&(h=new Uint8Array(h)),(h instanceof Int8Array||typeof Uint8ClampedArray<"u"&&h instanceof Uint8ClampedArray||h instanceof Int16Array||h instanceof Uint16Array||h instanceof Int32Array||h instanceof Uint32Array||h instanceof Float32Array||h instanceof Float64Array)&&(h=new Uint8Array(h.buffer,h.byteOffset,h.byteLength)),h instanceof Uint8Array){for(var u=h.byteLength,d=[],A=0;A<u;A++)d[A>>>2]|=h[A]<<24-A%4*8;o.call(this,d,u)}else o.apply(this,arguments)};c.prototype=s}}(),t.lib.WordArray})}(X1)),X1.exports}var J1={exports:{}},Z1;function jM(){return Z1||(Z1=1,function(r,e){(function(t,n){r.exports=n(wt())})(mt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.enc;o.Utf16=o.Utf16BE={stringify:function(h){for(var u=h.words,d=h.sigBytes,A=[],p=0;p<d;p+=2){var g=u[p>>>2]>>>16-p%4*8&65535;A.push(String.fromCharCode(g))}return A.join("")},parse:function(h){for(var u=h.length,d=[],A=0;A<u;A++)d[A>>>1]|=h.charCodeAt(A)<<16-A%2*16;return s.create(d,u*2)}},o.Utf16LE={stringify:function(h){for(var u=h.words,d=h.sigBytes,A=[],p=0;p<d;p+=2){var g=c(u[p>>>2]>>>16-p%4*8&65535);A.push(String.fromCharCode(g))}return A.join("")},parse:function(h){for(var u=h.length,d=[],A=0;A<u;A++)d[A>>>1]|=c(h.charCodeAt(A)<<16-A%2*16);return s.create(d,u*2)}};function c(h){return h<<8&4278255360|h>>>8&16711935}}(),t.enc.Utf16})}(J1)),J1.exports}var $1={exports:{}},e_;function ja(){return e_||(e_=1,function(r,e){(function(t,n){r.exports=n(wt())})(mt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.enc;o.Base64={stringify:function(h){var u=h.words,d=h.sigBytes,A=this._map;h.clamp();for(var p=[],g=0;g<d;g+=3)for(var v=u[g>>>2]>>>24-g%4*8&255,E=u[g+1>>>2]>>>24-(g+1)%4*8&255,m=u[g+2>>>2]>>>24-(g+2)%4*8&255,_=v<<16|E<<8|m,w=0;w<4&&g+w*.75<d;w++)p.push(A.charAt(_>>>6*(3-w)&63));var x=A.charAt(64);if(x)for(;p.length%4;)p.push(x);return p.join("")},parse:function(h){var u=h.length,d=this._map,A=this._reverseMap;if(!A){A=this._reverseMap=[];for(var p=0;p<d.length;p++)A[d.charCodeAt(p)]=p}var g=d.charAt(64);if(g){var v=h.indexOf(g);v!==-1&&(u=v)}return c(h,u,A)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function c(h,u,d){for(var A=[],p=0,g=0;g<u;g++)if(g%4){var v=d[h.charCodeAt(g-1)]<<g%4*2,E=d[h.charCodeAt(g)]>>>6-g%4*2,m=v|E;A[p>>>2]|=m<<24-p%4*8,p++}return s.create(A,p)}}(),t.enc.Base64})}($1)),$1.exports}var t_={exports:{}},r_;function WM(){return r_||(r_=1,function(r,e){(function(t,n){r.exports=n(wt())})(mt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.enc;o.Base64url={stringify:function(h,u){u===void 0&&(u=!0);var d=h.words,A=h.sigBytes,p=u?this._safe_map:this._map;h.clamp();for(var g=[],v=0;v<A;v+=3)for(var E=d[v>>>2]>>>24-v%4*8&255,m=d[v+1>>>2]>>>24-(v+1)%4*8&255,_=d[v+2>>>2]>>>24-(v+2)%4*8&255,w=E<<16|m<<8|_,x=0;x<4&&v+x*.75<A;x++)g.push(p.charAt(w>>>6*(3-x)&63));var I=p.charAt(64);if(I)for(;g.length%4;)g.push(I);return g.join("")},parse:function(h,u){u===void 0&&(u=!0);var d=h.length,A=u?this._safe_map:this._map,p=this._reverseMap;if(!p){p=this._reverseMap=[];for(var g=0;g<A.length;g++)p[A.charCodeAt(g)]=g}var v=A.charAt(64);if(v){var E=h.indexOf(v);E!==-1&&(d=E)}return c(h,d,p)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function c(h,u,d){for(var A=[],p=0,g=0;g<u;g++)if(g%4){var v=d[h.charCodeAt(g-1)]<<g%4*2,E=d[h.charCodeAt(g)]>>>6-g%4*2,m=v|E;A[p>>>2]|=m<<24-p%4*8,p++}return s.create(A,p)}}(),t.enc.Base64url})}(t_)),t_.exports}var n_={exports:{}},i_;function Wa(){return i_||(i_=1,function(r,e){(function(t,n){r.exports=n(wt())})(mt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,c=s.Hasher,h=i.algo,u=[];(function(){for(var E=0;E<64;E++)u[E]=n.abs(n.sin(E+1))*4294967296|0})();var d=h.MD5=c.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(E,m){for(var _=0;_<16;_++){var w=m+_,x=E[w];E[w]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}var I=this._hash.words,R=E[m+0],S=E[m+1],T=E[m+2],D=E[m+3],b=E[m+4],M=E[m+5],L=E[m+6],P=E[m+7],N=E[m+8],j=E[m+9],X=E[m+10],K=E[m+11],ne=E[m+12],V=E[m+13],te=E[m+14],Q=E[m+15],z=I[0],Z=I[1],re=I[2],H=I[3];z=A(z,Z,re,H,R,7,u[0]),H=A(H,z,Z,re,S,12,u[1]),re=A(re,H,z,Z,T,17,u[2]),Z=A(Z,re,H,z,D,22,u[3]),z=A(z,Z,re,H,b,7,u[4]),H=A(H,z,Z,re,M,12,u[5]),re=A(re,H,z,Z,L,17,u[6]),Z=A(Z,re,H,z,P,22,u[7]),z=A(z,Z,re,H,N,7,u[8]),H=A(H,z,Z,re,j,12,u[9]),re=A(re,H,z,Z,X,17,u[10]),Z=A(Z,re,H,z,K,22,u[11]),z=A(z,Z,re,H,ne,7,u[12]),H=A(H,z,Z,re,V,12,u[13]),re=A(re,H,z,Z,te,17,u[14]),Z=A(Z,re,H,z,Q,22,u[15]),z=p(z,Z,re,H,S,5,u[16]),H=p(H,z,Z,re,L,9,u[17]),re=p(re,H,z,Z,K,14,u[18]),Z=p(Z,re,H,z,R,20,u[19]),z=p(z,Z,re,H,M,5,u[20]),H=p(H,z,Z,re,X,9,u[21]),re=p(re,H,z,Z,Q,14,u[22]),Z=p(Z,re,H,z,b,20,u[23]),z=p(z,Z,re,H,j,5,u[24]),H=p(H,z,Z,re,te,9,u[25]),re=p(re,H,z,Z,D,14,u[26]),Z=p(Z,re,H,z,N,20,u[27]),z=p(z,Z,re,H,V,5,u[28]),H=p(H,z,Z,re,T,9,u[29]),re=p(re,H,z,Z,P,14,u[30]),Z=p(Z,re,H,z,ne,20,u[31]),z=g(z,Z,re,H,M,4,u[32]),H=g(H,z,Z,re,N,11,u[33]),re=g(re,H,z,Z,K,16,u[34]),Z=g(Z,re,H,z,te,23,u[35]),z=g(z,Z,re,H,S,4,u[36]),H=g(H,z,Z,re,b,11,u[37]),re=g(re,H,z,Z,P,16,u[38]),Z=g(Z,re,H,z,X,23,u[39]),z=g(z,Z,re,H,V,4,u[40]),H=g(H,z,Z,re,R,11,u[41]),re=g(re,H,z,Z,D,16,u[42]),Z=g(Z,re,H,z,L,23,u[43]),z=g(z,Z,re,H,j,4,u[44]),H=g(H,z,Z,re,ne,11,u[45]),re=g(re,H,z,Z,Q,16,u[46]),Z=g(Z,re,H,z,T,23,u[47]),z=v(z,Z,re,H,R,6,u[48]),H=v(H,z,Z,re,P,10,u[49]),re=v(re,H,z,Z,te,15,u[50]),Z=v(Z,re,H,z,M,21,u[51]),z=v(z,Z,re,H,ne,6,u[52]),H=v(H,z,Z,re,D,10,u[53]),re=v(re,H,z,Z,X,15,u[54]),Z=v(Z,re,H,z,S,21,u[55]),z=v(z,Z,re,H,N,6,u[56]),H=v(H,z,Z,re,Q,10,u[57]),re=v(re,H,z,Z,L,15,u[58]),Z=v(Z,re,H,z,V,21,u[59]),z=v(z,Z,re,H,b,6,u[60]),H=v(H,z,Z,re,K,10,u[61]),re=v(re,H,z,Z,T,15,u[62]),Z=v(Z,re,H,z,j,21,u[63]),I[0]=I[0]+z|0,I[1]=I[1]+Z|0,I[2]=I[2]+re|0,I[3]=I[3]+H|0},_doFinalize:function(){var E=this._data,m=E.words,_=this._nDataBytes*8,w=E.sigBytes*8;m[w>>>5]|=128<<24-w%32;var x=n.floor(_/4294967296),I=_;m[(w+64>>>9<<4)+15]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,m[(w+64>>>9<<4)+14]=(I<<8|I>>>24)&16711935|(I<<24|I>>>8)&4278255360,E.sigBytes=(m.length+1)*4,this._process();for(var R=this._hash,S=R.words,T=0;T<4;T++){var D=S[T];S[T]=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360}return R},clone:function(){var E=c.clone.call(this);return E._hash=this._hash.clone(),E}});function A(E,m,_,w,x,I,R){var S=E+(m&_|~m&w)+x+R;return(S<<I|S>>>32-I)+m}function p(E,m,_,w,x,I,R){var S=E+(m&w|_&~w)+x+R;return(S<<I|S>>>32-I)+m}function g(E,m,_,w,x,I,R){var S=E+(m^_^w)+x+R;return(S<<I|S>>>32-I)+m}function v(E,m,_,w,x,I,R){var S=E+(_^(m|~w))+x+R;return(S<<I|S>>>32-I)+m}i.MD5=c._createHelper(d),i.HmacMD5=c._createHmacHelper(d)}(Math),t.MD5})}(n_)),n_.exports}var s_={exports:{}},a_;function o_(){return a_||(a_=1,function(r,e){(function(t,n){r.exports=n(wt())})(mt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=i.Hasher,c=n.algo,h=[],u=c.SHA1=o.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(d,A){for(var p=this._hash.words,g=p[0],v=p[1],E=p[2],m=p[3],_=p[4],w=0;w<80;w++){if(w<16)h[w]=d[A+w]|0;else{var x=h[w-3]^h[w-8]^h[w-14]^h[w-16];h[w]=x<<1|x>>>31}var I=(g<<5|g>>>27)+_+h[w];w<20?I+=(v&E|~v&m)+1518500249:w<40?I+=(v^E^m)+1859775393:w<60?I+=(v&E|v&m|E&m)-1894007588:I+=(v^E^m)-899497514,_=m,m=E,E=v<<30|v>>>2,v=g,g=I}p[0]=p[0]+g|0,p[1]=p[1]+v|0,p[2]=p[2]+E|0,p[3]=p[3]+m|0,p[4]=p[4]+_|0},_doFinalize:function(){var d=this._data,A=d.words,p=this._nDataBytes*8,g=d.sigBytes*8;return A[g>>>5]|=128<<24-g%32,A[(g+64>>>9<<4)+14]=Math.floor(p/4294967296),A[(g+64>>>9<<4)+15]=p,d.sigBytes=A.length*4,this._process(),this._hash},clone:function(){var d=o.clone.call(this);return d._hash=this._hash.clone(),d}});n.SHA1=o._createHelper(u),n.HmacSHA1=o._createHmacHelper(u)}(),t.SHA1})}(s_)),s_.exports}var l_={exports:{}},c_;function Sp(){return c_||(c_=1,function(r,e){(function(t,n){r.exports=n(wt())})(mt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,c=s.Hasher,h=i.algo,u=[],d=[];(function(){function g(_){for(var w=n.sqrt(_),x=2;x<=w;x++)if(!(_%x))return!1;return!0}function v(_){return(_-(_|0))*4294967296|0}for(var E=2,m=0;m<64;)g(E)&&(m<8&&(u[m]=v(n.pow(E,1/2))),d[m]=v(n.pow(E,1/3)),m++),E++})();var A=[],p=h.SHA256=c.extend({_doReset:function(){this._hash=new o.init(u.slice(0))},_doProcessBlock:function(g,v){for(var E=this._hash.words,m=E[0],_=E[1],w=E[2],x=E[3],I=E[4],R=E[5],S=E[6],T=E[7],D=0;D<64;D++){if(D<16)A[D]=g[v+D]|0;else{var b=A[D-15],M=(b<<25|b>>>7)^(b<<14|b>>>18)^b>>>3,L=A[D-2],P=(L<<15|L>>>17)^(L<<13|L>>>19)^L>>>10;A[D]=M+A[D-7]+P+A[D-16]}var N=I&R^~I&S,j=m&_^m&w^_&w,X=(m<<30|m>>>2)^(m<<19|m>>>13)^(m<<10|m>>>22),K=(I<<26|I>>>6)^(I<<21|I>>>11)^(I<<7|I>>>25),ne=T+K+N+d[D]+A[D],V=X+j;T=S,S=R,R=I,I=x+ne|0,x=w,w=_,_=m,m=ne+V|0}E[0]=E[0]+m|0,E[1]=E[1]+_|0,E[2]=E[2]+w|0,E[3]=E[3]+x|0,E[4]=E[4]+I|0,E[5]=E[5]+R|0,E[6]=E[6]+S|0,E[7]=E[7]+T|0},_doFinalize:function(){var g=this._data,v=g.words,E=this._nDataBytes*8,m=g.sigBytes*8;return v[m>>>5]|=128<<24-m%32,v[(m+64>>>9<<4)+14]=n.floor(E/4294967296),v[(m+64>>>9<<4)+15]=E,g.sigBytes=v.length*4,this._process(),this._hash},clone:function(){var g=c.clone.call(this);return g._hash=this._hash.clone(),g}});i.SHA256=c._createHelper(p),i.HmacSHA256=c._createHmacHelper(p)}(Math),t.SHA256})}(l_)),l_.exports}var u_={exports:{}},h_;function YM(){return h_||(h_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Sp())})(mt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.algo,c=o.SHA256,h=o.SHA224=c.extend({_doReset:function(){this._hash=new s.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var u=c._doFinalize.call(this);return u.sigBytes-=4,u}});n.SHA224=c._createHelper(h),n.HmacSHA224=c._createHmacHelper(h)}(),t.SHA224})}(u_)),u_.exports}var d_={exports:{}},f_;function p_(){return f_||(f_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),bh())})(mt,function(t){return function(){var n=t,i=n.lib,s=i.Hasher,o=n.x64,c=o.Word,h=o.WordArray,u=n.algo;function d(){return c.create.apply(c,arguments)}var A=[d(1116352408,3609767458),d(1899447441,602891725),d(3049323471,3964484399),d(3921009573,2173295548),d(961987163,4081628472),d(1508970993,3053834265),d(2453635748,2937671579),d(2870763221,3664609560),d(3624381080,2734883394),d(310598401,1164996542),d(607225278,1323610764),d(1426881987,3590304994),d(1925078388,4068182383),d(2162078206,991336113),d(2614888103,633803317),d(3248222580,3479774868),d(3835390401,2666613458),d(4022224774,944711139),d(264347078,2341262773),d(604807628,2007800933),d(770255983,1495990901),d(1249150122,1856431235),d(1555081692,3175218132),d(1996064986,2198950837),d(2554220882,3999719339),d(2821834349,766784016),d(2952996808,2566594879),d(3210313671,3203337956),d(3336571891,1034457026),d(3584528711,2466948901),d(113926993,3758326383),d(338241895,168717936),d(666307205,1188179964),d(773529912,1546045734),d(1294757372,1522805485),d(1396182291,2643833823),d(1695183700,2343527390),d(1986661051,1014477480),d(2177026350,1206759142),d(2456956037,344077627),d(2730485921,1290863460),d(2820302411,3158454273),d(3259730800,3505952657),d(3345764771,106217008),d(3516065817,3606008344),d(3600352804,1432725776),d(4094571909,1467031594),d(275423344,851169720),d(430227734,3100823752),d(506948616,1363258195),d(659060556,3750685593),d(883997877,3785050280),d(958139571,3318307427),d(1322822218,3812723403),d(1537002063,2003034995),d(1747873779,3602036899),d(1955562222,1575990012),d(2024104815,1125592928),d(2227730452,2716904306),d(2361852424,442776044),d(2428436474,593698344),d(2756734187,3733110249),d(3204031479,2999351573),d(3329325298,3815920427),d(3391569614,3928383900),d(3515267271,566280711),d(3940187606,3454069534),d(4118630271,4000239992),d(116418474,1914138554),d(174292421,2731055270),d(289380356,3203993006),d(460393269,320620315),d(685471733,587496836),d(852142971,1086792851),d(1017036298,365543100),d(1126000580,2618297676),d(1288033470,3409855158),d(1501505948,4234509866),d(1607167915,987167468),d(1816402316,1246189591)],p=[];(function(){for(var v=0;v<80;v++)p[v]=d()})();var g=u.SHA512=s.extend({_doReset:function(){this._hash=new h.init([new c.init(1779033703,4089235720),new c.init(3144134277,2227873595),new c.init(1013904242,4271175723),new c.init(2773480762,1595750129),new c.init(1359893119,2917565137),new c.init(2600822924,725511199),new c.init(528734635,4215389547),new c.init(1541459225,327033209)])},_doProcessBlock:function(v,E){for(var m=this._hash.words,_=m[0],w=m[1],x=m[2],I=m[3],R=m[4],S=m[5],T=m[6],D=m[7],b=_.high,M=_.low,L=w.high,P=w.low,N=x.high,j=x.low,X=I.high,K=I.low,ne=R.high,V=R.low,te=S.high,Q=S.low,z=T.high,Z=T.low,re=D.high,H=D.low,fe=b,Ae=M,ve=L,ye=P,Oe=N,it=j,ae=X,rt=K,Pe=ne,lt=V,Ye=te,ct=Q,Y=z,k=Z,ee=re,ue=H,pe=0;pe<80;pe++){var ge,Ue,Ee=p[pe];if(pe<16)Ue=Ee.high=v[E+pe*2]|0,ge=Ee.low=v[E+pe*2+1]|0;else{var Qe=p[pe-15],He=Qe.high,Ce=Qe.low,Se=(He>>>1|Ce<<31)^(He>>>8|Ce<<24)^He>>>7,Ze=(Ce>>>1|He<<31)^(Ce>>>8|He<<24)^(Ce>>>7|He<<25),Ne=p[pe-2],Re=Ne.high,at=Ne.low,ft=(Re>>>19|at<<13)^(Re<<3|at>>>29)^Re>>>6,yt=(at>>>19|Re<<13)^(at<<3|Re>>>29)^(at>>>6|Re<<26),_t=p[pe-7],Et=_t.high,G=_t.low,O=p[pe-16],me=O.high,_e=O.low;ge=Ze+G,Ue=Se+Et+(ge>>>0<Ze>>>0?1:0),ge=ge+yt,Ue=Ue+ft+(ge>>>0<yt>>>0?1:0),ge=ge+_e,Ue=Ue+me+(ge>>>0<_e>>>0?1:0),Ee.high=Ue,Ee.low=ge}var Fe=Pe&Ye^~Pe&Y,De=lt&ct^~lt&k,pt=fe&ve^fe&Oe^ve&Oe,Dt=Ae&ye^Ae&it^ye&it,Lt=(fe>>>28|Ae<<4)^(fe<<30|Ae>>>2)^(fe<<25|Ae>>>7),St=(Ae>>>28|fe<<4)^(Ae<<30|fe>>>2)^(Ae<<25|fe>>>7),At=(Pe>>>14|lt<<18)^(Pe>>>18|lt<<14)^(Pe<<23|lt>>>9),ur=(lt>>>14|Pe<<18)^(lt>>>18|Pe<<14)^(lt<<23|Pe>>>9),Vt=A[pe],mr=Vt.high,Tn=Vt.low,qt=ue+ur,ui=ee+At+(qt>>>0<ue>>>0?1:0),qt=qt+De,ui=ui+Fe+(qt>>>0<De>>>0?1:0),qt=qt+Tn,ui=ui+mr+(qt>>>0<Tn>>>0?1:0),qt=qt+ge,ui=ui+Ue+(qt>>>0<ge>>>0?1:0),Kn=St+Dt,Ls=Lt+pt+(Kn>>>0<St>>>0?1:0);ee=Y,ue=k,Y=Ye,k=ct,Ye=Pe,ct=lt,lt=rt+qt|0,Pe=ae+ui+(lt>>>0<rt>>>0?1:0)|0,ae=Oe,rt=it,Oe=ve,it=ye,ve=fe,ye=Ae,Ae=qt+Kn|0,fe=ui+Ls+(Ae>>>0<qt>>>0?1:0)|0}M=_.low=M+Ae,_.high=b+fe+(M>>>0<Ae>>>0?1:0),P=w.low=P+ye,w.high=L+ve+(P>>>0<ye>>>0?1:0),j=x.low=j+it,x.high=N+Oe+(j>>>0<it>>>0?1:0),K=I.low=K+rt,I.high=X+ae+(K>>>0<rt>>>0?1:0),V=R.low=V+lt,R.high=ne+Pe+(V>>>0<lt>>>0?1:0),Q=S.low=Q+ct,S.high=te+Ye+(Q>>>0<ct>>>0?1:0),Z=T.low=Z+k,T.high=z+Y+(Z>>>0<k>>>0?1:0),H=D.low=H+ue,D.high=re+ee+(H>>>0<ue>>>0?1:0)},_doFinalize:function(){var v=this._data,E=v.words,m=this._nDataBytes*8,_=v.sigBytes*8;E[_>>>5]|=128<<24-_%32,E[(_+128>>>10<<5)+30]=Math.floor(m/4294967296),E[(_+128>>>10<<5)+31]=m,v.sigBytes=E.length*4,this._process();var w=this._hash.toX32();return w},clone:function(){var v=s.clone.call(this);return v._hash=this._hash.clone(),v},blockSize:1024/32});n.SHA512=s._createHelper(g),n.HmacSHA512=s._createHmacHelper(g)}(),t.SHA512})}(d_)),d_.exports}var A_={exports:{}},g_;function qM(){return g_||(g_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),bh(),p_())})(mt,function(t){return function(){var n=t,i=n.x64,s=i.Word,o=i.WordArray,c=n.algo,h=c.SHA512,u=c.SHA384=h.extend({_doReset:function(){this._hash=new o.init([new s.init(3418070365,3238371032),new s.init(1654270250,914150663),new s.init(2438529370,812702999),new s.init(355462360,4144912697),new s.init(1731405415,4290775857),new s.init(2394180231,1750603025),new s.init(3675008525,1694076839),new s.init(1203062813,3204075428)])},_doFinalize:function(){var d=h._doFinalize.call(this);return d.sigBytes-=16,d}});n.SHA384=h._createHelper(u),n.HmacSHA384=h._createHmacHelper(u)}(),t.SHA384})}(A_)),A_.exports}var m_={exports:{}},__;function XM(){return __||(__=1,function(r,e){(function(t,n,i){r.exports=n(wt(),bh())})(mt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,c=s.Hasher,h=i.x64,u=h.Word,d=i.algo,A=[],p=[],g=[];(function(){for(var m=1,_=0,w=0;w<24;w++){A[m+5*_]=(w+1)*(w+2)/2%64;var x=_%5,I=(2*m+3*_)%5;m=x,_=I}for(var m=0;m<5;m++)for(var _=0;_<5;_++)p[m+5*_]=_+(2*m+3*_)%5*5;for(var R=1,S=0;S<24;S++){for(var T=0,D=0,b=0;b<7;b++){if(R&1){var M=(1<<b)-1;M<32?D^=1<<M:T^=1<<M-32}R&128?R=R<<1^113:R<<=1}g[S]=u.create(T,D)}})();var v=[];(function(){for(var m=0;m<25;m++)v[m]=u.create()})();var E=d.SHA3=c.extend({cfg:c.cfg.extend({outputLength:512}),_doReset:function(){for(var m=this._state=[],_=0;_<25;_++)m[_]=new u.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(m,_){for(var w=this._state,x=this.blockSize/2,I=0;I<x;I++){var R=m[_+2*I],S=m[_+2*I+1];R=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360,S=(S<<8|S>>>24)&16711935|(S<<24|S>>>8)&4278255360;var T=w[I];T.high^=S,T.low^=R}for(var D=0;D<24;D++){for(var b=0;b<5;b++){for(var M=0,L=0,P=0;P<5;P++){var T=w[b+5*P];M^=T.high,L^=T.low}var N=v[b];N.high=M,N.low=L}for(var b=0;b<5;b++)for(var j=v[(b+4)%5],X=v[(b+1)%5],K=X.high,ne=X.low,M=j.high^(K<<1|ne>>>31),L=j.low^(ne<<1|K>>>31),P=0;P<5;P++){var T=w[b+5*P];T.high^=M,T.low^=L}for(var V=1;V<25;V++){var M,L,T=w[V],te=T.high,Q=T.low,z=A[V];z<32?(M=te<<z|Q>>>32-z,L=Q<<z|te>>>32-z):(M=Q<<z-32|te>>>64-z,L=te<<z-32|Q>>>64-z);var Z=v[p[V]];Z.high=M,Z.low=L}var re=v[0],H=w[0];re.high=H.high,re.low=H.low;for(var b=0;b<5;b++)for(var P=0;P<5;P++){var V=b+5*P,T=w[V],fe=v[V],Ae=v[(b+1)%5+5*P],ve=v[(b+2)%5+5*P];T.high=fe.high^~Ae.high&ve.high,T.low=fe.low^~Ae.low&ve.low}var T=w[0],ye=g[D];T.high^=ye.high,T.low^=ye.low}},_doFinalize:function(){var m=this._data,_=m.words;this._nDataBytes*8;var w=m.sigBytes*8,x=this.blockSize*32;_[w>>>5]|=1<<24-w%32,_[(n.ceil((w+1)/x)*x>>>5)-1]|=128,m.sigBytes=_.length*4,this._process();for(var I=this._state,R=this.cfg.outputLength/8,S=R/8,T=[],D=0;D<S;D++){var b=I[D],M=b.high,L=b.low;M=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360,L=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360,T.push(L),T.push(M)}return new o.init(T,R)},clone:function(){for(var m=c.clone.call(this),_=m._state=this._state.slice(0),w=0;w<25;w++)_[w]=_[w].clone();return m}});i.SHA3=c._createHelper(E),i.HmacSHA3=c._createHmacHelper(E)}(Math),t.SHA3})}(m_)),m_.exports}var v_={exports:{}},y_;function KM(){return y_||(y_=1,function(r,e){(function(t,n){r.exports=n(wt())})(mt,function(t){/** @preserve
19
+ */var R1;function EM(){if(R1)return Tc;R1=1;var r=gt,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(c,h,u){var d,A={},p=null,g=null;u!==void 0&&(p=""+u),h.key!==void 0&&(p=""+h.key),h.ref!==void 0&&(g=h.ref);for(d in h)n.call(h,d)&&!s.hasOwnProperty(d)&&(A[d]=h[d]);if(c&&c.defaultProps)for(d in h=c.defaultProps,h)A[d]===void 0&&(A[d]=h[d]);return{$$typeof:e,type:c,key:p,ref:g,props:A,_owner:i.current}}return Tc.Fragment=t,Tc.jsx=o,Tc.jsxs=o,Tc}T1.exports=EM();var Te=T1.exports;const MQ="";var xM=Object.defineProperty,wM=(r,e,t)=>e in r?xM(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,kt=(r,e,t)=>(wM(r,typeof e!="symbol"?e+"":e,t),t);const IM={storePrefix:{NODE_ENV:"production"}.STORE_PREFIX||"3d-configurator-",host:"https://api.sprie.io"},D1=Object.freeze(IM);class CM{constructor(e){kt(this,"baseURL"),kt(this,"JWT"),this.baseURL=e.baseURL}setJWT(e){this.JWT=e}RequestOptions(e,t){return{method:e,headers:{Accept:"application/json","Content-Type":"application/json",...this.JWT&&{Authorization:this.JWT}},...e==="POST"&&{body:JSON.stringify(t)}}}async Get(e){return await(await fetch(this.baseURL+e,this.RequestOptions("GET"))).json()}async Post(e,t){return await(await fetch(this.baseURL+e,this.RequestOptions("POST",t||{}))).json()}}const Bc=new CM({baseURL:D1.host});function MM(r,e){const t=r.findIndex(n=>n.sku===e.sku);return t!==-1?[e,...r.slice(0,t),...r.slice(t+1)]:r}class SM{constructor(){}async AuthServiceApi(e){const t=`/v1/widget/auth?api=${e}`,n=await Bc.Get(t);if(!n.access||!n.orgId)throw new Error("SPRIE key Not Authorised");return n}async FetchAssetBySKUOrBarcode(e){let t="/v1/widget/variants/";if(e.barcode)t+=`${e.barcode}`;else if(e.sku)t+=`${e.sku}`;else throw new Error("Need either sku or barcode.");return t+="?populate-customisation=true",await Bc.Get(t)}async FetchCustomisationList(){const e="/v1/widget/list-customisation?search=type:Lens,usage:customizer&limit=50",t=await Bc.Get(e),n=t.data.find(i=>i.sku==="lens-default");return{...t,data:MM(t.data,n)}}async DownloadMA(e){try{const t=`/v1/widget/org/${e.orgId}/asset/${e.assetsId}/universal-full-encrypted`,n=await Bc.Get(t),i=`org/${e.orgId}/asset/${e.assetsId}`;if(!n)throw new Error("Failed to download model asset.");return{asset:n,decryptionKey:i}}catch{throw new Error("Failed to download model asset.")}}}const Cp=new SM;class TM{constructor(e){kt(this,"prefix"),this.prefix=e}makeKey(e){return`${this.prefix}${e}`}getItem(e){return localStorage.getItem(this.makeKey(e))}setItem(e,t){return localStorage.setItem(this.makeKey(e),t)}}const bc=new TM(D1.storePrefix);class BM{constructor(){kt(this,"authPayload"),kt(this,"apiKey"),kt(this,"isAuthenticated"),this.isAuthenticated=!1,this.authPayload={}}async Init(e){try{return this.apiKey=e,await this.authenticate(),this.isAuthenticated=!0,!0}catch(t){return console.log(t),this.isAuthenticated=!1,!1}}scanApiKeyFromCurrentScriptTag(){const e=document.currentScript;if(!e)return;const t=e==null?void 0:e.getAttribute("src");if(!t)return;const n=new URLSearchParams(t.substring(t.indexOf("?")));this.apiKey=(n==null?void 0:n.get("apikey"))||(n==null?void 0:n.get("apiKey")),this.apiKey}async authenticate(){if(this.isAuthenticated)return;if(!this.apiKey)throw new Error("Spire: Unable to authenticate . Need APIKey.");const e=await Cp.AuthServiceApi(this.apiKey);this.setAuthConfig({EXPIRES:e.expires,JWT:e.access,ORGID:e.orgId})}setAuthConfig(e){e.JWT&&(bc.setItem("jwtToken",e.JWT),this.authPayload.JWT=e.JWT),e.EXPIRES&&(bc.setItem("expires",e.EXPIRES),this.authPayload.EXPIRES=e.EXPIRES),e.ORGID&&(bc.setItem("orgId",e.ORGID),this.authPayload.ORGID=e.ORGID)}LoadConfig(){const e=bc.getItem("jwtToken");e&&(this.authPayload.JWT=e);const t=bc.getItem("orgId");t&&(this.authPayload.ORGID=t);const n=localStorage.getItem("expires");return n&&(this.authPayload.EXPIRES=n),this.authPayload}}var mt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bM(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function RM(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var Mp={exports:{}},Go=typeof Reflect=="object"?Reflect:null,L1=Go&&typeof Go.apply=="function"?Go.apply:function(r,e,t){return Function.prototype.apply.call(r,e,t)},Th;Go&&typeof Go.ownKeys=="function"?Th=Go.ownKeys:Object.getOwnPropertySymbols?Th=function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:Th=function(r){return Object.getOwnPropertyNames(r)};function DM(r){console&&console.warn&&console.warn(r)}var N1=Number.isNaN||function(r){return r!==r};function Qt(){Qt.init.call(this)}Mp.exports=Qt,Mp.exports.once=PM,Qt.EventEmitter=Qt,Qt.prototype._events=void 0,Qt.prototype._eventsCount=0,Qt.prototype._maxListeners=void 0;var U1=10;function Bh(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(Qt,"defaultMaxListeners",{enumerable:!0,get:function(){return U1},set:function(r){if(typeof r!="number"||r<0||N1(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");U1=r}}),Qt.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Qt.prototype.setMaxListeners=function(r){if(typeof r!="number"||r<0||N1(r))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+r+".");return this._maxListeners=r,this};function P1(r){return r._maxListeners===void 0?Qt.defaultMaxListeners:r._maxListeners}Qt.prototype.getMaxListeners=function(){return P1(this)},Qt.prototype.emit=function(r){for(var e=[],t=1;t<arguments.length;t++)e.push(arguments[t]);var n=r==="error",i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var c=i[r];if(c===void 0)return!1;if(typeof c=="function")L1(c,this,e);else for(var h=c.length,u=z1(c,h),t=0;t<h;++t)L1(u[t],this,e);return!0};function k1(r,e,t,n){var i,s,o;if(Bh(t),s=r._events,s===void 0?(s=r._events=Object.create(null),r._eventsCount=0):(s.newListener!==void 0&&(r.emit("newListener",e,t.listener?t.listener:t),s=r._events),o=s[e]),o===void 0)o=s[e]=t,++r._eventsCount;else if(typeof o=="function"?o=s[e]=n?[t,o]:[o,t]:n?o.unshift(t):o.push(t),i=P1(r),i>0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=r,c.type=e,c.count=o.length,DM(c)}return r}Qt.prototype.addListener=function(r,e){return k1(this,r,e,!1)},Qt.prototype.on=Qt.prototype.addListener,Qt.prototype.prependListener=function(r,e){return k1(this,r,e,!0)};function LM(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Q1(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},i=LM.bind(n);return i.listener=t,n.wrapFn=i,i}Qt.prototype.once=function(r,e){return Bh(e),this.on(r,Q1(this,r,e)),this},Qt.prototype.prependOnceListener=function(r,e){return Bh(e),this.prependListener(r,Q1(this,r,e)),this},Qt.prototype.removeListener=function(r,e){var t,n,i,s,o;if(Bh(e),n=this._events,n===void 0)return this;if(t=n[r],t===void 0)return this;if(t===e||t.listener===e)--this._eventsCount===0?this._events=Object.create(null):(delete n[r],n.removeListener&&this.emit("removeListener",r,t.listener||e));else if(typeof t!="function"){for(i=-1,s=t.length-1;s>=0;s--)if(t[s]===e||t[s].listener===e){o=t[s].listener,i=s;break}if(i<0)return this;i===0?t.shift():NM(t,i),t.length===1&&(n[r]=t[0]),n.removeListener!==void 0&&this.emit("removeListener",r,o||e)}return this},Qt.prototype.off=Qt.prototype.removeListener,Qt.prototype.removeAllListeners=function(r){var e,t,n;if(t=this._events,t===void 0)return this;if(t.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):t[r]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete t[r]),this;if(arguments.length===0){var i=Object.keys(t),s;for(n=0;n<i.length;++n)s=i[n],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(e=t[r],typeof e=="function")this.removeListener(r,e);else if(e!==void 0)for(n=e.length-1;n>=0;n--)this.removeListener(r,e[n]);return this};function O1(r,e,t){var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?UM(i):z1(i,i.length)}Qt.prototype.listeners=function(r){return O1(this,r,!0)},Qt.prototype.rawListeners=function(r){return O1(this,r,!1)},Qt.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):F1.call(r,e)},Qt.prototype.listenerCount=F1;function F1(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}Qt.prototype.eventNames=function(){return this._eventsCount>0?Th(this._events):[]};function z1(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n];return t}function NM(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()}function UM(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}function PM(r,e){return new Promise(function(t,n){function i(o){r.removeListener(e,s),n(o)}function s(){typeof r.removeListener=="function"&&r.removeListener("error",i),t([].slice.call(arguments))}H1(r,e,s,{once:!0}),e!=="error"&&kM(r,i,{once:!0})})}function kM(r,e,t){typeof r.on=="function"&&H1(r,"error",e,t)}function H1(r,e,t,n){if(typeof r.on=="function")n.once?r.once(e,t):r.on(e,t);else if(typeof r.addEventListener=="function")r.addEventListener(e,function i(s){n.once&&r.removeEventListener(e,i),t(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r)}var QM=Mp.exports;const G1=class S1 extends QM.EventEmitter{emitEvent(e,t){Object.keys(S1.EVENTS).includes(e)&&this.emit(S1.EVENTS[e],t)}};kt(G1,"EVENTS",{onAddToCart:"add-to-cart"});let OM=G1;var V1={exports:{}};function FM(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var j1={exports:{}};const zM={},HM=Object.freeze(Object.defineProperty({__proto__:null,default:zM},Symbol.toStringTag,{value:"Module"})),GM=RM(HM);var W1;function wt(){return W1||(W1=1,function(r,e){(function(t,n){r.exports=n()})(mt,function(){var t=t||function(n,i){var s;if(typeof window<"u"&&window.crypto&&(s=window.crypto),typeof self<"u"&&self.crypto&&(s=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(s=globalThis.crypto),!s&&typeof window<"u"&&window.msCrypto&&(s=window.msCrypto),!s&&typeof mt<"u"&&mt.crypto&&(s=mt.crypto),!s&&typeof FM=="function")try{s=GM}catch{}var o=function(){if(s){if(typeof s.getRandomValues=="function")try{return s.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof s.randomBytes=="function")try{return s.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},c=Object.create||function(){function w(){}return function(x){var I;return w.prototype=x,I=new w,w.prototype=null,I}}(),h={},u=h.lib={},d=u.Base=function(){return{extend:function(w){var x=c(this);return w&&x.mixIn(w),(!x.hasOwnProperty("init")||this.init===x.init)&&(x.init=function(){x.$super.init.apply(this,arguments)}),x.init.prototype=x,x.$super=this,x},create:function(){var w=this.extend();return w.init.apply(w,arguments),w},init:function(){},mixIn:function(w){for(var x in w)w.hasOwnProperty(x)&&(this[x]=w[x]);w.hasOwnProperty("toString")&&(this.toString=w.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),A=u.WordArray=d.extend({init:function(w,x){w=this.words=w||[],x!=i?this.sigBytes=x:this.sigBytes=w.length*4},toString:function(w){return(w||g).stringify(this)},concat:function(w){var x=this.words,I=w.words,R=this.sigBytes,S=w.sigBytes;if(this.clamp(),R%4)for(var T=0;T<S;T++){var D=I[T>>>2]>>>24-T%4*8&255;x[R+T>>>2]|=D<<24-(R+T)%4*8}else for(var b=0;b<S;b+=4)x[R+b>>>2]=I[b>>>2];return this.sigBytes+=S,this},clamp:function(){var w=this.words,x=this.sigBytes;w[x>>>2]&=4294967295<<32-x%4*8,w.length=n.ceil(x/4)},clone:function(){var w=d.clone.call(this);return w.words=this.words.slice(0),w},random:function(w){for(var x=[],I=0;I<w;I+=4)x.push(o());return new A.init(x,w)}}),p=h.enc={},g=p.Hex={stringify:function(w){for(var x=w.words,I=w.sigBytes,R=[],S=0;S<I;S++){var T=x[S>>>2]>>>24-S%4*8&255;R.push((T>>>4).toString(16)),R.push((T&15).toString(16))}return R.join("")},parse:function(w){for(var x=w.length,I=[],R=0;R<x;R+=2)I[R>>>3]|=parseInt(w.substr(R,2),16)<<24-R%8*4;return new A.init(I,x/2)}},v=p.Latin1={stringify:function(w){for(var x=w.words,I=w.sigBytes,R=[],S=0;S<I;S++){var T=x[S>>>2]>>>24-S%4*8&255;R.push(String.fromCharCode(T))}return R.join("")},parse:function(w){for(var x=w.length,I=[],R=0;R<x;R++)I[R>>>2]|=(w.charCodeAt(R)&255)<<24-R%4*8;return new A.init(I,x)}},E=p.Utf8={stringify:function(w){try{return decodeURIComponent(escape(v.stringify(w)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(w){return v.parse(unescape(encodeURIComponent(w)))}},m=u.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new A.init,this._nDataBytes=0},_append:function(w){typeof w=="string"&&(w=E.parse(w)),this._data.concat(w),this._nDataBytes+=w.sigBytes},_process:function(w){var x,I=this._data,R=I.words,S=I.sigBytes,T=this.blockSize,D=T*4,b=S/D;w?b=n.ceil(b):b=n.max((b|0)-this._minBufferSize,0);var M=b*T,L=n.min(M*4,S);if(M){for(var P=0;P<M;P+=T)this._doProcessBlock(R,P);x=R.splice(0,M),I.sigBytes-=L}return new A.init(x,L)},clone:function(){var w=d.clone.call(this);return w._data=this._data.clone(),w},_minBufferSize:0});u.Hasher=m.extend({cfg:d.extend(),init:function(w){this.cfg=this.cfg.extend(w),this.reset()},reset:function(){m.reset.call(this),this._doReset()},update:function(w){return this._append(w),this._process(),this},finalize:function(w){w&&this._append(w);var x=this._doFinalize();return x},blockSize:16,_createHelper:function(w){return function(x,I){return new w.init(I).finalize(x)}},_createHmacHelper:function(w){return function(x,I){return new _.HMAC.init(w,I).finalize(x)}}});var _=h.algo={};return h}(Math);return t})}(j1)),j1.exports}var Y1={exports:{}},q1;function bh(){return q1||(q1=1,function(r,e){(function(t,n){r.exports=n(wt())})(mt,function(t){return function(n){var i=t,s=i.lib,o=s.Base,c=s.WordArray,h=i.x64={};h.Word=o.extend({init:function(u,d){this.high=u,this.low=d}}),h.WordArray=o.extend({init:function(u,d){u=this.words=u||[],d!=n?this.sigBytes=d:this.sigBytes=u.length*8},toX32:function(){for(var u=this.words,d=u.length,A=[],p=0;p<d;p++){var g=u[p];A.push(g.high),A.push(g.low)}return c.create(A,this.sigBytes)},clone:function(){for(var u=o.clone.call(this),d=u.words=this.words.slice(0),A=d.length,p=0;p<A;p++)d[p]=d[p].clone();return u}})}(),t})}(Y1)),Y1.exports}var X1={exports:{}},K1;function VM(){return K1||(K1=1,function(r,e){(function(t,n){r.exports=n(wt())})(mt,function(t){return function(){if(typeof ArrayBuffer=="function"){var n=t,i=n.lib,s=i.WordArray,o=s.init,c=s.init=function(h){if(h instanceof ArrayBuffer&&(h=new Uint8Array(h)),(h instanceof Int8Array||typeof Uint8ClampedArray<"u"&&h instanceof Uint8ClampedArray||h instanceof Int16Array||h instanceof Uint16Array||h instanceof Int32Array||h instanceof Uint32Array||h instanceof Float32Array||h instanceof Float64Array)&&(h=new Uint8Array(h.buffer,h.byteOffset,h.byteLength)),h instanceof Uint8Array){for(var u=h.byteLength,d=[],A=0;A<u;A++)d[A>>>2]|=h[A]<<24-A%4*8;o.call(this,d,u)}else o.apply(this,arguments)};c.prototype=s}}(),t.lib.WordArray})}(X1)),X1.exports}var J1={exports:{}},Z1;function jM(){return Z1||(Z1=1,function(r,e){(function(t,n){r.exports=n(wt())})(mt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.enc;o.Utf16=o.Utf16BE={stringify:function(h){for(var u=h.words,d=h.sigBytes,A=[],p=0;p<d;p+=2){var g=u[p>>>2]>>>16-p%4*8&65535;A.push(String.fromCharCode(g))}return A.join("")},parse:function(h){for(var u=h.length,d=[],A=0;A<u;A++)d[A>>>1]|=h.charCodeAt(A)<<16-A%2*16;return s.create(d,u*2)}},o.Utf16LE={stringify:function(h){for(var u=h.words,d=h.sigBytes,A=[],p=0;p<d;p+=2){var g=c(u[p>>>2]>>>16-p%4*8&65535);A.push(String.fromCharCode(g))}return A.join("")},parse:function(h){for(var u=h.length,d=[],A=0;A<u;A++)d[A>>>1]|=c(h.charCodeAt(A)<<16-A%2*16);return s.create(d,u*2)}};function c(h){return h<<8&4278255360|h>>>8&16711935}}(),t.enc.Utf16})}(J1)),J1.exports}var $1={exports:{}},e_;function ja(){return e_||(e_=1,function(r,e){(function(t,n){r.exports=n(wt())})(mt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.enc;o.Base64={stringify:function(h){var u=h.words,d=h.sigBytes,A=this._map;h.clamp();for(var p=[],g=0;g<d;g+=3)for(var v=u[g>>>2]>>>24-g%4*8&255,E=u[g+1>>>2]>>>24-(g+1)%4*8&255,m=u[g+2>>>2]>>>24-(g+2)%4*8&255,_=v<<16|E<<8|m,w=0;w<4&&g+w*.75<d;w++)p.push(A.charAt(_>>>6*(3-w)&63));var x=A.charAt(64);if(x)for(;p.length%4;)p.push(x);return p.join("")},parse:function(h){var u=h.length,d=this._map,A=this._reverseMap;if(!A){A=this._reverseMap=[];for(var p=0;p<d.length;p++)A[d.charCodeAt(p)]=p}var g=d.charAt(64);if(g){var v=h.indexOf(g);v!==-1&&(u=v)}return c(h,u,A)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function c(h,u,d){for(var A=[],p=0,g=0;g<u;g++)if(g%4){var v=d[h.charCodeAt(g-1)]<<g%4*2,E=d[h.charCodeAt(g)]>>>6-g%4*2,m=v|E;A[p>>>2]|=m<<24-p%4*8,p++}return s.create(A,p)}}(),t.enc.Base64})}($1)),$1.exports}var t_={exports:{}},r_;function WM(){return r_||(r_=1,function(r,e){(function(t,n){r.exports=n(wt())})(mt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.enc;o.Base64url={stringify:function(h,u){u===void 0&&(u=!0);var d=h.words,A=h.sigBytes,p=u?this._safe_map:this._map;h.clamp();for(var g=[],v=0;v<A;v+=3)for(var E=d[v>>>2]>>>24-v%4*8&255,m=d[v+1>>>2]>>>24-(v+1)%4*8&255,_=d[v+2>>>2]>>>24-(v+2)%4*8&255,w=E<<16|m<<8|_,x=0;x<4&&v+x*.75<A;x++)g.push(p.charAt(w>>>6*(3-x)&63));var I=p.charAt(64);if(I)for(;g.length%4;)g.push(I);return g.join("")},parse:function(h,u){u===void 0&&(u=!0);var d=h.length,A=u?this._safe_map:this._map,p=this._reverseMap;if(!p){p=this._reverseMap=[];for(var g=0;g<A.length;g++)p[A.charCodeAt(g)]=g}var v=A.charAt(64);if(v){var E=h.indexOf(v);E!==-1&&(d=E)}return c(h,d,p)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function c(h,u,d){for(var A=[],p=0,g=0;g<u;g++)if(g%4){var v=d[h.charCodeAt(g-1)]<<g%4*2,E=d[h.charCodeAt(g)]>>>6-g%4*2,m=v|E;A[p>>>2]|=m<<24-p%4*8,p++}return s.create(A,p)}}(),t.enc.Base64url})}(t_)),t_.exports}var n_={exports:{}},i_;function Wa(){return i_||(i_=1,function(r,e){(function(t,n){r.exports=n(wt())})(mt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,c=s.Hasher,h=i.algo,u=[];(function(){for(var E=0;E<64;E++)u[E]=n.abs(n.sin(E+1))*4294967296|0})();var d=h.MD5=c.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(E,m){for(var _=0;_<16;_++){var w=m+_,x=E[w];E[w]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}var I=this._hash.words,R=E[m+0],S=E[m+1],T=E[m+2],D=E[m+3],b=E[m+4],M=E[m+5],L=E[m+6],P=E[m+7],N=E[m+8],j=E[m+9],X=E[m+10],K=E[m+11],ne=E[m+12],V=E[m+13],te=E[m+14],Q=E[m+15],z=I[0],Z=I[1],re=I[2],H=I[3];z=A(z,Z,re,H,R,7,u[0]),H=A(H,z,Z,re,S,12,u[1]),re=A(re,H,z,Z,T,17,u[2]),Z=A(Z,re,H,z,D,22,u[3]),z=A(z,Z,re,H,b,7,u[4]),H=A(H,z,Z,re,M,12,u[5]),re=A(re,H,z,Z,L,17,u[6]),Z=A(Z,re,H,z,P,22,u[7]),z=A(z,Z,re,H,N,7,u[8]),H=A(H,z,Z,re,j,12,u[9]),re=A(re,H,z,Z,X,17,u[10]),Z=A(Z,re,H,z,K,22,u[11]),z=A(z,Z,re,H,ne,7,u[12]),H=A(H,z,Z,re,V,12,u[13]),re=A(re,H,z,Z,te,17,u[14]),Z=A(Z,re,H,z,Q,22,u[15]),z=p(z,Z,re,H,S,5,u[16]),H=p(H,z,Z,re,L,9,u[17]),re=p(re,H,z,Z,K,14,u[18]),Z=p(Z,re,H,z,R,20,u[19]),z=p(z,Z,re,H,M,5,u[20]),H=p(H,z,Z,re,X,9,u[21]),re=p(re,H,z,Z,Q,14,u[22]),Z=p(Z,re,H,z,b,20,u[23]),z=p(z,Z,re,H,j,5,u[24]),H=p(H,z,Z,re,te,9,u[25]),re=p(re,H,z,Z,D,14,u[26]),Z=p(Z,re,H,z,N,20,u[27]),z=p(z,Z,re,H,V,5,u[28]),H=p(H,z,Z,re,T,9,u[29]),re=p(re,H,z,Z,P,14,u[30]),Z=p(Z,re,H,z,ne,20,u[31]),z=g(z,Z,re,H,M,4,u[32]),H=g(H,z,Z,re,N,11,u[33]),re=g(re,H,z,Z,K,16,u[34]),Z=g(Z,re,H,z,te,23,u[35]),z=g(z,Z,re,H,S,4,u[36]),H=g(H,z,Z,re,b,11,u[37]),re=g(re,H,z,Z,P,16,u[38]),Z=g(Z,re,H,z,X,23,u[39]),z=g(z,Z,re,H,V,4,u[40]),H=g(H,z,Z,re,R,11,u[41]),re=g(re,H,z,Z,D,16,u[42]),Z=g(Z,re,H,z,L,23,u[43]),z=g(z,Z,re,H,j,4,u[44]),H=g(H,z,Z,re,ne,11,u[45]),re=g(re,H,z,Z,Q,16,u[46]),Z=g(Z,re,H,z,T,23,u[47]),z=v(z,Z,re,H,R,6,u[48]),H=v(H,z,Z,re,P,10,u[49]),re=v(re,H,z,Z,te,15,u[50]),Z=v(Z,re,H,z,M,21,u[51]),z=v(z,Z,re,H,ne,6,u[52]),H=v(H,z,Z,re,D,10,u[53]),re=v(re,H,z,Z,X,15,u[54]),Z=v(Z,re,H,z,S,21,u[55]),z=v(z,Z,re,H,N,6,u[56]),H=v(H,z,Z,re,Q,10,u[57]),re=v(re,H,z,Z,L,15,u[58]),Z=v(Z,re,H,z,V,21,u[59]),z=v(z,Z,re,H,b,6,u[60]),H=v(H,z,Z,re,K,10,u[61]),re=v(re,H,z,Z,T,15,u[62]),Z=v(Z,re,H,z,j,21,u[63]),I[0]=I[0]+z|0,I[1]=I[1]+Z|0,I[2]=I[2]+re|0,I[3]=I[3]+H|0},_doFinalize:function(){var E=this._data,m=E.words,_=this._nDataBytes*8,w=E.sigBytes*8;m[w>>>5]|=128<<24-w%32;var x=n.floor(_/4294967296),I=_;m[(w+64>>>9<<4)+15]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,m[(w+64>>>9<<4)+14]=(I<<8|I>>>24)&16711935|(I<<24|I>>>8)&4278255360,E.sigBytes=(m.length+1)*4,this._process();for(var R=this._hash,S=R.words,T=0;T<4;T++){var D=S[T];S[T]=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360}return R},clone:function(){var E=c.clone.call(this);return E._hash=this._hash.clone(),E}});function A(E,m,_,w,x,I,R){var S=E+(m&_|~m&w)+x+R;return(S<<I|S>>>32-I)+m}function p(E,m,_,w,x,I,R){var S=E+(m&w|_&~w)+x+R;return(S<<I|S>>>32-I)+m}function g(E,m,_,w,x,I,R){var S=E+(m^_^w)+x+R;return(S<<I|S>>>32-I)+m}function v(E,m,_,w,x,I,R){var S=E+(_^(m|~w))+x+R;return(S<<I|S>>>32-I)+m}i.MD5=c._createHelper(d),i.HmacMD5=c._createHmacHelper(d)}(Math),t.MD5})}(n_)),n_.exports}var s_={exports:{}},a_;function o_(){return a_||(a_=1,function(r,e){(function(t,n){r.exports=n(wt())})(mt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=i.Hasher,c=n.algo,h=[],u=c.SHA1=o.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(d,A){for(var p=this._hash.words,g=p[0],v=p[1],E=p[2],m=p[3],_=p[4],w=0;w<80;w++){if(w<16)h[w]=d[A+w]|0;else{var x=h[w-3]^h[w-8]^h[w-14]^h[w-16];h[w]=x<<1|x>>>31}var I=(g<<5|g>>>27)+_+h[w];w<20?I+=(v&E|~v&m)+1518500249:w<40?I+=(v^E^m)+1859775393:w<60?I+=(v&E|v&m|E&m)-1894007588:I+=(v^E^m)-899497514,_=m,m=E,E=v<<30|v>>>2,v=g,g=I}p[0]=p[0]+g|0,p[1]=p[1]+v|0,p[2]=p[2]+E|0,p[3]=p[3]+m|0,p[4]=p[4]+_|0},_doFinalize:function(){var d=this._data,A=d.words,p=this._nDataBytes*8,g=d.sigBytes*8;return A[g>>>5]|=128<<24-g%32,A[(g+64>>>9<<4)+14]=Math.floor(p/4294967296),A[(g+64>>>9<<4)+15]=p,d.sigBytes=A.length*4,this._process(),this._hash},clone:function(){var d=o.clone.call(this);return d._hash=this._hash.clone(),d}});n.SHA1=o._createHelper(u),n.HmacSHA1=o._createHmacHelper(u)}(),t.SHA1})}(s_)),s_.exports}var l_={exports:{}},c_;function Sp(){return c_||(c_=1,function(r,e){(function(t,n){r.exports=n(wt())})(mt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,c=s.Hasher,h=i.algo,u=[],d=[];(function(){function g(_){for(var w=n.sqrt(_),x=2;x<=w;x++)if(!(_%x))return!1;return!0}function v(_){return(_-(_|0))*4294967296|0}for(var E=2,m=0;m<64;)g(E)&&(m<8&&(u[m]=v(n.pow(E,1/2))),d[m]=v(n.pow(E,1/3)),m++),E++})();var A=[],p=h.SHA256=c.extend({_doReset:function(){this._hash=new o.init(u.slice(0))},_doProcessBlock:function(g,v){for(var E=this._hash.words,m=E[0],_=E[1],w=E[2],x=E[3],I=E[4],R=E[5],S=E[6],T=E[7],D=0;D<64;D++){if(D<16)A[D]=g[v+D]|0;else{var b=A[D-15],M=(b<<25|b>>>7)^(b<<14|b>>>18)^b>>>3,L=A[D-2],P=(L<<15|L>>>17)^(L<<13|L>>>19)^L>>>10;A[D]=M+A[D-7]+P+A[D-16]}var N=I&R^~I&S,j=m&_^m&w^_&w,X=(m<<30|m>>>2)^(m<<19|m>>>13)^(m<<10|m>>>22),K=(I<<26|I>>>6)^(I<<21|I>>>11)^(I<<7|I>>>25),ne=T+K+N+d[D]+A[D],V=X+j;T=S,S=R,R=I,I=x+ne|0,x=w,w=_,_=m,m=ne+V|0}E[0]=E[0]+m|0,E[1]=E[1]+_|0,E[2]=E[2]+w|0,E[3]=E[3]+x|0,E[4]=E[4]+I|0,E[5]=E[5]+R|0,E[6]=E[6]+S|0,E[7]=E[7]+T|0},_doFinalize:function(){var g=this._data,v=g.words,E=this._nDataBytes*8,m=g.sigBytes*8;return v[m>>>5]|=128<<24-m%32,v[(m+64>>>9<<4)+14]=n.floor(E/4294967296),v[(m+64>>>9<<4)+15]=E,g.sigBytes=v.length*4,this._process(),this._hash},clone:function(){var g=c.clone.call(this);return g._hash=this._hash.clone(),g}});i.SHA256=c._createHelper(p),i.HmacSHA256=c._createHmacHelper(p)}(Math),t.SHA256})}(l_)),l_.exports}var u_={exports:{}},h_;function YM(){return h_||(h_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Sp())})(mt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.algo,c=o.SHA256,h=o.SHA224=c.extend({_doReset:function(){this._hash=new s.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var u=c._doFinalize.call(this);return u.sigBytes-=4,u}});n.SHA224=c._createHelper(h),n.HmacSHA224=c._createHmacHelper(h)}(),t.SHA224})}(u_)),u_.exports}var d_={exports:{}},f_;function p_(){return f_||(f_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),bh())})(mt,function(t){return function(){var n=t,i=n.lib,s=i.Hasher,o=n.x64,c=o.Word,h=o.WordArray,u=n.algo;function d(){return c.create.apply(c,arguments)}var A=[d(1116352408,3609767458),d(1899447441,602891725),d(3049323471,3964484399),d(3921009573,2173295548),d(961987163,4081628472),d(1508970993,3053834265),d(2453635748,2937671579),d(2870763221,3664609560),d(3624381080,2734883394),d(310598401,1164996542),d(607225278,1323610764),d(1426881987,3590304994),d(1925078388,4068182383),d(2162078206,991336113),d(2614888103,633803317),d(3248222580,3479774868),d(3835390401,2666613458),d(4022224774,944711139),d(264347078,2341262773),d(604807628,2007800933),d(770255983,1495990901),d(1249150122,1856431235),d(1555081692,3175218132),d(1996064986,2198950837),d(2554220882,3999719339),d(2821834349,766784016),d(2952996808,2566594879),d(3210313671,3203337956),d(3336571891,1034457026),d(3584528711,2466948901),d(113926993,3758326383),d(338241895,168717936),d(666307205,1188179964),d(773529912,1546045734),d(1294757372,1522805485),d(1396182291,2643833823),d(1695183700,2343527390),d(1986661051,1014477480),d(2177026350,1206759142),d(2456956037,344077627),d(2730485921,1290863460),d(2820302411,3158454273),d(3259730800,3505952657),d(3345764771,106217008),d(3516065817,3606008344),d(3600352804,1432725776),d(4094571909,1467031594),d(275423344,851169720),d(430227734,3100823752),d(506948616,1363258195),d(659060556,3750685593),d(883997877,3785050280),d(958139571,3318307427),d(1322822218,3812723403),d(1537002063,2003034995),d(1747873779,3602036899),d(1955562222,1575990012),d(2024104815,1125592928),d(2227730452,2716904306),d(2361852424,442776044),d(2428436474,593698344),d(2756734187,3733110249),d(3204031479,2999351573),d(3329325298,3815920427),d(3391569614,3928383900),d(3515267271,566280711),d(3940187606,3454069534),d(4118630271,4000239992),d(116418474,1914138554),d(174292421,2731055270),d(289380356,3203993006),d(460393269,320620315),d(685471733,587496836),d(852142971,1086792851),d(1017036298,365543100),d(1126000580,2618297676),d(1288033470,3409855158),d(1501505948,4234509866),d(1607167915,987167468),d(1816402316,1246189591)],p=[];(function(){for(var v=0;v<80;v++)p[v]=d()})();var g=u.SHA512=s.extend({_doReset:function(){this._hash=new h.init([new c.init(1779033703,4089235720),new c.init(3144134277,2227873595),new c.init(1013904242,4271175723),new c.init(2773480762,1595750129),new c.init(1359893119,2917565137),new c.init(2600822924,725511199),new c.init(528734635,4215389547),new c.init(1541459225,327033209)])},_doProcessBlock:function(v,E){for(var m=this._hash.words,_=m[0],w=m[1],x=m[2],I=m[3],R=m[4],S=m[5],T=m[6],D=m[7],b=_.high,M=_.low,L=w.high,P=w.low,N=x.high,j=x.low,X=I.high,K=I.low,ne=R.high,V=R.low,te=S.high,Q=S.low,z=T.high,Z=T.low,re=D.high,H=D.low,fe=b,Ae=M,ve=L,ye=P,Oe=N,it=j,ae=X,rt=K,Pe=ne,lt=V,Ye=te,ct=Q,Y=z,k=Z,ee=re,ue=H,pe=0;pe<80;pe++){var ge,Ue,Ee=p[pe];if(pe<16)Ue=Ee.high=v[E+pe*2]|0,ge=Ee.low=v[E+pe*2+1]|0;else{var Qe=p[pe-15],He=Qe.high,Ce=Qe.low,Se=(He>>>1|Ce<<31)^(He>>>8|Ce<<24)^He>>>7,Ze=(Ce>>>1|He<<31)^(Ce>>>8|He<<24)^(Ce>>>7|He<<25),Ne=p[pe-2],Re=Ne.high,at=Ne.low,ft=(Re>>>19|at<<13)^(Re<<3|at>>>29)^Re>>>6,yt=(at>>>19|Re<<13)^(at<<3|Re>>>29)^(at>>>6|Re<<26),_t=p[pe-7],Et=_t.high,G=_t.low,O=p[pe-16],me=O.high,_e=O.low;ge=Ze+G,Ue=Se+Et+(ge>>>0<Ze>>>0?1:0),ge=ge+yt,Ue=Ue+ft+(ge>>>0<yt>>>0?1:0),ge=ge+_e,Ue=Ue+me+(ge>>>0<_e>>>0?1:0),Ee.high=Ue,Ee.low=ge}var Fe=Pe&Ye^~Pe&Y,De=lt&ct^~lt&k,pt=fe&ve^fe&Oe^ve&Oe,Dt=Ae&ye^Ae&it^ye&it,Lt=(fe>>>28|Ae<<4)^(fe<<30|Ae>>>2)^(fe<<25|Ae>>>7),St=(Ae>>>28|fe<<4)^(Ae<<30|fe>>>2)^(Ae<<25|fe>>>7),At=(Pe>>>14|lt<<18)^(Pe>>>18|lt<<14)^(Pe<<23|lt>>>9),ur=(lt>>>14|Pe<<18)^(lt>>>18|Pe<<14)^(lt<<23|Pe>>>9),Vt=A[pe],mr=Vt.high,Bn=Vt.low,qt=ue+ur,ui=ee+At+(qt>>>0<ue>>>0?1:0),qt=qt+De,ui=ui+Fe+(qt>>>0<De>>>0?1:0),qt=qt+Bn,ui=ui+mr+(qt>>>0<Bn>>>0?1:0),qt=qt+ge,ui=ui+Ue+(qt>>>0<ge>>>0?1:0),Kn=St+Dt,Ls=Lt+pt+(Kn>>>0<St>>>0?1:0);ee=Y,ue=k,Y=Ye,k=ct,Ye=Pe,ct=lt,lt=rt+qt|0,Pe=ae+ui+(lt>>>0<rt>>>0?1:0)|0,ae=Oe,rt=it,Oe=ve,it=ye,ve=fe,ye=Ae,Ae=qt+Kn|0,fe=ui+Ls+(Ae>>>0<qt>>>0?1:0)|0}M=_.low=M+Ae,_.high=b+fe+(M>>>0<Ae>>>0?1:0),P=w.low=P+ye,w.high=L+ve+(P>>>0<ye>>>0?1:0),j=x.low=j+it,x.high=N+Oe+(j>>>0<it>>>0?1:0),K=I.low=K+rt,I.high=X+ae+(K>>>0<rt>>>0?1:0),V=R.low=V+lt,R.high=ne+Pe+(V>>>0<lt>>>0?1:0),Q=S.low=Q+ct,S.high=te+Ye+(Q>>>0<ct>>>0?1:0),Z=T.low=Z+k,T.high=z+Y+(Z>>>0<k>>>0?1:0),H=D.low=H+ue,D.high=re+ee+(H>>>0<ue>>>0?1:0)},_doFinalize:function(){var v=this._data,E=v.words,m=this._nDataBytes*8,_=v.sigBytes*8;E[_>>>5]|=128<<24-_%32,E[(_+128>>>10<<5)+30]=Math.floor(m/4294967296),E[(_+128>>>10<<5)+31]=m,v.sigBytes=E.length*4,this._process();var w=this._hash.toX32();return w},clone:function(){var v=s.clone.call(this);return v._hash=this._hash.clone(),v},blockSize:1024/32});n.SHA512=s._createHelper(g),n.HmacSHA512=s._createHmacHelper(g)}(),t.SHA512})}(d_)),d_.exports}var A_={exports:{}},g_;function qM(){return g_||(g_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),bh(),p_())})(mt,function(t){return function(){var n=t,i=n.x64,s=i.Word,o=i.WordArray,c=n.algo,h=c.SHA512,u=c.SHA384=h.extend({_doReset:function(){this._hash=new o.init([new s.init(3418070365,3238371032),new s.init(1654270250,914150663),new s.init(2438529370,812702999),new s.init(355462360,4144912697),new s.init(1731405415,4290775857),new s.init(2394180231,1750603025),new s.init(3675008525,1694076839),new s.init(1203062813,3204075428)])},_doFinalize:function(){var d=h._doFinalize.call(this);return d.sigBytes-=16,d}});n.SHA384=h._createHelper(u),n.HmacSHA384=h._createHmacHelper(u)}(),t.SHA384})}(A_)),A_.exports}var m_={exports:{}},__;function XM(){return __||(__=1,function(r,e){(function(t,n,i){r.exports=n(wt(),bh())})(mt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,c=s.Hasher,h=i.x64,u=h.Word,d=i.algo,A=[],p=[],g=[];(function(){for(var m=1,_=0,w=0;w<24;w++){A[m+5*_]=(w+1)*(w+2)/2%64;var x=_%5,I=(2*m+3*_)%5;m=x,_=I}for(var m=0;m<5;m++)for(var _=0;_<5;_++)p[m+5*_]=_+(2*m+3*_)%5*5;for(var R=1,S=0;S<24;S++){for(var T=0,D=0,b=0;b<7;b++){if(R&1){var M=(1<<b)-1;M<32?D^=1<<M:T^=1<<M-32}R&128?R=R<<1^113:R<<=1}g[S]=u.create(T,D)}})();var v=[];(function(){for(var m=0;m<25;m++)v[m]=u.create()})();var E=d.SHA3=c.extend({cfg:c.cfg.extend({outputLength:512}),_doReset:function(){for(var m=this._state=[],_=0;_<25;_++)m[_]=new u.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(m,_){for(var w=this._state,x=this.blockSize/2,I=0;I<x;I++){var R=m[_+2*I],S=m[_+2*I+1];R=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360,S=(S<<8|S>>>24)&16711935|(S<<24|S>>>8)&4278255360;var T=w[I];T.high^=S,T.low^=R}for(var D=0;D<24;D++){for(var b=0;b<5;b++){for(var M=0,L=0,P=0;P<5;P++){var T=w[b+5*P];M^=T.high,L^=T.low}var N=v[b];N.high=M,N.low=L}for(var b=0;b<5;b++)for(var j=v[(b+4)%5],X=v[(b+1)%5],K=X.high,ne=X.low,M=j.high^(K<<1|ne>>>31),L=j.low^(ne<<1|K>>>31),P=0;P<5;P++){var T=w[b+5*P];T.high^=M,T.low^=L}for(var V=1;V<25;V++){var M,L,T=w[V],te=T.high,Q=T.low,z=A[V];z<32?(M=te<<z|Q>>>32-z,L=Q<<z|te>>>32-z):(M=Q<<z-32|te>>>64-z,L=te<<z-32|Q>>>64-z);var Z=v[p[V]];Z.high=M,Z.low=L}var re=v[0],H=w[0];re.high=H.high,re.low=H.low;for(var b=0;b<5;b++)for(var P=0;P<5;P++){var V=b+5*P,T=w[V],fe=v[V],Ae=v[(b+1)%5+5*P],ve=v[(b+2)%5+5*P];T.high=fe.high^~Ae.high&ve.high,T.low=fe.low^~Ae.low&ve.low}var T=w[0],ye=g[D];T.high^=ye.high,T.low^=ye.low}},_doFinalize:function(){var m=this._data,_=m.words;this._nDataBytes*8;var w=m.sigBytes*8,x=this.blockSize*32;_[w>>>5]|=1<<24-w%32,_[(n.ceil((w+1)/x)*x>>>5)-1]|=128,m.sigBytes=_.length*4,this._process();for(var I=this._state,R=this.cfg.outputLength/8,S=R/8,T=[],D=0;D<S;D++){var b=I[D],M=b.high,L=b.low;M=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360,L=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360,T.push(L),T.push(M)}return new o.init(T,R)},clone:function(){for(var m=c.clone.call(this),_=m._state=this._state.slice(0),w=0;w<25;w++)_[w]=_[w].clone();return m}});i.SHA3=c._createHelper(E),i.HmacSHA3=c._createHmacHelper(E)}(Math),t.SHA3})}(m_)),m_.exports}var v_={exports:{}},y_;function KM(){return y_||(y_=1,function(r,e){(function(t,n){r.exports=n(wt())})(mt,function(t){/** @preserve
20
20
  (c) 2012 by Cédric Mesnil. All rights reserved.
21
21
 
22
22
  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
@@ -29,11 +29,11 @@ var IQ=Object.defineProperty;var CQ=(Va,os,ls)=>os in Va?IQ(Va,os,{enumerable:!0
29
29
  * Counter block mode compatible with Dr Brian Gladman fileenc.c
30
30
  * derived from CryptoJS.mode.CTR
31
31
  * Jan Hruby jhruby.web@gmail.com
32
- */return t.mode.CTRGladman=function(){var n=t.lib.BlockCipherMode.extend();function i(c){if((c>>24&255)===255){var h=c>>16&255,u=c>>8&255,d=c&255;h===255?(h=0,u===255?(u=0,d===255?d=0:++d):++u):++h,c=0,c+=h<<16,c+=u<<8,c+=d}else c+=1<<24;return c}function s(c){return(c[0]=i(c[0]))===0&&(c[1]=i(c[1])),c}var o=n.Encryptor=n.extend({processBlock:function(c,h){var u=this._cipher,d=u.blockSize,A=this._iv,p=this._counter;A&&(p=this._counter=A.slice(0),this._iv=void 0),s(p);var g=p.slice(0);u.encryptBlock(g,0);for(var v=0;v<d;v++)c[h+v]^=g[v]}});return n.Decryptor=o,n}(),t.mode.CTRGladman})}(L_)),L_.exports}var U_={exports:{}},P_;function tS(){return P_||(P_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Nr())})(mt,function(t){return t.mode.OFB=function(){var n=t.lib.BlockCipherMode.extend(),i=n.Encryptor=n.extend({processBlock:function(s,o){var c=this._cipher,h=c.blockSize,u=this._iv,d=this._keystream;u&&(d=this._keystream=u.slice(0),this._iv=void 0),c.encryptBlock(d,0);for(var A=0;A<h;A++)s[o+A]^=d[A]}});return n.Decryptor=i,n}(),t.mode.OFB})}(U_)),U_.exports}var k_={exports:{}},Q_;function rS(){return Q_||(Q_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Nr())})(mt,function(t){return t.mode.ECB=function(){var n=t.lib.BlockCipherMode.extend();return n.Encryptor=n.extend({processBlock:function(i,s){this._cipher.encryptBlock(i,s)}}),n.Decryptor=n.extend({processBlock:function(i,s){this._cipher.decryptBlock(i,s)}}),n}(),t.mode.ECB})}(k_)),k_.exports}var O_={exports:{}},F_;function nS(){return F_||(F_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Nr())})(mt,function(t){return t.pad.AnsiX923={pad:function(n,i){var s=n.sigBytes,o=i*4,c=o-s%o,h=s+c-1;n.clamp(),n.words[h>>>2]|=c<<24-h%4*8,n.sigBytes+=c},unpad:function(n){var i=n.words[n.sigBytes-1>>>2]&255;n.sigBytes-=i}},t.pad.Ansix923})}(O_)),O_.exports}var z_={exports:{}},H_;function iS(){return H_||(H_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Nr())})(mt,function(t){return t.pad.Iso10126={pad:function(n,i){var s=i*4,o=s-n.sigBytes%s;n.concat(t.lib.WordArray.random(o-1)).concat(t.lib.WordArray.create([o<<24],1))},unpad:function(n){var i=n.words[n.sigBytes-1>>>2]&255;n.sigBytes-=i}},t.pad.Iso10126})}(z_)),z_.exports}var G_={exports:{}},V_;function sS(){return V_||(V_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Nr())})(mt,function(t){return t.pad.Iso97971={pad:function(n,i){n.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(n,i)},unpad:function(n){t.pad.ZeroPadding.unpad(n),n.sigBytes--}},t.pad.Iso97971})}(G_)),G_.exports}var j_={exports:{}},W_;function aS(){return W_||(W_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Nr())})(mt,function(t){return t.pad.ZeroPadding={pad:function(n,i){var s=i*4;n.clamp(),n.sigBytes+=s-(n.sigBytes%s||s)},unpad:function(n){for(var i=n.words,s=n.sigBytes-1,s=n.sigBytes-1;s>=0;s--)if(i[s>>>2]>>>24-s%4*8&255){n.sigBytes=s+1;break}}},t.pad.ZeroPadding})}(j_)),j_.exports}var Y_={exports:{}},q_;function oS(){return q_||(q_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Nr())})(mt,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})}(Y_)),Y_.exports}var X_={exports:{}},K_;function lS(){return K_||(K_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Nr())})(mt,function(t){return function(n){var i=t,s=i.lib,o=s.CipherParams,c=i.enc,h=c.Hex,u=i.format;u.Hex={stringify:function(d){return d.ciphertext.toString(h)},parse:function(d){var A=h.parse(d);return o.create({ciphertext:A})}}}(),t.format.Hex})}(X_)),X_.exports}var J_={exports:{}},Z_;function cS(){return Z_||(Z_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),ja(),Wa(),js(),Nr())})(mt,function(t){return function(){var n=t,i=n.lib,s=i.BlockCipher,o=n.algo,c=[],h=[],u=[],d=[],A=[],p=[],g=[],v=[],E=[],m=[];(function(){for(var x=[],I=0;I<256;I++)I<128?x[I]=I<<1:x[I]=I<<1^283;for(var R=0,S=0,I=0;I<256;I++){var T=S^S<<1^S<<2^S<<3^S<<4;T=T>>>8^T&255^99,c[R]=T,h[T]=R;var D=x[R],b=x[D],M=x[b],L=x[T]*257^T*16843008;u[R]=L<<24|L>>>8,d[R]=L<<16|L>>>16,A[R]=L<<8|L>>>24,p[R]=L;var L=M*16843009^b*65537^D*257^R*16843008;g[T]=L<<24|L>>>8,v[T]=L<<16|L>>>16,E[T]=L<<8|L>>>24,m[T]=L,R?(R=D^x[x[x[M^D]]],S^=x[x[S]]):R=S=1}})();var _=[0,1,2,4,8,16,32,64,128,27,54],w=o.AES=s.extend({_doReset:function(){var x;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var I=this._keyPriorReset=this._key,R=I.words,S=I.sigBytes/4,T=this._nRounds=S+6,D=(T+1)*4,b=this._keySchedule=[],M=0;M<D;M++)M<S?b[M]=R[M]:(x=b[M-1],M%S?S>6&&M%S==4&&(x=c[x>>>24]<<24|c[x>>>16&255]<<16|c[x>>>8&255]<<8|c[x&255]):(x=x<<8|x>>>24,x=c[x>>>24]<<24|c[x>>>16&255]<<16|c[x>>>8&255]<<8|c[x&255],x^=_[M/S|0]<<24),b[M]=b[M-S]^x);for(var L=this._invKeySchedule=[],P=0;P<D;P++){var M=D-P;if(P%4)var x=b[M];else var x=b[M-4];P<4||M<=4?L[P]=x:L[P]=g[c[x>>>24]]^v[c[x>>>16&255]]^E[c[x>>>8&255]]^m[c[x&255]]}}},encryptBlock:function(x,I){this._doCryptBlock(x,I,this._keySchedule,u,d,A,p,c)},decryptBlock:function(x,I){var R=x[I+1];x[I+1]=x[I+3],x[I+3]=R,this._doCryptBlock(x,I,this._invKeySchedule,g,v,E,m,h);var R=x[I+1];x[I+1]=x[I+3],x[I+3]=R},_doCryptBlock:function(x,I,R,S,T,D,b,M){for(var L=this._nRounds,P=x[I]^R[0],N=x[I+1]^R[1],j=x[I+2]^R[2],X=x[I+3]^R[3],K=4,ne=1;ne<L;ne++){var V=S[P>>>24]^T[N>>>16&255]^D[j>>>8&255]^b[X&255]^R[K++],te=S[N>>>24]^T[j>>>16&255]^D[X>>>8&255]^b[P&255]^R[K++],Q=S[j>>>24]^T[X>>>16&255]^D[P>>>8&255]^b[N&255]^R[K++],z=S[X>>>24]^T[P>>>16&255]^D[N>>>8&255]^b[j&255]^R[K++];P=V,N=te,j=Q,X=z}var V=(M[P>>>24]<<24|M[N>>>16&255]<<16|M[j>>>8&255]<<8|M[X&255])^R[K++],te=(M[N>>>24]<<24|M[j>>>16&255]<<16|M[X>>>8&255]<<8|M[P&255])^R[K++],Q=(M[j>>>24]<<24|M[X>>>16&255]<<16|M[P>>>8&255]<<8|M[N&255])^R[K++],z=(M[X>>>24]<<24|M[P>>>16&255]<<16|M[N>>>8&255]<<8|M[j&255])^R[K++];x[I]=V,x[I+1]=te,x[I+2]=Q,x[I+3]=z},keySize:256/32});n.AES=s._createHelper(w)}(),t.AES})}(J_)),J_.exports}var $_={exports:{}},ev;function uS(){return ev||(ev=1,function(r,e){(function(t,n,i){r.exports=n(wt(),ja(),Wa(),js(),Nr())})(mt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=i.BlockCipher,c=n.algo,h=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],u=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],d=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],A=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],p=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],g=c.DES=o.extend({_doReset:function(){for(var _=this._key,w=_.words,x=[],I=0;I<56;I++){var R=h[I]-1;x[I]=w[R>>>5]>>>31-R%32&1}for(var S=this._subKeys=[],T=0;T<16;T++){for(var D=S[T]=[],b=d[T],I=0;I<24;I++)D[I/6|0]|=x[(u[I]-1+b)%28]<<31-I%6,D[4+(I/6|0)]|=x[28+(u[I+24]-1+b)%28]<<31-I%6;D[0]=D[0]<<1|D[0]>>>31;for(var I=1;I<7;I++)D[I]=D[I]>>>(I-1)*4+3;D[7]=D[7]<<5|D[7]>>>27}for(var M=this._invSubKeys=[],I=0;I<16;I++)M[I]=S[15-I]},encryptBlock:function(_,w){this._doCryptBlock(_,w,this._subKeys)},decryptBlock:function(_,w){this._doCryptBlock(_,w,this._invSubKeys)},_doCryptBlock:function(_,w,x){this._lBlock=_[w],this._rBlock=_[w+1],v.call(this,4,252645135),v.call(this,16,65535),E.call(this,2,858993459),E.call(this,8,16711935),v.call(this,1,1431655765);for(var I=0;I<16;I++){for(var R=x[I],S=this._lBlock,T=this._rBlock,D=0,b=0;b<8;b++)D|=A[b][((T^R[b])&p[b])>>>0];this._lBlock=T,this._rBlock=S^D}var M=this._lBlock;this._lBlock=this._rBlock,this._rBlock=M,v.call(this,1,1431655765),E.call(this,8,16711935),E.call(this,2,858993459),v.call(this,16,65535),v.call(this,4,252645135),_[w]=this._lBlock,_[w+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function v(_,w){var x=(this._lBlock>>>_^this._rBlock)&w;this._rBlock^=x,this._lBlock^=x<<_}function E(_,w){var x=(this._rBlock>>>_^this._lBlock)&w;this._lBlock^=x,this._rBlock^=x<<_}n.DES=o._createHelper(g);var m=c.TripleDES=o.extend({_doReset:function(){var _=this._key,w=_.words;if(w.length!==2&&w.length!==4&&w.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var x=w.slice(0,2),I=w.length<4?w.slice(0,2):w.slice(2,4),R=w.length<6?w.slice(0,2):w.slice(4,6);this._des1=g.createEncryptor(s.create(x)),this._des2=g.createEncryptor(s.create(I)),this._des3=g.createEncryptor(s.create(R))},encryptBlock:function(_,w){this._des1.encryptBlock(_,w),this._des2.decryptBlock(_,w),this._des3.encryptBlock(_,w)},decryptBlock:function(_,w){this._des3.decryptBlock(_,w),this._des2.encryptBlock(_,w),this._des1.decryptBlock(_,w)},keySize:192/32,ivSize:64/32,blockSize:64/32});n.TripleDES=o._createHelper(m)}(),t.TripleDES})}($_)),$_.exports}var tv={exports:{}},rv;function hS(){return rv||(rv=1,function(r,e){(function(t,n,i){r.exports=n(wt(),ja(),Wa(),js(),Nr())})(mt,function(t){return function(){var n=t,i=n.lib,s=i.StreamCipher,o=n.algo,c=o.RC4=s.extend({_doReset:function(){for(var d=this._key,A=d.words,p=d.sigBytes,g=this._S=[],v=0;v<256;v++)g[v]=v;for(var v=0,E=0;v<256;v++){var m=v%p,_=A[m>>>2]>>>24-m%4*8&255;E=(E+g[v]+_)%256;var w=g[v];g[v]=g[E],g[E]=w}this._i=this._j=0},_doProcessBlock:function(d,A){d[A]^=h.call(this)},keySize:256/32,ivSize:0});function h(){for(var d=this._S,A=this._i,p=this._j,g=0,v=0;v<4;v++){A=(A+1)%256,p=(p+d[A])%256;var E=d[A];d[A]=d[p],d[p]=E,g|=d[(d[A]+d[p])%256]<<24-v*8}return this._i=A,this._j=p,g}n.RC4=s._createHelper(c);var u=o.RC4Drop=c.extend({cfg:c.cfg.extend({drop:192}),_doReset:function(){c._doReset.call(this);for(var d=this.cfg.drop;d>0;d--)h.call(this)}});n.RC4Drop=s._createHelper(u)}(),t.RC4})}(tv)),tv.exports}var nv={exports:{}},iv;function dS(){return iv||(iv=1,function(r,e){(function(t,n,i){r.exports=n(wt(),ja(),Wa(),js(),Nr())})(mt,function(t){return function(){var n=t,i=n.lib,s=i.StreamCipher,o=n.algo,c=[],h=[],u=[],d=o.Rabbit=s.extend({_doReset:function(){for(var p=this._key.words,g=this.cfg.iv,v=0;v<4;v++)p[v]=(p[v]<<8|p[v]>>>24)&16711935|(p[v]<<24|p[v]>>>8)&4278255360;var E=this._X=[p[0],p[3]<<16|p[2]>>>16,p[1],p[0]<<16|p[3]>>>16,p[2],p[1]<<16|p[0]>>>16,p[3],p[2]<<16|p[1]>>>16],m=this._C=[p[2]<<16|p[2]>>>16,p[0]&4294901760|p[1]&65535,p[3]<<16|p[3]>>>16,p[1]&4294901760|p[2]&65535,p[0]<<16|p[0]>>>16,p[2]&4294901760|p[3]&65535,p[1]<<16|p[1]>>>16,p[3]&4294901760|p[0]&65535];this._b=0;for(var v=0;v<4;v++)A.call(this);for(var v=0;v<8;v++)m[v]^=E[v+4&7];if(g){var _=g.words,w=_[0],x=_[1],I=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,R=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,S=I>>>16|R&4294901760,T=R<<16|I&65535;m[0]^=I,m[1]^=S,m[2]^=R,m[3]^=T,m[4]^=I,m[5]^=S,m[6]^=R,m[7]^=T;for(var v=0;v<4;v++)A.call(this)}},_doProcessBlock:function(p,g){var v=this._X;A.call(this),c[0]=v[0]^v[5]>>>16^v[3]<<16,c[1]=v[2]^v[7]>>>16^v[5]<<16,c[2]=v[4]^v[1]>>>16^v[7]<<16,c[3]=v[6]^v[3]>>>16^v[1]<<16;for(var E=0;E<4;E++)c[E]=(c[E]<<8|c[E]>>>24)&16711935|(c[E]<<24|c[E]>>>8)&4278255360,p[g+E]^=c[E]},blockSize:128/32,ivSize:64/32});function A(){for(var p=this._X,g=this._C,v=0;v<8;v++)h[v]=g[v];g[0]=g[0]+1295307597+this._b|0,g[1]=g[1]+3545052371+(g[0]>>>0<h[0]>>>0?1:0)|0,g[2]=g[2]+886263092+(g[1]>>>0<h[1]>>>0?1:0)|0,g[3]=g[3]+1295307597+(g[2]>>>0<h[2]>>>0?1:0)|0,g[4]=g[4]+3545052371+(g[3]>>>0<h[3]>>>0?1:0)|0,g[5]=g[5]+886263092+(g[4]>>>0<h[4]>>>0?1:0)|0,g[6]=g[6]+1295307597+(g[5]>>>0<h[5]>>>0?1:0)|0,g[7]=g[7]+3545052371+(g[6]>>>0<h[6]>>>0?1:0)|0,this._b=g[7]>>>0<h[7]>>>0?1:0;for(var v=0;v<8;v++){var E=p[v]+g[v],m=E&65535,_=E>>>16,w=((m*m>>>17)+m*_>>>15)+_*_,x=((E&4294901760)*E|0)+((E&65535)*E|0);u[v]=w^x}p[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,p[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,p[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,p[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,p[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,p[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,p[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,p[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}n.Rabbit=s._createHelper(d)}(),t.Rabbit})}(nv)),nv.exports}var sv={exports:{}},av;function fS(){return av||(av=1,function(r,e){(function(t,n,i){r.exports=n(wt(),ja(),Wa(),js(),Nr())})(mt,function(t){return function(){var n=t,i=n.lib,s=i.StreamCipher,o=n.algo,c=[],h=[],u=[],d=o.RabbitLegacy=s.extend({_doReset:function(){var p=this._key.words,g=this.cfg.iv,v=this._X=[p[0],p[3]<<16|p[2]>>>16,p[1],p[0]<<16|p[3]>>>16,p[2],p[1]<<16|p[0]>>>16,p[3],p[2]<<16|p[1]>>>16],E=this._C=[p[2]<<16|p[2]>>>16,p[0]&4294901760|p[1]&65535,p[3]<<16|p[3]>>>16,p[1]&4294901760|p[2]&65535,p[0]<<16|p[0]>>>16,p[2]&4294901760|p[3]&65535,p[1]<<16|p[1]>>>16,p[3]&4294901760|p[0]&65535];this._b=0;for(var m=0;m<4;m++)A.call(this);for(var m=0;m<8;m++)E[m]^=v[m+4&7];if(g){var _=g.words,w=_[0],x=_[1],I=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,R=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,S=I>>>16|R&4294901760,T=R<<16|I&65535;E[0]^=I,E[1]^=S,E[2]^=R,E[3]^=T,E[4]^=I,E[5]^=S,E[6]^=R,E[7]^=T;for(var m=0;m<4;m++)A.call(this)}},_doProcessBlock:function(p,g){var v=this._X;A.call(this),c[0]=v[0]^v[5]>>>16^v[3]<<16,c[1]=v[2]^v[7]>>>16^v[5]<<16,c[2]=v[4]^v[1]>>>16^v[7]<<16,c[3]=v[6]^v[3]>>>16^v[1]<<16;for(var E=0;E<4;E++)c[E]=(c[E]<<8|c[E]>>>24)&16711935|(c[E]<<24|c[E]>>>8)&4278255360,p[g+E]^=c[E]},blockSize:128/32,ivSize:64/32});function A(){for(var p=this._X,g=this._C,v=0;v<8;v++)h[v]=g[v];g[0]=g[0]+1295307597+this._b|0,g[1]=g[1]+3545052371+(g[0]>>>0<h[0]>>>0?1:0)|0,g[2]=g[2]+886263092+(g[1]>>>0<h[1]>>>0?1:0)|0,g[3]=g[3]+1295307597+(g[2]>>>0<h[2]>>>0?1:0)|0,g[4]=g[4]+3545052371+(g[3]>>>0<h[3]>>>0?1:0)|0,g[5]=g[5]+886263092+(g[4]>>>0<h[4]>>>0?1:0)|0,g[6]=g[6]+1295307597+(g[5]>>>0<h[5]>>>0?1:0)|0,g[7]=g[7]+3545052371+(g[6]>>>0<h[6]>>>0?1:0)|0,this._b=g[7]>>>0<h[7]>>>0?1:0;for(var v=0;v<8;v++){var E=p[v]+g[v],m=E&65535,_=E>>>16,w=((m*m>>>17)+m*_>>>15)+_*_,x=((E&4294901760)*E|0)+((E&65535)*E|0);u[v]=w^x}p[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,p[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,p[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,p[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,p[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,p[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,p[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,p[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}n.RabbitLegacy=s._createHelper(d)}(),t.RabbitLegacy})}(sv)),sv.exports}var ov={exports:{}},lv;function pS(){return lv||(lv=1,function(r,e){(function(t,n,i){r.exports=n(wt(),ja(),Wa(),js(),Nr())})(mt,function(t){return function(){var n=t,i=n.lib,s=i.BlockCipher,o=n.algo;const c=16,h=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],u=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var d={pbox:[],sbox:[]};function A(m,_){let w=_>>24&255,x=_>>16&255,I=_>>8&255,R=_&255,S=m.sbox[0][w]+m.sbox[1][x];return S=S^m.sbox[2][I],S=S+m.sbox[3][R],S}function p(m,_,w){let x=_,I=w,R;for(let S=0;S<c;++S)x=x^m.pbox[S],I=A(m,x)^I,R=x,x=I,I=R;return R=x,x=I,I=R,I=I^m.pbox[c],x=x^m.pbox[c+1],{left:x,right:I}}function g(m,_,w){let x=_,I=w,R;for(let S=c+1;S>1;--S)x=x^m.pbox[S],I=A(m,x)^I,R=x,x=I,I=R;return R=x,x=I,I=R,I=I^m.pbox[1],x=x^m.pbox[0],{left:x,right:I}}function v(m,_,w){for(let T=0;T<4;T++){m.sbox[T]=[];for(let D=0;D<256;D++)m.sbox[T][D]=u[T][D]}let x=0;for(let T=0;T<c+2;T++)m.pbox[T]=h[T]^_[x],x++,x>=w&&(x=0);let I=0,R=0,S=0;for(let T=0;T<c+2;T+=2)S=p(m,I,R),I=S.left,R=S.right,m.pbox[T]=I,m.pbox[T+1]=R;for(let T=0;T<4;T++)for(let D=0;D<256;D+=2)S=p(m,I,R),I=S.left,R=S.right,m.sbox[T][D]=I,m.sbox[T][D+1]=R;return!0}var E=o.Blowfish=s.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var m=this._keyPriorReset=this._key,_=m.words,w=m.sigBytes/4;v(d,_,w)}},encryptBlock:function(m,_){var w=p(d,m[_],m[_+1]);m[_]=w.left,m[_+1]=w.right},decryptBlock:function(m,_){var w=g(d,m[_],m[_+1]);m[_]=w.left,m[_+1]=w.right},blockSize:64/32,keySize:128/32,ivSize:64/32});n.Blowfish=s._createHelper(E)}(),t.Blowfish})}(ov)),ov.exports}(function(r,e){(function(t,n,i){r.exports=n(wt(),bh(),VM(),jM(),ja(),WM(),Wa(),o_(),Sp(),YM(),p_(),qM(),XM(),KM(),Tp(),JM(),js(),Nr(),ZM(),$M(),eS(),tS(),rS(),nS(),iS(),sS(),aS(),oS(),lS(),cS(),uS(),hS(),dS(),fS(),pS())})(mt,function(t){return t})})(V1);var AS=V1.exports;const Bp=bM(AS);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const gS=4,cv=0,uv=1,mS=2;function Vo(r){let e=r.length;for(;--e>=0;)r[e]=0}const _S=0,hv=1,vS=2,yS=3,ES=258,bp=29,Rc=256,Dc=Rc+1+bp,jo=30,Rp=19,dv=2*Dc+1,Ya=15,Dp=16,xS=7,Lp=256,fv=16,pv=17,Av=18,Np=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Rh=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),wS=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),gv=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),IS=512,cs=new Array((Dc+2)*2);Vo(cs);const Lc=new Array(jo*2);Vo(Lc);const Nc=new Array(IS);Vo(Nc);const Uc=new Array(ES-yS+1);Vo(Uc);const Up=new Array(bp);Vo(Up);const Dh=new Array(jo);Vo(Dh);function Pp(r,e,t,n,i){this.static_tree=r,this.extra_bits=e,this.extra_base=t,this.elems=n,this.max_length=i,this.has_stree=r&&r.length}let mv,_v,vv;function kp(r,e){this.dyn_tree=r,this.max_code=0,this.stat_desc=e}const yv=r=>r<256?Nc[r]:Nc[256+(r>>>7)],Pc=(r,e)=>{r.pending_buf[r.pending++]=e&255,r.pending_buf[r.pending++]=e>>>8&255},mn=(r,e,t)=>{r.bi_valid>Dp-t?(r.bi_buf|=e<<r.bi_valid&65535,Pc(r,r.bi_buf),r.bi_buf=e>>Dp-r.bi_valid,r.bi_valid+=t-Dp):(r.bi_buf|=e<<r.bi_valid&65535,r.bi_valid+=t)},zi=(r,e,t)=>{mn(r,t[e*2],t[e*2+1])},Ev=(r,e)=>{let t=0;do t|=r&1,r>>>=1,t<<=1;while(--e>0);return t>>>1},CS=r=>{r.bi_valid===16?(Pc(r,r.bi_buf),r.bi_buf=0,r.bi_valid=0):r.bi_valid>=8&&(r.pending_buf[r.pending++]=r.bi_buf&255,r.bi_buf>>=8,r.bi_valid-=8)},MS=(r,e)=>{const t=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,s=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,h=e.stat_desc.max_length;let u,d,A,p,g,v,E=0;for(p=0;p<=Ya;p++)r.bl_count[p]=0;for(t[r.heap[r.heap_max]*2+1]=0,u=r.heap_max+1;u<dv;u++)d=r.heap[u],p=t[t[d*2+1]*2+1]+1,p>h&&(p=h,E++),t[d*2+1]=p,!(d>n)&&(r.bl_count[p]++,g=0,d>=c&&(g=o[d-c]),v=t[d*2],r.opt_len+=v*(p+g),s&&(r.static_len+=v*(i[d*2+1]+g)));if(E!==0){do{for(p=h-1;r.bl_count[p]===0;)p--;r.bl_count[p]--,r.bl_count[p+1]+=2,r.bl_count[h]--,E-=2}while(E>0);for(p=h;p!==0;p--)for(d=r.bl_count[p];d!==0;)A=r.heap[--u],!(A>n)&&(t[A*2+1]!==p&&(r.opt_len+=(p-t[A*2+1])*t[A*2],t[A*2+1]=p),d--)}},xv=(r,e,t)=>{const n=new Array(Ya+1);let i=0,s,o;for(s=1;s<=Ya;s++)i=i+t[s-1]<<1,n[s]=i;for(o=0;o<=e;o++){let c=r[o*2+1];c!==0&&(r[o*2]=Ev(n[c]++,c))}},SS=()=>{let r,e,t,n,i;const s=new Array(Ya+1);for(t=0,n=0;n<bp-1;n++)for(Up[n]=t,r=0;r<1<<Np[n];r++)Uc[t++]=n;for(Uc[t-1]=n,i=0,n=0;n<16;n++)for(Dh[n]=i,r=0;r<1<<Rh[n];r++)Nc[i++]=n;for(i>>=7;n<jo;n++)for(Dh[n]=i<<7,r=0;r<1<<Rh[n]-7;r++)Nc[256+i++]=n;for(e=0;e<=Ya;e++)s[e]=0;for(r=0;r<=143;)cs[r*2+1]=8,r++,s[8]++;for(;r<=255;)cs[r*2+1]=9,r++,s[9]++;for(;r<=279;)cs[r*2+1]=7,r++,s[7]++;for(;r<=287;)cs[r*2+1]=8,r++,s[8]++;for(xv(cs,Dc+1,s),r=0;r<jo;r++)Lc[r*2+1]=5,Lc[r*2]=Ev(r,5);mv=new Pp(cs,Np,Rc+1,Dc,Ya),_v=new Pp(Lc,Rh,0,jo,Ya),vv=new Pp(new Array(0),wS,0,Rp,xS)},wv=r=>{let e;for(e=0;e<Dc;e++)r.dyn_ltree[e*2]=0;for(e=0;e<jo;e++)r.dyn_dtree[e*2]=0;for(e=0;e<Rp;e++)r.bl_tree[e*2]=0;r.dyn_ltree[Lp*2]=1,r.opt_len=r.static_len=0,r.sym_next=r.matches=0},Iv=r=>{r.bi_valid>8?Pc(r,r.bi_buf):r.bi_valid>0&&(r.pending_buf[r.pending++]=r.bi_buf),r.bi_buf=0,r.bi_valid=0},Cv=(r,e,t,n)=>{const i=e*2,s=t*2;return r[i]<r[s]||r[i]===r[s]&&n[e]<=n[t]},Qp=(r,e,t)=>{const n=r.heap[t];let i=t<<1;for(;i<=r.heap_len&&(i<r.heap_len&&Cv(e,r.heap[i+1],r.heap[i],r.depth)&&i++,!Cv(e,n,r.heap[i],r.depth));)r.heap[t]=r.heap[i],t=i,i<<=1;r.heap[t]=n},Mv=(r,e,t)=>{let n,i,s=0,o,c;if(r.sym_next!==0)do n=r.pending_buf[r.sym_buf+s++]&255,n+=(r.pending_buf[r.sym_buf+s++]&255)<<8,i=r.pending_buf[r.sym_buf+s++],n===0?zi(r,i,e):(o=Uc[i],zi(r,o+Rc+1,e),c=Np[o],c!==0&&(i-=Up[o],mn(r,i,c)),n--,o=yv(n),zi(r,o,t),c=Rh[o],c!==0&&(n-=Dh[o],mn(r,n,c)));while(s<r.sym_next);zi(r,Lp,e)},Op=(r,e)=>{const t=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,s=e.stat_desc.elems;let o,c,h=-1,u;for(r.heap_len=0,r.heap_max=dv,o=0;o<s;o++)t[o*2]!==0?(r.heap[++r.heap_len]=h=o,r.depth[o]=0):t[o*2+1]=0;for(;r.heap_len<2;)u=r.heap[++r.heap_len]=h<2?++h:0,t[u*2]=1,r.depth[u]=0,r.opt_len--,i&&(r.static_len-=n[u*2+1]);for(e.max_code=h,o=r.heap_len>>1;o>=1;o--)Qp(r,t,o);u=s;do o=r.heap[1],r.heap[1]=r.heap[r.heap_len--],Qp(r,t,1),c=r.heap[1],r.heap[--r.heap_max]=o,r.heap[--r.heap_max]=c,t[u*2]=t[o*2]+t[c*2],r.depth[u]=(r.depth[o]>=r.depth[c]?r.depth[o]:r.depth[c])+1,t[o*2+1]=t[c*2+1]=u,r.heap[1]=u++,Qp(r,t,1);while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],MS(r,e),xv(t,h,r.bl_count)},Sv=(r,e,t)=>{let n,i=-1,s,o=e[0*2+1],c=0,h=7,u=4;for(o===0&&(h=138,u=3),e[(t+1)*2+1]=65535,n=0;n<=t;n++)s=o,o=e[(n+1)*2+1],!(++c<h&&s===o)&&(c<u?r.bl_tree[s*2]+=c:s!==0?(s!==i&&r.bl_tree[s*2]++,r.bl_tree[fv*2]++):c<=10?r.bl_tree[pv*2]++:r.bl_tree[Av*2]++,c=0,i=s,o===0?(h=138,u=3):s===o?(h=6,u=3):(h=7,u=4))},Tv=(r,e,t)=>{let n,i=-1,s,o=e[0*2+1],c=0,h=7,u=4;for(o===0&&(h=138,u=3),n=0;n<=t;n++)if(s=o,o=e[(n+1)*2+1],!(++c<h&&s===o)){if(c<u)do zi(r,s,r.bl_tree);while(--c!==0);else s!==0?(s!==i&&(zi(r,s,r.bl_tree),c--),zi(r,fv,r.bl_tree),mn(r,c-3,2)):c<=10?(zi(r,pv,r.bl_tree),mn(r,c-3,3)):(zi(r,Av,r.bl_tree),mn(r,c-11,7));c=0,i=s,o===0?(h=138,u=3):s===o?(h=6,u=3):(h=7,u=4)}},TS=r=>{let e;for(Sv(r,r.dyn_ltree,r.l_desc.max_code),Sv(r,r.dyn_dtree,r.d_desc.max_code),Op(r,r.bl_desc),e=Rp-1;e>=3&&r.bl_tree[gv[e]*2+1]===0;e--);return r.opt_len+=3*(e+1)+5+5+4,e},BS=(r,e,t,n)=>{let i;for(mn(r,e-257,5),mn(r,t-1,5),mn(r,n-4,4),i=0;i<n;i++)mn(r,r.bl_tree[gv[i]*2+1],3);Tv(r,r.dyn_ltree,e-1),Tv(r,r.dyn_dtree,t-1)},bS=r=>{let e=4093624447,t;for(t=0;t<=31;t++,e>>>=1)if(e&1&&r.dyn_ltree[t*2]!==0)return cv;if(r.dyn_ltree[9*2]!==0||r.dyn_ltree[10*2]!==0||r.dyn_ltree[13*2]!==0)return uv;for(t=32;t<Rc;t++)if(r.dyn_ltree[t*2]!==0)return uv;return cv};let Bv=!1;const RS=r=>{Bv||(SS(),Bv=!0),r.l_desc=new kp(r.dyn_ltree,mv),r.d_desc=new kp(r.dyn_dtree,_v),r.bl_desc=new kp(r.bl_tree,vv),r.bi_buf=0,r.bi_valid=0,wv(r)},bv=(r,e,t,n)=>{mn(r,(_S<<1)+(n?1:0),3),Iv(r),Pc(r,t),Pc(r,~t),t&&r.pending_buf.set(r.window.subarray(e,e+t),r.pending),r.pending+=t},DS=r=>{mn(r,hv<<1,3),zi(r,Lp,cs),CS(r)},LS=(r,e,t,n)=>{let i,s,o=0;r.level>0?(r.strm.data_type===mS&&(r.strm.data_type=bS(r)),Op(r,r.l_desc),Op(r,r.d_desc),o=TS(r),i=r.opt_len+3+7>>>3,s=r.static_len+3+7>>>3,s<=i&&(i=s)):i=s=t+5,t+4<=i&&e!==-1?bv(r,e,t,n):r.strategy===gS||s===i?(mn(r,(hv<<1)+(n?1:0),3),Mv(r,cs,Lc)):(mn(r,(vS<<1)+(n?1:0),3),BS(r,r.l_desc.max_code+1,r.d_desc.max_code+1,o+1),Mv(r,r.dyn_ltree,r.dyn_dtree)),wv(r),n&&Iv(r)},NS=(r,e,t)=>(r.pending_buf[r.sym_buf+r.sym_next++]=e,r.pending_buf[r.sym_buf+r.sym_next++]=e>>8,r.pending_buf[r.sym_buf+r.sym_next++]=t,e===0?r.dyn_ltree[t*2]++:(r.matches++,e--,r.dyn_ltree[(Uc[t]+Rc+1)*2]++,r.dyn_dtree[yv(e)*2]++),r.sym_next===r.sym_end);var US=RS,PS=bv,kS=LS,QS=NS,OS=DS,FS={_tr_init:US,_tr_stored_block:PS,_tr_flush_block:kS,_tr_tally:QS,_tr_align:OS},kc=(r,e,t,n)=>{let i=r&65535|0,s=r>>>16&65535|0,o=0;for(;t!==0;){o=t>2e3?2e3:t,t-=o;do i=i+e[n++]|0,s=s+i|0;while(--o);i%=65521,s%=65521}return i|s<<16|0};const zS=()=>{let r,e=[];for(var t=0;t<256;t++){r=t;for(var n=0;n<8;n++)r=r&1?3988292384^r>>>1:r>>>1;e[t]=r}return e},HS=new Uint32Array(zS());var Ur=(r,e,t,n)=>{const i=HS,s=n+t;r^=-1;for(let o=n;o<s;o++)r=r>>>8^i[(r^e[o])&255];return r^-1},qa={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Xa={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:GS,_tr_stored_block:Fp,_tr_flush_block:VS,_tr_tally:Ws,_tr_align:jS}=FS,{Z_NO_FLUSH:Ys,Z_PARTIAL_FLUSH:WS,Z_FULL_FLUSH:YS,Z_FINISH:ti,Z_BLOCK:Rv,Z_OK:jr,Z_STREAM_END:Dv,Z_STREAM_ERROR:Hi,Z_DATA_ERROR:qS,Z_BUF_ERROR:zp,Z_DEFAULT_COMPRESSION:XS,Z_FILTERED:KS,Z_HUFFMAN_ONLY:Lh,Z_RLE:JS,Z_FIXED:ZS,Z_DEFAULT_STRATEGY:$S,Z_UNKNOWN:eT,Z_DEFLATED:Nh}=Xa,tT=9,rT=15,nT=8,iT=29,sT=256,Hp=sT+1+iT,aT=30,oT=19,lT=2*Hp+1,cT=15,It=3,qs=258,Gi=qs+It+1,uT=32,Wo=42,Gp=57,Vp=69,jp=73,Wp=91,Yp=103,Ka=113,Qc=666,an=1,Yo=2,Ja=3,qo=4,hT=3,Za=(r,e)=>(r.msg=qa[e],e),Lv=r=>r*2-(r>4?9:0),Xs=r=>{let e=r.length;for(;--e>=0;)r[e]=0},dT=r=>{let e,t,n,i=r.w_size;e=r.hash_size,n=e;do t=r.head[--n],r.head[n]=t>=i?t-i:0;while(--e);e=i,n=e;do t=r.prev[--n],r.prev[n]=t>=i?t-i:0;while(--e)};let fT=(r,e,t)=>(e<<r.hash_shift^t)&r.hash_mask,Ks=fT;const kn=r=>{const e=r.state;let t=e.pending;t>r.avail_out&&(t=r.avail_out),t!==0&&(r.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+t),r.next_out),r.next_out+=t,e.pending_out+=t,r.total_out+=t,r.avail_out-=t,e.pending-=t,e.pending===0&&(e.pending_out=0))},Qn=(r,e)=>{VS(r,r.block_start>=0?r.block_start:-1,r.strstart-r.block_start,e),r.block_start=r.strstart,kn(r.strm)},bt=(r,e)=>{r.pending_buf[r.pending++]=e},Oc=(r,e)=>{r.pending_buf[r.pending++]=e>>>8&255,r.pending_buf[r.pending++]=e&255},qp=(r,e,t,n)=>{let i=r.avail_in;return i>n&&(i=n),i===0?0:(r.avail_in-=i,e.set(r.input.subarray(r.next_in,r.next_in+i),t),r.state.wrap===1?r.adler=kc(r.adler,e,i,t):r.state.wrap===2&&(r.adler=Ur(r.adler,e,i,t)),r.next_in+=i,r.total_in+=i,i)},Nv=(r,e)=>{let t=r.max_chain_length,n=r.strstart,i,s,o=r.prev_length,c=r.nice_match;const h=r.strstart>r.w_size-Gi?r.strstart-(r.w_size-Gi):0,u=r.window,d=r.w_mask,A=r.prev,p=r.strstart+qs;let g=u[n+o-1],v=u[n+o];r.prev_length>=r.good_match&&(t>>=2),c>r.lookahead&&(c=r.lookahead);do if(i=e,!(u[i+o]!==v||u[i+o-1]!==g||u[i]!==u[n]||u[++i]!==u[n+1])){n+=2,i++;do;while(u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&n<p);if(s=qs-(p-n),n=p-qs,s>o){if(r.match_start=e,o=s,s>=c)break;g=u[n+o-1],v=u[n+o]}}while((e=A[e&d])>h&&--t!==0);return o<=r.lookahead?o:r.lookahead},Xo=r=>{const e=r.w_size;let t,n,i;do{if(n=r.window_size-r.lookahead-r.strstart,r.strstart>=e+(e-Gi)&&(r.window.set(r.window.subarray(e,e+e-n),0),r.match_start-=e,r.strstart-=e,r.block_start-=e,r.insert>r.strstart&&(r.insert=r.strstart),dT(r),n+=e),r.strm.avail_in===0)break;if(t=qp(r.strm,r.window,r.strstart+r.lookahead,n),r.lookahead+=t,r.lookahead+r.insert>=It)for(i=r.strstart-r.insert,r.ins_h=r.window[i],r.ins_h=Ks(r,r.ins_h,r.window[i+1]);r.insert&&(r.ins_h=Ks(r,r.ins_h,r.window[i+It-1]),r.prev[i&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=i,i++,r.insert--,!(r.lookahead+r.insert<It)););}while(r.lookahead<Gi&&r.strm.avail_in!==0)},Uv=(r,e)=>{let t=r.pending_buf_size-5>r.w_size?r.w_size:r.pending_buf_size-5,n,i,s,o=0,c=r.strm.avail_in;do{if(n=65535,s=r.bi_valid+42>>3,r.strm.avail_out<s||(s=r.strm.avail_out-s,i=r.strstart-r.block_start,n>i+r.strm.avail_in&&(n=i+r.strm.avail_in),n>s&&(n=s),n<t&&(n===0&&e!==ti||e===Ys||n!==i+r.strm.avail_in)))break;o=e===ti&&n===i+r.strm.avail_in?1:0,Fp(r,0,0,o),r.pending_buf[r.pending-4]=n,r.pending_buf[r.pending-3]=n>>8,r.pending_buf[r.pending-2]=~n,r.pending_buf[r.pending-1]=~n>>8,kn(r.strm),i&&(i>n&&(i=n),r.strm.output.set(r.window.subarray(r.block_start,r.block_start+i),r.strm.next_out),r.strm.next_out+=i,r.strm.avail_out-=i,r.strm.total_out+=i,r.block_start+=i,n-=i),n&&(qp(r.strm,r.strm.output,r.strm.next_out,n),r.strm.next_out+=n,r.strm.avail_out-=n,r.strm.total_out+=n)}while(o===0);return c-=r.strm.avail_in,c&&(c>=r.w_size?(r.matches=2,r.window.set(r.strm.input.subarray(r.strm.next_in-r.w_size,r.strm.next_in),0),r.strstart=r.w_size,r.insert=r.strstart):(r.window_size-r.strstart<=c&&(r.strstart-=r.w_size,r.window.set(r.window.subarray(r.w_size,r.w_size+r.strstart),0),r.matches<2&&r.matches++,r.insert>r.strstart&&(r.insert=r.strstart)),r.window.set(r.strm.input.subarray(r.strm.next_in-c,r.strm.next_in),r.strstart),r.strstart+=c,r.insert+=c>r.w_size-r.insert?r.w_size-r.insert:c),r.block_start=r.strstart),r.high_water<r.strstart&&(r.high_water=r.strstart),o?qo:e!==Ys&&e!==ti&&r.strm.avail_in===0&&r.strstart===r.block_start?Yo:(s=r.window_size-r.strstart,r.strm.avail_in>s&&r.block_start>=r.w_size&&(r.block_start-=r.w_size,r.strstart-=r.w_size,r.window.set(r.window.subarray(r.w_size,r.w_size+r.strstart),0),r.matches<2&&r.matches++,s+=r.w_size,r.insert>r.strstart&&(r.insert=r.strstart)),s>r.strm.avail_in&&(s=r.strm.avail_in),s&&(qp(r.strm,r.window,r.strstart,s),r.strstart+=s,r.insert+=s>r.w_size-r.insert?r.w_size-r.insert:s),r.high_water<r.strstart&&(r.high_water=r.strstart),s=r.bi_valid+42>>3,s=r.pending_buf_size-s>65535?65535:r.pending_buf_size-s,t=s>r.w_size?r.w_size:s,i=r.strstart-r.block_start,(i>=t||(i||e===ti)&&e!==Ys&&r.strm.avail_in===0&&i<=s)&&(n=i>s?s:i,o=e===ti&&r.strm.avail_in===0&&n===i?1:0,Fp(r,r.block_start,n,o),r.block_start+=n,kn(r.strm)),o?Ja:an)},Xp=(r,e)=>{let t,n;for(;;){if(r.lookahead<Gi){if(Xo(r),r.lookahead<Gi&&e===Ys)return an;if(r.lookahead===0)break}if(t=0,r.lookahead>=It&&(r.ins_h=Ks(r,r.ins_h,r.window[r.strstart+It-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart),t!==0&&r.strstart-t<=r.w_size-Gi&&(r.match_length=Nv(r,t)),r.match_length>=It)if(n=Ws(r,r.strstart-r.match_start,r.match_length-It),r.lookahead-=r.match_length,r.match_length<=r.max_lazy_match&&r.lookahead>=It){r.match_length--;do r.strstart++,r.ins_h=Ks(r,r.ins_h,r.window[r.strstart+It-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart;while(--r.match_length!==0);r.strstart++}else r.strstart+=r.match_length,r.match_length=0,r.ins_h=r.window[r.strstart],r.ins_h=Ks(r,r.ins_h,r.window[r.strstart+1]);else n=Ws(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++;if(n&&(Qn(r,!1),r.strm.avail_out===0))return an}return r.insert=r.strstart<It-1?r.strstart:It-1,e===ti?(Qn(r,!0),r.strm.avail_out===0?Ja:qo):r.sym_next&&(Qn(r,!1),r.strm.avail_out===0)?an:Yo},Ko=(r,e)=>{let t,n,i;for(;;){if(r.lookahead<Gi){if(Xo(r),r.lookahead<Gi&&e===Ys)return an;if(r.lookahead===0)break}if(t=0,r.lookahead>=It&&(r.ins_h=Ks(r,r.ins_h,r.window[r.strstart+It-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart),r.prev_length=r.match_length,r.prev_match=r.match_start,r.match_length=It-1,t!==0&&r.prev_length<r.max_lazy_match&&r.strstart-t<=r.w_size-Gi&&(r.match_length=Nv(r,t),r.match_length<=5&&(r.strategy===KS||r.match_length===It&&r.strstart-r.match_start>4096)&&(r.match_length=It-1)),r.prev_length>=It&&r.match_length<=r.prev_length){i=r.strstart+r.lookahead-It,n=Ws(r,r.strstart-1-r.prev_match,r.prev_length-It),r.lookahead-=r.prev_length-1,r.prev_length-=2;do++r.strstart<=i&&(r.ins_h=Ks(r,r.ins_h,r.window[r.strstart+It-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart);while(--r.prev_length!==0);if(r.match_available=0,r.match_length=It-1,r.strstart++,n&&(Qn(r,!1),r.strm.avail_out===0))return an}else if(r.match_available){if(n=Ws(r,0,r.window[r.strstart-1]),n&&Qn(r,!1),r.strstart++,r.lookahead--,r.strm.avail_out===0)return an}else r.match_available=1,r.strstart++,r.lookahead--}return r.match_available&&(n=Ws(r,0,r.window[r.strstart-1]),r.match_available=0),r.insert=r.strstart<It-1?r.strstart:It-1,e===ti?(Qn(r,!0),r.strm.avail_out===0?Ja:qo):r.sym_next&&(Qn(r,!1),r.strm.avail_out===0)?an:Yo},pT=(r,e)=>{let t,n,i,s;const o=r.window;for(;;){if(r.lookahead<=qs){if(Xo(r),r.lookahead<=qs&&e===Ys)return an;if(r.lookahead===0)break}if(r.match_length=0,r.lookahead>=It&&r.strstart>0&&(i=r.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){s=r.strstart+qs;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<s);r.match_length=qs-(s-i),r.match_length>r.lookahead&&(r.match_length=r.lookahead)}if(r.match_length>=It?(t=Ws(r,1,r.match_length-It),r.lookahead-=r.match_length,r.strstart+=r.match_length,r.match_length=0):(t=Ws(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++),t&&(Qn(r,!1),r.strm.avail_out===0))return an}return r.insert=0,e===ti?(Qn(r,!0),r.strm.avail_out===0?Ja:qo):r.sym_next&&(Qn(r,!1),r.strm.avail_out===0)?an:Yo},AT=(r,e)=>{let t;for(;;){if(r.lookahead===0&&(Xo(r),r.lookahead===0)){if(e===Ys)return an;break}if(r.match_length=0,t=Ws(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++,t&&(Qn(r,!1),r.strm.avail_out===0))return an}return r.insert=0,e===ti?(Qn(r,!0),r.strm.avail_out===0?Ja:qo):r.sym_next&&(Qn(r,!1),r.strm.avail_out===0)?an:Yo};function Vi(r,e,t,n,i){this.good_length=r,this.max_lazy=e,this.nice_length=t,this.max_chain=n,this.func=i}const Fc=[new Vi(0,0,0,0,Uv),new Vi(4,4,8,4,Xp),new Vi(4,5,16,8,Xp),new Vi(4,6,32,32,Xp),new Vi(4,4,16,16,Ko),new Vi(8,16,32,32,Ko),new Vi(8,16,128,128,Ko),new Vi(8,32,128,256,Ko),new Vi(32,128,258,1024,Ko),new Vi(32,258,258,4096,Ko)],gT=r=>{r.window_size=2*r.w_size,Xs(r.head),r.max_lazy_match=Fc[r.level].max_lazy,r.good_match=Fc[r.level].good_length,r.nice_match=Fc[r.level].nice_length,r.max_chain_length=Fc[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=It-1,r.match_available=0,r.ins_h=0};function mT(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Nh,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(lT*2),this.dyn_dtree=new Uint16Array((2*aT+1)*2),this.bl_tree=new Uint16Array((2*oT+1)*2),Xs(this.dyn_ltree),Xs(this.dyn_dtree),Xs(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(cT+1),this.heap=new Uint16Array(2*Hp+1),Xs(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Hp+1),Xs(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const zc=r=>{if(!r)return 1;const e=r.state;return!e||e.strm!==r||e.status!==Wo&&e.status!==Gp&&e.status!==Vp&&e.status!==jp&&e.status!==Wp&&e.status!==Yp&&e.status!==Ka&&e.status!==Qc?1:0},Pv=r=>{if(zc(r))return Za(r,Hi);r.total_in=r.total_out=0,r.data_type=eT;const e=r.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?Gp:e.wrap?Wo:Ka,r.adler=e.wrap===2?0:1,e.last_flush=-2,GS(e),jr},kv=r=>{const e=Pv(r);return e===jr&&gT(r.state),e},_T=(r,e)=>zc(r)||r.state.wrap!==2?Hi:(r.state.gzhead=e,jr),Qv=(r,e,t,n,i,s)=>{if(!r)return Hi;let o=1;if(e===XS&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>tT||t!==Nh||n<8||n>15||e<0||e>9||s<0||s>ZS||n===8&&o!==1)return Za(r,Hi);n===8&&(n=9);const c=new mT;return r.state=c,c.strm=r,c.status=Wo,c.wrap=o,c.gzhead=null,c.w_bits=n,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=i+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+It-1)/It),c.window=new Uint8Array(c.w_size*2),c.head=new Uint16Array(c.hash_size),c.prev=new Uint16Array(c.w_size),c.lit_bufsize=1<<i+6,c.pending_buf_size=c.lit_bufsize*4,c.pending_buf=new Uint8Array(c.pending_buf_size),c.sym_buf=c.lit_bufsize,c.sym_end=(c.lit_bufsize-1)*3,c.level=e,c.strategy=s,c.method=t,kv(r)},vT=(r,e)=>Qv(r,e,Nh,rT,nT,$S),yT=(r,e)=>{if(zc(r)||e>Rv||e<0)return r?Za(r,Hi):Hi;const t=r.state;if(!r.output||r.avail_in!==0&&!r.input||t.status===Qc&&e!==ti)return Za(r,r.avail_out===0?zp:Hi);const n=t.last_flush;if(t.last_flush=e,t.pending!==0){if(kn(r),r.avail_out===0)return t.last_flush=-1,jr}else if(r.avail_in===0&&Lv(e)<=Lv(n)&&e!==ti)return Za(r,zp);if(t.status===Qc&&r.avail_in!==0)return Za(r,zp);if(t.status===Wo&&t.wrap===0&&(t.status=Ka),t.status===Wo){let i=Nh+(t.w_bits-8<<4)<<8,s=-1;if(t.strategy>=Lh||t.level<2?s=0:t.level<6?s=1:t.level===6?s=2:s=3,i|=s<<6,t.strstart!==0&&(i|=uT),i+=31-i%31,Oc(t,i),t.strstart!==0&&(Oc(t,r.adler>>>16),Oc(t,r.adler&65535)),r.adler=1,t.status=Ka,kn(r),t.pending!==0)return t.last_flush=-1,jr}if(t.status===Gp){if(r.adler=0,bt(t,31),bt(t,139),bt(t,8),t.gzhead)bt(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),bt(t,t.gzhead.time&255),bt(t,t.gzhead.time>>8&255),bt(t,t.gzhead.time>>16&255),bt(t,t.gzhead.time>>24&255),bt(t,t.level===9?2:t.strategy>=Lh||t.level<2?4:0),bt(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(bt(t,t.gzhead.extra.length&255),bt(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(r.adler=Ur(r.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=Vp;else if(bt(t,0),bt(t,0),bt(t,0),bt(t,0),bt(t,0),bt(t,t.level===9?2:t.strategy>=Lh||t.level<2?4:0),bt(t,hT),t.status=Ka,kn(r),t.pending!==0)return t.last_flush=-1,jr}if(t.status===Vp){if(t.gzhead.extra){let i=t.pending,s=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+s>t.pending_buf_size;){let c=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+c),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>i&&(r.adler=Ur(r.adler,t.pending_buf,t.pending-i,i)),t.gzindex+=c,kn(r),t.pending!==0)return t.last_flush=-1,jr;i=0,s-=c}let o=new Uint8Array(t.gzhead.extra);t.pending_buf.set(o.subarray(t.gzindex,t.gzindex+s),t.pending),t.pending+=s,t.gzhead.hcrc&&t.pending>i&&(r.adler=Ur(r.adler,t.pending_buf,t.pending-i,i)),t.gzindex=0}t.status=jp}if(t.status===jp){if(t.gzhead.name){let i=t.pending,s;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>i&&(r.adler=Ur(r.adler,t.pending_buf,t.pending-i,i)),kn(r),t.pending!==0)return t.last_flush=-1,jr;i=0}t.gzindex<t.gzhead.name.length?s=t.gzhead.name.charCodeAt(t.gzindex++)&255:s=0,bt(t,s)}while(s!==0);t.gzhead.hcrc&&t.pending>i&&(r.adler=Ur(r.adler,t.pending_buf,t.pending-i,i)),t.gzindex=0}t.status=Wp}if(t.status===Wp){if(t.gzhead.comment){let i=t.pending,s;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>i&&(r.adler=Ur(r.adler,t.pending_buf,t.pending-i,i)),kn(r),t.pending!==0)return t.last_flush=-1,jr;i=0}t.gzindex<t.gzhead.comment.length?s=t.gzhead.comment.charCodeAt(t.gzindex++)&255:s=0,bt(t,s)}while(s!==0);t.gzhead.hcrc&&t.pending>i&&(r.adler=Ur(r.adler,t.pending_buf,t.pending-i,i))}t.status=Yp}if(t.status===Yp){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(kn(r),t.pending!==0))return t.last_flush=-1,jr;bt(t,r.adler&255),bt(t,r.adler>>8&255),r.adler=0}if(t.status=Ka,kn(r),t.pending!==0)return t.last_flush=-1,jr}if(r.avail_in!==0||t.lookahead!==0||e!==Ys&&t.status!==Qc){let i=t.level===0?Uv(t,e):t.strategy===Lh?AT(t,e):t.strategy===JS?pT(t,e):Fc[t.level].func(t,e);if((i===Ja||i===qo)&&(t.status=Qc),i===an||i===Ja)return r.avail_out===0&&(t.last_flush=-1),jr;if(i===Yo&&(e===WS?jS(t):e!==Rv&&(Fp(t,0,0,!1),e===YS&&(Xs(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),kn(r),r.avail_out===0))return t.last_flush=-1,jr}return e!==ti?jr:t.wrap<=0?Dv:(t.wrap===2?(bt(t,r.adler&255),bt(t,r.adler>>8&255),bt(t,r.adler>>16&255),bt(t,r.adler>>24&255),bt(t,r.total_in&255),bt(t,r.total_in>>8&255),bt(t,r.total_in>>16&255),bt(t,r.total_in>>24&255)):(Oc(t,r.adler>>>16),Oc(t,r.adler&65535)),kn(r),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?jr:Dv)},ET=r=>{if(zc(r))return Hi;const e=r.state.status;return r.state=null,e===Ka?Za(r,qS):jr},xT=(r,e)=>{let t=e.length;if(zc(r))return Hi;const n=r.state,i=n.wrap;if(i===2||i===1&&n.status!==Wo||n.lookahead)return Hi;if(i===1&&(r.adler=kc(r.adler,e,t,0)),n.wrap=0,t>=n.w_size){i===0&&(Xs(n.head),n.strstart=0,n.block_start=0,n.insert=0);let h=new Uint8Array(n.w_size);h.set(e.subarray(t-n.w_size,t),0),e=h,t=n.w_size}const s=r.avail_in,o=r.next_in,c=r.input;for(r.avail_in=t,r.next_in=0,r.input=e,Xo(n);n.lookahead>=It;){let h=n.strstart,u=n.lookahead-(It-1);do n.ins_h=Ks(n,n.ins_h,n.window[h+It-1]),n.prev[h&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=h,h++;while(--u);n.strstart=h,n.lookahead=It-1,Xo(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=It-1,n.match_available=0,r.next_in=o,r.input=c,r.avail_in=s,n.wrap=i,jr};var wT=vT,IT=Qv,CT=kv,MT=Pv,ST=_T,TT=yT,BT=ET,bT=xT,RT="pako deflate (from Nodeca project)",Hc={deflateInit:wT,deflateInit2:IT,deflateReset:CT,deflateResetKeep:MT,deflateSetHeader:ST,deflate:TT,deflateEnd:BT,deflateSetDictionary:bT,deflateInfo:RT};const DT=(r,e)=>Object.prototype.hasOwnProperty.call(r,e);var LT=function(r){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const t=e.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const n in t)DT(t,n)&&(r[n]=t[n])}}return r},NT=r=>{let e=0;for(let n=0,i=r.length;n<i;n++)e+=r[n].length;const t=new Uint8Array(e);for(let n=0,i=0,s=r.length;n<s;n++){let o=r[n];t.set(o,i),i+=o.length}return t},Uh={assign:LT,flattenChunks:NT};let Ov=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Ov=!1}const Gc=new Uint8Array(256);for(let r=0;r<256;r++)Gc[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;Gc[254]=Gc[254]=1;var UT=r=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(r);let e,t,n,i,s,o=r.length,c=0;for(i=0;i<o;i++)t=r.charCodeAt(i),(t&64512)===55296&&i+1<o&&(n=r.charCodeAt(i+1),(n&64512)===56320&&(t=65536+(t-55296<<10)+(n-56320),i++)),c+=t<128?1:t<2048?2:t<65536?3:4;for(e=new Uint8Array(c),s=0,i=0;s<c;i++)t=r.charCodeAt(i),(t&64512)===55296&&i+1<o&&(n=r.charCodeAt(i+1),(n&64512)===56320&&(t=65536+(t-55296<<10)+(n-56320),i++)),t<128?e[s++]=t:t<2048?(e[s++]=192|t>>>6,e[s++]=128|t&63):t<65536?(e[s++]=224|t>>>12,e[s++]=128|t>>>6&63,e[s++]=128|t&63):(e[s++]=240|t>>>18,e[s++]=128|t>>>12&63,e[s++]=128|t>>>6&63,e[s++]=128|t&63);return e};const PT=(r,e)=>{if(e<65534&&r.subarray&&Ov)return String.fromCharCode.apply(null,r.length===e?r:r.subarray(0,e));let t="";for(let n=0;n<e;n++)t+=String.fromCharCode(r[n]);return t};var kT=(r,e)=>{const t=e||r.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(r.subarray(0,e));let n,i;const s=new Array(t*2);for(i=0,n=0;n<t;){let o=r[n++];if(o<128){s[i++]=o;continue}let c=Gc[o];if(c>4){s[i++]=65533,n+=c-1;continue}for(o&=c===2?31:c===3?15:7;c>1&&n<t;)o=o<<6|r[n++]&63,c--;if(c>1){s[i++]=65533;continue}o<65536?s[i++]=o:(o-=65536,s[i++]=55296|o>>10&1023,s[i++]=56320|o&1023)}return PT(s,i)},QT=(r,e)=>{e=e||r.length,e>r.length&&(e=r.length);let t=e-1;for(;t>=0&&(r[t]&192)===128;)t--;return t<0||t===0?e:t+Gc[r[t]]>e?t:e},Vc={string2buf:UT,buf2string:kT,utf8border:QT};function OT(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Fv=OT;const zv=Object.prototype.toString,{Z_NO_FLUSH:FT,Z_SYNC_FLUSH:zT,Z_FULL_FLUSH:HT,Z_FINISH:GT,Z_OK:Ph,Z_STREAM_END:VT,Z_DEFAULT_COMPRESSION:jT,Z_DEFAULT_STRATEGY:WT,Z_DEFLATED:YT}=Xa;function jc(r){this.options=Uh.assign({level:jT,method:YT,chunkSize:16384,windowBits:15,memLevel:8,strategy:WT},r||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Fv,this.strm.avail_out=0;let t=Hc.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(t!==Ph)throw new Error(qa[t]);if(e.header&&Hc.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=Vc.string2buf(e.dictionary):zv.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,t=Hc.deflateSetDictionary(this.strm,n),t!==Ph)throw new Error(qa[t]);this._dict_set=!0}}jc.prototype.push=function(r,e){const t=this.strm,n=this.options.chunkSize;let i,s;if(this.ended)return!1;for(e===~~e?s=e:s=e===!0?GT:FT,typeof r=="string"?t.input=Vc.string2buf(r):zv.call(r)==="[object ArrayBuffer]"?t.input=new Uint8Array(r):t.input=r,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(n),t.next_out=0,t.avail_out=n),(s===zT||s===HT)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(i=Hc.deflate(t,s),i===VT)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),i=Hc.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Ph;if(t.avail_out===0){this.onData(t.output);continue}if(s>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0},jc.prototype.onData=function(r){this.chunks.push(r)},jc.prototype.onEnd=function(r){r===Ph&&(this.result=Uh.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function Kp(r,e){const t=new jc(e);if(t.push(r,!0),t.err)throw t.msg||qa[t.err];return t.result}function qT(r,e){return e=e||{},e.raw=!0,Kp(r,e)}function XT(r,e){return e=e||{},e.gzip=!0,Kp(r,e)}var KT=jc,JT=Kp,ZT=qT,$T=XT,e4=Xa,t4={Deflate:KT,deflate:JT,deflateRaw:ZT,gzip:$T,constants:e4};const kh=16209,r4=16191;var n4=function(r,e){let t,n,i,s,o,c,h,u,d,A,p,g,v,E,m,_,w,x,I,R,S,T,D,b;const M=r.state;t=r.next_in,D=r.input,n=t+(r.avail_in-5),i=r.next_out,b=r.output,s=i-(e-r.avail_out),o=i+(r.avail_out-257),c=M.dmax,h=M.wsize,u=M.whave,d=M.wnext,A=M.window,p=M.hold,g=M.bits,v=M.lencode,E=M.distcode,m=(1<<M.lenbits)-1,_=(1<<M.distbits)-1;e:do{g<15&&(p+=D[t++]<<g,g+=8,p+=D[t++]<<g,g+=8),w=v[p&m];t:for(;;){if(x=w>>>24,p>>>=x,g-=x,x=w>>>16&255,x===0)b[i++]=w&65535;else if(x&16){I=w&65535,x&=15,x&&(g<x&&(p+=D[t++]<<g,g+=8),I+=p&(1<<x)-1,p>>>=x,g-=x),g<15&&(p+=D[t++]<<g,g+=8,p+=D[t++]<<g,g+=8),w=E[p&_];r:for(;;){if(x=w>>>24,p>>>=x,g-=x,x=w>>>16&255,x&16){if(R=w&65535,x&=15,g<x&&(p+=D[t++]<<g,g+=8,g<x&&(p+=D[t++]<<g,g+=8)),R+=p&(1<<x)-1,R>c){r.msg="invalid distance too far back",M.mode=kh;break e}if(p>>>=x,g-=x,x=i-s,R>x){if(x=R-x,x>u&&M.sane){r.msg="invalid distance too far back",M.mode=kh;break e}if(S=0,T=A,d===0){if(S+=h-x,x<I){I-=x;do b[i++]=A[S++];while(--x);S=i-R,T=b}}else if(d<x){if(S+=h+d-x,x-=d,x<I){I-=x;do b[i++]=A[S++];while(--x);if(S=0,d<I){x=d,I-=x;do b[i++]=A[S++];while(--x);S=i-R,T=b}}}else if(S+=d-x,x<I){I-=x;do b[i++]=A[S++];while(--x);S=i-R,T=b}for(;I>2;)b[i++]=T[S++],b[i++]=T[S++],b[i++]=T[S++],I-=3;I&&(b[i++]=T[S++],I>1&&(b[i++]=T[S++]))}else{S=i-R;do b[i++]=b[S++],b[i++]=b[S++],b[i++]=b[S++],I-=3;while(I>2);I&&(b[i++]=b[S++],I>1&&(b[i++]=b[S++]))}}else if(x&64){r.msg="invalid distance code",M.mode=kh;break e}else{w=E[(w&65535)+(p&(1<<x)-1)];continue r}break}}else if(x&64)if(x&32){M.mode=r4;break e}else{r.msg="invalid literal/length code",M.mode=kh;break e}else{w=v[(w&65535)+(p&(1<<x)-1)];continue t}break}}while(t<n&&i<o);I=g>>3,t-=I,g-=I<<3,p&=(1<<g)-1,r.next_in=t,r.next_out=i,r.avail_in=t<n?5+(n-t):5-(t-n),r.avail_out=i<o?257+(o-i):257-(i-o),M.hold=p,M.bits=g};const Jo=15,Hv=852,Gv=592,Vv=0,Jp=1,jv=2,i4=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),s4=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),a4=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),o4=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Wc=(r,e,t,n,i,s,o,c)=>{const h=c.bits;let u=0,d=0,A=0,p=0,g=0,v=0,E=0,m=0,_=0,w=0,x,I,R,S,T,D=null,b;const M=new Uint16Array(Jo+1),L=new Uint16Array(Jo+1);let P=null,N,j,X;for(u=0;u<=Jo;u++)M[u]=0;for(d=0;d<n;d++)M[e[t+d]]++;for(g=h,p=Jo;p>=1&&M[p]===0;p--);if(g>p&&(g=p),p===0)return i[s++]=1<<24|64<<16|0,i[s++]=1<<24|64<<16|0,c.bits=1,0;for(A=1;A<p&&M[A]===0;A++);for(g<A&&(g=A),m=1,u=1;u<=Jo;u++)if(m<<=1,m-=M[u],m<0)return-1;if(m>0&&(r===Vv||p!==1))return-1;for(L[1]=0,u=1;u<Jo;u++)L[u+1]=L[u]+M[u];for(d=0;d<n;d++)e[t+d]!==0&&(o[L[e[t+d]]++]=d);if(r===Vv?(D=P=o,b=20):r===Jp?(D=i4,P=s4,b=257):(D=a4,P=o4,b=0),w=0,d=0,u=A,T=s,v=g,E=0,R=-1,_=1<<g,S=_-1,r===Jp&&_>Hv||r===jv&&_>Gv)return 1;for(;;){N=u-E,o[d]+1<b?(j=0,X=o[d]):o[d]>=b?(j=P[o[d]-b],X=D[o[d]-b]):(j=32+64,X=0),x=1<<u-E,I=1<<v,A=I;do I-=x,i[T+(w>>E)+I]=N<<24|j<<16|X|0;while(I!==0);for(x=1<<u-1;w&x;)x>>=1;if(x!==0?(w&=x-1,w+=x):w=0,d++,--M[u]===0){if(u===p)break;u=e[t+o[d]]}if(u>g&&(w&S)!==R){for(E===0&&(E=g),T+=A,v=u-E,m=1<<v;v+E<p&&(m-=M[v+E],!(m<=0));)v++,m<<=1;if(_+=1<<v,r===Jp&&_>Hv||r===jv&&_>Gv)return 1;R=w&S,i[R]=g<<24|v<<16|T-s|0}}return w!==0&&(i[T+w]=u-E<<24|64<<16|0),c.bits=g,0};const l4=0,Wv=1,Yv=2,{Z_FINISH:qv,Z_BLOCK:c4,Z_TREES:Qh,Z_OK:$a,Z_STREAM_END:u4,Z_NEED_DICT:h4,Z_STREAM_ERROR:_i,Z_DATA_ERROR:Xv,Z_MEM_ERROR:Kv,Z_BUF_ERROR:d4,Z_DEFLATED:Jv}=Xa,Oh=16180,Zv=16181,$v=16182,ey=16183,ty=16184,ry=16185,ny=16186,iy=16187,sy=16188,ay=16189,Fh=16190,us=16191,Zp=16192,oy=16193,$p=16194,ly=16195,cy=16196,uy=16197,hy=16198,zh=16199,Hh=16200,dy=16201,fy=16202,py=16203,Ay=16204,gy=16205,eA=16206,my=16207,_y=16208,Jt=16209,vy=16210,yy=16211,f4=852,p4=592,A4=15,g4=A4,Ey=r=>(r>>>24&255)+(r>>>8&65280)+((r&65280)<<8)+((r&255)<<24);function m4(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const eo=r=>{if(!r)return 1;const e=r.state;return!e||e.strm!==r||e.mode<Oh||e.mode>yy?1:0},xy=r=>{if(eo(r))return _i;const e=r.state;return r.total_in=r.total_out=e.total=0,r.msg="",e.wrap&&(r.adler=e.wrap&1),e.mode=Oh,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(f4),e.distcode=e.distdyn=new Int32Array(p4),e.sane=1,e.back=-1,$a},wy=r=>{if(eo(r))return _i;const e=r.state;return e.wsize=0,e.whave=0,e.wnext=0,xy(r)},Iy=(r,e)=>{let t;if(eo(r))return _i;const n=r.state;return e<0?(t=0,e=-e):(t=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?_i:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=t,n.wbits=e,wy(r))},Cy=(r,e)=>{if(!r)return _i;const t=new m4;r.state=t,t.strm=r,t.window=null,t.mode=Oh;const n=Iy(r,e);return n!==$a&&(r.state=null),n},_4=r=>Cy(r,g4);let My=!0,tA,rA;const v4=r=>{if(My){tA=new Int32Array(512),rA=new Int32Array(32);let e=0;for(;e<144;)r.lens[e++]=8;for(;e<256;)r.lens[e++]=9;for(;e<280;)r.lens[e++]=7;for(;e<288;)r.lens[e++]=8;for(Wc(Wv,r.lens,0,288,tA,0,r.work,{bits:9}),e=0;e<32;)r.lens[e++]=5;Wc(Yv,r.lens,0,32,rA,0,r.work,{bits:5}),My=!1}r.lencode=tA,r.lenbits=9,r.distcode=rA,r.distbits=5},Sy=(r,e,t,n)=>{let i;const s=r.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),n>=s.wsize?(s.window.set(e.subarray(t-s.wsize,t),0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>n&&(i=n),s.window.set(e.subarray(t-n,t-n+i),s.wnext),n-=i,n?(s.window.set(e.subarray(t-n,t),0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0},y4=(r,e)=>{let t,n,i,s,o,c,h,u,d,A,p,g,v,E,m=0,_,w,x,I,R,S,T,D;const b=new Uint8Array(4);let M,L;const P=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(eo(r)||!r.output||!r.input&&r.avail_in!==0)return _i;t=r.state,t.mode===us&&(t.mode=Zp),o=r.next_out,i=r.output,h=r.avail_out,s=r.next_in,n=r.input,c=r.avail_in,u=t.hold,d=t.bits,A=c,p=h,D=$a;e:for(;;)switch(t.mode){case Oh:if(t.wrap===0){t.mode=Zp;break}for(;d<16;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(t.wrap&2&&u===35615){t.wbits===0&&(t.wbits=15),t.check=0,b[0]=u&255,b[1]=u>>>8&255,t.check=Ur(t.check,b,2,0),u=0,d=0,t.mode=Zv;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((u&255)<<8)+(u>>8))%31){r.msg="incorrect header check",t.mode=Jt;break}if((u&15)!==Jv){r.msg="unknown compression method",t.mode=Jt;break}if(u>>>=4,d-=4,T=(u&15)+8,t.wbits===0&&(t.wbits=T),T>15||T>t.wbits){r.msg="invalid window size",t.mode=Jt;break}t.dmax=1<<t.wbits,t.flags=0,r.adler=t.check=1,t.mode=u&512?ay:us,u=0,d=0;break;case Zv:for(;d<16;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(t.flags=u,(t.flags&255)!==Jv){r.msg="unknown compression method",t.mode=Jt;break}if(t.flags&57344){r.msg="unknown header flags set",t.mode=Jt;break}t.head&&(t.head.text=u>>8&1),t.flags&512&&t.wrap&4&&(b[0]=u&255,b[1]=u>>>8&255,t.check=Ur(t.check,b,2,0)),u=0,d=0,t.mode=$v;case $v:for(;d<32;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}t.head&&(t.head.time=u),t.flags&512&&t.wrap&4&&(b[0]=u&255,b[1]=u>>>8&255,b[2]=u>>>16&255,b[3]=u>>>24&255,t.check=Ur(t.check,b,4,0)),u=0,d=0,t.mode=ey;case ey:for(;d<16;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}t.head&&(t.head.xflags=u&255,t.head.os=u>>8),t.flags&512&&t.wrap&4&&(b[0]=u&255,b[1]=u>>>8&255,t.check=Ur(t.check,b,2,0)),u=0,d=0,t.mode=ty;case ty:if(t.flags&1024){for(;d<16;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}t.length=u,t.head&&(t.head.extra_len=u),t.flags&512&&t.wrap&4&&(b[0]=u&255,b[1]=u>>>8&255,t.check=Ur(t.check,b,2,0)),u=0,d=0}else t.head&&(t.head.extra=null);t.mode=ry;case ry:if(t.flags&1024&&(g=t.length,g>c&&(g=c),g&&(t.head&&(T=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(n.subarray(s,s+g),T)),t.flags&512&&t.wrap&4&&(t.check=Ur(t.check,n,g,s)),c-=g,s+=g,t.length-=g),t.length))break e;t.length=0,t.mode=ny;case ny:if(t.flags&2048){if(c===0)break e;g=0;do T=n[s+g++],t.head&&T&&t.length<65536&&(t.head.name+=String.fromCharCode(T));while(T&&g<c);if(t.flags&512&&t.wrap&4&&(t.check=Ur(t.check,n,g,s)),c-=g,s+=g,T)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=iy;case iy:if(t.flags&4096){if(c===0)break e;g=0;do T=n[s+g++],t.head&&T&&t.length<65536&&(t.head.comment+=String.fromCharCode(T));while(T&&g<c);if(t.flags&512&&t.wrap&4&&(t.check=Ur(t.check,n,g,s)),c-=g,s+=g,T)break e}else t.head&&(t.head.comment=null);t.mode=sy;case sy:if(t.flags&512){for(;d<16;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(t.wrap&4&&u!==(t.check&65535)){r.msg="header crc mismatch",t.mode=Jt;break}u=0,d=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),r.adler=t.check=0,t.mode=us;break;case ay:for(;d<32;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}r.adler=t.check=Ey(u),u=0,d=0,t.mode=Fh;case Fh:if(t.havedict===0)return r.next_out=o,r.avail_out=h,r.next_in=s,r.avail_in=c,t.hold=u,t.bits=d,h4;r.adler=t.check=1,t.mode=us;case us:if(e===c4||e===Qh)break e;case Zp:if(t.last){u>>>=d&7,d-=d&7,t.mode=eA;break}for(;d<3;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}switch(t.last=u&1,u>>>=1,d-=1,u&3){case 0:t.mode=oy;break;case 1:if(v4(t),t.mode=zh,e===Qh){u>>>=2,d-=2;break e}break;case 2:t.mode=cy;break;case 3:r.msg="invalid block type",t.mode=Jt}u>>>=2,d-=2;break;case oy:for(u>>>=d&7,d-=d&7;d<32;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if((u&65535)!==(u>>>16^65535)){r.msg="invalid stored block lengths",t.mode=Jt;break}if(t.length=u&65535,u=0,d=0,t.mode=$p,e===Qh)break e;case $p:t.mode=ly;case ly:if(g=t.length,g){if(g>c&&(g=c),g>h&&(g=h),g===0)break e;i.set(n.subarray(s,s+g),o),c-=g,s+=g,h-=g,o+=g,t.length-=g;break}t.mode=us;break;case cy:for(;d<14;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(t.nlen=(u&31)+257,u>>>=5,d-=5,t.ndist=(u&31)+1,u>>>=5,d-=5,t.ncode=(u&15)+4,u>>>=4,d-=4,t.nlen>286||t.ndist>30){r.msg="too many length or distance symbols",t.mode=Jt;break}t.have=0,t.mode=uy;case uy:for(;t.have<t.ncode;){for(;d<3;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}t.lens[P[t.have++]]=u&7,u>>>=3,d-=3}for(;t.have<19;)t.lens[P[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,M={bits:t.lenbits},D=Wc(l4,t.lens,0,19,t.lencode,0,t.work,M),t.lenbits=M.bits,D){r.msg="invalid code lengths set",t.mode=Jt;break}t.have=0,t.mode=hy;case hy:for(;t.have<t.nlen+t.ndist;){for(;m=t.lencode[u&(1<<t.lenbits)-1],_=m>>>24,w=m>>>16&255,x=m&65535,!(_<=d);){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(x<16)u>>>=_,d-=_,t.lens[t.have++]=x;else{if(x===16){for(L=_+2;d<L;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(u>>>=_,d-=_,t.have===0){r.msg="invalid bit length repeat",t.mode=Jt;break}T=t.lens[t.have-1],g=3+(u&3),u>>>=2,d-=2}else if(x===17){for(L=_+3;d<L;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}u>>>=_,d-=_,T=0,g=3+(u&7),u>>>=3,d-=3}else{for(L=_+7;d<L;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}u>>>=_,d-=_,T=0,g=11+(u&127),u>>>=7,d-=7}if(t.have+g>t.nlen+t.ndist){r.msg="invalid bit length repeat",t.mode=Jt;break}for(;g--;)t.lens[t.have++]=T}}if(t.mode===Jt)break;if(t.lens[256]===0){r.msg="invalid code -- missing end-of-block",t.mode=Jt;break}if(t.lenbits=9,M={bits:t.lenbits},D=Wc(Wv,t.lens,0,t.nlen,t.lencode,0,t.work,M),t.lenbits=M.bits,D){r.msg="invalid literal/lengths set",t.mode=Jt;break}if(t.distbits=6,t.distcode=t.distdyn,M={bits:t.distbits},D=Wc(Yv,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,M),t.distbits=M.bits,D){r.msg="invalid distances set",t.mode=Jt;break}if(t.mode=zh,e===Qh)break e;case zh:t.mode=Hh;case Hh:if(c>=6&&h>=258){r.next_out=o,r.avail_out=h,r.next_in=s,r.avail_in=c,t.hold=u,t.bits=d,n4(r,p),o=r.next_out,i=r.output,h=r.avail_out,s=r.next_in,n=r.input,c=r.avail_in,u=t.hold,d=t.bits,t.mode===us&&(t.back=-1);break}for(t.back=0;m=t.lencode[u&(1<<t.lenbits)-1],_=m>>>24,w=m>>>16&255,x=m&65535,!(_<=d);){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(w&&!(w&240)){for(I=_,R=w,S=x;m=t.lencode[S+((u&(1<<I+R)-1)>>I)],_=m>>>24,w=m>>>16&255,x=m&65535,!(I+_<=d);){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}u>>>=I,d-=I,t.back+=I}if(u>>>=_,d-=_,t.back+=_,t.length=x,w===0){t.mode=gy;break}if(w&32){t.back=-1,t.mode=us;break}if(w&64){r.msg="invalid literal/length code",t.mode=Jt;break}t.extra=w&15,t.mode=dy;case dy:if(t.extra){for(L=t.extra;d<L;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}t.length+=u&(1<<t.extra)-1,u>>>=t.extra,d-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=fy;case fy:for(;m=t.distcode[u&(1<<t.distbits)-1],_=m>>>24,w=m>>>16&255,x=m&65535,!(_<=d);){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(!(w&240)){for(I=_,R=w,S=x;m=t.distcode[S+((u&(1<<I+R)-1)>>I)],_=m>>>24,w=m>>>16&255,x=m&65535,!(I+_<=d);){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}u>>>=I,d-=I,t.back+=I}if(u>>>=_,d-=_,t.back+=_,w&64){r.msg="invalid distance code",t.mode=Jt;break}t.offset=x,t.extra=w&15,t.mode=py;case py:if(t.extra){for(L=t.extra;d<L;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}t.offset+=u&(1<<t.extra)-1,u>>>=t.extra,d-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){r.msg="invalid distance too far back",t.mode=Jt;break}t.mode=Ay;case Ay:if(h===0)break e;if(g=p-h,t.offset>g){if(g=t.offset-g,g>t.whave&&t.sane){r.msg="invalid distance too far back",t.mode=Jt;break}g>t.wnext?(g-=t.wnext,v=t.wsize-g):v=t.wnext-g,g>t.length&&(g=t.length),E=t.window}else E=i,v=o-t.offset,g=t.length;g>h&&(g=h),h-=g,t.length-=g;do i[o++]=E[v++];while(--g);t.length===0&&(t.mode=Hh);break;case gy:if(h===0)break e;i[o++]=t.length,h--,t.mode=Hh;break;case eA:if(t.wrap){for(;d<32;){if(c===0)break e;c--,u|=n[s++]<<d,d+=8}if(p-=h,r.total_out+=p,t.total+=p,t.wrap&4&&p&&(r.adler=t.check=t.flags?Ur(t.check,i,p,o-p):kc(t.check,i,p,o-p)),p=h,t.wrap&4&&(t.flags?u:Ey(u))!==t.check){r.msg="incorrect data check",t.mode=Jt;break}u=0,d=0}t.mode=my;case my:if(t.wrap&&t.flags){for(;d<32;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(t.wrap&4&&u!==(t.total&4294967295)){r.msg="incorrect length check",t.mode=Jt;break}u=0,d=0}t.mode=_y;case _y:D=u4;break e;case Jt:D=Xv;break e;case vy:return Kv;case yy:default:return _i}return r.next_out=o,r.avail_out=h,r.next_in=s,r.avail_in=c,t.hold=u,t.bits=d,(t.wsize||p!==r.avail_out&&t.mode<Jt&&(t.mode<eA||e!==qv))&&Sy(r,r.output,r.next_out,p-r.avail_out),A-=r.avail_in,p-=r.avail_out,r.total_in+=A,r.total_out+=p,t.total+=p,t.wrap&4&&p&&(r.adler=t.check=t.flags?Ur(t.check,i,p,r.next_out-p):kc(t.check,i,p,r.next_out-p)),r.data_type=t.bits+(t.last?64:0)+(t.mode===us?128:0)+(t.mode===zh||t.mode===$p?256:0),(A===0&&p===0||e===qv)&&D===$a&&(D=d4),D},E4=r=>{if(eo(r))return _i;let e=r.state;return e.window&&(e.window=null),r.state=null,$a},x4=(r,e)=>{if(eo(r))return _i;const t=r.state;return t.wrap&2?(t.head=e,e.done=!1,$a):_i},w4=(r,e)=>{const t=e.length;let n,i,s;return eo(r)||(n=r.state,n.wrap!==0&&n.mode!==Fh)?_i:n.mode===Fh&&(i=1,i=kc(i,e,t,0),i!==n.check)?Xv:(s=Sy(r,e,t,t),s?(n.mode=vy,Kv):(n.havedict=1,$a))};var I4=wy,C4=Iy,M4=xy,S4=_4,T4=Cy,B4=y4,b4=E4,R4=x4,D4=w4,L4="pako inflate (from Nodeca project)",hs={inflateReset:I4,inflateReset2:C4,inflateResetKeep:M4,inflateInit:S4,inflateInit2:T4,inflate:B4,inflateEnd:b4,inflateGetHeader:R4,inflateSetDictionary:D4,inflateInfo:L4};function N4(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var U4=N4;const Ty=Object.prototype.toString,{Z_NO_FLUSH:P4,Z_FINISH:k4,Z_OK:Yc,Z_STREAM_END:nA,Z_NEED_DICT:iA,Z_STREAM_ERROR:Q4,Z_DATA_ERROR:By,Z_MEM_ERROR:O4}=Xa;function qc(r){this.options=Uh.assign({chunkSize:1024*64,windowBits:15,to:""},r||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(r&&r.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Fv,this.strm.avail_out=0;let t=hs.inflateInit2(this.strm,e.windowBits);if(t!==Yc)throw new Error(qa[t]);if(this.header=new U4,hs.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Vc.string2buf(e.dictionary):Ty.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=hs.inflateSetDictionary(this.strm,e.dictionary),t!==Yc)))throw new Error(qa[t])}qc.prototype.push=function(r,e){const t=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let s,o,c;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?k4:P4,Ty.call(r)==="[object ArrayBuffer]"?t.input=new Uint8Array(r):t.input=r,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(n),t.next_out=0,t.avail_out=n),s=hs.inflate(t,o),s===iA&&i&&(s=hs.inflateSetDictionary(t,i),s===Yc?s=hs.inflate(t,o):s===By&&(s=iA));t.avail_in>0&&s===nA&&t.state.wrap>0&&r[t.next_in]!==0;)hs.inflateReset(t),s=hs.inflate(t,o);switch(s){case Q4:case By:case iA:case O4:return this.onEnd(s),this.ended=!0,!1}if(c=t.avail_out,t.next_out&&(t.avail_out===0||s===nA))if(this.options.to==="string"){let h=Vc.utf8border(t.output,t.next_out),u=t.next_out-h,d=Vc.buf2string(t.output,h);t.next_out=u,t.avail_out=n-u,u&&t.output.set(t.output.subarray(h,h+u),0),this.onData(d)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(s===Yc&&c===0)){if(s===nA)return s=hs.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(t.avail_in===0)break}}return!0},qc.prototype.onData=function(r){this.chunks.push(r)},qc.prototype.onEnd=function(r){r===Yc&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Uh.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function sA(r,e){const t=new qc(e);if(t.push(r),t.err)throw t.msg||qa[t.err];return t.result}function F4(r,e){return e=e||{},e.raw=!0,sA(r,e)}var z4=qc,H4=sA,G4=F4,V4=sA,j4=Xa,W4={Inflate:z4,inflate:H4,inflateRaw:G4,ungzip:V4,constants:j4};const{Deflate:Y4,deflate:q4,deflateRaw:X4,gzip:K4}=t4,{Inflate:J4,inflate:Z4,inflateRaw:$4,ungzip:eB}=W4;var tB=Y4,rB=q4,nB=X4,iB=K4,sB=J4,aB=Z4,oB=$4,lB=eB,cB=Xa,uB={Deflate:tB,deflate:rB,deflateRaw:nB,gzip:iB,Inflate:sB,inflate:aB,inflateRaw:oB,ungzip:lB,constants:cB},hB=r=>{if(r===""||!r)return"";let e=r.split("/"),t=`$$${e[1].slice(-10)}${e[3].slice(-9)}`;return String(Bp.MD5(t))};async function dB(r){return await(await fetch(r,{method:"GET"})).arrayBuffer()}function fB(r){return uB.ungzip(r,{to:"string"})}var pB=r=>{let e=window.atob(r),t=e.length,n=new Uint8Array(t);for(let i=0;i<t;i+=1)n[i]=e.charCodeAt(i);return n.buffer};async function AB(r,e){let t=hB(e),n=Bp.AES.decrypt(r,t).toString(Bp.enc.Latin1);return pB(n)}async function gB(r,e){let t=e||`org/${r.split("org/")[1].split("/universal")[0]}`,n=Date.now(),i=await dB(r),s=Date.now()-n;n=Date.now();let o=fB(i),c=Date.now()-n;n=Date.now();let h=await AB(o,t),u=Date.now()-n;return{decodedData:h,events:{fileDownloadTime:s,fileUnzipTime:c,fileDecryptionTime:u}}}var mB=gB;/**
32
+ */return t.mode.CTRGladman=function(){var n=t.lib.BlockCipherMode.extend();function i(c){if((c>>24&255)===255){var h=c>>16&255,u=c>>8&255,d=c&255;h===255?(h=0,u===255?(u=0,d===255?d=0:++d):++u):++h,c=0,c+=h<<16,c+=u<<8,c+=d}else c+=1<<24;return c}function s(c){return(c[0]=i(c[0]))===0&&(c[1]=i(c[1])),c}var o=n.Encryptor=n.extend({processBlock:function(c,h){var u=this._cipher,d=u.blockSize,A=this._iv,p=this._counter;A&&(p=this._counter=A.slice(0),this._iv=void 0),s(p);var g=p.slice(0);u.encryptBlock(g,0);for(var v=0;v<d;v++)c[h+v]^=g[v]}});return n.Decryptor=o,n}(),t.mode.CTRGladman})}(L_)),L_.exports}var U_={exports:{}},P_;function tS(){return P_||(P_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Nr())})(mt,function(t){return t.mode.OFB=function(){var n=t.lib.BlockCipherMode.extend(),i=n.Encryptor=n.extend({processBlock:function(s,o){var c=this._cipher,h=c.blockSize,u=this._iv,d=this._keystream;u&&(d=this._keystream=u.slice(0),this._iv=void 0),c.encryptBlock(d,0);for(var A=0;A<h;A++)s[o+A]^=d[A]}});return n.Decryptor=i,n}(),t.mode.OFB})}(U_)),U_.exports}var k_={exports:{}},Q_;function rS(){return Q_||(Q_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Nr())})(mt,function(t){return t.mode.ECB=function(){var n=t.lib.BlockCipherMode.extend();return n.Encryptor=n.extend({processBlock:function(i,s){this._cipher.encryptBlock(i,s)}}),n.Decryptor=n.extend({processBlock:function(i,s){this._cipher.decryptBlock(i,s)}}),n}(),t.mode.ECB})}(k_)),k_.exports}var O_={exports:{}},F_;function nS(){return F_||(F_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Nr())})(mt,function(t){return t.pad.AnsiX923={pad:function(n,i){var s=n.sigBytes,o=i*4,c=o-s%o,h=s+c-1;n.clamp(),n.words[h>>>2]|=c<<24-h%4*8,n.sigBytes+=c},unpad:function(n){var i=n.words[n.sigBytes-1>>>2]&255;n.sigBytes-=i}},t.pad.Ansix923})}(O_)),O_.exports}var z_={exports:{}},H_;function iS(){return H_||(H_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Nr())})(mt,function(t){return t.pad.Iso10126={pad:function(n,i){var s=i*4,o=s-n.sigBytes%s;n.concat(t.lib.WordArray.random(o-1)).concat(t.lib.WordArray.create([o<<24],1))},unpad:function(n){var i=n.words[n.sigBytes-1>>>2]&255;n.sigBytes-=i}},t.pad.Iso10126})}(z_)),z_.exports}var G_={exports:{}},V_;function sS(){return V_||(V_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Nr())})(mt,function(t){return t.pad.Iso97971={pad:function(n,i){n.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(n,i)},unpad:function(n){t.pad.ZeroPadding.unpad(n),n.sigBytes--}},t.pad.Iso97971})}(G_)),G_.exports}var j_={exports:{}},W_;function aS(){return W_||(W_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Nr())})(mt,function(t){return t.pad.ZeroPadding={pad:function(n,i){var s=i*4;n.clamp(),n.sigBytes+=s-(n.sigBytes%s||s)},unpad:function(n){for(var i=n.words,s=n.sigBytes-1,s=n.sigBytes-1;s>=0;s--)if(i[s>>>2]>>>24-s%4*8&255){n.sigBytes=s+1;break}}},t.pad.ZeroPadding})}(j_)),j_.exports}var Y_={exports:{}},q_;function oS(){return q_||(q_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Nr())})(mt,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})}(Y_)),Y_.exports}var X_={exports:{}},K_;function lS(){return K_||(K_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Nr())})(mt,function(t){return function(n){var i=t,s=i.lib,o=s.CipherParams,c=i.enc,h=c.Hex,u=i.format;u.Hex={stringify:function(d){return d.ciphertext.toString(h)},parse:function(d){var A=h.parse(d);return o.create({ciphertext:A})}}}(),t.format.Hex})}(X_)),X_.exports}var J_={exports:{}},Z_;function cS(){return Z_||(Z_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),ja(),Wa(),js(),Nr())})(mt,function(t){return function(){var n=t,i=n.lib,s=i.BlockCipher,o=n.algo,c=[],h=[],u=[],d=[],A=[],p=[],g=[],v=[],E=[],m=[];(function(){for(var x=[],I=0;I<256;I++)I<128?x[I]=I<<1:x[I]=I<<1^283;for(var R=0,S=0,I=0;I<256;I++){var T=S^S<<1^S<<2^S<<3^S<<4;T=T>>>8^T&255^99,c[R]=T,h[T]=R;var D=x[R],b=x[D],M=x[b],L=x[T]*257^T*16843008;u[R]=L<<24|L>>>8,d[R]=L<<16|L>>>16,A[R]=L<<8|L>>>24,p[R]=L;var L=M*16843009^b*65537^D*257^R*16843008;g[T]=L<<24|L>>>8,v[T]=L<<16|L>>>16,E[T]=L<<8|L>>>24,m[T]=L,R?(R=D^x[x[x[M^D]]],S^=x[x[S]]):R=S=1}})();var _=[0,1,2,4,8,16,32,64,128,27,54],w=o.AES=s.extend({_doReset:function(){var x;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var I=this._keyPriorReset=this._key,R=I.words,S=I.sigBytes/4,T=this._nRounds=S+6,D=(T+1)*4,b=this._keySchedule=[],M=0;M<D;M++)M<S?b[M]=R[M]:(x=b[M-1],M%S?S>6&&M%S==4&&(x=c[x>>>24]<<24|c[x>>>16&255]<<16|c[x>>>8&255]<<8|c[x&255]):(x=x<<8|x>>>24,x=c[x>>>24]<<24|c[x>>>16&255]<<16|c[x>>>8&255]<<8|c[x&255],x^=_[M/S|0]<<24),b[M]=b[M-S]^x);for(var L=this._invKeySchedule=[],P=0;P<D;P++){var M=D-P;if(P%4)var x=b[M];else var x=b[M-4];P<4||M<=4?L[P]=x:L[P]=g[c[x>>>24]]^v[c[x>>>16&255]]^E[c[x>>>8&255]]^m[c[x&255]]}}},encryptBlock:function(x,I){this._doCryptBlock(x,I,this._keySchedule,u,d,A,p,c)},decryptBlock:function(x,I){var R=x[I+1];x[I+1]=x[I+3],x[I+3]=R,this._doCryptBlock(x,I,this._invKeySchedule,g,v,E,m,h);var R=x[I+1];x[I+1]=x[I+3],x[I+3]=R},_doCryptBlock:function(x,I,R,S,T,D,b,M){for(var L=this._nRounds,P=x[I]^R[0],N=x[I+1]^R[1],j=x[I+2]^R[2],X=x[I+3]^R[3],K=4,ne=1;ne<L;ne++){var V=S[P>>>24]^T[N>>>16&255]^D[j>>>8&255]^b[X&255]^R[K++],te=S[N>>>24]^T[j>>>16&255]^D[X>>>8&255]^b[P&255]^R[K++],Q=S[j>>>24]^T[X>>>16&255]^D[P>>>8&255]^b[N&255]^R[K++],z=S[X>>>24]^T[P>>>16&255]^D[N>>>8&255]^b[j&255]^R[K++];P=V,N=te,j=Q,X=z}var V=(M[P>>>24]<<24|M[N>>>16&255]<<16|M[j>>>8&255]<<8|M[X&255])^R[K++],te=(M[N>>>24]<<24|M[j>>>16&255]<<16|M[X>>>8&255]<<8|M[P&255])^R[K++],Q=(M[j>>>24]<<24|M[X>>>16&255]<<16|M[P>>>8&255]<<8|M[N&255])^R[K++],z=(M[X>>>24]<<24|M[P>>>16&255]<<16|M[N>>>8&255]<<8|M[j&255])^R[K++];x[I]=V,x[I+1]=te,x[I+2]=Q,x[I+3]=z},keySize:256/32});n.AES=s._createHelper(w)}(),t.AES})}(J_)),J_.exports}var $_={exports:{}},ev;function uS(){return ev||(ev=1,function(r,e){(function(t,n,i){r.exports=n(wt(),ja(),Wa(),js(),Nr())})(mt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=i.BlockCipher,c=n.algo,h=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],u=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],d=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],A=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],p=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],g=c.DES=o.extend({_doReset:function(){for(var _=this._key,w=_.words,x=[],I=0;I<56;I++){var R=h[I]-1;x[I]=w[R>>>5]>>>31-R%32&1}for(var S=this._subKeys=[],T=0;T<16;T++){for(var D=S[T]=[],b=d[T],I=0;I<24;I++)D[I/6|0]|=x[(u[I]-1+b)%28]<<31-I%6,D[4+(I/6|0)]|=x[28+(u[I+24]-1+b)%28]<<31-I%6;D[0]=D[0]<<1|D[0]>>>31;for(var I=1;I<7;I++)D[I]=D[I]>>>(I-1)*4+3;D[7]=D[7]<<5|D[7]>>>27}for(var M=this._invSubKeys=[],I=0;I<16;I++)M[I]=S[15-I]},encryptBlock:function(_,w){this._doCryptBlock(_,w,this._subKeys)},decryptBlock:function(_,w){this._doCryptBlock(_,w,this._invSubKeys)},_doCryptBlock:function(_,w,x){this._lBlock=_[w],this._rBlock=_[w+1],v.call(this,4,252645135),v.call(this,16,65535),E.call(this,2,858993459),E.call(this,8,16711935),v.call(this,1,1431655765);for(var I=0;I<16;I++){for(var R=x[I],S=this._lBlock,T=this._rBlock,D=0,b=0;b<8;b++)D|=A[b][((T^R[b])&p[b])>>>0];this._lBlock=T,this._rBlock=S^D}var M=this._lBlock;this._lBlock=this._rBlock,this._rBlock=M,v.call(this,1,1431655765),E.call(this,8,16711935),E.call(this,2,858993459),v.call(this,16,65535),v.call(this,4,252645135),_[w]=this._lBlock,_[w+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function v(_,w){var x=(this._lBlock>>>_^this._rBlock)&w;this._rBlock^=x,this._lBlock^=x<<_}function E(_,w){var x=(this._rBlock>>>_^this._lBlock)&w;this._lBlock^=x,this._rBlock^=x<<_}n.DES=o._createHelper(g);var m=c.TripleDES=o.extend({_doReset:function(){var _=this._key,w=_.words;if(w.length!==2&&w.length!==4&&w.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var x=w.slice(0,2),I=w.length<4?w.slice(0,2):w.slice(2,4),R=w.length<6?w.slice(0,2):w.slice(4,6);this._des1=g.createEncryptor(s.create(x)),this._des2=g.createEncryptor(s.create(I)),this._des3=g.createEncryptor(s.create(R))},encryptBlock:function(_,w){this._des1.encryptBlock(_,w),this._des2.decryptBlock(_,w),this._des3.encryptBlock(_,w)},decryptBlock:function(_,w){this._des3.decryptBlock(_,w),this._des2.encryptBlock(_,w),this._des1.decryptBlock(_,w)},keySize:192/32,ivSize:64/32,blockSize:64/32});n.TripleDES=o._createHelper(m)}(),t.TripleDES})}($_)),$_.exports}var tv={exports:{}},rv;function hS(){return rv||(rv=1,function(r,e){(function(t,n,i){r.exports=n(wt(),ja(),Wa(),js(),Nr())})(mt,function(t){return function(){var n=t,i=n.lib,s=i.StreamCipher,o=n.algo,c=o.RC4=s.extend({_doReset:function(){for(var d=this._key,A=d.words,p=d.sigBytes,g=this._S=[],v=0;v<256;v++)g[v]=v;for(var v=0,E=0;v<256;v++){var m=v%p,_=A[m>>>2]>>>24-m%4*8&255;E=(E+g[v]+_)%256;var w=g[v];g[v]=g[E],g[E]=w}this._i=this._j=0},_doProcessBlock:function(d,A){d[A]^=h.call(this)},keySize:256/32,ivSize:0});function h(){for(var d=this._S,A=this._i,p=this._j,g=0,v=0;v<4;v++){A=(A+1)%256,p=(p+d[A])%256;var E=d[A];d[A]=d[p],d[p]=E,g|=d[(d[A]+d[p])%256]<<24-v*8}return this._i=A,this._j=p,g}n.RC4=s._createHelper(c);var u=o.RC4Drop=c.extend({cfg:c.cfg.extend({drop:192}),_doReset:function(){c._doReset.call(this);for(var d=this.cfg.drop;d>0;d--)h.call(this)}});n.RC4Drop=s._createHelper(u)}(),t.RC4})}(tv)),tv.exports}var nv={exports:{}},iv;function dS(){return iv||(iv=1,function(r,e){(function(t,n,i){r.exports=n(wt(),ja(),Wa(),js(),Nr())})(mt,function(t){return function(){var n=t,i=n.lib,s=i.StreamCipher,o=n.algo,c=[],h=[],u=[],d=o.Rabbit=s.extend({_doReset:function(){for(var p=this._key.words,g=this.cfg.iv,v=0;v<4;v++)p[v]=(p[v]<<8|p[v]>>>24)&16711935|(p[v]<<24|p[v]>>>8)&4278255360;var E=this._X=[p[0],p[3]<<16|p[2]>>>16,p[1],p[0]<<16|p[3]>>>16,p[2],p[1]<<16|p[0]>>>16,p[3],p[2]<<16|p[1]>>>16],m=this._C=[p[2]<<16|p[2]>>>16,p[0]&4294901760|p[1]&65535,p[3]<<16|p[3]>>>16,p[1]&4294901760|p[2]&65535,p[0]<<16|p[0]>>>16,p[2]&4294901760|p[3]&65535,p[1]<<16|p[1]>>>16,p[3]&4294901760|p[0]&65535];this._b=0;for(var v=0;v<4;v++)A.call(this);for(var v=0;v<8;v++)m[v]^=E[v+4&7];if(g){var _=g.words,w=_[0],x=_[1],I=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,R=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,S=I>>>16|R&4294901760,T=R<<16|I&65535;m[0]^=I,m[1]^=S,m[2]^=R,m[3]^=T,m[4]^=I,m[5]^=S,m[6]^=R,m[7]^=T;for(var v=0;v<4;v++)A.call(this)}},_doProcessBlock:function(p,g){var v=this._X;A.call(this),c[0]=v[0]^v[5]>>>16^v[3]<<16,c[1]=v[2]^v[7]>>>16^v[5]<<16,c[2]=v[4]^v[1]>>>16^v[7]<<16,c[3]=v[6]^v[3]>>>16^v[1]<<16;for(var E=0;E<4;E++)c[E]=(c[E]<<8|c[E]>>>24)&16711935|(c[E]<<24|c[E]>>>8)&4278255360,p[g+E]^=c[E]},blockSize:128/32,ivSize:64/32});function A(){for(var p=this._X,g=this._C,v=0;v<8;v++)h[v]=g[v];g[0]=g[0]+1295307597+this._b|0,g[1]=g[1]+3545052371+(g[0]>>>0<h[0]>>>0?1:0)|0,g[2]=g[2]+886263092+(g[1]>>>0<h[1]>>>0?1:0)|0,g[3]=g[3]+1295307597+(g[2]>>>0<h[2]>>>0?1:0)|0,g[4]=g[4]+3545052371+(g[3]>>>0<h[3]>>>0?1:0)|0,g[5]=g[5]+886263092+(g[4]>>>0<h[4]>>>0?1:0)|0,g[6]=g[6]+1295307597+(g[5]>>>0<h[5]>>>0?1:0)|0,g[7]=g[7]+3545052371+(g[6]>>>0<h[6]>>>0?1:0)|0,this._b=g[7]>>>0<h[7]>>>0?1:0;for(var v=0;v<8;v++){var E=p[v]+g[v],m=E&65535,_=E>>>16,w=((m*m>>>17)+m*_>>>15)+_*_,x=((E&4294901760)*E|0)+((E&65535)*E|0);u[v]=w^x}p[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,p[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,p[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,p[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,p[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,p[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,p[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,p[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}n.Rabbit=s._createHelper(d)}(),t.Rabbit})}(nv)),nv.exports}var sv={exports:{}},av;function fS(){return av||(av=1,function(r,e){(function(t,n,i){r.exports=n(wt(),ja(),Wa(),js(),Nr())})(mt,function(t){return function(){var n=t,i=n.lib,s=i.StreamCipher,o=n.algo,c=[],h=[],u=[],d=o.RabbitLegacy=s.extend({_doReset:function(){var p=this._key.words,g=this.cfg.iv,v=this._X=[p[0],p[3]<<16|p[2]>>>16,p[1],p[0]<<16|p[3]>>>16,p[2],p[1]<<16|p[0]>>>16,p[3],p[2]<<16|p[1]>>>16],E=this._C=[p[2]<<16|p[2]>>>16,p[0]&4294901760|p[1]&65535,p[3]<<16|p[3]>>>16,p[1]&4294901760|p[2]&65535,p[0]<<16|p[0]>>>16,p[2]&4294901760|p[3]&65535,p[1]<<16|p[1]>>>16,p[3]&4294901760|p[0]&65535];this._b=0;for(var m=0;m<4;m++)A.call(this);for(var m=0;m<8;m++)E[m]^=v[m+4&7];if(g){var _=g.words,w=_[0],x=_[1],I=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,R=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,S=I>>>16|R&4294901760,T=R<<16|I&65535;E[0]^=I,E[1]^=S,E[2]^=R,E[3]^=T,E[4]^=I,E[5]^=S,E[6]^=R,E[7]^=T;for(var m=0;m<4;m++)A.call(this)}},_doProcessBlock:function(p,g){var v=this._X;A.call(this),c[0]=v[0]^v[5]>>>16^v[3]<<16,c[1]=v[2]^v[7]>>>16^v[5]<<16,c[2]=v[4]^v[1]>>>16^v[7]<<16,c[3]=v[6]^v[3]>>>16^v[1]<<16;for(var E=0;E<4;E++)c[E]=(c[E]<<8|c[E]>>>24)&16711935|(c[E]<<24|c[E]>>>8)&4278255360,p[g+E]^=c[E]},blockSize:128/32,ivSize:64/32});function A(){for(var p=this._X,g=this._C,v=0;v<8;v++)h[v]=g[v];g[0]=g[0]+1295307597+this._b|0,g[1]=g[1]+3545052371+(g[0]>>>0<h[0]>>>0?1:0)|0,g[2]=g[2]+886263092+(g[1]>>>0<h[1]>>>0?1:0)|0,g[3]=g[3]+1295307597+(g[2]>>>0<h[2]>>>0?1:0)|0,g[4]=g[4]+3545052371+(g[3]>>>0<h[3]>>>0?1:0)|0,g[5]=g[5]+886263092+(g[4]>>>0<h[4]>>>0?1:0)|0,g[6]=g[6]+1295307597+(g[5]>>>0<h[5]>>>0?1:0)|0,g[7]=g[7]+3545052371+(g[6]>>>0<h[6]>>>0?1:0)|0,this._b=g[7]>>>0<h[7]>>>0?1:0;for(var v=0;v<8;v++){var E=p[v]+g[v],m=E&65535,_=E>>>16,w=((m*m>>>17)+m*_>>>15)+_*_,x=((E&4294901760)*E|0)+((E&65535)*E|0);u[v]=w^x}p[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,p[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,p[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,p[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,p[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,p[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,p[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,p[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}n.RabbitLegacy=s._createHelper(d)}(),t.RabbitLegacy})}(sv)),sv.exports}var ov={exports:{}},lv;function pS(){return lv||(lv=1,function(r,e){(function(t,n,i){r.exports=n(wt(),ja(),Wa(),js(),Nr())})(mt,function(t){return function(){var n=t,i=n.lib,s=i.BlockCipher,o=n.algo;const c=16,h=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],u=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var d={pbox:[],sbox:[]};function A(m,_){let w=_>>24&255,x=_>>16&255,I=_>>8&255,R=_&255,S=m.sbox[0][w]+m.sbox[1][x];return S=S^m.sbox[2][I],S=S+m.sbox[3][R],S}function p(m,_,w){let x=_,I=w,R;for(let S=0;S<c;++S)x=x^m.pbox[S],I=A(m,x)^I,R=x,x=I,I=R;return R=x,x=I,I=R,I=I^m.pbox[c],x=x^m.pbox[c+1],{left:x,right:I}}function g(m,_,w){let x=_,I=w,R;for(let S=c+1;S>1;--S)x=x^m.pbox[S],I=A(m,x)^I,R=x,x=I,I=R;return R=x,x=I,I=R,I=I^m.pbox[1],x=x^m.pbox[0],{left:x,right:I}}function v(m,_,w){for(let T=0;T<4;T++){m.sbox[T]=[];for(let D=0;D<256;D++)m.sbox[T][D]=u[T][D]}let x=0;for(let T=0;T<c+2;T++)m.pbox[T]=h[T]^_[x],x++,x>=w&&(x=0);let I=0,R=0,S=0;for(let T=0;T<c+2;T+=2)S=p(m,I,R),I=S.left,R=S.right,m.pbox[T]=I,m.pbox[T+1]=R;for(let T=0;T<4;T++)for(let D=0;D<256;D+=2)S=p(m,I,R),I=S.left,R=S.right,m.sbox[T][D]=I,m.sbox[T][D+1]=R;return!0}var E=o.Blowfish=s.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var m=this._keyPriorReset=this._key,_=m.words,w=m.sigBytes/4;v(d,_,w)}},encryptBlock:function(m,_){var w=p(d,m[_],m[_+1]);m[_]=w.left,m[_+1]=w.right},decryptBlock:function(m,_){var w=g(d,m[_],m[_+1]);m[_]=w.left,m[_+1]=w.right},blockSize:64/32,keySize:128/32,ivSize:64/32});n.Blowfish=s._createHelper(E)}(),t.Blowfish})}(ov)),ov.exports}(function(r,e){(function(t,n,i){r.exports=n(wt(),bh(),VM(),jM(),ja(),WM(),Wa(),o_(),Sp(),YM(),p_(),qM(),XM(),KM(),Tp(),JM(),js(),Nr(),ZM(),$M(),eS(),tS(),rS(),nS(),iS(),sS(),aS(),oS(),lS(),cS(),uS(),hS(),dS(),fS(),pS())})(mt,function(t){return t})})(V1);var AS=V1.exports;const Bp=bM(AS);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const gS=4,cv=0,uv=1,mS=2;function Vo(r){let e=r.length;for(;--e>=0;)r[e]=0}const _S=0,hv=1,vS=2,yS=3,ES=258,bp=29,Rc=256,Dc=Rc+1+bp,jo=30,Rp=19,dv=2*Dc+1,Ya=15,Dp=16,xS=7,Lp=256,fv=16,pv=17,Av=18,Np=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Rh=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),wS=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),gv=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),IS=512,cs=new Array((Dc+2)*2);Vo(cs);const Lc=new Array(jo*2);Vo(Lc);const Nc=new Array(IS);Vo(Nc);const Uc=new Array(ES-yS+1);Vo(Uc);const Up=new Array(bp);Vo(Up);const Dh=new Array(jo);Vo(Dh);function Pp(r,e,t,n,i){this.static_tree=r,this.extra_bits=e,this.extra_base=t,this.elems=n,this.max_length=i,this.has_stree=r&&r.length}let mv,_v,vv;function kp(r,e){this.dyn_tree=r,this.max_code=0,this.stat_desc=e}const yv=r=>r<256?Nc[r]:Nc[256+(r>>>7)],Pc=(r,e)=>{r.pending_buf[r.pending++]=e&255,r.pending_buf[r.pending++]=e>>>8&255},mn=(r,e,t)=>{r.bi_valid>Dp-t?(r.bi_buf|=e<<r.bi_valid&65535,Pc(r,r.bi_buf),r.bi_buf=e>>Dp-r.bi_valid,r.bi_valid+=t-Dp):(r.bi_buf|=e<<r.bi_valid&65535,r.bi_valid+=t)},zi=(r,e,t)=>{mn(r,t[e*2],t[e*2+1])},Ev=(r,e)=>{let t=0;do t|=r&1,r>>>=1,t<<=1;while(--e>0);return t>>>1},CS=r=>{r.bi_valid===16?(Pc(r,r.bi_buf),r.bi_buf=0,r.bi_valid=0):r.bi_valid>=8&&(r.pending_buf[r.pending++]=r.bi_buf&255,r.bi_buf>>=8,r.bi_valid-=8)},MS=(r,e)=>{const t=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,s=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,h=e.stat_desc.max_length;let u,d,A,p,g,v,E=0;for(p=0;p<=Ya;p++)r.bl_count[p]=0;for(t[r.heap[r.heap_max]*2+1]=0,u=r.heap_max+1;u<dv;u++)d=r.heap[u],p=t[t[d*2+1]*2+1]+1,p>h&&(p=h,E++),t[d*2+1]=p,!(d>n)&&(r.bl_count[p]++,g=0,d>=c&&(g=o[d-c]),v=t[d*2],r.opt_len+=v*(p+g),s&&(r.static_len+=v*(i[d*2+1]+g)));if(E!==0){do{for(p=h-1;r.bl_count[p]===0;)p--;r.bl_count[p]--,r.bl_count[p+1]+=2,r.bl_count[h]--,E-=2}while(E>0);for(p=h;p!==0;p--)for(d=r.bl_count[p];d!==0;)A=r.heap[--u],!(A>n)&&(t[A*2+1]!==p&&(r.opt_len+=(p-t[A*2+1])*t[A*2],t[A*2+1]=p),d--)}},xv=(r,e,t)=>{const n=new Array(Ya+1);let i=0,s,o;for(s=1;s<=Ya;s++)i=i+t[s-1]<<1,n[s]=i;for(o=0;o<=e;o++){let c=r[o*2+1];c!==0&&(r[o*2]=Ev(n[c]++,c))}},SS=()=>{let r,e,t,n,i;const s=new Array(Ya+1);for(t=0,n=0;n<bp-1;n++)for(Up[n]=t,r=0;r<1<<Np[n];r++)Uc[t++]=n;for(Uc[t-1]=n,i=0,n=0;n<16;n++)for(Dh[n]=i,r=0;r<1<<Rh[n];r++)Nc[i++]=n;for(i>>=7;n<jo;n++)for(Dh[n]=i<<7,r=0;r<1<<Rh[n]-7;r++)Nc[256+i++]=n;for(e=0;e<=Ya;e++)s[e]=0;for(r=0;r<=143;)cs[r*2+1]=8,r++,s[8]++;for(;r<=255;)cs[r*2+1]=9,r++,s[9]++;for(;r<=279;)cs[r*2+1]=7,r++,s[7]++;for(;r<=287;)cs[r*2+1]=8,r++,s[8]++;for(xv(cs,Dc+1,s),r=0;r<jo;r++)Lc[r*2+1]=5,Lc[r*2]=Ev(r,5);mv=new Pp(cs,Np,Rc+1,Dc,Ya),_v=new Pp(Lc,Rh,0,jo,Ya),vv=new Pp(new Array(0),wS,0,Rp,xS)},wv=r=>{let e;for(e=0;e<Dc;e++)r.dyn_ltree[e*2]=0;for(e=0;e<jo;e++)r.dyn_dtree[e*2]=0;for(e=0;e<Rp;e++)r.bl_tree[e*2]=0;r.dyn_ltree[Lp*2]=1,r.opt_len=r.static_len=0,r.sym_next=r.matches=0},Iv=r=>{r.bi_valid>8?Pc(r,r.bi_buf):r.bi_valid>0&&(r.pending_buf[r.pending++]=r.bi_buf),r.bi_buf=0,r.bi_valid=0},Cv=(r,e,t,n)=>{const i=e*2,s=t*2;return r[i]<r[s]||r[i]===r[s]&&n[e]<=n[t]},Qp=(r,e,t)=>{const n=r.heap[t];let i=t<<1;for(;i<=r.heap_len&&(i<r.heap_len&&Cv(e,r.heap[i+1],r.heap[i],r.depth)&&i++,!Cv(e,n,r.heap[i],r.depth));)r.heap[t]=r.heap[i],t=i,i<<=1;r.heap[t]=n},Mv=(r,e,t)=>{let n,i,s=0,o,c;if(r.sym_next!==0)do n=r.pending_buf[r.sym_buf+s++]&255,n+=(r.pending_buf[r.sym_buf+s++]&255)<<8,i=r.pending_buf[r.sym_buf+s++],n===0?zi(r,i,e):(o=Uc[i],zi(r,o+Rc+1,e),c=Np[o],c!==0&&(i-=Up[o],mn(r,i,c)),n--,o=yv(n),zi(r,o,t),c=Rh[o],c!==0&&(n-=Dh[o],mn(r,n,c)));while(s<r.sym_next);zi(r,Lp,e)},Op=(r,e)=>{const t=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,s=e.stat_desc.elems;let o,c,h=-1,u;for(r.heap_len=0,r.heap_max=dv,o=0;o<s;o++)t[o*2]!==0?(r.heap[++r.heap_len]=h=o,r.depth[o]=0):t[o*2+1]=0;for(;r.heap_len<2;)u=r.heap[++r.heap_len]=h<2?++h:0,t[u*2]=1,r.depth[u]=0,r.opt_len--,i&&(r.static_len-=n[u*2+1]);for(e.max_code=h,o=r.heap_len>>1;o>=1;o--)Qp(r,t,o);u=s;do o=r.heap[1],r.heap[1]=r.heap[r.heap_len--],Qp(r,t,1),c=r.heap[1],r.heap[--r.heap_max]=o,r.heap[--r.heap_max]=c,t[u*2]=t[o*2]+t[c*2],r.depth[u]=(r.depth[o]>=r.depth[c]?r.depth[o]:r.depth[c])+1,t[o*2+1]=t[c*2+1]=u,r.heap[1]=u++,Qp(r,t,1);while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],MS(r,e),xv(t,h,r.bl_count)},Sv=(r,e,t)=>{let n,i=-1,s,o=e[0*2+1],c=0,h=7,u=4;for(o===0&&(h=138,u=3),e[(t+1)*2+1]=65535,n=0;n<=t;n++)s=o,o=e[(n+1)*2+1],!(++c<h&&s===o)&&(c<u?r.bl_tree[s*2]+=c:s!==0?(s!==i&&r.bl_tree[s*2]++,r.bl_tree[fv*2]++):c<=10?r.bl_tree[pv*2]++:r.bl_tree[Av*2]++,c=0,i=s,o===0?(h=138,u=3):s===o?(h=6,u=3):(h=7,u=4))},Tv=(r,e,t)=>{let n,i=-1,s,o=e[0*2+1],c=0,h=7,u=4;for(o===0&&(h=138,u=3),n=0;n<=t;n++)if(s=o,o=e[(n+1)*2+1],!(++c<h&&s===o)){if(c<u)do zi(r,s,r.bl_tree);while(--c!==0);else s!==0?(s!==i&&(zi(r,s,r.bl_tree),c--),zi(r,fv,r.bl_tree),mn(r,c-3,2)):c<=10?(zi(r,pv,r.bl_tree),mn(r,c-3,3)):(zi(r,Av,r.bl_tree),mn(r,c-11,7));c=0,i=s,o===0?(h=138,u=3):s===o?(h=6,u=3):(h=7,u=4)}},TS=r=>{let e;for(Sv(r,r.dyn_ltree,r.l_desc.max_code),Sv(r,r.dyn_dtree,r.d_desc.max_code),Op(r,r.bl_desc),e=Rp-1;e>=3&&r.bl_tree[gv[e]*2+1]===0;e--);return r.opt_len+=3*(e+1)+5+5+4,e},BS=(r,e,t,n)=>{let i;for(mn(r,e-257,5),mn(r,t-1,5),mn(r,n-4,4),i=0;i<n;i++)mn(r,r.bl_tree[gv[i]*2+1],3);Tv(r,r.dyn_ltree,e-1),Tv(r,r.dyn_dtree,t-1)},bS=r=>{let e=4093624447,t;for(t=0;t<=31;t++,e>>>=1)if(e&1&&r.dyn_ltree[t*2]!==0)return cv;if(r.dyn_ltree[9*2]!==0||r.dyn_ltree[10*2]!==0||r.dyn_ltree[13*2]!==0)return uv;for(t=32;t<Rc;t++)if(r.dyn_ltree[t*2]!==0)return uv;return cv};let Bv=!1;const RS=r=>{Bv||(SS(),Bv=!0),r.l_desc=new kp(r.dyn_ltree,mv),r.d_desc=new kp(r.dyn_dtree,_v),r.bl_desc=new kp(r.bl_tree,vv),r.bi_buf=0,r.bi_valid=0,wv(r)},bv=(r,e,t,n)=>{mn(r,(_S<<1)+(n?1:0),3),Iv(r),Pc(r,t),Pc(r,~t),t&&r.pending_buf.set(r.window.subarray(e,e+t),r.pending),r.pending+=t},DS=r=>{mn(r,hv<<1,3),zi(r,Lp,cs),CS(r)},LS=(r,e,t,n)=>{let i,s,o=0;r.level>0?(r.strm.data_type===mS&&(r.strm.data_type=bS(r)),Op(r,r.l_desc),Op(r,r.d_desc),o=TS(r),i=r.opt_len+3+7>>>3,s=r.static_len+3+7>>>3,s<=i&&(i=s)):i=s=t+5,t+4<=i&&e!==-1?bv(r,e,t,n):r.strategy===gS||s===i?(mn(r,(hv<<1)+(n?1:0),3),Mv(r,cs,Lc)):(mn(r,(vS<<1)+(n?1:0),3),BS(r,r.l_desc.max_code+1,r.d_desc.max_code+1,o+1),Mv(r,r.dyn_ltree,r.dyn_dtree)),wv(r),n&&Iv(r)},NS=(r,e,t)=>(r.pending_buf[r.sym_buf+r.sym_next++]=e,r.pending_buf[r.sym_buf+r.sym_next++]=e>>8,r.pending_buf[r.sym_buf+r.sym_next++]=t,e===0?r.dyn_ltree[t*2]++:(r.matches++,e--,r.dyn_ltree[(Uc[t]+Rc+1)*2]++,r.dyn_dtree[yv(e)*2]++),r.sym_next===r.sym_end);var US=RS,PS=bv,kS=LS,QS=NS,OS=DS,FS={_tr_init:US,_tr_stored_block:PS,_tr_flush_block:kS,_tr_tally:QS,_tr_align:OS},kc=(r,e,t,n)=>{let i=r&65535|0,s=r>>>16&65535|0,o=0;for(;t!==0;){o=t>2e3?2e3:t,t-=o;do i=i+e[n++]|0,s=s+i|0;while(--o);i%=65521,s%=65521}return i|s<<16|0};const zS=()=>{let r,e=[];for(var t=0;t<256;t++){r=t;for(var n=0;n<8;n++)r=r&1?3988292384^r>>>1:r>>>1;e[t]=r}return e},HS=new Uint32Array(zS());var Ur=(r,e,t,n)=>{const i=HS,s=n+t;r^=-1;for(let o=n;o<s;o++)r=r>>>8^i[(r^e[o])&255];return r^-1},qa={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Xa={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:GS,_tr_stored_block:Fp,_tr_flush_block:VS,_tr_tally:Ws,_tr_align:jS}=FS,{Z_NO_FLUSH:Ys,Z_PARTIAL_FLUSH:WS,Z_FULL_FLUSH:YS,Z_FINISH:ti,Z_BLOCK:Rv,Z_OK:jr,Z_STREAM_END:Dv,Z_STREAM_ERROR:Hi,Z_DATA_ERROR:qS,Z_BUF_ERROR:zp,Z_DEFAULT_COMPRESSION:XS,Z_FILTERED:KS,Z_HUFFMAN_ONLY:Lh,Z_RLE:JS,Z_FIXED:ZS,Z_DEFAULT_STRATEGY:$S,Z_UNKNOWN:eT,Z_DEFLATED:Nh}=Xa,tT=9,rT=15,nT=8,iT=29,sT=256,Hp=sT+1+iT,aT=30,oT=19,lT=2*Hp+1,cT=15,It=3,qs=258,Gi=qs+It+1,uT=32,Wo=42,Gp=57,Vp=69,jp=73,Wp=91,Yp=103,Ka=113,Qc=666,an=1,Yo=2,Ja=3,qo=4,hT=3,Za=(r,e)=>(r.msg=qa[e],e),Lv=r=>r*2-(r>4?9:0),Xs=r=>{let e=r.length;for(;--e>=0;)r[e]=0},dT=r=>{let e,t,n,i=r.w_size;e=r.hash_size,n=e;do t=r.head[--n],r.head[n]=t>=i?t-i:0;while(--e);e=i,n=e;do t=r.prev[--n],r.prev[n]=t>=i?t-i:0;while(--e)};let fT=(r,e,t)=>(e<<r.hash_shift^t)&r.hash_mask,Ks=fT;const Qn=r=>{const e=r.state;let t=e.pending;t>r.avail_out&&(t=r.avail_out),t!==0&&(r.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+t),r.next_out),r.next_out+=t,e.pending_out+=t,r.total_out+=t,r.avail_out-=t,e.pending-=t,e.pending===0&&(e.pending_out=0))},On=(r,e)=>{VS(r,r.block_start>=0?r.block_start:-1,r.strstart-r.block_start,e),r.block_start=r.strstart,Qn(r.strm)},bt=(r,e)=>{r.pending_buf[r.pending++]=e},Oc=(r,e)=>{r.pending_buf[r.pending++]=e>>>8&255,r.pending_buf[r.pending++]=e&255},qp=(r,e,t,n)=>{let i=r.avail_in;return i>n&&(i=n),i===0?0:(r.avail_in-=i,e.set(r.input.subarray(r.next_in,r.next_in+i),t),r.state.wrap===1?r.adler=kc(r.adler,e,i,t):r.state.wrap===2&&(r.adler=Ur(r.adler,e,i,t)),r.next_in+=i,r.total_in+=i,i)},Nv=(r,e)=>{let t=r.max_chain_length,n=r.strstart,i,s,o=r.prev_length,c=r.nice_match;const h=r.strstart>r.w_size-Gi?r.strstart-(r.w_size-Gi):0,u=r.window,d=r.w_mask,A=r.prev,p=r.strstart+qs;let g=u[n+o-1],v=u[n+o];r.prev_length>=r.good_match&&(t>>=2),c>r.lookahead&&(c=r.lookahead);do if(i=e,!(u[i+o]!==v||u[i+o-1]!==g||u[i]!==u[n]||u[++i]!==u[n+1])){n+=2,i++;do;while(u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&n<p);if(s=qs-(p-n),n=p-qs,s>o){if(r.match_start=e,o=s,s>=c)break;g=u[n+o-1],v=u[n+o]}}while((e=A[e&d])>h&&--t!==0);return o<=r.lookahead?o:r.lookahead},Xo=r=>{const e=r.w_size;let t,n,i;do{if(n=r.window_size-r.lookahead-r.strstart,r.strstart>=e+(e-Gi)&&(r.window.set(r.window.subarray(e,e+e-n),0),r.match_start-=e,r.strstart-=e,r.block_start-=e,r.insert>r.strstart&&(r.insert=r.strstart),dT(r),n+=e),r.strm.avail_in===0)break;if(t=qp(r.strm,r.window,r.strstart+r.lookahead,n),r.lookahead+=t,r.lookahead+r.insert>=It)for(i=r.strstart-r.insert,r.ins_h=r.window[i],r.ins_h=Ks(r,r.ins_h,r.window[i+1]);r.insert&&(r.ins_h=Ks(r,r.ins_h,r.window[i+It-1]),r.prev[i&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=i,i++,r.insert--,!(r.lookahead+r.insert<It)););}while(r.lookahead<Gi&&r.strm.avail_in!==0)},Uv=(r,e)=>{let t=r.pending_buf_size-5>r.w_size?r.w_size:r.pending_buf_size-5,n,i,s,o=0,c=r.strm.avail_in;do{if(n=65535,s=r.bi_valid+42>>3,r.strm.avail_out<s||(s=r.strm.avail_out-s,i=r.strstart-r.block_start,n>i+r.strm.avail_in&&(n=i+r.strm.avail_in),n>s&&(n=s),n<t&&(n===0&&e!==ti||e===Ys||n!==i+r.strm.avail_in)))break;o=e===ti&&n===i+r.strm.avail_in?1:0,Fp(r,0,0,o),r.pending_buf[r.pending-4]=n,r.pending_buf[r.pending-3]=n>>8,r.pending_buf[r.pending-2]=~n,r.pending_buf[r.pending-1]=~n>>8,Qn(r.strm),i&&(i>n&&(i=n),r.strm.output.set(r.window.subarray(r.block_start,r.block_start+i),r.strm.next_out),r.strm.next_out+=i,r.strm.avail_out-=i,r.strm.total_out+=i,r.block_start+=i,n-=i),n&&(qp(r.strm,r.strm.output,r.strm.next_out,n),r.strm.next_out+=n,r.strm.avail_out-=n,r.strm.total_out+=n)}while(o===0);return c-=r.strm.avail_in,c&&(c>=r.w_size?(r.matches=2,r.window.set(r.strm.input.subarray(r.strm.next_in-r.w_size,r.strm.next_in),0),r.strstart=r.w_size,r.insert=r.strstart):(r.window_size-r.strstart<=c&&(r.strstart-=r.w_size,r.window.set(r.window.subarray(r.w_size,r.w_size+r.strstart),0),r.matches<2&&r.matches++,r.insert>r.strstart&&(r.insert=r.strstart)),r.window.set(r.strm.input.subarray(r.strm.next_in-c,r.strm.next_in),r.strstart),r.strstart+=c,r.insert+=c>r.w_size-r.insert?r.w_size-r.insert:c),r.block_start=r.strstart),r.high_water<r.strstart&&(r.high_water=r.strstart),o?qo:e!==Ys&&e!==ti&&r.strm.avail_in===0&&r.strstart===r.block_start?Yo:(s=r.window_size-r.strstart,r.strm.avail_in>s&&r.block_start>=r.w_size&&(r.block_start-=r.w_size,r.strstart-=r.w_size,r.window.set(r.window.subarray(r.w_size,r.w_size+r.strstart),0),r.matches<2&&r.matches++,s+=r.w_size,r.insert>r.strstart&&(r.insert=r.strstart)),s>r.strm.avail_in&&(s=r.strm.avail_in),s&&(qp(r.strm,r.window,r.strstart,s),r.strstart+=s,r.insert+=s>r.w_size-r.insert?r.w_size-r.insert:s),r.high_water<r.strstart&&(r.high_water=r.strstart),s=r.bi_valid+42>>3,s=r.pending_buf_size-s>65535?65535:r.pending_buf_size-s,t=s>r.w_size?r.w_size:s,i=r.strstart-r.block_start,(i>=t||(i||e===ti)&&e!==Ys&&r.strm.avail_in===0&&i<=s)&&(n=i>s?s:i,o=e===ti&&r.strm.avail_in===0&&n===i?1:0,Fp(r,r.block_start,n,o),r.block_start+=n,Qn(r.strm)),o?Ja:an)},Xp=(r,e)=>{let t,n;for(;;){if(r.lookahead<Gi){if(Xo(r),r.lookahead<Gi&&e===Ys)return an;if(r.lookahead===0)break}if(t=0,r.lookahead>=It&&(r.ins_h=Ks(r,r.ins_h,r.window[r.strstart+It-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart),t!==0&&r.strstart-t<=r.w_size-Gi&&(r.match_length=Nv(r,t)),r.match_length>=It)if(n=Ws(r,r.strstart-r.match_start,r.match_length-It),r.lookahead-=r.match_length,r.match_length<=r.max_lazy_match&&r.lookahead>=It){r.match_length--;do r.strstart++,r.ins_h=Ks(r,r.ins_h,r.window[r.strstart+It-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart;while(--r.match_length!==0);r.strstart++}else r.strstart+=r.match_length,r.match_length=0,r.ins_h=r.window[r.strstart],r.ins_h=Ks(r,r.ins_h,r.window[r.strstart+1]);else n=Ws(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++;if(n&&(On(r,!1),r.strm.avail_out===0))return an}return r.insert=r.strstart<It-1?r.strstart:It-1,e===ti?(On(r,!0),r.strm.avail_out===0?Ja:qo):r.sym_next&&(On(r,!1),r.strm.avail_out===0)?an:Yo},Ko=(r,e)=>{let t,n,i;for(;;){if(r.lookahead<Gi){if(Xo(r),r.lookahead<Gi&&e===Ys)return an;if(r.lookahead===0)break}if(t=0,r.lookahead>=It&&(r.ins_h=Ks(r,r.ins_h,r.window[r.strstart+It-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart),r.prev_length=r.match_length,r.prev_match=r.match_start,r.match_length=It-1,t!==0&&r.prev_length<r.max_lazy_match&&r.strstart-t<=r.w_size-Gi&&(r.match_length=Nv(r,t),r.match_length<=5&&(r.strategy===KS||r.match_length===It&&r.strstart-r.match_start>4096)&&(r.match_length=It-1)),r.prev_length>=It&&r.match_length<=r.prev_length){i=r.strstart+r.lookahead-It,n=Ws(r,r.strstart-1-r.prev_match,r.prev_length-It),r.lookahead-=r.prev_length-1,r.prev_length-=2;do++r.strstart<=i&&(r.ins_h=Ks(r,r.ins_h,r.window[r.strstart+It-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart);while(--r.prev_length!==0);if(r.match_available=0,r.match_length=It-1,r.strstart++,n&&(On(r,!1),r.strm.avail_out===0))return an}else if(r.match_available){if(n=Ws(r,0,r.window[r.strstart-1]),n&&On(r,!1),r.strstart++,r.lookahead--,r.strm.avail_out===0)return an}else r.match_available=1,r.strstart++,r.lookahead--}return r.match_available&&(n=Ws(r,0,r.window[r.strstart-1]),r.match_available=0),r.insert=r.strstart<It-1?r.strstart:It-1,e===ti?(On(r,!0),r.strm.avail_out===0?Ja:qo):r.sym_next&&(On(r,!1),r.strm.avail_out===0)?an:Yo},pT=(r,e)=>{let t,n,i,s;const o=r.window;for(;;){if(r.lookahead<=qs){if(Xo(r),r.lookahead<=qs&&e===Ys)return an;if(r.lookahead===0)break}if(r.match_length=0,r.lookahead>=It&&r.strstart>0&&(i=r.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){s=r.strstart+qs;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<s);r.match_length=qs-(s-i),r.match_length>r.lookahead&&(r.match_length=r.lookahead)}if(r.match_length>=It?(t=Ws(r,1,r.match_length-It),r.lookahead-=r.match_length,r.strstart+=r.match_length,r.match_length=0):(t=Ws(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++),t&&(On(r,!1),r.strm.avail_out===0))return an}return r.insert=0,e===ti?(On(r,!0),r.strm.avail_out===0?Ja:qo):r.sym_next&&(On(r,!1),r.strm.avail_out===0)?an:Yo},AT=(r,e)=>{let t;for(;;){if(r.lookahead===0&&(Xo(r),r.lookahead===0)){if(e===Ys)return an;break}if(r.match_length=0,t=Ws(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++,t&&(On(r,!1),r.strm.avail_out===0))return an}return r.insert=0,e===ti?(On(r,!0),r.strm.avail_out===0?Ja:qo):r.sym_next&&(On(r,!1),r.strm.avail_out===0)?an:Yo};function Vi(r,e,t,n,i){this.good_length=r,this.max_lazy=e,this.nice_length=t,this.max_chain=n,this.func=i}const Fc=[new Vi(0,0,0,0,Uv),new Vi(4,4,8,4,Xp),new Vi(4,5,16,8,Xp),new Vi(4,6,32,32,Xp),new Vi(4,4,16,16,Ko),new Vi(8,16,32,32,Ko),new Vi(8,16,128,128,Ko),new Vi(8,32,128,256,Ko),new Vi(32,128,258,1024,Ko),new Vi(32,258,258,4096,Ko)],gT=r=>{r.window_size=2*r.w_size,Xs(r.head),r.max_lazy_match=Fc[r.level].max_lazy,r.good_match=Fc[r.level].good_length,r.nice_match=Fc[r.level].nice_length,r.max_chain_length=Fc[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=It-1,r.match_available=0,r.ins_h=0};function mT(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Nh,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(lT*2),this.dyn_dtree=new Uint16Array((2*aT+1)*2),this.bl_tree=new Uint16Array((2*oT+1)*2),Xs(this.dyn_ltree),Xs(this.dyn_dtree),Xs(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(cT+1),this.heap=new Uint16Array(2*Hp+1),Xs(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Hp+1),Xs(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const zc=r=>{if(!r)return 1;const e=r.state;return!e||e.strm!==r||e.status!==Wo&&e.status!==Gp&&e.status!==Vp&&e.status!==jp&&e.status!==Wp&&e.status!==Yp&&e.status!==Ka&&e.status!==Qc?1:0},Pv=r=>{if(zc(r))return Za(r,Hi);r.total_in=r.total_out=0,r.data_type=eT;const e=r.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?Gp:e.wrap?Wo:Ka,r.adler=e.wrap===2?0:1,e.last_flush=-2,GS(e),jr},kv=r=>{const e=Pv(r);return e===jr&&gT(r.state),e},_T=(r,e)=>zc(r)||r.state.wrap!==2?Hi:(r.state.gzhead=e,jr),Qv=(r,e,t,n,i,s)=>{if(!r)return Hi;let o=1;if(e===XS&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>tT||t!==Nh||n<8||n>15||e<0||e>9||s<0||s>ZS||n===8&&o!==1)return Za(r,Hi);n===8&&(n=9);const c=new mT;return r.state=c,c.strm=r,c.status=Wo,c.wrap=o,c.gzhead=null,c.w_bits=n,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=i+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+It-1)/It),c.window=new Uint8Array(c.w_size*2),c.head=new Uint16Array(c.hash_size),c.prev=new Uint16Array(c.w_size),c.lit_bufsize=1<<i+6,c.pending_buf_size=c.lit_bufsize*4,c.pending_buf=new Uint8Array(c.pending_buf_size),c.sym_buf=c.lit_bufsize,c.sym_end=(c.lit_bufsize-1)*3,c.level=e,c.strategy=s,c.method=t,kv(r)},vT=(r,e)=>Qv(r,e,Nh,rT,nT,$S),yT=(r,e)=>{if(zc(r)||e>Rv||e<0)return r?Za(r,Hi):Hi;const t=r.state;if(!r.output||r.avail_in!==0&&!r.input||t.status===Qc&&e!==ti)return Za(r,r.avail_out===0?zp:Hi);const n=t.last_flush;if(t.last_flush=e,t.pending!==0){if(Qn(r),r.avail_out===0)return t.last_flush=-1,jr}else if(r.avail_in===0&&Lv(e)<=Lv(n)&&e!==ti)return Za(r,zp);if(t.status===Qc&&r.avail_in!==0)return Za(r,zp);if(t.status===Wo&&t.wrap===0&&(t.status=Ka),t.status===Wo){let i=Nh+(t.w_bits-8<<4)<<8,s=-1;if(t.strategy>=Lh||t.level<2?s=0:t.level<6?s=1:t.level===6?s=2:s=3,i|=s<<6,t.strstart!==0&&(i|=uT),i+=31-i%31,Oc(t,i),t.strstart!==0&&(Oc(t,r.adler>>>16),Oc(t,r.adler&65535)),r.adler=1,t.status=Ka,Qn(r),t.pending!==0)return t.last_flush=-1,jr}if(t.status===Gp){if(r.adler=0,bt(t,31),bt(t,139),bt(t,8),t.gzhead)bt(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),bt(t,t.gzhead.time&255),bt(t,t.gzhead.time>>8&255),bt(t,t.gzhead.time>>16&255),bt(t,t.gzhead.time>>24&255),bt(t,t.level===9?2:t.strategy>=Lh||t.level<2?4:0),bt(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(bt(t,t.gzhead.extra.length&255),bt(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(r.adler=Ur(r.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=Vp;else if(bt(t,0),bt(t,0),bt(t,0),bt(t,0),bt(t,0),bt(t,t.level===9?2:t.strategy>=Lh||t.level<2?4:0),bt(t,hT),t.status=Ka,Qn(r),t.pending!==0)return t.last_flush=-1,jr}if(t.status===Vp){if(t.gzhead.extra){let i=t.pending,s=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+s>t.pending_buf_size;){let c=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+c),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>i&&(r.adler=Ur(r.adler,t.pending_buf,t.pending-i,i)),t.gzindex+=c,Qn(r),t.pending!==0)return t.last_flush=-1,jr;i=0,s-=c}let o=new Uint8Array(t.gzhead.extra);t.pending_buf.set(o.subarray(t.gzindex,t.gzindex+s),t.pending),t.pending+=s,t.gzhead.hcrc&&t.pending>i&&(r.adler=Ur(r.adler,t.pending_buf,t.pending-i,i)),t.gzindex=0}t.status=jp}if(t.status===jp){if(t.gzhead.name){let i=t.pending,s;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>i&&(r.adler=Ur(r.adler,t.pending_buf,t.pending-i,i)),Qn(r),t.pending!==0)return t.last_flush=-1,jr;i=0}t.gzindex<t.gzhead.name.length?s=t.gzhead.name.charCodeAt(t.gzindex++)&255:s=0,bt(t,s)}while(s!==0);t.gzhead.hcrc&&t.pending>i&&(r.adler=Ur(r.adler,t.pending_buf,t.pending-i,i)),t.gzindex=0}t.status=Wp}if(t.status===Wp){if(t.gzhead.comment){let i=t.pending,s;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>i&&(r.adler=Ur(r.adler,t.pending_buf,t.pending-i,i)),Qn(r),t.pending!==0)return t.last_flush=-1,jr;i=0}t.gzindex<t.gzhead.comment.length?s=t.gzhead.comment.charCodeAt(t.gzindex++)&255:s=0,bt(t,s)}while(s!==0);t.gzhead.hcrc&&t.pending>i&&(r.adler=Ur(r.adler,t.pending_buf,t.pending-i,i))}t.status=Yp}if(t.status===Yp){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(Qn(r),t.pending!==0))return t.last_flush=-1,jr;bt(t,r.adler&255),bt(t,r.adler>>8&255),r.adler=0}if(t.status=Ka,Qn(r),t.pending!==0)return t.last_flush=-1,jr}if(r.avail_in!==0||t.lookahead!==0||e!==Ys&&t.status!==Qc){let i=t.level===0?Uv(t,e):t.strategy===Lh?AT(t,e):t.strategy===JS?pT(t,e):Fc[t.level].func(t,e);if((i===Ja||i===qo)&&(t.status=Qc),i===an||i===Ja)return r.avail_out===0&&(t.last_flush=-1),jr;if(i===Yo&&(e===WS?jS(t):e!==Rv&&(Fp(t,0,0,!1),e===YS&&(Xs(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),Qn(r),r.avail_out===0))return t.last_flush=-1,jr}return e!==ti?jr:t.wrap<=0?Dv:(t.wrap===2?(bt(t,r.adler&255),bt(t,r.adler>>8&255),bt(t,r.adler>>16&255),bt(t,r.adler>>24&255),bt(t,r.total_in&255),bt(t,r.total_in>>8&255),bt(t,r.total_in>>16&255),bt(t,r.total_in>>24&255)):(Oc(t,r.adler>>>16),Oc(t,r.adler&65535)),Qn(r),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?jr:Dv)},ET=r=>{if(zc(r))return Hi;const e=r.state.status;return r.state=null,e===Ka?Za(r,qS):jr},xT=(r,e)=>{let t=e.length;if(zc(r))return Hi;const n=r.state,i=n.wrap;if(i===2||i===1&&n.status!==Wo||n.lookahead)return Hi;if(i===1&&(r.adler=kc(r.adler,e,t,0)),n.wrap=0,t>=n.w_size){i===0&&(Xs(n.head),n.strstart=0,n.block_start=0,n.insert=0);let h=new Uint8Array(n.w_size);h.set(e.subarray(t-n.w_size,t),0),e=h,t=n.w_size}const s=r.avail_in,o=r.next_in,c=r.input;for(r.avail_in=t,r.next_in=0,r.input=e,Xo(n);n.lookahead>=It;){let h=n.strstart,u=n.lookahead-(It-1);do n.ins_h=Ks(n,n.ins_h,n.window[h+It-1]),n.prev[h&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=h,h++;while(--u);n.strstart=h,n.lookahead=It-1,Xo(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=It-1,n.match_available=0,r.next_in=o,r.input=c,r.avail_in=s,n.wrap=i,jr};var wT=vT,IT=Qv,CT=kv,MT=Pv,ST=_T,TT=yT,BT=ET,bT=xT,RT="pako deflate (from Nodeca project)",Hc={deflateInit:wT,deflateInit2:IT,deflateReset:CT,deflateResetKeep:MT,deflateSetHeader:ST,deflate:TT,deflateEnd:BT,deflateSetDictionary:bT,deflateInfo:RT};const DT=(r,e)=>Object.prototype.hasOwnProperty.call(r,e);var LT=function(r){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const t=e.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const n in t)DT(t,n)&&(r[n]=t[n])}}return r},NT=r=>{let e=0;for(let n=0,i=r.length;n<i;n++)e+=r[n].length;const t=new Uint8Array(e);for(let n=0,i=0,s=r.length;n<s;n++){let o=r[n];t.set(o,i),i+=o.length}return t},Uh={assign:LT,flattenChunks:NT};let Ov=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Ov=!1}const Gc=new Uint8Array(256);for(let r=0;r<256;r++)Gc[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;Gc[254]=Gc[254]=1;var UT=r=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(r);let e,t,n,i,s,o=r.length,c=0;for(i=0;i<o;i++)t=r.charCodeAt(i),(t&64512)===55296&&i+1<o&&(n=r.charCodeAt(i+1),(n&64512)===56320&&(t=65536+(t-55296<<10)+(n-56320),i++)),c+=t<128?1:t<2048?2:t<65536?3:4;for(e=new Uint8Array(c),s=0,i=0;s<c;i++)t=r.charCodeAt(i),(t&64512)===55296&&i+1<o&&(n=r.charCodeAt(i+1),(n&64512)===56320&&(t=65536+(t-55296<<10)+(n-56320),i++)),t<128?e[s++]=t:t<2048?(e[s++]=192|t>>>6,e[s++]=128|t&63):t<65536?(e[s++]=224|t>>>12,e[s++]=128|t>>>6&63,e[s++]=128|t&63):(e[s++]=240|t>>>18,e[s++]=128|t>>>12&63,e[s++]=128|t>>>6&63,e[s++]=128|t&63);return e};const PT=(r,e)=>{if(e<65534&&r.subarray&&Ov)return String.fromCharCode.apply(null,r.length===e?r:r.subarray(0,e));let t="";for(let n=0;n<e;n++)t+=String.fromCharCode(r[n]);return t};var kT=(r,e)=>{const t=e||r.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(r.subarray(0,e));let n,i;const s=new Array(t*2);for(i=0,n=0;n<t;){let o=r[n++];if(o<128){s[i++]=o;continue}let c=Gc[o];if(c>4){s[i++]=65533,n+=c-1;continue}for(o&=c===2?31:c===3?15:7;c>1&&n<t;)o=o<<6|r[n++]&63,c--;if(c>1){s[i++]=65533;continue}o<65536?s[i++]=o:(o-=65536,s[i++]=55296|o>>10&1023,s[i++]=56320|o&1023)}return PT(s,i)},QT=(r,e)=>{e=e||r.length,e>r.length&&(e=r.length);let t=e-1;for(;t>=0&&(r[t]&192)===128;)t--;return t<0||t===0?e:t+Gc[r[t]]>e?t:e},Vc={string2buf:UT,buf2string:kT,utf8border:QT};function OT(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Fv=OT;const zv=Object.prototype.toString,{Z_NO_FLUSH:FT,Z_SYNC_FLUSH:zT,Z_FULL_FLUSH:HT,Z_FINISH:GT,Z_OK:Ph,Z_STREAM_END:VT,Z_DEFAULT_COMPRESSION:jT,Z_DEFAULT_STRATEGY:WT,Z_DEFLATED:YT}=Xa;function jc(r){this.options=Uh.assign({level:jT,method:YT,chunkSize:16384,windowBits:15,memLevel:8,strategy:WT},r||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Fv,this.strm.avail_out=0;let t=Hc.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(t!==Ph)throw new Error(qa[t]);if(e.header&&Hc.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=Vc.string2buf(e.dictionary):zv.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,t=Hc.deflateSetDictionary(this.strm,n),t!==Ph)throw new Error(qa[t]);this._dict_set=!0}}jc.prototype.push=function(r,e){const t=this.strm,n=this.options.chunkSize;let i,s;if(this.ended)return!1;for(e===~~e?s=e:s=e===!0?GT:FT,typeof r=="string"?t.input=Vc.string2buf(r):zv.call(r)==="[object ArrayBuffer]"?t.input=new Uint8Array(r):t.input=r,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(n),t.next_out=0,t.avail_out=n),(s===zT||s===HT)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(i=Hc.deflate(t,s),i===VT)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),i=Hc.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Ph;if(t.avail_out===0){this.onData(t.output);continue}if(s>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0},jc.prototype.onData=function(r){this.chunks.push(r)},jc.prototype.onEnd=function(r){r===Ph&&(this.result=Uh.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function Kp(r,e){const t=new jc(e);if(t.push(r,!0),t.err)throw t.msg||qa[t.err];return t.result}function qT(r,e){return e=e||{},e.raw=!0,Kp(r,e)}function XT(r,e){return e=e||{},e.gzip=!0,Kp(r,e)}var KT=jc,JT=Kp,ZT=qT,$T=XT,e4=Xa,t4={Deflate:KT,deflate:JT,deflateRaw:ZT,gzip:$T,constants:e4};const kh=16209,r4=16191;var n4=function(r,e){let t,n,i,s,o,c,h,u,d,A,p,g,v,E,m,_,w,x,I,R,S,T,D,b;const M=r.state;t=r.next_in,D=r.input,n=t+(r.avail_in-5),i=r.next_out,b=r.output,s=i-(e-r.avail_out),o=i+(r.avail_out-257),c=M.dmax,h=M.wsize,u=M.whave,d=M.wnext,A=M.window,p=M.hold,g=M.bits,v=M.lencode,E=M.distcode,m=(1<<M.lenbits)-1,_=(1<<M.distbits)-1;e:do{g<15&&(p+=D[t++]<<g,g+=8,p+=D[t++]<<g,g+=8),w=v[p&m];t:for(;;){if(x=w>>>24,p>>>=x,g-=x,x=w>>>16&255,x===0)b[i++]=w&65535;else if(x&16){I=w&65535,x&=15,x&&(g<x&&(p+=D[t++]<<g,g+=8),I+=p&(1<<x)-1,p>>>=x,g-=x),g<15&&(p+=D[t++]<<g,g+=8,p+=D[t++]<<g,g+=8),w=E[p&_];r:for(;;){if(x=w>>>24,p>>>=x,g-=x,x=w>>>16&255,x&16){if(R=w&65535,x&=15,g<x&&(p+=D[t++]<<g,g+=8,g<x&&(p+=D[t++]<<g,g+=8)),R+=p&(1<<x)-1,R>c){r.msg="invalid distance too far back",M.mode=kh;break e}if(p>>>=x,g-=x,x=i-s,R>x){if(x=R-x,x>u&&M.sane){r.msg="invalid distance too far back",M.mode=kh;break e}if(S=0,T=A,d===0){if(S+=h-x,x<I){I-=x;do b[i++]=A[S++];while(--x);S=i-R,T=b}}else if(d<x){if(S+=h+d-x,x-=d,x<I){I-=x;do b[i++]=A[S++];while(--x);if(S=0,d<I){x=d,I-=x;do b[i++]=A[S++];while(--x);S=i-R,T=b}}}else if(S+=d-x,x<I){I-=x;do b[i++]=A[S++];while(--x);S=i-R,T=b}for(;I>2;)b[i++]=T[S++],b[i++]=T[S++],b[i++]=T[S++],I-=3;I&&(b[i++]=T[S++],I>1&&(b[i++]=T[S++]))}else{S=i-R;do b[i++]=b[S++],b[i++]=b[S++],b[i++]=b[S++],I-=3;while(I>2);I&&(b[i++]=b[S++],I>1&&(b[i++]=b[S++]))}}else if(x&64){r.msg="invalid distance code",M.mode=kh;break e}else{w=E[(w&65535)+(p&(1<<x)-1)];continue r}break}}else if(x&64)if(x&32){M.mode=r4;break e}else{r.msg="invalid literal/length code",M.mode=kh;break e}else{w=v[(w&65535)+(p&(1<<x)-1)];continue t}break}}while(t<n&&i<o);I=g>>3,t-=I,g-=I<<3,p&=(1<<g)-1,r.next_in=t,r.next_out=i,r.avail_in=t<n?5+(n-t):5-(t-n),r.avail_out=i<o?257+(o-i):257-(i-o),M.hold=p,M.bits=g};const Jo=15,Hv=852,Gv=592,Vv=0,Jp=1,jv=2,i4=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),s4=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),a4=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),o4=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Wc=(r,e,t,n,i,s,o,c)=>{const h=c.bits;let u=0,d=0,A=0,p=0,g=0,v=0,E=0,m=0,_=0,w=0,x,I,R,S,T,D=null,b;const M=new Uint16Array(Jo+1),L=new Uint16Array(Jo+1);let P=null,N,j,X;for(u=0;u<=Jo;u++)M[u]=0;for(d=0;d<n;d++)M[e[t+d]]++;for(g=h,p=Jo;p>=1&&M[p]===0;p--);if(g>p&&(g=p),p===0)return i[s++]=1<<24|64<<16|0,i[s++]=1<<24|64<<16|0,c.bits=1,0;for(A=1;A<p&&M[A]===0;A++);for(g<A&&(g=A),m=1,u=1;u<=Jo;u++)if(m<<=1,m-=M[u],m<0)return-1;if(m>0&&(r===Vv||p!==1))return-1;for(L[1]=0,u=1;u<Jo;u++)L[u+1]=L[u]+M[u];for(d=0;d<n;d++)e[t+d]!==0&&(o[L[e[t+d]]++]=d);if(r===Vv?(D=P=o,b=20):r===Jp?(D=i4,P=s4,b=257):(D=a4,P=o4,b=0),w=0,d=0,u=A,T=s,v=g,E=0,R=-1,_=1<<g,S=_-1,r===Jp&&_>Hv||r===jv&&_>Gv)return 1;for(;;){N=u-E,o[d]+1<b?(j=0,X=o[d]):o[d]>=b?(j=P[o[d]-b],X=D[o[d]-b]):(j=32+64,X=0),x=1<<u-E,I=1<<v,A=I;do I-=x,i[T+(w>>E)+I]=N<<24|j<<16|X|0;while(I!==0);for(x=1<<u-1;w&x;)x>>=1;if(x!==0?(w&=x-1,w+=x):w=0,d++,--M[u]===0){if(u===p)break;u=e[t+o[d]]}if(u>g&&(w&S)!==R){for(E===0&&(E=g),T+=A,v=u-E,m=1<<v;v+E<p&&(m-=M[v+E],!(m<=0));)v++,m<<=1;if(_+=1<<v,r===Jp&&_>Hv||r===jv&&_>Gv)return 1;R=w&S,i[R]=g<<24|v<<16|T-s|0}}return w!==0&&(i[T+w]=u-E<<24|64<<16|0),c.bits=g,0};const l4=0,Wv=1,Yv=2,{Z_FINISH:qv,Z_BLOCK:c4,Z_TREES:Qh,Z_OK:$a,Z_STREAM_END:u4,Z_NEED_DICT:h4,Z_STREAM_ERROR:_i,Z_DATA_ERROR:Xv,Z_MEM_ERROR:Kv,Z_BUF_ERROR:d4,Z_DEFLATED:Jv}=Xa,Oh=16180,Zv=16181,$v=16182,ey=16183,ty=16184,ry=16185,ny=16186,iy=16187,sy=16188,ay=16189,Fh=16190,us=16191,Zp=16192,oy=16193,$p=16194,ly=16195,cy=16196,uy=16197,hy=16198,zh=16199,Hh=16200,dy=16201,fy=16202,py=16203,Ay=16204,gy=16205,eA=16206,my=16207,_y=16208,Jt=16209,vy=16210,yy=16211,f4=852,p4=592,A4=15,g4=A4,Ey=r=>(r>>>24&255)+(r>>>8&65280)+((r&65280)<<8)+((r&255)<<24);function m4(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const eo=r=>{if(!r)return 1;const e=r.state;return!e||e.strm!==r||e.mode<Oh||e.mode>yy?1:0},xy=r=>{if(eo(r))return _i;const e=r.state;return r.total_in=r.total_out=e.total=0,r.msg="",e.wrap&&(r.adler=e.wrap&1),e.mode=Oh,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(f4),e.distcode=e.distdyn=new Int32Array(p4),e.sane=1,e.back=-1,$a},wy=r=>{if(eo(r))return _i;const e=r.state;return e.wsize=0,e.whave=0,e.wnext=0,xy(r)},Iy=(r,e)=>{let t;if(eo(r))return _i;const n=r.state;return e<0?(t=0,e=-e):(t=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?_i:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=t,n.wbits=e,wy(r))},Cy=(r,e)=>{if(!r)return _i;const t=new m4;r.state=t,t.strm=r,t.window=null,t.mode=Oh;const n=Iy(r,e);return n!==$a&&(r.state=null),n},_4=r=>Cy(r,g4);let My=!0,tA,rA;const v4=r=>{if(My){tA=new Int32Array(512),rA=new Int32Array(32);let e=0;for(;e<144;)r.lens[e++]=8;for(;e<256;)r.lens[e++]=9;for(;e<280;)r.lens[e++]=7;for(;e<288;)r.lens[e++]=8;for(Wc(Wv,r.lens,0,288,tA,0,r.work,{bits:9}),e=0;e<32;)r.lens[e++]=5;Wc(Yv,r.lens,0,32,rA,0,r.work,{bits:5}),My=!1}r.lencode=tA,r.lenbits=9,r.distcode=rA,r.distbits=5},Sy=(r,e,t,n)=>{let i;const s=r.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),n>=s.wsize?(s.window.set(e.subarray(t-s.wsize,t),0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>n&&(i=n),s.window.set(e.subarray(t-n,t-n+i),s.wnext),n-=i,n?(s.window.set(e.subarray(t-n,t),0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0},y4=(r,e)=>{let t,n,i,s,o,c,h,u,d,A,p,g,v,E,m=0,_,w,x,I,R,S,T,D;const b=new Uint8Array(4);let M,L;const P=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(eo(r)||!r.output||!r.input&&r.avail_in!==0)return _i;t=r.state,t.mode===us&&(t.mode=Zp),o=r.next_out,i=r.output,h=r.avail_out,s=r.next_in,n=r.input,c=r.avail_in,u=t.hold,d=t.bits,A=c,p=h,D=$a;e:for(;;)switch(t.mode){case Oh:if(t.wrap===0){t.mode=Zp;break}for(;d<16;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(t.wrap&2&&u===35615){t.wbits===0&&(t.wbits=15),t.check=0,b[0]=u&255,b[1]=u>>>8&255,t.check=Ur(t.check,b,2,0),u=0,d=0,t.mode=Zv;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((u&255)<<8)+(u>>8))%31){r.msg="incorrect header check",t.mode=Jt;break}if((u&15)!==Jv){r.msg="unknown compression method",t.mode=Jt;break}if(u>>>=4,d-=4,T=(u&15)+8,t.wbits===0&&(t.wbits=T),T>15||T>t.wbits){r.msg="invalid window size",t.mode=Jt;break}t.dmax=1<<t.wbits,t.flags=0,r.adler=t.check=1,t.mode=u&512?ay:us,u=0,d=0;break;case Zv:for(;d<16;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(t.flags=u,(t.flags&255)!==Jv){r.msg="unknown compression method",t.mode=Jt;break}if(t.flags&57344){r.msg="unknown header flags set",t.mode=Jt;break}t.head&&(t.head.text=u>>8&1),t.flags&512&&t.wrap&4&&(b[0]=u&255,b[1]=u>>>8&255,t.check=Ur(t.check,b,2,0)),u=0,d=0,t.mode=$v;case $v:for(;d<32;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}t.head&&(t.head.time=u),t.flags&512&&t.wrap&4&&(b[0]=u&255,b[1]=u>>>8&255,b[2]=u>>>16&255,b[3]=u>>>24&255,t.check=Ur(t.check,b,4,0)),u=0,d=0,t.mode=ey;case ey:for(;d<16;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}t.head&&(t.head.xflags=u&255,t.head.os=u>>8),t.flags&512&&t.wrap&4&&(b[0]=u&255,b[1]=u>>>8&255,t.check=Ur(t.check,b,2,0)),u=0,d=0,t.mode=ty;case ty:if(t.flags&1024){for(;d<16;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}t.length=u,t.head&&(t.head.extra_len=u),t.flags&512&&t.wrap&4&&(b[0]=u&255,b[1]=u>>>8&255,t.check=Ur(t.check,b,2,0)),u=0,d=0}else t.head&&(t.head.extra=null);t.mode=ry;case ry:if(t.flags&1024&&(g=t.length,g>c&&(g=c),g&&(t.head&&(T=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(n.subarray(s,s+g),T)),t.flags&512&&t.wrap&4&&(t.check=Ur(t.check,n,g,s)),c-=g,s+=g,t.length-=g),t.length))break e;t.length=0,t.mode=ny;case ny:if(t.flags&2048){if(c===0)break e;g=0;do T=n[s+g++],t.head&&T&&t.length<65536&&(t.head.name+=String.fromCharCode(T));while(T&&g<c);if(t.flags&512&&t.wrap&4&&(t.check=Ur(t.check,n,g,s)),c-=g,s+=g,T)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=iy;case iy:if(t.flags&4096){if(c===0)break e;g=0;do T=n[s+g++],t.head&&T&&t.length<65536&&(t.head.comment+=String.fromCharCode(T));while(T&&g<c);if(t.flags&512&&t.wrap&4&&(t.check=Ur(t.check,n,g,s)),c-=g,s+=g,T)break e}else t.head&&(t.head.comment=null);t.mode=sy;case sy:if(t.flags&512){for(;d<16;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(t.wrap&4&&u!==(t.check&65535)){r.msg="header crc mismatch",t.mode=Jt;break}u=0,d=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),r.adler=t.check=0,t.mode=us;break;case ay:for(;d<32;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}r.adler=t.check=Ey(u),u=0,d=0,t.mode=Fh;case Fh:if(t.havedict===0)return r.next_out=o,r.avail_out=h,r.next_in=s,r.avail_in=c,t.hold=u,t.bits=d,h4;r.adler=t.check=1,t.mode=us;case us:if(e===c4||e===Qh)break e;case Zp:if(t.last){u>>>=d&7,d-=d&7,t.mode=eA;break}for(;d<3;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}switch(t.last=u&1,u>>>=1,d-=1,u&3){case 0:t.mode=oy;break;case 1:if(v4(t),t.mode=zh,e===Qh){u>>>=2,d-=2;break e}break;case 2:t.mode=cy;break;case 3:r.msg="invalid block type",t.mode=Jt}u>>>=2,d-=2;break;case oy:for(u>>>=d&7,d-=d&7;d<32;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if((u&65535)!==(u>>>16^65535)){r.msg="invalid stored block lengths",t.mode=Jt;break}if(t.length=u&65535,u=0,d=0,t.mode=$p,e===Qh)break e;case $p:t.mode=ly;case ly:if(g=t.length,g){if(g>c&&(g=c),g>h&&(g=h),g===0)break e;i.set(n.subarray(s,s+g),o),c-=g,s+=g,h-=g,o+=g,t.length-=g;break}t.mode=us;break;case cy:for(;d<14;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(t.nlen=(u&31)+257,u>>>=5,d-=5,t.ndist=(u&31)+1,u>>>=5,d-=5,t.ncode=(u&15)+4,u>>>=4,d-=4,t.nlen>286||t.ndist>30){r.msg="too many length or distance symbols",t.mode=Jt;break}t.have=0,t.mode=uy;case uy:for(;t.have<t.ncode;){for(;d<3;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}t.lens[P[t.have++]]=u&7,u>>>=3,d-=3}for(;t.have<19;)t.lens[P[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,M={bits:t.lenbits},D=Wc(l4,t.lens,0,19,t.lencode,0,t.work,M),t.lenbits=M.bits,D){r.msg="invalid code lengths set",t.mode=Jt;break}t.have=0,t.mode=hy;case hy:for(;t.have<t.nlen+t.ndist;){for(;m=t.lencode[u&(1<<t.lenbits)-1],_=m>>>24,w=m>>>16&255,x=m&65535,!(_<=d);){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(x<16)u>>>=_,d-=_,t.lens[t.have++]=x;else{if(x===16){for(L=_+2;d<L;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(u>>>=_,d-=_,t.have===0){r.msg="invalid bit length repeat",t.mode=Jt;break}T=t.lens[t.have-1],g=3+(u&3),u>>>=2,d-=2}else if(x===17){for(L=_+3;d<L;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}u>>>=_,d-=_,T=0,g=3+(u&7),u>>>=3,d-=3}else{for(L=_+7;d<L;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}u>>>=_,d-=_,T=0,g=11+(u&127),u>>>=7,d-=7}if(t.have+g>t.nlen+t.ndist){r.msg="invalid bit length repeat",t.mode=Jt;break}for(;g--;)t.lens[t.have++]=T}}if(t.mode===Jt)break;if(t.lens[256]===0){r.msg="invalid code -- missing end-of-block",t.mode=Jt;break}if(t.lenbits=9,M={bits:t.lenbits},D=Wc(Wv,t.lens,0,t.nlen,t.lencode,0,t.work,M),t.lenbits=M.bits,D){r.msg="invalid literal/lengths set",t.mode=Jt;break}if(t.distbits=6,t.distcode=t.distdyn,M={bits:t.distbits},D=Wc(Yv,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,M),t.distbits=M.bits,D){r.msg="invalid distances set",t.mode=Jt;break}if(t.mode=zh,e===Qh)break e;case zh:t.mode=Hh;case Hh:if(c>=6&&h>=258){r.next_out=o,r.avail_out=h,r.next_in=s,r.avail_in=c,t.hold=u,t.bits=d,n4(r,p),o=r.next_out,i=r.output,h=r.avail_out,s=r.next_in,n=r.input,c=r.avail_in,u=t.hold,d=t.bits,t.mode===us&&(t.back=-1);break}for(t.back=0;m=t.lencode[u&(1<<t.lenbits)-1],_=m>>>24,w=m>>>16&255,x=m&65535,!(_<=d);){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(w&&!(w&240)){for(I=_,R=w,S=x;m=t.lencode[S+((u&(1<<I+R)-1)>>I)],_=m>>>24,w=m>>>16&255,x=m&65535,!(I+_<=d);){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}u>>>=I,d-=I,t.back+=I}if(u>>>=_,d-=_,t.back+=_,t.length=x,w===0){t.mode=gy;break}if(w&32){t.back=-1,t.mode=us;break}if(w&64){r.msg="invalid literal/length code",t.mode=Jt;break}t.extra=w&15,t.mode=dy;case dy:if(t.extra){for(L=t.extra;d<L;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}t.length+=u&(1<<t.extra)-1,u>>>=t.extra,d-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=fy;case fy:for(;m=t.distcode[u&(1<<t.distbits)-1],_=m>>>24,w=m>>>16&255,x=m&65535,!(_<=d);){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(!(w&240)){for(I=_,R=w,S=x;m=t.distcode[S+((u&(1<<I+R)-1)>>I)],_=m>>>24,w=m>>>16&255,x=m&65535,!(I+_<=d);){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}u>>>=I,d-=I,t.back+=I}if(u>>>=_,d-=_,t.back+=_,w&64){r.msg="invalid distance code",t.mode=Jt;break}t.offset=x,t.extra=w&15,t.mode=py;case py:if(t.extra){for(L=t.extra;d<L;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}t.offset+=u&(1<<t.extra)-1,u>>>=t.extra,d-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){r.msg="invalid distance too far back",t.mode=Jt;break}t.mode=Ay;case Ay:if(h===0)break e;if(g=p-h,t.offset>g){if(g=t.offset-g,g>t.whave&&t.sane){r.msg="invalid distance too far back",t.mode=Jt;break}g>t.wnext?(g-=t.wnext,v=t.wsize-g):v=t.wnext-g,g>t.length&&(g=t.length),E=t.window}else E=i,v=o-t.offset,g=t.length;g>h&&(g=h),h-=g,t.length-=g;do i[o++]=E[v++];while(--g);t.length===0&&(t.mode=Hh);break;case gy:if(h===0)break e;i[o++]=t.length,h--,t.mode=Hh;break;case eA:if(t.wrap){for(;d<32;){if(c===0)break e;c--,u|=n[s++]<<d,d+=8}if(p-=h,r.total_out+=p,t.total+=p,t.wrap&4&&p&&(r.adler=t.check=t.flags?Ur(t.check,i,p,o-p):kc(t.check,i,p,o-p)),p=h,t.wrap&4&&(t.flags?u:Ey(u))!==t.check){r.msg="incorrect data check",t.mode=Jt;break}u=0,d=0}t.mode=my;case my:if(t.wrap&&t.flags){for(;d<32;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(t.wrap&4&&u!==(t.total&4294967295)){r.msg="incorrect length check",t.mode=Jt;break}u=0,d=0}t.mode=_y;case _y:D=u4;break e;case Jt:D=Xv;break e;case vy:return Kv;case yy:default:return _i}return r.next_out=o,r.avail_out=h,r.next_in=s,r.avail_in=c,t.hold=u,t.bits=d,(t.wsize||p!==r.avail_out&&t.mode<Jt&&(t.mode<eA||e!==qv))&&Sy(r,r.output,r.next_out,p-r.avail_out),A-=r.avail_in,p-=r.avail_out,r.total_in+=A,r.total_out+=p,t.total+=p,t.wrap&4&&p&&(r.adler=t.check=t.flags?Ur(t.check,i,p,r.next_out-p):kc(t.check,i,p,r.next_out-p)),r.data_type=t.bits+(t.last?64:0)+(t.mode===us?128:0)+(t.mode===zh||t.mode===$p?256:0),(A===0&&p===0||e===qv)&&D===$a&&(D=d4),D},E4=r=>{if(eo(r))return _i;let e=r.state;return e.window&&(e.window=null),r.state=null,$a},x4=(r,e)=>{if(eo(r))return _i;const t=r.state;return t.wrap&2?(t.head=e,e.done=!1,$a):_i},w4=(r,e)=>{const t=e.length;let n,i,s;return eo(r)||(n=r.state,n.wrap!==0&&n.mode!==Fh)?_i:n.mode===Fh&&(i=1,i=kc(i,e,t,0),i!==n.check)?Xv:(s=Sy(r,e,t,t),s?(n.mode=vy,Kv):(n.havedict=1,$a))};var I4=wy,C4=Iy,M4=xy,S4=_4,T4=Cy,B4=y4,b4=E4,R4=x4,D4=w4,L4="pako inflate (from Nodeca project)",hs={inflateReset:I4,inflateReset2:C4,inflateResetKeep:M4,inflateInit:S4,inflateInit2:T4,inflate:B4,inflateEnd:b4,inflateGetHeader:R4,inflateSetDictionary:D4,inflateInfo:L4};function N4(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var U4=N4;const Ty=Object.prototype.toString,{Z_NO_FLUSH:P4,Z_FINISH:k4,Z_OK:Yc,Z_STREAM_END:nA,Z_NEED_DICT:iA,Z_STREAM_ERROR:Q4,Z_DATA_ERROR:By,Z_MEM_ERROR:O4}=Xa;function qc(r){this.options=Uh.assign({chunkSize:1024*64,windowBits:15,to:""},r||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(r&&r.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Fv,this.strm.avail_out=0;let t=hs.inflateInit2(this.strm,e.windowBits);if(t!==Yc)throw new Error(qa[t]);if(this.header=new U4,hs.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Vc.string2buf(e.dictionary):Ty.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=hs.inflateSetDictionary(this.strm,e.dictionary),t!==Yc)))throw new Error(qa[t])}qc.prototype.push=function(r,e){const t=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let s,o,c;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?k4:P4,Ty.call(r)==="[object ArrayBuffer]"?t.input=new Uint8Array(r):t.input=r,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(n),t.next_out=0,t.avail_out=n),s=hs.inflate(t,o),s===iA&&i&&(s=hs.inflateSetDictionary(t,i),s===Yc?s=hs.inflate(t,o):s===By&&(s=iA));t.avail_in>0&&s===nA&&t.state.wrap>0&&r[t.next_in]!==0;)hs.inflateReset(t),s=hs.inflate(t,o);switch(s){case Q4:case By:case iA:case O4:return this.onEnd(s),this.ended=!0,!1}if(c=t.avail_out,t.next_out&&(t.avail_out===0||s===nA))if(this.options.to==="string"){let h=Vc.utf8border(t.output,t.next_out),u=t.next_out-h,d=Vc.buf2string(t.output,h);t.next_out=u,t.avail_out=n-u,u&&t.output.set(t.output.subarray(h,h+u),0),this.onData(d)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(s===Yc&&c===0)){if(s===nA)return s=hs.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(t.avail_in===0)break}}return!0},qc.prototype.onData=function(r){this.chunks.push(r)},qc.prototype.onEnd=function(r){r===Yc&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Uh.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function sA(r,e){const t=new qc(e);if(t.push(r),t.err)throw t.msg||qa[t.err];return t.result}function F4(r,e){return e=e||{},e.raw=!0,sA(r,e)}var z4=qc,H4=sA,G4=F4,V4=sA,j4=Xa,W4={Inflate:z4,inflate:H4,inflateRaw:G4,ungzip:V4,constants:j4};const{Deflate:Y4,deflate:q4,deflateRaw:X4,gzip:K4}=t4,{Inflate:J4,inflate:Z4,inflateRaw:$4,ungzip:eB}=W4;var tB=Y4,rB=q4,nB=X4,iB=K4,sB=J4,aB=Z4,oB=$4,lB=eB,cB=Xa,uB={Deflate:tB,deflate:rB,deflateRaw:nB,gzip:iB,Inflate:sB,inflate:aB,inflateRaw:oB,ungzip:lB,constants:cB},hB=r=>{if(r===""||!r)return"";let e=r.split("/"),t=`$$${e[1].slice(-10)}${e[3].slice(-9)}`;return String(Bp.MD5(t))};async function dB(r){return await(await fetch(r,{method:"GET"})).arrayBuffer()}function fB(r){return uB.ungzip(r,{to:"string"})}var pB=r=>{let e=window.atob(r),t=e.length,n=new Uint8Array(t);for(let i=0;i<t;i+=1)n[i]=e.charCodeAt(i);return n.buffer};async function AB(r,e){let t=hB(e),n=Bp.AES.decrypt(r,t).toString(Bp.enc.Latin1);return pB(n)}async function gB(r,e){let t=e||`org/${r.split("org/")[1].split("/universal")[0]}`,n=Date.now(),i=await dB(r),s=Date.now()-n;n=Date.now();let o=fB(i),c=Date.now()-n;n=Date.now();let h=await AB(o,t),u=Date.now()-n;return{decodedData:h,events:{fileDownloadTime:s,fileUnzipTime:c,fileDecryptionTime:u}}}var mB=gB;/**
33
33
  * @license
34
34
  * Copyright 2010-2023 Three.js Authors
35
35
  * SPDX-License-Identifier: MIT
36
- */const Gh="163",Zo={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},$o={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},_B=0,by=1,vB=2,Ry=1,yB=2,ds=3,vi=0,Pr=1,yi=2,fs=0,el=1,Dy=2,Ly=3,Ny=4,EB=5,to=100,xB=101,wB=102,IB=103,CB=104,MB=200,SB=201,TB=202,BB=203,aA=204,oA=205,bB=206,RB=207,DB=208,LB=209,NB=210,UB=211,PB=212,kB=213,QB=214,OB=0,FB=1,zB=2,Vh=3,HB=4,GB=5,VB=6,jB=7,Uy=0,WB=1,YB=2,Js=0,Py=1,ky=2,Qy=3,lA=4,qB=5,Oy=6,Fy=7,zy="attached",XB="detached",Hy=300,ro=301,tl=302,Xc=303,cA=304,jh=306,Zs=1e3,Ei=1001,Wh=1002,dr=1003,Gy=1004,Kc=1005,fr=1006,Yh=1007,xi=1008,KB=1008,pr=1009,uA=1010,Vy=1011,hA=1012,Jc=1013,wi=1014,or=1015,_n=1016,jy=1017,Wy=1018,Zc=1020,JB=35902,ZB=1021,$B=1022,Ar=1023,eb=1024,tb=1025,rl=1026,$c=1027,$s=1028,dA=1029,no=1030,qh=1031,eu=1033,Xh=33776,fA=33777,pA=33778,Kh=33779,AA=35840,Yy=35841,gA=35842,qy=35843,mA=36196,_A=37492,vA=37496,yA=37808,Xy=37809,Ky=37810,Jy=37811,Jh=37812,Zy=37813,$y=37814,eE=37815,tE=37816,rE=37817,nE=37818,iE=37819,sE=37820,aE=37821,Zh=36492,oE=36494,lE=36495,rb=36283,cE=36284,uE=36285,hE=36286,tu=2300,nl=2301,EA=2302,dE=2400,fE=2401,pE=2402,nb=2500,ib=0,AE=1,xA=2,sb=3200,ab=3201,gE=0,ob=1,ps="",kr="srgb",Cr="srgb-linear",$h="display-p3",ru="display-p3-linear",ed="linear",Ht="srgb",td="rec709",rd="p3",il=7680,mE=519,lb=512,cb=513,ub=514,_E=515,hb=516,db=517,fb=518,pb=519,wA=35044,vE="300 es",As=2e3,nd=2001;class io{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const n=this._listeners[e];if(n!==void 0){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const t=this._listeners[e.type];if(t!==void 0){e.target=this;const n=t.slice(0);for(let i=0,s=n.length;i<s;i++)n[i].call(this,e);e.target=null}}}const Xr=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let yE=1234567;const nu=Math.PI/180,sl=180/Math.PI;function Ii(){const r=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(Xr[r&255]+Xr[r>>8&255]+Xr[r>>16&255]+Xr[r>>24&255]+"-"+Xr[e&255]+Xr[e>>8&255]+"-"+Xr[e>>16&15|64]+Xr[e>>24&255]+"-"+Xr[t&63|128]+Xr[t>>8&255]+"-"+Xr[t>>16&255]+Xr[t>>24&255]+Xr[n&255]+Xr[n>>8&255]+Xr[n>>16&255]+Xr[n>>24&255]).toLowerCase()}function Mr(r,e,t){return Math.max(e,Math.min(t,r))}function IA(r,e){return(r%e+e)%e}function Ab(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function gb(r,e,t){return r!==e?(t-r)/(e-r):0}function iu(r,e,t){return(1-t)*r+t*e}function mb(r,e,t,n){return iu(r,e,1-Math.exp(-t*n))}function _b(r,e=1){return e-Math.abs(IA(r,e*2)-e)}function vb(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function yb(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function Eb(r,e){return r+Math.floor(Math.random()*(e-r+1))}function xb(r,e){return r+Math.random()*(e-r)}function wb(r){return r*(.5-Math.random())}function Ib(r){r!==void 0&&(yE=r);let e=yE+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function Cb(r){return r*nu}function Mb(r){return r*sl}function Sb(r){return(r&r-1)===0&&r!==0}function Tb(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function Bb(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function bb(r,e,t,n,i){const s=Math.cos,o=Math.sin,c=s(t/2),h=o(t/2),u=s((e+n)/2),d=o((e+n)/2),A=s((e-n)/2),p=o((e-n)/2),g=s((n-e)/2),v=o((n-e)/2);switch(i){case"XYX":r.set(c*d,h*A,h*p,c*u);break;case"YZY":r.set(h*p,c*d,h*A,c*u);break;case"ZXZ":r.set(h*A,h*p,c*d,c*u);break;case"XZX":r.set(c*d,h*v,h*g,c*u);break;case"YXY":r.set(h*g,c*d,h*v,c*u);break;case"ZYZ":r.set(h*v,h*g,c*d,c*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Ci(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function Nt(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}const CA={DEG2RAD:nu,RAD2DEG:sl,generateUUID:Ii,clamp:Mr,euclideanModulo:IA,mapLinear:Ab,inverseLerp:gb,lerp:iu,damp:mb,pingpong:_b,smoothstep:vb,smootherstep:yb,randInt:Eb,randFloat:xb,randFloatSpread:wb,seededRandom:Ib,degToRad:Cb,radToDeg:Mb,isPowerOfTwo:Sb,ceilPowerOfTwo:Tb,floorPowerOfTwo:Bb,setQuaternionFromProperEuler:bb,normalize:Nt,denormalize:Ci};class Ge{constructor(e=0,t=0){Ge.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){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[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){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(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}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Mr(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=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){const n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ht{constructor(e,t,n,i,s,o,c,h,u){ht.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,o,c,h,u)}set(e,t,n,i,s,o,c,h,u){const d=this.elements;return d[0]=e,d[1]=i,d[2]=c,d[3]=t,d[4]=s,d[5]=h,d[6]=n,d[7]=o,d[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const 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){const n=e.elements,i=t.elements,s=this.elements,o=n[0],c=n[3],h=n[6],u=n[1],d=n[4],A=n[7],p=n[2],g=n[5],v=n[8],E=i[0],m=i[3],_=i[6],w=i[1],x=i[4],I=i[7],R=i[2],S=i[5],T=i[8];return s[0]=o*E+c*w+h*R,s[3]=o*m+c*x+h*S,s[6]=o*_+c*I+h*T,s[1]=u*E+d*w+A*R,s[4]=u*m+d*x+A*S,s[7]=u*_+d*I+A*T,s[2]=p*E+g*w+v*R,s[5]=p*m+g*x+v*S,s[8]=p*_+g*I+v*T,this}multiplyScalar(e){const 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(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],c=e[5],h=e[6],u=e[7],d=e[8];return t*o*d-t*c*u-n*s*d+n*c*h+i*s*u-i*o*h}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],c=e[5],h=e[6],u=e[7],d=e[8],A=d*o-c*u,p=c*h-d*s,g=u*s-o*h,v=t*A+n*p+i*g;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const E=1/v;return e[0]=A*E,e[1]=(i*u-d*n)*E,e[2]=(c*n-i*o)*E,e[3]=p*E,e[4]=(d*t-i*h)*E,e[5]=(i*s-c*t)*E,e[6]=g*E,e[7]=(n*h-u*t)*E,e[8]=(o*t-n*s)*E,this}transpose(){let e;const 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){const 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,n,i,s,o,c){const h=Math.cos(s),u=Math.sin(s);return this.set(n*h,n*u,-n*(h*o+u*c)+o+e,-i*u,i*h,-i*(-u*o+h*c)+c+t,0,0,1),this}scale(e,t){return this.premultiply(MA.makeScale(e,t)),this}rotate(e){return this.premultiply(MA.makeRotation(-e)),this}translate(e,t){return this.premultiply(MA.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const MA=new ht;function EE(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}function su(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function Rb(){const r=su("canvas");return r.style.display="block",r}const xE={};function wE(r){r in xE||(xE[r]=!0,console.warn(r))}const IE=new ht().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),CE=new ht().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),id={[Cr]:{transfer:ed,primaries:td,toReference:r=>r,fromReference:r=>r},[kr]:{transfer:Ht,primaries:td,toReference:r=>r.convertSRGBToLinear(),fromReference:r=>r.convertLinearToSRGB()},[ru]:{transfer:ed,primaries:rd,toReference:r=>r.applyMatrix3(CE),fromReference:r=>r.applyMatrix3(IE)},[$h]:{transfer:Ht,primaries:rd,toReference:r=>r.convertSRGBToLinear().applyMatrix3(CE),fromReference:r=>r.applyMatrix3(IE).convertLinearToSRGB()}},Db=new Set([Cr,ru]),Rt={enabled:!0,_workingColorSpace:Cr,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(r){if(!Db.has(r))throw new Error(`Unsupported working color space, "${r}".`);this._workingColorSpace=r},convert:function(r,e,t){if(this.enabled===!1||e===t||!e||!t)return r;const n=id[e].toReference,i=id[t].fromReference;return i(n(r))},fromWorkingColorSpace:function(r,e){return this.convert(r,this._workingColorSpace,e)},toWorkingColorSpace:function(r,e){return this.convert(r,e,this._workingColorSpace)},getPrimaries:function(r){return id[r].primaries},getTransfer:function(r){return r===ps?ed:id[r].transfer}};function al(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function SA(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}let ol;class Lb{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{ol===void 0&&(ol=su("canvas")),ol.width=e.width,ol.height=e.height;const n=ol.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=ol}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){const t=su("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),s=i.data;for(let o=0;o<s.length;o++)s[o]=al(s[o]/255)*255;return n.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(al(t[n]/255)*255):t[n]=al(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let Nb=0;class ME{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Nb++}),this.uuid=Ii(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let o=0,c=i.length;o<c;o++)i[o].isDataTexture?s.push(TA(i[o].image)):s.push(TA(i[o]))}else s=TA(i);n.url=s}return t||(e.images[this.uuid]=n),n}}function TA(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?Lb.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Ub=0;class Sr extends io{constructor(e=Sr.DEFAULT_IMAGE,t=Sr.DEFAULT_MAPPING,n=Ei,i=Ei,s=fr,o=xi,c=Ar,h=pr,u=Sr.DEFAULT_ANISOTROPY,d=ps){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Ub++}),this.uuid=Ii(),this.name="",this.source=new ME(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=u,this.format=c,this.internalFormat=null,this.type=h,this.offset=new Ge(0,0),this.repeat=new Ge(1,1),this.center=new Ge(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ht,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=d,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){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.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Hy)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Zs:e.x=e.x-Math.floor(e.x);break;case Ei:e.x=e.x<0?0:1;break;case Wh:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Zs:e.y=e.y-Math.floor(e.y);break;case Ei:e.y=e.y<0?0:1;break;case Wh:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Sr.DEFAULT_IMAGE=null,Sr.DEFAULT_MAPPING=Hy,Sr.DEFAULT_ANISOTROPY=1;class Ft{constructor(e=0,t=0,n=0,i=1){Ft.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}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,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,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=e.w!==void 0?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){const t=this.x,n=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const 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,n,i,s;const o=e.elements,c=o[0],h=o[4],u=o[8],d=o[1],A=o[5],p=o[9],g=o[2],v=o[6],E=o[10];if(Math.abs(h-d)<.01&&Math.abs(u-g)<.01&&Math.abs(p-v)<.01){if(Math.abs(h+d)<.1&&Math.abs(u+g)<.1&&Math.abs(p+v)<.1&&Math.abs(c+A+E-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const _=(c+1)/2,w=(A+1)/2,x=(E+1)/2,I=(h+d)/4,R=(u+g)/4,S=(p+v)/4;return _>w&&_>x?_<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(_),i=I/n,s=R/n):w>x?w<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(w),n=I/i,s=S/i):x<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(x),n=R/s,i=S/s),this.set(n,i,s,t),this}let m=Math.sqrt((v-p)*(v-p)+(u-g)*(u-g)+(d-h)*(d-h));return Math.abs(m)<.001&&(m=1),this.x=(v-p)/m,this.y=(u-g)/m,this.z=(d-h)/m,this.w=Math.acos((c+A+E-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){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=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}}class Pb extends io{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Ft(0,0,e,t),this.scissorTest=!1,this.viewport=new Ft(0,0,e,t);const i={width:e,height:t,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:fr,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0,count:1},n);const s=new Sr(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);s.flipY=!1,s.generateMipmaps=n.generateMipmaps,s.internalFormat=n.internalFormat,this.textures=[];const o=n.count;for(let c=0;c<o;c++)this.textures[c]=s.clone(),this.textures[c].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,s=this.textures.length;i<s;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=n;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.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,i=e.textures.length;n<i;n++)this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new ME(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Mi extends Pb{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class SE extends Sr{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=dr,this.minFilter=dr,this.wrapR=Ei,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class TE extends Sr{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=dr,this.minFilter=dr,this.wrapR=Ei,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ji{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,s,o,c){let h=n[i+0],u=n[i+1],d=n[i+2],A=n[i+3];const p=s[o+0],g=s[o+1],v=s[o+2],E=s[o+3];if(c===0){e[t+0]=h,e[t+1]=u,e[t+2]=d,e[t+3]=A;return}if(c===1){e[t+0]=p,e[t+1]=g,e[t+2]=v,e[t+3]=E;return}if(A!==E||h!==p||u!==g||d!==v){let m=1-c;const _=h*p+u*g+d*v+A*E,w=_>=0?1:-1,x=1-_*_;if(x>Number.EPSILON){const R=Math.sqrt(x),S=Math.atan2(R,_*w);m=Math.sin(m*S)/R,c=Math.sin(c*S)/R}const I=c*w;if(h=h*m+p*I,u=u*m+g*I,d=d*m+v*I,A=A*m+E*I,m===1-c){const R=1/Math.sqrt(h*h+u*u+d*d+A*A);h*=R,u*=R,d*=R,A*=R}}e[t]=h,e[t+1]=u,e[t+2]=d,e[t+3]=A}static multiplyQuaternionsFlat(e,t,n,i,s,o){const c=n[i],h=n[i+1],u=n[i+2],d=n[i+3],A=s[o],p=s[o+1],g=s[o+2],v=s[o+3];return e[t]=c*v+d*A+h*g-u*p,e[t+1]=h*v+d*p+u*A-c*g,e[t+2]=u*v+d*g+c*p-h*A,e[t+3]=d*v-c*A-h*p-u*g,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,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,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=!0){const n=e._x,i=e._y,s=e._z,o=e._order,c=Math.cos,h=Math.sin,u=c(n/2),d=c(i/2),A=c(s/2),p=h(n/2),g=h(i/2),v=h(s/2);switch(o){case"XYZ":this._x=p*d*A+u*g*v,this._y=u*g*A-p*d*v,this._z=u*d*v+p*g*A,this._w=u*d*A-p*g*v;break;case"YXZ":this._x=p*d*A+u*g*v,this._y=u*g*A-p*d*v,this._z=u*d*v-p*g*A,this._w=u*d*A+p*g*v;break;case"ZXY":this._x=p*d*A-u*g*v,this._y=u*g*A+p*d*v,this._z=u*d*v+p*g*A,this._w=u*d*A-p*g*v;break;case"ZYX":this._x=p*d*A-u*g*v,this._y=u*g*A+p*d*v,this._z=u*d*v-p*g*A,this._w=u*d*A+p*g*v;break;case"YZX":this._x=p*d*A+u*g*v,this._y=u*g*A+p*d*v,this._z=u*d*v-p*g*A,this._w=u*d*A-p*g*v;break;case"XZY":this._x=p*d*A-u*g*v,this._y=u*g*A-p*d*v,this._z=u*d*v+p*g*A,this._w=u*d*A+p*g*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],s=t[8],o=t[1],c=t[5],h=t[9],u=t[2],d=t[6],A=t[10],p=n+c+A;if(p>0){const g=.5/Math.sqrt(p+1);this._w=.25/g,this._x=(d-h)*g,this._y=(s-u)*g,this._z=(o-i)*g}else if(n>c&&n>A){const g=2*Math.sqrt(1+n-c-A);this._w=(d-h)/g,this._x=.25*g,this._y=(i+o)/g,this._z=(s+u)/g}else if(c>A){const g=2*Math.sqrt(1+c-n-A);this._w=(s-u)/g,this._x=(i+o)/g,this._y=.25*g,this._z=(h+d)/g}else{const g=2*Math.sqrt(1+A-n-c);this._w=(o-i)/g,this._x=(s+u)/g,this._y=(h+d)/g,this._z=.25*g}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Mr(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(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 e===0?(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){const n=e._x,i=e._y,s=e._z,o=e._w,c=t._x,h=t._y,u=t._z,d=t._w;return this._x=n*d+o*c+i*u-s*h,this._y=i*d+o*h+s*c-n*u,this._z=s*d+o*u+n*h-i*c,this._w=o*d-n*c-i*h-s*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,i=this._y,s=this._z,o=this._w;let c=o*e._w+n*e._x+i*e._y+s*e._z;if(c<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,c=-c):this.copy(e),c>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;const h=1-c*c;if(h<=Number.EPSILON){const g=1-t;return this._w=g*o+t*this._w,this._x=g*n+t*this._x,this._y=g*i+t*this._y,this._z=g*s+t*this._z,this.normalize(),this}const u=Math.sqrt(h),d=Math.atan2(u,c),A=Math.sin((1-t)*d)/u,p=Math.sin(t*d)/u;return this._w=o*A+this._w*p,this._x=n*A+this._x*p,this._y=i*A+this._y*p,this._z=s*A+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=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(e=[],t=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._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class W{constructor(e=0,t=0,n=0){W.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,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(BE.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(BE.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,s=e.x,o=e.y,c=e.z,h=e.w,u=2*(o*i-c*n),d=2*(c*t-s*i),A=2*(s*n-o*t);return this.x=t+h*u+o*A-c*d,this.y=n+h*d+c*u-s*A,this.z=i+h*A+s*d-o*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,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){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,s=e.z,o=t.x,c=t.y,h=t.z;return this.x=i*h-s*c,this.y=s*o-n*h,this.z=n*c-i*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return BA.copy(this).projectOnVector(e),this.sub(BA)}reflect(e){return this.sub(BA.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Mr(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}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,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=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(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const BA=new W,BE=new ji;class yr{constructor(e=new W(1/0,1/0,1/0),t=new W(-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){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(Si.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Si.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=Si.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!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,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const s=n.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let o=0,c=s.count;o<c;o++)e.isMesh===!0?e.getVertexPosition(o,Si):Si.fromBufferAttribute(s,o),Si.applyMatrix4(e.matrixWorld),this.expandByPoint(Si);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),sd.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),sd.copy(n.boundingBox)),sd.applyMatrix4(e.matrixWorld),this.union(sd)}const i=e.children;for(let s=0,o=i.length;s<o;s++)this.expandByObject(i[s],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,Si),Si.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(au),ad.subVectors(this.max,au),ll.subVectors(e.a,au),cl.subVectors(e.b,au),ul.subVectors(e.c,au),ea.subVectors(cl,ll),ta.subVectors(ul,cl),so.subVectors(ll,ul);let t=[0,-ea.z,ea.y,0,-ta.z,ta.y,0,-so.z,so.y,ea.z,0,-ea.x,ta.z,0,-ta.x,so.z,0,-so.x,-ea.y,ea.x,0,-ta.y,ta.x,0,-so.y,so.x,0];return!bA(t,ll,cl,ul,ad)||(t=[1,0,0,0,1,0,0,0,1],!bA(t,ll,cl,ul,ad))?!1:(od.crossVectors(ea,ta),t=[od.x,od.y,od.z],bA(t,ll,cl,ul,ad))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Si).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Si).length()*.5),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()?this:(gs[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),gs[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),gs[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),gs[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),gs[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),gs[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),gs[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),gs[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(gs),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)}}const gs=[new W,new W,new W,new W,new W,new W,new W,new W],Si=new W,sd=new yr,ll=new W,cl=new W,ul=new W,ea=new W,ta=new W,so=new W,au=new W,ad=new W,od=new W,ao=new W;function bA(r,e,t,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){ao.fromArray(r,s);const c=i.x*Math.abs(ao.x)+i.y*Math.abs(ao.y)+i.z*Math.abs(ao.z),h=e.dot(ao),u=t.dot(ao),d=n.dot(ao);if(Math.max(-Math.max(h,u,d),Math.min(h,u,d))>c)return!1}return!0}const kb=new yr,ou=new W,RA=new W;class Ti{constructor(e=new W,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):kb.setFromPoints(e).getCenter(n);let i=0;for(let s=0,o=e.length;s<o;s++)i=Math.max(i,n.distanceToSquared(e[s]));return this.radius=Math.sqrt(i),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){const 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){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}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;ou.subVectors(e,this.center);const t=ou.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(ou,i/n),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(RA.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ou.copy(e.center).add(RA)),this.expandByPoint(ou.copy(e.center).sub(RA))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const ms=new W,DA=new W,ld=new W,ra=new W,LA=new W,cd=new W,NA=new W;class lu{constructor(e=new W,t=new W(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.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ms)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=ms.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ms.copy(this.origin).addScaledVector(this.direction,t),ms.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){DA.copy(e).add(t).multiplyScalar(.5),ld.copy(t).sub(e).normalize(),ra.copy(this.origin).sub(DA);const s=e.distanceTo(t)*.5,o=-this.direction.dot(ld),c=ra.dot(this.direction),h=-ra.dot(ld),u=ra.lengthSq(),d=Math.abs(1-o*o);let A,p,g,v;if(d>0)if(A=o*h-c,p=o*c-h,v=s*d,A>=0)if(p>=-v)if(p<=v){const E=1/d;A*=E,p*=E,g=A*(A+o*p+2*c)+p*(o*A+p+2*h)+u}else p=s,A=Math.max(0,-(o*p+c)),g=-A*A+p*(p+2*h)+u;else p=-s,A=Math.max(0,-(o*p+c)),g=-A*A+p*(p+2*h)+u;else p<=-v?(A=Math.max(0,-(-o*s+c)),p=A>0?-s:Math.min(Math.max(-s,-h),s),g=-A*A+p*(p+2*h)+u):p<=v?(A=0,p=Math.min(Math.max(-s,-h),s),g=p*(p+2*h)+u):(A=Math.max(0,-(o*s+c)),p=A>0?s:Math.min(Math.max(-s,-h),s),g=-A*A+p*(p+2*h)+u);else p=o>0?-s:s,A=Math.max(0,-(o*p+c)),g=-A*A+p*(p+2*h)+u;return n&&n.copy(this.origin).addScaledVector(this.direction,A),i&&i.copy(DA).addScaledVector(ld,p),g}intersectSphere(e,t){ms.subVectors(e.center,this.origin);const n=ms.dot(this.direction),i=ms.dot(ms)-n*n,s=e.radius*e.radius;if(i>s)return null;const o=Math.sqrt(s-i),c=n-o,h=n+o;return h<0?null:c<0?this.at(h,t):this.at(c,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,o,c,h;const u=1/this.direction.x,d=1/this.direction.y,A=1/this.direction.z,p=this.origin;return u>=0?(n=(e.min.x-p.x)*u,i=(e.max.x-p.x)*u):(n=(e.max.x-p.x)*u,i=(e.min.x-p.x)*u),d>=0?(s=(e.min.y-p.y)*d,o=(e.max.y-p.y)*d):(s=(e.max.y-p.y)*d,o=(e.min.y-p.y)*d),n>o||s>i||((s>n||isNaN(n))&&(n=s),(o<i||isNaN(i))&&(i=o),A>=0?(c=(e.min.z-p.z)*A,h=(e.max.z-p.z)*A):(c=(e.max.z-p.z)*A,h=(e.min.z-p.z)*A),n>h||c>i)||((c>n||n!==n)&&(n=c),(h<i||i!==i)&&(i=h),i<0)?null:this.at(n>=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,ms)!==null}intersectTriangle(e,t,n,i,s){LA.subVectors(t,e),cd.subVectors(n,e),NA.crossVectors(LA,cd);let o=this.direction.dot(NA),c;if(o>0){if(i)return null;c=1}else if(o<0)c=-1,o=-o;else return null;ra.subVectors(this.origin,e);const h=c*this.direction.dot(cd.crossVectors(ra,cd));if(h<0)return null;const u=c*this.direction.dot(LA.cross(ra));if(u<0||h+u>o)return null;const d=-c*ra.dot(NA);return d<0?null:this.at(d/o,s)}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)}}class tt{constructor(e,t,n,i,s,o,c,h,u,d,A,p,g,v,E,m){tt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,o,c,h,u,d,A,p,g,v,E,m)}set(e,t,n,i,s,o,c,h,u,d,A,p,g,v,E,m){const _=this.elements;return _[0]=e,_[4]=t,_[8]=n,_[12]=i,_[1]=s,_[5]=o,_[9]=c,_[13]=h,_[2]=u,_[6]=d,_[10]=A,_[14]=p,_[3]=g,_[7]=v,_[11]=E,_[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 tt().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const 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,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,i=1/hl.setFromMatrixColumn(e,0).length(),s=1/hl.setFromMatrixColumn(e,1).length(),o=1/hl.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,i=e.y,s=e.z,o=Math.cos(n),c=Math.sin(n),h=Math.cos(i),u=Math.sin(i),d=Math.cos(s),A=Math.sin(s);if(e.order==="XYZ"){const p=o*d,g=o*A,v=c*d,E=c*A;t[0]=h*d,t[4]=-h*A,t[8]=u,t[1]=g+v*u,t[5]=p-E*u,t[9]=-c*h,t[2]=E-p*u,t[6]=v+g*u,t[10]=o*h}else if(e.order==="YXZ"){const p=h*d,g=h*A,v=u*d,E=u*A;t[0]=p+E*c,t[4]=v*c-g,t[8]=o*u,t[1]=o*A,t[5]=o*d,t[9]=-c,t[2]=g*c-v,t[6]=E+p*c,t[10]=o*h}else if(e.order==="ZXY"){const p=h*d,g=h*A,v=u*d,E=u*A;t[0]=p-E*c,t[4]=-o*A,t[8]=v+g*c,t[1]=g+v*c,t[5]=o*d,t[9]=E-p*c,t[2]=-o*u,t[6]=c,t[10]=o*h}else if(e.order==="ZYX"){const p=o*d,g=o*A,v=c*d,E=c*A;t[0]=h*d,t[4]=v*u-g,t[8]=p*u+E,t[1]=h*A,t[5]=E*u+p,t[9]=g*u-v,t[2]=-u,t[6]=c*h,t[10]=o*h}else if(e.order==="YZX"){const p=o*h,g=o*u,v=c*h,E=c*u;t[0]=h*d,t[4]=E-p*A,t[8]=v*A+g,t[1]=A,t[5]=o*d,t[9]=-c*d,t[2]=-u*d,t[6]=g*A+v,t[10]=p-E*A}else if(e.order==="XZY"){const p=o*h,g=o*u,v=c*h,E=c*u;t[0]=h*d,t[4]=-A,t[8]=u*d,t[1]=p*A+E,t[5]=o*d,t[9]=g*A-v,t[2]=v*A-g,t[6]=c*d,t[10]=E*A+p}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(Qb,e,Ob)}lookAt(e,t,n){const i=this.elements;return On.subVectors(e,t),On.lengthSq()===0&&(On.z=1),On.normalize(),na.crossVectors(n,On),na.lengthSq()===0&&(Math.abs(n.z)===1?On.x+=1e-4:On.z+=1e-4,On.normalize(),na.crossVectors(n,On)),na.normalize(),ud.crossVectors(On,na),i[0]=na.x,i[4]=ud.x,i[8]=On.x,i[1]=na.y,i[5]=ud.y,i[9]=On.y,i[2]=na.z,i[6]=ud.z,i[10]=On.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,o=n[0],c=n[4],h=n[8],u=n[12],d=n[1],A=n[5],p=n[9],g=n[13],v=n[2],E=n[6],m=n[10],_=n[14],w=n[3],x=n[7],I=n[11],R=n[15],S=i[0],T=i[4],D=i[8],b=i[12],M=i[1],L=i[5],P=i[9],N=i[13],j=i[2],X=i[6],K=i[10],ne=i[14],V=i[3],te=i[7],Q=i[11],z=i[15];return s[0]=o*S+c*M+h*j+u*V,s[4]=o*T+c*L+h*X+u*te,s[8]=o*D+c*P+h*K+u*Q,s[12]=o*b+c*N+h*ne+u*z,s[1]=d*S+A*M+p*j+g*V,s[5]=d*T+A*L+p*X+g*te,s[9]=d*D+A*P+p*K+g*Q,s[13]=d*b+A*N+p*ne+g*z,s[2]=v*S+E*M+m*j+_*V,s[6]=v*T+E*L+m*X+_*te,s[10]=v*D+E*P+m*K+_*Q,s[14]=v*b+E*N+m*ne+_*z,s[3]=w*S+x*M+I*j+R*V,s[7]=w*T+x*L+I*X+R*te,s[11]=w*D+x*P+I*K+R*Q,s[15]=w*b+x*N+I*ne+R*z,this}multiplyScalar(e){const 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(){const e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],o=e[1],c=e[5],h=e[9],u=e[13],d=e[2],A=e[6],p=e[10],g=e[14],v=e[3],E=e[7],m=e[11],_=e[15];return v*(+s*h*A-i*u*A-s*c*p+n*u*p+i*c*g-n*h*g)+E*(+t*h*g-t*u*p+s*o*p-i*o*g+i*u*d-s*h*d)+m*(+t*u*A-t*c*g-s*o*A+n*o*g+s*c*d-n*u*d)+_*(-i*c*d-t*h*A+t*c*p+i*o*A-n*o*p+n*h*d)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],c=e[5],h=e[6],u=e[7],d=e[8],A=e[9],p=e[10],g=e[11],v=e[12],E=e[13],m=e[14],_=e[15],w=A*m*u-E*p*u+E*h*g-c*m*g-A*h*_+c*p*_,x=v*p*u-d*m*u-v*h*g+o*m*g+d*h*_-o*p*_,I=d*E*u-v*A*u+v*c*g-o*E*g-d*c*_+o*A*_,R=v*A*h-d*E*h-v*c*p+o*E*p+d*c*m-o*A*m,S=t*w+n*x+i*I+s*R;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/S;return e[0]=w*T,e[1]=(E*p*s-A*m*s-E*i*g+n*m*g+A*i*_-n*p*_)*T,e[2]=(c*m*s-E*h*s+E*i*u-n*m*u-c*i*_+n*h*_)*T,e[3]=(A*h*s-c*p*s-A*i*u+n*p*u+c*i*g-n*h*g)*T,e[4]=x*T,e[5]=(d*m*s-v*p*s+v*i*g-t*m*g-d*i*_+t*p*_)*T,e[6]=(v*h*s-o*m*s-v*i*u+t*m*u+o*i*_-t*h*_)*T,e[7]=(o*p*s-d*h*s+d*i*u-t*p*u-o*i*g+t*h*g)*T,e[8]=I*T,e[9]=(v*A*s-d*E*s-v*n*g+t*E*g+d*n*_-t*A*_)*T,e[10]=(o*E*s-v*c*s+v*n*u-t*E*u-o*n*_+t*c*_)*T,e[11]=(d*c*s-o*A*s-d*n*u+t*A*u+o*n*g-t*c*g)*T,e[12]=R*T,e[13]=(d*E*i-v*A*i+v*n*p-t*E*p-d*n*m+t*A*m)*T,e[14]=(v*c*i-o*E*i-v*n*h+t*E*h+o*n*m-t*c*m)*T,e[15]=(o*A*i-d*c*i+d*n*h-t*A*h-o*n*p+t*c*p)*T,this}scale(e){const t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),s=1-n,o=e.x,c=e.y,h=e.z,u=s*o,d=s*c;return this.set(u*o+n,u*c-i*h,u*h+i*c,0,u*c+i*h,d*c+n,d*h-i*o,0,u*h-i*c,d*h+i*o,s*h*h+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,o){return this.set(1,n,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,s=t._x,o=t._y,c=t._z,h=t._w,u=s+s,d=o+o,A=c+c,p=s*u,g=s*d,v=s*A,E=o*d,m=o*A,_=c*A,w=h*u,x=h*d,I=h*A,R=n.x,S=n.y,T=n.z;return i[0]=(1-(E+_))*R,i[1]=(g+I)*R,i[2]=(v-x)*R,i[3]=0,i[4]=(g-I)*S,i[5]=(1-(p+_))*S,i[6]=(m+w)*S,i[7]=0,i[8]=(v+x)*T,i[9]=(m-w)*T,i[10]=(1-(p+E))*T,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let s=hl.set(i[0],i[1],i[2]).length();const o=hl.set(i[4],i[5],i[6]).length(),c=hl.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],Bi.copy(this);const h=1/s,u=1/o,d=1/c;return Bi.elements[0]*=h,Bi.elements[1]*=h,Bi.elements[2]*=h,Bi.elements[4]*=u,Bi.elements[5]*=u,Bi.elements[6]*=u,Bi.elements[8]*=d,Bi.elements[9]*=d,Bi.elements[10]*=d,t.setFromRotationMatrix(Bi),n.x=s,n.y=o,n.z=c,this}makePerspective(e,t,n,i,s,o,c=As){const h=this.elements,u=2*s/(t-e),d=2*s/(n-i),A=(t+e)/(t-e),p=(n+i)/(n-i);let g,v;if(c===As)g=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(c===nd)g=-o/(o-s),v=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+c);return h[0]=u,h[4]=0,h[8]=A,h[12]=0,h[1]=0,h[5]=d,h[9]=p,h[13]=0,h[2]=0,h[6]=0,h[10]=g,h[14]=v,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this}makeOrthographic(e,t,n,i,s,o,c=As){const h=this.elements,u=1/(t-e),d=1/(n-i),A=1/(o-s),p=(t+e)*u,g=(n+i)*d;let v,E;if(c===As)v=(o+s)*A,E=-2*A;else if(c===nd)v=s*A,E=-1*A;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+c);return h[0]=2*u,h[4]=0,h[8]=0,h[12]=-p,h[1]=0,h[5]=2*d,h[9]=0,h[13]=-g,h[2]=0,h[6]=0,h[10]=E,h[14]=-v,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const hl=new W,Bi=new tt,Qb=new W(0,0,0),Ob=new W(1,1,1),na=new W,ud=new W,On=new W,bE=new tt,RE=new ji;class Wi{constructor(e=0,t=0,n=0,i=Wi.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}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,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,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,t=this._order,n=!0){const i=e.elements,s=i[0],o=i[4],c=i[8],h=i[1],u=i[5],d=i[9],A=i[2],p=i[6],g=i[10];switch(t){case"XYZ":this._y=Math.asin(Mr(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-d,g),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,u),this._z=0);break;case"YXZ":this._x=Math.asin(-Mr(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(c,g),this._z=Math.atan2(h,u)):(this._y=Math.atan2(-A,s),this._z=0);break;case"ZXY":this._x=Math.asin(Mr(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-A,g),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(h,s));break;case"ZYX":this._y=Math.asin(-Mr(A,-1,1)),Math.abs(A)<.9999999?(this._x=Math.atan2(p,g),this._z=Math.atan2(h,s)):(this._x=0,this._z=Math.atan2(-o,u));break;case"YZX":this._z=Math.asin(Mr(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-d,u),this._y=Math.atan2(-A,s)):(this._x=0,this._y=Math.atan2(c,g));break;case"XZY":this._z=Math.asin(-Mr(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,u),this._y=Math.atan2(c,s)):(this._x=Math.atan2(-d,g),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return bE.makeRotationFromQuaternion(e),this.setFromRotationMatrix(bE,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return RE.setFromEuler(this),this.setFromQuaternion(RE,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],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=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}}Wi.DEFAULT_ORDER="XYZ";class UA{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(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let Fb=0;const DE=new W,dl=new ji,_s=new tt,hd=new W,cu=new W,zb=new W,Hb=new ji,LE=new W(1,0,0),NE=new W(0,1,0),UE=new W(0,0,1),PE={type:"added"},Gb={type:"removed"},fl={type:"childadded",child:null},PA={type:"childremoved",child:null};class Zt extends io{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Fb++}),this.uuid=Ii(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Zt.DEFAULT_UP.clone();const e=new W,t=new Wi,n=new ji,i=new W(1,1,1);function s(){n.setFromEuler(t,!1)}function o(){t.setFromQuaternion(n,void 0,!1)}t._onChange(s),n._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new tt},normalMatrix:{value:new ht}}),this.matrix=new tt,this.matrixWorld=new tt,this.matrixAutoUpdate=Zt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Zt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new UA,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}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 dl.setFromAxisAngle(e,t),this.quaternion.multiply(dl),this}rotateOnWorldAxis(e,t){return dl.setFromAxisAngle(e,t),this.quaternion.premultiply(dl),this}rotateX(e){return this.rotateOnAxis(LE,e)}rotateY(e){return this.rotateOnAxis(NE,e)}rotateZ(e){return this.rotateOnAxis(UE,e)}translateOnAxis(e,t){return DE.copy(e).applyQuaternion(this.quaternion),this.position.add(DE.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(LE,e)}translateY(e){return this.translateOnAxis(NE,e)}translateZ(e){return this.translateOnAxis(UE,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(_s.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?hd.copy(e):hd.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),cu.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?_s.lookAt(cu,hd,this.up):_s.lookAt(hd,cu,this.up),this.quaternion.setFromRotationMatrix(_s),i&&(_s.extractRotation(i.matrixWorld),dl.setFromRotationMatrix(_s),this.quaternion.premultiply(dl.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(PE),fl.child=e,this.dispatchEvent(fl),fl.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(Gb),PA.child=e,this.dispatchEvent(PA),PA.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),_s.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),_s.multiply(e.parent.matrixWorld)),e.applyMatrix4(_s),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(PE),fl.child=e,this.dispatchEvent(fl),fl.child=null,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 n=0,i=this.children.length;n<i;n++){const s=this.children[n].getObjectByProperty(e,t);if(s!==void 0)return s}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const i=this.children;for(let s=0,o=i.length;s<o;s++)i[s].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(cu,e,zb),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(cu,Hb,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(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)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,i=t.length;n<i;n++){const s=t[n];(s.matrixWorldAutoUpdate===!0||e===!0)&&s.updateMatrixWorld(e)}}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.matrixWorldAutoUpdate===!0&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t===!0){const i=this.children;for(let s=0,o=i.length;s<o;s++){const c=i[s];c.matrixWorldAutoUpdate===!0&&c.updateWorldMatrix(!1,!0)}}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(c=>({boxInitialized:c.boxInitialized,boxMin:c.box.min.toArray(),boxMax:c.box.max.toArray(),sphereInitialized:c.sphereInitialized,sphereRadius:c.sphere.radius,sphereCenter:c.sphere.center.toArray()})),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function s(c,h){return c[h.uuid]===void 0&&(c[h.uuid]=h.toJSON(e)),h.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(e.geometries,this.geometry);const c=this.geometry.parameters;if(c!==void 0&&c.shapes!==void 0){const h=c.shapes;if(Array.isArray(h))for(let u=0,d=h.length;u<d;u++){const A=h[u];s(e.shapes,A)}else s(e.shapes,h)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const c=[];for(let h=0,u=this.material.length;h<u;h++)c.push(s(e.materials,this.material[h]));i.material=c}else i.material=s(e.materials,this.material);if(this.children.length>0){i.children=[];for(let c=0;c<this.children.length;c++)i.children.push(this.children[c].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let c=0;c<this.animations.length;c++){const h=this.animations[c];i.animations.push(s(e.animations,h))}}if(t){const c=o(e.geometries),h=o(e.materials),u=o(e.textures),d=o(e.images),A=o(e.shapes),p=o(e.skeletons),g=o(e.animations),v=o(e.nodes);c.length>0&&(n.geometries=c),h.length>0&&(n.materials=h),u.length>0&&(n.textures=u),d.length>0&&(n.images=d),A.length>0&&(n.shapes=A),p.length>0&&(n.skeletons=p),g.length>0&&(n.animations=g),v.length>0&&(n.nodes=v)}return n.object=i,n;function o(c){const h=[];for(const u in c){const d=c[u];delete d.metadata,h.push(d)}return h}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const i=e.children[n];this.add(i.clone())}return this}}Zt.DEFAULT_UP=new W(0,1,0),Zt.DEFAULT_MATRIX_AUTO_UPDATE=!0,Zt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const bi=new W,vs=new W,kA=new W,ys=new W,pl=new W,Al=new W,kE=new W,QA=new W,OA=new W,FA=new W;class on{constructor(e=new W,t=new W,n=new W){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),bi.subVectors(e,t),i.cross(bi);const s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){bi.subVectors(i,t),vs.subVectors(n,t),kA.subVectors(e,t);const o=bi.dot(bi),c=bi.dot(vs),h=bi.dot(kA),u=vs.dot(vs),d=vs.dot(kA),A=o*u-c*c;if(A===0)return s.set(0,0,0),null;const p=1/A,g=(u*h-c*d)*p,v=(o*d-c*h)*p;return s.set(1-g-v,v,g)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,ys)===null?!1:ys.x>=0&&ys.y>=0&&ys.x+ys.y<=1}static getInterpolation(e,t,n,i,s,o,c,h){return this.getBarycoord(e,t,n,i,ys)===null?(h.x=0,h.y=0,"z"in h&&(h.z=0),"w"in h&&(h.w=0),null):(h.setScalar(0),h.addScaledVector(s,ys.x),h.addScaledVector(o,ys.y),h.addScaledVector(c,ys.z),h)}static isFrontFacing(e,t,n,i){return bi.subVectors(n,t),vs.subVectors(e,t),bi.cross(vs).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),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 bi.subVectors(this.c,this.b),vs.subVectors(this.a,this.b),bi.cross(vs).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return on.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return on.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,s){return on.getInterpolation(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return on.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return on.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,s=this.c;let o,c;pl.subVectors(i,n),Al.subVectors(s,n),QA.subVectors(e,n);const h=pl.dot(QA),u=Al.dot(QA);if(h<=0&&u<=0)return t.copy(n);OA.subVectors(e,i);const d=pl.dot(OA),A=Al.dot(OA);if(d>=0&&A<=d)return t.copy(i);const p=h*A-d*u;if(p<=0&&h>=0&&d<=0)return o=h/(h-d),t.copy(n).addScaledVector(pl,o);FA.subVectors(e,s);const g=pl.dot(FA),v=Al.dot(FA);if(v>=0&&g<=v)return t.copy(s);const E=g*u-h*v;if(E<=0&&u>=0&&v<=0)return c=u/(u-v),t.copy(n).addScaledVector(Al,c);const m=d*v-g*A;if(m<=0&&A-d>=0&&g-v>=0)return kE.subVectors(s,i),c=(A-d)/(A-d+(g-v)),t.copy(i).addScaledVector(kE,c);const _=1/(m+E+p);return o=E*_,c=p*_,t.copy(n).addScaledVector(pl,o).addScaledVector(Al,c)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const QE={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},ia={h:0,s:0,l:0},dd={h:0,s:0,l:0};function zA(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}class qe{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=kr){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Rt.toWorkingColorSpace(this,t),this}setRGB(e,t,n,i=Rt.workingColorSpace){return this.r=e,this.g=t,this.b=n,Rt.toWorkingColorSpace(this,i),this}setHSL(e,t,n,i=Rt.workingColorSpace){if(e=IA(e,1),t=Mr(t,0,1),n=Mr(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,o=2*n-s;this.r=zA(o,s,e+1/3),this.g=zA(o,s,e),this.b=zA(o,s,e-1/3)}return Rt.toWorkingColorSpace(this,i),this}setStyle(e,t=kr){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=i[1],c=i[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=kr){const n=QE[e.toLowerCase()];return n!==void 0?this.setHex(n,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=al(e.r),this.g=al(e.g),this.b=al(e.b),this}copyLinearToSRGB(e){return this.r=SA(e.r),this.g=SA(e.g),this.b=SA(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=kr){return Rt.fromWorkingColorSpace(Kr.copy(this),e),Math.round(Mr(Kr.r*255,0,255))*65536+Math.round(Mr(Kr.g*255,0,255))*256+Math.round(Mr(Kr.b*255,0,255))}getHexString(e=kr){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Rt.workingColorSpace){Rt.fromWorkingColorSpace(Kr.copy(this),t);const n=Kr.r,i=Kr.g,s=Kr.b,o=Math.max(n,i,s),c=Math.min(n,i,s);let h,u;const d=(c+o)/2;if(c===o)h=0,u=0;else{const A=o-c;switch(u=d<=.5?A/(o+c):A/(2-o-c),o){case n:h=(i-s)/A+(i<s?6:0);break;case i:h=(s-n)/A+2;break;case s:h=(n-i)/A+4;break}h/=6}return e.h=h,e.s=u,e.l=d,e}getRGB(e,t=Rt.workingColorSpace){return Rt.fromWorkingColorSpace(Kr.copy(this),t),e.r=Kr.r,e.g=Kr.g,e.b=Kr.b,e}getStyle(e=kr){Rt.fromWorkingColorSpace(Kr.copy(this),e);const t=Kr.r,n=Kr.g,i=Kr.b;return e!==kr?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(e,t,n){return this.getHSL(ia),this.setHSL(ia.h+e,ia.s+t,ia.l+n)}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,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(ia),e.getHSL(dd);const n=iu(ia.h,dd.h,t),i=iu(ia.s,dd.s,t),s=iu(ia.l,dd.l,t);return this.setHSL(n,i,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,i=this.b,s=e.elements;return this.r=s[0]*t+s[3]*n+s[6]*i,this.g=s[1]*t+s[4]*n+s[7]*i,this.b=s[2]*t+s[5]*n+s[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=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}}const Kr=new qe;qe.NAMES=QE;let Vb=0;class Yi extends io{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Vb++}),this.uuid=Ii(),this.name="",this.type="Material",this.blending=el,this.side=vi,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=aA,this.blendDst=oA,this.blendEquation=to,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new qe(0,0,0),this.blendAlpha=0,this.depthFunc=Vh,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=mE,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=il,this.stencilZFail=il,this.stencilZPass=il,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(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==el&&(n.blending=this.blending),this.side!==vi&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==aA&&(n.blendSrc=this.blendSrc),this.blendDst!==oA&&(n.blendDst=this.blendDst),this.blendEquation!==to&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==Vh&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==mE&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==il&&(n.stencilFail=this.stencilFail),this.stencilZFail!==il&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==il&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(s){const o=[];for(const c in s){const h=s[c];delete h.metadata,o.push(h)}return o}if(t){const s=i(e.textures),o=i(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}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.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Es extends Yi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new qe(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Wi,this.combine=Uy,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.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const xs=jb();function jb(){const r=new ArrayBuffer(4),e=new Float32Array(r),t=new Uint32Array(r),n=new Uint32Array(512),i=new Uint32Array(512);for(let h=0;h<256;++h){const u=h-127;u<-27?(n[h]=0,n[h|256]=32768,i[h]=24,i[h|256]=24):u<-14?(n[h]=1024>>-u-14,n[h|256]=1024>>-u-14|32768,i[h]=-u-1,i[h|256]=-u-1):u<=15?(n[h]=u+15<<10,n[h|256]=u+15<<10|32768,i[h]=13,i[h|256]=13):u<128?(n[h]=31744,n[h|256]=64512,i[h]=24,i[h|256]=24):(n[h]=31744,n[h|256]=64512,i[h]=13,i[h|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),c=new Uint32Array(64);for(let h=1;h<1024;++h){let u=h<<13,d=0;for(;!(u&8388608);)u<<=1,d-=8388608;u&=-8388609,d+=947912704,s[h]=u|d}for(let h=1024;h<2048;++h)s[h]=939524096+(h-1024<<13);for(let h=1;h<31;++h)o[h]=h<<23;o[31]=1199570944,o[32]=2147483648;for(let h=33;h<63;++h)o[h]=2147483648+(h-32<<23);o[63]=3347054592;for(let h=1;h<64;++h)h!==32&&(c[h]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:i,mantissaTable:s,exponentTable:o,offsetTable:c}}function Wb(r){Math.abs(r)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),r=Mr(r,-65504,65504),xs.floatView[0]=r;const e=xs.uint32View[0],t=e>>23&511;return xs.baseTable[t]+((e&8388607)>>xs.shiftTable[t])}function Yb(r){const e=r>>10;return xs.uint32View[0]=xs.mantissaTable[xs.offsetTable[e]+(r&1023)]+xs.exponentTable[e],xs.floatView[0]}const fd={toHalfFloat:Wb,fromHalfFloat:Yb},Er=new W,pd=new Ge;class Qr{constructor(e,t,n=!1){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=e!==void 0?e.length/t:0,this.normalized=n,this.usage=wA,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=or,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return wE("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}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.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,s=this.itemSize;i<s;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)pd.fromBufferAttribute(this,t),pd.applyMatrix3(e),this.setXY(t,pd.x,pd.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)Er.fromBufferAttribute(this,t),Er.applyMatrix3(e),this.setXYZ(t,Er.x,Er.y,Er.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Er.fromBufferAttribute(this,t),Er.applyMatrix4(e),this.setXYZ(t,Er.x,Er.y,Er.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Er.fromBufferAttribute(this,t),Er.applyNormalMatrix(e),this.setXYZ(t,Er.x,Er.y,Er.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Er.fromBufferAttribute(this,t),Er.transformDirection(e),this.setXYZ(t,Er.x,Er.y,Er.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=Ci(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Nt(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Ci(t,this.array)),t}setX(e,t){return this.normalized&&(t=Nt(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Ci(t,this.array)),t}setY(e,t){return this.normalized&&(t=Nt(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=Ci(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Nt(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=Ci(t,this.array)),t}setW(e,t){return this.normalized&&(t=Nt(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array),i=Nt(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,s){return e*=this.itemSize,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array),i=Nt(i,this.array),s=Nt(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const 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!==wA&&(e.usage=this.usage),e}}class OE extends Qr{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class FE extends Qr{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class Ri extends Qr{constructor(e,t,n){super(new Float32Array(e),t,n)}}let qb=0;const ri=new tt,HA=new Zt,gl=new W,Fn=new yr,uu=new yr,Or=new W;class zn extends io{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:qb++}),this.uuid=Ii(),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(EE(e)?FE:OE)(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 this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const s=new ht().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return ri.makeRotationFromQuaternion(e),this.applyMatrix4(ri),this}rotateX(e){return ri.makeRotationX(e),this.applyMatrix4(ri),this}rotateY(e){return ri.makeRotationY(e),this.applyMatrix4(ri),this}rotateZ(e){return ri.makeRotationZ(e),this.applyMatrix4(ri),this}translate(e,t,n){return ri.makeTranslation(e,t,n),this.applyMatrix4(ri),this}scale(e,t,n){return ri.makeScale(e,t,n),this.applyMatrix4(ri),this}lookAt(e){return HA.lookAt(e),HA.updateMatrix(),this.applyMatrix4(HA.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(gl).negate(),this.translate(gl.x,gl.y,gl.z),this}setFromPoints(e){const t=[];for(let n=0,i=e.length;n<i;n++){const s=e[n];t.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new Ri(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new yr);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new W(-1/0,-1/0,-1/0),new W(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,i=t.length;n<i;n++){const s=t[n];Fn.setFromBufferAttribute(s),this.morphTargetsRelative?(Or.addVectors(this.boundingBox.min,Fn.min),this.boundingBox.expandByPoint(Or),Or.addVectors(this.boundingBox.max,Fn.max),this.boundingBox.expandByPoint(Or)):(this.boundingBox.expandByPoint(Fn.min),this.boundingBox.expandByPoint(Fn.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(){this.boundingSphere===null&&(this.boundingSphere=new Ti);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new W,1/0);return}if(e){const n=this.boundingSphere.center;if(Fn.setFromBufferAttribute(e),t)for(let s=0,o=t.length;s<o;s++){const c=t[s];uu.setFromBufferAttribute(c),this.morphTargetsRelative?(Or.addVectors(Fn.min,uu.min),Fn.expandByPoint(Or),Or.addVectors(Fn.max,uu.max),Fn.expandByPoint(Or)):(Fn.expandByPoint(uu.min),Fn.expandByPoint(uu.max))}Fn.getCenter(n);let i=0;for(let s=0,o=e.count;s<o;s++)Or.fromBufferAttribute(e,s),i=Math.max(i,n.distanceToSquared(Or));if(t)for(let s=0,o=t.length;s<o;s++){const c=t[s],h=this.morphTargetsRelative;for(let u=0,d=c.count;u<d;u++)Or.fromBufferAttribute(c,u),h&&(gl.fromBufferAttribute(e,u),Or.add(gl)),i=Math.max(i,n.distanceToSquared(Or))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,i=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Qr(new Float32Array(4*n.count),4));const o=this.getAttribute("tangent"),c=[],h=[];for(let D=0;D<n.count;D++)c[D]=new W,h[D]=new W;const u=new W,d=new W,A=new W,p=new Ge,g=new Ge,v=new Ge,E=new W,m=new W;function _(D,b,M){u.fromBufferAttribute(n,D),d.fromBufferAttribute(n,b),A.fromBufferAttribute(n,M),p.fromBufferAttribute(s,D),g.fromBufferAttribute(s,b),v.fromBufferAttribute(s,M),d.sub(u),A.sub(u),g.sub(p),v.sub(p);const L=1/(g.x*v.y-v.x*g.y);isFinite(L)&&(E.copy(d).multiplyScalar(v.y).addScaledVector(A,-g.y).multiplyScalar(L),m.copy(A).multiplyScalar(g.x).addScaledVector(d,-v.x).multiplyScalar(L),c[D].add(E),c[b].add(E),c[M].add(E),h[D].add(m),h[b].add(m),h[M].add(m))}let w=this.groups;w.length===0&&(w=[{start:0,count:e.count}]);for(let D=0,b=w.length;D<b;++D){const M=w[D],L=M.start,P=M.count;for(let N=L,j=L+P;N<j;N+=3)_(e.getX(N+0),e.getX(N+1),e.getX(N+2))}const x=new W,I=new W,R=new W,S=new W;function T(D){R.fromBufferAttribute(i,D),S.copy(R);const b=c[D];x.copy(b),x.sub(R.multiplyScalar(R.dot(b))).normalize(),I.crossVectors(S,b);const M=I.dot(h[D])<0?-1:1;o.setXYZW(D,x.x,x.y,x.z,M)}for(let D=0,b=w.length;D<b;++D){const M=w[D],L=M.start,P=M.count;for(let N=L,j=L+P;N<j;N+=3)T(e.getX(N+0)),T(e.getX(N+1)),T(e.getX(N+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new Qr(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let p=0,g=n.count;p<g;p++)n.setXYZ(p,0,0,0);const i=new W,s=new W,o=new W,c=new W,h=new W,u=new W,d=new W,A=new W;if(e)for(let p=0,g=e.count;p<g;p+=3){const v=e.getX(p+0),E=e.getX(p+1),m=e.getX(p+2);i.fromBufferAttribute(t,v),s.fromBufferAttribute(t,E),o.fromBufferAttribute(t,m),d.subVectors(o,s),A.subVectors(i,s),d.cross(A),c.fromBufferAttribute(n,v),h.fromBufferAttribute(n,E),u.fromBufferAttribute(n,m),c.add(d),h.add(d),u.add(d),n.setXYZ(v,c.x,c.y,c.z),n.setXYZ(E,h.x,h.y,h.z),n.setXYZ(m,u.x,u.y,u.z)}else for(let p=0,g=t.count;p<g;p+=3)i.fromBufferAttribute(t,p+0),s.fromBufferAttribute(t,p+1),o.fromBufferAttribute(t,p+2),d.subVectors(o,s),A.subVectors(i,s),d.cross(A),n.setXYZ(p+0,d.x,d.y,d.z),n.setXYZ(p+1,d.x,d.y,d.z),n.setXYZ(p+2,d.x,d.y,d.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Or.fromBufferAttribute(e,t),Or.normalize(),e.setXYZ(t,Or.x,Or.y,Or.z)}toNonIndexed(){function e(c,h){const u=c.array,d=c.itemSize,A=c.normalized,p=new u.constructor(h.length*d);let g=0,v=0;for(let E=0,m=h.length;E<m;E++){c.isInterleavedBufferAttribute?g=h[E]*c.data.stride+c.offset:g=h[E]*d;for(let _=0;_<d;_++)p[v++]=u[g++]}return new Qr(p,d,A)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new zn,n=this.index.array,i=this.attributes;for(const c in i){const h=i[c],u=e(h,n);t.setAttribute(c,u)}const s=this.morphAttributes;for(const c in s){const h=[],u=s[c];for(let d=0,A=u.length;d<A;d++){const p=u[d],g=e(p,n);h.push(g)}t.morphAttributes[c]=h}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let c=0,h=o.length;c<h;c++){const u=o[c];t.addGroup(u.start,u.count,u.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,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),this.parameters!==void 0){const h=this.parameters;for(const u in h)h[u]!==void 0&&(e[u]=h[u]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const h in n){const u=n[h];e.data.attributes[h]=u.toJSON(e.data)}const i={};let s=!1;for(const h in this.morphAttributes){const u=this.morphAttributes[h],d=[];for(let A=0,p=u.length;A<p;A++){const g=u[A];d.push(g.toJSON(e.data))}d.length>0&&(i[h]=d,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const c=this.boundingSphere;return c!==null&&(e.data.boundingSphere={center:c.center.toArray(),radius:c.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;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone(t));const i=e.attributes;for(const u in i){const d=i[u];this.setAttribute(u,d.clone(t))}const s=e.morphAttributes;for(const u in s){const d=[],A=s[u];for(let p=0,g=A.length;p<g;p++)d.push(A[p].clone(t));this.morphAttributes[u]=d}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let u=0,d=o.length;u<d;u++){const A=o[u];this.addGroup(A.start,A.count,A.materialIndex)}const c=e.boundingBox;c!==null&&(this.boundingBox=c.clone());const h=e.boundingSphere;return h!==null&&(this.boundingSphere=h.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const zE=new tt,oo=new lu,Ad=new Ti,HE=new W,ml=new W,_l=new W,vl=new W,GA=new W,gd=new W,md=new Ge,_d=new Ge,vd=new Ge,GE=new W,VE=new W,jE=new W,yd=new W,Ed=new W;class Wr extends Zt{constructor(e=new zn,t=new Es){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,s=n.length;i<s;i++){const o=n[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=i}}}}getVertexPosition(e,t){const n=this.geometry,i=n.attributes.position,s=n.morphAttributes.position,o=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const c=this.morphTargetInfluences;if(s&&c){gd.set(0,0,0);for(let h=0,u=s.length;h<u;h++){const d=c[h],A=s[h];d!==0&&(GA.fromBufferAttribute(A,e),o?gd.addScaledVector(GA,d):gd.addScaledVector(GA.sub(t),d))}t.add(gd)}return t}raycast(e,t){const n=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),Ad.copy(n.boundingSphere),Ad.applyMatrix4(s),oo.copy(e.ray).recast(e.near),!(Ad.containsPoint(oo.origin)===!1&&(oo.intersectSphere(Ad,HE)===null||oo.origin.distanceToSquared(HE)>(e.far-e.near)**2))&&(zE.copy(s).invert(),oo.copy(e.ray).applyMatrix4(zE),!(n.boundingBox!==null&&oo.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,oo)))}_computeIntersections(e,t,n){let i;const s=this.geometry,o=this.material,c=s.index,h=s.attributes.position,u=s.attributes.uv,d=s.attributes.uv1,A=s.attributes.normal,p=s.groups,g=s.drawRange;if(c!==null)if(Array.isArray(o))for(let v=0,E=p.length;v<E;v++){const m=p[v],_=o[m.materialIndex],w=Math.max(m.start,g.start),x=Math.min(c.count,Math.min(m.start+m.count,g.start+g.count));for(let I=w,R=x;I<R;I+=3){const S=c.getX(I),T=c.getX(I+1),D=c.getX(I+2);i=xd(this,_,e,n,u,d,A,S,T,D),i&&(i.faceIndex=Math.floor(I/3),i.face.materialIndex=m.materialIndex,t.push(i))}}else{const v=Math.max(0,g.start),E=Math.min(c.count,g.start+g.count);for(let m=v,_=E;m<_;m+=3){const w=c.getX(m),x=c.getX(m+1),I=c.getX(m+2);i=xd(this,o,e,n,u,d,A,w,x,I),i&&(i.faceIndex=Math.floor(m/3),t.push(i))}}else if(h!==void 0)if(Array.isArray(o))for(let v=0,E=p.length;v<E;v++){const m=p[v],_=o[m.materialIndex],w=Math.max(m.start,g.start),x=Math.min(h.count,Math.min(m.start+m.count,g.start+g.count));for(let I=w,R=x;I<R;I+=3){const S=I,T=I+1,D=I+2;i=xd(this,_,e,n,u,d,A,S,T,D),i&&(i.faceIndex=Math.floor(I/3),i.face.materialIndex=m.materialIndex,t.push(i))}}else{const v=Math.max(0,g.start),E=Math.min(h.count,g.start+g.count);for(let m=v,_=E;m<_;m+=3){const w=m,x=m+1,I=m+2;i=xd(this,o,e,n,u,d,A,w,x,I),i&&(i.faceIndex=Math.floor(m/3),t.push(i))}}}}function Xb(r,e,t,n,i,s,o,c){let h;if(e.side===Pr?h=n.intersectTriangle(o,s,i,!0,c):h=n.intersectTriangle(i,s,o,e.side===vi,c),h===null)return null;Ed.copy(c),Ed.applyMatrix4(r.matrixWorld);const u=t.ray.origin.distanceTo(Ed);return u<t.near||u>t.far?null:{distance:u,point:Ed.clone(),object:r}}function xd(r,e,t,n,i,s,o,c,h,u){r.getVertexPosition(c,ml),r.getVertexPosition(h,_l),r.getVertexPosition(u,vl);const d=Xb(r,e,t,n,ml,_l,vl,yd);if(d){i&&(md.fromBufferAttribute(i,c),_d.fromBufferAttribute(i,h),vd.fromBufferAttribute(i,u),d.uv=on.getInterpolation(yd,ml,_l,vl,md,_d,vd,new Ge)),s&&(md.fromBufferAttribute(s,c),_d.fromBufferAttribute(s,h),vd.fromBufferAttribute(s,u),d.uv1=on.getInterpolation(yd,ml,_l,vl,md,_d,vd,new Ge)),o&&(GE.fromBufferAttribute(o,c),VE.fromBufferAttribute(o,h),jE.fromBufferAttribute(o,u),d.normal=on.getInterpolation(yd,ml,_l,vl,GE,VE,jE,new W),d.normal.dot(n.direction)>0&&d.normal.multiplyScalar(-1));const A={a:c,b:h,c:u,normal:new W,materialIndex:0};on.getNormal(ml,_l,vl,A.normal),d.face=A}return d}class hu extends zn{constructor(e=1,t=1,n=1,i=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:o};const c=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o);const h=[],u=[],d=[],A=[];let p=0,g=0;v("z","y","x",-1,-1,n,t,e,o,s,0),v("z","y","x",1,-1,n,t,-e,o,s,1),v("x","z","y",1,1,e,n,t,i,o,2),v("x","z","y",1,-1,e,n,-t,i,o,3),v("x","y","z",1,-1,e,t,n,i,s,4),v("x","y","z",-1,-1,e,t,-n,i,s,5),this.setIndex(h),this.setAttribute("position",new Ri(u,3)),this.setAttribute("normal",new Ri(d,3)),this.setAttribute("uv",new Ri(A,2));function v(E,m,_,w,x,I,R,S,T,D,b){const M=I/T,L=R/D,P=I/2,N=R/2,j=S/2,X=T+1,K=D+1;let ne=0,V=0;const te=new W;for(let Q=0;Q<K;Q++){const z=Q*L-N;for(let Z=0;Z<X;Z++){const re=Z*M-P;te[E]=re*w,te[m]=z*x,te[_]=j,u.push(te.x,te.y,te.z),te[E]=0,te[m]=0,te[_]=S>0?1:-1,d.push(te.x,te.y,te.z),A.push(Z/T),A.push(1-Q/D),ne+=1}}for(let Q=0;Q<D;Q++)for(let z=0;z<T;z++){const Z=p+z+X*Q,re=p+z+X*(Q+1),H=p+(z+1)+X*(Q+1),fe=p+(z+1)+X*Q;h.push(Z,re,fe),h.push(re,H,fe),V+=6}c.addGroup(g,V,b),g+=V,p+=ne}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new hu(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function yl(r){const e={};for(const t in r){e[t]={};for(const n in r[t]){const i=r[t][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=i.clone():Array.isArray(i)?e[t][n]=i.slice():e[t][n]=i}}return e}function ln(r){const e={};for(let t=0;t<r.length;t++){const n=yl(r[t]);for(const i in n)e[i]=n[i]}return e}function Kb(r){const e=[];for(let t=0;t<r.length;t++)e.push(r[t].clone());return e}function WE(r){const e=r.getRenderTarget();return e===null?r.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Rt.workingColorSpace}const wd={clone:yl,merge:ln};var Jb=`void main() {
36
+ */const Gh="163",Zo={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},$o={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},_B=0,by=1,vB=2,Ry=1,yB=2,ds=3,vi=0,Pr=1,yi=2,fs=0,el=1,Dy=2,Ly=3,Ny=4,EB=5,to=100,xB=101,wB=102,IB=103,CB=104,MB=200,SB=201,TB=202,BB=203,aA=204,oA=205,bB=206,RB=207,DB=208,LB=209,NB=210,UB=211,PB=212,kB=213,QB=214,OB=0,FB=1,zB=2,Vh=3,HB=4,GB=5,VB=6,jB=7,Uy=0,WB=1,YB=2,Js=0,Py=1,ky=2,Qy=3,lA=4,qB=5,Oy=6,Fy=7,zy="attached",XB="detached",Hy=300,ro=301,tl=302,Xc=303,cA=304,jh=306,Zs=1e3,Ei=1001,Wh=1002,dr=1003,Gy=1004,Kc=1005,fr=1006,Yh=1007,xi=1008,KB=1008,pr=1009,uA=1010,Vy=1011,hA=1012,Jc=1013,wi=1014,or=1015,_n=1016,jy=1017,Wy=1018,Zc=1020,JB=35902,ZB=1021,$B=1022,Ar=1023,eb=1024,tb=1025,rl=1026,$c=1027,$s=1028,dA=1029,no=1030,qh=1031,eu=1033,Xh=33776,fA=33777,pA=33778,Kh=33779,AA=35840,Yy=35841,gA=35842,qy=35843,mA=36196,_A=37492,vA=37496,yA=37808,Xy=37809,Ky=37810,Jy=37811,Jh=37812,Zy=37813,$y=37814,eE=37815,tE=37816,rE=37817,nE=37818,iE=37819,sE=37820,aE=37821,Zh=36492,oE=36494,lE=36495,rb=36283,cE=36284,uE=36285,hE=36286,tu=2300,nl=2301,EA=2302,dE=2400,fE=2401,pE=2402,nb=2500,ib=0,AE=1,xA=2,sb=3200,ab=3201,gE=0,ob=1,ps="",kr="srgb",Cr="srgb-linear",$h="display-p3",ru="display-p3-linear",ed="linear",Ht="srgb",td="rec709",rd="p3",il=7680,mE=519,lb=512,cb=513,ub=514,_E=515,hb=516,db=517,fb=518,pb=519,wA=35044,vE="300 es",As=2e3,nd=2001;class io{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const n=this._listeners[e];if(n!==void 0){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const t=this._listeners[e.type];if(t!==void 0){e.target=this;const n=t.slice(0);for(let i=0,s=n.length;i<s;i++)n[i].call(this,e);e.target=null}}}const Xr=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let yE=1234567;const nu=Math.PI/180,sl=180/Math.PI;function Ii(){const r=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(Xr[r&255]+Xr[r>>8&255]+Xr[r>>16&255]+Xr[r>>24&255]+"-"+Xr[e&255]+Xr[e>>8&255]+"-"+Xr[e>>16&15|64]+Xr[e>>24&255]+"-"+Xr[t&63|128]+Xr[t>>8&255]+"-"+Xr[t>>16&255]+Xr[t>>24&255]+Xr[n&255]+Xr[n>>8&255]+Xr[n>>16&255]+Xr[n>>24&255]).toLowerCase()}function Mr(r,e,t){return Math.max(e,Math.min(t,r))}function IA(r,e){return(r%e+e)%e}function Ab(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function gb(r,e,t){return r!==e?(t-r)/(e-r):0}function iu(r,e,t){return(1-t)*r+t*e}function mb(r,e,t,n){return iu(r,e,1-Math.exp(-t*n))}function _b(r,e=1){return e-Math.abs(IA(r,e*2)-e)}function vb(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function yb(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function Eb(r,e){return r+Math.floor(Math.random()*(e-r+1))}function xb(r,e){return r+Math.random()*(e-r)}function wb(r){return r*(.5-Math.random())}function Ib(r){r!==void 0&&(yE=r);let e=yE+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function Cb(r){return r*nu}function Mb(r){return r*sl}function Sb(r){return(r&r-1)===0&&r!==0}function Tb(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function Bb(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function bb(r,e,t,n,i){const s=Math.cos,o=Math.sin,c=s(t/2),h=o(t/2),u=s((e+n)/2),d=o((e+n)/2),A=s((e-n)/2),p=o((e-n)/2),g=s((n-e)/2),v=o((n-e)/2);switch(i){case"XYX":r.set(c*d,h*A,h*p,c*u);break;case"YZY":r.set(h*p,c*d,h*A,c*u);break;case"ZXZ":r.set(h*A,h*p,c*d,c*u);break;case"XZX":r.set(c*d,h*v,h*g,c*u);break;case"YXY":r.set(h*g,c*d,h*v,c*u);break;case"ZYZ":r.set(h*v,h*g,c*d,c*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Ci(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function Nt(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}const CA={DEG2RAD:nu,RAD2DEG:sl,generateUUID:Ii,clamp:Mr,euclideanModulo:IA,mapLinear:Ab,inverseLerp:gb,lerp:iu,damp:mb,pingpong:_b,smoothstep:vb,smootherstep:yb,randInt:Eb,randFloat:xb,randFloatSpread:wb,seededRandom:Ib,degToRad:Cb,radToDeg:Mb,isPowerOfTwo:Sb,ceilPowerOfTwo:Tb,floorPowerOfTwo:Bb,setQuaternionFromProperEuler:bb,normalize:Nt,denormalize:Ci};class Ge{constructor(e=0,t=0){Ge.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){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[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){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(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}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Mr(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=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){const n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ht{constructor(e,t,n,i,s,o,c,h,u){ht.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,o,c,h,u)}set(e,t,n,i,s,o,c,h,u){const d=this.elements;return d[0]=e,d[1]=i,d[2]=c,d[3]=t,d[4]=s,d[5]=h,d[6]=n,d[7]=o,d[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const 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){const n=e.elements,i=t.elements,s=this.elements,o=n[0],c=n[3],h=n[6],u=n[1],d=n[4],A=n[7],p=n[2],g=n[5],v=n[8],E=i[0],m=i[3],_=i[6],w=i[1],x=i[4],I=i[7],R=i[2],S=i[5],T=i[8];return s[0]=o*E+c*w+h*R,s[3]=o*m+c*x+h*S,s[6]=o*_+c*I+h*T,s[1]=u*E+d*w+A*R,s[4]=u*m+d*x+A*S,s[7]=u*_+d*I+A*T,s[2]=p*E+g*w+v*R,s[5]=p*m+g*x+v*S,s[8]=p*_+g*I+v*T,this}multiplyScalar(e){const 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(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],c=e[5],h=e[6],u=e[7],d=e[8];return t*o*d-t*c*u-n*s*d+n*c*h+i*s*u-i*o*h}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],c=e[5],h=e[6],u=e[7],d=e[8],A=d*o-c*u,p=c*h-d*s,g=u*s-o*h,v=t*A+n*p+i*g;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const E=1/v;return e[0]=A*E,e[1]=(i*u-d*n)*E,e[2]=(c*n-i*o)*E,e[3]=p*E,e[4]=(d*t-i*h)*E,e[5]=(i*s-c*t)*E,e[6]=g*E,e[7]=(n*h-u*t)*E,e[8]=(o*t-n*s)*E,this}transpose(){let e;const 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){const 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,n,i,s,o,c){const h=Math.cos(s),u=Math.sin(s);return this.set(n*h,n*u,-n*(h*o+u*c)+o+e,-i*u,i*h,-i*(-u*o+h*c)+c+t,0,0,1),this}scale(e,t){return this.premultiply(MA.makeScale(e,t)),this}rotate(e){return this.premultiply(MA.makeRotation(-e)),this}translate(e,t){return this.premultiply(MA.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const MA=new ht;function EE(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}function su(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function Rb(){const r=su("canvas");return r.style.display="block",r}const xE={};function wE(r){r in xE||(xE[r]=!0,console.warn(r))}const IE=new ht().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),CE=new ht().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),id={[Cr]:{transfer:ed,primaries:td,toReference:r=>r,fromReference:r=>r},[kr]:{transfer:Ht,primaries:td,toReference:r=>r.convertSRGBToLinear(),fromReference:r=>r.convertLinearToSRGB()},[ru]:{transfer:ed,primaries:rd,toReference:r=>r.applyMatrix3(CE),fromReference:r=>r.applyMatrix3(IE)},[$h]:{transfer:Ht,primaries:rd,toReference:r=>r.convertSRGBToLinear().applyMatrix3(CE),fromReference:r=>r.applyMatrix3(IE).convertLinearToSRGB()}},Db=new Set([Cr,ru]),Rt={enabled:!0,_workingColorSpace:Cr,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(r){if(!Db.has(r))throw new Error(`Unsupported working color space, "${r}".`);this._workingColorSpace=r},convert:function(r,e,t){if(this.enabled===!1||e===t||!e||!t)return r;const n=id[e].toReference,i=id[t].fromReference;return i(n(r))},fromWorkingColorSpace:function(r,e){return this.convert(r,this._workingColorSpace,e)},toWorkingColorSpace:function(r,e){return this.convert(r,e,this._workingColorSpace)},getPrimaries:function(r){return id[r].primaries},getTransfer:function(r){return r===ps?ed:id[r].transfer}};function al(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function SA(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}let ol;class Lb{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{ol===void 0&&(ol=su("canvas")),ol.width=e.width,ol.height=e.height;const n=ol.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=ol}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){const t=su("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),s=i.data;for(let o=0;o<s.length;o++)s[o]=al(s[o]/255)*255;return n.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(al(t[n]/255)*255):t[n]=al(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let Nb=0;class ME{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Nb++}),this.uuid=Ii(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let o=0,c=i.length;o<c;o++)i[o].isDataTexture?s.push(TA(i[o].image)):s.push(TA(i[o]))}else s=TA(i);n.url=s}return t||(e.images[this.uuid]=n),n}}function TA(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?Lb.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Ub=0;class Sr extends io{constructor(e=Sr.DEFAULT_IMAGE,t=Sr.DEFAULT_MAPPING,n=Ei,i=Ei,s=fr,o=xi,c=Ar,h=pr,u=Sr.DEFAULT_ANISOTROPY,d=ps){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Ub++}),this.uuid=Ii(),this.name="",this.source=new ME(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=u,this.format=c,this.internalFormat=null,this.type=h,this.offset=new Ge(0,0),this.repeat=new Ge(1,1),this.center=new Ge(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ht,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=d,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){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.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Hy)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Zs:e.x=e.x-Math.floor(e.x);break;case Ei:e.x=e.x<0?0:1;break;case Wh:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Zs:e.y=e.y-Math.floor(e.y);break;case Ei:e.y=e.y<0?0:1;break;case Wh:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Sr.DEFAULT_IMAGE=null,Sr.DEFAULT_MAPPING=Hy,Sr.DEFAULT_ANISOTROPY=1;class Ft{constructor(e=0,t=0,n=0,i=1){Ft.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}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,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,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=e.w!==void 0?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){const t=this.x,n=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const 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,n,i,s;const o=e.elements,c=o[0],h=o[4],u=o[8],d=o[1],A=o[5],p=o[9],g=o[2],v=o[6],E=o[10];if(Math.abs(h-d)<.01&&Math.abs(u-g)<.01&&Math.abs(p-v)<.01){if(Math.abs(h+d)<.1&&Math.abs(u+g)<.1&&Math.abs(p+v)<.1&&Math.abs(c+A+E-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const _=(c+1)/2,w=(A+1)/2,x=(E+1)/2,I=(h+d)/4,R=(u+g)/4,S=(p+v)/4;return _>w&&_>x?_<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(_),i=I/n,s=R/n):w>x?w<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(w),n=I/i,s=S/i):x<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(x),n=R/s,i=S/s),this.set(n,i,s,t),this}let m=Math.sqrt((v-p)*(v-p)+(u-g)*(u-g)+(d-h)*(d-h));return Math.abs(m)<.001&&(m=1),this.x=(v-p)/m,this.y=(u-g)/m,this.z=(d-h)/m,this.w=Math.acos((c+A+E-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){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=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}}class Pb extends io{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Ft(0,0,e,t),this.scissorTest=!1,this.viewport=new Ft(0,0,e,t);const i={width:e,height:t,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:fr,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0,count:1},n);const s=new Sr(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);s.flipY=!1,s.generateMipmaps=n.generateMipmaps,s.internalFormat=n.internalFormat,this.textures=[];const o=n.count;for(let c=0;c<o;c++)this.textures[c]=s.clone(),this.textures[c].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,s=this.textures.length;i<s;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=n;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.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,i=e.textures.length;n<i;n++)this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new ME(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Mi extends Pb{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class SE extends Sr{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=dr,this.minFilter=dr,this.wrapR=Ei,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class TE extends Sr{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=dr,this.minFilter=dr,this.wrapR=Ei,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ji{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,s,o,c){let h=n[i+0],u=n[i+1],d=n[i+2],A=n[i+3];const p=s[o+0],g=s[o+1],v=s[o+2],E=s[o+3];if(c===0){e[t+0]=h,e[t+1]=u,e[t+2]=d,e[t+3]=A;return}if(c===1){e[t+0]=p,e[t+1]=g,e[t+2]=v,e[t+3]=E;return}if(A!==E||h!==p||u!==g||d!==v){let m=1-c;const _=h*p+u*g+d*v+A*E,w=_>=0?1:-1,x=1-_*_;if(x>Number.EPSILON){const R=Math.sqrt(x),S=Math.atan2(R,_*w);m=Math.sin(m*S)/R,c=Math.sin(c*S)/R}const I=c*w;if(h=h*m+p*I,u=u*m+g*I,d=d*m+v*I,A=A*m+E*I,m===1-c){const R=1/Math.sqrt(h*h+u*u+d*d+A*A);h*=R,u*=R,d*=R,A*=R}}e[t]=h,e[t+1]=u,e[t+2]=d,e[t+3]=A}static multiplyQuaternionsFlat(e,t,n,i,s,o){const c=n[i],h=n[i+1],u=n[i+2],d=n[i+3],A=s[o],p=s[o+1],g=s[o+2],v=s[o+3];return e[t]=c*v+d*A+h*g-u*p,e[t+1]=h*v+d*p+u*A-c*g,e[t+2]=u*v+d*g+c*p-h*A,e[t+3]=d*v-c*A-h*p-u*g,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,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,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=!0){const n=e._x,i=e._y,s=e._z,o=e._order,c=Math.cos,h=Math.sin,u=c(n/2),d=c(i/2),A=c(s/2),p=h(n/2),g=h(i/2),v=h(s/2);switch(o){case"XYZ":this._x=p*d*A+u*g*v,this._y=u*g*A-p*d*v,this._z=u*d*v+p*g*A,this._w=u*d*A-p*g*v;break;case"YXZ":this._x=p*d*A+u*g*v,this._y=u*g*A-p*d*v,this._z=u*d*v-p*g*A,this._w=u*d*A+p*g*v;break;case"ZXY":this._x=p*d*A-u*g*v,this._y=u*g*A+p*d*v,this._z=u*d*v+p*g*A,this._w=u*d*A-p*g*v;break;case"ZYX":this._x=p*d*A-u*g*v,this._y=u*g*A+p*d*v,this._z=u*d*v-p*g*A,this._w=u*d*A+p*g*v;break;case"YZX":this._x=p*d*A+u*g*v,this._y=u*g*A+p*d*v,this._z=u*d*v-p*g*A,this._w=u*d*A-p*g*v;break;case"XZY":this._x=p*d*A-u*g*v,this._y=u*g*A-p*d*v,this._z=u*d*v+p*g*A,this._w=u*d*A+p*g*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],s=t[8],o=t[1],c=t[5],h=t[9],u=t[2],d=t[6],A=t[10],p=n+c+A;if(p>0){const g=.5/Math.sqrt(p+1);this._w=.25/g,this._x=(d-h)*g,this._y=(s-u)*g,this._z=(o-i)*g}else if(n>c&&n>A){const g=2*Math.sqrt(1+n-c-A);this._w=(d-h)/g,this._x=.25*g,this._y=(i+o)/g,this._z=(s+u)/g}else if(c>A){const g=2*Math.sqrt(1+c-n-A);this._w=(s-u)/g,this._x=(i+o)/g,this._y=.25*g,this._z=(h+d)/g}else{const g=2*Math.sqrt(1+A-n-c);this._w=(o-i)/g,this._x=(s+u)/g,this._y=(h+d)/g,this._z=.25*g}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Mr(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(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 e===0?(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){const n=e._x,i=e._y,s=e._z,o=e._w,c=t._x,h=t._y,u=t._z,d=t._w;return this._x=n*d+o*c+i*u-s*h,this._y=i*d+o*h+s*c-n*u,this._z=s*d+o*u+n*h-i*c,this._w=o*d-n*c-i*h-s*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,i=this._y,s=this._z,o=this._w;let c=o*e._w+n*e._x+i*e._y+s*e._z;if(c<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,c=-c):this.copy(e),c>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;const h=1-c*c;if(h<=Number.EPSILON){const g=1-t;return this._w=g*o+t*this._w,this._x=g*n+t*this._x,this._y=g*i+t*this._y,this._z=g*s+t*this._z,this.normalize(),this}const u=Math.sqrt(h),d=Math.atan2(u,c),A=Math.sin((1-t)*d)/u,p=Math.sin(t*d)/u;return this._w=o*A+this._w*p,this._x=n*A+this._x*p,this._y=i*A+this._y*p,this._z=s*A+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=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(e=[],t=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._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class W{constructor(e=0,t=0,n=0){W.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,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(BE.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(BE.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,s=e.x,o=e.y,c=e.z,h=e.w,u=2*(o*i-c*n),d=2*(c*t-s*i),A=2*(s*n-o*t);return this.x=t+h*u+o*A-c*d,this.y=n+h*d+c*u-s*A,this.z=i+h*A+s*d-o*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,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){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,s=e.z,o=t.x,c=t.y,h=t.z;return this.x=i*h-s*c,this.y=s*o-n*h,this.z=n*c-i*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return BA.copy(this).projectOnVector(e),this.sub(BA)}reflect(e){return this.sub(BA.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Mr(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}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,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=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(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const BA=new W,BE=new ji;class yr{constructor(e=new W(1/0,1/0,1/0),t=new W(-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){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(Si.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Si.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=Si.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!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,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const s=n.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let o=0,c=s.count;o<c;o++)e.isMesh===!0?e.getVertexPosition(o,Si):Si.fromBufferAttribute(s,o),Si.applyMatrix4(e.matrixWorld),this.expandByPoint(Si);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),sd.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),sd.copy(n.boundingBox)),sd.applyMatrix4(e.matrixWorld),this.union(sd)}const i=e.children;for(let s=0,o=i.length;s<o;s++)this.expandByObject(i[s],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,Si),Si.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(au),ad.subVectors(this.max,au),ll.subVectors(e.a,au),cl.subVectors(e.b,au),ul.subVectors(e.c,au),ea.subVectors(cl,ll),ta.subVectors(ul,cl),so.subVectors(ll,ul);let t=[0,-ea.z,ea.y,0,-ta.z,ta.y,0,-so.z,so.y,ea.z,0,-ea.x,ta.z,0,-ta.x,so.z,0,-so.x,-ea.y,ea.x,0,-ta.y,ta.x,0,-so.y,so.x,0];return!bA(t,ll,cl,ul,ad)||(t=[1,0,0,0,1,0,0,0,1],!bA(t,ll,cl,ul,ad))?!1:(od.crossVectors(ea,ta),t=[od.x,od.y,od.z],bA(t,ll,cl,ul,ad))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Si).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Si).length()*.5),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()?this:(gs[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),gs[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),gs[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),gs[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),gs[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),gs[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),gs[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),gs[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(gs),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)}}const gs=[new W,new W,new W,new W,new W,new W,new W,new W],Si=new W,sd=new yr,ll=new W,cl=new W,ul=new W,ea=new W,ta=new W,so=new W,au=new W,ad=new W,od=new W,ao=new W;function bA(r,e,t,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){ao.fromArray(r,s);const c=i.x*Math.abs(ao.x)+i.y*Math.abs(ao.y)+i.z*Math.abs(ao.z),h=e.dot(ao),u=t.dot(ao),d=n.dot(ao);if(Math.max(-Math.max(h,u,d),Math.min(h,u,d))>c)return!1}return!0}const kb=new yr,ou=new W,RA=new W;class Ti{constructor(e=new W,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):kb.setFromPoints(e).getCenter(n);let i=0;for(let s=0,o=e.length;s<o;s++)i=Math.max(i,n.distanceToSquared(e[s]));return this.radius=Math.sqrt(i),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){const 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){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}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;ou.subVectors(e,this.center);const t=ou.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(ou,i/n),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(RA.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ou.copy(e.center).add(RA)),this.expandByPoint(ou.copy(e.center).sub(RA))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const ms=new W,DA=new W,ld=new W,ra=new W,LA=new W,cd=new W,NA=new W;class lu{constructor(e=new W,t=new W(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.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ms)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=ms.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ms.copy(this.origin).addScaledVector(this.direction,t),ms.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){DA.copy(e).add(t).multiplyScalar(.5),ld.copy(t).sub(e).normalize(),ra.copy(this.origin).sub(DA);const s=e.distanceTo(t)*.5,o=-this.direction.dot(ld),c=ra.dot(this.direction),h=-ra.dot(ld),u=ra.lengthSq(),d=Math.abs(1-o*o);let A,p,g,v;if(d>0)if(A=o*h-c,p=o*c-h,v=s*d,A>=0)if(p>=-v)if(p<=v){const E=1/d;A*=E,p*=E,g=A*(A+o*p+2*c)+p*(o*A+p+2*h)+u}else p=s,A=Math.max(0,-(o*p+c)),g=-A*A+p*(p+2*h)+u;else p=-s,A=Math.max(0,-(o*p+c)),g=-A*A+p*(p+2*h)+u;else p<=-v?(A=Math.max(0,-(-o*s+c)),p=A>0?-s:Math.min(Math.max(-s,-h),s),g=-A*A+p*(p+2*h)+u):p<=v?(A=0,p=Math.min(Math.max(-s,-h),s),g=p*(p+2*h)+u):(A=Math.max(0,-(o*s+c)),p=A>0?s:Math.min(Math.max(-s,-h),s),g=-A*A+p*(p+2*h)+u);else p=o>0?-s:s,A=Math.max(0,-(o*p+c)),g=-A*A+p*(p+2*h)+u;return n&&n.copy(this.origin).addScaledVector(this.direction,A),i&&i.copy(DA).addScaledVector(ld,p),g}intersectSphere(e,t){ms.subVectors(e.center,this.origin);const n=ms.dot(this.direction),i=ms.dot(ms)-n*n,s=e.radius*e.radius;if(i>s)return null;const o=Math.sqrt(s-i),c=n-o,h=n+o;return h<0?null:c<0?this.at(h,t):this.at(c,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,o,c,h;const u=1/this.direction.x,d=1/this.direction.y,A=1/this.direction.z,p=this.origin;return u>=0?(n=(e.min.x-p.x)*u,i=(e.max.x-p.x)*u):(n=(e.max.x-p.x)*u,i=(e.min.x-p.x)*u),d>=0?(s=(e.min.y-p.y)*d,o=(e.max.y-p.y)*d):(s=(e.max.y-p.y)*d,o=(e.min.y-p.y)*d),n>o||s>i||((s>n||isNaN(n))&&(n=s),(o<i||isNaN(i))&&(i=o),A>=0?(c=(e.min.z-p.z)*A,h=(e.max.z-p.z)*A):(c=(e.max.z-p.z)*A,h=(e.min.z-p.z)*A),n>h||c>i)||((c>n||n!==n)&&(n=c),(h<i||i!==i)&&(i=h),i<0)?null:this.at(n>=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,ms)!==null}intersectTriangle(e,t,n,i,s){LA.subVectors(t,e),cd.subVectors(n,e),NA.crossVectors(LA,cd);let o=this.direction.dot(NA),c;if(o>0){if(i)return null;c=1}else if(o<0)c=-1,o=-o;else return null;ra.subVectors(this.origin,e);const h=c*this.direction.dot(cd.crossVectors(ra,cd));if(h<0)return null;const u=c*this.direction.dot(LA.cross(ra));if(u<0||h+u>o)return null;const d=-c*ra.dot(NA);return d<0?null:this.at(d/o,s)}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)}}class tt{constructor(e,t,n,i,s,o,c,h,u,d,A,p,g,v,E,m){tt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,o,c,h,u,d,A,p,g,v,E,m)}set(e,t,n,i,s,o,c,h,u,d,A,p,g,v,E,m){const _=this.elements;return _[0]=e,_[4]=t,_[8]=n,_[12]=i,_[1]=s,_[5]=o,_[9]=c,_[13]=h,_[2]=u,_[6]=d,_[10]=A,_[14]=p,_[3]=g,_[7]=v,_[11]=E,_[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 tt().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const 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,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,i=1/hl.setFromMatrixColumn(e,0).length(),s=1/hl.setFromMatrixColumn(e,1).length(),o=1/hl.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,i=e.y,s=e.z,o=Math.cos(n),c=Math.sin(n),h=Math.cos(i),u=Math.sin(i),d=Math.cos(s),A=Math.sin(s);if(e.order==="XYZ"){const p=o*d,g=o*A,v=c*d,E=c*A;t[0]=h*d,t[4]=-h*A,t[8]=u,t[1]=g+v*u,t[5]=p-E*u,t[9]=-c*h,t[2]=E-p*u,t[6]=v+g*u,t[10]=o*h}else if(e.order==="YXZ"){const p=h*d,g=h*A,v=u*d,E=u*A;t[0]=p+E*c,t[4]=v*c-g,t[8]=o*u,t[1]=o*A,t[5]=o*d,t[9]=-c,t[2]=g*c-v,t[6]=E+p*c,t[10]=o*h}else if(e.order==="ZXY"){const p=h*d,g=h*A,v=u*d,E=u*A;t[0]=p-E*c,t[4]=-o*A,t[8]=v+g*c,t[1]=g+v*c,t[5]=o*d,t[9]=E-p*c,t[2]=-o*u,t[6]=c,t[10]=o*h}else if(e.order==="ZYX"){const p=o*d,g=o*A,v=c*d,E=c*A;t[0]=h*d,t[4]=v*u-g,t[8]=p*u+E,t[1]=h*A,t[5]=E*u+p,t[9]=g*u-v,t[2]=-u,t[6]=c*h,t[10]=o*h}else if(e.order==="YZX"){const p=o*h,g=o*u,v=c*h,E=c*u;t[0]=h*d,t[4]=E-p*A,t[8]=v*A+g,t[1]=A,t[5]=o*d,t[9]=-c*d,t[2]=-u*d,t[6]=g*A+v,t[10]=p-E*A}else if(e.order==="XZY"){const p=o*h,g=o*u,v=c*h,E=c*u;t[0]=h*d,t[4]=-A,t[8]=u*d,t[1]=p*A+E,t[5]=o*d,t[9]=g*A-v,t[2]=v*A-g,t[6]=c*d,t[10]=E*A+p}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(Qb,e,Ob)}lookAt(e,t,n){const i=this.elements;return Fn.subVectors(e,t),Fn.lengthSq()===0&&(Fn.z=1),Fn.normalize(),na.crossVectors(n,Fn),na.lengthSq()===0&&(Math.abs(n.z)===1?Fn.x+=1e-4:Fn.z+=1e-4,Fn.normalize(),na.crossVectors(n,Fn)),na.normalize(),ud.crossVectors(Fn,na),i[0]=na.x,i[4]=ud.x,i[8]=Fn.x,i[1]=na.y,i[5]=ud.y,i[9]=Fn.y,i[2]=na.z,i[6]=ud.z,i[10]=Fn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,o=n[0],c=n[4],h=n[8],u=n[12],d=n[1],A=n[5],p=n[9],g=n[13],v=n[2],E=n[6],m=n[10],_=n[14],w=n[3],x=n[7],I=n[11],R=n[15],S=i[0],T=i[4],D=i[8],b=i[12],M=i[1],L=i[5],P=i[9],N=i[13],j=i[2],X=i[6],K=i[10],ne=i[14],V=i[3],te=i[7],Q=i[11],z=i[15];return s[0]=o*S+c*M+h*j+u*V,s[4]=o*T+c*L+h*X+u*te,s[8]=o*D+c*P+h*K+u*Q,s[12]=o*b+c*N+h*ne+u*z,s[1]=d*S+A*M+p*j+g*V,s[5]=d*T+A*L+p*X+g*te,s[9]=d*D+A*P+p*K+g*Q,s[13]=d*b+A*N+p*ne+g*z,s[2]=v*S+E*M+m*j+_*V,s[6]=v*T+E*L+m*X+_*te,s[10]=v*D+E*P+m*K+_*Q,s[14]=v*b+E*N+m*ne+_*z,s[3]=w*S+x*M+I*j+R*V,s[7]=w*T+x*L+I*X+R*te,s[11]=w*D+x*P+I*K+R*Q,s[15]=w*b+x*N+I*ne+R*z,this}multiplyScalar(e){const 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(){const e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],o=e[1],c=e[5],h=e[9],u=e[13],d=e[2],A=e[6],p=e[10],g=e[14],v=e[3],E=e[7],m=e[11],_=e[15];return v*(+s*h*A-i*u*A-s*c*p+n*u*p+i*c*g-n*h*g)+E*(+t*h*g-t*u*p+s*o*p-i*o*g+i*u*d-s*h*d)+m*(+t*u*A-t*c*g-s*o*A+n*o*g+s*c*d-n*u*d)+_*(-i*c*d-t*h*A+t*c*p+i*o*A-n*o*p+n*h*d)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],c=e[5],h=e[6],u=e[7],d=e[8],A=e[9],p=e[10],g=e[11],v=e[12],E=e[13],m=e[14],_=e[15],w=A*m*u-E*p*u+E*h*g-c*m*g-A*h*_+c*p*_,x=v*p*u-d*m*u-v*h*g+o*m*g+d*h*_-o*p*_,I=d*E*u-v*A*u+v*c*g-o*E*g-d*c*_+o*A*_,R=v*A*h-d*E*h-v*c*p+o*E*p+d*c*m-o*A*m,S=t*w+n*x+i*I+s*R;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/S;return e[0]=w*T,e[1]=(E*p*s-A*m*s-E*i*g+n*m*g+A*i*_-n*p*_)*T,e[2]=(c*m*s-E*h*s+E*i*u-n*m*u-c*i*_+n*h*_)*T,e[3]=(A*h*s-c*p*s-A*i*u+n*p*u+c*i*g-n*h*g)*T,e[4]=x*T,e[5]=(d*m*s-v*p*s+v*i*g-t*m*g-d*i*_+t*p*_)*T,e[6]=(v*h*s-o*m*s-v*i*u+t*m*u+o*i*_-t*h*_)*T,e[7]=(o*p*s-d*h*s+d*i*u-t*p*u-o*i*g+t*h*g)*T,e[8]=I*T,e[9]=(v*A*s-d*E*s-v*n*g+t*E*g+d*n*_-t*A*_)*T,e[10]=(o*E*s-v*c*s+v*n*u-t*E*u-o*n*_+t*c*_)*T,e[11]=(d*c*s-o*A*s-d*n*u+t*A*u+o*n*g-t*c*g)*T,e[12]=R*T,e[13]=(d*E*i-v*A*i+v*n*p-t*E*p-d*n*m+t*A*m)*T,e[14]=(v*c*i-o*E*i-v*n*h+t*E*h+o*n*m-t*c*m)*T,e[15]=(o*A*i-d*c*i+d*n*h-t*A*h-o*n*p+t*c*p)*T,this}scale(e){const t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),s=1-n,o=e.x,c=e.y,h=e.z,u=s*o,d=s*c;return this.set(u*o+n,u*c-i*h,u*h+i*c,0,u*c+i*h,d*c+n,d*h-i*o,0,u*h-i*c,d*h+i*o,s*h*h+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,o){return this.set(1,n,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,s=t._x,o=t._y,c=t._z,h=t._w,u=s+s,d=o+o,A=c+c,p=s*u,g=s*d,v=s*A,E=o*d,m=o*A,_=c*A,w=h*u,x=h*d,I=h*A,R=n.x,S=n.y,T=n.z;return i[0]=(1-(E+_))*R,i[1]=(g+I)*R,i[2]=(v-x)*R,i[3]=0,i[4]=(g-I)*S,i[5]=(1-(p+_))*S,i[6]=(m+w)*S,i[7]=0,i[8]=(v+x)*T,i[9]=(m-w)*T,i[10]=(1-(p+E))*T,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let s=hl.set(i[0],i[1],i[2]).length();const o=hl.set(i[4],i[5],i[6]).length(),c=hl.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],Bi.copy(this);const h=1/s,u=1/o,d=1/c;return Bi.elements[0]*=h,Bi.elements[1]*=h,Bi.elements[2]*=h,Bi.elements[4]*=u,Bi.elements[5]*=u,Bi.elements[6]*=u,Bi.elements[8]*=d,Bi.elements[9]*=d,Bi.elements[10]*=d,t.setFromRotationMatrix(Bi),n.x=s,n.y=o,n.z=c,this}makePerspective(e,t,n,i,s,o,c=As){const h=this.elements,u=2*s/(t-e),d=2*s/(n-i),A=(t+e)/(t-e),p=(n+i)/(n-i);let g,v;if(c===As)g=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(c===nd)g=-o/(o-s),v=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+c);return h[0]=u,h[4]=0,h[8]=A,h[12]=0,h[1]=0,h[5]=d,h[9]=p,h[13]=0,h[2]=0,h[6]=0,h[10]=g,h[14]=v,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this}makeOrthographic(e,t,n,i,s,o,c=As){const h=this.elements,u=1/(t-e),d=1/(n-i),A=1/(o-s),p=(t+e)*u,g=(n+i)*d;let v,E;if(c===As)v=(o+s)*A,E=-2*A;else if(c===nd)v=s*A,E=-1*A;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+c);return h[0]=2*u,h[4]=0,h[8]=0,h[12]=-p,h[1]=0,h[5]=2*d,h[9]=0,h[13]=-g,h[2]=0,h[6]=0,h[10]=E,h[14]=-v,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const hl=new W,Bi=new tt,Qb=new W(0,0,0),Ob=new W(1,1,1),na=new W,ud=new W,Fn=new W,bE=new tt,RE=new ji;class Wi{constructor(e=0,t=0,n=0,i=Wi.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}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,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,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,t=this._order,n=!0){const i=e.elements,s=i[0],o=i[4],c=i[8],h=i[1],u=i[5],d=i[9],A=i[2],p=i[6],g=i[10];switch(t){case"XYZ":this._y=Math.asin(Mr(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-d,g),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,u),this._z=0);break;case"YXZ":this._x=Math.asin(-Mr(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(c,g),this._z=Math.atan2(h,u)):(this._y=Math.atan2(-A,s),this._z=0);break;case"ZXY":this._x=Math.asin(Mr(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-A,g),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(h,s));break;case"ZYX":this._y=Math.asin(-Mr(A,-1,1)),Math.abs(A)<.9999999?(this._x=Math.atan2(p,g),this._z=Math.atan2(h,s)):(this._x=0,this._z=Math.atan2(-o,u));break;case"YZX":this._z=Math.asin(Mr(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-d,u),this._y=Math.atan2(-A,s)):(this._x=0,this._y=Math.atan2(c,g));break;case"XZY":this._z=Math.asin(-Mr(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,u),this._y=Math.atan2(c,s)):(this._x=Math.atan2(-d,g),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return bE.makeRotationFromQuaternion(e),this.setFromRotationMatrix(bE,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return RE.setFromEuler(this),this.setFromQuaternion(RE,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],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=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}}Wi.DEFAULT_ORDER="XYZ";class UA{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(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let Fb=0;const DE=new W,dl=new ji,_s=new tt,hd=new W,cu=new W,zb=new W,Hb=new ji,LE=new W(1,0,0),NE=new W(0,1,0),UE=new W(0,0,1),PE={type:"added"},Gb={type:"removed"},fl={type:"childadded",child:null},PA={type:"childremoved",child:null};class Zt extends io{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Fb++}),this.uuid=Ii(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Zt.DEFAULT_UP.clone();const e=new W,t=new Wi,n=new ji,i=new W(1,1,1);function s(){n.setFromEuler(t,!1)}function o(){t.setFromQuaternion(n,void 0,!1)}t._onChange(s),n._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new tt},normalMatrix:{value:new ht}}),this.matrix=new tt,this.matrixWorld=new tt,this.matrixAutoUpdate=Zt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Zt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new UA,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}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 dl.setFromAxisAngle(e,t),this.quaternion.multiply(dl),this}rotateOnWorldAxis(e,t){return dl.setFromAxisAngle(e,t),this.quaternion.premultiply(dl),this}rotateX(e){return this.rotateOnAxis(LE,e)}rotateY(e){return this.rotateOnAxis(NE,e)}rotateZ(e){return this.rotateOnAxis(UE,e)}translateOnAxis(e,t){return DE.copy(e).applyQuaternion(this.quaternion),this.position.add(DE.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(LE,e)}translateY(e){return this.translateOnAxis(NE,e)}translateZ(e){return this.translateOnAxis(UE,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(_s.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?hd.copy(e):hd.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),cu.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?_s.lookAt(cu,hd,this.up):_s.lookAt(hd,cu,this.up),this.quaternion.setFromRotationMatrix(_s),i&&(_s.extractRotation(i.matrixWorld),dl.setFromRotationMatrix(_s),this.quaternion.premultiply(dl.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(PE),fl.child=e,this.dispatchEvent(fl),fl.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(Gb),PA.child=e,this.dispatchEvent(PA),PA.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),_s.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),_s.multiply(e.parent.matrixWorld)),e.applyMatrix4(_s),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(PE),fl.child=e,this.dispatchEvent(fl),fl.child=null,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 n=0,i=this.children.length;n<i;n++){const s=this.children[n].getObjectByProperty(e,t);if(s!==void 0)return s}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const i=this.children;for(let s=0,o=i.length;s<o;s++)i[s].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(cu,e,zb),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(cu,Hb,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(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)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,i=t.length;n<i;n++){const s=t[n];(s.matrixWorldAutoUpdate===!0||e===!0)&&s.updateMatrixWorld(e)}}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.matrixWorldAutoUpdate===!0&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t===!0){const i=this.children;for(let s=0,o=i.length;s<o;s++){const c=i[s];c.matrixWorldAutoUpdate===!0&&c.updateWorldMatrix(!1,!0)}}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(c=>({boxInitialized:c.boxInitialized,boxMin:c.box.min.toArray(),boxMax:c.box.max.toArray(),sphereInitialized:c.sphereInitialized,sphereRadius:c.sphere.radius,sphereCenter:c.sphere.center.toArray()})),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function s(c,h){return c[h.uuid]===void 0&&(c[h.uuid]=h.toJSON(e)),h.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(e.geometries,this.geometry);const c=this.geometry.parameters;if(c!==void 0&&c.shapes!==void 0){const h=c.shapes;if(Array.isArray(h))for(let u=0,d=h.length;u<d;u++){const A=h[u];s(e.shapes,A)}else s(e.shapes,h)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const c=[];for(let h=0,u=this.material.length;h<u;h++)c.push(s(e.materials,this.material[h]));i.material=c}else i.material=s(e.materials,this.material);if(this.children.length>0){i.children=[];for(let c=0;c<this.children.length;c++)i.children.push(this.children[c].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let c=0;c<this.animations.length;c++){const h=this.animations[c];i.animations.push(s(e.animations,h))}}if(t){const c=o(e.geometries),h=o(e.materials),u=o(e.textures),d=o(e.images),A=o(e.shapes),p=o(e.skeletons),g=o(e.animations),v=o(e.nodes);c.length>0&&(n.geometries=c),h.length>0&&(n.materials=h),u.length>0&&(n.textures=u),d.length>0&&(n.images=d),A.length>0&&(n.shapes=A),p.length>0&&(n.skeletons=p),g.length>0&&(n.animations=g),v.length>0&&(n.nodes=v)}return n.object=i,n;function o(c){const h=[];for(const u in c){const d=c[u];delete d.metadata,h.push(d)}return h}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const i=e.children[n];this.add(i.clone())}return this}}Zt.DEFAULT_UP=new W(0,1,0),Zt.DEFAULT_MATRIX_AUTO_UPDATE=!0,Zt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const bi=new W,vs=new W,kA=new W,ys=new W,pl=new W,Al=new W,kE=new W,QA=new W,OA=new W,FA=new W;class on{constructor(e=new W,t=new W,n=new W){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),bi.subVectors(e,t),i.cross(bi);const s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){bi.subVectors(i,t),vs.subVectors(n,t),kA.subVectors(e,t);const o=bi.dot(bi),c=bi.dot(vs),h=bi.dot(kA),u=vs.dot(vs),d=vs.dot(kA),A=o*u-c*c;if(A===0)return s.set(0,0,0),null;const p=1/A,g=(u*h-c*d)*p,v=(o*d-c*h)*p;return s.set(1-g-v,v,g)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,ys)===null?!1:ys.x>=0&&ys.y>=0&&ys.x+ys.y<=1}static getInterpolation(e,t,n,i,s,o,c,h){return this.getBarycoord(e,t,n,i,ys)===null?(h.x=0,h.y=0,"z"in h&&(h.z=0),"w"in h&&(h.w=0),null):(h.setScalar(0),h.addScaledVector(s,ys.x),h.addScaledVector(o,ys.y),h.addScaledVector(c,ys.z),h)}static isFrontFacing(e,t,n,i){return bi.subVectors(n,t),vs.subVectors(e,t),bi.cross(vs).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),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 bi.subVectors(this.c,this.b),vs.subVectors(this.a,this.b),bi.cross(vs).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return on.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return on.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,s){return on.getInterpolation(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return on.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return on.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,s=this.c;let o,c;pl.subVectors(i,n),Al.subVectors(s,n),QA.subVectors(e,n);const h=pl.dot(QA),u=Al.dot(QA);if(h<=0&&u<=0)return t.copy(n);OA.subVectors(e,i);const d=pl.dot(OA),A=Al.dot(OA);if(d>=0&&A<=d)return t.copy(i);const p=h*A-d*u;if(p<=0&&h>=0&&d<=0)return o=h/(h-d),t.copy(n).addScaledVector(pl,o);FA.subVectors(e,s);const g=pl.dot(FA),v=Al.dot(FA);if(v>=0&&g<=v)return t.copy(s);const E=g*u-h*v;if(E<=0&&u>=0&&v<=0)return c=u/(u-v),t.copy(n).addScaledVector(Al,c);const m=d*v-g*A;if(m<=0&&A-d>=0&&g-v>=0)return kE.subVectors(s,i),c=(A-d)/(A-d+(g-v)),t.copy(i).addScaledVector(kE,c);const _=1/(m+E+p);return o=E*_,c=p*_,t.copy(n).addScaledVector(pl,o).addScaledVector(Al,c)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const QE={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},ia={h:0,s:0,l:0},dd={h:0,s:0,l:0};function zA(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}class qe{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=kr){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Rt.toWorkingColorSpace(this,t),this}setRGB(e,t,n,i=Rt.workingColorSpace){return this.r=e,this.g=t,this.b=n,Rt.toWorkingColorSpace(this,i),this}setHSL(e,t,n,i=Rt.workingColorSpace){if(e=IA(e,1),t=Mr(t,0,1),n=Mr(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,o=2*n-s;this.r=zA(o,s,e+1/3),this.g=zA(o,s,e),this.b=zA(o,s,e-1/3)}return Rt.toWorkingColorSpace(this,i),this}setStyle(e,t=kr){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=i[1],c=i[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=kr){const n=QE[e.toLowerCase()];return n!==void 0?this.setHex(n,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=al(e.r),this.g=al(e.g),this.b=al(e.b),this}copyLinearToSRGB(e){return this.r=SA(e.r),this.g=SA(e.g),this.b=SA(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=kr){return Rt.fromWorkingColorSpace(Kr.copy(this),e),Math.round(Mr(Kr.r*255,0,255))*65536+Math.round(Mr(Kr.g*255,0,255))*256+Math.round(Mr(Kr.b*255,0,255))}getHexString(e=kr){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Rt.workingColorSpace){Rt.fromWorkingColorSpace(Kr.copy(this),t);const n=Kr.r,i=Kr.g,s=Kr.b,o=Math.max(n,i,s),c=Math.min(n,i,s);let h,u;const d=(c+o)/2;if(c===o)h=0,u=0;else{const A=o-c;switch(u=d<=.5?A/(o+c):A/(2-o-c),o){case n:h=(i-s)/A+(i<s?6:0);break;case i:h=(s-n)/A+2;break;case s:h=(n-i)/A+4;break}h/=6}return e.h=h,e.s=u,e.l=d,e}getRGB(e,t=Rt.workingColorSpace){return Rt.fromWorkingColorSpace(Kr.copy(this),t),e.r=Kr.r,e.g=Kr.g,e.b=Kr.b,e}getStyle(e=kr){Rt.fromWorkingColorSpace(Kr.copy(this),e);const t=Kr.r,n=Kr.g,i=Kr.b;return e!==kr?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(e,t,n){return this.getHSL(ia),this.setHSL(ia.h+e,ia.s+t,ia.l+n)}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,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(ia),e.getHSL(dd);const n=iu(ia.h,dd.h,t),i=iu(ia.s,dd.s,t),s=iu(ia.l,dd.l,t);return this.setHSL(n,i,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,i=this.b,s=e.elements;return this.r=s[0]*t+s[3]*n+s[6]*i,this.g=s[1]*t+s[4]*n+s[7]*i,this.b=s[2]*t+s[5]*n+s[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=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}}const Kr=new qe;qe.NAMES=QE;let Vb=0;class Yi extends io{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Vb++}),this.uuid=Ii(),this.name="",this.type="Material",this.blending=el,this.side=vi,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=aA,this.blendDst=oA,this.blendEquation=to,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new qe(0,0,0),this.blendAlpha=0,this.depthFunc=Vh,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=mE,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=il,this.stencilZFail=il,this.stencilZPass=il,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(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==el&&(n.blending=this.blending),this.side!==vi&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==aA&&(n.blendSrc=this.blendSrc),this.blendDst!==oA&&(n.blendDst=this.blendDst),this.blendEquation!==to&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==Vh&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==mE&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==il&&(n.stencilFail=this.stencilFail),this.stencilZFail!==il&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==il&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(s){const o=[];for(const c in s){const h=s[c];delete h.metadata,o.push(h)}return o}if(t){const s=i(e.textures),o=i(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}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.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Es extends Yi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new qe(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Wi,this.combine=Uy,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.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const xs=jb();function jb(){const r=new ArrayBuffer(4),e=new Float32Array(r),t=new Uint32Array(r),n=new Uint32Array(512),i=new Uint32Array(512);for(let h=0;h<256;++h){const u=h-127;u<-27?(n[h]=0,n[h|256]=32768,i[h]=24,i[h|256]=24):u<-14?(n[h]=1024>>-u-14,n[h|256]=1024>>-u-14|32768,i[h]=-u-1,i[h|256]=-u-1):u<=15?(n[h]=u+15<<10,n[h|256]=u+15<<10|32768,i[h]=13,i[h|256]=13):u<128?(n[h]=31744,n[h|256]=64512,i[h]=24,i[h|256]=24):(n[h]=31744,n[h|256]=64512,i[h]=13,i[h|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),c=new Uint32Array(64);for(let h=1;h<1024;++h){let u=h<<13,d=0;for(;!(u&8388608);)u<<=1,d-=8388608;u&=-8388609,d+=947912704,s[h]=u|d}for(let h=1024;h<2048;++h)s[h]=939524096+(h-1024<<13);for(let h=1;h<31;++h)o[h]=h<<23;o[31]=1199570944,o[32]=2147483648;for(let h=33;h<63;++h)o[h]=2147483648+(h-32<<23);o[63]=3347054592;for(let h=1;h<64;++h)h!==32&&(c[h]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:i,mantissaTable:s,exponentTable:o,offsetTable:c}}function Wb(r){Math.abs(r)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),r=Mr(r,-65504,65504),xs.floatView[0]=r;const e=xs.uint32View[0],t=e>>23&511;return xs.baseTable[t]+((e&8388607)>>xs.shiftTable[t])}function Yb(r){const e=r>>10;return xs.uint32View[0]=xs.mantissaTable[xs.offsetTable[e]+(r&1023)]+xs.exponentTable[e],xs.floatView[0]}const fd={toHalfFloat:Wb,fromHalfFloat:Yb},Er=new W,pd=new Ge;class Qr{constructor(e,t,n=!1){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=e!==void 0?e.length/t:0,this.normalized=n,this.usage=wA,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=or,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return wE("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}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.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,s=this.itemSize;i<s;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)pd.fromBufferAttribute(this,t),pd.applyMatrix3(e),this.setXY(t,pd.x,pd.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)Er.fromBufferAttribute(this,t),Er.applyMatrix3(e),this.setXYZ(t,Er.x,Er.y,Er.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Er.fromBufferAttribute(this,t),Er.applyMatrix4(e),this.setXYZ(t,Er.x,Er.y,Er.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Er.fromBufferAttribute(this,t),Er.applyNormalMatrix(e),this.setXYZ(t,Er.x,Er.y,Er.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Er.fromBufferAttribute(this,t),Er.transformDirection(e),this.setXYZ(t,Er.x,Er.y,Er.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=Ci(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Nt(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Ci(t,this.array)),t}setX(e,t){return this.normalized&&(t=Nt(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Ci(t,this.array)),t}setY(e,t){return this.normalized&&(t=Nt(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=Ci(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Nt(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=Ci(t,this.array)),t}setW(e,t){return this.normalized&&(t=Nt(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array),i=Nt(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,s){return e*=this.itemSize,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array),i=Nt(i,this.array),s=Nt(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const 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!==wA&&(e.usage=this.usage),e}}class OE extends Qr{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class FE extends Qr{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class Ri extends Qr{constructor(e,t,n){super(new Float32Array(e),t,n)}}let qb=0;const ri=new tt,HA=new Zt,gl=new W,zn=new yr,uu=new yr,Or=new W;class Hn extends io{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:qb++}),this.uuid=Ii(),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(EE(e)?FE:OE)(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 this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const s=new ht().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return ri.makeRotationFromQuaternion(e),this.applyMatrix4(ri),this}rotateX(e){return ri.makeRotationX(e),this.applyMatrix4(ri),this}rotateY(e){return ri.makeRotationY(e),this.applyMatrix4(ri),this}rotateZ(e){return ri.makeRotationZ(e),this.applyMatrix4(ri),this}translate(e,t,n){return ri.makeTranslation(e,t,n),this.applyMatrix4(ri),this}scale(e,t,n){return ri.makeScale(e,t,n),this.applyMatrix4(ri),this}lookAt(e){return HA.lookAt(e),HA.updateMatrix(),this.applyMatrix4(HA.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(gl).negate(),this.translate(gl.x,gl.y,gl.z),this}setFromPoints(e){const t=[];for(let n=0,i=e.length;n<i;n++){const s=e[n];t.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new Ri(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new yr);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new W(-1/0,-1/0,-1/0),new W(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,i=t.length;n<i;n++){const s=t[n];zn.setFromBufferAttribute(s),this.morphTargetsRelative?(Or.addVectors(this.boundingBox.min,zn.min),this.boundingBox.expandByPoint(Or),Or.addVectors(this.boundingBox.max,zn.max),this.boundingBox.expandByPoint(Or)):(this.boundingBox.expandByPoint(zn.min),this.boundingBox.expandByPoint(zn.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(){this.boundingSphere===null&&(this.boundingSphere=new Ti);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new W,1/0);return}if(e){const n=this.boundingSphere.center;if(zn.setFromBufferAttribute(e),t)for(let s=0,o=t.length;s<o;s++){const c=t[s];uu.setFromBufferAttribute(c),this.morphTargetsRelative?(Or.addVectors(zn.min,uu.min),zn.expandByPoint(Or),Or.addVectors(zn.max,uu.max),zn.expandByPoint(Or)):(zn.expandByPoint(uu.min),zn.expandByPoint(uu.max))}zn.getCenter(n);let i=0;for(let s=0,o=e.count;s<o;s++)Or.fromBufferAttribute(e,s),i=Math.max(i,n.distanceToSquared(Or));if(t)for(let s=0,o=t.length;s<o;s++){const c=t[s],h=this.morphTargetsRelative;for(let u=0,d=c.count;u<d;u++)Or.fromBufferAttribute(c,u),h&&(gl.fromBufferAttribute(e,u),Or.add(gl)),i=Math.max(i,n.distanceToSquared(Or))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,i=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Qr(new Float32Array(4*n.count),4));const o=this.getAttribute("tangent"),c=[],h=[];for(let D=0;D<n.count;D++)c[D]=new W,h[D]=new W;const u=new W,d=new W,A=new W,p=new Ge,g=new Ge,v=new Ge,E=new W,m=new W;function _(D,b,M){u.fromBufferAttribute(n,D),d.fromBufferAttribute(n,b),A.fromBufferAttribute(n,M),p.fromBufferAttribute(s,D),g.fromBufferAttribute(s,b),v.fromBufferAttribute(s,M),d.sub(u),A.sub(u),g.sub(p),v.sub(p);const L=1/(g.x*v.y-v.x*g.y);isFinite(L)&&(E.copy(d).multiplyScalar(v.y).addScaledVector(A,-g.y).multiplyScalar(L),m.copy(A).multiplyScalar(g.x).addScaledVector(d,-v.x).multiplyScalar(L),c[D].add(E),c[b].add(E),c[M].add(E),h[D].add(m),h[b].add(m),h[M].add(m))}let w=this.groups;w.length===0&&(w=[{start:0,count:e.count}]);for(let D=0,b=w.length;D<b;++D){const M=w[D],L=M.start,P=M.count;for(let N=L,j=L+P;N<j;N+=3)_(e.getX(N+0),e.getX(N+1),e.getX(N+2))}const x=new W,I=new W,R=new W,S=new W;function T(D){R.fromBufferAttribute(i,D),S.copy(R);const b=c[D];x.copy(b),x.sub(R.multiplyScalar(R.dot(b))).normalize(),I.crossVectors(S,b);const M=I.dot(h[D])<0?-1:1;o.setXYZW(D,x.x,x.y,x.z,M)}for(let D=0,b=w.length;D<b;++D){const M=w[D],L=M.start,P=M.count;for(let N=L,j=L+P;N<j;N+=3)T(e.getX(N+0)),T(e.getX(N+1)),T(e.getX(N+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new Qr(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let p=0,g=n.count;p<g;p++)n.setXYZ(p,0,0,0);const i=new W,s=new W,o=new W,c=new W,h=new W,u=new W,d=new W,A=new W;if(e)for(let p=0,g=e.count;p<g;p+=3){const v=e.getX(p+0),E=e.getX(p+1),m=e.getX(p+2);i.fromBufferAttribute(t,v),s.fromBufferAttribute(t,E),o.fromBufferAttribute(t,m),d.subVectors(o,s),A.subVectors(i,s),d.cross(A),c.fromBufferAttribute(n,v),h.fromBufferAttribute(n,E),u.fromBufferAttribute(n,m),c.add(d),h.add(d),u.add(d),n.setXYZ(v,c.x,c.y,c.z),n.setXYZ(E,h.x,h.y,h.z),n.setXYZ(m,u.x,u.y,u.z)}else for(let p=0,g=t.count;p<g;p+=3)i.fromBufferAttribute(t,p+0),s.fromBufferAttribute(t,p+1),o.fromBufferAttribute(t,p+2),d.subVectors(o,s),A.subVectors(i,s),d.cross(A),n.setXYZ(p+0,d.x,d.y,d.z),n.setXYZ(p+1,d.x,d.y,d.z),n.setXYZ(p+2,d.x,d.y,d.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Or.fromBufferAttribute(e,t),Or.normalize(),e.setXYZ(t,Or.x,Or.y,Or.z)}toNonIndexed(){function e(c,h){const u=c.array,d=c.itemSize,A=c.normalized,p=new u.constructor(h.length*d);let g=0,v=0;for(let E=0,m=h.length;E<m;E++){c.isInterleavedBufferAttribute?g=h[E]*c.data.stride+c.offset:g=h[E]*d;for(let _=0;_<d;_++)p[v++]=u[g++]}return new Qr(p,d,A)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Hn,n=this.index.array,i=this.attributes;for(const c in i){const h=i[c],u=e(h,n);t.setAttribute(c,u)}const s=this.morphAttributes;for(const c in s){const h=[],u=s[c];for(let d=0,A=u.length;d<A;d++){const p=u[d],g=e(p,n);h.push(g)}t.morphAttributes[c]=h}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let c=0,h=o.length;c<h;c++){const u=o[c];t.addGroup(u.start,u.count,u.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,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),this.parameters!==void 0){const h=this.parameters;for(const u in h)h[u]!==void 0&&(e[u]=h[u]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const h in n){const u=n[h];e.data.attributes[h]=u.toJSON(e.data)}const i={};let s=!1;for(const h in this.morphAttributes){const u=this.morphAttributes[h],d=[];for(let A=0,p=u.length;A<p;A++){const g=u[A];d.push(g.toJSON(e.data))}d.length>0&&(i[h]=d,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const c=this.boundingSphere;return c!==null&&(e.data.boundingSphere={center:c.center.toArray(),radius:c.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;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone(t));const i=e.attributes;for(const u in i){const d=i[u];this.setAttribute(u,d.clone(t))}const s=e.morphAttributes;for(const u in s){const d=[],A=s[u];for(let p=0,g=A.length;p<g;p++)d.push(A[p].clone(t));this.morphAttributes[u]=d}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let u=0,d=o.length;u<d;u++){const A=o[u];this.addGroup(A.start,A.count,A.materialIndex)}const c=e.boundingBox;c!==null&&(this.boundingBox=c.clone());const h=e.boundingSphere;return h!==null&&(this.boundingSphere=h.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const zE=new tt,oo=new lu,Ad=new Ti,HE=new W,ml=new W,_l=new W,vl=new W,GA=new W,gd=new W,md=new Ge,_d=new Ge,vd=new Ge,GE=new W,VE=new W,jE=new W,yd=new W,Ed=new W;class Wr extends Zt{constructor(e=new Hn,t=new Es){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,s=n.length;i<s;i++){const o=n[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=i}}}}getVertexPosition(e,t){const n=this.geometry,i=n.attributes.position,s=n.morphAttributes.position,o=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const c=this.morphTargetInfluences;if(s&&c){gd.set(0,0,0);for(let h=0,u=s.length;h<u;h++){const d=c[h],A=s[h];d!==0&&(GA.fromBufferAttribute(A,e),o?gd.addScaledVector(GA,d):gd.addScaledVector(GA.sub(t),d))}t.add(gd)}return t}raycast(e,t){const n=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),Ad.copy(n.boundingSphere),Ad.applyMatrix4(s),oo.copy(e.ray).recast(e.near),!(Ad.containsPoint(oo.origin)===!1&&(oo.intersectSphere(Ad,HE)===null||oo.origin.distanceToSquared(HE)>(e.far-e.near)**2))&&(zE.copy(s).invert(),oo.copy(e.ray).applyMatrix4(zE),!(n.boundingBox!==null&&oo.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,oo)))}_computeIntersections(e,t,n){let i;const s=this.geometry,o=this.material,c=s.index,h=s.attributes.position,u=s.attributes.uv,d=s.attributes.uv1,A=s.attributes.normal,p=s.groups,g=s.drawRange;if(c!==null)if(Array.isArray(o))for(let v=0,E=p.length;v<E;v++){const m=p[v],_=o[m.materialIndex],w=Math.max(m.start,g.start),x=Math.min(c.count,Math.min(m.start+m.count,g.start+g.count));for(let I=w,R=x;I<R;I+=3){const S=c.getX(I),T=c.getX(I+1),D=c.getX(I+2);i=xd(this,_,e,n,u,d,A,S,T,D),i&&(i.faceIndex=Math.floor(I/3),i.face.materialIndex=m.materialIndex,t.push(i))}}else{const v=Math.max(0,g.start),E=Math.min(c.count,g.start+g.count);for(let m=v,_=E;m<_;m+=3){const w=c.getX(m),x=c.getX(m+1),I=c.getX(m+2);i=xd(this,o,e,n,u,d,A,w,x,I),i&&(i.faceIndex=Math.floor(m/3),t.push(i))}}else if(h!==void 0)if(Array.isArray(o))for(let v=0,E=p.length;v<E;v++){const m=p[v],_=o[m.materialIndex],w=Math.max(m.start,g.start),x=Math.min(h.count,Math.min(m.start+m.count,g.start+g.count));for(let I=w,R=x;I<R;I+=3){const S=I,T=I+1,D=I+2;i=xd(this,_,e,n,u,d,A,S,T,D),i&&(i.faceIndex=Math.floor(I/3),i.face.materialIndex=m.materialIndex,t.push(i))}}else{const v=Math.max(0,g.start),E=Math.min(h.count,g.start+g.count);for(let m=v,_=E;m<_;m+=3){const w=m,x=m+1,I=m+2;i=xd(this,o,e,n,u,d,A,w,x,I),i&&(i.faceIndex=Math.floor(m/3),t.push(i))}}}}function Xb(r,e,t,n,i,s,o,c){let h;if(e.side===Pr?h=n.intersectTriangle(o,s,i,!0,c):h=n.intersectTriangle(i,s,o,e.side===vi,c),h===null)return null;Ed.copy(c),Ed.applyMatrix4(r.matrixWorld);const u=t.ray.origin.distanceTo(Ed);return u<t.near||u>t.far?null:{distance:u,point:Ed.clone(),object:r}}function xd(r,e,t,n,i,s,o,c,h,u){r.getVertexPosition(c,ml),r.getVertexPosition(h,_l),r.getVertexPosition(u,vl);const d=Xb(r,e,t,n,ml,_l,vl,yd);if(d){i&&(md.fromBufferAttribute(i,c),_d.fromBufferAttribute(i,h),vd.fromBufferAttribute(i,u),d.uv=on.getInterpolation(yd,ml,_l,vl,md,_d,vd,new Ge)),s&&(md.fromBufferAttribute(s,c),_d.fromBufferAttribute(s,h),vd.fromBufferAttribute(s,u),d.uv1=on.getInterpolation(yd,ml,_l,vl,md,_d,vd,new Ge)),o&&(GE.fromBufferAttribute(o,c),VE.fromBufferAttribute(o,h),jE.fromBufferAttribute(o,u),d.normal=on.getInterpolation(yd,ml,_l,vl,GE,VE,jE,new W),d.normal.dot(n.direction)>0&&d.normal.multiplyScalar(-1));const A={a:c,b:h,c:u,normal:new W,materialIndex:0};on.getNormal(ml,_l,vl,A.normal),d.face=A}return d}class hu extends Hn{constructor(e=1,t=1,n=1,i=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:o};const c=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o);const h=[],u=[],d=[],A=[];let p=0,g=0;v("z","y","x",-1,-1,n,t,e,o,s,0),v("z","y","x",1,-1,n,t,-e,o,s,1),v("x","z","y",1,1,e,n,t,i,o,2),v("x","z","y",1,-1,e,n,-t,i,o,3),v("x","y","z",1,-1,e,t,n,i,s,4),v("x","y","z",-1,-1,e,t,-n,i,s,5),this.setIndex(h),this.setAttribute("position",new Ri(u,3)),this.setAttribute("normal",new Ri(d,3)),this.setAttribute("uv",new Ri(A,2));function v(E,m,_,w,x,I,R,S,T,D,b){const M=I/T,L=R/D,P=I/2,N=R/2,j=S/2,X=T+1,K=D+1;let ne=0,V=0;const te=new W;for(let Q=0;Q<K;Q++){const z=Q*L-N;for(let Z=0;Z<X;Z++){const re=Z*M-P;te[E]=re*w,te[m]=z*x,te[_]=j,u.push(te.x,te.y,te.z),te[E]=0,te[m]=0,te[_]=S>0?1:-1,d.push(te.x,te.y,te.z),A.push(Z/T),A.push(1-Q/D),ne+=1}}for(let Q=0;Q<D;Q++)for(let z=0;z<T;z++){const Z=p+z+X*Q,re=p+z+X*(Q+1),H=p+(z+1)+X*(Q+1),fe=p+(z+1)+X*Q;h.push(Z,re,fe),h.push(re,H,fe),V+=6}c.addGroup(g,V,b),g+=V,p+=ne}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new hu(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function yl(r){const e={};for(const t in r){e[t]={};for(const n in r[t]){const i=r[t][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=i.clone():Array.isArray(i)?e[t][n]=i.slice():e[t][n]=i}}return e}function ln(r){const e={};for(let t=0;t<r.length;t++){const n=yl(r[t]);for(const i in n)e[i]=n[i]}return e}function Kb(r){const e=[];for(let t=0;t<r.length;t++)e.push(r[t].clone());return e}function WE(r){const e=r.getRenderTarget();return e===null?r.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Rt.workingColorSpace}const wd={clone:yl,merge:ln};var Jb=`void main() {
37
37
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
38
38
  }`,Zb=`void main() {
39
39
  gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
@@ -72,7 +72,7 @@ var IQ=Object.defineProperty;var CQ=(Va,os,ls)=>os in Va?IQ(Va,os,{enumerable:!0
72
72
  gl_FragColor = texture2D( tEquirect, sampleUV );
73
73
 
74
74
  }
75
- `},i=new hu(5,5,5),s=new vn({name:"CubemapFromEquirect",uniforms:yl(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Pr,blending:fs});s.uniforms.tEquirect.value=t;const o=new Wr(i,s),c=t.minFilter;return t.minFilter===xi&&(t.minFilter=fr),new $b(1,10,this).update(e,o),t.minFilter=c,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,i){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,i);e.setRenderTarget(s)}}const VA=new W,t5=new W,r5=new ht;class qi{constructor(e=new W(1,0,0),t=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,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=VA.subVectors(n,t).cross(t5.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const 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(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(VA),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(e.start).addScaledVector(n,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<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){const n=t||r5.getNormalMatrix(e),i=this.coplanarPoint(VA).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),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)}}const lo=new Ti,Id=new W;class jA{constructor(e=new qi,t=new qi,n=new qi,i=new qi,s=new qi,o=new qi){this.planes=[e,t,n,i,s,o]}set(e,t,n,i,s,o){const c=this.planes;return c[0].copy(e),c[1].copy(t),c[2].copy(n),c[3].copy(i),c[4].copy(s),c[5].copy(o),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=As){const n=this.planes,i=e.elements,s=i[0],o=i[1],c=i[2],h=i[3],u=i[4],d=i[5],A=i[6],p=i[7],g=i[8],v=i[9],E=i[10],m=i[11],_=i[12],w=i[13],x=i[14],I=i[15];if(n[0].setComponents(h-s,p-u,m-g,I-_).normalize(),n[1].setComponents(h+s,p+u,m+g,I+_).normalize(),n[2].setComponents(h+o,p+d,m+v,I+w).normalize(),n[3].setComponents(h-o,p-d,m-v,I-w).normalize(),n[4].setComponents(h-c,p-A,m-E,I-x).normalize(),t===As)n[5].setComponents(h+c,p+A,m+E,I+x).normalize();else if(t===nd)n[5].setComponents(c,A,E,x).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),lo.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),lo.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(lo)}intersectsSprite(e){return lo.center.set(0,0,0),lo.radius=.7071067811865476,lo.applyMatrix4(e.matrixWorld),this.intersectsSphere(lo)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const i=t[n];if(Id.x=i.normal.x>0?e.max.x:e.min.x,Id.y=i.normal.y>0?e.max.y:e.min.y,Id.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Id)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function JE(){let r=null,e=!1,t=null,n=null;function i(s,o){t(s,o),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function n5(r){const e=new WeakMap;function t(c,h){const u=c.array,d=c.usage,A=u.byteLength,p=r.createBuffer();r.bindBuffer(h,p),r.bufferData(h,u,d),c.onUploadCallback();let g;if(u instanceof Float32Array)g=r.FLOAT;else if(u instanceof Uint16Array)c.isFloat16BufferAttribute?g=r.HALF_FLOAT:g=r.UNSIGNED_SHORT;else if(u instanceof Int16Array)g=r.SHORT;else if(u instanceof Uint32Array)g=r.UNSIGNED_INT;else if(u instanceof Int32Array)g=r.INT;else if(u instanceof Int8Array)g=r.BYTE;else if(u instanceof Uint8Array)g=r.UNSIGNED_BYTE;else if(u instanceof Uint8ClampedArray)g=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+u);return{buffer:p,type:g,bytesPerElement:u.BYTES_PER_ELEMENT,version:c.version,size:A}}function n(c,h,u){const d=h.array,A=h._updateRange,p=h.updateRanges;if(r.bindBuffer(u,c),A.count===-1&&p.length===0&&r.bufferSubData(u,0,d),p.length!==0){for(let g=0,v=p.length;g<v;g++){const E=p[g];r.bufferSubData(u,E.start*d.BYTES_PER_ELEMENT,d,E.start,E.count)}h.clearUpdateRanges()}A.count!==-1&&(r.bufferSubData(u,A.offset*d.BYTES_PER_ELEMENT,d,A.offset,A.count),A.count=-1),h.onUploadCallback()}function i(c){return c.isInterleavedBufferAttribute&&(c=c.data),e.get(c)}function s(c){c.isInterleavedBufferAttribute&&(c=c.data);const h=e.get(c);h&&(r.deleteBuffer(h.buffer),e.delete(c))}function o(c,h){if(c.isGLBufferAttribute){const d=e.get(c);(!d||d.version<c.version)&&e.set(c,{buffer:c.buffer,type:c.type,bytesPerElement:c.elementSize,version:c.version});return}c.isInterleavedBufferAttribute&&(c=c.data);const u=e.get(c);if(u===void 0)e.set(c,t(c,h));else if(u.version<c.version){if(u.size!==c.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");n(u.buffer,c,h),u.version=c.version}}return{get:i,remove:s,update:o}}class du extends zn{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const s=e/2,o=t/2,c=Math.floor(n),h=Math.floor(i),u=c+1,d=h+1,A=e/c,p=t/h,g=[],v=[],E=[],m=[];for(let _=0;_<d;_++){const w=_*p-o;for(let x=0;x<u;x++){const I=x*A-s;v.push(I,-w,0),E.push(0,0,1),m.push(x/c),m.push(1-_/h)}}for(let _=0;_<h;_++)for(let w=0;w<c;w++){const x=w+u*_,I=w+u*(_+1),R=w+1+u*(_+1),S=w+1+u*_;g.push(x,I,S),g.push(I,R,S)}this.setIndex(g),this.setAttribute("position",new Ri(v,3)),this.setAttribute("normal",new Ri(E,3)),this.setAttribute("uv",new Ri(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new du(e.width,e.height,e.widthSegments,e.heightSegments)}}var i5=`#ifdef USE_ALPHAHASH
75
+ `},i=new hu(5,5,5),s=new vn({name:"CubemapFromEquirect",uniforms:yl(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Pr,blending:fs});s.uniforms.tEquirect.value=t;const o=new Wr(i,s),c=t.minFilter;return t.minFilter===xi&&(t.minFilter=fr),new $b(1,10,this).update(e,o),t.minFilter=c,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,i){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,i);e.setRenderTarget(s)}}const VA=new W,t5=new W,r5=new ht;class qi{constructor(e=new W(1,0,0),t=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,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=VA.subVectors(n,t).cross(t5.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const 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(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(VA),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(e.start).addScaledVector(n,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<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){const n=t||r5.getNormalMatrix(e),i=this.coplanarPoint(VA).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),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)}}const lo=new Ti,Id=new W;class jA{constructor(e=new qi,t=new qi,n=new qi,i=new qi,s=new qi,o=new qi){this.planes=[e,t,n,i,s,o]}set(e,t,n,i,s,o){const c=this.planes;return c[0].copy(e),c[1].copy(t),c[2].copy(n),c[3].copy(i),c[4].copy(s),c[5].copy(o),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=As){const n=this.planes,i=e.elements,s=i[0],o=i[1],c=i[2],h=i[3],u=i[4],d=i[5],A=i[6],p=i[7],g=i[8],v=i[9],E=i[10],m=i[11],_=i[12],w=i[13],x=i[14],I=i[15];if(n[0].setComponents(h-s,p-u,m-g,I-_).normalize(),n[1].setComponents(h+s,p+u,m+g,I+_).normalize(),n[2].setComponents(h+o,p+d,m+v,I+w).normalize(),n[3].setComponents(h-o,p-d,m-v,I-w).normalize(),n[4].setComponents(h-c,p-A,m-E,I-x).normalize(),t===As)n[5].setComponents(h+c,p+A,m+E,I+x).normalize();else if(t===nd)n[5].setComponents(c,A,E,x).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),lo.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),lo.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(lo)}intersectsSprite(e){return lo.center.set(0,0,0),lo.radius=.7071067811865476,lo.applyMatrix4(e.matrixWorld),this.intersectsSphere(lo)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const i=t[n];if(Id.x=i.normal.x>0?e.max.x:e.min.x,Id.y=i.normal.y>0?e.max.y:e.min.y,Id.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Id)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function JE(){let r=null,e=!1,t=null,n=null;function i(s,o){t(s,o),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function n5(r){const e=new WeakMap;function t(c,h){const u=c.array,d=c.usage,A=u.byteLength,p=r.createBuffer();r.bindBuffer(h,p),r.bufferData(h,u,d),c.onUploadCallback();let g;if(u instanceof Float32Array)g=r.FLOAT;else if(u instanceof Uint16Array)c.isFloat16BufferAttribute?g=r.HALF_FLOAT:g=r.UNSIGNED_SHORT;else if(u instanceof Int16Array)g=r.SHORT;else if(u instanceof Uint32Array)g=r.UNSIGNED_INT;else if(u instanceof Int32Array)g=r.INT;else if(u instanceof Int8Array)g=r.BYTE;else if(u instanceof Uint8Array)g=r.UNSIGNED_BYTE;else if(u instanceof Uint8ClampedArray)g=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+u);return{buffer:p,type:g,bytesPerElement:u.BYTES_PER_ELEMENT,version:c.version,size:A}}function n(c,h,u){const d=h.array,A=h._updateRange,p=h.updateRanges;if(r.bindBuffer(u,c),A.count===-1&&p.length===0&&r.bufferSubData(u,0,d),p.length!==0){for(let g=0,v=p.length;g<v;g++){const E=p[g];r.bufferSubData(u,E.start*d.BYTES_PER_ELEMENT,d,E.start,E.count)}h.clearUpdateRanges()}A.count!==-1&&(r.bufferSubData(u,A.offset*d.BYTES_PER_ELEMENT,d,A.offset,A.count),A.count=-1),h.onUploadCallback()}function i(c){return c.isInterleavedBufferAttribute&&(c=c.data),e.get(c)}function s(c){c.isInterleavedBufferAttribute&&(c=c.data);const h=e.get(c);h&&(r.deleteBuffer(h.buffer),e.delete(c))}function o(c,h){if(c.isGLBufferAttribute){const d=e.get(c);(!d||d.version<c.version)&&e.set(c,{buffer:c.buffer,type:c.type,bytesPerElement:c.elementSize,version:c.version});return}c.isInterleavedBufferAttribute&&(c=c.data);const u=e.get(c);if(u===void 0)e.set(c,t(c,h));else if(u.version<c.version){if(u.size!==c.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");n(u.buffer,c,h),u.version=c.version}}return{get:i,remove:s,update:o}}class du extends Hn{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const s=e/2,o=t/2,c=Math.floor(n),h=Math.floor(i),u=c+1,d=h+1,A=e/c,p=t/h,g=[],v=[],E=[],m=[];for(let _=0;_<d;_++){const w=_*p-o;for(let x=0;x<u;x++){const I=x*A-s;v.push(I,-w,0),E.push(0,0,1),m.push(x/c),m.push(1-_/h)}}for(let _=0;_<h;_++)for(let w=0;w<c;w++){const x=w+u*_,I=w+u*(_+1),R=w+1+u*(_+1),S=w+1+u*_;g.push(x,I,S),g.push(I,R,S)}this.setIndex(g),this.setAttribute("position",new Ri(v,3)),this.setAttribute("normal",new Ri(E,3)),this.setAttribute("uv",new Ri(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new du(e.width,e.height,e.widthSegments,e.heightSegments)}}var i5=`#ifdef USE_ALPHAHASH
76
76
  if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
77
77
  #endif`,s5=`#ifdef USE_ALPHAHASH
78
78
  const float ALPHA_HASH_SCALE = 0.05;
@@ -3574,7 +3574,7 @@ void main() {
3574
3574
  #include <tonemapping_fragment>
3575
3575
  #include <colorspace_fragment>
3576
3576
  #include <fog_fragment>
3577
- }`,dt={alphahash_fragment:i5,alphahash_pars_fragment:s5,alphamap_fragment:a5,alphamap_pars_fragment:o5,alphatest_fragment:l5,alphatest_pars_fragment:c5,aomap_fragment:u5,aomap_pars_fragment:h5,batching_pars_vertex:d5,batching_vertex:f5,begin_vertex:p5,beginnormal_vertex:A5,bsdfs:g5,iridescence_fragment:m5,bumpmap_pars_fragment:_5,clipping_planes_fragment:v5,clipping_planes_pars_fragment:y5,clipping_planes_pars_vertex:E5,clipping_planes_vertex:x5,color_fragment:w5,color_pars_fragment:I5,color_pars_vertex:C5,color_vertex:M5,common:S5,cube_uv_reflection_fragment:T5,defaultnormal_vertex:B5,displacementmap_pars_vertex:b5,displacementmap_vertex:R5,emissivemap_fragment:D5,emissivemap_pars_fragment:L5,colorspace_fragment:N5,colorspace_pars_fragment:U5,envmap_fragment:P5,envmap_common_pars_fragment:k5,envmap_pars_fragment:Q5,envmap_pars_vertex:O5,envmap_physical_pars_fragment:J5,envmap_vertex:F5,fog_vertex:z5,fog_pars_vertex:H5,fog_fragment:G5,fog_pars_fragment:V5,gradientmap_pars_fragment:j5,lightmap_fragment:W5,lightmap_pars_fragment:Y5,lights_lambert_fragment:q5,lights_lambert_pars_fragment:X5,lights_pars_begin:K5,lights_toon_fragment:Z5,lights_toon_pars_fragment:$5,lights_phong_fragment:eR,lights_phong_pars_fragment:tR,lights_physical_fragment:rR,lights_physical_pars_fragment:nR,lights_fragment_begin:iR,lights_fragment_maps:sR,lights_fragment_end:aR,logdepthbuf_fragment:oR,logdepthbuf_pars_fragment:lR,logdepthbuf_pars_vertex:cR,logdepthbuf_vertex:uR,map_fragment:hR,map_pars_fragment:dR,map_particle_fragment:fR,map_particle_pars_fragment:pR,metalnessmap_fragment:AR,metalnessmap_pars_fragment:gR,morphinstance_vertex:mR,morphcolor_vertex:_R,morphnormal_vertex:vR,morphtarget_pars_vertex:yR,morphtarget_vertex:ER,normal_fragment_begin:xR,normal_fragment_maps:wR,normal_pars_fragment:IR,normal_pars_vertex:CR,normal_vertex:MR,normalmap_pars_fragment:SR,clearcoat_normal_fragment_begin:TR,clearcoat_normal_fragment_maps:BR,clearcoat_pars_fragment:bR,iridescence_pars_fragment:RR,opaque_fragment:DR,packing:LR,premultiplied_alpha_fragment:NR,project_vertex:UR,dithering_fragment:PR,dithering_pars_fragment:kR,roughnessmap_fragment:QR,roughnessmap_pars_fragment:OR,shadowmap_pars_fragment:FR,shadowmap_pars_vertex:zR,shadowmap_vertex:HR,shadowmask_pars_fragment:GR,skinbase_vertex:VR,skinning_pars_vertex:jR,skinning_vertex:WR,skinnormal_vertex:YR,specularmap_fragment:qR,specularmap_pars_fragment:XR,tonemapping_fragment:KR,tonemapping_pars_fragment:JR,transmission_fragment:ZR,transmission_pars_fragment:$R,uv_pars_fragment:e6,uv_pars_vertex:t6,uv_vertex:r6,worldpos_vertex:n6,background_vert:i6,background_frag:s6,backgroundCube_vert:a6,backgroundCube_frag:o6,cube_vert:l6,cube_frag:c6,depth_vert:u6,depth_frag:h6,distanceRGBA_vert:d6,distanceRGBA_frag:f6,equirect_vert:p6,equirect_frag:A6,linedashed_vert:g6,linedashed_frag:m6,meshbasic_vert:_6,meshbasic_frag:v6,meshlambert_vert:y6,meshlambert_frag:E6,meshmatcap_vert:x6,meshmatcap_frag:w6,meshnormal_vert:I6,meshnormal_frag:C6,meshphong_vert:M6,meshphong_frag:S6,meshphysical_vert:T6,meshphysical_frag:B6,meshtoon_vert:b6,meshtoon_frag:R6,points_vert:D6,points_frag:L6,shadow_vert:N6,shadow_frag:U6,sprite_vert:P6,sprite_frag:k6},be={common:{diffuse:{value:new qe(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ht},alphaMap:{value:null},alphaMapTransform:{value:new ht},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ht}},envmap:{envMap:{value:null},envMapRotation:{value:new ht},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new ht}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ht}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ht},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ht},normalScale:{value:new Ge(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ht},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ht}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ht}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ht}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new qe(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 qe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ht},alphaTest:{value:0},uvTransform:{value:new ht}},sprite:{diffuse:{value:new qe(16777215)},opacity:{value:1},center:{value:new Ge(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ht},alphaMap:{value:null},alphaMapTransform:{value:new ht},alphaTest:{value:0}}},Xi={basic:{uniforms:ln([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.fog]),vertexShader:dt.meshbasic_vert,fragmentShader:dt.meshbasic_frag},lambert:{uniforms:ln([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new qe(0)}}]),vertexShader:dt.meshlambert_vert,fragmentShader:dt.meshlambert_frag},phong:{uniforms:ln([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new qe(0)},specular:{value:new qe(1118481)},shininess:{value:30}}]),vertexShader:dt.meshphong_vert,fragmentShader:dt.meshphong_frag},standard:{uniforms:ln([be.common,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.roughnessmap,be.metalnessmap,be.fog,be.lights,{emissive:{value:new qe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:dt.meshphysical_vert,fragmentShader:dt.meshphysical_frag},toon:{uniforms:ln([be.common,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.gradientmap,be.fog,be.lights,{emissive:{value:new qe(0)}}]),vertexShader:dt.meshtoon_vert,fragmentShader:dt.meshtoon_frag},matcap:{uniforms:ln([be.common,be.bumpmap,be.normalmap,be.displacementmap,be.fog,{matcap:{value:null}}]),vertexShader:dt.meshmatcap_vert,fragmentShader:dt.meshmatcap_frag},points:{uniforms:ln([be.points,be.fog]),vertexShader:dt.points_vert,fragmentShader:dt.points_frag},dashed:{uniforms:ln([be.common,be.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:dt.linedashed_vert,fragmentShader:dt.linedashed_frag},depth:{uniforms:ln([be.common,be.displacementmap]),vertexShader:dt.depth_vert,fragmentShader:dt.depth_frag},normal:{uniforms:ln([be.common,be.bumpmap,be.normalmap,be.displacementmap,{opacity:{value:1}}]),vertexShader:dt.meshnormal_vert,fragmentShader:dt.meshnormal_frag},sprite:{uniforms:ln([be.sprite,be.fog]),vertexShader:dt.sprite_vert,fragmentShader:dt.sprite_frag},background:{uniforms:{uvTransform:{value:new ht},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:dt.background_vert,fragmentShader:dt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new ht}},vertexShader:dt.backgroundCube_vert,fragmentShader:dt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:dt.cube_vert,fragmentShader:dt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:dt.equirect_vert,fragmentShader:dt.equirect_frag},distanceRGBA:{uniforms:ln([be.common,be.displacementmap,{referencePosition:{value:new W},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:dt.distanceRGBA_vert,fragmentShader:dt.distanceRGBA_frag},shadow:{uniforms:ln([be.lights,be.fog,{color:{value:new qe(0)},opacity:{value:1}}]),vertexShader:dt.shadow_vert,fragmentShader:dt.shadow_frag}};Xi.physical={uniforms:ln([Xi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ht},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ht},clearcoatNormalScale:{value:new Ge(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ht},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ht},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ht},sheen:{value:0},sheenColor:{value:new qe(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ht},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ht},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ht},transmissionSamplerSize:{value:new Ge},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ht},attenuationDistance:{value:0},attenuationColor:{value:new qe(0)},specularColor:{value:new qe(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ht},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ht},anisotropyVector:{value:new Ge},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ht}}]),vertexShader:dt.meshphysical_vert,fragmentShader:dt.meshphysical_frag};const Cd={r:0,b:0,g:0},co=new Wi,Q6=new tt;function O6(r,e,t,n,i,s,o){const c=new qe(0);let h=s===!0?0:1,u,d,A=null,p=0,g=null;function v(m,_){let w=!1,x=_.isScene===!0?_.background:null;x&&x.isTexture&&(x=(_.backgroundBlurriness>0?t:e).get(x)),x===null?E(c,h):x&&x.isColor&&(E(x,1),w=!0);const I=r.xr.getEnvironmentBlendMode();I==="additive"?n.buffers.color.setClear(0,0,0,1,o):I==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,o),(r.autoClear||w)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),x&&(x.isCubeTexture||x.mapping===jh)?(d===void 0&&(d=new Wr(new hu(1,1,1),new vn({name:"BackgroundCubeMaterial",uniforms:yl(Xi.backgroundCube.uniforms),vertexShader:Xi.backgroundCube.vertexShader,fragmentShader:Xi.backgroundCube.fragmentShader,side:Pr,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),d.geometry.deleteAttribute("uv"),d.onBeforeRender=function(R,S,T){this.matrixWorld.copyPosition(T.matrixWorld)},Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(d)),co.copy(_.backgroundRotation),co.x*=-1,co.y*=-1,co.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(co.y*=-1,co.z*=-1),d.material.uniforms.envMap.value=x,d.material.uniforms.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,d.material.uniforms.backgroundBlurriness.value=_.backgroundBlurriness,d.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,d.material.uniforms.backgroundRotation.value.setFromMatrix4(Q6.makeRotationFromEuler(co)),d.material.toneMapped=Rt.getTransfer(x.colorSpace)!==Ht,(A!==x||p!==x.version||g!==r.toneMapping)&&(d.material.needsUpdate=!0,A=x,p=x.version,g=r.toneMapping),d.layers.enableAll(),m.unshift(d,d.geometry,d.material,0,0,null)):x&&x.isTexture&&(u===void 0&&(u=new Wr(new du(2,2),new vn({name:"BackgroundMaterial",uniforms:yl(Xi.background.uniforms),vertexShader:Xi.background.vertexShader,fragmentShader:Xi.background.fragmentShader,side:vi,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(u)),u.material.uniforms.t2D.value=x,u.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,u.material.toneMapped=Rt.getTransfer(x.colorSpace)!==Ht,x.matrixAutoUpdate===!0&&x.updateMatrix(),u.material.uniforms.uvTransform.value.copy(x.matrix),(A!==x||p!==x.version||g!==r.toneMapping)&&(u.material.needsUpdate=!0,A=x,p=x.version,g=r.toneMapping),u.layers.enableAll(),m.unshift(u,u.geometry,u.material,0,0,null))}function E(m,_){m.getRGB(Cd,WE(r)),n.buffers.color.setClear(Cd.r,Cd.g,Cd.b,_,o)}return{getClearColor:function(){return c},setClearColor:function(m,_=1){c.set(m),h=_,E(c,h)},getClearAlpha:function(){return h},setClearAlpha:function(m){h=m,E(c,h)},render:v}}function F6(r,e){const t=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=p(null);let s=i,o=!1;function c(M,L,P,N,j){let X=!1;const K=A(N,P,L);s!==K&&(s=K,u(s.object)),X=g(M,N,P,j),X&&v(M,N,P,j),j!==null&&e.update(j,r.ELEMENT_ARRAY_BUFFER),(X||o)&&(o=!1,I(M,L,P,N),j!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e.get(j).buffer))}function h(){return r.createVertexArray()}function u(M){return r.bindVertexArray(M)}function d(M){return r.deleteVertexArray(M)}function A(M,L,P){const N=P.wireframe===!0;let j=n[M.id];j===void 0&&(j={},n[M.id]=j);let X=j[L.id];X===void 0&&(X={},j[L.id]=X);let K=X[N];return K===void 0&&(K=p(h()),X[N]=K),K}function p(M){const L=[],P=[],N=[];for(let j=0;j<t;j++)L[j]=0,P[j]=0,N[j]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:L,enabledAttributes:P,attributeDivisors:N,object:M,attributes:{},index:null}}function g(M,L,P,N){const j=s.attributes,X=L.attributes;let K=0;const ne=P.getAttributes();for(const V in ne)if(ne[V].location>=0){const te=j[V];let Q=X[V];if(Q===void 0&&(V==="instanceMatrix"&&M.instanceMatrix&&(Q=M.instanceMatrix),V==="instanceColor"&&M.instanceColor&&(Q=M.instanceColor)),te===void 0||te.attribute!==Q||Q&&te.data!==Q.data)return!0;K++}return s.attributesNum!==K||s.index!==N}function v(M,L,P,N){const j={},X=L.attributes;let K=0;const ne=P.getAttributes();for(const V in ne)if(ne[V].location>=0){let te=X[V];te===void 0&&(V==="instanceMatrix"&&M.instanceMatrix&&(te=M.instanceMatrix),V==="instanceColor"&&M.instanceColor&&(te=M.instanceColor));const Q={};Q.attribute=te,te&&te.data&&(Q.data=te.data),j[V]=Q,K++}s.attributes=j,s.attributesNum=K,s.index=N}function E(){const M=s.newAttributes;for(let L=0,P=M.length;L<P;L++)M[L]=0}function m(M){_(M,0)}function _(M,L){const P=s.newAttributes,N=s.enabledAttributes,j=s.attributeDivisors;P[M]=1,N[M]===0&&(r.enableVertexAttribArray(M),N[M]=1),j[M]!==L&&(r.vertexAttribDivisor(M,L),j[M]=L)}function w(){const M=s.newAttributes,L=s.enabledAttributes;for(let P=0,N=L.length;P<N;P++)L[P]!==M[P]&&(r.disableVertexAttribArray(P),L[P]=0)}function x(M,L,P,N,j,X,K){K===!0?r.vertexAttribIPointer(M,L,P,j,X):r.vertexAttribPointer(M,L,P,N,j,X)}function I(M,L,P,N){E();const j=N.attributes,X=P.getAttributes(),K=L.defaultAttributeValues;for(const ne in X){const V=X[ne];if(V.location>=0){let te=j[ne];if(te===void 0&&(ne==="instanceMatrix"&&M.instanceMatrix&&(te=M.instanceMatrix),ne==="instanceColor"&&M.instanceColor&&(te=M.instanceColor)),te!==void 0){const Q=te.normalized,z=te.itemSize,Z=e.get(te);if(Z===void 0)continue;const re=Z.buffer,H=Z.type,fe=Z.bytesPerElement,Ae=H===r.INT||H===r.UNSIGNED_INT||te.gpuType===Jc;if(te.isInterleavedBufferAttribute){const ve=te.data,ye=ve.stride,Oe=te.offset;if(ve.isInstancedInterleavedBuffer){for(let it=0;it<V.locationSize;it++)_(V.location+it,ve.meshPerAttribute);M.isInstancedMesh!==!0&&N._maxInstanceCount===void 0&&(N._maxInstanceCount=ve.meshPerAttribute*ve.count)}else for(let it=0;it<V.locationSize;it++)m(V.location+it);r.bindBuffer(r.ARRAY_BUFFER,re);for(let it=0;it<V.locationSize;it++)x(V.location+it,z/V.locationSize,H,Q,ye*fe,(Oe+z/V.locationSize*it)*fe,Ae)}else{if(te.isInstancedBufferAttribute){for(let ve=0;ve<V.locationSize;ve++)_(V.location+ve,te.meshPerAttribute);M.isInstancedMesh!==!0&&N._maxInstanceCount===void 0&&(N._maxInstanceCount=te.meshPerAttribute*te.count)}else for(let ve=0;ve<V.locationSize;ve++)m(V.location+ve);r.bindBuffer(r.ARRAY_BUFFER,re);for(let ve=0;ve<V.locationSize;ve++)x(V.location+ve,z/V.locationSize,H,Q,z*fe,z/V.locationSize*ve*fe,Ae)}}else if(K!==void 0){const Q=K[ne];if(Q!==void 0)switch(Q.length){case 2:r.vertexAttrib2fv(V.location,Q);break;case 3:r.vertexAttrib3fv(V.location,Q);break;case 4:r.vertexAttrib4fv(V.location,Q);break;default:r.vertexAttrib1fv(V.location,Q)}}}}w()}function R(){D();for(const M in n){const L=n[M];for(const P in L){const N=L[P];for(const j in N)d(N[j].object),delete N[j];delete L[P]}delete n[M]}}function S(M){if(n[M.id]===void 0)return;const L=n[M.id];for(const P in L){const N=L[P];for(const j in N)d(N[j].object),delete N[j];delete L[P]}delete n[M.id]}function T(M){for(const L in n){const P=n[L];if(P[M.id]===void 0)continue;const N=P[M.id];for(const j in N)d(N[j].object),delete N[j];delete P[M.id]}}function D(){b(),o=!0,s!==i&&(s=i,u(s.object))}function b(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:c,reset:D,resetDefaultState:b,dispose:R,releaseStatesOfGeometry:S,releaseStatesOfProgram:T,initAttributes:E,enableAttribute:m,disableUnusedAttributes:w}}function z6(r,e,t){let n;function i(h){n=h}function s(h,u){r.drawArrays(n,h,u),t.update(u,n,1)}function o(h,u,d){d!==0&&(r.drawArraysInstanced(n,h,u,d),t.update(u,n,d))}function c(h,u,d){if(d===0)return;const A=e.get("WEBGL_multi_draw");if(A===null)for(let p=0;p<d;p++)this.render(h[p],u[p]);else{A.multiDrawArraysWEBGL(n,h,0,u,0,d);let p=0;for(let g=0;g<d;g++)p+=u[g];t.update(p,n,1)}}this.setMode=i,this.render=s,this.renderInstances=o,this.renderMultiDraw=c}function H6(r,e,t){let n;function i(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){const x=e.get("EXT_texture_filter_anisotropic");n=r.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(x){if(x==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";x="mediump"}return x==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let o=t.precision!==void 0?t.precision:"highp";const c=s(o);c!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",c,"instead."),o=c);const h=t.logarithmicDepthBuffer===!0,u=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),d=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),A=r.getParameter(r.MAX_TEXTURE_SIZE),p=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),g=r.getParameter(r.MAX_VERTEX_ATTRIBS),v=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),E=r.getParameter(r.MAX_VARYING_VECTORS),m=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),_=d>0,w=r.getParameter(r.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:i,getMaxPrecision:s,precision:o,logarithmicDepthBuffer:h,maxTextures:u,maxVertexTextures:d,maxTextureSize:A,maxCubemapSize:p,maxAttributes:g,maxVertexUniforms:v,maxVaryings:E,maxFragmentUniforms:m,vertexTextures:_,maxSamples:w}}function G6(r){const e=this;let t=null,n=0,i=!1,s=!1;const o=new qi,c=new ht,h={value:null,needsUpdate:!1};this.uniform=h,this.numPlanes=0,this.numIntersection=0,this.init=function(A,p){const g=A.length!==0||p||n!==0||i;return i=p,n=A.length,g},this.beginShadows=function(){s=!0,d(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(A,p){t=d(A,p,0)},this.setState=function(A,p,g){const v=A.clippingPlanes,E=A.clipIntersection,m=A.clipShadows,_=r.get(A);if(!i||v===null||v.length===0||s&&!m)s?d(null):u();else{const w=s?0:n,x=w*4;let I=_.clippingState||null;h.value=I,I=d(v,p,x,g);for(let R=0;R!==x;++R)I[R]=t[R];_.clippingState=I,this.numIntersection=E?this.numPlanes:0,this.numPlanes+=w}};function u(){h.value!==t&&(h.value=t,h.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function d(A,p,g,v){const E=A!==null?A.length:0;let m=null;if(E!==0){if(m=h.value,v!==!0||m===null){const _=g+E*4,w=p.matrixWorldInverse;c.getNormalMatrix(w),(m===null||m.length<_)&&(m=new Float32Array(_));for(let x=0,I=g;x!==E;++x,I+=4)o.copy(A[x]).applyMatrix4(w,c),o.normal.toArray(m,I),m[I+3]=o.constant}h.value=m,h.needsUpdate=!0}return e.numPlanes=E,e.numIntersection=0,m}}function V6(r){let e=new WeakMap;function t(o,c){return c===Xc?o.mapping=ro:c===cA&&(o.mapping=tl),o}function n(o){if(o&&o.isTexture){const c=o.mapping;if(c===Xc||c===cA)if(e.has(o)){const h=e.get(o).texture;return t(h,o.mapping)}else{const h=o.image;if(h&&h.height>0){const u=new e5(h.height);return u.fromEquirectangularTexture(r,o),e.set(o,u),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){const c=o.target;c.removeEventListener("dispose",i);const h=e.get(c);h!==void 0&&(e.delete(c),h.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}class fu extends YE{constructor(e=-1,t=1,n=1,i=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=o,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=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=n-e,o=n+e,c=i+t,h=i-t;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,d=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=u*this.view.offsetX,o=s+u*this.view.width,c-=d*this.view.offsetY,h=c-d*this.view.height}this.projectionMatrix.makeOrthographic(s,o,c,h,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const 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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const wl=4,ZE=[.125,.215,.35,.446,.526,.582],uo=20,WA=new fu,$E=new qe;let YA=null,qA=0,XA=0,KA=!1;const ho=(1+Math.sqrt(5))/2,Il=1/ho,e2=[new W(1,1,1),new W(-1,1,1),new W(1,1,-1),new W(-1,1,-1),new W(0,ho,Il),new W(0,ho,-Il),new W(Il,0,ho),new W(-Il,0,ho),new W(ho,Il,0),new W(-ho,Il,0)];class t2{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,t=0,n=.1,i=100){YA=this._renderer.getRenderTarget(),qA=this._renderer.getActiveCubeFace(),XA=this._renderer.getActiveMipmapLevel(),KA=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=i2(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=n2(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(YA,qA,XA),this._renderer.xr.enabled=KA,e.scissorTest=!1,Md(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===ro||e.mapping===tl?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),YA=this._renderer.getRenderTarget(),qA=this._renderer.getActiveCubeFace(),XA=this._renderer.getActiveMipmapLevel(),KA=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:fr,minFilter:fr,generateMipmaps:!1,type:_n,format:Ar,colorSpace:Cr,depthBuffer:!1},i=r2(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=r2(e,t,n);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=j6(s)),this._blurMaterial=W6(s,e,t)}return i}_compileMaterial(e){const t=new Wr(this._lodPlanes[0],e);this._renderer.compile(t,WA)}_sceneToCubeUV(e,t,n,i){const s=new cn(90,1,t,n),o=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],h=this._renderer,u=h.autoClear,d=h.toneMapping;h.getClearColor($E),h.toneMapping=Js,h.autoClear=!1;const A=new Es({name:"PMREM.Background",side:Pr,depthWrite:!1,depthTest:!1}),p=new Wr(new hu,A);let g=!1;const v=e.background;v?v.isColor&&(A.color.copy(v),e.background=null,g=!0):(A.color.copy($E),g=!0);for(let E=0;E<6;E++){const m=E%3;m===0?(s.up.set(0,o[E],0),s.lookAt(c[E],0,0)):m===1?(s.up.set(0,0,o[E]),s.lookAt(0,c[E],0)):(s.up.set(0,o[E],0),s.lookAt(0,0,c[E]));const _=this._cubeSize;Md(i,m*_,E>2?_:0,_,_),h.setRenderTarget(i),g&&h.render(p,s),h.render(e,s)}p.geometry.dispose(),p.material.dispose(),h.toneMapping=d,h.autoClear=u,e.background=v}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===ro||e.mapping===tl;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=i2()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=n2());const s=i?this._cubemapMaterial:this._equirectMaterial,o=new Wr(this._lodPlanes[0],s),c=s.uniforms;c.envMap.value=e;const h=this._cubeSize;Md(t,0,0,3*h,2*h),n.setRenderTarget(t),n.render(o,WA)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;i<this._lodPlanes.length;i++){const s=Math.sqrt(this._sigmas[i]*this._sigmas[i]-this._sigmas[i-1]*this._sigmas[i-1]),o=e2[(i-1)%e2.length];this._blur(e,i-1,i,s,o)}t.autoClear=n}_blur(e,t,n,i,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,n,i,"latitudinal",s),this._halfBlur(o,e,n,n,i,"longitudinal",s)}_halfBlur(e,t,n,i,s,o,c){const h=this._renderer,u=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const d=3,A=new Wr(this._lodPlanes[i],u),p=u.uniforms,g=this._sizeLods[n]-1,v=isFinite(s)?Math.PI/(2*g):2*Math.PI/(2*uo-1),E=s/v,m=isFinite(s)?1+Math.floor(d*E):uo;m>uo&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${uo}`);const _=[];let w=0;for(let T=0;T<uo;++T){const D=T/E,b=Math.exp(-D*D/2);_.push(b),T===0?w+=b:T<m&&(w+=2*b)}for(let T=0;T<_.length;T++)_[T]=_[T]/w;p.envMap.value=e.texture,p.samples.value=m,p.weights.value=_,p.latitudinal.value=o==="latitudinal",c&&(p.poleAxis.value=c);const{_lodMax:x}=this;p.dTheta.value=v,p.mipInt.value=x-n;const I=this._sizeLods[i],R=3*I*(i>x-wl?i-x+wl:0),S=4*(this._cubeSize-I);Md(t,R,S,3*I,2*I),h.setRenderTarget(t),h.render(A,WA)}}function j6(r){const e=[],t=[],n=[];let i=r;const s=r-wl+1+ZE.length;for(let o=0;o<s;o++){const c=Math.pow(2,i);t.push(c);let h=1/c;o>r-wl?h=ZE[o-r+wl-1]:o===0&&(h=0),n.push(h);const u=1/(c-2),d=-u,A=1+u,p=[d,d,A,d,A,A,d,d,A,A,d,A],g=6,v=6,E=3,m=2,_=1,w=new Float32Array(E*v*g),x=new Float32Array(m*v*g),I=new Float32Array(_*v*g);for(let S=0;S<g;S++){const T=S%3*2/3-1,D=S>2?0:-1,b=[T,D,0,T+2/3,D,0,T+2/3,D+1,0,T,D,0,T+2/3,D+1,0,T,D+1,0];w.set(b,E*v*S),x.set(p,m*v*S);const M=[S,S,S,S,S,S];I.set(M,_*v*S)}const R=new zn;R.setAttribute("position",new Qr(w,E)),R.setAttribute("uv",new Qr(x,m)),R.setAttribute("faceIndex",new Qr(I,_)),e.push(R),i>wl&&i--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function r2(r,e,t){const n=new Mi(r,e,t);return n.texture.mapping=jh,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Md(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function W6(r,e,t){const n=new Float32Array(uo),i=new W(0,1,0);return new vn({name:"SphericalGaussianBlur",defines:{n:uo,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:JA(),fragmentShader:`
3577
+ }`,dt={alphahash_fragment:i5,alphahash_pars_fragment:s5,alphamap_fragment:a5,alphamap_pars_fragment:o5,alphatest_fragment:l5,alphatest_pars_fragment:c5,aomap_fragment:u5,aomap_pars_fragment:h5,batching_pars_vertex:d5,batching_vertex:f5,begin_vertex:p5,beginnormal_vertex:A5,bsdfs:g5,iridescence_fragment:m5,bumpmap_pars_fragment:_5,clipping_planes_fragment:v5,clipping_planes_pars_fragment:y5,clipping_planes_pars_vertex:E5,clipping_planes_vertex:x5,color_fragment:w5,color_pars_fragment:I5,color_pars_vertex:C5,color_vertex:M5,common:S5,cube_uv_reflection_fragment:T5,defaultnormal_vertex:B5,displacementmap_pars_vertex:b5,displacementmap_vertex:R5,emissivemap_fragment:D5,emissivemap_pars_fragment:L5,colorspace_fragment:N5,colorspace_pars_fragment:U5,envmap_fragment:P5,envmap_common_pars_fragment:k5,envmap_pars_fragment:Q5,envmap_pars_vertex:O5,envmap_physical_pars_fragment:J5,envmap_vertex:F5,fog_vertex:z5,fog_pars_vertex:H5,fog_fragment:G5,fog_pars_fragment:V5,gradientmap_pars_fragment:j5,lightmap_fragment:W5,lightmap_pars_fragment:Y5,lights_lambert_fragment:q5,lights_lambert_pars_fragment:X5,lights_pars_begin:K5,lights_toon_fragment:Z5,lights_toon_pars_fragment:$5,lights_phong_fragment:eR,lights_phong_pars_fragment:tR,lights_physical_fragment:rR,lights_physical_pars_fragment:nR,lights_fragment_begin:iR,lights_fragment_maps:sR,lights_fragment_end:aR,logdepthbuf_fragment:oR,logdepthbuf_pars_fragment:lR,logdepthbuf_pars_vertex:cR,logdepthbuf_vertex:uR,map_fragment:hR,map_pars_fragment:dR,map_particle_fragment:fR,map_particle_pars_fragment:pR,metalnessmap_fragment:AR,metalnessmap_pars_fragment:gR,morphinstance_vertex:mR,morphcolor_vertex:_R,morphnormal_vertex:vR,morphtarget_pars_vertex:yR,morphtarget_vertex:ER,normal_fragment_begin:xR,normal_fragment_maps:wR,normal_pars_fragment:IR,normal_pars_vertex:CR,normal_vertex:MR,normalmap_pars_fragment:SR,clearcoat_normal_fragment_begin:TR,clearcoat_normal_fragment_maps:BR,clearcoat_pars_fragment:bR,iridescence_pars_fragment:RR,opaque_fragment:DR,packing:LR,premultiplied_alpha_fragment:NR,project_vertex:UR,dithering_fragment:PR,dithering_pars_fragment:kR,roughnessmap_fragment:QR,roughnessmap_pars_fragment:OR,shadowmap_pars_fragment:FR,shadowmap_pars_vertex:zR,shadowmap_vertex:HR,shadowmask_pars_fragment:GR,skinbase_vertex:VR,skinning_pars_vertex:jR,skinning_vertex:WR,skinnormal_vertex:YR,specularmap_fragment:qR,specularmap_pars_fragment:XR,tonemapping_fragment:KR,tonemapping_pars_fragment:JR,transmission_fragment:ZR,transmission_pars_fragment:$R,uv_pars_fragment:e6,uv_pars_vertex:t6,uv_vertex:r6,worldpos_vertex:n6,background_vert:i6,background_frag:s6,backgroundCube_vert:a6,backgroundCube_frag:o6,cube_vert:l6,cube_frag:c6,depth_vert:u6,depth_frag:h6,distanceRGBA_vert:d6,distanceRGBA_frag:f6,equirect_vert:p6,equirect_frag:A6,linedashed_vert:g6,linedashed_frag:m6,meshbasic_vert:_6,meshbasic_frag:v6,meshlambert_vert:y6,meshlambert_frag:E6,meshmatcap_vert:x6,meshmatcap_frag:w6,meshnormal_vert:I6,meshnormal_frag:C6,meshphong_vert:M6,meshphong_frag:S6,meshphysical_vert:T6,meshphysical_frag:B6,meshtoon_vert:b6,meshtoon_frag:R6,points_vert:D6,points_frag:L6,shadow_vert:N6,shadow_frag:U6,sprite_vert:P6,sprite_frag:k6},be={common:{diffuse:{value:new qe(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ht},alphaMap:{value:null},alphaMapTransform:{value:new ht},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ht}},envmap:{envMap:{value:null},envMapRotation:{value:new ht},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new ht}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ht}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ht},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ht},normalScale:{value:new Ge(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ht},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ht}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ht}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ht}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new qe(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 qe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ht},alphaTest:{value:0},uvTransform:{value:new ht}},sprite:{diffuse:{value:new qe(16777215)},opacity:{value:1},center:{value:new Ge(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ht},alphaMap:{value:null},alphaMapTransform:{value:new ht},alphaTest:{value:0}}},Xi={basic:{uniforms:ln([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.fog]),vertexShader:dt.meshbasic_vert,fragmentShader:dt.meshbasic_frag},lambert:{uniforms:ln([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new qe(0)}}]),vertexShader:dt.meshlambert_vert,fragmentShader:dt.meshlambert_frag},phong:{uniforms:ln([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new qe(0)},specular:{value:new qe(1118481)},shininess:{value:30}}]),vertexShader:dt.meshphong_vert,fragmentShader:dt.meshphong_frag},standard:{uniforms:ln([be.common,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.roughnessmap,be.metalnessmap,be.fog,be.lights,{emissive:{value:new qe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:dt.meshphysical_vert,fragmentShader:dt.meshphysical_frag},toon:{uniforms:ln([be.common,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.gradientmap,be.fog,be.lights,{emissive:{value:new qe(0)}}]),vertexShader:dt.meshtoon_vert,fragmentShader:dt.meshtoon_frag},matcap:{uniforms:ln([be.common,be.bumpmap,be.normalmap,be.displacementmap,be.fog,{matcap:{value:null}}]),vertexShader:dt.meshmatcap_vert,fragmentShader:dt.meshmatcap_frag},points:{uniforms:ln([be.points,be.fog]),vertexShader:dt.points_vert,fragmentShader:dt.points_frag},dashed:{uniforms:ln([be.common,be.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:dt.linedashed_vert,fragmentShader:dt.linedashed_frag},depth:{uniforms:ln([be.common,be.displacementmap]),vertexShader:dt.depth_vert,fragmentShader:dt.depth_frag},normal:{uniforms:ln([be.common,be.bumpmap,be.normalmap,be.displacementmap,{opacity:{value:1}}]),vertexShader:dt.meshnormal_vert,fragmentShader:dt.meshnormal_frag},sprite:{uniforms:ln([be.sprite,be.fog]),vertexShader:dt.sprite_vert,fragmentShader:dt.sprite_frag},background:{uniforms:{uvTransform:{value:new ht},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:dt.background_vert,fragmentShader:dt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new ht}},vertexShader:dt.backgroundCube_vert,fragmentShader:dt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:dt.cube_vert,fragmentShader:dt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:dt.equirect_vert,fragmentShader:dt.equirect_frag},distanceRGBA:{uniforms:ln([be.common,be.displacementmap,{referencePosition:{value:new W},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:dt.distanceRGBA_vert,fragmentShader:dt.distanceRGBA_frag},shadow:{uniforms:ln([be.lights,be.fog,{color:{value:new qe(0)},opacity:{value:1}}]),vertexShader:dt.shadow_vert,fragmentShader:dt.shadow_frag}};Xi.physical={uniforms:ln([Xi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ht},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ht},clearcoatNormalScale:{value:new Ge(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ht},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ht},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ht},sheen:{value:0},sheenColor:{value:new qe(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ht},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ht},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ht},transmissionSamplerSize:{value:new Ge},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ht},attenuationDistance:{value:0},attenuationColor:{value:new qe(0)},specularColor:{value:new qe(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ht},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ht},anisotropyVector:{value:new Ge},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ht}}]),vertexShader:dt.meshphysical_vert,fragmentShader:dt.meshphysical_frag};const Cd={r:0,b:0,g:0},co=new Wi,Q6=new tt;function O6(r,e,t,n,i,s,o){const c=new qe(0);let h=s===!0?0:1,u,d,A=null,p=0,g=null;function v(m,_){let w=!1,x=_.isScene===!0?_.background:null;x&&x.isTexture&&(x=(_.backgroundBlurriness>0?t:e).get(x)),x===null?E(c,h):x&&x.isColor&&(E(x,1),w=!0);const I=r.xr.getEnvironmentBlendMode();I==="additive"?n.buffers.color.setClear(0,0,0,1,o):I==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,o),(r.autoClear||w)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),x&&(x.isCubeTexture||x.mapping===jh)?(d===void 0&&(d=new Wr(new hu(1,1,1),new vn({name:"BackgroundCubeMaterial",uniforms:yl(Xi.backgroundCube.uniforms),vertexShader:Xi.backgroundCube.vertexShader,fragmentShader:Xi.backgroundCube.fragmentShader,side:Pr,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),d.geometry.deleteAttribute("uv"),d.onBeforeRender=function(R,S,T){this.matrixWorld.copyPosition(T.matrixWorld)},Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(d)),co.copy(_.backgroundRotation),co.x*=-1,co.y*=-1,co.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(co.y*=-1,co.z*=-1),d.material.uniforms.envMap.value=x,d.material.uniforms.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,d.material.uniforms.backgroundBlurriness.value=_.backgroundBlurriness,d.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,d.material.uniforms.backgroundRotation.value.setFromMatrix4(Q6.makeRotationFromEuler(co)),d.material.toneMapped=Rt.getTransfer(x.colorSpace)!==Ht,(A!==x||p!==x.version||g!==r.toneMapping)&&(d.material.needsUpdate=!0,A=x,p=x.version,g=r.toneMapping),d.layers.enableAll(),m.unshift(d,d.geometry,d.material,0,0,null)):x&&x.isTexture&&(u===void 0&&(u=new Wr(new du(2,2),new vn({name:"BackgroundMaterial",uniforms:yl(Xi.background.uniforms),vertexShader:Xi.background.vertexShader,fragmentShader:Xi.background.fragmentShader,side:vi,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(u)),u.material.uniforms.t2D.value=x,u.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,u.material.toneMapped=Rt.getTransfer(x.colorSpace)!==Ht,x.matrixAutoUpdate===!0&&x.updateMatrix(),u.material.uniforms.uvTransform.value.copy(x.matrix),(A!==x||p!==x.version||g!==r.toneMapping)&&(u.material.needsUpdate=!0,A=x,p=x.version,g=r.toneMapping),u.layers.enableAll(),m.unshift(u,u.geometry,u.material,0,0,null))}function E(m,_){m.getRGB(Cd,WE(r)),n.buffers.color.setClear(Cd.r,Cd.g,Cd.b,_,o)}return{getClearColor:function(){return c},setClearColor:function(m,_=1){c.set(m),h=_,E(c,h)},getClearAlpha:function(){return h},setClearAlpha:function(m){h=m,E(c,h)},render:v}}function F6(r,e){const t=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=p(null);let s=i,o=!1;function c(M,L,P,N,j){let X=!1;const K=A(N,P,L);s!==K&&(s=K,u(s.object)),X=g(M,N,P,j),X&&v(M,N,P,j),j!==null&&e.update(j,r.ELEMENT_ARRAY_BUFFER),(X||o)&&(o=!1,I(M,L,P,N),j!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e.get(j).buffer))}function h(){return r.createVertexArray()}function u(M){return r.bindVertexArray(M)}function d(M){return r.deleteVertexArray(M)}function A(M,L,P){const N=P.wireframe===!0;let j=n[M.id];j===void 0&&(j={},n[M.id]=j);let X=j[L.id];X===void 0&&(X={},j[L.id]=X);let K=X[N];return K===void 0&&(K=p(h()),X[N]=K),K}function p(M){const L=[],P=[],N=[];for(let j=0;j<t;j++)L[j]=0,P[j]=0,N[j]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:L,enabledAttributes:P,attributeDivisors:N,object:M,attributes:{},index:null}}function g(M,L,P,N){const j=s.attributes,X=L.attributes;let K=0;const ne=P.getAttributes();for(const V in ne)if(ne[V].location>=0){const te=j[V];let Q=X[V];if(Q===void 0&&(V==="instanceMatrix"&&M.instanceMatrix&&(Q=M.instanceMatrix),V==="instanceColor"&&M.instanceColor&&(Q=M.instanceColor)),te===void 0||te.attribute!==Q||Q&&te.data!==Q.data)return!0;K++}return s.attributesNum!==K||s.index!==N}function v(M,L,P,N){const j={},X=L.attributes;let K=0;const ne=P.getAttributes();for(const V in ne)if(ne[V].location>=0){let te=X[V];te===void 0&&(V==="instanceMatrix"&&M.instanceMatrix&&(te=M.instanceMatrix),V==="instanceColor"&&M.instanceColor&&(te=M.instanceColor));const Q={};Q.attribute=te,te&&te.data&&(Q.data=te.data),j[V]=Q,K++}s.attributes=j,s.attributesNum=K,s.index=N}function E(){const M=s.newAttributes;for(let L=0,P=M.length;L<P;L++)M[L]=0}function m(M){_(M,0)}function _(M,L){const P=s.newAttributes,N=s.enabledAttributes,j=s.attributeDivisors;P[M]=1,N[M]===0&&(r.enableVertexAttribArray(M),N[M]=1),j[M]!==L&&(r.vertexAttribDivisor(M,L),j[M]=L)}function w(){const M=s.newAttributes,L=s.enabledAttributes;for(let P=0,N=L.length;P<N;P++)L[P]!==M[P]&&(r.disableVertexAttribArray(P),L[P]=0)}function x(M,L,P,N,j,X,K){K===!0?r.vertexAttribIPointer(M,L,P,j,X):r.vertexAttribPointer(M,L,P,N,j,X)}function I(M,L,P,N){E();const j=N.attributes,X=P.getAttributes(),K=L.defaultAttributeValues;for(const ne in X){const V=X[ne];if(V.location>=0){let te=j[ne];if(te===void 0&&(ne==="instanceMatrix"&&M.instanceMatrix&&(te=M.instanceMatrix),ne==="instanceColor"&&M.instanceColor&&(te=M.instanceColor)),te!==void 0){const Q=te.normalized,z=te.itemSize,Z=e.get(te);if(Z===void 0)continue;const re=Z.buffer,H=Z.type,fe=Z.bytesPerElement,Ae=H===r.INT||H===r.UNSIGNED_INT||te.gpuType===Jc;if(te.isInterleavedBufferAttribute){const ve=te.data,ye=ve.stride,Oe=te.offset;if(ve.isInstancedInterleavedBuffer){for(let it=0;it<V.locationSize;it++)_(V.location+it,ve.meshPerAttribute);M.isInstancedMesh!==!0&&N._maxInstanceCount===void 0&&(N._maxInstanceCount=ve.meshPerAttribute*ve.count)}else for(let it=0;it<V.locationSize;it++)m(V.location+it);r.bindBuffer(r.ARRAY_BUFFER,re);for(let it=0;it<V.locationSize;it++)x(V.location+it,z/V.locationSize,H,Q,ye*fe,(Oe+z/V.locationSize*it)*fe,Ae)}else{if(te.isInstancedBufferAttribute){for(let ve=0;ve<V.locationSize;ve++)_(V.location+ve,te.meshPerAttribute);M.isInstancedMesh!==!0&&N._maxInstanceCount===void 0&&(N._maxInstanceCount=te.meshPerAttribute*te.count)}else for(let ve=0;ve<V.locationSize;ve++)m(V.location+ve);r.bindBuffer(r.ARRAY_BUFFER,re);for(let ve=0;ve<V.locationSize;ve++)x(V.location+ve,z/V.locationSize,H,Q,z*fe,z/V.locationSize*ve*fe,Ae)}}else if(K!==void 0){const Q=K[ne];if(Q!==void 0)switch(Q.length){case 2:r.vertexAttrib2fv(V.location,Q);break;case 3:r.vertexAttrib3fv(V.location,Q);break;case 4:r.vertexAttrib4fv(V.location,Q);break;default:r.vertexAttrib1fv(V.location,Q)}}}}w()}function R(){D();for(const M in n){const L=n[M];for(const P in L){const N=L[P];for(const j in N)d(N[j].object),delete N[j];delete L[P]}delete n[M]}}function S(M){if(n[M.id]===void 0)return;const L=n[M.id];for(const P in L){const N=L[P];for(const j in N)d(N[j].object),delete N[j];delete L[P]}delete n[M.id]}function T(M){for(const L in n){const P=n[L];if(P[M.id]===void 0)continue;const N=P[M.id];for(const j in N)d(N[j].object),delete N[j];delete P[M.id]}}function D(){b(),o=!0,s!==i&&(s=i,u(s.object))}function b(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:c,reset:D,resetDefaultState:b,dispose:R,releaseStatesOfGeometry:S,releaseStatesOfProgram:T,initAttributes:E,enableAttribute:m,disableUnusedAttributes:w}}function z6(r,e,t){let n;function i(h){n=h}function s(h,u){r.drawArrays(n,h,u),t.update(u,n,1)}function o(h,u,d){d!==0&&(r.drawArraysInstanced(n,h,u,d),t.update(u,n,d))}function c(h,u,d){if(d===0)return;const A=e.get("WEBGL_multi_draw");if(A===null)for(let p=0;p<d;p++)this.render(h[p],u[p]);else{A.multiDrawArraysWEBGL(n,h,0,u,0,d);let p=0;for(let g=0;g<d;g++)p+=u[g];t.update(p,n,1)}}this.setMode=i,this.render=s,this.renderInstances=o,this.renderMultiDraw=c}function H6(r,e,t){let n;function i(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){const x=e.get("EXT_texture_filter_anisotropic");n=r.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(x){if(x==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";x="mediump"}return x==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let o=t.precision!==void 0?t.precision:"highp";const c=s(o);c!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",c,"instead."),o=c);const h=t.logarithmicDepthBuffer===!0,u=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),d=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),A=r.getParameter(r.MAX_TEXTURE_SIZE),p=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),g=r.getParameter(r.MAX_VERTEX_ATTRIBS),v=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),E=r.getParameter(r.MAX_VARYING_VECTORS),m=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),_=d>0,w=r.getParameter(r.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:i,getMaxPrecision:s,precision:o,logarithmicDepthBuffer:h,maxTextures:u,maxVertexTextures:d,maxTextureSize:A,maxCubemapSize:p,maxAttributes:g,maxVertexUniforms:v,maxVaryings:E,maxFragmentUniforms:m,vertexTextures:_,maxSamples:w}}function G6(r){const e=this;let t=null,n=0,i=!1,s=!1;const o=new qi,c=new ht,h={value:null,needsUpdate:!1};this.uniform=h,this.numPlanes=0,this.numIntersection=0,this.init=function(A,p){const g=A.length!==0||p||n!==0||i;return i=p,n=A.length,g},this.beginShadows=function(){s=!0,d(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(A,p){t=d(A,p,0)},this.setState=function(A,p,g){const v=A.clippingPlanes,E=A.clipIntersection,m=A.clipShadows,_=r.get(A);if(!i||v===null||v.length===0||s&&!m)s?d(null):u();else{const w=s?0:n,x=w*4;let I=_.clippingState||null;h.value=I,I=d(v,p,x,g);for(let R=0;R!==x;++R)I[R]=t[R];_.clippingState=I,this.numIntersection=E?this.numPlanes:0,this.numPlanes+=w}};function u(){h.value!==t&&(h.value=t,h.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function d(A,p,g,v){const E=A!==null?A.length:0;let m=null;if(E!==0){if(m=h.value,v!==!0||m===null){const _=g+E*4,w=p.matrixWorldInverse;c.getNormalMatrix(w),(m===null||m.length<_)&&(m=new Float32Array(_));for(let x=0,I=g;x!==E;++x,I+=4)o.copy(A[x]).applyMatrix4(w,c),o.normal.toArray(m,I),m[I+3]=o.constant}h.value=m,h.needsUpdate=!0}return e.numPlanes=E,e.numIntersection=0,m}}function V6(r){let e=new WeakMap;function t(o,c){return c===Xc?o.mapping=ro:c===cA&&(o.mapping=tl),o}function n(o){if(o&&o.isTexture){const c=o.mapping;if(c===Xc||c===cA)if(e.has(o)){const h=e.get(o).texture;return t(h,o.mapping)}else{const h=o.image;if(h&&h.height>0){const u=new e5(h.height);return u.fromEquirectangularTexture(r,o),e.set(o,u),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){const c=o.target;c.removeEventListener("dispose",i);const h=e.get(c);h!==void 0&&(e.delete(c),h.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}class fu extends YE{constructor(e=-1,t=1,n=1,i=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=o,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=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=n-e,o=n+e,c=i+t,h=i-t;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,d=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=u*this.view.offsetX,o=s+u*this.view.width,c-=d*this.view.offsetY,h=c-d*this.view.height}this.projectionMatrix.makeOrthographic(s,o,c,h,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const 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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const wl=4,ZE=[.125,.215,.35,.446,.526,.582],uo=20,WA=new fu,$E=new qe;let YA=null,qA=0,XA=0,KA=!1;const ho=(1+Math.sqrt(5))/2,Il=1/ho,e2=[new W(1,1,1),new W(-1,1,1),new W(1,1,-1),new W(-1,1,-1),new W(0,ho,Il),new W(0,ho,-Il),new W(Il,0,ho),new W(-Il,0,ho),new W(ho,Il,0),new W(-ho,Il,0)];class t2{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,t=0,n=.1,i=100){YA=this._renderer.getRenderTarget(),qA=this._renderer.getActiveCubeFace(),XA=this._renderer.getActiveMipmapLevel(),KA=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=i2(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=n2(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(YA,qA,XA),this._renderer.xr.enabled=KA,e.scissorTest=!1,Md(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===ro||e.mapping===tl?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),YA=this._renderer.getRenderTarget(),qA=this._renderer.getActiveCubeFace(),XA=this._renderer.getActiveMipmapLevel(),KA=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:fr,minFilter:fr,generateMipmaps:!1,type:_n,format:Ar,colorSpace:Cr,depthBuffer:!1},i=r2(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=r2(e,t,n);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=j6(s)),this._blurMaterial=W6(s,e,t)}return i}_compileMaterial(e){const t=new Wr(this._lodPlanes[0],e);this._renderer.compile(t,WA)}_sceneToCubeUV(e,t,n,i){const s=new cn(90,1,t,n),o=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],h=this._renderer,u=h.autoClear,d=h.toneMapping;h.getClearColor($E),h.toneMapping=Js,h.autoClear=!1;const A=new Es({name:"PMREM.Background",side:Pr,depthWrite:!1,depthTest:!1}),p=new Wr(new hu,A);let g=!1;const v=e.background;v?v.isColor&&(A.color.copy(v),e.background=null,g=!0):(A.color.copy($E),g=!0);for(let E=0;E<6;E++){const m=E%3;m===0?(s.up.set(0,o[E],0),s.lookAt(c[E],0,0)):m===1?(s.up.set(0,0,o[E]),s.lookAt(0,c[E],0)):(s.up.set(0,o[E],0),s.lookAt(0,0,c[E]));const _=this._cubeSize;Md(i,m*_,E>2?_:0,_,_),h.setRenderTarget(i),g&&h.render(p,s),h.render(e,s)}p.geometry.dispose(),p.material.dispose(),h.toneMapping=d,h.autoClear=u,e.background=v}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===ro||e.mapping===tl;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=i2()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=n2());const s=i?this._cubemapMaterial:this._equirectMaterial,o=new Wr(this._lodPlanes[0],s),c=s.uniforms;c.envMap.value=e;const h=this._cubeSize;Md(t,0,0,3*h,2*h),n.setRenderTarget(t),n.render(o,WA)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;i<this._lodPlanes.length;i++){const s=Math.sqrt(this._sigmas[i]*this._sigmas[i]-this._sigmas[i-1]*this._sigmas[i-1]),o=e2[(i-1)%e2.length];this._blur(e,i-1,i,s,o)}t.autoClear=n}_blur(e,t,n,i,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,n,i,"latitudinal",s),this._halfBlur(o,e,n,n,i,"longitudinal",s)}_halfBlur(e,t,n,i,s,o,c){const h=this._renderer,u=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const d=3,A=new Wr(this._lodPlanes[i],u),p=u.uniforms,g=this._sizeLods[n]-1,v=isFinite(s)?Math.PI/(2*g):2*Math.PI/(2*uo-1),E=s/v,m=isFinite(s)?1+Math.floor(d*E):uo;m>uo&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${uo}`);const _=[];let w=0;for(let T=0;T<uo;++T){const D=T/E,b=Math.exp(-D*D/2);_.push(b),T===0?w+=b:T<m&&(w+=2*b)}for(let T=0;T<_.length;T++)_[T]=_[T]/w;p.envMap.value=e.texture,p.samples.value=m,p.weights.value=_,p.latitudinal.value=o==="latitudinal",c&&(p.poleAxis.value=c);const{_lodMax:x}=this;p.dTheta.value=v,p.mipInt.value=x-n;const I=this._sizeLods[i],R=3*I*(i>x-wl?i-x+wl:0),S=4*(this._cubeSize-I);Md(t,R,S,3*I,2*I),h.setRenderTarget(t),h.render(A,WA)}}function j6(r){const e=[],t=[],n=[];let i=r;const s=r-wl+1+ZE.length;for(let o=0;o<s;o++){const c=Math.pow(2,i);t.push(c);let h=1/c;o>r-wl?h=ZE[o-r+wl-1]:o===0&&(h=0),n.push(h);const u=1/(c-2),d=-u,A=1+u,p=[d,d,A,d,A,A,d,d,A,A,d,A],g=6,v=6,E=3,m=2,_=1,w=new Float32Array(E*v*g),x=new Float32Array(m*v*g),I=new Float32Array(_*v*g);for(let S=0;S<g;S++){const T=S%3*2/3-1,D=S>2?0:-1,b=[T,D,0,T+2/3,D,0,T+2/3,D+1,0,T,D,0,T+2/3,D+1,0,T,D+1,0];w.set(b,E*v*S),x.set(p,m*v*S);const M=[S,S,S,S,S,S];I.set(M,_*v*S)}const R=new Hn;R.setAttribute("position",new Qr(w,E)),R.setAttribute("uv",new Qr(x,m)),R.setAttribute("faceIndex",new Qr(I,_)),e.push(R),i>wl&&i--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function r2(r,e,t){const n=new Mi(r,e,t);return n.texture.mapping=jh,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Md(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function W6(r,e,t){const n=new Float32Array(uo),i=new W(0,1,0);return new vn({name:"SphericalGaussianBlur",defines:{n:uo,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:JA(),fragmentShader:`
3578
3578
 
3579
3579
  precision mediump float;
3580
3580
  precision mediump int;
@@ -3801,7 +3801,7 @@ void main() {
3801
3801
  squared_mean = squared_mean / samples;
3802
3802
  float std_dev = sqrt( squared_mean - mean * mean );
3803
3803
  gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
3804
- }`;function ML(r,e,t){let n=new jA;const i=new Ge,s=new Ge,o=new Ft,c=new M2({depthPacking:ab}),h=new wL,u={},d=t.maxTextureSize,A={[vi]:Pr,[Pr]:vi,[yi]:yi},p=new vn({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ge},radius:{value:4}},vertexShader:IL,fragmentShader:CL}),g=p.clone();g.defines.HORIZONTAL_PASS=1;const v=new zn;v.setAttribute("position",new Qr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const E=new Wr(v,p),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ry;let _=this.type;this.render=function(S,T,D){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||S.length===0)return;const b=r.getRenderTarget(),M=r.getActiveCubeFace(),L=r.getActiveMipmapLevel(),P=r.state;P.setBlending(fs),P.buffers.color.setClear(1,1,1,1),P.buffers.depth.setTest(!0),P.setScissorTest(!1);const N=_!==ds&&this.type===ds,j=_===ds&&this.type!==ds;for(let X=0,K=S.length;X<K;X++){const ne=S[X],V=ne.shadow;if(V===void 0){console.warn("THREE.WebGLShadowMap:",ne,"has no shadow.");continue}if(V.autoUpdate===!1&&V.needsUpdate===!1)continue;i.copy(V.mapSize);const te=V.getFrameExtents();if(i.multiply(te),s.copy(V.mapSize),(i.x>d||i.y>d)&&(i.x>d&&(s.x=Math.floor(d/te.x),i.x=s.x*te.x,V.mapSize.x=s.x),i.y>d&&(s.y=Math.floor(d/te.y),i.y=s.y*te.y,V.mapSize.y=s.y)),V.map===null||N===!0||j===!0){const z=this.type!==ds?{minFilter:dr,magFilter:dr}:{};V.map!==null&&V.map.dispose(),V.map=new Mi(i.x,i.y,z),V.map.texture.name=ne.name+".shadowMap",V.camera.updateProjectionMatrix()}r.setRenderTarget(V.map),r.clear();const Q=V.getViewportCount();for(let z=0;z<Q;z++){const Z=V.getViewport(z);o.set(s.x*Z.x,s.y*Z.y,s.x*Z.z,s.y*Z.w),P.viewport(o),V.updateMatrices(ne,z),n=V.getFrustum(),I(T,D,V.camera,ne,this.type)}V.isPointLightShadow!==!0&&this.type===ds&&w(V,D),V.needsUpdate=!1}_=this.type,m.needsUpdate=!1,r.setRenderTarget(b,M,L)};function w(S,T){const D=e.update(E);p.defines.VSM_SAMPLES!==S.blurSamples&&(p.defines.VSM_SAMPLES=S.blurSamples,g.defines.VSM_SAMPLES=S.blurSamples,p.needsUpdate=!0,g.needsUpdate=!0),S.mapPass===null&&(S.mapPass=new Mi(i.x,i.y)),p.uniforms.shadow_pass.value=S.map.texture,p.uniforms.resolution.value=S.mapSize,p.uniforms.radius.value=S.radius,r.setRenderTarget(S.mapPass),r.clear(),r.renderBufferDirect(T,null,D,p,E,null),g.uniforms.shadow_pass.value=S.mapPass.texture,g.uniforms.resolution.value=S.mapSize,g.uniforms.radius.value=S.radius,r.setRenderTarget(S.map),r.clear(),r.renderBufferDirect(T,null,D,g,E,null)}function x(S,T,D,b){let M=null;const L=D.isPointLight===!0?S.customDistanceMaterial:S.customDepthMaterial;if(L!==void 0)M=L;else if(M=D.isPointLight===!0?h:c,r.localClippingEnabled&&T.clipShadows===!0&&Array.isArray(T.clippingPlanes)&&T.clippingPlanes.length!==0||T.displacementMap&&T.displacementScale!==0||T.alphaMap&&T.alphaTest>0||T.map&&T.alphaTest>0){const P=M.uuid,N=T.uuid;let j=u[P];j===void 0&&(j={},u[P]=j);let X=j[N];X===void 0&&(X=M.clone(),j[N]=X,T.addEventListener("dispose",R)),M=X}if(M.visible=T.visible,M.wireframe=T.wireframe,b===ds?M.side=T.shadowSide!==null?T.shadowSide:T.side:M.side=T.shadowSide!==null?T.shadowSide:A[T.side],M.alphaMap=T.alphaMap,M.alphaTest=T.alphaTest,M.map=T.map,M.clipShadows=T.clipShadows,M.clippingPlanes=T.clippingPlanes,M.clipIntersection=T.clipIntersection,M.displacementMap=T.displacementMap,M.displacementScale=T.displacementScale,M.displacementBias=T.displacementBias,M.wireframeLinewidth=T.wireframeLinewidth,M.linewidth=T.linewidth,D.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const P=r.properties.get(M);P.light=D}return M}function I(S,T,D,b,M){if(S.visible===!1)return;if(S.layers.test(T.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&M===ds)&&(!S.frustumCulled||n.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,S.matrixWorld);const P=e.update(S),N=S.material;if(Array.isArray(N)){const j=P.groups;for(let X=0,K=j.length;X<K;X++){const ne=j[X],V=N[ne.materialIndex];if(V&&V.visible){const te=x(S,V,b,M);S.onBeforeShadow(r,S,T,D,P,te,ne),r.renderBufferDirect(D,null,P,te,S,ne),S.onAfterShadow(r,S,T,D,P,te,ne)}}}else if(N.visible){const j=x(S,N,b,M);S.onBeforeShadow(r,S,T,D,P,j,null),r.renderBufferDirect(D,null,P,j,S,null),S.onAfterShadow(r,S,T,D,P,j,null)}}const L=S.children;for(let P=0,N=L.length;P<N;P++)I(L[P],T,D,b,M)}function R(S){S.target.removeEventListener("dispose",R);for(const T in u){const D=u[T],b=S.target.uuid;b in D&&(D[b].dispose(),delete D[b])}}}function SL(r){function e(){let O=!1;const me=new Ft;let _e=null;const Fe=new Ft(0,0,0,0);return{setMask:function(De){_e!==De&&!O&&(r.colorMask(De,De,De,De),_e=De)},setLocked:function(De){O=De},setClear:function(De,pt,Dt,Lt,St){St===!0&&(De*=Lt,pt*=Lt,Dt*=Lt),me.set(De,pt,Dt,Lt),Fe.equals(me)===!1&&(r.clearColor(De,pt,Dt,Lt),Fe.copy(me))},reset:function(){O=!1,_e=null,Fe.set(-1,0,0,0)}}}function t(){let O=!1,me=null,_e=null,Fe=null;return{setTest:function(De){De?Ae(r.DEPTH_TEST):ve(r.DEPTH_TEST)},setMask:function(De){me!==De&&!O&&(r.depthMask(De),me=De)},setFunc:function(De){if(_e!==De){switch(De){case OB:r.depthFunc(r.NEVER);break;case FB:r.depthFunc(r.ALWAYS);break;case zB:r.depthFunc(r.LESS);break;case Vh:r.depthFunc(r.LEQUAL);break;case HB:r.depthFunc(r.EQUAL);break;case GB:r.depthFunc(r.GEQUAL);break;case VB:r.depthFunc(r.GREATER);break;case jB:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}_e=De}},setLocked:function(De){O=De},setClear:function(De){Fe!==De&&(r.clearDepth(De),Fe=De)},reset:function(){O=!1,me=null,_e=null,Fe=null}}}function n(){let O=!1,me=null,_e=null,Fe=null,De=null,pt=null,Dt=null,Lt=null,St=null;return{setTest:function(At){O||(At?Ae(r.STENCIL_TEST):ve(r.STENCIL_TEST))},setMask:function(At){me!==At&&!O&&(r.stencilMask(At),me=At)},setFunc:function(At,ur,Vt){(_e!==At||Fe!==ur||De!==Vt)&&(r.stencilFunc(At,ur,Vt),_e=At,Fe=ur,De=Vt)},setOp:function(At,ur,Vt){(pt!==At||Dt!==ur||Lt!==Vt)&&(r.stencilOp(At,ur,Vt),pt=At,Dt=ur,Lt=Vt)},setLocked:function(At){O=At},setClear:function(At){St!==At&&(r.clearStencil(At),St=At)},reset:function(){O=!1,me=null,_e=null,Fe=null,De=null,pt=null,Dt=null,Lt=null,St=null}}}const i=new e,s=new t,o=new n,c=new WeakMap,h=new WeakMap;let u={},d={},A=new WeakMap,p=[],g=null,v=!1,E=null,m=null,_=null,w=null,x=null,I=null,R=null,S=new qe(0,0,0),T=0,D=!1,b=null,M=null,L=null,P=null,N=null;const j=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let X=!1,K=0;const ne=r.getParameter(r.VERSION);ne.indexOf("WebGL")!==-1?(K=parseFloat(/^WebGL (\d)/.exec(ne)[1]),X=K>=1):ne.indexOf("OpenGL ES")!==-1&&(K=parseFloat(/^OpenGL ES (\d)/.exec(ne)[1]),X=K>=2);let V=null,te={};const Q=r.getParameter(r.SCISSOR_BOX),z=r.getParameter(r.VIEWPORT),Z=new Ft().fromArray(Q),re=new Ft().fromArray(z);function H(O,me,_e,Fe){const De=new Uint8Array(4),pt=r.createTexture();r.bindTexture(O,pt),r.texParameteri(O,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(O,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let Dt=0;Dt<_e;Dt++)O===r.TEXTURE_3D||O===r.TEXTURE_2D_ARRAY?r.texImage3D(me,0,r.RGBA,1,1,Fe,0,r.RGBA,r.UNSIGNED_BYTE,De):r.texImage2D(me+Dt,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,De);return pt}const fe={};fe[r.TEXTURE_2D]=H(r.TEXTURE_2D,r.TEXTURE_2D,1),fe[r.TEXTURE_CUBE_MAP]=H(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),fe[r.TEXTURE_2D_ARRAY]=H(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),fe[r.TEXTURE_3D]=H(r.TEXTURE_3D,r.TEXTURE_3D,1,1),i.setClear(0,0,0,1),s.setClear(1),o.setClear(0),Ae(r.DEPTH_TEST),s.setFunc(Vh),Ye(!1),ct(by),Ae(r.CULL_FACE),Pe(fs);function Ae(O){u[O]!==!0&&(r.enable(O),u[O]=!0)}function ve(O){u[O]!==!1&&(r.disable(O),u[O]=!1)}function ye(O,me){return d[O]!==me?(r.bindFramebuffer(O,me),d[O]=me,O===r.DRAW_FRAMEBUFFER&&(d[r.FRAMEBUFFER]=me),O===r.FRAMEBUFFER&&(d[r.DRAW_FRAMEBUFFER]=me),!0):!1}function Oe(O,me){let _e=p,Fe=!1;if(O){_e=A.get(me),_e===void 0&&(_e=[],A.set(me,_e));const De=O.textures;if(_e.length!==De.length||_e[0]!==r.COLOR_ATTACHMENT0){for(let pt=0,Dt=De.length;pt<Dt;pt++)_e[pt]=r.COLOR_ATTACHMENT0+pt;_e.length=De.length,Fe=!0}}else _e[0]!==r.BACK&&(_e[0]=r.BACK,Fe=!0);Fe&&r.drawBuffers(_e)}function it(O){return g!==O?(r.useProgram(O),g=O,!0):!1}const ae={[to]:r.FUNC_ADD,[xB]:r.FUNC_SUBTRACT,[wB]:r.FUNC_REVERSE_SUBTRACT};ae[IB]=r.MIN,ae[CB]=r.MAX;const rt={[MB]:r.ZERO,[SB]:r.ONE,[TB]:r.SRC_COLOR,[aA]:r.SRC_ALPHA,[NB]:r.SRC_ALPHA_SATURATE,[DB]:r.DST_COLOR,[bB]:r.DST_ALPHA,[BB]:r.ONE_MINUS_SRC_COLOR,[oA]:r.ONE_MINUS_SRC_ALPHA,[LB]:r.ONE_MINUS_DST_COLOR,[RB]:r.ONE_MINUS_DST_ALPHA,[UB]:r.CONSTANT_COLOR,[PB]:r.ONE_MINUS_CONSTANT_COLOR,[kB]:r.CONSTANT_ALPHA,[QB]:r.ONE_MINUS_CONSTANT_ALPHA};function Pe(O,me,_e,Fe,De,pt,Dt,Lt,St,At){if(O===fs){v===!0&&(ve(r.BLEND),v=!1);return}if(v===!1&&(Ae(r.BLEND),v=!0),O!==EB){if(O!==E||At!==D){if((m!==to||x!==to)&&(r.blendEquation(r.FUNC_ADD),m=to,x=to),At)switch(O){case el:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Dy:r.blendFunc(r.ONE,r.ONE);break;case Ly:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Ny:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",O);break}else switch(O){case el:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Dy:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case Ly:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Ny:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",O);break}_=null,w=null,I=null,R=null,S.set(0,0,0),T=0,E=O,D=At}return}De=De||me,pt=pt||_e,Dt=Dt||Fe,(me!==m||De!==x)&&(r.blendEquationSeparate(ae[me],ae[De]),m=me,x=De),(_e!==_||Fe!==w||pt!==I||Dt!==R)&&(r.blendFuncSeparate(rt[_e],rt[Fe],rt[pt],rt[Dt]),_=_e,w=Fe,I=pt,R=Dt),(Lt.equals(S)===!1||St!==T)&&(r.blendColor(Lt.r,Lt.g,Lt.b,St),S.copy(Lt),T=St),E=O,D=!1}function lt(O,me){O.side===yi?ve(r.CULL_FACE):Ae(r.CULL_FACE);let _e=O.side===Pr;me&&(_e=!_e),Ye(_e),O.blending===el&&O.transparent===!1?Pe(fs):Pe(O.blending,O.blendEquation,O.blendSrc,O.blendDst,O.blendEquationAlpha,O.blendSrcAlpha,O.blendDstAlpha,O.blendColor,O.blendAlpha,O.premultipliedAlpha),s.setFunc(O.depthFunc),s.setTest(O.depthTest),s.setMask(O.depthWrite),i.setMask(O.colorWrite);const Fe=O.stencilWrite;o.setTest(Fe),Fe&&(o.setMask(O.stencilWriteMask),o.setFunc(O.stencilFunc,O.stencilRef,O.stencilFuncMask),o.setOp(O.stencilFail,O.stencilZFail,O.stencilZPass)),k(O.polygonOffset,O.polygonOffsetFactor,O.polygonOffsetUnits),O.alphaToCoverage===!0?Ae(r.SAMPLE_ALPHA_TO_COVERAGE):ve(r.SAMPLE_ALPHA_TO_COVERAGE)}function Ye(O){b!==O&&(O?r.frontFace(r.CW):r.frontFace(r.CCW),b=O)}function ct(O){O!==_B?(Ae(r.CULL_FACE),O!==M&&(O===by?r.cullFace(r.BACK):O===vB?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):ve(r.CULL_FACE),M=O}function Y(O){O!==L&&(X&&r.lineWidth(O),L=O)}function k(O,me,_e){O?(Ae(r.POLYGON_OFFSET_FILL),(P!==me||N!==_e)&&(r.polygonOffset(me,_e),P=me,N=_e)):ve(r.POLYGON_OFFSET_FILL)}function ee(O){O?Ae(r.SCISSOR_TEST):ve(r.SCISSOR_TEST)}function ue(O){O===void 0&&(O=r.TEXTURE0+j-1),V!==O&&(r.activeTexture(O),V=O)}function pe(O,me,_e){_e===void 0&&(V===null?_e=r.TEXTURE0+j-1:_e=V);let Fe=te[_e];Fe===void 0&&(Fe={type:void 0,texture:void 0},te[_e]=Fe),(Fe.type!==O||Fe.texture!==me)&&(V!==_e&&(r.activeTexture(_e),V=_e),r.bindTexture(O,me||fe[O]),Fe.type=O,Fe.texture=me)}function ge(){const O=te[V];O!==void 0&&O.type!==void 0&&(r.bindTexture(O.type,null),O.type=void 0,O.texture=void 0)}function Ue(){try{r.compressedTexImage2D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function Ee(){try{r.compressedTexImage3D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function Qe(){try{r.texSubImage2D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function He(){try{r.texSubImage3D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function Ce(){try{r.compressedTexSubImage2D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function Se(){try{r.compressedTexSubImage3D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function Ze(){try{r.texStorage2D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function Ne(){try{r.texStorage3D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function Re(){try{r.texImage2D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function at(){try{r.texImage3D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function ft(O){Z.equals(O)===!1&&(r.scissor(O.x,O.y,O.z,O.w),Z.copy(O))}function yt(O){re.equals(O)===!1&&(r.viewport(O.x,O.y,O.z,O.w),re.copy(O))}function _t(O,me){let _e=h.get(me);_e===void 0&&(_e=new WeakMap,h.set(me,_e));let Fe=_e.get(O);Fe===void 0&&(Fe=r.getUniformBlockIndex(me,O.name),_e.set(O,Fe))}function Et(O,me){const _e=h.get(me).get(O);c.get(me)!==_e&&(r.uniformBlockBinding(me,_e,O.__bindingPointIndex),c.set(me,_e))}function G(){r.disable(r.BLEND),r.disable(r.CULL_FACE),r.disable(r.DEPTH_TEST),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SCISSOR_TEST),r.disable(r.STENCIL_TEST),r.disable(r.SAMPLE_ALPHA_TO_COVERAGE),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ZERO),r.blendFuncSeparate(r.ONE,r.ZERO,r.ONE,r.ZERO),r.blendColor(0,0,0,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(r.LESS),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(r.ALWAYS,0,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.clearStencil(0),r.cullFace(r.BACK),r.frontFace(r.CCW),r.polygonOffset(0,0),r.activeTexture(r.TEXTURE0),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(r.READ_FRAMEBUFFER,null),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),u={},V=null,te={},d={},A=new WeakMap,p=[],g=null,v=!1,E=null,m=null,_=null,w=null,x=null,I=null,R=null,S=new qe(0,0,0),T=0,D=!1,b=null,M=null,L=null,P=null,N=null,Z.set(0,0,r.canvas.width,r.canvas.height),re.set(0,0,r.canvas.width,r.canvas.height),i.reset(),s.reset(),o.reset()}return{buffers:{color:i,depth:s,stencil:o},enable:Ae,disable:ve,bindFramebuffer:ye,drawBuffers:Oe,useProgram:it,setBlending:Pe,setMaterial:lt,setFlipSided:Ye,setCullFace:ct,setLineWidth:Y,setPolygonOffset:k,setScissorTest:ee,activeTexture:ue,bindTexture:pe,unbindTexture:ge,compressedTexImage2D:Ue,compressedTexImage3D:Ee,texImage2D:Re,texImage3D:at,updateUBOMapping:_t,uniformBlockBinding:Et,texStorage2D:Ze,texStorage3D:Ne,texSubImage2D:Qe,texSubImage3D:He,compressedTexSubImage2D:Ce,compressedTexSubImage3D:Se,scissor:ft,viewport:yt,reset:G}}function TL(r,e,t,n,i,s,o){const c=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,h=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),u=new Ge,d=new WeakMap;let A;const p=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function v(Y,k){return g?new OffscreenCanvas(Y,k):su("canvas")}function E(Y,k,ee){let ue=1;const pe=ct(Y);if((pe.width>ee||pe.height>ee)&&(ue=ee/Math.max(pe.width,pe.height)),ue<1)if(typeof HTMLImageElement<"u"&&Y instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&Y instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&Y instanceof ImageBitmap||typeof VideoFrame<"u"&&Y instanceof VideoFrame){const ge=Math.floor(ue*pe.width),Ue=Math.floor(ue*pe.height);A===void 0&&(A=v(ge,Ue));const Ee=k?v(ge,Ue):A;return Ee.width=ge,Ee.height=Ue,Ee.getContext("2d").drawImage(Y,0,0,ge,Ue),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+pe.width+"x"+pe.height+") to ("+ge+"x"+Ue+")."),Ee}else return"data"in Y&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+pe.width+"x"+pe.height+")."),Y;return Y}function m(Y){return Y.generateMipmaps&&Y.minFilter!==dr&&Y.minFilter!==fr}function _(Y){r.generateMipmap(Y)}function w(Y,k,ee,ue,pe=!1){if(Y!==null){if(r[Y]!==void 0)return r[Y];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+Y+"'")}let ge=k;if(k===r.RED&&(ee===r.FLOAT&&(ge=r.R32F),ee===r.HALF_FLOAT&&(ge=r.R16F),ee===r.UNSIGNED_BYTE&&(ge=r.R8)),k===r.RED_INTEGER&&(ee===r.UNSIGNED_BYTE&&(ge=r.R8UI),ee===r.UNSIGNED_SHORT&&(ge=r.R16UI),ee===r.UNSIGNED_INT&&(ge=r.R32UI),ee===r.BYTE&&(ge=r.R8I),ee===r.SHORT&&(ge=r.R16I),ee===r.INT&&(ge=r.R32I)),k===r.RG&&(ee===r.FLOAT&&(ge=r.RG32F),ee===r.HALF_FLOAT&&(ge=r.RG16F),ee===r.UNSIGNED_BYTE&&(ge=r.RG8)),k===r.RG_INTEGER&&(ee===r.UNSIGNED_BYTE&&(ge=r.RG8UI),ee===r.UNSIGNED_SHORT&&(ge=r.RG16UI),ee===r.UNSIGNED_INT&&(ge=r.RG32UI),ee===r.BYTE&&(ge=r.RG8I),ee===r.SHORT&&(ge=r.RG16I),ee===r.INT&&(ge=r.RG32I)),k===r.RGB&&ee===r.UNSIGNED_INT_5_9_9_9_REV&&(ge=r.RGB9_E5),k===r.RGBA){const Ue=pe?ed:Rt.getTransfer(ue);ee===r.FLOAT&&(ge=r.RGBA32F),ee===r.HALF_FLOAT&&(ge=r.RGBA16F),ee===r.UNSIGNED_BYTE&&(ge=Ue===Ht?r.SRGB8_ALPHA8:r.RGBA8),ee===r.UNSIGNED_SHORT_4_4_4_4&&(ge=r.RGBA4),ee===r.UNSIGNED_SHORT_5_5_5_1&&(ge=r.RGB5_A1)}return(ge===r.R16F||ge===r.R32F||ge===r.RG16F||ge===r.RG32F||ge===r.RGBA16F||ge===r.RGBA32F)&&e.get("EXT_color_buffer_float"),ge}function x(Y,k){return m(Y)===!0||Y.isFramebufferTexture&&Y.minFilter!==dr&&Y.minFilter!==fr?Math.log2(Math.max(k.width,k.height))+1:Y.mipmaps!==void 0&&Y.mipmaps.length>0?Y.mipmaps.length:Y.isCompressedTexture&&Array.isArray(Y.image)?k.mipmaps.length:1}function I(Y){const k=Y.target;k.removeEventListener("dispose",I),S(k),k.isVideoTexture&&d.delete(k)}function R(Y){const k=Y.target;k.removeEventListener("dispose",R),D(k)}function S(Y){const k=n.get(Y);if(k.__webglInit===void 0)return;const ee=Y.source,ue=p.get(ee);if(ue){const pe=ue[k.__cacheKey];pe.usedTimes--,pe.usedTimes===0&&T(Y),Object.keys(ue).length===0&&p.delete(ee)}n.remove(Y)}function T(Y){const k=n.get(Y);r.deleteTexture(k.__webglTexture);const ee=Y.source,ue=p.get(ee);delete ue[k.__cacheKey],o.memory.textures--}function D(Y){const k=n.get(Y);if(Y.depthTexture&&Y.depthTexture.dispose(),Y.isWebGLCubeRenderTarget)for(let ue=0;ue<6;ue++){if(Array.isArray(k.__webglFramebuffer[ue]))for(let pe=0;pe<k.__webglFramebuffer[ue].length;pe++)r.deleteFramebuffer(k.__webglFramebuffer[ue][pe]);else r.deleteFramebuffer(k.__webglFramebuffer[ue]);k.__webglDepthbuffer&&r.deleteRenderbuffer(k.__webglDepthbuffer[ue])}else{if(Array.isArray(k.__webglFramebuffer))for(let ue=0;ue<k.__webglFramebuffer.length;ue++)r.deleteFramebuffer(k.__webglFramebuffer[ue]);else r.deleteFramebuffer(k.__webglFramebuffer);if(k.__webglDepthbuffer&&r.deleteRenderbuffer(k.__webglDepthbuffer),k.__webglMultisampledFramebuffer&&r.deleteFramebuffer(k.__webglMultisampledFramebuffer),k.__webglColorRenderbuffer)for(let ue=0;ue<k.__webglColorRenderbuffer.length;ue++)k.__webglColorRenderbuffer[ue]&&r.deleteRenderbuffer(k.__webglColorRenderbuffer[ue]);k.__webglDepthRenderbuffer&&r.deleteRenderbuffer(k.__webglDepthRenderbuffer)}const ee=Y.textures;for(let ue=0,pe=ee.length;ue<pe;ue++){const ge=n.get(ee[ue]);ge.__webglTexture&&(r.deleteTexture(ge.__webglTexture),o.memory.textures--),n.remove(ee[ue])}n.remove(Y)}let b=0;function M(){b=0}function L(){const Y=b;return Y>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+Y+" texture units while this GPU supports only "+i.maxTextures),b+=1,Y}function P(Y){const k=[];return k.push(Y.wrapS),k.push(Y.wrapT),k.push(Y.wrapR||0),k.push(Y.magFilter),k.push(Y.minFilter),k.push(Y.anisotropy),k.push(Y.internalFormat),k.push(Y.format),k.push(Y.type),k.push(Y.generateMipmaps),k.push(Y.premultiplyAlpha),k.push(Y.flipY),k.push(Y.unpackAlignment),k.push(Y.colorSpace),k.join()}function N(Y,k){const ee=n.get(Y);if(Y.isVideoTexture&&lt(Y),Y.isRenderTargetTexture===!1&&Y.version>0&&ee.__version!==Y.version){const ue=Y.image;if(ue===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ue.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Z(ee,Y,k);return}}t.bindTexture(r.TEXTURE_2D,ee.__webglTexture,r.TEXTURE0+k)}function j(Y,k){const ee=n.get(Y);if(Y.version>0&&ee.__version!==Y.version){Z(ee,Y,k);return}t.bindTexture(r.TEXTURE_2D_ARRAY,ee.__webglTexture,r.TEXTURE0+k)}function X(Y,k){const ee=n.get(Y);if(Y.version>0&&ee.__version!==Y.version){Z(ee,Y,k);return}t.bindTexture(r.TEXTURE_3D,ee.__webglTexture,r.TEXTURE0+k)}function K(Y,k){const ee=n.get(Y);if(Y.version>0&&ee.__version!==Y.version){re(ee,Y,k);return}t.bindTexture(r.TEXTURE_CUBE_MAP,ee.__webglTexture,r.TEXTURE0+k)}const ne={[Zs]:r.REPEAT,[Ei]:r.CLAMP_TO_EDGE,[Wh]:r.MIRRORED_REPEAT},V={[dr]:r.NEAREST,[Gy]:r.NEAREST_MIPMAP_NEAREST,[Kc]:r.NEAREST_MIPMAP_LINEAR,[fr]:r.LINEAR,[Yh]:r.LINEAR_MIPMAP_NEAREST,[xi]:r.LINEAR_MIPMAP_LINEAR},te={[lb]:r.NEVER,[pb]:r.ALWAYS,[cb]:r.LESS,[_E]:r.LEQUAL,[ub]:r.EQUAL,[fb]:r.GEQUAL,[hb]:r.GREATER,[db]:r.NOTEQUAL};function Q(Y,k){if(k.type===or&&e.has("OES_texture_float_linear")===!1&&(k.magFilter===fr||k.magFilter===Yh||k.magFilter===Kc||k.magFilter===xi||k.minFilter===fr||k.minFilter===Yh||k.minFilter===Kc||k.minFilter===xi)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(Y,r.TEXTURE_WRAP_S,ne[k.wrapS]),r.texParameteri(Y,r.TEXTURE_WRAP_T,ne[k.wrapT]),(Y===r.TEXTURE_3D||Y===r.TEXTURE_2D_ARRAY)&&r.texParameteri(Y,r.TEXTURE_WRAP_R,ne[k.wrapR]),r.texParameteri(Y,r.TEXTURE_MAG_FILTER,V[k.magFilter]),r.texParameteri(Y,r.TEXTURE_MIN_FILTER,V[k.minFilter]),k.compareFunction&&(r.texParameteri(Y,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(Y,r.TEXTURE_COMPARE_FUNC,te[k.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(k.magFilter===dr||k.minFilter!==Kc&&k.minFilter!==xi||k.type===or&&e.has("OES_texture_float_linear")===!1)return;if(k.anisotropy>1||n.get(k).__currentAnisotropy){const ee=e.get("EXT_texture_filter_anisotropic");r.texParameterf(Y,ee.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(k.anisotropy,i.getMaxAnisotropy())),n.get(k).__currentAnisotropy=k.anisotropy}}}function z(Y,k){let ee=!1;Y.__webglInit===void 0&&(Y.__webglInit=!0,k.addEventListener("dispose",I));const ue=k.source;let pe=p.get(ue);pe===void 0&&(pe={},p.set(ue,pe));const ge=P(k);if(ge!==Y.__cacheKey){pe[ge]===void 0&&(pe[ge]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,ee=!0),pe[ge].usedTimes++;const Ue=pe[Y.__cacheKey];Ue!==void 0&&(pe[Y.__cacheKey].usedTimes--,Ue.usedTimes===0&&T(k)),Y.__cacheKey=ge,Y.__webglTexture=pe[ge].texture}return ee}function Z(Y,k,ee){let ue=r.TEXTURE_2D;(k.isDataArrayTexture||k.isCompressedArrayTexture)&&(ue=r.TEXTURE_2D_ARRAY),k.isData3DTexture&&(ue=r.TEXTURE_3D);const pe=z(Y,k),ge=k.source;t.bindTexture(ue,Y.__webglTexture,r.TEXTURE0+ee);const Ue=n.get(ge);if(ge.version!==Ue.__version||pe===!0){t.activeTexture(r.TEXTURE0+ee);const Ee=Rt.getPrimaries(Rt.workingColorSpace),Qe=k.colorSpace===ps?null:Rt.getPrimaries(k.colorSpace),He=k.colorSpace===ps||Ee===Qe?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,k.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,k.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,k.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,He);let Ce=E(k.image,!1,i.maxTextureSize);Ce=Ye(k,Ce);const Se=s.convert(k.format,k.colorSpace),Ze=s.convert(k.type);let Ne=w(k.internalFormat,Se,Ze,k.colorSpace,k.isVideoTexture);Q(ue,k);let Re;const at=k.mipmaps,ft=k.isVideoTexture!==!0&&Ne!==mA,yt=Ue.__version===void 0||pe===!0,_t=ge.dataReady,Et=x(k,Ce);if(k.isDepthTexture)Ne=r.DEPTH_COMPONENT16,k.type===or?Ne=r.DEPTH_COMPONENT32F:k.type===wi?Ne=r.DEPTH_COMPONENT24:k.type===Zc&&(Ne=r.DEPTH24_STENCIL8),yt&&(ft?t.texStorage2D(r.TEXTURE_2D,1,Ne,Ce.width,Ce.height):t.texImage2D(r.TEXTURE_2D,0,Ne,Ce.width,Ce.height,0,Se,Ze,null));else if(k.isDataTexture)if(at.length>0){ft&&yt&&t.texStorage2D(r.TEXTURE_2D,Et,Ne,at[0].width,at[0].height);for(let G=0,O=at.length;G<O;G++)Re=at[G],ft?_t&&t.texSubImage2D(r.TEXTURE_2D,G,0,0,Re.width,Re.height,Se,Ze,Re.data):t.texImage2D(r.TEXTURE_2D,G,Ne,Re.width,Re.height,0,Se,Ze,Re.data);k.generateMipmaps=!1}else ft?(yt&&t.texStorage2D(r.TEXTURE_2D,Et,Ne,Ce.width,Ce.height),_t&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,Ce.width,Ce.height,Se,Ze,Ce.data)):t.texImage2D(r.TEXTURE_2D,0,Ne,Ce.width,Ce.height,0,Se,Ze,Ce.data);else if(k.isCompressedTexture)if(k.isCompressedArrayTexture){ft&&yt&&t.texStorage3D(r.TEXTURE_2D_ARRAY,Et,Ne,at[0].width,at[0].height,Ce.depth);for(let G=0,O=at.length;G<O;G++)Re=at[G],k.format!==Ar?Se!==null?ft?_t&&t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,G,0,0,0,Re.width,Re.height,Ce.depth,Se,Re.data,0,0):t.compressedTexImage3D(r.TEXTURE_2D_ARRAY,G,Ne,Re.width,Re.height,Ce.depth,0,Re.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ft?_t&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,G,0,0,0,Re.width,Re.height,Ce.depth,Se,Ze,Re.data):t.texImage3D(r.TEXTURE_2D_ARRAY,G,Ne,Re.width,Re.height,Ce.depth,0,Se,Ze,Re.data)}else{ft&&yt&&t.texStorage2D(r.TEXTURE_2D,Et,Ne,at[0].width,at[0].height);for(let G=0,O=at.length;G<O;G++)Re=at[G],k.format!==Ar?Se!==null?ft?_t&&t.compressedTexSubImage2D(r.TEXTURE_2D,G,0,0,Re.width,Re.height,Se,Re.data):t.compressedTexImage2D(r.TEXTURE_2D,G,Ne,Re.width,Re.height,0,Re.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ft?_t&&t.texSubImage2D(r.TEXTURE_2D,G,0,0,Re.width,Re.height,Se,Ze,Re.data):t.texImage2D(r.TEXTURE_2D,G,Ne,Re.width,Re.height,0,Se,Ze,Re.data)}else if(k.isDataArrayTexture)ft?(yt&&t.texStorage3D(r.TEXTURE_2D_ARRAY,Et,Ne,Ce.width,Ce.height,Ce.depth),_t&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,Ce.width,Ce.height,Ce.depth,Se,Ze,Ce.data)):t.texImage3D(r.TEXTURE_2D_ARRAY,0,Ne,Ce.width,Ce.height,Ce.depth,0,Se,Ze,Ce.data);else if(k.isData3DTexture)ft?(yt&&t.texStorage3D(r.TEXTURE_3D,Et,Ne,Ce.width,Ce.height,Ce.depth),_t&&t.texSubImage3D(r.TEXTURE_3D,0,0,0,0,Ce.width,Ce.height,Ce.depth,Se,Ze,Ce.data)):t.texImage3D(r.TEXTURE_3D,0,Ne,Ce.width,Ce.height,Ce.depth,0,Se,Ze,Ce.data);else if(k.isFramebufferTexture){if(yt)if(ft)t.texStorage2D(r.TEXTURE_2D,Et,Ne,Ce.width,Ce.height);else{let G=Ce.width,O=Ce.height;for(let me=0;me<Et;me++)t.texImage2D(r.TEXTURE_2D,me,Ne,G,O,0,Se,Ze,null),G>>=1,O>>=1}}else if(at.length>0){if(ft&&yt){const G=ct(at[0]);t.texStorage2D(r.TEXTURE_2D,Et,Ne,G.width,G.height)}for(let G=0,O=at.length;G<O;G++)Re=at[G],ft?_t&&t.texSubImage2D(r.TEXTURE_2D,G,0,0,Se,Ze,Re):t.texImage2D(r.TEXTURE_2D,G,Ne,Se,Ze,Re);k.generateMipmaps=!1}else if(ft){if(yt){const G=ct(Ce);t.texStorage2D(r.TEXTURE_2D,Et,Ne,G.width,G.height)}_t&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,Se,Ze,Ce)}else t.texImage2D(r.TEXTURE_2D,0,Ne,Se,Ze,Ce);m(k)&&_(ue),Ue.__version=ge.version,k.onUpdate&&k.onUpdate(k)}Y.__version=k.version}function re(Y,k,ee){if(k.image.length!==6)return;const ue=z(Y,k),pe=k.source;t.bindTexture(r.TEXTURE_CUBE_MAP,Y.__webglTexture,r.TEXTURE0+ee);const ge=n.get(pe);if(pe.version!==ge.__version||ue===!0){t.activeTexture(r.TEXTURE0+ee);const Ue=Rt.getPrimaries(Rt.workingColorSpace),Ee=k.colorSpace===ps?null:Rt.getPrimaries(k.colorSpace),Qe=k.colorSpace===ps||Ue===Ee?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,k.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,k.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,k.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Qe);const He=k.isCompressedTexture||k.image[0].isCompressedTexture,Ce=k.image[0]&&k.image[0].isDataTexture,Se=[];for(let O=0;O<6;O++)!He&&!Ce?Se[O]=E(k.image[O],!0,i.maxCubemapSize):Se[O]=Ce?k.image[O].image:k.image[O],Se[O]=Ye(k,Se[O]);const Ze=Se[0],Ne=s.convert(k.format,k.colorSpace),Re=s.convert(k.type),at=w(k.internalFormat,Ne,Re,k.colorSpace),ft=k.isVideoTexture!==!0,yt=ge.__version===void 0||ue===!0,_t=pe.dataReady;let Et=x(k,Ze);Q(r.TEXTURE_CUBE_MAP,k);let G;if(He){ft&&yt&&t.texStorage2D(r.TEXTURE_CUBE_MAP,Et,at,Ze.width,Ze.height);for(let O=0;O<6;O++){G=Se[O].mipmaps;for(let me=0;me<G.length;me++){const _e=G[me];k.format!==Ar?Ne!==null?ft?_t&&t.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,me,0,0,_e.width,_e.height,Ne,_e.data):t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,me,at,_e.width,_e.height,0,_e.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):ft?_t&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,me,0,0,_e.width,_e.height,Ne,Re,_e.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,me,at,_e.width,_e.height,0,Ne,Re,_e.data)}}}else{if(G=k.mipmaps,ft&&yt){G.length>0&&Et++;const O=ct(Se[0]);t.texStorage2D(r.TEXTURE_CUBE_MAP,Et,at,O.width,O.height)}for(let O=0;O<6;O++)if(Ce){ft?_t&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,0,0,0,Se[O].width,Se[O].height,Ne,Re,Se[O].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,0,at,Se[O].width,Se[O].height,0,Ne,Re,Se[O].data);for(let me=0;me<G.length;me++){const _e=G[me].image[O].image;ft?_t&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,me+1,0,0,_e.width,_e.height,Ne,Re,_e.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,me+1,at,_e.width,_e.height,0,Ne,Re,_e.data)}}else{ft?_t&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,0,0,0,Ne,Re,Se[O]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,0,at,Ne,Re,Se[O]);for(let me=0;me<G.length;me++){const _e=G[me];ft?_t&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,me+1,0,0,Ne,Re,_e.image[O]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,me+1,at,Ne,Re,_e.image[O])}}}m(k)&&_(r.TEXTURE_CUBE_MAP),ge.__version=pe.version,k.onUpdate&&k.onUpdate(k)}Y.__version=k.version}function H(Y,k,ee,ue,pe,ge){const Ue=s.convert(ee.format,ee.colorSpace),Ee=s.convert(ee.type),Qe=w(ee.internalFormat,Ue,Ee,ee.colorSpace);if(!n.get(k).__hasExternalTextures){const He=Math.max(1,k.width>>ge),Ce=Math.max(1,k.height>>ge);pe===r.TEXTURE_3D||pe===r.TEXTURE_2D_ARRAY?t.texImage3D(pe,ge,Qe,He,Ce,k.depth,0,Ue,Ee,null):t.texImage2D(pe,ge,Qe,He,Ce,0,Ue,Ee,null)}t.bindFramebuffer(r.FRAMEBUFFER,Y),Pe(k)?c.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,ue,pe,n.get(ee).__webglTexture,0,rt(k)):(pe===r.TEXTURE_2D||pe>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&pe<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,ue,pe,n.get(ee).__webglTexture,ge),t.bindFramebuffer(r.FRAMEBUFFER,null)}function fe(Y,k,ee){if(r.bindRenderbuffer(r.RENDERBUFFER,Y),k.depthBuffer&&!k.stencilBuffer){let ue=r.DEPTH_COMPONENT24;if(ee||Pe(k)){const pe=k.depthTexture;pe&&pe.isDepthTexture&&(pe.type===or?ue=r.DEPTH_COMPONENT32F:pe.type===wi&&(ue=r.DEPTH_COMPONENT24));const ge=rt(k);Pe(k)?c.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,ge,ue,k.width,k.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,ge,ue,k.width,k.height)}else r.renderbufferStorage(r.RENDERBUFFER,ue,k.width,k.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,Y)}else if(k.depthBuffer&&k.stencilBuffer){const ue=rt(k);ee&&Pe(k)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,ue,r.DEPTH24_STENCIL8,k.width,k.height):Pe(k)?c.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,ue,r.DEPTH24_STENCIL8,k.width,k.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,k.width,k.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,Y)}else{const ue=k.textures;for(let pe=0;pe<ue.length;pe++){const ge=ue[pe],Ue=s.convert(ge.format,ge.colorSpace),Ee=s.convert(ge.type),Qe=w(ge.internalFormat,Ue,Ee,ge.colorSpace),He=rt(k);ee&&Pe(k)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,He,Qe,k.width,k.height):Pe(k)?c.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,He,Qe,k.width,k.height):r.renderbufferStorage(r.RENDERBUFFER,Qe,k.width,k.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function Ae(Y,k){if(k&&k.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(r.FRAMEBUFFER,Y),!(k.depthTexture&&k.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(k.depthTexture).__webglTexture||k.depthTexture.image.width!==k.width||k.depthTexture.image.height!==k.height)&&(k.depthTexture.image.width=k.width,k.depthTexture.image.height=k.height,k.depthTexture.needsUpdate=!0),N(k.depthTexture,0);const ee=n.get(k.depthTexture).__webglTexture,ue=rt(k);if(k.depthTexture.format===rl)Pe(k)?c.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,ee,0,ue):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,ee,0);else if(k.depthTexture.format===$c)Pe(k)?c.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,ee,0,ue):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,ee,0);else throw new Error("Unknown depthTexture format")}function ve(Y){const k=n.get(Y),ee=Y.isWebGLCubeRenderTarget===!0;if(Y.depthTexture&&!k.__autoAllocateDepthBuffer){if(ee)throw new Error("target.depthTexture not supported in Cube render targets");Ae(k.__webglFramebuffer,Y)}else if(ee){k.__webglDepthbuffer=[];for(let ue=0;ue<6;ue++)t.bindFramebuffer(r.FRAMEBUFFER,k.__webglFramebuffer[ue]),k.__webglDepthbuffer[ue]=r.createRenderbuffer(),fe(k.__webglDepthbuffer[ue],Y,!1)}else t.bindFramebuffer(r.FRAMEBUFFER,k.__webglFramebuffer),k.__webglDepthbuffer=r.createRenderbuffer(),fe(k.__webglDepthbuffer,Y,!1);t.bindFramebuffer(r.FRAMEBUFFER,null)}function ye(Y,k,ee){const ue=n.get(Y);k!==void 0&&H(ue.__webglFramebuffer,Y,Y.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),ee!==void 0&&ve(Y)}function Oe(Y){const k=Y.texture,ee=n.get(Y),ue=n.get(k);Y.addEventListener("dispose",R);const pe=Y.textures,ge=Y.isWebGLCubeRenderTarget===!0,Ue=pe.length>1;if(Ue||(ue.__webglTexture===void 0&&(ue.__webglTexture=r.createTexture()),ue.__version=k.version,o.memory.textures++),ge){ee.__webglFramebuffer=[];for(let Ee=0;Ee<6;Ee++)if(k.mipmaps&&k.mipmaps.length>0){ee.__webglFramebuffer[Ee]=[];for(let Qe=0;Qe<k.mipmaps.length;Qe++)ee.__webglFramebuffer[Ee][Qe]=r.createFramebuffer()}else ee.__webglFramebuffer[Ee]=r.createFramebuffer()}else{if(k.mipmaps&&k.mipmaps.length>0){ee.__webglFramebuffer=[];for(let Ee=0;Ee<k.mipmaps.length;Ee++)ee.__webglFramebuffer[Ee]=r.createFramebuffer()}else ee.__webglFramebuffer=r.createFramebuffer();if(Ue)for(let Ee=0,Qe=pe.length;Ee<Qe;Ee++){const He=n.get(pe[Ee]);He.__webglTexture===void 0&&(He.__webglTexture=r.createTexture(),o.memory.textures++)}if(Y.samples>0&&Pe(Y)===!1){ee.__webglMultisampledFramebuffer=r.createFramebuffer(),ee.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,ee.__webglMultisampledFramebuffer);for(let Ee=0;Ee<pe.length;Ee++){const Qe=pe[Ee];ee.__webglColorRenderbuffer[Ee]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,ee.__webglColorRenderbuffer[Ee]);const He=s.convert(Qe.format,Qe.colorSpace),Ce=s.convert(Qe.type),Se=w(Qe.internalFormat,He,Ce,Qe.colorSpace,Y.isXRRenderTarget===!0),Ze=rt(Y);r.renderbufferStorageMultisample(r.RENDERBUFFER,Ze,Se,Y.width,Y.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ee,r.RENDERBUFFER,ee.__webglColorRenderbuffer[Ee])}r.bindRenderbuffer(r.RENDERBUFFER,null),Y.depthBuffer&&(ee.__webglDepthRenderbuffer=r.createRenderbuffer(),fe(ee.__webglDepthRenderbuffer,Y,!0)),t.bindFramebuffer(r.FRAMEBUFFER,null)}}if(ge){t.bindTexture(r.TEXTURE_CUBE_MAP,ue.__webglTexture),Q(r.TEXTURE_CUBE_MAP,k);for(let Ee=0;Ee<6;Ee++)if(k.mipmaps&&k.mipmaps.length>0)for(let Qe=0;Qe<k.mipmaps.length;Qe++)H(ee.__webglFramebuffer[Ee][Qe],Y,k,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,Qe);else H(ee.__webglFramebuffer[Ee],Y,k,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,0);m(k)&&_(r.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(Ue){for(let Ee=0,Qe=pe.length;Ee<Qe;Ee++){const He=pe[Ee],Ce=n.get(He);t.bindTexture(r.TEXTURE_2D,Ce.__webglTexture),Q(r.TEXTURE_2D,He),H(ee.__webglFramebuffer,Y,He,r.COLOR_ATTACHMENT0+Ee,r.TEXTURE_2D,0),m(He)&&_(r.TEXTURE_2D)}t.unbindTexture()}else{let Ee=r.TEXTURE_2D;if((Y.isWebGL3DRenderTarget||Y.isWebGLArrayRenderTarget)&&(Ee=Y.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),t.bindTexture(Ee,ue.__webglTexture),Q(Ee,k),k.mipmaps&&k.mipmaps.length>0)for(let Qe=0;Qe<k.mipmaps.length;Qe++)H(ee.__webglFramebuffer[Qe],Y,k,r.COLOR_ATTACHMENT0,Ee,Qe);else H(ee.__webglFramebuffer,Y,k,r.COLOR_ATTACHMENT0,Ee,0);m(k)&&_(Ee),t.unbindTexture()}Y.depthBuffer&&ve(Y)}function it(Y){const k=Y.textures;for(let ee=0,ue=k.length;ee<ue;ee++){const pe=k[ee];if(m(pe)){const ge=Y.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,Ue=n.get(pe).__webglTexture;t.bindTexture(ge,Ue),_(ge),t.unbindTexture()}}}function ae(Y){if(Y.samples>0&&Pe(Y)===!1){const k=Y.textures,ee=Y.width,ue=Y.height;let pe=r.COLOR_BUFFER_BIT;const ge=[],Ue=Y.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ee=n.get(Y),Qe=k.length>1;if(Qe)for(let He=0;He<k.length;He++)t.bindFramebuffer(r.FRAMEBUFFER,Ee.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+He,r.RENDERBUFFER,null),t.bindFramebuffer(r.FRAMEBUFFER,Ee.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+He,r.TEXTURE_2D,null,0);t.bindFramebuffer(r.READ_FRAMEBUFFER,Ee.__webglMultisampledFramebuffer),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ee.__webglFramebuffer);for(let He=0;He<k.length;He++){ge.push(r.COLOR_ATTACHMENT0+He),Y.depthBuffer&&ge.push(Ue);const Ce=Ee.__ignoreDepthValues!==void 0?Ee.__ignoreDepthValues:!1;if(Ce===!1&&(Y.depthBuffer&&(pe|=r.DEPTH_BUFFER_BIT),Y.stencilBuffer&&Ee.__isTransmissionRenderTarget!==!0&&(pe|=r.STENCIL_BUFFER_BIT)),Qe&&r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,Ee.__webglColorRenderbuffer[He]),Ce===!0&&(r.invalidateFramebuffer(r.READ_FRAMEBUFFER,[Ue]),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[Ue])),Qe){const Se=n.get(k[He]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,Se,0)}r.blitFramebuffer(0,0,ee,ue,0,0,ee,ue,pe,r.NEAREST),h&&r.invalidateFramebuffer(r.READ_FRAMEBUFFER,ge)}if(t.bindFramebuffer(r.READ_FRAMEBUFFER,null),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),Qe)for(let He=0;He<k.length;He++){t.bindFramebuffer(r.FRAMEBUFFER,Ee.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+He,r.RENDERBUFFER,Ee.__webglColorRenderbuffer[He]);const Ce=n.get(k[He]).__webglTexture;t.bindFramebuffer(r.FRAMEBUFFER,Ee.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+He,r.TEXTURE_2D,Ce,0)}t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ee.__webglMultisampledFramebuffer)}}function rt(Y){return Math.min(i.maxSamples,Y.samples)}function Pe(Y){const k=n.get(Y);return Y.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&k.__useRenderToTexture!==!1}function lt(Y){const k=o.render.frame;d.get(Y)!==k&&(d.set(Y,k),Y.update())}function Ye(Y,k){const ee=Y.colorSpace,ue=Y.format,pe=Y.type;return Y.isCompressedTexture===!0||Y.isVideoTexture===!0||ee!==Cr&&ee!==ps&&(Rt.getTransfer(ee)===Ht?(ue!==Ar||pe!==pr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ee)),k}function ct(Y){return typeof HTMLImageElement<"u"&&Y instanceof HTMLImageElement?(u.width=Y.naturalWidth||Y.width,u.height=Y.naturalHeight||Y.height):typeof VideoFrame<"u"&&Y instanceof VideoFrame?(u.width=Y.displayWidth,u.height=Y.displayHeight):(u.width=Y.width,u.height=Y.height),u}this.allocateTextureUnit=L,this.resetTextureUnits=M,this.setTexture2D=N,this.setTexture2DArray=j,this.setTexture3D=X,this.setTextureCube=K,this.rebindTextures=ye,this.setupRenderTarget=Oe,this.updateRenderTargetMipmap=it,this.updateMultisampleRenderTarget=ae,this.setupDepthRenderbuffer=ve,this.setupFrameBufferTexture=H,this.useMultisampledRTT=Pe}function BL(r,e){function t(n,i=ps){let s;const o=Rt.getTransfer(i);if(n===pr)return r.UNSIGNED_BYTE;if(n===jy)return r.UNSIGNED_SHORT_4_4_4_4;if(n===Wy)return r.UNSIGNED_SHORT_5_5_5_1;if(n===JB)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===uA)return r.BYTE;if(n===Vy)return r.SHORT;if(n===hA)return r.UNSIGNED_SHORT;if(n===Jc)return r.INT;if(n===wi)return r.UNSIGNED_INT;if(n===or)return r.FLOAT;if(n===_n)return r.HALF_FLOAT;if(n===ZB)return r.ALPHA;if(n===$B)return r.RGB;if(n===Ar)return r.RGBA;if(n===eb)return r.LUMINANCE;if(n===tb)return r.LUMINANCE_ALPHA;if(n===rl)return r.DEPTH_COMPONENT;if(n===$c)return r.DEPTH_STENCIL;if(n===$s)return r.RED;if(n===dA)return r.RED_INTEGER;if(n===no)return r.RG;if(n===qh)return r.RG_INTEGER;if(n===eu)return r.RGBA_INTEGER;if(n===Xh||n===fA||n===pA||n===Kh)if(o===Ht)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===Xh)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===fA)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===pA)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Kh)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===Xh)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===fA)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===pA)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Kh)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===AA||n===Yy||n===gA||n===qy)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===AA)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Yy)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===gA)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===qy)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===mA)return s=e.get("WEBGL_compressed_texture_etc1"),s!==null?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(n===_A||n===vA)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(n===_A)return o===Ht?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===vA)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===yA||n===Xy||n===Ky||n===Jy||n===Jh||n===Zy||n===$y||n===eE||n===tE||n===rE||n===nE||n===iE||n===sE||n===aE)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(n===yA)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Xy)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Ky)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Jy)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Jh)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Zy)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===$y)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===eE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===tE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===rE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===nE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===iE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===sE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===aE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===Zh||n===oE||n===lE)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(n===Zh)return o===Ht?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===oE)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===lE)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===rb||n===cE||n===uE||n===hE)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(n===Zh)return s.COMPRESSED_RED_RGTC1_EXT;if(n===cE)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===uE)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===hE)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Zc?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:t}}class bL extends cn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class aa extends Zt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const RL={type:"move"};class eg{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new aa,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new aa,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new W,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new W),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new aa,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new W,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new W),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let i=null,s=null,o=null;const c=this._targetRay,h=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){o=!0;for(const E of e.hand.values()){const m=t.getJointPose(E,n),_=this._getHandJoint(u,E);m!==null&&(_.matrix.fromArray(m.transform.matrix),_.matrix.decompose(_.position,_.rotation,_.scale),_.matrixWorldNeedsUpdate=!0,_.jointRadius=m.radius),_.visible=m!==null}const d=u.joints["index-finger-tip"],A=u.joints["thumb-tip"],p=d.position.distanceTo(A.position),g=.02,v=.005;u.inputState.pinching&&p>g+v?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&p<=g-v&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else h!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(h.matrix.fromArray(s.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale),h.matrixWorldNeedsUpdate=!0,s.linearVelocity?(h.hasLinearVelocity=!0,h.linearVelocity.copy(s.linearVelocity)):h.hasLinearVelocity=!1,s.angularVelocity?(h.hasAngularVelocity=!0,h.angularVelocity.copy(s.angularVelocity)):h.hasAngularVelocity=!1));c!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(c.matrix.fromArray(i.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,i.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(i.linearVelocity)):c.hasLinearVelocity=!1,i.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(i.angularVelocity)):c.hasAngularVelocity=!1,this.dispatchEvent(RL)))}return c!==null&&(c.visible=i!==null),h!==null&&(h.visible=s!==null),u!==null&&(u.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new aa;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}const DL=`
3804
+ }`;function ML(r,e,t){let n=new jA;const i=new Ge,s=new Ge,o=new Ft,c=new M2({depthPacking:ab}),h=new wL,u={},d=t.maxTextureSize,A={[vi]:Pr,[Pr]:vi,[yi]:yi},p=new vn({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ge},radius:{value:4}},vertexShader:IL,fragmentShader:CL}),g=p.clone();g.defines.HORIZONTAL_PASS=1;const v=new Hn;v.setAttribute("position",new Qr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const E=new Wr(v,p),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ry;let _=this.type;this.render=function(S,T,D){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||S.length===0)return;const b=r.getRenderTarget(),M=r.getActiveCubeFace(),L=r.getActiveMipmapLevel(),P=r.state;P.setBlending(fs),P.buffers.color.setClear(1,1,1,1),P.buffers.depth.setTest(!0),P.setScissorTest(!1);const N=_!==ds&&this.type===ds,j=_===ds&&this.type!==ds;for(let X=0,K=S.length;X<K;X++){const ne=S[X],V=ne.shadow;if(V===void 0){console.warn("THREE.WebGLShadowMap:",ne,"has no shadow.");continue}if(V.autoUpdate===!1&&V.needsUpdate===!1)continue;i.copy(V.mapSize);const te=V.getFrameExtents();if(i.multiply(te),s.copy(V.mapSize),(i.x>d||i.y>d)&&(i.x>d&&(s.x=Math.floor(d/te.x),i.x=s.x*te.x,V.mapSize.x=s.x),i.y>d&&(s.y=Math.floor(d/te.y),i.y=s.y*te.y,V.mapSize.y=s.y)),V.map===null||N===!0||j===!0){const z=this.type!==ds?{minFilter:dr,magFilter:dr}:{};V.map!==null&&V.map.dispose(),V.map=new Mi(i.x,i.y,z),V.map.texture.name=ne.name+".shadowMap",V.camera.updateProjectionMatrix()}r.setRenderTarget(V.map),r.clear();const Q=V.getViewportCount();for(let z=0;z<Q;z++){const Z=V.getViewport(z);o.set(s.x*Z.x,s.y*Z.y,s.x*Z.z,s.y*Z.w),P.viewport(o),V.updateMatrices(ne,z),n=V.getFrustum(),I(T,D,V.camera,ne,this.type)}V.isPointLightShadow!==!0&&this.type===ds&&w(V,D),V.needsUpdate=!1}_=this.type,m.needsUpdate=!1,r.setRenderTarget(b,M,L)};function w(S,T){const D=e.update(E);p.defines.VSM_SAMPLES!==S.blurSamples&&(p.defines.VSM_SAMPLES=S.blurSamples,g.defines.VSM_SAMPLES=S.blurSamples,p.needsUpdate=!0,g.needsUpdate=!0),S.mapPass===null&&(S.mapPass=new Mi(i.x,i.y)),p.uniforms.shadow_pass.value=S.map.texture,p.uniforms.resolution.value=S.mapSize,p.uniforms.radius.value=S.radius,r.setRenderTarget(S.mapPass),r.clear(),r.renderBufferDirect(T,null,D,p,E,null),g.uniforms.shadow_pass.value=S.mapPass.texture,g.uniforms.resolution.value=S.mapSize,g.uniforms.radius.value=S.radius,r.setRenderTarget(S.map),r.clear(),r.renderBufferDirect(T,null,D,g,E,null)}function x(S,T,D,b){let M=null;const L=D.isPointLight===!0?S.customDistanceMaterial:S.customDepthMaterial;if(L!==void 0)M=L;else if(M=D.isPointLight===!0?h:c,r.localClippingEnabled&&T.clipShadows===!0&&Array.isArray(T.clippingPlanes)&&T.clippingPlanes.length!==0||T.displacementMap&&T.displacementScale!==0||T.alphaMap&&T.alphaTest>0||T.map&&T.alphaTest>0){const P=M.uuid,N=T.uuid;let j=u[P];j===void 0&&(j={},u[P]=j);let X=j[N];X===void 0&&(X=M.clone(),j[N]=X,T.addEventListener("dispose",R)),M=X}if(M.visible=T.visible,M.wireframe=T.wireframe,b===ds?M.side=T.shadowSide!==null?T.shadowSide:T.side:M.side=T.shadowSide!==null?T.shadowSide:A[T.side],M.alphaMap=T.alphaMap,M.alphaTest=T.alphaTest,M.map=T.map,M.clipShadows=T.clipShadows,M.clippingPlanes=T.clippingPlanes,M.clipIntersection=T.clipIntersection,M.displacementMap=T.displacementMap,M.displacementScale=T.displacementScale,M.displacementBias=T.displacementBias,M.wireframeLinewidth=T.wireframeLinewidth,M.linewidth=T.linewidth,D.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const P=r.properties.get(M);P.light=D}return M}function I(S,T,D,b,M){if(S.visible===!1)return;if(S.layers.test(T.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&M===ds)&&(!S.frustumCulled||n.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,S.matrixWorld);const P=e.update(S),N=S.material;if(Array.isArray(N)){const j=P.groups;for(let X=0,K=j.length;X<K;X++){const ne=j[X],V=N[ne.materialIndex];if(V&&V.visible){const te=x(S,V,b,M);S.onBeforeShadow(r,S,T,D,P,te,ne),r.renderBufferDirect(D,null,P,te,S,ne),S.onAfterShadow(r,S,T,D,P,te,ne)}}}else if(N.visible){const j=x(S,N,b,M);S.onBeforeShadow(r,S,T,D,P,j,null),r.renderBufferDirect(D,null,P,j,S,null),S.onAfterShadow(r,S,T,D,P,j,null)}}const L=S.children;for(let P=0,N=L.length;P<N;P++)I(L[P],T,D,b,M)}function R(S){S.target.removeEventListener("dispose",R);for(const T in u){const D=u[T],b=S.target.uuid;b in D&&(D[b].dispose(),delete D[b])}}}function SL(r){function e(){let O=!1;const me=new Ft;let _e=null;const Fe=new Ft(0,0,0,0);return{setMask:function(De){_e!==De&&!O&&(r.colorMask(De,De,De,De),_e=De)},setLocked:function(De){O=De},setClear:function(De,pt,Dt,Lt,St){St===!0&&(De*=Lt,pt*=Lt,Dt*=Lt),me.set(De,pt,Dt,Lt),Fe.equals(me)===!1&&(r.clearColor(De,pt,Dt,Lt),Fe.copy(me))},reset:function(){O=!1,_e=null,Fe.set(-1,0,0,0)}}}function t(){let O=!1,me=null,_e=null,Fe=null;return{setTest:function(De){De?Ae(r.DEPTH_TEST):ve(r.DEPTH_TEST)},setMask:function(De){me!==De&&!O&&(r.depthMask(De),me=De)},setFunc:function(De){if(_e!==De){switch(De){case OB:r.depthFunc(r.NEVER);break;case FB:r.depthFunc(r.ALWAYS);break;case zB:r.depthFunc(r.LESS);break;case Vh:r.depthFunc(r.LEQUAL);break;case HB:r.depthFunc(r.EQUAL);break;case GB:r.depthFunc(r.GEQUAL);break;case VB:r.depthFunc(r.GREATER);break;case jB:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}_e=De}},setLocked:function(De){O=De},setClear:function(De){Fe!==De&&(r.clearDepth(De),Fe=De)},reset:function(){O=!1,me=null,_e=null,Fe=null}}}function n(){let O=!1,me=null,_e=null,Fe=null,De=null,pt=null,Dt=null,Lt=null,St=null;return{setTest:function(At){O||(At?Ae(r.STENCIL_TEST):ve(r.STENCIL_TEST))},setMask:function(At){me!==At&&!O&&(r.stencilMask(At),me=At)},setFunc:function(At,ur,Vt){(_e!==At||Fe!==ur||De!==Vt)&&(r.stencilFunc(At,ur,Vt),_e=At,Fe=ur,De=Vt)},setOp:function(At,ur,Vt){(pt!==At||Dt!==ur||Lt!==Vt)&&(r.stencilOp(At,ur,Vt),pt=At,Dt=ur,Lt=Vt)},setLocked:function(At){O=At},setClear:function(At){St!==At&&(r.clearStencil(At),St=At)},reset:function(){O=!1,me=null,_e=null,Fe=null,De=null,pt=null,Dt=null,Lt=null,St=null}}}const i=new e,s=new t,o=new n,c=new WeakMap,h=new WeakMap;let u={},d={},A=new WeakMap,p=[],g=null,v=!1,E=null,m=null,_=null,w=null,x=null,I=null,R=null,S=new qe(0,0,0),T=0,D=!1,b=null,M=null,L=null,P=null,N=null;const j=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let X=!1,K=0;const ne=r.getParameter(r.VERSION);ne.indexOf("WebGL")!==-1?(K=parseFloat(/^WebGL (\d)/.exec(ne)[1]),X=K>=1):ne.indexOf("OpenGL ES")!==-1&&(K=parseFloat(/^OpenGL ES (\d)/.exec(ne)[1]),X=K>=2);let V=null,te={};const Q=r.getParameter(r.SCISSOR_BOX),z=r.getParameter(r.VIEWPORT),Z=new Ft().fromArray(Q),re=new Ft().fromArray(z);function H(O,me,_e,Fe){const De=new Uint8Array(4),pt=r.createTexture();r.bindTexture(O,pt),r.texParameteri(O,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(O,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let Dt=0;Dt<_e;Dt++)O===r.TEXTURE_3D||O===r.TEXTURE_2D_ARRAY?r.texImage3D(me,0,r.RGBA,1,1,Fe,0,r.RGBA,r.UNSIGNED_BYTE,De):r.texImage2D(me+Dt,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,De);return pt}const fe={};fe[r.TEXTURE_2D]=H(r.TEXTURE_2D,r.TEXTURE_2D,1),fe[r.TEXTURE_CUBE_MAP]=H(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),fe[r.TEXTURE_2D_ARRAY]=H(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),fe[r.TEXTURE_3D]=H(r.TEXTURE_3D,r.TEXTURE_3D,1,1),i.setClear(0,0,0,1),s.setClear(1),o.setClear(0),Ae(r.DEPTH_TEST),s.setFunc(Vh),Ye(!1),ct(by),Ae(r.CULL_FACE),Pe(fs);function Ae(O){u[O]!==!0&&(r.enable(O),u[O]=!0)}function ve(O){u[O]!==!1&&(r.disable(O),u[O]=!1)}function ye(O,me){return d[O]!==me?(r.bindFramebuffer(O,me),d[O]=me,O===r.DRAW_FRAMEBUFFER&&(d[r.FRAMEBUFFER]=me),O===r.FRAMEBUFFER&&(d[r.DRAW_FRAMEBUFFER]=me),!0):!1}function Oe(O,me){let _e=p,Fe=!1;if(O){_e=A.get(me),_e===void 0&&(_e=[],A.set(me,_e));const De=O.textures;if(_e.length!==De.length||_e[0]!==r.COLOR_ATTACHMENT0){for(let pt=0,Dt=De.length;pt<Dt;pt++)_e[pt]=r.COLOR_ATTACHMENT0+pt;_e.length=De.length,Fe=!0}}else _e[0]!==r.BACK&&(_e[0]=r.BACK,Fe=!0);Fe&&r.drawBuffers(_e)}function it(O){return g!==O?(r.useProgram(O),g=O,!0):!1}const ae={[to]:r.FUNC_ADD,[xB]:r.FUNC_SUBTRACT,[wB]:r.FUNC_REVERSE_SUBTRACT};ae[IB]=r.MIN,ae[CB]=r.MAX;const rt={[MB]:r.ZERO,[SB]:r.ONE,[TB]:r.SRC_COLOR,[aA]:r.SRC_ALPHA,[NB]:r.SRC_ALPHA_SATURATE,[DB]:r.DST_COLOR,[bB]:r.DST_ALPHA,[BB]:r.ONE_MINUS_SRC_COLOR,[oA]:r.ONE_MINUS_SRC_ALPHA,[LB]:r.ONE_MINUS_DST_COLOR,[RB]:r.ONE_MINUS_DST_ALPHA,[UB]:r.CONSTANT_COLOR,[PB]:r.ONE_MINUS_CONSTANT_COLOR,[kB]:r.CONSTANT_ALPHA,[QB]:r.ONE_MINUS_CONSTANT_ALPHA};function Pe(O,me,_e,Fe,De,pt,Dt,Lt,St,At){if(O===fs){v===!0&&(ve(r.BLEND),v=!1);return}if(v===!1&&(Ae(r.BLEND),v=!0),O!==EB){if(O!==E||At!==D){if((m!==to||x!==to)&&(r.blendEquation(r.FUNC_ADD),m=to,x=to),At)switch(O){case el:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Dy:r.blendFunc(r.ONE,r.ONE);break;case Ly:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Ny:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",O);break}else switch(O){case el:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Dy:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case Ly:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Ny:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",O);break}_=null,w=null,I=null,R=null,S.set(0,0,0),T=0,E=O,D=At}return}De=De||me,pt=pt||_e,Dt=Dt||Fe,(me!==m||De!==x)&&(r.blendEquationSeparate(ae[me],ae[De]),m=me,x=De),(_e!==_||Fe!==w||pt!==I||Dt!==R)&&(r.blendFuncSeparate(rt[_e],rt[Fe],rt[pt],rt[Dt]),_=_e,w=Fe,I=pt,R=Dt),(Lt.equals(S)===!1||St!==T)&&(r.blendColor(Lt.r,Lt.g,Lt.b,St),S.copy(Lt),T=St),E=O,D=!1}function lt(O,me){O.side===yi?ve(r.CULL_FACE):Ae(r.CULL_FACE);let _e=O.side===Pr;me&&(_e=!_e),Ye(_e),O.blending===el&&O.transparent===!1?Pe(fs):Pe(O.blending,O.blendEquation,O.blendSrc,O.blendDst,O.blendEquationAlpha,O.blendSrcAlpha,O.blendDstAlpha,O.blendColor,O.blendAlpha,O.premultipliedAlpha),s.setFunc(O.depthFunc),s.setTest(O.depthTest),s.setMask(O.depthWrite),i.setMask(O.colorWrite);const Fe=O.stencilWrite;o.setTest(Fe),Fe&&(o.setMask(O.stencilWriteMask),o.setFunc(O.stencilFunc,O.stencilRef,O.stencilFuncMask),o.setOp(O.stencilFail,O.stencilZFail,O.stencilZPass)),k(O.polygonOffset,O.polygonOffsetFactor,O.polygonOffsetUnits),O.alphaToCoverage===!0?Ae(r.SAMPLE_ALPHA_TO_COVERAGE):ve(r.SAMPLE_ALPHA_TO_COVERAGE)}function Ye(O){b!==O&&(O?r.frontFace(r.CW):r.frontFace(r.CCW),b=O)}function ct(O){O!==_B?(Ae(r.CULL_FACE),O!==M&&(O===by?r.cullFace(r.BACK):O===vB?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):ve(r.CULL_FACE),M=O}function Y(O){O!==L&&(X&&r.lineWidth(O),L=O)}function k(O,me,_e){O?(Ae(r.POLYGON_OFFSET_FILL),(P!==me||N!==_e)&&(r.polygonOffset(me,_e),P=me,N=_e)):ve(r.POLYGON_OFFSET_FILL)}function ee(O){O?Ae(r.SCISSOR_TEST):ve(r.SCISSOR_TEST)}function ue(O){O===void 0&&(O=r.TEXTURE0+j-1),V!==O&&(r.activeTexture(O),V=O)}function pe(O,me,_e){_e===void 0&&(V===null?_e=r.TEXTURE0+j-1:_e=V);let Fe=te[_e];Fe===void 0&&(Fe={type:void 0,texture:void 0},te[_e]=Fe),(Fe.type!==O||Fe.texture!==me)&&(V!==_e&&(r.activeTexture(_e),V=_e),r.bindTexture(O,me||fe[O]),Fe.type=O,Fe.texture=me)}function ge(){const O=te[V];O!==void 0&&O.type!==void 0&&(r.bindTexture(O.type,null),O.type=void 0,O.texture=void 0)}function Ue(){try{r.compressedTexImage2D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function Ee(){try{r.compressedTexImage3D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function Qe(){try{r.texSubImage2D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function He(){try{r.texSubImage3D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function Ce(){try{r.compressedTexSubImage2D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function Se(){try{r.compressedTexSubImage3D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function Ze(){try{r.texStorage2D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function Ne(){try{r.texStorage3D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function Re(){try{r.texImage2D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function at(){try{r.texImage3D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function ft(O){Z.equals(O)===!1&&(r.scissor(O.x,O.y,O.z,O.w),Z.copy(O))}function yt(O){re.equals(O)===!1&&(r.viewport(O.x,O.y,O.z,O.w),re.copy(O))}function _t(O,me){let _e=h.get(me);_e===void 0&&(_e=new WeakMap,h.set(me,_e));let Fe=_e.get(O);Fe===void 0&&(Fe=r.getUniformBlockIndex(me,O.name),_e.set(O,Fe))}function Et(O,me){const _e=h.get(me).get(O);c.get(me)!==_e&&(r.uniformBlockBinding(me,_e,O.__bindingPointIndex),c.set(me,_e))}function G(){r.disable(r.BLEND),r.disable(r.CULL_FACE),r.disable(r.DEPTH_TEST),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SCISSOR_TEST),r.disable(r.STENCIL_TEST),r.disable(r.SAMPLE_ALPHA_TO_COVERAGE),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ZERO),r.blendFuncSeparate(r.ONE,r.ZERO,r.ONE,r.ZERO),r.blendColor(0,0,0,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(r.LESS),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(r.ALWAYS,0,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.clearStencil(0),r.cullFace(r.BACK),r.frontFace(r.CCW),r.polygonOffset(0,0),r.activeTexture(r.TEXTURE0),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(r.READ_FRAMEBUFFER,null),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),u={},V=null,te={},d={},A=new WeakMap,p=[],g=null,v=!1,E=null,m=null,_=null,w=null,x=null,I=null,R=null,S=new qe(0,0,0),T=0,D=!1,b=null,M=null,L=null,P=null,N=null,Z.set(0,0,r.canvas.width,r.canvas.height),re.set(0,0,r.canvas.width,r.canvas.height),i.reset(),s.reset(),o.reset()}return{buffers:{color:i,depth:s,stencil:o},enable:Ae,disable:ve,bindFramebuffer:ye,drawBuffers:Oe,useProgram:it,setBlending:Pe,setMaterial:lt,setFlipSided:Ye,setCullFace:ct,setLineWidth:Y,setPolygonOffset:k,setScissorTest:ee,activeTexture:ue,bindTexture:pe,unbindTexture:ge,compressedTexImage2D:Ue,compressedTexImage3D:Ee,texImage2D:Re,texImage3D:at,updateUBOMapping:_t,uniformBlockBinding:Et,texStorage2D:Ze,texStorage3D:Ne,texSubImage2D:Qe,texSubImage3D:He,compressedTexSubImage2D:Ce,compressedTexSubImage3D:Se,scissor:ft,viewport:yt,reset:G}}function TL(r,e,t,n,i,s,o){const c=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,h=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),u=new Ge,d=new WeakMap;let A;const p=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function v(Y,k){return g?new OffscreenCanvas(Y,k):su("canvas")}function E(Y,k,ee){let ue=1;const pe=ct(Y);if((pe.width>ee||pe.height>ee)&&(ue=ee/Math.max(pe.width,pe.height)),ue<1)if(typeof HTMLImageElement<"u"&&Y instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&Y instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&Y instanceof ImageBitmap||typeof VideoFrame<"u"&&Y instanceof VideoFrame){const ge=Math.floor(ue*pe.width),Ue=Math.floor(ue*pe.height);A===void 0&&(A=v(ge,Ue));const Ee=k?v(ge,Ue):A;return Ee.width=ge,Ee.height=Ue,Ee.getContext("2d").drawImage(Y,0,0,ge,Ue),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+pe.width+"x"+pe.height+") to ("+ge+"x"+Ue+")."),Ee}else return"data"in Y&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+pe.width+"x"+pe.height+")."),Y;return Y}function m(Y){return Y.generateMipmaps&&Y.minFilter!==dr&&Y.minFilter!==fr}function _(Y){r.generateMipmap(Y)}function w(Y,k,ee,ue,pe=!1){if(Y!==null){if(r[Y]!==void 0)return r[Y];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+Y+"'")}let ge=k;if(k===r.RED&&(ee===r.FLOAT&&(ge=r.R32F),ee===r.HALF_FLOAT&&(ge=r.R16F),ee===r.UNSIGNED_BYTE&&(ge=r.R8)),k===r.RED_INTEGER&&(ee===r.UNSIGNED_BYTE&&(ge=r.R8UI),ee===r.UNSIGNED_SHORT&&(ge=r.R16UI),ee===r.UNSIGNED_INT&&(ge=r.R32UI),ee===r.BYTE&&(ge=r.R8I),ee===r.SHORT&&(ge=r.R16I),ee===r.INT&&(ge=r.R32I)),k===r.RG&&(ee===r.FLOAT&&(ge=r.RG32F),ee===r.HALF_FLOAT&&(ge=r.RG16F),ee===r.UNSIGNED_BYTE&&(ge=r.RG8)),k===r.RG_INTEGER&&(ee===r.UNSIGNED_BYTE&&(ge=r.RG8UI),ee===r.UNSIGNED_SHORT&&(ge=r.RG16UI),ee===r.UNSIGNED_INT&&(ge=r.RG32UI),ee===r.BYTE&&(ge=r.RG8I),ee===r.SHORT&&(ge=r.RG16I),ee===r.INT&&(ge=r.RG32I)),k===r.RGB&&ee===r.UNSIGNED_INT_5_9_9_9_REV&&(ge=r.RGB9_E5),k===r.RGBA){const Ue=pe?ed:Rt.getTransfer(ue);ee===r.FLOAT&&(ge=r.RGBA32F),ee===r.HALF_FLOAT&&(ge=r.RGBA16F),ee===r.UNSIGNED_BYTE&&(ge=Ue===Ht?r.SRGB8_ALPHA8:r.RGBA8),ee===r.UNSIGNED_SHORT_4_4_4_4&&(ge=r.RGBA4),ee===r.UNSIGNED_SHORT_5_5_5_1&&(ge=r.RGB5_A1)}return(ge===r.R16F||ge===r.R32F||ge===r.RG16F||ge===r.RG32F||ge===r.RGBA16F||ge===r.RGBA32F)&&e.get("EXT_color_buffer_float"),ge}function x(Y,k){return m(Y)===!0||Y.isFramebufferTexture&&Y.minFilter!==dr&&Y.minFilter!==fr?Math.log2(Math.max(k.width,k.height))+1:Y.mipmaps!==void 0&&Y.mipmaps.length>0?Y.mipmaps.length:Y.isCompressedTexture&&Array.isArray(Y.image)?k.mipmaps.length:1}function I(Y){const k=Y.target;k.removeEventListener("dispose",I),S(k),k.isVideoTexture&&d.delete(k)}function R(Y){const k=Y.target;k.removeEventListener("dispose",R),D(k)}function S(Y){const k=n.get(Y);if(k.__webglInit===void 0)return;const ee=Y.source,ue=p.get(ee);if(ue){const pe=ue[k.__cacheKey];pe.usedTimes--,pe.usedTimes===0&&T(Y),Object.keys(ue).length===0&&p.delete(ee)}n.remove(Y)}function T(Y){const k=n.get(Y);r.deleteTexture(k.__webglTexture);const ee=Y.source,ue=p.get(ee);delete ue[k.__cacheKey],o.memory.textures--}function D(Y){const k=n.get(Y);if(Y.depthTexture&&Y.depthTexture.dispose(),Y.isWebGLCubeRenderTarget)for(let ue=0;ue<6;ue++){if(Array.isArray(k.__webglFramebuffer[ue]))for(let pe=0;pe<k.__webglFramebuffer[ue].length;pe++)r.deleteFramebuffer(k.__webglFramebuffer[ue][pe]);else r.deleteFramebuffer(k.__webglFramebuffer[ue]);k.__webglDepthbuffer&&r.deleteRenderbuffer(k.__webglDepthbuffer[ue])}else{if(Array.isArray(k.__webglFramebuffer))for(let ue=0;ue<k.__webglFramebuffer.length;ue++)r.deleteFramebuffer(k.__webglFramebuffer[ue]);else r.deleteFramebuffer(k.__webglFramebuffer);if(k.__webglDepthbuffer&&r.deleteRenderbuffer(k.__webglDepthbuffer),k.__webglMultisampledFramebuffer&&r.deleteFramebuffer(k.__webglMultisampledFramebuffer),k.__webglColorRenderbuffer)for(let ue=0;ue<k.__webglColorRenderbuffer.length;ue++)k.__webglColorRenderbuffer[ue]&&r.deleteRenderbuffer(k.__webglColorRenderbuffer[ue]);k.__webglDepthRenderbuffer&&r.deleteRenderbuffer(k.__webglDepthRenderbuffer)}const ee=Y.textures;for(let ue=0,pe=ee.length;ue<pe;ue++){const ge=n.get(ee[ue]);ge.__webglTexture&&(r.deleteTexture(ge.__webglTexture),o.memory.textures--),n.remove(ee[ue])}n.remove(Y)}let b=0;function M(){b=0}function L(){const Y=b;return Y>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+Y+" texture units while this GPU supports only "+i.maxTextures),b+=1,Y}function P(Y){const k=[];return k.push(Y.wrapS),k.push(Y.wrapT),k.push(Y.wrapR||0),k.push(Y.magFilter),k.push(Y.minFilter),k.push(Y.anisotropy),k.push(Y.internalFormat),k.push(Y.format),k.push(Y.type),k.push(Y.generateMipmaps),k.push(Y.premultiplyAlpha),k.push(Y.flipY),k.push(Y.unpackAlignment),k.push(Y.colorSpace),k.join()}function N(Y,k){const ee=n.get(Y);if(Y.isVideoTexture&&lt(Y),Y.isRenderTargetTexture===!1&&Y.version>0&&ee.__version!==Y.version){const ue=Y.image;if(ue===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ue.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Z(ee,Y,k);return}}t.bindTexture(r.TEXTURE_2D,ee.__webglTexture,r.TEXTURE0+k)}function j(Y,k){const ee=n.get(Y);if(Y.version>0&&ee.__version!==Y.version){Z(ee,Y,k);return}t.bindTexture(r.TEXTURE_2D_ARRAY,ee.__webglTexture,r.TEXTURE0+k)}function X(Y,k){const ee=n.get(Y);if(Y.version>0&&ee.__version!==Y.version){Z(ee,Y,k);return}t.bindTexture(r.TEXTURE_3D,ee.__webglTexture,r.TEXTURE0+k)}function K(Y,k){const ee=n.get(Y);if(Y.version>0&&ee.__version!==Y.version){re(ee,Y,k);return}t.bindTexture(r.TEXTURE_CUBE_MAP,ee.__webglTexture,r.TEXTURE0+k)}const ne={[Zs]:r.REPEAT,[Ei]:r.CLAMP_TO_EDGE,[Wh]:r.MIRRORED_REPEAT},V={[dr]:r.NEAREST,[Gy]:r.NEAREST_MIPMAP_NEAREST,[Kc]:r.NEAREST_MIPMAP_LINEAR,[fr]:r.LINEAR,[Yh]:r.LINEAR_MIPMAP_NEAREST,[xi]:r.LINEAR_MIPMAP_LINEAR},te={[lb]:r.NEVER,[pb]:r.ALWAYS,[cb]:r.LESS,[_E]:r.LEQUAL,[ub]:r.EQUAL,[fb]:r.GEQUAL,[hb]:r.GREATER,[db]:r.NOTEQUAL};function Q(Y,k){if(k.type===or&&e.has("OES_texture_float_linear")===!1&&(k.magFilter===fr||k.magFilter===Yh||k.magFilter===Kc||k.magFilter===xi||k.minFilter===fr||k.minFilter===Yh||k.minFilter===Kc||k.minFilter===xi)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(Y,r.TEXTURE_WRAP_S,ne[k.wrapS]),r.texParameteri(Y,r.TEXTURE_WRAP_T,ne[k.wrapT]),(Y===r.TEXTURE_3D||Y===r.TEXTURE_2D_ARRAY)&&r.texParameteri(Y,r.TEXTURE_WRAP_R,ne[k.wrapR]),r.texParameteri(Y,r.TEXTURE_MAG_FILTER,V[k.magFilter]),r.texParameteri(Y,r.TEXTURE_MIN_FILTER,V[k.minFilter]),k.compareFunction&&(r.texParameteri(Y,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(Y,r.TEXTURE_COMPARE_FUNC,te[k.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(k.magFilter===dr||k.minFilter!==Kc&&k.minFilter!==xi||k.type===or&&e.has("OES_texture_float_linear")===!1)return;if(k.anisotropy>1||n.get(k).__currentAnisotropy){const ee=e.get("EXT_texture_filter_anisotropic");r.texParameterf(Y,ee.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(k.anisotropy,i.getMaxAnisotropy())),n.get(k).__currentAnisotropy=k.anisotropy}}}function z(Y,k){let ee=!1;Y.__webglInit===void 0&&(Y.__webglInit=!0,k.addEventListener("dispose",I));const ue=k.source;let pe=p.get(ue);pe===void 0&&(pe={},p.set(ue,pe));const ge=P(k);if(ge!==Y.__cacheKey){pe[ge]===void 0&&(pe[ge]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,ee=!0),pe[ge].usedTimes++;const Ue=pe[Y.__cacheKey];Ue!==void 0&&(pe[Y.__cacheKey].usedTimes--,Ue.usedTimes===0&&T(k)),Y.__cacheKey=ge,Y.__webglTexture=pe[ge].texture}return ee}function Z(Y,k,ee){let ue=r.TEXTURE_2D;(k.isDataArrayTexture||k.isCompressedArrayTexture)&&(ue=r.TEXTURE_2D_ARRAY),k.isData3DTexture&&(ue=r.TEXTURE_3D);const pe=z(Y,k),ge=k.source;t.bindTexture(ue,Y.__webglTexture,r.TEXTURE0+ee);const Ue=n.get(ge);if(ge.version!==Ue.__version||pe===!0){t.activeTexture(r.TEXTURE0+ee);const Ee=Rt.getPrimaries(Rt.workingColorSpace),Qe=k.colorSpace===ps?null:Rt.getPrimaries(k.colorSpace),He=k.colorSpace===ps||Ee===Qe?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,k.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,k.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,k.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,He);let Ce=E(k.image,!1,i.maxTextureSize);Ce=Ye(k,Ce);const Se=s.convert(k.format,k.colorSpace),Ze=s.convert(k.type);let Ne=w(k.internalFormat,Se,Ze,k.colorSpace,k.isVideoTexture);Q(ue,k);let Re;const at=k.mipmaps,ft=k.isVideoTexture!==!0&&Ne!==mA,yt=Ue.__version===void 0||pe===!0,_t=ge.dataReady,Et=x(k,Ce);if(k.isDepthTexture)Ne=r.DEPTH_COMPONENT16,k.type===or?Ne=r.DEPTH_COMPONENT32F:k.type===wi?Ne=r.DEPTH_COMPONENT24:k.type===Zc&&(Ne=r.DEPTH24_STENCIL8),yt&&(ft?t.texStorage2D(r.TEXTURE_2D,1,Ne,Ce.width,Ce.height):t.texImage2D(r.TEXTURE_2D,0,Ne,Ce.width,Ce.height,0,Se,Ze,null));else if(k.isDataTexture)if(at.length>0){ft&&yt&&t.texStorage2D(r.TEXTURE_2D,Et,Ne,at[0].width,at[0].height);for(let G=0,O=at.length;G<O;G++)Re=at[G],ft?_t&&t.texSubImage2D(r.TEXTURE_2D,G,0,0,Re.width,Re.height,Se,Ze,Re.data):t.texImage2D(r.TEXTURE_2D,G,Ne,Re.width,Re.height,0,Se,Ze,Re.data);k.generateMipmaps=!1}else ft?(yt&&t.texStorage2D(r.TEXTURE_2D,Et,Ne,Ce.width,Ce.height),_t&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,Ce.width,Ce.height,Se,Ze,Ce.data)):t.texImage2D(r.TEXTURE_2D,0,Ne,Ce.width,Ce.height,0,Se,Ze,Ce.data);else if(k.isCompressedTexture)if(k.isCompressedArrayTexture){ft&&yt&&t.texStorage3D(r.TEXTURE_2D_ARRAY,Et,Ne,at[0].width,at[0].height,Ce.depth);for(let G=0,O=at.length;G<O;G++)Re=at[G],k.format!==Ar?Se!==null?ft?_t&&t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,G,0,0,0,Re.width,Re.height,Ce.depth,Se,Re.data,0,0):t.compressedTexImage3D(r.TEXTURE_2D_ARRAY,G,Ne,Re.width,Re.height,Ce.depth,0,Re.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ft?_t&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,G,0,0,0,Re.width,Re.height,Ce.depth,Se,Ze,Re.data):t.texImage3D(r.TEXTURE_2D_ARRAY,G,Ne,Re.width,Re.height,Ce.depth,0,Se,Ze,Re.data)}else{ft&&yt&&t.texStorage2D(r.TEXTURE_2D,Et,Ne,at[0].width,at[0].height);for(let G=0,O=at.length;G<O;G++)Re=at[G],k.format!==Ar?Se!==null?ft?_t&&t.compressedTexSubImage2D(r.TEXTURE_2D,G,0,0,Re.width,Re.height,Se,Re.data):t.compressedTexImage2D(r.TEXTURE_2D,G,Ne,Re.width,Re.height,0,Re.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ft?_t&&t.texSubImage2D(r.TEXTURE_2D,G,0,0,Re.width,Re.height,Se,Ze,Re.data):t.texImage2D(r.TEXTURE_2D,G,Ne,Re.width,Re.height,0,Se,Ze,Re.data)}else if(k.isDataArrayTexture)ft?(yt&&t.texStorage3D(r.TEXTURE_2D_ARRAY,Et,Ne,Ce.width,Ce.height,Ce.depth),_t&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,Ce.width,Ce.height,Ce.depth,Se,Ze,Ce.data)):t.texImage3D(r.TEXTURE_2D_ARRAY,0,Ne,Ce.width,Ce.height,Ce.depth,0,Se,Ze,Ce.data);else if(k.isData3DTexture)ft?(yt&&t.texStorage3D(r.TEXTURE_3D,Et,Ne,Ce.width,Ce.height,Ce.depth),_t&&t.texSubImage3D(r.TEXTURE_3D,0,0,0,0,Ce.width,Ce.height,Ce.depth,Se,Ze,Ce.data)):t.texImage3D(r.TEXTURE_3D,0,Ne,Ce.width,Ce.height,Ce.depth,0,Se,Ze,Ce.data);else if(k.isFramebufferTexture){if(yt)if(ft)t.texStorage2D(r.TEXTURE_2D,Et,Ne,Ce.width,Ce.height);else{let G=Ce.width,O=Ce.height;for(let me=0;me<Et;me++)t.texImage2D(r.TEXTURE_2D,me,Ne,G,O,0,Se,Ze,null),G>>=1,O>>=1}}else if(at.length>0){if(ft&&yt){const G=ct(at[0]);t.texStorage2D(r.TEXTURE_2D,Et,Ne,G.width,G.height)}for(let G=0,O=at.length;G<O;G++)Re=at[G],ft?_t&&t.texSubImage2D(r.TEXTURE_2D,G,0,0,Se,Ze,Re):t.texImage2D(r.TEXTURE_2D,G,Ne,Se,Ze,Re);k.generateMipmaps=!1}else if(ft){if(yt){const G=ct(Ce);t.texStorage2D(r.TEXTURE_2D,Et,Ne,G.width,G.height)}_t&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,Se,Ze,Ce)}else t.texImage2D(r.TEXTURE_2D,0,Ne,Se,Ze,Ce);m(k)&&_(ue),Ue.__version=ge.version,k.onUpdate&&k.onUpdate(k)}Y.__version=k.version}function re(Y,k,ee){if(k.image.length!==6)return;const ue=z(Y,k),pe=k.source;t.bindTexture(r.TEXTURE_CUBE_MAP,Y.__webglTexture,r.TEXTURE0+ee);const ge=n.get(pe);if(pe.version!==ge.__version||ue===!0){t.activeTexture(r.TEXTURE0+ee);const Ue=Rt.getPrimaries(Rt.workingColorSpace),Ee=k.colorSpace===ps?null:Rt.getPrimaries(k.colorSpace),Qe=k.colorSpace===ps||Ue===Ee?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,k.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,k.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,k.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Qe);const He=k.isCompressedTexture||k.image[0].isCompressedTexture,Ce=k.image[0]&&k.image[0].isDataTexture,Se=[];for(let O=0;O<6;O++)!He&&!Ce?Se[O]=E(k.image[O],!0,i.maxCubemapSize):Se[O]=Ce?k.image[O].image:k.image[O],Se[O]=Ye(k,Se[O]);const Ze=Se[0],Ne=s.convert(k.format,k.colorSpace),Re=s.convert(k.type),at=w(k.internalFormat,Ne,Re,k.colorSpace),ft=k.isVideoTexture!==!0,yt=ge.__version===void 0||ue===!0,_t=pe.dataReady;let Et=x(k,Ze);Q(r.TEXTURE_CUBE_MAP,k);let G;if(He){ft&&yt&&t.texStorage2D(r.TEXTURE_CUBE_MAP,Et,at,Ze.width,Ze.height);for(let O=0;O<6;O++){G=Se[O].mipmaps;for(let me=0;me<G.length;me++){const _e=G[me];k.format!==Ar?Ne!==null?ft?_t&&t.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,me,0,0,_e.width,_e.height,Ne,_e.data):t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,me,at,_e.width,_e.height,0,_e.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):ft?_t&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,me,0,0,_e.width,_e.height,Ne,Re,_e.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,me,at,_e.width,_e.height,0,Ne,Re,_e.data)}}}else{if(G=k.mipmaps,ft&&yt){G.length>0&&Et++;const O=ct(Se[0]);t.texStorage2D(r.TEXTURE_CUBE_MAP,Et,at,O.width,O.height)}for(let O=0;O<6;O++)if(Ce){ft?_t&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,0,0,0,Se[O].width,Se[O].height,Ne,Re,Se[O].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,0,at,Se[O].width,Se[O].height,0,Ne,Re,Se[O].data);for(let me=0;me<G.length;me++){const _e=G[me].image[O].image;ft?_t&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,me+1,0,0,_e.width,_e.height,Ne,Re,_e.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,me+1,at,_e.width,_e.height,0,Ne,Re,_e.data)}}else{ft?_t&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,0,0,0,Ne,Re,Se[O]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,0,at,Ne,Re,Se[O]);for(let me=0;me<G.length;me++){const _e=G[me];ft?_t&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,me+1,0,0,Ne,Re,_e.image[O]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,me+1,at,Ne,Re,_e.image[O])}}}m(k)&&_(r.TEXTURE_CUBE_MAP),ge.__version=pe.version,k.onUpdate&&k.onUpdate(k)}Y.__version=k.version}function H(Y,k,ee,ue,pe,ge){const Ue=s.convert(ee.format,ee.colorSpace),Ee=s.convert(ee.type),Qe=w(ee.internalFormat,Ue,Ee,ee.colorSpace);if(!n.get(k).__hasExternalTextures){const He=Math.max(1,k.width>>ge),Ce=Math.max(1,k.height>>ge);pe===r.TEXTURE_3D||pe===r.TEXTURE_2D_ARRAY?t.texImage3D(pe,ge,Qe,He,Ce,k.depth,0,Ue,Ee,null):t.texImage2D(pe,ge,Qe,He,Ce,0,Ue,Ee,null)}t.bindFramebuffer(r.FRAMEBUFFER,Y),Pe(k)?c.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,ue,pe,n.get(ee).__webglTexture,0,rt(k)):(pe===r.TEXTURE_2D||pe>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&pe<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,ue,pe,n.get(ee).__webglTexture,ge),t.bindFramebuffer(r.FRAMEBUFFER,null)}function fe(Y,k,ee){if(r.bindRenderbuffer(r.RENDERBUFFER,Y),k.depthBuffer&&!k.stencilBuffer){let ue=r.DEPTH_COMPONENT24;if(ee||Pe(k)){const pe=k.depthTexture;pe&&pe.isDepthTexture&&(pe.type===or?ue=r.DEPTH_COMPONENT32F:pe.type===wi&&(ue=r.DEPTH_COMPONENT24));const ge=rt(k);Pe(k)?c.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,ge,ue,k.width,k.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,ge,ue,k.width,k.height)}else r.renderbufferStorage(r.RENDERBUFFER,ue,k.width,k.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,Y)}else if(k.depthBuffer&&k.stencilBuffer){const ue=rt(k);ee&&Pe(k)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,ue,r.DEPTH24_STENCIL8,k.width,k.height):Pe(k)?c.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,ue,r.DEPTH24_STENCIL8,k.width,k.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,k.width,k.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,Y)}else{const ue=k.textures;for(let pe=0;pe<ue.length;pe++){const ge=ue[pe],Ue=s.convert(ge.format,ge.colorSpace),Ee=s.convert(ge.type),Qe=w(ge.internalFormat,Ue,Ee,ge.colorSpace),He=rt(k);ee&&Pe(k)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,He,Qe,k.width,k.height):Pe(k)?c.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,He,Qe,k.width,k.height):r.renderbufferStorage(r.RENDERBUFFER,Qe,k.width,k.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function Ae(Y,k){if(k&&k.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(r.FRAMEBUFFER,Y),!(k.depthTexture&&k.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(k.depthTexture).__webglTexture||k.depthTexture.image.width!==k.width||k.depthTexture.image.height!==k.height)&&(k.depthTexture.image.width=k.width,k.depthTexture.image.height=k.height,k.depthTexture.needsUpdate=!0),N(k.depthTexture,0);const ee=n.get(k.depthTexture).__webglTexture,ue=rt(k);if(k.depthTexture.format===rl)Pe(k)?c.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,ee,0,ue):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,ee,0);else if(k.depthTexture.format===$c)Pe(k)?c.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,ee,0,ue):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,ee,0);else throw new Error("Unknown depthTexture format")}function ve(Y){const k=n.get(Y),ee=Y.isWebGLCubeRenderTarget===!0;if(Y.depthTexture&&!k.__autoAllocateDepthBuffer){if(ee)throw new Error("target.depthTexture not supported in Cube render targets");Ae(k.__webglFramebuffer,Y)}else if(ee){k.__webglDepthbuffer=[];for(let ue=0;ue<6;ue++)t.bindFramebuffer(r.FRAMEBUFFER,k.__webglFramebuffer[ue]),k.__webglDepthbuffer[ue]=r.createRenderbuffer(),fe(k.__webglDepthbuffer[ue],Y,!1)}else t.bindFramebuffer(r.FRAMEBUFFER,k.__webglFramebuffer),k.__webglDepthbuffer=r.createRenderbuffer(),fe(k.__webglDepthbuffer,Y,!1);t.bindFramebuffer(r.FRAMEBUFFER,null)}function ye(Y,k,ee){const ue=n.get(Y);k!==void 0&&H(ue.__webglFramebuffer,Y,Y.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),ee!==void 0&&ve(Y)}function Oe(Y){const k=Y.texture,ee=n.get(Y),ue=n.get(k);Y.addEventListener("dispose",R);const pe=Y.textures,ge=Y.isWebGLCubeRenderTarget===!0,Ue=pe.length>1;if(Ue||(ue.__webglTexture===void 0&&(ue.__webglTexture=r.createTexture()),ue.__version=k.version,o.memory.textures++),ge){ee.__webglFramebuffer=[];for(let Ee=0;Ee<6;Ee++)if(k.mipmaps&&k.mipmaps.length>0){ee.__webglFramebuffer[Ee]=[];for(let Qe=0;Qe<k.mipmaps.length;Qe++)ee.__webglFramebuffer[Ee][Qe]=r.createFramebuffer()}else ee.__webglFramebuffer[Ee]=r.createFramebuffer()}else{if(k.mipmaps&&k.mipmaps.length>0){ee.__webglFramebuffer=[];for(let Ee=0;Ee<k.mipmaps.length;Ee++)ee.__webglFramebuffer[Ee]=r.createFramebuffer()}else ee.__webglFramebuffer=r.createFramebuffer();if(Ue)for(let Ee=0,Qe=pe.length;Ee<Qe;Ee++){const He=n.get(pe[Ee]);He.__webglTexture===void 0&&(He.__webglTexture=r.createTexture(),o.memory.textures++)}if(Y.samples>0&&Pe(Y)===!1){ee.__webglMultisampledFramebuffer=r.createFramebuffer(),ee.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,ee.__webglMultisampledFramebuffer);for(let Ee=0;Ee<pe.length;Ee++){const Qe=pe[Ee];ee.__webglColorRenderbuffer[Ee]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,ee.__webglColorRenderbuffer[Ee]);const He=s.convert(Qe.format,Qe.colorSpace),Ce=s.convert(Qe.type),Se=w(Qe.internalFormat,He,Ce,Qe.colorSpace,Y.isXRRenderTarget===!0),Ze=rt(Y);r.renderbufferStorageMultisample(r.RENDERBUFFER,Ze,Se,Y.width,Y.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ee,r.RENDERBUFFER,ee.__webglColorRenderbuffer[Ee])}r.bindRenderbuffer(r.RENDERBUFFER,null),Y.depthBuffer&&(ee.__webglDepthRenderbuffer=r.createRenderbuffer(),fe(ee.__webglDepthRenderbuffer,Y,!0)),t.bindFramebuffer(r.FRAMEBUFFER,null)}}if(ge){t.bindTexture(r.TEXTURE_CUBE_MAP,ue.__webglTexture),Q(r.TEXTURE_CUBE_MAP,k);for(let Ee=0;Ee<6;Ee++)if(k.mipmaps&&k.mipmaps.length>0)for(let Qe=0;Qe<k.mipmaps.length;Qe++)H(ee.__webglFramebuffer[Ee][Qe],Y,k,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,Qe);else H(ee.__webglFramebuffer[Ee],Y,k,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,0);m(k)&&_(r.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(Ue){for(let Ee=0,Qe=pe.length;Ee<Qe;Ee++){const He=pe[Ee],Ce=n.get(He);t.bindTexture(r.TEXTURE_2D,Ce.__webglTexture),Q(r.TEXTURE_2D,He),H(ee.__webglFramebuffer,Y,He,r.COLOR_ATTACHMENT0+Ee,r.TEXTURE_2D,0),m(He)&&_(r.TEXTURE_2D)}t.unbindTexture()}else{let Ee=r.TEXTURE_2D;if((Y.isWebGL3DRenderTarget||Y.isWebGLArrayRenderTarget)&&(Ee=Y.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),t.bindTexture(Ee,ue.__webglTexture),Q(Ee,k),k.mipmaps&&k.mipmaps.length>0)for(let Qe=0;Qe<k.mipmaps.length;Qe++)H(ee.__webglFramebuffer[Qe],Y,k,r.COLOR_ATTACHMENT0,Ee,Qe);else H(ee.__webglFramebuffer,Y,k,r.COLOR_ATTACHMENT0,Ee,0);m(k)&&_(Ee),t.unbindTexture()}Y.depthBuffer&&ve(Y)}function it(Y){const k=Y.textures;for(let ee=0,ue=k.length;ee<ue;ee++){const pe=k[ee];if(m(pe)){const ge=Y.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,Ue=n.get(pe).__webglTexture;t.bindTexture(ge,Ue),_(ge),t.unbindTexture()}}}function ae(Y){if(Y.samples>0&&Pe(Y)===!1){const k=Y.textures,ee=Y.width,ue=Y.height;let pe=r.COLOR_BUFFER_BIT;const ge=[],Ue=Y.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ee=n.get(Y),Qe=k.length>1;if(Qe)for(let He=0;He<k.length;He++)t.bindFramebuffer(r.FRAMEBUFFER,Ee.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+He,r.RENDERBUFFER,null),t.bindFramebuffer(r.FRAMEBUFFER,Ee.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+He,r.TEXTURE_2D,null,0);t.bindFramebuffer(r.READ_FRAMEBUFFER,Ee.__webglMultisampledFramebuffer),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ee.__webglFramebuffer);for(let He=0;He<k.length;He++){ge.push(r.COLOR_ATTACHMENT0+He),Y.depthBuffer&&ge.push(Ue);const Ce=Ee.__ignoreDepthValues!==void 0?Ee.__ignoreDepthValues:!1;if(Ce===!1&&(Y.depthBuffer&&(pe|=r.DEPTH_BUFFER_BIT),Y.stencilBuffer&&Ee.__isTransmissionRenderTarget!==!0&&(pe|=r.STENCIL_BUFFER_BIT)),Qe&&r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,Ee.__webglColorRenderbuffer[He]),Ce===!0&&(r.invalidateFramebuffer(r.READ_FRAMEBUFFER,[Ue]),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[Ue])),Qe){const Se=n.get(k[He]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,Se,0)}r.blitFramebuffer(0,0,ee,ue,0,0,ee,ue,pe,r.NEAREST),h&&r.invalidateFramebuffer(r.READ_FRAMEBUFFER,ge)}if(t.bindFramebuffer(r.READ_FRAMEBUFFER,null),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),Qe)for(let He=0;He<k.length;He++){t.bindFramebuffer(r.FRAMEBUFFER,Ee.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+He,r.RENDERBUFFER,Ee.__webglColorRenderbuffer[He]);const Ce=n.get(k[He]).__webglTexture;t.bindFramebuffer(r.FRAMEBUFFER,Ee.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+He,r.TEXTURE_2D,Ce,0)}t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ee.__webglMultisampledFramebuffer)}}function rt(Y){return Math.min(i.maxSamples,Y.samples)}function Pe(Y){const k=n.get(Y);return Y.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&k.__useRenderToTexture!==!1}function lt(Y){const k=o.render.frame;d.get(Y)!==k&&(d.set(Y,k),Y.update())}function Ye(Y,k){const ee=Y.colorSpace,ue=Y.format,pe=Y.type;return Y.isCompressedTexture===!0||Y.isVideoTexture===!0||ee!==Cr&&ee!==ps&&(Rt.getTransfer(ee)===Ht?(ue!==Ar||pe!==pr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ee)),k}function ct(Y){return typeof HTMLImageElement<"u"&&Y instanceof HTMLImageElement?(u.width=Y.naturalWidth||Y.width,u.height=Y.naturalHeight||Y.height):typeof VideoFrame<"u"&&Y instanceof VideoFrame?(u.width=Y.displayWidth,u.height=Y.displayHeight):(u.width=Y.width,u.height=Y.height),u}this.allocateTextureUnit=L,this.resetTextureUnits=M,this.setTexture2D=N,this.setTexture2DArray=j,this.setTexture3D=X,this.setTextureCube=K,this.rebindTextures=ye,this.setupRenderTarget=Oe,this.updateRenderTargetMipmap=it,this.updateMultisampleRenderTarget=ae,this.setupDepthRenderbuffer=ve,this.setupFrameBufferTexture=H,this.useMultisampledRTT=Pe}function BL(r,e){function t(n,i=ps){let s;const o=Rt.getTransfer(i);if(n===pr)return r.UNSIGNED_BYTE;if(n===jy)return r.UNSIGNED_SHORT_4_4_4_4;if(n===Wy)return r.UNSIGNED_SHORT_5_5_5_1;if(n===JB)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===uA)return r.BYTE;if(n===Vy)return r.SHORT;if(n===hA)return r.UNSIGNED_SHORT;if(n===Jc)return r.INT;if(n===wi)return r.UNSIGNED_INT;if(n===or)return r.FLOAT;if(n===_n)return r.HALF_FLOAT;if(n===ZB)return r.ALPHA;if(n===$B)return r.RGB;if(n===Ar)return r.RGBA;if(n===eb)return r.LUMINANCE;if(n===tb)return r.LUMINANCE_ALPHA;if(n===rl)return r.DEPTH_COMPONENT;if(n===$c)return r.DEPTH_STENCIL;if(n===$s)return r.RED;if(n===dA)return r.RED_INTEGER;if(n===no)return r.RG;if(n===qh)return r.RG_INTEGER;if(n===eu)return r.RGBA_INTEGER;if(n===Xh||n===fA||n===pA||n===Kh)if(o===Ht)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===Xh)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===fA)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===pA)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Kh)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===Xh)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===fA)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===pA)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Kh)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===AA||n===Yy||n===gA||n===qy)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===AA)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Yy)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===gA)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===qy)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===mA)return s=e.get("WEBGL_compressed_texture_etc1"),s!==null?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(n===_A||n===vA)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(n===_A)return o===Ht?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===vA)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===yA||n===Xy||n===Ky||n===Jy||n===Jh||n===Zy||n===$y||n===eE||n===tE||n===rE||n===nE||n===iE||n===sE||n===aE)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(n===yA)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Xy)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Ky)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Jy)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Jh)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Zy)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===$y)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===eE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===tE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===rE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===nE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===iE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===sE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===aE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===Zh||n===oE||n===lE)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(n===Zh)return o===Ht?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===oE)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===lE)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===rb||n===cE||n===uE||n===hE)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(n===Zh)return s.COMPRESSED_RED_RGTC1_EXT;if(n===cE)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===uE)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===hE)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Zc?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:t}}class bL extends cn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class aa extends Zt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const RL={type:"move"};class eg{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new aa,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new aa,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new W,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new W),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new aa,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new W,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new W),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let i=null,s=null,o=null;const c=this._targetRay,h=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){o=!0;for(const E of e.hand.values()){const m=t.getJointPose(E,n),_=this._getHandJoint(u,E);m!==null&&(_.matrix.fromArray(m.transform.matrix),_.matrix.decompose(_.position,_.rotation,_.scale),_.matrixWorldNeedsUpdate=!0,_.jointRadius=m.radius),_.visible=m!==null}const d=u.joints["index-finger-tip"],A=u.joints["thumb-tip"],p=d.position.distanceTo(A.position),g=.02,v=.005;u.inputState.pinching&&p>g+v?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&p<=g-v&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else h!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(h.matrix.fromArray(s.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale),h.matrixWorldNeedsUpdate=!0,s.linearVelocity?(h.hasLinearVelocity=!0,h.linearVelocity.copy(s.linearVelocity)):h.hasLinearVelocity=!1,s.angularVelocity?(h.hasAngularVelocity=!0,h.angularVelocity.copy(s.angularVelocity)):h.hasAngularVelocity=!1));c!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(c.matrix.fromArray(i.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,i.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(i.linearVelocity)):c.hasLinearVelocity=!1,i.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(i.angularVelocity)):c.hasAngularVelocity=!1,this.dispatchEvent(RL)))}return c!==null&&(c.visible=i!==null),h!==null&&(h.visible=s!==null),u!==null&&(u.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new aa;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}const DL=`
3805
3805
  void main() {
3806
3806
 
3807
3807
  gl_Position = vec4( position, 1.0 );
@@ -3825,7 +3825,7 @@ void main() {
3825
3825
 
3826
3826
  }
3827
3827
 
3828
- }`;class NL{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const i=new Sr,s=e.properties.get(i);s.__webglTexture=t.texture,(t.depthNear!=n.depthNear||t.depthFar!=n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}render(e,t){if(this.texture!==null){if(this.mesh===null){const n=t.cameras[0].viewport,i=new vn({vertexShader:DL,fragmentShader:LL,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new Wr(new du(20,20),i)}e.render(this.mesh,t)}}reset(){this.texture=null,this.mesh=null}}class UL extends io{constructor(e,t){super();const n=this;let i=null,s=1,o=null,c="local-floor",h=1,u=null,d=null,A=null,p=null,g=null,v=null;const E=new NL,m=t.getContextAttributes();let _=null,w=null;const x=[],I=[],R=new Ge;let S=null;const T=new cn;T.layers.enable(1),T.viewport=new Ft;const D=new cn;D.layers.enable(2),D.viewport=new Ft;const b=[T,D],M=new bL;M.layers.enable(1),M.layers.enable(2);let L=null,P=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(H){let fe=x[H];return fe===void 0&&(fe=new eg,x[H]=fe),fe.getTargetRaySpace()},this.getControllerGrip=function(H){let fe=x[H];return fe===void 0&&(fe=new eg,x[H]=fe),fe.getGripSpace()},this.getHand=function(H){let fe=x[H];return fe===void 0&&(fe=new eg,x[H]=fe),fe.getHandSpace()};function N(H){const fe=I.indexOf(H.inputSource);if(fe===-1)return;const Ae=x[fe];Ae!==void 0&&(Ae.update(H.inputSource,H.frame,u||o),Ae.dispatchEvent({type:H.type,data:H.inputSource}))}function j(){i.removeEventListener("select",N),i.removeEventListener("selectstart",N),i.removeEventListener("selectend",N),i.removeEventListener("squeeze",N),i.removeEventListener("squeezestart",N),i.removeEventListener("squeezeend",N),i.removeEventListener("end",j),i.removeEventListener("inputsourceschange",X);for(let H=0;H<x.length;H++){const fe=I[H];fe!==null&&(I[H]=null,x[H].disconnect(fe))}L=null,P=null,E.reset(),e.setRenderTarget(_),g=null,p=null,A=null,i=null,w=null,re.stop(),n.isPresenting=!1,e.setPixelRatio(S),e.setSize(R.width,R.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(H){s=H,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(H){c=H,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||o},this.setReferenceSpace=function(H){u=H},this.getBaseLayer=function(){return p!==null?p:g},this.getBinding=function(){return A},this.getFrame=function(){return v},this.getSession=function(){return i},this.setSession=async function(H){if(i=H,i!==null){if(_=e.getRenderTarget(),i.addEventListener("select",N),i.addEventListener("selectstart",N),i.addEventListener("selectend",N),i.addEventListener("squeeze",N),i.addEventListener("squeezestart",N),i.addEventListener("squeezeend",N),i.addEventListener("end",j),i.addEventListener("inputsourceschange",X),m.xrCompatible!==!0&&await t.makeXRCompatible(),S=e.getPixelRatio(),e.getSize(R),i.renderState.layers===void 0){const fe={antialias:m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:s};g=new XRWebGLLayer(i,t,fe),i.updateRenderState({baseLayer:g}),e.setPixelRatio(1),e.setSize(g.framebufferWidth,g.framebufferHeight,!1),w=new Mi(g.framebufferWidth,g.framebufferHeight,{format:Ar,type:pr,colorSpace:e.outputColorSpace,stencilBuffer:m.stencil})}else{let fe=null,Ae=null,ve=null;m.depth&&(ve=m.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,fe=m.stencil?$c:rl,Ae=m.stencil?Zc:wi);const ye={colorFormat:t.RGBA8,depthFormat:ve,scaleFactor:s};A=new XRWebGLBinding(i,t),p=A.createProjectionLayer(ye),i.updateRenderState({layers:[p]}),e.setPixelRatio(1),e.setSize(p.textureWidth,p.textureHeight,!1),w=new Mi(p.textureWidth,p.textureHeight,{format:Ar,type:pr,depthTexture:new s2(p.textureWidth,p.textureHeight,Ae,void 0,void 0,void 0,void 0,void 0,void 0,fe),stencilBuffer:m.stencil,colorSpace:e.outputColorSpace,samples:m.antialias?4:0});const Oe=e.properties.get(w);Oe.__ignoreDepthValues=p.ignoreDepthValues}w.isXRRenderTarget=!0,this.setFoveation(h),u=null,o=await i.requestReferenceSpace(c),re.setContext(i),re.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode};function X(H){for(let fe=0;fe<H.removed.length;fe++){const Ae=H.removed[fe],ve=I.indexOf(Ae);ve>=0&&(I[ve]=null,x[ve].disconnect(Ae))}for(let fe=0;fe<H.added.length;fe++){const Ae=H.added[fe];let ve=I.indexOf(Ae);if(ve===-1){for(let Oe=0;Oe<x.length;Oe++)if(Oe>=I.length){I.push(Ae),ve=Oe;break}else if(I[Oe]===null){I[Oe]=Ae,ve=Oe;break}if(ve===-1)break}const ye=x[ve];ye&&ye.connect(Ae)}}const K=new W,ne=new W;function V(H,fe,Ae){K.setFromMatrixPosition(fe.matrixWorld),ne.setFromMatrixPosition(Ae.matrixWorld);const ve=K.distanceTo(ne),ye=fe.projectionMatrix.elements,Oe=Ae.projectionMatrix.elements,it=ye[14]/(ye[10]-1),ae=ye[14]/(ye[10]+1),rt=(ye[9]+1)/ye[5],Pe=(ye[9]-1)/ye[5],lt=(ye[8]-1)/ye[0],Ye=(Oe[8]+1)/Oe[0],ct=it*lt,Y=it*Ye,k=ve/(-lt+Ye),ee=k*-lt;fe.matrixWorld.decompose(H.position,H.quaternion,H.scale),H.translateX(ee),H.translateZ(k),H.matrixWorld.compose(H.position,H.quaternion,H.scale),H.matrixWorldInverse.copy(H.matrixWorld).invert();const ue=it+k,pe=ae+k,ge=ct-ee,Ue=Y+(ve-ee),Ee=rt*ae/pe*ue,Qe=Pe*ae/pe*ue;H.projectionMatrix.makePerspective(ge,Ue,Ee,Qe,ue,pe),H.projectionMatrixInverse.copy(H.projectionMatrix).invert()}function te(H,fe){fe===null?H.matrixWorld.copy(H.matrix):H.matrixWorld.multiplyMatrices(fe.matrixWorld,H.matrix),H.matrixWorldInverse.copy(H.matrixWorld).invert()}this.updateCamera=function(H){if(i===null)return;E.texture!==null&&(H.near=E.depthNear,H.far=E.depthFar),M.near=D.near=T.near=H.near,M.far=D.far=T.far=H.far,(L!==M.near||P!==M.far)&&(i.updateRenderState({depthNear:M.near,depthFar:M.far}),L=M.near,P=M.far,T.near=L,T.far=P,D.near=L,D.far=P,T.updateProjectionMatrix(),D.updateProjectionMatrix(),H.updateProjectionMatrix());const fe=H.parent,Ae=M.cameras;te(M,fe);for(let ve=0;ve<Ae.length;ve++)te(Ae[ve],fe);Ae.length===2?V(M,T,D):M.projectionMatrix.copy(T.projectionMatrix),Q(H,M,fe)};function Q(H,fe,Ae){Ae===null?H.matrix.copy(fe.matrixWorld):(H.matrix.copy(Ae.matrixWorld),H.matrix.invert(),H.matrix.multiply(fe.matrixWorld)),H.matrix.decompose(H.position,H.quaternion,H.scale),H.updateMatrixWorld(!0),H.projectionMatrix.copy(fe.projectionMatrix),H.projectionMatrixInverse.copy(fe.projectionMatrixInverse),H.isPerspectiveCamera&&(H.fov=sl*2*Math.atan(1/H.projectionMatrix.elements[5]),H.zoom=1)}this.getCamera=function(){return M},this.getFoveation=function(){if(!(p===null&&g===null))return h},this.setFoveation=function(H){h=H,p!==null&&(p.fixedFoveation=H),g!==null&&g.fixedFoveation!==void 0&&(g.fixedFoveation=H)},this.hasDepthSensing=function(){return E.texture!==null};let z=null;function Z(H,fe){if(d=fe.getViewerPose(u||o),v=fe,d!==null){const Ae=d.views;g!==null&&(e.setRenderTargetFramebuffer(w,g.framebuffer),e.setRenderTarget(w));let ve=!1;Ae.length!==M.cameras.length&&(M.cameras.length=0,ve=!0);for(let Oe=0;Oe<Ae.length;Oe++){const it=Ae[Oe];let ae=null;if(g!==null)ae=g.getViewport(it);else{const Pe=A.getViewSubImage(p,it);ae=Pe.viewport,Oe===0&&(e.setRenderTargetTextures(w,Pe.colorTexture,p.ignoreDepthValues?void 0:Pe.depthStencilTexture),e.setRenderTarget(w))}let rt=b[Oe];rt===void 0&&(rt=new cn,rt.layers.enable(Oe),rt.viewport=new Ft,b[Oe]=rt),rt.matrix.fromArray(it.transform.matrix),rt.matrix.decompose(rt.position,rt.quaternion,rt.scale),rt.projectionMatrix.fromArray(it.projectionMatrix),rt.projectionMatrixInverse.copy(rt.projectionMatrix).invert(),rt.viewport.set(ae.x,ae.y,ae.width,ae.height),Oe===0&&(M.matrix.copy(rt.matrix),M.matrix.decompose(M.position,M.quaternion,M.scale)),ve===!0&&M.cameras.push(rt)}const ye=i.enabledFeatures;if(ye&&ye.includes("depth-sensing")){const Oe=A.getDepthInformation(Ae[0]);Oe&&Oe.isValid&&Oe.texture&&E.init(e,Oe,i.renderState)}}for(let Ae=0;Ae<x.length;Ae++){const ve=I[Ae],ye=x[Ae];ve!==null&&ye!==void 0&&ye.update(ve,fe,u||o)}E.render(e,M),z&&z(H,fe),fe.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:fe}),v=null}const re=new JE;re.setAnimationLoop(Z),this.setAnimationLoop=function(H){z=H},this.dispose=function(){}}}const fo=new Wi,PL=new tt;function kL(r,e){function t(m,_){m.matrixAutoUpdate===!0&&m.updateMatrix(),_.value.copy(m.matrix)}function n(m,_){_.color.getRGB(m.fogColor.value,WE(r)),_.isFog?(m.fogNear.value=_.near,m.fogFar.value=_.far):_.isFogExp2&&(m.fogDensity.value=_.density)}function i(m,_,w,x,I){_.isMeshBasicMaterial||_.isMeshLambertMaterial?s(m,_):_.isMeshToonMaterial?(s(m,_),A(m,_)):_.isMeshPhongMaterial?(s(m,_),d(m,_)):_.isMeshStandardMaterial?(s(m,_),p(m,_),_.isMeshPhysicalMaterial&&g(m,_,I)):_.isMeshMatcapMaterial?(s(m,_),v(m,_)):_.isMeshDepthMaterial?s(m,_):_.isMeshDistanceMaterial?(s(m,_),E(m,_)):_.isMeshNormalMaterial?s(m,_):_.isLineBasicMaterial?(o(m,_),_.isLineDashedMaterial&&c(m,_)):_.isPointsMaterial?h(m,_,w,x):_.isSpriteMaterial?u(m,_):_.isShadowMaterial?(m.color.value.copy(_.color),m.opacity.value=_.opacity):_.isShaderMaterial&&(_.uniformsNeedUpdate=!1)}function s(m,_){m.opacity.value=_.opacity,_.color&&m.diffuse.value.copy(_.color),_.emissive&&m.emissive.value.copy(_.emissive).multiplyScalar(_.emissiveIntensity),_.map&&(m.map.value=_.map,t(_.map,m.mapTransform)),_.alphaMap&&(m.alphaMap.value=_.alphaMap,t(_.alphaMap,m.alphaMapTransform)),_.bumpMap&&(m.bumpMap.value=_.bumpMap,t(_.bumpMap,m.bumpMapTransform),m.bumpScale.value=_.bumpScale,_.side===Pr&&(m.bumpScale.value*=-1)),_.normalMap&&(m.normalMap.value=_.normalMap,t(_.normalMap,m.normalMapTransform),m.normalScale.value.copy(_.normalScale),_.side===Pr&&m.normalScale.value.negate()),_.displacementMap&&(m.displacementMap.value=_.displacementMap,t(_.displacementMap,m.displacementMapTransform),m.displacementScale.value=_.displacementScale,m.displacementBias.value=_.displacementBias),_.emissiveMap&&(m.emissiveMap.value=_.emissiveMap,t(_.emissiveMap,m.emissiveMapTransform)),_.specularMap&&(m.specularMap.value=_.specularMap,t(_.specularMap,m.specularMapTransform)),_.alphaTest>0&&(m.alphaTest.value=_.alphaTest);const w=e.get(_),x=w.envMap,I=w.envMapRotation;if(x&&(m.envMap.value=x,fo.copy(I),fo.x*=-1,fo.y*=-1,fo.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(fo.y*=-1,fo.z*=-1),m.envMapRotation.value.setFromMatrix4(PL.makeRotationFromEuler(fo)),m.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=_.reflectivity,m.ior.value=_.ior,m.refractionRatio.value=_.refractionRatio),_.lightMap){m.lightMap.value=_.lightMap;const R=r._useLegacyLights===!0?Math.PI:1;m.lightMapIntensity.value=_.lightMapIntensity*R,t(_.lightMap,m.lightMapTransform)}_.aoMap&&(m.aoMap.value=_.aoMap,m.aoMapIntensity.value=_.aoMapIntensity,t(_.aoMap,m.aoMapTransform))}function o(m,_){m.diffuse.value.copy(_.color),m.opacity.value=_.opacity,_.map&&(m.map.value=_.map,t(_.map,m.mapTransform))}function c(m,_){m.dashSize.value=_.dashSize,m.totalSize.value=_.dashSize+_.gapSize,m.scale.value=_.scale}function h(m,_,w,x){m.diffuse.value.copy(_.color),m.opacity.value=_.opacity,m.size.value=_.size*w,m.scale.value=x*.5,_.map&&(m.map.value=_.map,t(_.map,m.uvTransform)),_.alphaMap&&(m.alphaMap.value=_.alphaMap,t(_.alphaMap,m.alphaMapTransform)),_.alphaTest>0&&(m.alphaTest.value=_.alphaTest)}function u(m,_){m.diffuse.value.copy(_.color),m.opacity.value=_.opacity,m.rotation.value=_.rotation,_.map&&(m.map.value=_.map,t(_.map,m.mapTransform)),_.alphaMap&&(m.alphaMap.value=_.alphaMap,t(_.alphaMap,m.alphaMapTransform)),_.alphaTest>0&&(m.alphaTest.value=_.alphaTest)}function d(m,_){m.specular.value.copy(_.specular),m.shininess.value=Math.max(_.shininess,1e-4)}function A(m,_){_.gradientMap&&(m.gradientMap.value=_.gradientMap)}function p(m,_){m.metalness.value=_.metalness,_.metalnessMap&&(m.metalnessMap.value=_.metalnessMap,t(_.metalnessMap,m.metalnessMapTransform)),m.roughness.value=_.roughness,_.roughnessMap&&(m.roughnessMap.value=_.roughnessMap,t(_.roughnessMap,m.roughnessMapTransform)),_.envMap&&(m.envMapIntensity.value=_.envMapIntensity)}function g(m,_,w){m.ior.value=_.ior,_.sheen>0&&(m.sheenColor.value.copy(_.sheenColor).multiplyScalar(_.sheen),m.sheenRoughness.value=_.sheenRoughness,_.sheenColorMap&&(m.sheenColorMap.value=_.sheenColorMap,t(_.sheenColorMap,m.sheenColorMapTransform)),_.sheenRoughnessMap&&(m.sheenRoughnessMap.value=_.sheenRoughnessMap,t(_.sheenRoughnessMap,m.sheenRoughnessMapTransform))),_.clearcoat>0&&(m.clearcoat.value=_.clearcoat,m.clearcoatRoughness.value=_.clearcoatRoughness,_.clearcoatMap&&(m.clearcoatMap.value=_.clearcoatMap,t(_.clearcoatMap,m.clearcoatMapTransform)),_.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=_.clearcoatRoughnessMap,t(_.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),_.clearcoatNormalMap&&(m.clearcoatNormalMap.value=_.clearcoatNormalMap,t(_.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(_.clearcoatNormalScale),_.side===Pr&&m.clearcoatNormalScale.value.negate())),_.iridescence>0&&(m.iridescence.value=_.iridescence,m.iridescenceIOR.value=_.iridescenceIOR,m.iridescenceThicknessMinimum.value=_.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=_.iridescenceThicknessRange[1],_.iridescenceMap&&(m.iridescenceMap.value=_.iridescenceMap,t(_.iridescenceMap,m.iridescenceMapTransform)),_.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=_.iridescenceThicknessMap,t(_.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),_.transmission>0&&(m.transmission.value=_.transmission,m.transmissionSamplerMap.value=w.texture,m.transmissionSamplerSize.value.set(w.width,w.height),_.transmissionMap&&(m.transmissionMap.value=_.transmissionMap,t(_.transmissionMap,m.transmissionMapTransform)),m.thickness.value=_.thickness,_.thicknessMap&&(m.thicknessMap.value=_.thicknessMap,t(_.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=_.attenuationDistance,m.attenuationColor.value.copy(_.attenuationColor)),_.anisotropy>0&&(m.anisotropyVector.value.set(_.anisotropy*Math.cos(_.anisotropyRotation),_.anisotropy*Math.sin(_.anisotropyRotation)),_.anisotropyMap&&(m.anisotropyMap.value=_.anisotropyMap,t(_.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=_.specularIntensity,m.specularColor.value.copy(_.specularColor),_.specularColorMap&&(m.specularColorMap.value=_.specularColorMap,t(_.specularColorMap,m.specularColorMapTransform)),_.specularIntensityMap&&(m.specularIntensityMap.value=_.specularIntensityMap,t(_.specularIntensityMap,m.specularIntensityMapTransform))}function v(m,_){_.matcap&&(m.matcap.value=_.matcap)}function E(m,_){const w=e.get(_).light;m.referencePosition.value.setFromMatrixPosition(w.matrixWorld),m.nearDistance.value=w.shadow.camera.near,m.farDistance.value=w.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function QL(r,e,t,n){let i={},s={},o=[];const c=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function h(w,x){const I=x.program;n.uniformBlockBinding(w,I)}function u(w,x){let I=i[w.id];I===void 0&&(v(w),I=d(w),i[w.id]=I,w.addEventListener("dispose",m));const R=x.program;n.updateUBOMapping(w,R);const S=e.render.frame;s[w.id]!==S&&(p(w),s[w.id]=S)}function d(w){const x=A();w.__bindingPointIndex=x;const I=r.createBuffer(),R=w.__size,S=w.usage;return r.bindBuffer(r.UNIFORM_BUFFER,I),r.bufferData(r.UNIFORM_BUFFER,R,S),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,x,I),I}function A(){for(let w=0;w<c;w++)if(o.indexOf(w)===-1)return o.push(w),w;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function p(w){const x=i[w.id],I=w.uniforms,R=w.__cache;r.bindBuffer(r.UNIFORM_BUFFER,x);for(let S=0,T=I.length;S<T;S++){const D=Array.isArray(I[S])?I[S]:[I[S]];for(let b=0,M=D.length;b<M;b++){const L=D[b];if(g(L,S,b,R)===!0){const P=L.__offset,N=Array.isArray(L.value)?L.value:[L.value];let j=0;for(let X=0;X<N.length;X++){const K=N[X],ne=E(K);typeof K=="number"||typeof K=="boolean"?(L.__data[0]=K,r.bufferSubData(r.UNIFORM_BUFFER,P+j,L.__data)):K.isMatrix3?(L.__data[0]=K.elements[0],L.__data[1]=K.elements[1],L.__data[2]=K.elements[2],L.__data[3]=0,L.__data[4]=K.elements[3],L.__data[5]=K.elements[4],L.__data[6]=K.elements[5],L.__data[7]=0,L.__data[8]=K.elements[6],L.__data[9]=K.elements[7],L.__data[10]=K.elements[8],L.__data[11]=0):(K.toArray(L.__data,j),j+=ne.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,P,L.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function g(w,x,I,R){const S=w.value,T=x+"_"+I;if(R[T]===void 0)return typeof S=="number"||typeof S=="boolean"?R[T]=S:R[T]=S.clone(),!0;{const D=R[T];if(typeof S=="number"||typeof S=="boolean"){if(D!==S)return R[T]=S,!0}else if(D.equals(S)===!1)return D.copy(S),!0}return!1}function v(w){const x=w.uniforms;let I=0;const R=16;for(let T=0,D=x.length;T<D;T++){const b=Array.isArray(x[T])?x[T]:[x[T]];for(let M=0,L=b.length;M<L;M++){const P=b[M],N=Array.isArray(P.value)?P.value:[P.value];for(let j=0,X=N.length;j<X;j++){const K=N[j],ne=E(K),V=I%R;V!==0&&R-V<ne.boundary&&(I+=R-V),P.__data=new Float32Array(ne.storage/Float32Array.BYTES_PER_ELEMENT),P.__offset=I,I+=ne.storage}}}const S=I%R;return S>0&&(I+=R-S),w.__size=I,w.__cache={},this}function E(w){const x={boundary:0,storage:0};return typeof w=="number"||typeof w=="boolean"?(x.boundary=4,x.storage=4):w.isVector2?(x.boundary=8,x.storage=8):w.isVector3||w.isColor?(x.boundary=16,x.storage=12):w.isVector4?(x.boundary=16,x.storage=16):w.isMatrix3?(x.boundary=48,x.storage=48):w.isMatrix4?(x.boundary=64,x.storage=64):w.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",w),x}function m(w){const x=w.target;x.removeEventListener("dispose",m);const I=o.indexOf(x.__bindingPointIndex);o.splice(I,1),r.deleteBuffer(i[x.id]),delete i[x.id],delete s[x.id]}function _(){for(const w in i)r.deleteBuffer(i[w]);o=[],i={},s={}}return{bind:h,update:u,dispose:_}}class OL{constructor(e={}){const{canvas:t=Rb(),context:n=null,depth:i=!0,stencil:s=!1,alpha:o=!1,antialias:c=!1,premultipliedAlpha:h=!0,preserveDrawingBuffer:u=!1,powerPreference:d="default",failIfMajorPerformanceCaveat:A=!1}=e;this.isWebGLRenderer=!0;let p;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=n.getContextAttributes().alpha}else p=o;const g=new Uint32Array(4),v=new Int32Array(4);let E=null,m=null;const _=[],w=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=kr,this._useLegacyLights=!1,this.toneMapping=Js,this.toneMappingExposure=1;const x=this;let I=!1,R=0,S=0,T=null,D=-1,b=null;const M=new Ft,L=new Ft;let P=null;const N=new qe(0);let j=0,X=t.width,K=t.height,ne=1,V=null,te=null;const Q=new Ft(0,0,X,K),z=new Ft(0,0,X,K);let Z=!1;const re=new jA;let H=!1,fe=!1;const Ae=new tt,ve=new Ge,ye=new W,Oe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function it(){return T===null?ne:1}let ae=n;function rt(F,ie){const he=t.getContext(F,ie);return he!==null?he:null}try{const F={alpha:!0,depth:i,stencil:s,antialias:c,premultipliedAlpha:h,preserveDrawingBuffer:u,powerPreference:d,failIfMajorPerformanceCaveat:A};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Gh}`),t.addEventListener("webglcontextlost",me,!1),t.addEventListener("webglcontextrestored",_e,!1),t.addEventListener("webglcontextcreationerror",Fe,!1),ae===null){const ie="webgl2";if(ae=rt(ie,F),ae===null)throw rt(ie)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(F){throw console.error("THREE.WebGLRenderer: "+F.message),F}let Pe,lt,Ye,ct,Y,k,ee,ue,pe,ge,Ue,Ee,Qe,He,Ce,Se,Ze,Ne,Re,at,ft,yt,_t,Et;function G(){Pe=new q6(ae),Pe.init(),lt=new H6(ae,Pe,e),yt=new BL(ae,Pe),Ye=new SL(ae),ct=new J6(ae),Y=new pL,k=new TL(ae,Pe,Ye,Y,lt,yt,ct),ee=new V6(x),ue=new Y6(x),pe=new n5(ae),_t=new F6(ae,pe),ge=new X6(ae,pe,ct,_t),Ue=new $6(ae,ge,pe,ct),Re=new Z6(ae,lt,k),Se=new G6(Y),Ee=new fL(x,ee,ue,Pe,lt,_t,Se),Qe=new kL(x,Y),He=new gL,Ce=new xL(Pe),Ne=new O6(x,ee,ue,Ye,Ue,p,h),Ze=new ML(x,Ue,lt),Et=new QL(ae,ct,lt,Ye),at=new z6(ae,Pe,ct),ft=new K6(ae,Pe,ct),ct.programs=Ee.programs,x.capabilities=lt,x.extensions=Pe,x.properties=Y,x.renderLists=He,x.shadowMap=Ze,x.state=Ye,x.info=ct}G();const O=new UL(x,ae);this.xr=O,this.getContext=function(){return ae},this.getContextAttributes=function(){return ae.getContextAttributes()},this.forceContextLoss=function(){const F=Pe.get("WEBGL_lose_context");F&&F.loseContext()},this.forceContextRestore=function(){const F=Pe.get("WEBGL_lose_context");F&&F.restoreContext()},this.getPixelRatio=function(){return ne},this.setPixelRatio=function(F){F!==void 0&&(ne=F,this.setSize(X,K,!1))},this.getSize=function(F){return F.set(X,K)},this.setSize=function(F,ie,he=!0){if(O.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}X=F,K=ie,t.width=Math.floor(F*ne),t.height=Math.floor(ie*ne),he===!0&&(t.style.width=F+"px",t.style.height=ie+"px"),this.setViewport(0,0,F,ie)},this.getDrawingBufferSize=function(F){return F.set(X*ne,K*ne).floor()},this.setDrawingBufferSize=function(F,ie,he){X=F,K=ie,ne=he,t.width=Math.floor(F*he),t.height=Math.floor(ie*he),this.setViewport(0,0,F,ie)},this.getCurrentViewport=function(F){return F.copy(M)},this.getViewport=function(F){return F.copy(Q)},this.setViewport=function(F,ie,he,de){F.isVector4?Q.set(F.x,F.y,F.z,F.w):Q.set(F,ie,he,de),Ye.viewport(M.copy(Q).multiplyScalar(ne).round())},this.getScissor=function(F){return F.copy(z)},this.setScissor=function(F,ie,he,de){F.isVector4?z.set(F.x,F.y,F.z,F.w):z.set(F,ie,he,de),Ye.scissor(L.copy(z).multiplyScalar(ne).round())},this.getScissorTest=function(){return Z},this.setScissorTest=function(F){Ye.setScissorTest(Z=F)},this.setOpaqueSort=function(F){V=F},this.setTransparentSort=function(F){te=F},this.getClearColor=function(F){return F.copy(Ne.getClearColor())},this.setClearColor=function(){Ne.setClearColor.apply(Ne,arguments)},this.getClearAlpha=function(){return Ne.getClearAlpha()},this.setClearAlpha=function(){Ne.setClearAlpha.apply(Ne,arguments)},this.clear=function(F=!0,ie=!0,he=!0){let de=0;if(F){let le=!1;if(T!==null){const Be=T.texture.format;le=Be===eu||Be===qh||Be===dA}if(le){const Be=T.texture.type,Xe=Be===pr||Be===wi||Be===hA||Be===Zc||Be===jy||Be===Wy,et=Ne.getClearColor(),nt=Ne.getClearAlpha(),We=et.r,ut=et.g,ot=et.b;Xe?(g[0]=We,g[1]=ut,g[2]=ot,g[3]=nt,ae.clearBufferuiv(ae.COLOR,0,g)):(v[0]=We,v[1]=ut,v[2]=ot,v[3]=nt,ae.clearBufferiv(ae.COLOR,0,v))}else de|=ae.COLOR_BUFFER_BIT}ie&&(de|=ae.DEPTH_BUFFER_BIT),he&&(de|=ae.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),ae.clear(de)},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(){t.removeEventListener("webglcontextlost",me,!1),t.removeEventListener("webglcontextrestored",_e,!1),t.removeEventListener("webglcontextcreationerror",Fe,!1),He.dispose(),Ce.dispose(),Y.dispose(),ee.dispose(),ue.dispose(),Ue.dispose(),_t.dispose(),Et.dispose(),Ee.dispose(),O.dispose(),O.removeEventListener("sessionstart",ur),O.removeEventListener("sessionend",Vt),mr.stop()};function me(F){F.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),I=!0}function _e(){console.log("THREE.WebGLRenderer: Context Restored."),I=!1;const F=ct.autoReset,ie=Ze.enabled,he=Ze.autoUpdate,de=Ze.needsUpdate,le=Ze.type;G(),ct.autoReset=F,Ze.enabled=ie,Ze.autoUpdate=he,Ze.needsUpdate=de,Ze.type=le}function Fe(F){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",F.statusMessage)}function De(F){const ie=F.target;ie.removeEventListener("dispose",De),pt(ie)}function pt(F){Dt(F),Y.remove(F)}function Dt(F){const ie=Y.get(F).programs;ie!==void 0&&(ie.forEach(function(he){Ee.releaseProgram(he)}),F.isShaderMaterial&&Ee.releaseShaderCache(F))}this.renderBufferDirect=function(F,ie,he,de,le,Be){ie===null&&(ie=Oe);const Xe=le.isMesh&&le.matrixWorld.determinant()<0,et=Ym(F,ie,he,de,le);Ye.setMaterial(de,Xe);let nt=he.index,We=1;if(de.wireframe===!0){if(nt=ge.getWireframeAttribute(he),nt===void 0)return;We=2}const ut=he.drawRange,ot=he.attributes.position;let Rr=ut.start*We,er=(ut.start+ut.count)*We;Be!==null&&(Rr=Math.max(Rr,Be.start*We),er=Math.min(er,(Be.start+Be.count)*We)),nt!==null?(Rr=Math.max(Rr,0),er=Math.min(er,nt.count)):ot!=null&&(Rr=Math.max(Rr,0),er=Math.min(er,ot.count));const Bn=er-Rr;if(Bn<0||Bn===1/0)return;_t.setup(le,de,et,he,nt);let hi,jt=at;if(nt!==null&&(hi=pe.get(nt),jt=ft,jt.setIndex(hi)),le.isMesh)de.wireframe===!0?(Ye.setLineWidth(de.wireframeLinewidth*it()),jt.setMode(ae.LINES)):jt.setMode(ae.TRIANGLES);else if(le.isLine){let $e=de.linewidth;$e===void 0&&($e=1),Ye.setLineWidth($e*it()),le.isLineSegments?jt.setMode(ae.LINES):le.isLineLoop?jt.setMode(ae.LINE_LOOP):jt.setMode(ae.LINE_STRIP)}else le.isPoints?jt.setMode(ae.POINTS):le.isSprite&&jt.setMode(ae.TRIANGLES);if(le.isBatchedMesh)jt.renderMultiDraw(le._multiDrawStarts,le._multiDrawCounts,le._multiDrawCount);else if(le.isInstancedMesh)jt.renderInstances(Rr,Bn,le.count);else if(he.isInstancedBufferGeometry){const $e=he._maxInstanceCount!==void 0?he._maxInstanceCount:1/0,ju=Math.min(he.instanceCount,$e);jt.renderInstances(Rr,Bn,ju)}else jt.render(Rr,Bn)};function Lt(F,ie,he){F.transparent===!0&&F.side===yi&&F.forceSinglePass===!1?(F.side=Pr,F.needsUpdate=!0,Ns(F,ie,he),F.side=vi,F.needsUpdate=!0,Ns(F,ie,he),F.side=yi):Ns(F,ie,he)}this.compile=function(F,ie,he=null){he===null&&(he=F),m=Ce.get(he),m.init(),w.push(m),he.traverseVisible(function(le){le.isLight&&le.layers.test(ie.layers)&&(m.pushLight(le),le.castShadow&&m.pushShadow(le))}),F!==he&&F.traverseVisible(function(le){le.isLight&&le.layers.test(ie.layers)&&(m.pushLight(le),le.castShadow&&m.pushShadow(le))}),m.setupLights(x._useLegacyLights);const de=new Set;return F.traverse(function(le){const Be=le.material;if(Be)if(Array.isArray(Be))for(let Xe=0;Xe<Be.length;Xe++){const et=Be[Xe];Lt(et,he,le),de.add(et)}else Lt(Be,he,le),de.add(Be)}),w.pop(),m=null,de},this.compileAsync=function(F,ie,he=null){const de=this.compile(F,ie,he);return new Promise(le=>{function Be(){if(de.forEach(function(Xe){Y.get(Xe).currentProgram.isReady()&&de.delete(Xe)}),de.size===0){le(F);return}setTimeout(Be,10)}Pe.get("KHR_parallel_shader_compile")!==null?Be():setTimeout(Be,10)})};let St=null;function At(F){St&&St(F)}function ur(){mr.stop()}function Vt(){mr.start()}const mr=new JE;mr.setAnimationLoop(At),typeof self<"u"&&mr.setContext(self),this.setAnimationLoop=function(F){St=F,O.setAnimationLoop(F),F===null?mr.stop():mr.start()},O.addEventListener("sessionstart",ur),O.addEventListener("sessionend",Vt),this.render=function(F,ie){if(ie!==void 0&&ie.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(I===!0)return;F.matrixWorldAutoUpdate===!0&&F.updateMatrixWorld(),ie.parent===null&&ie.matrixWorldAutoUpdate===!0&&ie.updateMatrixWorld(),O.enabled===!0&&O.isPresenting===!0&&(O.cameraAutoUpdate===!0&&O.updateCamera(ie),ie=O.getCamera()),F.isScene===!0&&F.onBeforeRender(x,F,ie,T),m=Ce.get(F,w.length),m.init(),w.push(m),Ae.multiplyMatrices(ie.projectionMatrix,ie.matrixWorldInverse),re.setFromProjectionMatrix(Ae),fe=this.localClippingEnabled,H=Se.init(this.clippingPlanes,fe),E=He.get(F,_.length),E.init(),_.push(E),Tn(F,ie,0,x.sortObjects),E.finish(),x.sortObjects===!0&&E.sort(V,te),this.info.render.frame++,H===!0&&Se.beginShadows();const he=m.state.shadowsArray;if(Ze.render(he,F,ie),H===!0&&Se.endShadows(),this.info.autoReset===!0&&this.info.reset(),(O.enabled===!1||O.isPresenting===!1||O.hasDepthSensing()===!1)&&Ne.render(E,F),m.setupLights(x._useLegacyLights),ie.isArrayCamera){const de=ie.cameras;for(let le=0,Be=de.length;le<Be;le++){const Xe=de[le];qt(E,F,Xe,Xe.viewport)}}else qt(E,F,ie);T!==null&&(k.updateMultisampleRenderTarget(T),k.updateRenderTargetMipmap(T)),F.isScene===!0&&F.onAfterRender(x,F,ie),_t.resetDefaultState(),D=-1,b=null,w.pop(),w.length>0?m=w[w.length-1]:m=null,_.pop(),_.length>0?E=_[_.length-1]:E=null};function Tn(F,ie,he,de){if(F.visible===!1)return;if(F.layers.test(ie.layers)){if(F.isGroup)he=F.renderOrder;else if(F.isLOD)F.autoUpdate===!0&&F.update(ie);else if(F.isLight)m.pushLight(F),F.castShadow&&m.pushShadow(F);else if(F.isSprite){if(!F.frustumCulled||re.intersectsSprite(F)){de&&ye.setFromMatrixPosition(F.matrixWorld).applyMatrix4(Ae);const Be=Ue.update(F),Xe=F.material;Xe.visible&&E.push(F,Be,Xe,he,ye.z,null)}}else if((F.isMesh||F.isLine||F.isPoints)&&(!F.frustumCulled||re.intersectsObject(F))){const Be=Ue.update(F),Xe=F.material;if(de&&(F.boundingSphere!==void 0?(F.boundingSphere===null&&F.computeBoundingSphere(),ye.copy(F.boundingSphere.center)):(Be.boundingSphere===null&&Be.computeBoundingSphere(),ye.copy(Be.boundingSphere.center)),ye.applyMatrix4(F.matrixWorld).applyMatrix4(Ae)),Array.isArray(Xe)){const et=Be.groups;for(let nt=0,We=et.length;nt<We;nt++){const ut=et[nt],ot=Xe[ut.materialIndex];ot&&ot.visible&&E.push(F,Be,ot,he,ye.z,ut)}}else Xe.visible&&E.push(F,Be,Xe,he,ye.z,null)}}const le=F.children;for(let Be=0,Xe=le.length;Be<Xe;Be++)Tn(le[Be],ie,he,de)}function qt(F,ie,he,de){const le=F.opaque,Be=F.transmissive,Xe=F.transparent;m.setupLightsView(he),H===!0&&Se.setGlobalState(x.clippingPlanes,he),Be.length>0&&ui(le,Be,ie,he),de&&Ye.viewport(M.copy(de)),le.length>0&&Kn(le,ie,he),Be.length>0&&Kn(Be,ie,he),Xe.length>0&&Kn(Xe,ie,he),Ye.buffers.depth.setTest(!0),Ye.buffers.depth.setMask(!0),Ye.buffers.color.setMask(!0),Ye.setPolygonOffset(!1)}function ui(F,ie,he,de){if((he.isScene===!0?he.overrideMaterial:null)!==null)return;if(m.state.transmissionRenderTarget===null){m.state.transmissionRenderTarget=new Mi(1,1,{generateMipmaps:!0,type:Pe.has("EXT_color_buffer_half_float")||Pe.has("EXT_color_buffer_float")?_n:pr,minFilter:xi,samples:4,stencilBuffer:s});const nt=Y.get(m.state.transmissionRenderTarget);nt.__isTransmissionRenderTarget=!0}const le=m.state.transmissionRenderTarget;x.getDrawingBufferSize(ve),le.setSize(ve.x,ve.y);const Be=x.getRenderTarget();x.setRenderTarget(le),x.getClearColor(N),j=x.getClearAlpha(),j<1&&x.setClearColor(16777215,.5),x.clear();const Xe=x.toneMapping;x.toneMapping=Js,Kn(F,he,de),k.updateMultisampleRenderTarget(le),k.updateRenderTargetMipmap(le);let et=!1;for(let nt=0,We=ie.length;nt<We;nt++){const ut=ie[nt],ot=ut.object,Rr=ut.geometry,er=ut.material,Bn=ut.group;if(er.side===yi&&ot.layers.test(de.layers)){const hi=er.side;er.side=Pr,er.needsUpdate=!0,Ls(ot,he,de,Rr,er,Bn),er.side=hi,er.needsUpdate=!0,et=!0}}et===!0&&(k.updateMultisampleRenderTarget(le),k.updateRenderTargetMipmap(le)),x.setRenderTarget(Be),x.setClearColor(N,j),x.toneMapping=Xe}function Kn(F,ie,he){const de=ie.isScene===!0?ie.overrideMaterial:null;for(let le=0,Be=F.length;le<Be;le++){const Xe=F[le],et=Xe.object,nt=Xe.geometry,We=de===null?Xe.material:de,ut=Xe.group;et.layers.test(he.layers)&&Ls(et,ie,he,nt,We,ut)}}function Ls(F,ie,he,de,le,Be){F.onBeforeRender(x,ie,he,de,le,Be),F.modelViewMatrix.multiplyMatrices(he.matrixWorldInverse,F.matrixWorld),F.normalMatrix.getNormalMatrix(F.modelViewMatrix),le.onBeforeRender(x,ie,he,de,F,Be),le.transparent===!0&&le.side===yi&&le.forceSinglePass===!1?(le.side=Pr,le.needsUpdate=!0,x.renderBufferDirect(he,ie,de,le,F,Be),le.side=vi,le.needsUpdate=!0,x.renderBufferDirect(he,ie,de,le,F,Be),le.side=yi):x.renderBufferDirect(he,ie,de,le,F,Be),F.onAfterRender(x,ie,he,de,le,Be)}function Ns(F,ie,he){ie.isScene!==!0&&(ie=Oe);const de=Y.get(F),le=m.state.lights,Be=m.state.shadowsArray,Xe=le.state.version,et=Ee.getParameters(F,le.state,Be,ie,he),nt=Ee.getProgramCacheKey(et);let We=de.programs;de.environment=F.isMeshStandardMaterial?ie.environment:null,de.fog=ie.fog,de.envMap=(F.isMeshStandardMaterial?ue:ee).get(F.envMap||de.environment),de.envMapRotation=de.environment!==null&&F.envMap===null?ie.environmentRotation:F.envMapRotation,We===void 0&&(F.addEventListener("dispose",De),We=new Map,de.programs=We);let ut=We.get(nt);if(ut!==void 0){if(de.currentProgram===ut&&de.lightsStateVersion===Xe)return xf(F,et),ut}else et.uniforms=Ee.getUniforms(F),F.onBuild(he,et,x),F.onBeforeCompile(et,x),ut=Ee.acquireProgram(et,nt),We.set(nt,ut),de.uniforms=et.uniforms;const ot=de.uniforms;return(!F.isShaderMaterial&&!F.isRawShaderMaterial||F.clipping===!0)&&(ot.clippingPlanes=Se.uniform),xf(F,et),de.needsLights=Us(F),de.lightsStateVersion=Xe,de.needsLights&&(ot.ambientLightColor.value=le.state.ambient,ot.lightProbe.value=le.state.probe,ot.directionalLights.value=le.state.directional,ot.directionalLightShadows.value=le.state.directionalShadow,ot.spotLights.value=le.state.spot,ot.spotLightShadows.value=le.state.spotShadow,ot.rectAreaLights.value=le.state.rectArea,ot.ltc_1.value=le.state.rectAreaLTC1,ot.ltc_2.value=le.state.rectAreaLTC2,ot.pointLights.value=le.state.point,ot.pointLightShadows.value=le.state.pointShadow,ot.hemisphereLights.value=le.state.hemi,ot.directionalShadowMap.value=le.state.directionalShadowMap,ot.directionalShadowMatrix.value=le.state.directionalShadowMatrix,ot.spotShadowMap.value=le.state.spotShadowMap,ot.spotLightMatrix.value=le.state.spotLightMatrix,ot.spotLightMap.value=le.state.spotLightMap,ot.pointShadowMap.value=le.state.pointShadowMap,ot.pointShadowMatrix.value=le.state.pointShadowMatrix),de.currentProgram=ut,de.uniformsList=null,ut}function sc(F){if(F.uniformsList===null){const ie=F.currentProgram.getUniforms();F.uniformsList=Td.seqWithValue(ie.seq,F.uniforms)}return F.uniformsList}function xf(F,ie){const he=Y.get(F);he.outputColorSpace=ie.outputColorSpace,he.batching=ie.batching,he.instancing=ie.instancing,he.instancingColor=ie.instancingColor,he.instancingMorph=ie.instancingMorph,he.skinning=ie.skinning,he.morphTargets=ie.morphTargets,he.morphNormals=ie.morphNormals,he.morphColors=ie.morphColors,he.morphTargetsCount=ie.morphTargetsCount,he.numClippingPlanes=ie.numClippingPlanes,he.numIntersection=ie.numClipIntersection,he.vertexAlphas=ie.vertexAlphas,he.vertexTangents=ie.vertexTangents,he.toneMapping=ie.toneMapping}function Ym(F,ie,he,de,le){ie.isScene!==!0&&(ie=Oe),k.resetTextureUnits();const Be=ie.fog,Xe=de.isMeshStandardMaterial?ie.environment:null,et=T===null?x.outputColorSpace:T.isXRRenderTarget===!0?T.texture.colorSpace:Cr,nt=(de.isMeshStandardMaterial?ue:ee).get(de.envMap||Xe),We=de.vertexColors===!0&&!!he.attributes.color&&he.attributes.color.itemSize===4,ut=!!he.attributes.tangent&&(!!de.normalMap||de.anisotropy>0),ot=!!he.morphAttributes.position,Rr=!!he.morphAttributes.normal,er=!!he.morphAttributes.color;let Bn=Js;de.toneMapped&&(T===null||T.isXRRenderTarget===!0)&&(Bn=x.toneMapping);const hi=he.morphAttributes.position||he.morphAttributes.normal||he.morphAttributes.color,jt=hi!==void 0?hi.length:0,$e=Y.get(de),ju=m.state.lights;if(H===!0&&(fe===!0||F!==b)){const Rn=F===b&&de.id===D;Se.setState(de,F,Rn)}let pn=!1;de.version===$e.__version?($e.needsLights&&$e.lightsStateVersion!==ju.state.version||$e.outputColorSpace!==et||le.isBatchedMesh&&$e.batching===!1||!le.isBatchedMesh&&$e.batching===!0||le.isInstancedMesh&&$e.instancing===!1||!le.isInstancedMesh&&$e.instancing===!0||le.isSkinnedMesh&&$e.skinning===!1||!le.isSkinnedMesh&&$e.skinning===!0||le.isInstancedMesh&&$e.instancingColor===!0&&le.instanceColor===null||le.isInstancedMesh&&$e.instancingColor===!1&&le.instanceColor!==null||le.isInstancedMesh&&$e.instancingMorph===!0&&le.morphTexture===null||le.isInstancedMesh&&$e.instancingMorph===!1&&le.morphTexture!==null||$e.envMap!==nt||de.fog===!0&&$e.fog!==Be||$e.numClippingPlanes!==void 0&&($e.numClippingPlanes!==Se.numPlanes||$e.numIntersection!==Se.numIntersection)||$e.vertexAlphas!==We||$e.vertexTangents!==ut||$e.morphTargets!==ot||$e.morphNormals!==Rr||$e.morphColors!==er||$e.toneMapping!==Bn||$e.morphTargetsCount!==jt)&&(pn=!0):(pn=!0,$e.__version=de.version);let Ps=$e.currentProgram;pn===!0&&(Ps=Ns(de,ie,le));let wf=!1,bo=!1,wa=!1;const _r=Ps.getUniforms(),bn=$e.uniforms;if(Ye.useProgram(Ps.program)&&(wf=!0,bo=!0,wa=!0),de.id!==D&&(D=de.id,bo=!0),wf||b!==F){_r.setValue(ae,"projectionMatrix",F.projectionMatrix),_r.setValue(ae,"viewMatrix",F.matrixWorldInverse);const Rn=_r.map.cameraPosition;Rn!==void 0&&Rn.setValue(ae,ye.setFromMatrixPosition(F.matrixWorld)),lt.logarithmicDepthBuffer&&_r.setValue(ae,"logDepthBufFC",2/(Math.log(F.far+1)/Math.LN2)),(de.isMeshPhongMaterial||de.isMeshToonMaterial||de.isMeshLambertMaterial||de.isMeshBasicMaterial||de.isMeshStandardMaterial||de.isShaderMaterial)&&_r.setValue(ae,"isOrthographic",F.isOrthographicCamera===!0),b!==F&&(b=F,bo=!0,wa=!0)}if(le.isSkinnedMesh){_r.setOptional(ae,le,"bindMatrix"),_r.setOptional(ae,le,"bindMatrixInverse");const Rn=le.skeleton;Rn&&(Rn.boneTexture===null&&Rn.computeBoneTexture(),_r.setValue(ae,"boneTexture",Rn.boneTexture,k))}le.isBatchedMesh&&(_r.setOptional(ae,le,"batchingTexture"),_r.setValue(ae,"batchingTexture",le._matricesTexture,k));const Ia=he.morphAttributes;if((Ia.position!==void 0||Ia.normal!==void 0||Ia.color!==void 0)&&Re.update(le,he,Ps),(bo||$e.receiveShadow!==le.receiveShadow)&&($e.receiveShadow=le.receiveShadow,_r.setValue(ae,"receiveShadow",le.receiveShadow)),de.isMeshGouraudMaterial&&de.envMap!==null&&(bn.envMap.value=nt,bn.flipEnvMap.value=nt.isCubeTexture&&nt.isRenderTargetTexture===!1?-1:1),de.isMeshStandardMaterial&&de.envMap===null&&ie.environment!==null&&(bn.envMapIntensity.value=ie.environmentIntensity),bo&&(_r.setValue(ae,"toneMappingExposure",x.toneMappingExposure),$e.needsLights&&qm(bn,wa),Be&&de.fog===!0&&Qe.refreshFogUniforms(bn,Be),Qe.refreshMaterialUniforms(bn,de,ne,K,m.state.transmissionRenderTarget),Td.upload(ae,sc($e),bn,k)),de.isShaderMaterial&&de.uniformsNeedUpdate===!0&&(Td.upload(ae,sc($e),bn,k),de.uniformsNeedUpdate=!1),de.isSpriteMaterial&&_r.setValue(ae,"center",le.center),_r.setValue(ae,"modelViewMatrix",le.modelViewMatrix),_r.setValue(ae,"normalMatrix",le.normalMatrix),_r.setValue(ae,"modelMatrix",le.matrixWorld),de.isShaderMaterial||de.isRawShaderMaterial){const Rn=de.uniformsGroups;for(let Wu=0,Yu=Rn.length;Wu<Yu;Wu++){const qu=Rn[Wu];Et.update(qu,Ps),Et.bind(qu,Ps)}}return Ps}function qm(F,ie){F.ambientLightColor.needsUpdate=ie,F.lightProbe.needsUpdate=ie,F.directionalLights.needsUpdate=ie,F.directionalLightShadows.needsUpdate=ie,F.pointLights.needsUpdate=ie,F.pointLightShadows.needsUpdate=ie,F.spotLights.needsUpdate=ie,F.spotLightShadows.needsUpdate=ie,F.rectAreaLights.needsUpdate=ie,F.hemisphereLights.needsUpdate=ie}function Us(F){return F.isMeshLambertMaterial||F.isMeshToonMaterial||F.isMeshPhongMaterial||F.isMeshStandardMaterial||F.isShadowMaterial||F.isShaderMaterial&&F.lights===!0}this.getActiveCubeFace=function(){return R},this.getActiveMipmapLevel=function(){return S},this.getRenderTarget=function(){return T},this.setRenderTargetTextures=function(F,ie,he){Y.get(F.texture).__webglTexture=ie,Y.get(F.depthTexture).__webglTexture=he;const de=Y.get(F);de.__hasExternalTextures=!0,de.__autoAllocateDepthBuffer=he===void 0,de.__autoAllocateDepthBuffer||Pe.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),de.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(F,ie){const he=Y.get(F);he.__webglFramebuffer=ie,he.__useDefaultFramebuffer=ie===void 0},this.setRenderTarget=function(F,ie=0,he=0){T=F,R=ie,S=he;let de=!0,le=null,Be=!1,Xe=!1;if(F){const et=Y.get(F);et.__useDefaultFramebuffer!==void 0?(Ye.bindFramebuffer(ae.FRAMEBUFFER,null),de=!1):et.__webglFramebuffer===void 0?k.setupRenderTarget(F):et.__hasExternalTextures&&k.rebindTextures(F,Y.get(F.texture).__webglTexture,Y.get(F.depthTexture).__webglTexture);const nt=F.texture;(nt.isData3DTexture||nt.isDataArrayTexture||nt.isCompressedArrayTexture)&&(Xe=!0);const We=Y.get(F).__webglFramebuffer;F.isWebGLCubeRenderTarget?(Array.isArray(We[ie])?le=We[ie][he]:le=We[ie],Be=!0):F.samples>0&&k.useMultisampledRTT(F)===!1?le=Y.get(F).__webglMultisampledFramebuffer:Array.isArray(We)?le=We[he]:le=We,M.copy(F.viewport),L.copy(F.scissor),P=F.scissorTest}else M.copy(Q).multiplyScalar(ne).floor(),L.copy(z).multiplyScalar(ne).floor(),P=Z;if(Ye.bindFramebuffer(ae.FRAMEBUFFER,le)&&de&&Ye.drawBuffers(F,le),Ye.viewport(M),Ye.scissor(L),Ye.setScissorTest(P),Be){const et=Y.get(F.texture);ae.framebufferTexture2D(ae.FRAMEBUFFER,ae.COLOR_ATTACHMENT0,ae.TEXTURE_CUBE_MAP_POSITIVE_X+ie,et.__webglTexture,he)}else if(Xe){const et=Y.get(F.texture),nt=ie||0;ae.framebufferTextureLayer(ae.FRAMEBUFFER,ae.COLOR_ATTACHMENT0,et.__webglTexture,he||0,nt)}D=-1},this.readRenderTargetPixels=function(F,ie,he,de,le,Be,Xe){if(!(F&&F.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let et=Y.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&Xe!==void 0&&(et=et[Xe]),et){Ye.bindFramebuffer(ae.FRAMEBUFFER,et);try{const nt=F.texture,We=nt.format,ut=nt.type;if(We!==Ar&&yt.convert(We)!==ae.getParameter(ae.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ot=ut===_n&&(Pe.has("EXT_color_buffer_half_float")||Pe.has("EXT_color_buffer_float"));if(ut!==pr&&yt.convert(ut)!==ae.getParameter(ae.IMPLEMENTATION_COLOR_READ_TYPE)&&ut!==or&&!ot){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ie>=0&&ie<=F.width-de&&he>=0&&he<=F.height-le&&ae.readPixels(ie,he,de,le,yt.convert(We),yt.convert(ut),Be)}finally{const nt=T!==null?Y.get(T).__webglFramebuffer:null;Ye.bindFramebuffer(ae.FRAMEBUFFER,nt)}}},this.copyFramebufferToTexture=function(F,ie,he=0){const de=Math.pow(2,-he),le=Math.floor(ie.image.width*de),Be=Math.floor(ie.image.height*de);k.setTexture2D(ie,0),ae.copyTexSubImage2D(ae.TEXTURE_2D,he,0,0,F.x,F.y,le,Be),Ye.unbindTexture()},this.copyTextureToTexture=function(F,ie,he,de=0){const le=ie.image.width,Be=ie.image.height,Xe=yt.convert(he.format),et=yt.convert(he.type);k.setTexture2D(he,0),ae.pixelStorei(ae.UNPACK_FLIP_Y_WEBGL,he.flipY),ae.pixelStorei(ae.UNPACK_PREMULTIPLY_ALPHA_WEBGL,he.premultiplyAlpha),ae.pixelStorei(ae.UNPACK_ALIGNMENT,he.unpackAlignment),ie.isDataTexture?ae.texSubImage2D(ae.TEXTURE_2D,de,F.x,F.y,le,Be,Xe,et,ie.image.data):ie.isCompressedTexture?ae.compressedTexSubImage2D(ae.TEXTURE_2D,de,F.x,F.y,ie.mipmaps[0].width,ie.mipmaps[0].height,Xe,ie.mipmaps[0].data):ae.texSubImage2D(ae.TEXTURE_2D,de,F.x,F.y,Xe,et,ie.image),de===0&&he.generateMipmaps&&ae.generateMipmap(ae.TEXTURE_2D),Ye.unbindTexture()},this.copyTextureToTexture3D=function(F,ie,he,de,le=0){const Be=Math.round(F.max.x-F.min.x),Xe=Math.round(F.max.y-F.min.y),et=F.max.z-F.min.z+1,nt=yt.convert(de.format),We=yt.convert(de.type);let ut;if(de.isData3DTexture)k.setTexture3D(de,0),ut=ae.TEXTURE_3D;else if(de.isDataArrayTexture||de.isCompressedArrayTexture)k.setTexture2DArray(de,0),ut=ae.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}ae.pixelStorei(ae.UNPACK_FLIP_Y_WEBGL,de.flipY),ae.pixelStorei(ae.UNPACK_PREMULTIPLY_ALPHA_WEBGL,de.premultiplyAlpha),ae.pixelStorei(ae.UNPACK_ALIGNMENT,de.unpackAlignment);const ot=ae.getParameter(ae.UNPACK_ROW_LENGTH),Rr=ae.getParameter(ae.UNPACK_IMAGE_HEIGHT),er=ae.getParameter(ae.UNPACK_SKIP_PIXELS),Bn=ae.getParameter(ae.UNPACK_SKIP_ROWS),hi=ae.getParameter(ae.UNPACK_SKIP_IMAGES),jt=he.isCompressedTexture?he.mipmaps[le]:he.image;ae.pixelStorei(ae.UNPACK_ROW_LENGTH,jt.width),ae.pixelStorei(ae.UNPACK_IMAGE_HEIGHT,jt.height),ae.pixelStorei(ae.UNPACK_SKIP_PIXELS,F.min.x),ae.pixelStorei(ae.UNPACK_SKIP_ROWS,F.min.y),ae.pixelStorei(ae.UNPACK_SKIP_IMAGES,F.min.z),he.isDataTexture||he.isData3DTexture?ae.texSubImage3D(ut,le,ie.x,ie.y,ie.z,Be,Xe,et,nt,We,jt.data):de.isCompressedArrayTexture?ae.compressedTexSubImage3D(ut,le,ie.x,ie.y,ie.z,Be,Xe,et,nt,jt.data):ae.texSubImage3D(ut,le,ie.x,ie.y,ie.z,Be,Xe,et,nt,We,jt),ae.pixelStorei(ae.UNPACK_ROW_LENGTH,ot),ae.pixelStorei(ae.UNPACK_IMAGE_HEIGHT,Rr),ae.pixelStorei(ae.UNPACK_SKIP_PIXELS,er),ae.pixelStorei(ae.UNPACK_SKIP_ROWS,Bn),ae.pixelStorei(ae.UNPACK_SKIP_IMAGES,hi),le===0&&de.generateMipmaps&&ae.generateMipmap(ut),Ye.unbindTexture()},this.initTexture=function(F){F.isCubeTexture?k.setTextureCube(F,0):F.isData3DTexture?k.setTexture3D(F,0):F.isDataArrayTexture||F.isCompressedArrayTexture?k.setTexture2DArray(F,0):k.setTexture2D(F,0),Ye.unbindTexture()},this.resetState=function(){R=0,S=0,T=null,Ye.reset(),_t.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return As}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===$h?"display-p3":"srgb",t.unpackColorSpace=Rt.workingColorSpace===ru?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class FL extends Zt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Wi,this.environmentIntensity=1,this.environmentRotation=new Wi,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class zL{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=wA,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Ii()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return wE("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}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,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;i<s;i++)this.array[e+i]=t.array[n+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Ii()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Ii()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(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}}}const un=new W;class tg{constructor(e,t,n,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=i}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,n=this.data.count;t<n;t++)un.fromBufferAttribute(this,t),un.applyMatrix4(e),this.setXYZ(t,un.x,un.y,un.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)un.fromBufferAttribute(this,t),un.applyNormalMatrix(e),this.setXYZ(t,un.x,un.y,un.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)un.fromBufferAttribute(this,t),un.transformDirection(e),this.setXYZ(t,un.x,un.y,un.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=Ci(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Nt(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Nt(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=Ci(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Ci(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Ci(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Ci(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array),i=Nt(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this}setXYZW(e,t,n,i,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array),i=Nt(i,this.array),s=Nt(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this.data.array[e+3]=s,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}return new Qr(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new tg(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}const S2=new W,T2=new Ft,B2=new Ft,HL=new W,b2=new tt,Bd=new W,rg=new Ti,R2=new tt,ng=new lu;class GL extends Wr{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=zy,this.bindMatrix=new tt,this.bindMatrixInverse=new tt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new yr),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Bd),this.boundingBox.expandByPoint(Bd)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Ti),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Bd),this.boundingSphere.expandByPoint(Bd)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const n=this.material,i=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),rg.copy(this.boundingSphere),rg.applyMatrix4(i),e.ray.intersectsSphere(rg)!==!1&&(R2.copy(i).invert(),ng.copy(e.ray).applyMatrix4(R2),!(this.boundingBox!==null&&ng.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,ng)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new Ft,t=this.geometry.attributes.skinWeight;for(let n=0,i=t.count;n<i;n++){e.fromBufferAttribute(t,n);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===zy?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===XB?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,i=this.geometry;T2.fromBufferAttribute(i.attributes.skinIndex,e),B2.fromBufferAttribute(i.attributes.skinWeight,e),S2.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=B2.getComponent(s);if(o!==0){const c=T2.getComponent(s);b2.multiplyMatrices(n.bones[c].matrixWorld,n.boneInverses[c]),t.addScaledVector(HL.copy(S2).applyMatrix4(b2),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}class D2 extends Zt{constructor(){super(),this.isBone=!0,this.type="Bone"}}class po extends Sr{constructor(e=null,t=1,n=1,i,s,o,c,h,u=dr,d=dr,A,p){super(null,o,c,h,u,d,i,s,A,p),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const L2=new tt,VL=new tt;class ig{constructor(e=[],t=[]){this.uuid=Ii(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)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 n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new tt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new tt;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let s=0,o=e.length;s<o;s++){const c=e[s]?e[s].matrixWorld:VL;L2.multiplyMatrices(c,t[s]),L2.toArray(n,s*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new ig(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new po(t,e,e,Ar,or);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,i=e.bones.length;n<i;n++){const s=e.bones[n];let o=t[s];o===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),o=new D2),this.bones.push(o),this.boneInverses.push(new tt().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let i=0,s=t.length;i<s;i++){const o=t[i];e.bones.push(o.uuid);const c=n[i];e.boneInverses.push(c.toArray())}return e}}class sg extends Qr{constructor(e,t,n,i=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const Ml=new tt,N2=new tt,bd=[],U2=new yr,jL=new tt,Au=new Wr,gu=new Ti;class WL extends Wr{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new sg(new Float32Array(n*16),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let i=0;i<n;i++)this.setMatrixAt(i,jL)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new yr),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Ml),U2.copy(e.boundingBox).applyMatrix4(Ml),this.boundingBox.union(U2)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new Ti),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Ml),gu.copy(e.boundingSphere).applyMatrix4(Ml),this.boundingSphere.union(gu)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const n=t.morphTargetInfluences,i=this.morphTexture.source.data.data,s=n.length+1,o=e*s+1;for(let c=0;c<n.length;c++)n[c]=i[o+c]}raycast(e,t){const n=this.matrixWorld,i=this.count;if(Au.geometry=this.geometry,Au.material=this.material,Au.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),gu.copy(this.boundingSphere),gu.applyMatrix4(n),e.ray.intersectsSphere(gu)!==!1))for(let s=0;s<i;s++){this.getMatrixAt(s,Ml),N2.multiplyMatrices(n,Ml),Au.matrixWorld=N2,Au.raycast(e,bd);for(let o=0,c=bd.length;o<c;o++){const h=bd[o];h.instanceId=s,h.object=this,t.push(h)}bd.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new sg(new Float32Array(this.instanceMatrix.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){const n=t.morphTargetInfluences,i=n.length+1;this.morphTexture===null&&(this.morphTexture=new po(new Float32Array(i*this.count),i,this.count,$s,or));const s=this.morphTexture.source.data.data;let o=0;for(let u=0;u<n.length;u++)o+=n[u];const c=this.geometry.morphTargetsRelative?1:1-o,h=i*e;s[h]=c,s.set(n,h+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null),this}}class P2 extends Yi{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new qe(16777215),this.map=null,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.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const k2=new W,Q2=new W,O2=new tt,ag=new lu,Rd=new Ti;class og extends Zt{constructor(e=new zn,t=new P2){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=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[0];for(let i=1,s=t.count;i<s;i++)k2.fromBufferAttribute(t,i-1),Q2.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=k2.distanceTo(Q2);e.setAttribute("lineDistance",new Ri(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,s=e.params.Line.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Rd.copy(n.boundingSphere),Rd.applyMatrix4(i),Rd.radius+=s,e.ray.intersectsSphere(Rd)===!1)return;O2.copy(i).invert(),ag.copy(e.ray).applyMatrix4(O2);const c=s/((this.scale.x+this.scale.y+this.scale.z)/3),h=c*c,u=new W,d=new W,A=new W,p=new W,g=this.isLineSegments?2:1,v=n.index,E=n.attributes.position;if(v!==null){const m=Math.max(0,o.start),_=Math.min(v.count,o.start+o.count);for(let w=m,x=_-1;w<x;w+=g){const I=v.getX(w),R=v.getX(w+1);if(u.fromBufferAttribute(E,I),d.fromBufferAttribute(E,R),ag.distanceSqToSegment(u,d,p,A)>h)continue;p.applyMatrix4(this.matrixWorld);const S=e.ray.origin.distanceTo(p);S<e.near||S>e.far||t.push({distance:S,point:A.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}else{const m=Math.max(0,o.start),_=Math.min(E.count,o.start+o.count);for(let w=m,x=_-1;w<x;w+=g){if(u.fromBufferAttribute(E,w),d.fromBufferAttribute(E,w+1),ag.distanceSqToSegment(u,d,p,A)>h)continue;p.applyMatrix4(this.matrixWorld);const I=e.ray.origin.distanceTo(p);I<e.near||I>e.far||t.push({distance:I,point:A.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,s=n.length;i<s;i++){const o=n[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=i}}}}}const F2=new W,z2=new W;class YL extends og{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[];for(let i=0,s=t.count;i<s;i+=2)F2.fromBufferAttribute(t,i),z2.fromBufferAttribute(t,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+F2.distanceTo(z2);e.setAttribute("lineDistance",new Ri(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class qL extends og{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class H2 extends Yi{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new qe(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const G2=new tt,lg=new lu,Dd=new Ti,Ld=new W;class XL extends Zt{constructor(e=new zn,t=new H2){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,s=e.params.Points.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Dd.copy(n.boundingSphere),Dd.applyMatrix4(i),Dd.radius+=s,e.ray.intersectsSphere(Dd)===!1)return;G2.copy(i).invert(),lg.copy(e.ray).applyMatrix4(G2);const c=s/((this.scale.x+this.scale.y+this.scale.z)/3),h=c*c,u=n.index,d=n.attributes.position;if(u!==null){const A=Math.max(0,o.start),p=Math.min(u.count,o.start+o.count);for(let g=A,v=p;g<v;g++){const E=u.getX(g);Ld.fromBufferAttribute(d,E),V2(Ld,E,h,i,e,t,this)}}else{const A=Math.max(0,o.start),p=Math.min(d.count,o.start+o.count);for(let g=A,v=p;g<v;g++)Ld.fromBufferAttribute(d,g),V2(Ld,g,h,i,e,t,this)}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,s=n.length;i<s;i++){const o=n[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=i}}}}}function V2(r,e,t,n,i,s,o){const c=lg.distanceSqToPoint(r);if(c<t){const h=new W;lg.closestPointToPoint(r,h),h.applyMatrix4(n);const u=i.ray.origin.distanceTo(h);if(u<i.near||u>i.far)return;s.push({distance:u,distanceToRay:Math.sqrt(c),point:h,index:e,face:null,object:o})}}class Nd extends Sr{constructor(e,t,n,i,s,o,c,h,u,d,A,p){super(null,o,c,h,u,d,i,s,A,p),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class KL extends Nd{constructor(e,t,n,i,s,o){super(e,t,n,s,o),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=Ei}}class JL extends Nd{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,ro),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class ZL extends vn{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class cg extends Yi{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new qe(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new qe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=gE,this.normalScale=new Ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Wi,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Di extends cg{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Ge(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Mr(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new qe(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new qe(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new qe(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}function Ud(r,e,t){return!r||!t&&r.constructor===e?r:typeof e.BYTES_PER_ELEMENT=="number"?new e(r):Array.prototype.slice.call(r)}function $L(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function e8(r){function e(i,s){return r[i]-r[s]}const t=r.length,n=new Array(t);for(let i=0;i!==t;++i)n[i]=i;return n.sort(e),n}function j2(r,e,t){const n=r.length,i=new r.constructor(n);for(let s=0,o=0;o!==n;++s){const c=t[s]*e;for(let h=0;h!==e;++h)i[o++]=r[c+h]}return i}function W2(r,e,t,n){let i=1,s=r[0];for(;s!==void 0&&s[n]===void 0;)s=r[i++];if(s===void 0)return;let o=s[n];if(o!==void 0)if(Array.isArray(o))do o=s[n],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=r[i++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[n],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=r[i++];while(s!==void 0);else do o=s[n],o!==void 0&&(e.push(s.time),t.push(o)),s=r[i++];while(s!==void 0)}class mu{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,i=t[n],s=t[n-1];e:{t:{let o;r:{n:if(!(e<i)){for(let c=n+2;;){if(i===void 0){if(e<s)break n;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===c)break;if(s=i,i=t[++n],e<i)break t}o=t.length;break r}if(!(e>=s)){const c=t[1];e<c&&(n=2,s=c);for(let h=n-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===h)break;if(i=s,s=t[--n-1],e>=s)break t}o=n,n=0;break r}break e}for(;n<o;){const c=n+o>>>1;e<t[c]?o=c:n=c+1}if(i=t[n],s=t[n-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,s,i)}return this.interpolate_(n,s,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i;for(let o=0;o!==i;++o)t[o]=n[s+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class t8 extends mu{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:dE,endingEnd:dE}}intervalChanged_(e,t,n){const i=this.parameterPositions;let s=e-2,o=e+1,c=i[s],h=i[o];if(c===void 0)switch(this.getSettings_().endingStart){case fE:s=e,c=2*t-n;break;case pE:s=i.length-2,c=t+i[s]-i[s+1];break;default:s=e,c=n}if(h===void 0)switch(this.getSettings_().endingEnd){case fE:o=e,h=2*n-t;break;case pE:o=1,h=n+i[1]-i[0];break;default:o=e-1,h=t}const u=(n-t)*.5,d=this.valueSize;this._weightPrev=u/(t-c),this._weightNext=u/(h-n),this._offsetPrev=s*d,this._offsetNext=o*d}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,c=this.valueSize,h=e*c,u=h-c,d=this._offsetPrev,A=this._offsetNext,p=this._weightPrev,g=this._weightNext,v=(n-t)/(i-t),E=v*v,m=E*v,_=-p*m+2*p*E-p*v,w=(1+p)*m+(-1.5-2*p)*E+(-.5+p)*v+1,x=(-1-g)*m+(1.5+g)*E+.5*v,I=g*m-g*E;for(let R=0;R!==c;++R)s[R]=_*o[d+R]+w*o[u+R]+x*o[h+R]+I*o[A+R];return s}}class r8 extends mu{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,c=this.valueSize,h=e*c,u=h-c,d=(n-t)/(i-t),A=1-d;for(let p=0;p!==c;++p)s[p]=o[u+p]*A+o[h+p]*d;return s}}class n8 extends mu{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class Ki{constructor(e,t,n,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Ud(t,this.TimeBufferType),this.values=Ud(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Ud(e.times,Array),values:Ud(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new n8(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new r8(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new t8(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case tu:t=this.InterpolantFactoryMethodDiscrete;break;case nl:t=this.InterpolantFactoryMethodLinear;break;case EA:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return tu;case this.InterpolantFactoryMethodLinear:return nl;case this.InterpolantFactoryMethodSmooth:return EA}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e}return this}trim(e,t){const n=this.times,i=n.length;let s=0,o=i-1;for(;s!==i&&n[s]<e;)++s;for(;o!==-1&&n[o]>t;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);const c=this.getValueSize();this.times=n.slice(s,o),this.values=this.values.slice(s*c,o*c)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let c=0;c!==s;c++){const h=n[c];if(typeof h=="number"&&isNaN(h)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,c,h),e=!1;break}if(o!==null&&o>h){console.error("THREE.KeyframeTrack: Out of order keys.",this,c,h,o),e=!1;break}o=h}if(i!==void 0&&$L(i))for(let c=0,h=i.length;c!==h;++c){const u=i[c];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,c,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===EA,s=e.length-1;let o=1;for(let c=1;c<s;++c){let h=!1;const u=e[c],d=e[c+1];if(u!==d&&(c!==1||u!==e[0]))if(i)h=!0;else{const A=c*n,p=A-n,g=A+n;for(let v=0;v!==n;++v){const E=t[A+v];if(E!==t[p+v]||E!==t[g+v]){h=!0;break}}}if(h){if(c!==o){e[o]=e[c];const A=c*n,p=o*n;for(let g=0;g!==n;++g)t[p+g]=t[A+g]}++o}}if(s>0){e[o]=e[s];for(let c=s*n,h=o*n,u=0;u!==n;++u)t[h+u]=t[c+u];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}Ki.prototype.TimeBufferType=Float32Array,Ki.prototype.ValueBufferType=Float32Array,Ki.prototype.DefaultInterpolation=nl;class Sl extends Ki{}Sl.prototype.ValueTypeName="bool",Sl.prototype.ValueBufferType=Array,Sl.prototype.DefaultInterpolation=tu,Sl.prototype.InterpolantFactoryMethodLinear=void 0,Sl.prototype.InterpolantFactoryMethodSmooth=void 0;class Y2 extends Ki{}Y2.prototype.ValueTypeName="color";class Tl extends Ki{}Tl.prototype.ValueTypeName="number";class i8 extends mu{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,c=this.valueSize,h=(n-t)/(i-t);let u=e*c;for(let d=u+c;u!==d;u+=4)ji.slerpFlat(s,0,o,u-c,o,u,h);return s}}class Ao extends Ki{InterpolantFactoryMethodLinear(e){return new i8(this.times,this.values,this.getValueSize(),e)}}Ao.prototype.ValueTypeName="quaternion",Ao.prototype.DefaultInterpolation=nl,Ao.prototype.InterpolantFactoryMethodSmooth=void 0;class Bl extends Ki{}Bl.prototype.ValueTypeName="string",Bl.prototype.ValueBufferType=Array,Bl.prototype.DefaultInterpolation=tu,Bl.prototype.InterpolantFactoryMethodLinear=void 0,Bl.prototype.InterpolantFactoryMethodSmooth=void 0;class bl extends Ki{}bl.prototype.ValueTypeName="vector";class s8{constructor(e="",t=-1,n=[],i=nb){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=Ii(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,c=n.length;o!==c;++o)t.push(o8(n[o]).scale(i));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=n.length;s!==o;++s)t.push(Ki.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const s=t.length,o=[];for(let c=0;c<s;c++){let h=[],u=[];h.push((c+s-1)%s,c,(c+1)%s),u.push(0,1,0);const d=e8(h);h=j2(h,1,d),u=j2(u,1,d),!i&&h[0]===0&&(h.push(s),u.push(u[0])),o.push(new Tl(".morphTargetInfluences["+t[c].name+"]",h,u).scale(1/n))}return new this(e,-1,o)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const i=e;n=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const i={},s=/^([\w-]*?)([\d]+)$/;for(let c=0,h=e.length;c<h;c++){const u=e[c],d=u.name.match(s);if(d&&d.length>1){const A=d[1];let p=i[A];p||(i[A]=p=[]),p.push(u)}}const o=[];for(const c in i)o.push(this.CreateFromMorphTargetSequence(c,i[c],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(d,A,p,g,v){if(p.length!==0){const E=[],m=[];W2(p,E,m,g),E.length!==0&&v.push(new d(A,E,m))}},i=[],s=e.name||"default",o=e.fps||30,c=e.blendMode;let h=e.length||-1;const u=e.hierarchy||[];for(let d=0;d<u.length;d++){const A=u[d].keys;if(!(!A||A.length===0))if(A[0].morphTargets){const p={};let g;for(g=0;g<A.length;g++)if(A[g].morphTargets)for(let v=0;v<A[g].morphTargets.length;v++)p[A[g].morphTargets[v]]=-1;for(const v in p){const E=[],m=[];for(let _=0;_!==A[g].morphTargets.length;++_){const w=A[g];E.push(w.time),m.push(w.morphTarget===v?1:0)}i.push(new Tl(".morphTargetInfluence["+v+"]",E,m))}h=p.length*o}else{const p=".bones["+t[d].name+"]";n(bl,p+".position",A,"pos",i),n(Ao,p+".quaternion",A,"rot",i),n(bl,p+".scale",A,"scl",i)}}return i.length===0?null:new this(s,h,i,c)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,i=e.length;n!==i;++n){const s=this.tracks[n];t=Math.max(t,s.times[s.times.length-1])}return this.duration=t,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(){const 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 a8(r){switch(r.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Tl;case"vector":case"vector2":case"vector3":case"vector4":return bl;case"color":return Y2;case"quaternion":return Ao;case"bool":case"boolean":return Sl;case"string":return Bl}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+r)}function o8(r){if(r.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=a8(r.type);if(r.times===void 0){const t=[],n=[];W2(r.keys,t,n,"value"),r.times=t,r.values=n}return e.parse!==void 0?e.parse(r):new e(r.name,r.times,r.values,r.interpolation)}const oa={enabled:!1,files:{},add:function(r,e){this.enabled!==!1&&(this.files[r]=e)},get:function(r){if(this.enabled!==!1)return this.files[r]},remove:function(r){delete this.files[r]},clear:function(){this.files={}}};class q2{constructor(e,t,n){const i=this;let s=!1,o=0,c=0,h;const u=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(d){c++,s===!1&&i.onStart!==void 0&&i.onStart(d,o,c),s=!0},this.itemEnd=function(d){o++,i.onProgress!==void 0&&i.onProgress(d,o,c),o===c&&(s=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(d){i.onError!==void 0&&i.onError(d)},this.resolveURL=function(d){return h?h(d):d},this.setURLModifier=function(d){return h=d,this},this.addHandler=function(d,A){return u.push(d,A),this},this.removeHandler=function(d){const A=u.indexOf(d);return A!==-1&&u.splice(A,2),this},this.getHandler=function(d){for(let A=0,p=u.length;A<p;A+=2){const g=u[A],v=u[A+1];if(g.global&&(g.lastIndex=0),g.test(d))return v}return null}}}const l8=new q2;class la{constructor(e){this.manager=e!==void 0?e:l8,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(i,s){n.load(e,i,t,s)})}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}}la.DEFAULT_MATERIAL_NAME="__DEFAULT";const ws={};class c8 extends Error{constructor(e,t){super(e),this.response=t}}class Rl extends la{constructor(e){super(e)}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=oa.get(e);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(s),this.manager.itemEnd(e)},0),s;if(ws[e]!==void 0){ws[e].push({onLoad:t,onProgress:n,onError:i});return}ws[e]=[],ws[e].push({onLoad:t,onProgress:n,onError:i});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),c=this.mimeType,h=this.responseType;fetch(o).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||u.body===void 0||u.body.getReader===void 0)return u;const d=ws[e],A=u.body.getReader(),p=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),g=p?parseInt(p):0,v=g!==0;let E=0;const m=new ReadableStream({start(_){w();function w(){A.read().then(({done:x,value:I})=>{if(x)_.close();else{E+=I.byteLength;const R=new ProgressEvent("progress",{lengthComputable:v,loaded:E,total:g});for(let S=0,T=d.length;S<T;S++){const D=d[S];D.onProgress&&D.onProgress(R)}_.enqueue(I),w()}})}}});return new Response(m)}else throw new c8(`fetch for "${u.url}" responded with ${u.status}: ${u.statusText}`,u)}).then(u=>{switch(h){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(d=>new DOMParser().parseFromString(d,c));case"json":return u.json();default:if(c===void 0)return u.text();{const d=/charset="?([^;"\s]*)"?/i.exec(c),A=d&&d[1]?d[1].toLowerCase():void 0,p=new TextDecoder(A);return u.arrayBuffer().then(g=>p.decode(g))}}}).then(u=>{oa.add(e,u);const d=ws[e];delete ws[e];for(let A=0,p=d.length;A<p;A++){const g=d[A];g.onLoad&&g.onLoad(u)}}).catch(u=>{const d=ws[e];if(d===void 0)throw this.manager.itemError(e),u;delete ws[e];for(let A=0,p=d.length;A<p;A++){const g=d[A];g.onError&&g.onError(u)}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}}class u8 extends la{constructor(e){super(e)}load(e,t,n,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=oa.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const c=su("img");function h(){d(),oa.add(e,this),t&&t(this),s.manager.itemEnd(e)}function u(A){d(),i&&i(A),s.manager.itemError(e),s.manager.itemEnd(e)}function d(){c.removeEventListener("load",h,!1),c.removeEventListener("error",u,!1)}return c.addEventListener("load",h,!1),c.addEventListener("error",u,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(c.crossOrigin=this.crossOrigin),s.manager.itemStart(e),c.src=e,c}}class h8 extends la{constructor(e){super(e)}load(e,t,n,i){const s=this,o=new po,c=new Rl(this.manager);return c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(s.withCredentials),c.load(e,function(h){let u;try{u=s.parse(h)}catch(d){if(i!==void 0)i(d);else{console.error(d);return}}u.image!==void 0?o.image=u.image:u.data!==void 0&&(o.image.width=u.width,o.image.height=u.height,o.image.data=u.data),o.wrapS=u.wrapS!==void 0?u.wrapS:Ei,o.wrapT=u.wrapT!==void 0?u.wrapT:Ei,o.magFilter=u.magFilter!==void 0?u.magFilter:fr,o.minFilter=u.minFilter!==void 0?u.minFilter:fr,o.anisotropy=u.anisotropy!==void 0?u.anisotropy:1,u.colorSpace!==void 0&&(o.colorSpace=u.colorSpace),u.flipY!==void 0&&(o.flipY=u.flipY),u.format!==void 0&&(o.format=u.format),u.type!==void 0&&(o.type=u.type),u.mipmaps!==void 0&&(o.mipmaps=u.mipmaps,o.minFilter=xi),u.mipmapCount===1&&(o.minFilter=fr),u.generateMipmaps!==void 0&&(o.generateMipmaps=u.generateMipmaps),o.needsUpdate=!0,t&&t(o,u)},n,i),o}}class X2 extends la{constructor(e){super(e)}load(e,t,n,i){const s=new Sr,o=new u8(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(c){s.image=c,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}}class Pd extends Zt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new qe(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){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}class d8 extends Pd{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Zt.DEFAULT_UP),this.updateMatrix(),this.groundColor=new qe(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const ug=new tt,K2=new W,J2=new W;class hg{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ge(512,512),this.map=null,this.mapPass=null,this.matrix=new tt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new jA,this._frameExtents=new Ge(1,1),this._viewportCount=1,this._viewports=[new Ft(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;K2.setFromMatrixPosition(e.matrixWorld),t.position.copy(K2),J2.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(J2),t.updateMatrixWorld(),ug.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ug),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(ug)}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(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class f8 extends hg{constructor(){super(new cn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=sl*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(n!==t.fov||i!==t.aspect||s!==t.far)&&(t.fov=n,t.aspect=i,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class p8 extends Pd{constructor(e,t,n=0,i=Math.PI/3,s=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Zt.DEFAULT_UP),this.updateMatrix(),this.target=new Zt,this.distance=n,this.angle=i,this.penumbra=s,this.decay=o,this.map=null,this.shadow=new f8}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}}const Z2=new tt,_u=new W,dg=new W;class A8 extends hg{constructor(){super(new cn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Ge(4,2),this._viewportCount=6,this._viewports=[new Ft(2,1,1,1),new Ft(0,1,1,1),new Ft(3,1,1,1),new Ft(1,1,1,1),new Ft(3,0,1,1),new Ft(1,0,1,1)],this._cubeDirections=[new W(1,0,0),new W(-1,0,0),new W(0,0,1),new W(0,0,-1),new W(0,1,0),new W(0,-1,0)],this._cubeUps=[new W(0,1,0),new W(0,1,0),new W(0,1,0),new W(0,1,0),new W(0,0,1),new W(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,i=this.matrix,s=e.distance||n.far;s!==n.far&&(n.far=s,n.updateProjectionMatrix()),_u.setFromMatrixPosition(e.matrixWorld),n.position.copy(_u),dg.copy(n.position),dg.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(dg),n.updateMatrixWorld(),i.makeTranslation(-_u.x,-_u.y,-_u.z),Z2.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Z2)}}class g8 extends Pd{constructor(e,t,n=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new A8}get power(){return this.intensity*4*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}}class m8 extends hg{constructor(){super(new fu(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class $2 extends Pd{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Zt.DEFAULT_UP),this.updateMatrix(),this.target=new Zt,this.shadow=new m8}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class vu{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class _8 extends la{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=oa.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(u=>{t&&t(u),s.manager.itemEnd(e)}).catch(u=>{i&&i(u)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const c={};c.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",c.headers=this.requestHeader;const h=fetch(e,c).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(u){return oa.add(e,u),t&&t(u),s.manager.itemEnd(e),u}).catch(function(u){i&&i(u),oa.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});oa.add(e,h),s.manager.itemStart(e)}}class v8{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=ex(),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){const t=ex();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function ex(){return(typeof performance>"u"?Date:performance).now()}const fg="\\[\\]\\.:\\/",y8=new RegExp("["+fg+"]","g"),pg="[^"+fg+"]",E8="[^"+fg.replace("\\.","")+"]",x8=/((?:WC+[\/:])*)/.source.replace("WC",pg),w8=/(WCOD+)?/.source.replace("WCOD",E8),I8=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",pg),C8=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",pg),M8=new RegExp("^"+x8+w8+I8+C8+"$"),S8=["material","materials","bones","map"];class T8{constructor(e,t,n){const i=n||Ut.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class Ut{constructor(e,t,n){this.path=t,this.parsedPath=n||Ut.parseTrackName(t),this.node=Ut.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new Ut.Composite(e,t,n):new Ut(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(y8,"")}static parseTrackName(e){const t=M8.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const s=n.nodeName.substring(i+1);S8.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(s){for(let o=0;o<s.length;o++){const c=s[o];if(c.name===t||c.uuid===t)return c;const h=n(c.children);if(h)return h}return null},i=n(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)e[t++]=n[i]}_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){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=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;const t=this.parsedPath,n=t.objectName,i=t.propertyName;let s=t.propertyIndex;if(e||(e=Ut.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let u=t.objectIndex;switch(n){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let d=0;d<e.length;d++)if(e[d].name===u){u=d;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(u!==void 0){if(e[u]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[u]}}const o=e[i];if(o===void 0){const u=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+i+" but it wasn't found.",e);return}let c=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?c=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(c=this.Versioning.MatrixWorldNeedsUpdate);let h=this.BindingType.Direct;if(s!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[s]!==void 0&&(s=e.morphTargetDictionary[s])}h=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(h=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(h=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[h],this.setValue=this.SetterByBindingTypeAndVersioning[h][c]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Ut.Composite=T8,Ut.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Ut.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Ut.prototype.GetterByBindingType=[Ut.prototype._getValue_direct,Ut.prototype._getValue_array,Ut.prototype._getValue_arrayElement,Ut.prototype._getValue_toArray],Ut.prototype.SetterByBindingTypeAndVersioning=[[Ut.prototype._setValue_direct,Ut.prototype._setValue_direct_setNeedsUpdate,Ut.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Ut.prototype._setValue_array,Ut.prototype._setValue_array_setNeedsUpdate,Ut.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Ut.prototype._setValue_arrayElement,Ut.prototype._setValue_arrayElement_setNeedsUpdate,Ut.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Ut.prototype._setValue_fromArray,Ut.prototype._setValue_fromArray_setNeedsUpdate,Ut.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class tx{constructor(e=1,t=0,n=0){return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,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,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Mr(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const rx=new W,kd=new W;class Is{constructor(e=new W,t=new W){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){rx.subVectors(e,this.start),kd.subVectors(this.end,this.start);const n=kd.dot(kd);let i=kd.dot(rx)/n;return t&&(i=Mr(i,0,1)),i}closestPointToPoint(e,t,n){const i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).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)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Gh}})),typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Gh);const nx={type:"change"},Ag={type:"start"},ix={type:"end"},Qd=new lu,sx=new qi,B8=Math.cos(70*CA.DEG2RAD);class b8 extends io{constructor(e,t){super(),this.object=e,this.domElement=t,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new W,this.cursor=new W,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Zo.ROTATE,MIDDLE:Zo.DOLLY,RIGHT:Zo.PAN},this.touches={ONE:$o.ROTATE,TWO:$o.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return c.phi},this.getAzimuthalAngle=function(){return c.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(G){G.addEventListener("keydown",Se),this._domElementKeyEvents=G},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",Se),this._domElementKeyEvents=null},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(nx),n.update(),s=i.NONE},this.update=function(){const G=new W,O=new ji().setFromUnitVectors(e.up,new W(0,1,0)),me=O.clone().invert(),_e=new W,Fe=new ji,De=new W,pt=2*Math.PI;return function(Dt=null){const Lt=n.object.position;G.copy(Lt).sub(n.target),G.applyQuaternion(O),c.setFromVector3(G),n.autoRotate&&s===i.NONE&&P(M(Dt)),n.enableDamping?(c.theta+=h.theta*n.dampingFactor,c.phi+=h.phi*n.dampingFactor):(c.theta+=h.theta,c.phi+=h.phi);let St=n.minAzimuthAngle,At=n.maxAzimuthAngle;isFinite(St)&&isFinite(At)&&(St<-Math.PI?St+=pt:St>Math.PI&&(St-=pt),At<-Math.PI?At+=pt:At>Math.PI&&(At-=pt),St<=At?c.theta=Math.max(St,Math.min(At,c.theta)):c.theta=c.theta>(St+At)/2?Math.max(St,c.theta):Math.min(At,c.theta)),c.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,c.phi)),c.makeSafe(),n.enableDamping===!0?n.target.addScaledVector(d,n.dampingFactor):n.target.add(d),n.target.sub(n.cursor),n.target.clampLength(n.minTargetRadius,n.maxTargetRadius),n.target.add(n.cursor);let ur=!1;if(n.zoomToCursor&&S||n.object.isOrthographicCamera)c.radius=Q(c.radius);else{const Vt=c.radius;c.radius=Q(c.radius*u),ur=Vt!=c.radius}if(G.setFromSpherical(c),G.applyQuaternion(me),Lt.copy(n.target).add(G),n.object.lookAt(n.target),n.enableDamping===!0?(h.theta*=1-n.dampingFactor,h.phi*=1-n.dampingFactor,d.multiplyScalar(1-n.dampingFactor)):(h.set(0,0,0),d.set(0,0,0)),n.zoomToCursor&&S){let Vt=null;if(n.object.isPerspectiveCamera){const mr=G.length();Vt=Q(mr*u);const Tn=mr-Vt;n.object.position.addScaledVector(I,Tn),n.object.updateMatrixWorld(),ur=!!Tn}else if(n.object.isOrthographicCamera){const mr=new W(R.x,R.y,0);mr.unproject(n.object);const Tn=n.object.zoom;n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/u)),n.object.updateProjectionMatrix(),ur=Tn!==n.object.zoom;const qt=new W(R.x,R.y,0);qt.unproject(n.object),n.object.position.sub(qt).add(mr),n.object.updateMatrixWorld(),Vt=G.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;Vt!==null&&(this.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(Vt).add(n.object.position):(Qd.origin.copy(n.object.position),Qd.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(Qd.direction))<B8?e.lookAt(n.target):(sx.setFromNormalAndCoplanarPoint(n.object.up,n.target),Qd.intersectPlane(sx,n.target))))}else if(n.object.isOrthographicCamera){const Vt=n.object.zoom;n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/u)),Vt!==n.object.zoom&&(n.object.updateProjectionMatrix(),ur=!0)}return u=1,S=!1,ur||_e.distanceToSquared(n.object.position)>o||8*(1-Fe.dot(n.object.quaternion))>o||De.distanceToSquared(n.target)>o?(n.dispatchEvent(nx),_e.copy(n.object.position),Fe.copy(n.object.quaternion),De.copy(n.target),!0):!1}}(),this.dispose=function(){n.domElement.removeEventListener("contextmenu",Re),n.domElement.removeEventListener("pointerdown",ee),n.domElement.removeEventListener("pointercancel",pe),n.domElement.removeEventListener("wheel",Ee),n.domElement.removeEventListener("pointermove",ue),n.domElement.removeEventListener("pointerup",pe),n.domElement.getRootNode().removeEventListener("keydown",He,{capture:!0}),n._domElementKeyEvents!==null&&(n._domElementKeyEvents.removeEventListener("keydown",Se),n._domElementKeyEvents=null)};const n=this,i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let s=i.NONE;const o=1e-6,c=new tx,h=new tx;let u=1;const d=new W,A=new Ge,p=new Ge,g=new Ge,v=new Ge,E=new Ge,m=new Ge,_=new Ge,w=new Ge,x=new Ge,I=new W,R=new Ge;let S=!1;const T=[],D={};let b=!1;function M(G){return G!==null?2*Math.PI/60*n.autoRotateSpeed*G:2*Math.PI/60/60*n.autoRotateSpeed}function L(G){const O=Math.abs(G*.01);return Math.pow(.95,n.zoomSpeed*O)}function P(G){h.theta-=G}function N(G){h.phi-=G}const j=function(){const G=new W;return function(O,me){G.setFromMatrixColumn(me,0),G.multiplyScalar(-O),d.add(G)}}(),X=function(){const G=new W;return function(O,me){n.screenSpacePanning===!0?G.setFromMatrixColumn(me,1):(G.setFromMatrixColumn(me,0),G.crossVectors(n.object.up,G)),G.multiplyScalar(O),d.add(G)}}(),K=function(){const G=new W;return function(O,me){const _e=n.domElement;if(n.object.isPerspectiveCamera){const Fe=n.object.position;G.copy(Fe).sub(n.target);let De=G.length();De*=Math.tan(n.object.fov/2*Math.PI/180),j(2*O*De/_e.clientHeight,n.object.matrix),X(2*me*De/_e.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(j(O*(n.object.right-n.object.left)/n.object.zoom/_e.clientWidth,n.object.matrix),X(me*(n.object.top-n.object.bottom)/n.object.zoom/_e.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function ne(G){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?u/=G:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function V(G){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?u*=G:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function te(G,O){if(!n.zoomToCursor)return;S=!0;const me=n.domElement.getBoundingClientRect(),_e=G-me.left,Fe=O-me.top,De=me.width,pt=me.height;R.x=_e/De*2-1,R.y=-(Fe/pt)*2+1,I.set(R.x,R.y,1).unproject(n.object).sub(n.object.position).normalize()}function Q(G){return Math.max(n.minDistance,Math.min(n.maxDistance,G))}function z(G){A.set(G.clientX,G.clientY)}function Z(G){te(G.clientX,G.clientX),_.set(G.clientX,G.clientY)}function re(G){v.set(G.clientX,G.clientY)}function H(G){p.set(G.clientX,G.clientY),g.subVectors(p,A).multiplyScalar(n.rotateSpeed);const O=n.domElement;P(2*Math.PI*g.x/O.clientHeight),N(2*Math.PI*g.y/O.clientHeight),A.copy(p),n.update()}function fe(G){w.set(G.clientX,G.clientY),x.subVectors(w,_),x.y>0?ne(L(x.y)):x.y<0&&V(L(x.y)),_.copy(w),n.update()}function Ae(G){E.set(G.clientX,G.clientY),m.subVectors(E,v).multiplyScalar(n.panSpeed),K(m.x,m.y),v.copy(E),n.update()}function ve(G){te(G.clientX,G.clientY),G.deltaY<0?V(L(G.deltaY)):G.deltaY>0&&ne(L(G.deltaY)),n.update()}function ye(G){let O=!1;switch(G.code){case n.keys.UP:G.ctrlKey||G.metaKey||G.shiftKey?N(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(0,n.keyPanSpeed),O=!0;break;case n.keys.BOTTOM:G.ctrlKey||G.metaKey||G.shiftKey?N(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(0,-n.keyPanSpeed),O=!0;break;case n.keys.LEFT:G.ctrlKey||G.metaKey||G.shiftKey?P(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(n.keyPanSpeed,0),O=!0;break;case n.keys.RIGHT:G.ctrlKey||G.metaKey||G.shiftKey?P(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(-n.keyPanSpeed,0),O=!0;break}O&&(G.preventDefault(),n.update())}function Oe(G){if(T.length===1)A.set(G.pageX,G.pageY);else{const O=Et(G),me=.5*(G.pageX+O.x),_e=.5*(G.pageY+O.y);A.set(me,_e)}}function it(G){if(T.length===1)v.set(G.pageX,G.pageY);else{const O=Et(G),me=.5*(G.pageX+O.x),_e=.5*(G.pageY+O.y);v.set(me,_e)}}function ae(G){const O=Et(G),me=G.pageX-O.x,_e=G.pageY-O.y,Fe=Math.sqrt(me*me+_e*_e);_.set(0,Fe)}function rt(G){n.enableZoom&&ae(G),n.enablePan&&it(G)}function Pe(G){n.enableZoom&&ae(G),n.enableRotate&&Oe(G)}function lt(G){if(T.length==1)p.set(G.pageX,G.pageY);else{const me=Et(G),_e=.5*(G.pageX+me.x),Fe=.5*(G.pageY+me.y);p.set(_e,Fe)}g.subVectors(p,A).multiplyScalar(n.rotateSpeed);const O=n.domElement;P(2*Math.PI*g.x/O.clientHeight),N(2*Math.PI*g.y/O.clientHeight),A.copy(p)}function Ye(G){if(T.length===1)E.set(G.pageX,G.pageY);else{const O=Et(G),me=.5*(G.pageX+O.x),_e=.5*(G.pageY+O.y);E.set(me,_e)}m.subVectors(E,v).multiplyScalar(n.panSpeed),K(m.x,m.y),v.copy(E)}function ct(G){const O=Et(G),me=G.pageX-O.x,_e=G.pageY-O.y,Fe=Math.sqrt(me*me+_e*_e);w.set(0,Fe),x.set(0,Math.pow(w.y/_.y,n.zoomSpeed)),ne(x.y),_.copy(w);const De=(G.pageX+O.x)*.5,pt=(G.pageY+O.y)*.5;te(De,pt)}function Y(G){n.enableZoom&&ct(G),n.enablePan&&Ye(G)}function k(G){n.enableZoom&&ct(G),n.enableRotate&&lt(G)}function ee(G){n.enabled!==!1&&(T.length===0&&(n.domElement.setPointerCapture(G.pointerId),n.domElement.addEventListener("pointermove",ue),n.domElement.addEventListener("pointerup",pe)),!yt(G)&&(at(G),G.pointerType==="touch"?Ze(G):ge(G)))}function ue(G){n.enabled!==!1&&(G.pointerType==="touch"?Ne(G):Ue(G))}function pe(G){switch(ft(G),T.length){case 0:n.domElement.releasePointerCapture(G.pointerId),n.domElement.removeEventListener("pointermove",ue),n.domElement.removeEventListener("pointerup",pe),n.dispatchEvent(ix),s=i.NONE;break;case 1:const O=T[0],me=D[O];Ze({pointerId:O,pageX:me.x,pageY:me.y});break}}function ge(G){let O;switch(G.button){case 0:O=n.mouseButtons.LEFT;break;case 1:O=n.mouseButtons.MIDDLE;break;case 2:O=n.mouseButtons.RIGHT;break;default:O=-1}switch(O){case Zo.DOLLY:if(n.enableZoom===!1)return;Z(G),s=i.DOLLY;break;case Zo.ROTATE:if(G.ctrlKey||G.metaKey||G.shiftKey){if(n.enablePan===!1)return;re(G),s=i.PAN}else{if(n.enableRotate===!1)return;z(G),s=i.ROTATE}break;case Zo.PAN:if(G.ctrlKey||G.metaKey||G.shiftKey){if(n.enableRotate===!1)return;z(G),s=i.ROTATE}else{if(n.enablePan===!1)return;re(G),s=i.PAN}break;default:s=i.NONE}s!==i.NONE&&n.dispatchEvent(Ag)}function Ue(G){switch(s){case i.ROTATE:if(n.enableRotate===!1)return;H(G);break;case i.DOLLY:if(n.enableZoom===!1)return;fe(G);break;case i.PAN:if(n.enablePan===!1)return;Ae(G);break}}function Ee(G){n.enabled===!1||n.enableZoom===!1||s!==i.NONE||(G.preventDefault(),n.dispatchEvent(Ag),ve(Qe(G)),n.dispatchEvent(ix))}function Qe(G){const O=G.deltaMode,me={clientX:G.clientX,clientY:G.clientY,deltaY:G.deltaY};switch(O){case 1:me.deltaY*=16;break;case 2:me.deltaY*=100;break}return G.ctrlKey&&!b&&(me.deltaY*=10),me}function He(G){G.key==="Control"&&(b=!0,n.domElement.getRootNode().addEventListener("keyup",Ce,{passive:!0,capture:!0}))}function Ce(G){G.key==="Control"&&(b=!1,n.domElement.getRootNode().removeEventListener("keyup",Ce,{passive:!0,capture:!0}))}function Se(G){n.enabled===!1||n.enablePan===!1||ye(G)}function Ze(G){switch(_t(G),T.length){case 1:switch(n.touches.ONE){case $o.ROTATE:if(n.enableRotate===!1)return;Oe(G),s=i.TOUCH_ROTATE;break;case $o.PAN:if(n.enablePan===!1)return;it(G),s=i.TOUCH_PAN;break;default:s=i.NONE}break;case 2:switch(n.touches.TWO){case $o.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;rt(G),s=i.TOUCH_DOLLY_PAN;break;case $o.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;Pe(G),s=i.TOUCH_DOLLY_ROTATE;break;default:s=i.NONE}break;default:s=i.NONE}s!==i.NONE&&n.dispatchEvent(Ag)}function Ne(G){switch(_t(G),s){case i.TOUCH_ROTATE:if(n.enableRotate===!1)return;lt(G),n.update();break;case i.TOUCH_PAN:if(n.enablePan===!1)return;Ye(G),n.update();break;case i.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Y(G),n.update();break;case i.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;k(G),n.update();break;default:s=i.NONE}}function Re(G){n.enabled!==!1&&G.preventDefault()}function at(G){T.push(G.pointerId)}function ft(G){delete D[G.pointerId];for(let O=0;O<T.length;O++)if(T[O]==G.pointerId){T.splice(O,1);return}}function yt(G){for(let O=0;O<T.length;O++)if(T[O]==G.pointerId)return!0;return!1}function _t(G){let O=D[G.pointerId];O===void 0&&(O=new Ge,D[G.pointerId]=O),O.set(G.pageX,G.pageY)}function Et(G){const O=G.pointerId===T[0]?T[1]:T[0];return D[O]}n.domElement.addEventListener("contextmenu",Re),n.domElement.addEventListener("pointerdown",ee),n.domElement.addEventListener("pointercancel",pe),n.domElement.addEventListener("wheel",Ee,{passive:!1}),n.domElement.getRootNode().addEventListener("keydown",He,{passive:!0,capture:!0}),this.update()}}function ax(r,e){if(e===ib)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),r;if(e===xA||e===AE){let t=r.getIndex();if(t===null){const o=[],c=r.getAttribute("position");if(c!==void 0){for(let h=0;h<c.count;h++)o.push(h);r.setIndex(o),t=r.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),r}const n=t.count-2,i=[];if(e===xA)for(let o=1;o<=n;o++)i.push(t.getX(0)),i.push(t.getX(o)),i.push(t.getX(o+1));else for(let o=0;o<n;o++)o%2===0?(i.push(t.getX(o)),i.push(t.getX(o+1)),i.push(t.getX(o+2))):(i.push(t.getX(o+2)),i.push(t.getX(o+1)),i.push(t.getX(o)));i.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=r.clone();return s.setIndex(i),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),r}class R8 extends la{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new P8(t)}),this.register(function(t){return new j8(t)}),this.register(function(t){return new W8(t)}),this.register(function(t){return new Y8(t)}),this.register(function(t){return new Q8(t)}),this.register(function(t){return new O8(t)}),this.register(function(t){return new F8(t)}),this.register(function(t){return new z8(t)}),this.register(function(t){return new U8(t)}),this.register(function(t){return new H8(t)}),this.register(function(t){return new k8(t)}),this.register(function(t){return new V8(t)}),this.register(function(t){return new G8(t)}),this.register(function(t){return new L8(t)}),this.register(function(t){return new q8(t)}),this.register(function(t){return new X8(t)})}load(e,t,n,i){const s=this;let o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){const u=vu.extractUrlBase(e);o=vu.resolveURL(u,this.path)}else o=vu.extractUrlBase(e);this.manager.itemStart(e);const c=function(u){i?i(u):console.error(u),s.manager.itemError(e),s.manager.itemEnd(e)},h=new Rl(this.manager);h.setPath(this.path),h.setResponseType("arraybuffer"),h.setRequestHeader(this.requestHeader),h.setWithCredentials(this.withCredentials),h.load(e,function(u){try{s.parse(u,o,function(d){t(d),s.manager.itemEnd(e)},c)}catch(d){c(d)}},n,c)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let s;const o={},c={},h=new TextDecoder;if(typeof e=="string")s=JSON.parse(e);else if(e instanceof ArrayBuffer)if(h.decode(new Uint8Array(e,0,4))===ox){try{o[xt.KHR_BINARY_GLTF]=new K8(e)}catch(d){i&&i(d);return}s=JSON.parse(o[xt.KHR_BINARY_GLTF].content)}else s=JSON.parse(h.decode(e));else s=e;if(s.asset===void 0||s.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const u=new cN(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});u.fileLoader.setRequestHeader(this.requestHeader);for(let d=0;d<this.pluginCallbacks.length;d++){const A=this.pluginCallbacks[d](u);A.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),c[A.name]=A,o[A.name]=!0}if(s.extensionsUsed)for(let d=0;d<s.extensionsUsed.length;++d){const A=s.extensionsUsed[d],p=s.extensionsRequired||[];switch(A){case xt.KHR_MATERIALS_UNLIT:o[A]=new N8;break;case xt.KHR_DRACO_MESH_COMPRESSION:o[A]=new J8(s,this.dracoLoader);break;case xt.KHR_TEXTURE_TRANSFORM:o[A]=new Z8;break;case xt.KHR_MESH_QUANTIZATION:o[A]=new $8;break;default:p.indexOf(A)>=0&&c[A]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+A+'".')}}u.setExtensions(o),u.setPlugins(c),u.parse(n,i)}parseAsync(e,t){const n=this;return new Promise(function(i,s){n.parse(e,t,i,s)})}}function D8(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}const xt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class L8{constructor(e){this.parser=e,this.name=xt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n<i;n++){const s=t[n];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let i=t.cache.get(n);if(i)return i;const s=t.json,o=((s.extensions&&s.extensions[this.name]||{}).lights||[])[e];let c;const h=new qe(16777215);o.color!==void 0&&h.setRGB(o.color[0],o.color[1],o.color[2],Cr);const u=o.range!==void 0?o.range:0;switch(o.type){case"directional":c=new $2(h),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new g8(h),c.distance=u;break;case"spot":c=new p8(h),c.distance=u,o.spot=o.spot||{},o.spot.innerConeAngle=o.spot.innerConeAngle!==void 0?o.spot.innerConeAngle:0,o.spot.outerConeAngle=o.spot.outerConeAngle!==void 0?o.spot.outerConeAngle:Math.PI/4,c.angle=o.spot.outerConeAngle,c.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return c.position.set(0,0,0),c.decay=2,ua(c,o),o.intensity!==void 0&&(c.intensity=o.intensity),c.name=t.createUniqueName(o.name||"light_"+e),i=Promise.resolve(c),t.cache.add(n,i),i}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,i=n.json.nodes[e],s=(i.extensions&&i.extensions[this.name]||{}).light;return s===void 0?null:this._loadLight(s).then(function(o){return n._getNodeRef(t.cache,s,o)})}}class N8{constructor(){this.name=xt.KHR_MATERIALS_UNLIT}getMaterialType(){return Es}extendParams(e,t,n){const i=[];e.color=new qe(1,1,1),e.opacity=1;const s=t.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const o=s.baseColorFactor;e.color.setRGB(o[0],o[1],o[2],Cr),e.opacity=o[3]}s.baseColorTexture!==void 0&&i.push(n.assignTexture(e,"map",s.baseColorTexture,kr))}return Promise.all(i)}}class U8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=n.extensions[this.name].emissiveStrength;return i!==void 0&&(t.emissiveIntensity=i),Promise.resolve()}}class P8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Di}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];if(o.clearcoatFactor!==void 0&&(t.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&s.push(n.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&s.push(n.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(s.push(n.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){const c=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new Ge(c,c)}return Promise.all(s)}}class k8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Di}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.iridescenceFactor!==void 0&&(t.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&s.push(n.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(t.iridescenceIOR=o.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&s.push(n.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(s)}}class Q8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_SHEEN}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Di}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[];t.sheenColor=new qe(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=i.extensions[this.name];if(o.sheenColorFactor!==void 0){const c=o.sheenColorFactor;t.sheenColor.setRGB(c[0],c[1],c[2],Cr)}return o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&s.push(n.assignTexture(t,"sheenColorMap",o.sheenColorTexture,kr)),o.sheenRoughnessTexture!==void 0&&s.push(n.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(s)}}class O8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Di}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.transmissionFactor!==void 0&&(t.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&s.push(n.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(s)}}class F8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_VOLUME}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Di}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];t.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&s.push(n.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const c=o.attenuationColor||[1,1,1];return t.attenuationColor=new qe().setRGB(c[0],c[1],c[2],Cr),Promise.all(s)}}class z8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_IOR}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Di}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=n.extensions[this.name];return t.ior=i.ior!==void 0?i.ior:1.5,Promise.resolve()}}class H8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_SPECULAR}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Di}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];t.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&s.push(n.assignTexture(t,"specularIntensityMap",o.specularTexture));const c=o.specularColorFactor||[1,1,1];return t.specularColor=new qe().setRGB(c[0],c[1],c[2],Cr),o.specularColorTexture!==void 0&&s.push(n.assignTexture(t,"specularColorMap",o.specularColorTexture,kr)),Promise.all(s)}}class G8{constructor(e){this.parser=e,this.name=xt.EXT_MATERIALS_BUMP}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Di}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return t.bumpScale=o.bumpFactor!==void 0?o.bumpFactor:1,o.bumpTexture!==void 0&&s.push(n.assignTexture(t,"bumpMap",o.bumpTexture)),Promise.all(s)}}class V8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Di}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.anisotropyStrength!==void 0&&(t.anisotropy=o.anisotropyStrength),o.anisotropyRotation!==void 0&&(t.anisotropyRotation=o.anisotropyRotation),o.anisotropyTexture!==void 0&&s.push(n.assignTexture(t,"anisotropyMap",o.anisotropyTexture)),Promise.all(s)}}class j8{constructor(e){this.parser=e,this.name=xt.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,i=n.textures[e];if(!i.extensions||!i.extensions[this.name])return null;const s=i.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,o)}}class W8{constructor(e){this.parser=e,this.name=xt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],c=i.images[o.source];let h=n.textureLoader;if(c.uri){const u=n.options.manager.getHandler(c.uri);u!==null&&(h=u)}return this.detectSupport().then(function(u){if(u)return n.loadTextureImage(e,o.source,h);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class Y8{constructor(e){this.parser=e,this.name=xt.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],c=i.images[o.source];let h=n.textureLoader;if(c.uri){const u=n.options.manager.getHandler(c.uri);u!==null&&(h=u)}return this.detectSupport().then(function(u){if(u)return n.loadTextureImage(e,o.source,h);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class q8{constructor(e){this.name=xt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const i=n.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(c){const h=i.byteOffset||0,u=i.byteLength||0,d=i.count,A=i.byteStride,p=new Uint8Array(c,h,u);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(d,A,p,i.mode,i.filter).then(function(g){return g.buffer}):o.ready.then(function(){const g=new ArrayBuffer(d*A);return o.decodeGltfBuffer(new Uint8Array(g),d,A,p,i.mode,i.filter),g})})}else return null}}class X8{constructor(e){this.name=xt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const i=t.meshes[n.mesh];for(const h of i.primitives)if(h.mode!==ni.TRIANGLES&&h.mode!==ni.TRIANGLE_STRIP&&h.mode!==ni.TRIANGLE_FAN&&h.mode!==void 0)return null;const s=n.extensions[this.name].attributes,o=[],c={};for(const h in s)o.push(this.parser.getDependency("accessor",s[h]).then(u=>(c[h]=u,c[h])));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then(h=>{const u=h.pop(),d=u.isGroup?u.children:[u],A=h[0].count,p=[];for(const g of d){const v=new tt,E=new W,m=new ji,_=new W(1,1,1),w=new WL(g.geometry,g.material,A);for(let x=0;x<A;x++)c.TRANSLATION&&E.fromBufferAttribute(c.TRANSLATION,x),c.ROTATION&&m.fromBufferAttribute(c.ROTATION,x),c.SCALE&&_.fromBufferAttribute(c.SCALE,x),w.setMatrixAt(x,v.compose(E,m,_));for(const x in c)if(x==="_COLOR_0"){const I=c[x];w.instanceColor=new sg(I.array,I.itemSize,I.normalized)}else x!=="TRANSLATION"&&x!=="ROTATION"&&x!=="SCALE"&&g.geometry.setAttribute(x,c[x]);Zt.prototype.copy.call(w,g),this.parser.assignFinalMaterial(w),p.push(w)}return u.isGroup?(u.clear(),u.add(...p),u):p[0]}))}}const ox="glTF",yu=12,lx={JSON:1313821514,BIN:5130562};class K8{constructor(e){this.name=xt.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,yu),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==ox)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-yu,s=new DataView(e,yu);let o=0;for(;o<i;){const c=s.getUint32(o,!0);o+=4;const h=s.getUint32(o,!0);if(o+=4,h===lx.JSON){const u=new Uint8Array(e,yu+o,c);this.content=n.decode(u)}else if(h===lx.BIN){const u=yu+o;this.body=e.slice(u,u+c)}o+=c}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class J8{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=xt.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,i=this.dracoLoader,s=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,c={},h={},u={};for(const d in o){const A=mg[d]||d.toLowerCase();c[A]=o[d]}for(const d in e.attributes){const A=mg[d]||d.toLowerCase();if(o[d]!==void 0){const p=n.accessors[e.attributes[d]],g=Dl[p.componentType];u[A]=g.name,h[A]=p.normalized===!0}}return t.getDependency("bufferView",s).then(function(d){return new Promise(function(A,p){i.decodeDracoFile(d,function(g){for(const v in g.attributes){const E=g.attributes[v],m=h[v];m!==void 0&&(E.normalized=m)}A(g)},c,u,Cr,p)})})}}class Z8{constructor(){this.name=xt.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class $8{constructor(){this.name=xt.KHR_MESH_QUANTIZATION}}class cx extends mu{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let o=0;o!==i;o++)t[o]=n[s+o];return t}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,c=this.valueSize,h=c*2,u=c*3,d=i-t,A=(n-t)/d,p=A*A,g=p*A,v=e*u,E=v-u,m=-2*g+3*p,_=g-p,w=1-m,x=_-p+A;for(let I=0;I!==c;I++){const R=o[E+I+c],S=o[E+I+h]*d,T=o[v+I+c],D=o[v+I]*d;s[I]=w*R+x*S+m*T+_*D}return s}}const eN=new ji;class tN extends cx{interpolate_(e,t,n,i){const s=super.interpolate_(e,t,n,i);return eN.fromArray(s).normalize().toArray(s),s}}const ni={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},Dl={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},ux={9728:dr,9729:fr,9984:Gy,9985:Yh,9986:Kc,9987:xi},hx={33071:Ei,33648:Wh,10497:Zs},gg={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},mg={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},ca={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},rN={CUBICSPLINE:void 0,LINEAR:nl,STEP:tu},_g={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function nN(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new cg({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:vi})),r.DefaultMaterial}function go(r,e,t){for(const n in t.extensions)r[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function ua(r,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(r.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function iN(r,e,t){let n=!1,i=!1,s=!1;for(let u=0,d=e.length;u<d;u++){const A=e[u];if(A.POSITION!==void 0&&(n=!0),A.NORMAL!==void 0&&(i=!0),A.COLOR_0!==void 0&&(s=!0),n&&i&&s)break}if(!n&&!i&&!s)return Promise.resolve(r);const o=[],c=[],h=[];for(let u=0,d=e.length;u<d;u++){const A=e[u];if(n){const p=A.POSITION!==void 0?t.getDependency("accessor",A.POSITION):r.attributes.position;o.push(p)}if(i){const p=A.NORMAL!==void 0?t.getDependency("accessor",A.NORMAL):r.attributes.normal;c.push(p)}if(s){const p=A.COLOR_0!==void 0?t.getDependency("accessor",A.COLOR_0):r.attributes.color;h.push(p)}}return Promise.all([Promise.all(o),Promise.all(c),Promise.all(h)]).then(function(u){const d=u[0],A=u[1],p=u[2];return n&&(r.morphAttributes.position=d),i&&(r.morphAttributes.normal=A),s&&(r.morphAttributes.color=p),r.morphTargetsRelative=!0,r})}function sN(r,e){if(r.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)r.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(r.morphTargetInfluences.length===t.length){r.morphTargetDictionary={};for(let n=0,i=t.length;n<i;n++)r.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function aN(r){let e;const t=r.extensions&&r.extensions[xt.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+vg(t.attributes):e=r.indices+":"+vg(r.attributes)+":"+r.mode,r.targets!==void 0)for(let n=0,i=r.targets.length;n<i;n++)e+=":"+vg(r.targets[n]);return e}function vg(r){let e="";const t=Object.keys(r).sort();for(let n=0,i=t.length;n<i;n++)e+=t[n]+":"+r[t[n]]+";";return e}function yg(r){switch(r){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function oN(r){return r.search(/\.jpe?g($|\?)/i)>0||r.search(/^data\:image\/jpeg/)===0?"image/jpeg":r.search(/\.webp($|\?)/i)>0||r.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const lN=new tt;class cN{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new D8,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,i=!1,s=-1;typeof navigator<"u"&&(n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,i=navigator.userAgent.indexOf("Firefox")>-1,s=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||n||i&&s<98?this.textureLoader=new X2(this.options.manager):this.textureLoader=new _8(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Rl(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,i=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(o){const c={scene:o[0][i.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:i.asset,parser:n,userData:{}};return go(s,c,i),ua(c,i),Promise.all(n._invokeAll(function(h){return h.afterRoot&&h.afterRoot(c)})).then(function(){for(const h of c.scenes)h.updateMatrixWorld();e(c)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let i=0,s=t.length;i<s;i++){const o=t[i].joints;for(let c=0,h=o.length;c<h;c++)e[o[c]].isBone=!0}for(let i=0,s=e.length;i<s;i++){const o=e[i];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(n[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const i=n.clone(),s=(o,c)=>{const h=this.associations.get(o);h!=null&&this.associations.set(c,h);for(const[u,d]of o.children.entries())s(d,c.children[u])};return s(n,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const i=e(t[n]);if(i)return i}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let i=0;i<t.length;i++){const s=e(t[i]);s&&n.push(s)}return n}getDependency(e,t){const n=e+":"+t;let i=this.cache.get(n);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this._invokeOne(function(s){return s.loadNode&&s.loadNode(t)});break;case"mesh":i=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(t)});break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(t)});break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(t)});break;case"texture":i=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(t)});break;case"skin":i=this.loadSkin(t);break;case"animation":i=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(t)});break;case"camera":i=this.loadCamera(t);break;default:if(i=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(e,t)}),!i)throw new Error("Unknown type: "+e);break}this.cache.add(n,i)}return i}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,i=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(i.map(function(s,o){return n.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[xt.KHR_BINARY_GLTF].body);const i=this.options;return new Promise(function(s,o){n.load(vu.resolveURL(t.uri,i.path),s,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(n){const i=t.byteLength||0,s=t.byteOffset||0;return n.slice(s,s+i)})}loadAccessor(e){const t=this,n=this.json,i=this.json.accessors[e];if(i.bufferView===void 0&&i.sparse===void 0){const o=gg[i.type],c=Dl[i.componentType],h=i.normalized===!0,u=new c(i.count*o);return Promise.resolve(new Qr(u,o,h))}const s=[];return i.bufferView!==void 0?s.push(this.getDependency("bufferView",i.bufferView)):s.push(null),i.sparse!==void 0&&(s.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(s).then(function(o){const c=o[0],h=gg[i.type],u=Dl[i.componentType],d=u.BYTES_PER_ELEMENT,A=d*h,p=i.byteOffset||0,g=i.bufferView!==void 0?n.bufferViews[i.bufferView].byteStride:void 0,v=i.normalized===!0;let E,m;if(g&&g!==A){const _=Math.floor(p/g),w="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+_+":"+i.count;let x=t.cache.get(w);x||(E=new u(c,_*g,i.count*g/d),x=new zL(E,g/d),t.cache.add(w,x)),m=new tg(x,h,p%g/d,v)}else c===null?E=new u(i.count*h):E=new u(c,p,i.count*h),m=new Qr(E,h,v);if(i.sparse!==void 0){const _=gg.SCALAR,w=Dl[i.sparse.indices.componentType],x=i.sparse.indices.byteOffset||0,I=i.sparse.values.byteOffset||0,R=new w(o[1],x,i.sparse.count*_),S=new u(o[2],I,i.sparse.count*h);c!==null&&(m=new Qr(m.array.slice(),m.itemSize,m.normalized));for(let T=0,D=R.length;T<D;T++){const b=R[T];if(m.setX(b,S[T*h]),h>=2&&m.setY(b,S[T*h+1]),h>=3&&m.setZ(b,S[T*h+2]),h>=4&&m.setW(b,S[T*h+3]),h>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return m})}loadTexture(e){const t=this.json,n=this.options,i=t.textures[e].source,s=t.images[i];let o=this.textureLoader;if(s.uri){const c=n.manager.getHandler(s.uri);c!==null&&(o=c)}return this.loadTextureImage(e,i,o)}loadTextureImage(e,t,n){const i=this,s=this.json,o=s.textures[e],c=s.images[t],h=(c.uri||c.bufferView)+":"+o.sampler;if(this.textureCache[h])return this.textureCache[h];const u=this.loadImageSource(t,n).then(function(d){d.flipY=!1,d.name=o.name||c.name||"",d.name===""&&typeof c.uri=="string"&&c.uri.startsWith("data:image/")===!1&&(d.name=c.uri);const A=(s.samplers||{})[o.sampler]||{};return d.magFilter=ux[A.magFilter]||fr,d.minFilter=ux[A.minFilter]||xi,d.wrapS=hx[A.wrapS]||Zs,d.wrapT=hx[A.wrapT]||Zs,i.associations.set(d,{textures:e}),d}).catch(function(){return null});return this.textureCache[h]=u,u}loadImageSource(e,t){const n=this,i=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(A=>A.clone());const o=i.images[e],c=self.URL||self.webkitURL;let h=o.uri||"",u=!1;if(o.bufferView!==void 0)h=n.getDependency("bufferView",o.bufferView).then(function(A){u=!0;const p=new Blob([A],{type:o.mimeType});return h=c.createObjectURL(p),h});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const d=Promise.resolve(h).then(function(A){return new Promise(function(p,g){let v=p;t.isImageBitmapLoader===!0&&(v=function(E){const m=new Sr(E);m.needsUpdate=!0,p(m)}),t.load(vu.resolveURL(A,s.path),v,void 0,g)})}).then(function(A){return u===!0&&c.revokeObjectURL(h),A.userData.mimeType=o.mimeType||oN(o.uri),A}).catch(function(A){throw console.error("THREE.GLTFLoader: Couldn't load texture",h),A});return this.sourceCache[e]=d,d}assignTexture(e,t,n,i){const s=this;return this.getDependency("texture",n.index).then(function(o){if(!o)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(o=o.clone(),o.channel=n.texCoord),s.extensions[xt.KHR_TEXTURE_TRANSFORM]){const c=n.extensions!==void 0?n.extensions[xt.KHR_TEXTURE_TRANSFORM]:void 0;if(c){const h=s.associations.get(o);o=s.extensions[xt.KHR_TEXTURE_TRANSFORM].extendTexture(o,c),s.associations.set(o,h)}}return i!==void 0&&(o.colorSpace=i),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const i=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const c="PointsMaterial:"+n.uuid;let h=this.cache.get(c);h||(h=new H2,Yi.prototype.copy.call(h,n),h.color.copy(n.color),h.map=n.map,h.sizeAttenuation=!1,this.cache.add(c,h)),n=h}else if(e.isLine){const c="LineBasicMaterial:"+n.uuid;let h=this.cache.get(c);h||(h=new P2,Yi.prototype.copy.call(h,n),h.color.copy(n.color),h.map=n.map,this.cache.add(c,h)),n=h}if(i||s||o){let c="ClonedMaterial:"+n.uuid+":";i&&(c+="derivative-tangents:"),s&&(c+="vertex-colors:"),o&&(c+="flat-shading:");let h=this.cache.get(c);h||(h=n.clone(),s&&(h.vertexColors=!0),o&&(h.flatShading=!0),i&&(h.normalScale&&(h.normalScale.y*=-1),h.clearcoatNormalScale&&(h.clearcoatNormalScale.y*=-1)),this.cache.add(c,h),this.associations.set(h,this.associations.get(n))),n=h}e.material=n}getMaterialType(){return cg}loadMaterial(e){const t=this,n=this.json,i=this.extensions,s=n.materials[e];let o;const c={},h=s.extensions||{},u=[];if(h[xt.KHR_MATERIALS_UNLIT]){const A=i[xt.KHR_MATERIALS_UNLIT];o=A.getMaterialType(),u.push(A.extendParams(c,s,t))}else{const A=s.pbrMetallicRoughness||{};if(c.color=new qe(1,1,1),c.opacity=1,Array.isArray(A.baseColorFactor)){const p=A.baseColorFactor;c.color.setRGB(p[0],p[1],p[2],Cr),c.opacity=p[3]}A.baseColorTexture!==void 0&&u.push(t.assignTexture(c,"map",A.baseColorTexture,kr)),c.metalness=A.metallicFactor!==void 0?A.metallicFactor:1,c.roughness=A.roughnessFactor!==void 0?A.roughnessFactor:1,A.metallicRoughnessTexture!==void 0&&(u.push(t.assignTexture(c,"metalnessMap",A.metallicRoughnessTexture)),u.push(t.assignTexture(c,"roughnessMap",A.metallicRoughnessTexture))),o=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,c)})))}s.doubleSided===!0&&(c.side=yi);const d=s.alphaMode||_g.OPAQUE;if(d===_g.BLEND?(c.transparent=!0,c.depthWrite=!1):(c.transparent=!1,d===_g.MASK&&(c.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==Es&&(u.push(t.assignTexture(c,"normalMap",s.normalTexture)),c.normalScale=new Ge(1,1),s.normalTexture.scale!==void 0)){const A=s.normalTexture.scale;c.normalScale.set(A,A)}if(s.occlusionTexture!==void 0&&o!==Es&&(u.push(t.assignTexture(c,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(c.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==Es){const A=s.emissiveFactor;c.emissive=new qe().setRGB(A[0],A[1],A[2],Cr)}return s.emissiveTexture!==void 0&&o!==Es&&u.push(t.assignTexture(c,"emissiveMap",s.emissiveTexture,kr)),Promise.all(u).then(function(){const A=new o(c);return s.name&&(A.name=s.name),ua(A,s),t.associations.set(A,{materials:e}),s.extensions&&go(i,A,s),A})}createUniqueName(e){const t=Ut.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,i=this.primitiveCache;function s(c){return n[xt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(c,t).then(function(h){return dx(h,c,t)})}const o=[];for(let c=0,h=e.length;c<h;c++){const u=e[c],d=aN(u),A=i[d];if(A)o.push(A.promise);else{let p;u.extensions&&u.extensions[xt.KHR_DRACO_MESH_COMPRESSION]?p=s(u):p=dx(new zn,u,t),i[d]={primitive:u,promise:p},o.push(p)}}return Promise.all(o)}loadMesh(e){const t=this,n=this.json,i=this.extensions,s=n.meshes[e],o=s.primitives,c=[];for(let h=0,u=o.length;h<u;h++){const d=o[h].material===void 0?nN(this.cache):this.getDependency("material",o[h].material);c.push(d)}return c.push(t.loadGeometries(o)),Promise.all(c).then(function(h){const u=h.slice(0,h.length-1),d=h[h.length-1],A=[];for(let g=0,v=d.length;g<v;g++){const E=d[g],m=o[g];let _;const w=u[g];if(m.mode===ni.TRIANGLES||m.mode===ni.TRIANGLE_STRIP||m.mode===ni.TRIANGLE_FAN||m.mode===void 0)_=s.isSkinnedMesh===!0?new GL(E,w):new Wr(E,w),_.isSkinnedMesh===!0&&_.normalizeSkinWeights(),m.mode===ni.TRIANGLE_STRIP?_.geometry=ax(_.geometry,AE):m.mode===ni.TRIANGLE_FAN&&(_.geometry=ax(_.geometry,xA));else if(m.mode===ni.LINES)_=new YL(E,w);else if(m.mode===ni.LINE_STRIP)_=new og(E,w);else if(m.mode===ni.LINE_LOOP)_=new qL(E,w);else if(m.mode===ni.POINTS)_=new XL(E,w);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+m.mode);Object.keys(_.geometry.morphAttributes).length>0&&sN(_,s),_.name=t.createUniqueName(s.name||"mesh_"+e),ua(_,s),m.extensions&&go(i,_,m),t.assignFinalMaterial(_),A.push(_)}for(let g=0,v=A.length;g<v;g++)t.associations.set(A[g],{meshes:e,primitives:g});if(A.length===1)return s.extensions&&go(i,A[0],s),A[0];const p=new aa;s.extensions&&go(i,p,s),t.associations.set(p,{meshes:e});for(let g=0,v=A.length;g<v;g++)p.add(A[g]);return p})}loadCamera(e){let t;const n=this.json.cameras[e],i=n[n.type];if(!i){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new cn(CA.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):n.type==="orthographic"&&(t=new fu(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),ua(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let i=0,s=t.joints.length;i<s;i++)n.push(this._loadNodeShallow(t.joints[i]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(i){const s=i.pop(),o=i,c=[],h=[];for(let u=0,d=o.length;u<d;u++){const A=o[u];if(A){c.push(A);const p=new tt;s!==null&&p.fromArray(s.array,u*16),h.push(p)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[u])}return new ig(c,h)})}loadAnimation(e){const t=this.json,n=this,i=t.animations[e],s=i.name?i.name:"animation_"+e,o=[],c=[],h=[],u=[],d=[];for(let A=0,p=i.channels.length;A<p;A++){const g=i.channels[A],v=i.samplers[g.sampler],E=g.target,m=E.node,_=i.parameters!==void 0?i.parameters[v.input]:v.input,w=i.parameters!==void 0?i.parameters[v.output]:v.output;E.node!==void 0&&(o.push(this.getDependency("node",m)),c.push(this.getDependency("accessor",_)),h.push(this.getDependency("accessor",w)),u.push(v),d.push(E))}return Promise.all([Promise.all(o),Promise.all(c),Promise.all(h),Promise.all(u),Promise.all(d)]).then(function(A){const p=A[0],g=A[1],v=A[2],E=A[3],m=A[4],_=[];for(let w=0,x=p.length;w<x;w++){const I=p[w],R=g[w],S=v[w],T=E[w],D=m[w];if(I===void 0)continue;I.updateMatrix&&I.updateMatrix();const b=n._createAnimationTracks(I,R,S,T,D);if(b)for(let M=0;M<b.length;M++)_.push(b[M])}return new s8(s,void 0,_)})}createNodeMesh(e){const t=this.json,n=this,i=t.nodes[e];return i.mesh===void 0?null:n.getDependency("mesh",i.mesh).then(function(s){const o=n._getNodeRef(n.meshCache,i.mesh,s);return i.weights!==void 0&&o.traverse(function(c){if(c.isMesh)for(let h=0,u=i.weights.length;h<u;h++)c.morphTargetInfluences[h]=i.weights[h]}),o})}loadNode(e){const t=this.json,n=this,i=t.nodes[e],s=n._loadNodeShallow(e),o=[],c=i.children||[];for(let u=0,d=c.length;u<d;u++)o.push(n.getDependency("node",c[u]));const h=i.skin===void 0?Promise.resolve(null):n.getDependency("skin",i.skin);return Promise.all([s,Promise.all(o),h]).then(function(u){const d=u[0],A=u[1],p=u[2];p!==null&&d.traverse(function(g){g.isSkinnedMesh&&g.bind(p,lN)});for(let g=0,v=A.length;g<v;g++)d.add(A[g]);return d})}_loadNodeShallow(e){const t=this.json,n=this.extensions,i=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const s=t.nodes[e],o=s.name?i.createUniqueName(s.name):"",c=[],h=i._invokeOne(function(u){return u.createNodeMesh&&u.createNodeMesh(e)});return h&&c.push(h),s.camera!==void 0&&c.push(i.getDependency("camera",s.camera).then(function(u){return i._getNodeRef(i.cameraCache,s.camera,u)})),i._invokeAll(function(u){return u.createNodeAttachment&&u.createNodeAttachment(e)}).forEach(function(u){c.push(u)}),this.nodeCache[e]=Promise.all(c).then(function(u){let d;if(s.isBone===!0?d=new D2:u.length>1?d=new aa:u.length===1?d=u[0]:d=new Zt,d!==u[0])for(let A=0,p=u.length;A<p;A++)d.add(u[A]);if(s.name&&(d.userData.name=s.name,d.name=o),ua(d,s),s.extensions&&go(n,d,s),s.matrix!==void 0){const A=new tt;A.fromArray(s.matrix),d.applyMatrix4(A)}else s.translation!==void 0&&d.position.fromArray(s.translation),s.rotation!==void 0&&d.quaternion.fromArray(s.rotation),s.scale!==void 0&&d.scale.fromArray(s.scale);return i.associations.has(d)||i.associations.set(d,{}),i.associations.get(d).nodes=e,d}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],i=this,s=new aa;n.name&&(s.name=i.createUniqueName(n.name)),ua(s,n),n.extensions&&go(t,s,n);const o=n.nodes||[],c=[];for(let h=0,u=o.length;h<u;h++)c.push(i.getDependency("node",o[h]));return Promise.all(c).then(function(h){for(let d=0,A=h.length;d<A;d++)s.add(h[d]);const u=d=>{const A=new Map;for(const[p,g]of i.associations)(p instanceof Yi||p instanceof Sr)&&A.set(p,g);return d.traverse(p=>{const g=i.associations.get(p);g!=null&&A.set(p,g)}),A};return i.associations=u(s),s})}_createAnimationTracks(e,t,n,i,s){const o=[],c=e.name?e.name:e.uuid,h=[];ca[s.path]===ca.weights?e.traverse(function(p){p.morphTargetInfluences&&h.push(p.name?p.name:p.uuid)}):h.push(c);let u;switch(ca[s.path]){case ca.weights:u=Tl;break;case ca.rotation:u=Ao;break;case ca.position:case ca.scale:u=bl;break;default:switch(n.itemSize){case 1:u=Tl;break;case 2:case 3:default:u=bl;break}break}const d=i.interpolation!==void 0?rN[i.interpolation]:nl,A=this._getArrayFromAccessor(n);for(let p=0,g=h.length;p<g;p++){const v=new u(h[p]+"."+ca[s.path],t.array,A,d);i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(v),o.push(v)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=yg(t.constructor),i=new Float32Array(t.length);for(let s=0,o=t.length;s<o;s++)i[s]=t[s]*n;t=i}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(t){const n=this instanceof Ao?tN:cx;return new n(this.times,this.values,this.getValueSize()/3,t)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function uN(r,e,t){const n=e.attributes,i=new yr;if(n.POSITION!==void 0){const c=t.json.accessors[n.POSITION],h=c.min,u=c.max;if(h!==void 0&&u!==void 0){if(i.set(new W(h[0],h[1],h[2]),new W(u[0],u[1],u[2])),c.normalized){const d=yg(Dl[c.componentType]);i.min.multiplyScalar(d),i.max.multiplyScalar(d)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const c=new W,h=new W;for(let u=0,d=s.length;u<d;u++){const A=s[u];if(A.POSITION!==void 0){const p=t.json.accessors[A.POSITION],g=p.min,v=p.max;if(g!==void 0&&v!==void 0){if(h.setX(Math.max(Math.abs(g[0]),Math.abs(v[0]))),h.setY(Math.max(Math.abs(g[1]),Math.abs(v[1]))),h.setZ(Math.max(Math.abs(g[2]),Math.abs(v[2]))),p.normalized){const E=yg(Dl[p.componentType]);h.multiplyScalar(E)}c.max(h)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(c)}r.boundingBox=i;const o=new Ti;i.getCenter(o.center),o.radius=i.min.distanceTo(i.max)/2,r.boundingSphere=o}function dx(r,e,t){const n=e.attributes,i=[];function s(o,c){return t.getDependency("accessor",o).then(function(h){r.setAttribute(c,h)})}for(const o in n){const c=mg[o]||o.toLowerCase();c in r.attributes||i.push(s(n[o],c))}if(e.indices!==void 0&&!r.index){const o=t.getDependency("accessor",e.indices).then(function(c){r.setIndex(c)});i.push(o)}return Rt.workingColorSpace!==Cr&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Rt.workingColorSpace}" not supported.`),ua(r,e),uN(r,e,t),Promise.all(i).then(function(){return e.targets!==void 0?iN(r,e.targets,t):r})}class hN{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}_onMessage(e,t){const n=this.workersResolve[e];if(n&&n(t),this.queue.length){const{resolve:i,msg:s,transfer:o}=this.queue.shift();this.workersResolve[e]=i,this.workers[e].postMessage(s,o)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(n=>{const i=this._getIdleWorker();i!==-1?(this._initWorker(i),this.workerStatus|=1<<i,this.workersResolve[i]=n,this.workers[i].postMessage(e,t)):this.queue.push({resolve:n,msg:e,transfer:t})})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}const dN=0,fx=2,fN=1,px=2,pN=0,AN=1,gN=10,mN=0,Ax=9,gx=15,mx=16,_x=22,vx=37,yx=43,Ex=76,xx=83,wx=97,Ix=100,Cx=103,Mx=109,Sx=165,Tx=166;class _N{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class Eu{constructor(e,t,n,i){this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=i,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+4294967296*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_skip(e){return this._offset+=e,this}_scan(e,t=0){const n=this._offset;let i=0;for(;this._dataView.getUint8(this._offset)!==t&&i<e;)i++,this._offset++;return i<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,i)}}const hn=[171,75,84,88,32,50,48,187,13,10,26,10];function Bx(r){return typeof TextDecoder<"u"?new TextDecoder().decode(r):Buffer.from(r).toString("utf8")}function vN(r){const e=new Uint8Array(r.buffer,r.byteOffset,hn.length);if(e[0]!==hn[0]||e[1]!==hn[1]||e[2]!==hn[2]||e[3]!==hn[3]||e[4]!==hn[4]||e[5]!==hn[5]||e[6]!==hn[6]||e[7]!==hn[7]||e[8]!==hn[8]||e[9]!==hn[9]||e[10]!==hn[10]||e[11]!==hn[11])throw new Error("Missing KTX 2.0 identifier.");const t=new _N,n=17*Uint32Array.BYTES_PER_ELEMENT,i=new Eu(r,hn.length,n,!0);t.vkFormat=i._nextUint32(),t.typeSize=i._nextUint32(),t.pixelWidth=i._nextUint32(),t.pixelHeight=i._nextUint32(),t.pixelDepth=i._nextUint32(),t.layerCount=i._nextUint32(),t.faceCount=i._nextUint32();const s=i._nextUint32();t.supercompressionScheme=i._nextUint32();const o=i._nextUint32(),c=i._nextUint32(),h=i._nextUint32(),u=i._nextUint32(),d=i._nextUint64(),A=i._nextUint64(),p=new Eu(r,hn.length+n,3*s*8,!0);for(let ne=0;ne<s;ne++)t.levels.push({levelData:new Uint8Array(r.buffer,r.byteOffset+p._nextUint64(),p._nextUint64()),uncompressedByteLength:p._nextUint64()});const g=new Eu(r,o,c,!0),v={vendorId:g._skip(4)._nextUint16(),descriptorType:g._nextUint16(),versionNumber:g._nextUint16(),descriptorBlockSize:g._nextUint16(),colorModel:g._nextUint8(),colorPrimaries:g._nextUint8(),transferFunction:g._nextUint8(),flags:g._nextUint8(),texelBlockDimension:[g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8()],bytesPlane:[g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8()],samples:[]},E=(v.descriptorBlockSize/4-6)/4;for(let ne=0;ne<E;ne++){const V={bitOffset:g._nextUint16(),bitLength:g._nextUint8(),channelType:g._nextUint8(),samplePosition:[g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};64&V.channelType?(V.sampleLower=g._nextInt32(),V.sampleUpper=g._nextInt32()):(V.sampleLower=g._nextUint32(),V.sampleUpper=g._nextUint32()),v.samples[ne]=V}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(v);const m=new Eu(r,h,u,!0);for(;m._offset<u;){const ne=m._nextUint32(),V=m._scan(ne),te=Bx(V),Q=m._scan(ne-V.byteLength);t.keyValue[te]=te.match(/^ktx/i)?Bx(Q):Q,m._offset%4&&m._skip(4-m._offset%4)}if(A<=0)return t;const _=new Eu(r,d,A,!0),w=_._nextUint16(),x=_._nextUint16(),I=_._nextUint32(),R=_._nextUint32(),S=_._nextUint32(),T=_._nextUint32(),D=[];for(let ne=0;ne<s;ne++)D.push({imageFlags:_._nextUint32(),rgbSliceByteOffset:_._nextUint32(),rgbSliceByteLength:_._nextUint32(),alphaSliceByteOffset:_._nextUint32(),alphaSliceByteLength:_._nextUint32()});const b=d+_._offset,M=b+I,L=M+R,P=L+S,N=new Uint8Array(r.buffer,r.byteOffset+b,I),j=new Uint8Array(r.buffer,r.byteOffset+M,R),X=new Uint8Array(r.buffer,r.byteOffset+L,S),K=new Uint8Array(r.buffer,r.byteOffset+P,T);return t.globalData={endpointCount:w,selectorCount:x,imageDescs:D,endpointsData:N,selectorsData:j,tablesData:X,extendedData:K},t}let Eg,Cs,xg;const wg={env:{emscripten_notify_memory_growth:function(r){xg=new Uint8Array(Cs.exports.memory.buffer)}}};class yN{init(){return Eg||(Eg=typeof fetch<"u"?fetch("data:application/wasm;base64,"+bx).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,wg)).then(this._init):WebAssembly.instantiate(Buffer.from(bx,"base64"),wg).then(this._init),Eg)}_init(e){Cs=e.instance,wg.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!Cs)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,i=Cs.exports.malloc(n);xg.set(e,i),t=t||Number(Cs.exports.ZSTD_findDecompressedSize(i,n));const s=Cs.exports.malloc(t),o=Cs.exports.ZSTD_decompress(s,t,i,n),c=xg.slice(s,s+o);return Cs.exports.free(i),Cs.exports.free(s),c}}const bx="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoiAzYCCCAAIAMoAAA2AgAgAUF/ai0AACIBBEAgAEEIIAEQFGs2AgQgAg8LIABBADYCBEF/DwsgACABNgIIIAAgAS0AACIDNgIAIAJBfmoiBEEBTQRAIARBAWtFBEAgACABLQACQRB0IANyIgM2AgALIAAgAS0AAUEIdCADajYCAAsgASACakF/ai0AACIBRQRAIABBADYCBEFsDwsgAEEoIAEQFCACQQN0ams2AgQgAgsWACAAIAEpAAA3AAAgACABKQAINwAICy8BAX8gAUECdEGgHWooAgAgACgCAEEgIAEgACgCBGprQR9xdnEhAiAAIAEQASACCyEAIAFCz9bTvtLHq9lCfiAAfEIfiUKHla+vmLbem55/fgsdAQF/IAAoAgggACgCDEYEfyAAKAIEQSBGBUEACwuCBAEDfyACQYDAAE8EQCAAIAEgAhBnIAAPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAkEBSARAIAAhAgwBCyAAQQNxRQRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADTw0BIAJBA3ENAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAgAkEBaiECDAELCyAGIA5LQQAgBiAFQQN1aiIHIAxLG0UEQCAHKAAAIAVBB3EiBXYhBAwCCyAEQQJ2IQQLIAYhBwsCfyALQX9qIAQgAEF/anEiBiAAQQF0QX9qIgggCWsiEUkNABogBCAIcSIEQQAgESAEIABIG2shBiALCyEIIA0gAkEBdGogBkF/aiIEOwEAIAlBASAGayAEIAZBAUgbayEJA0AgCSAASARAIABBAXUhACALQX9qIQsMAQsLAn8gByAOS0EAIAcgBSAIaiIFQQN1aiIGIAxLG0UEQCAFQQdxDAELIAUgDCIGIAdrQQN0awshBSACQQFqIQIgBEUhCCAGKAAAIAVBH3F2IQQMAQsLQWwgCUEBRyAFQSBKcg0BGiABIAJBf2o2AgAgBiAFQQdqQQN1aiADawwBC0FQCyEAIApBEGokACAACwkAQQFBBSAAGwsMACAAIAEoAAA2AAALqgMBCn8jAEHwAGsiCiQAIAJBAWohDiAAQQhqIQtBgIAEIAVBf2p0QRB1IQxBACECQQEhBkEBIAV0IglBf2oiDyEIA0AgAiAORkUEQAJAIAEgAkEBdCINai8BACIHQf//A0YEQCALIAhBA3RqIAI2AgQgCEF/aiEIQQEhBwwBCyAGQQAgDCAHQRB0QRB1ShshBgsgCiANaiAHOwEAIAJBAWohAgwBCwsgACAFNgIEIAAgBjYCACAJQQN2IAlBAXZqQQNqIQxBACEAQQAhBkEAIQIDQCAGIA5GBEADQAJAIAAgCUYNACAKIAsgAEEDdGoiASgCBCIGQQF0aiICIAIvAQAiAkEBajsBACABIAUgAhAUayIIOgADIAEgAiAIQf8BcXQgCWs7AQAgASAEIAZBAnQiAmooAgA6AAIgASACIANqKAIANgIEIABBAWohAAwBCwsFIAEgBkEBdGouAQAhDUEAIQcDQCAHIA1ORQRAIAsgAkEDdGogBjYCBANAIAIgDGogD3EiAiAISw0ACyAHQQFqIQcMAQsLIAZBAWohBgwBCwsgCkHwAGokAAsjAEIAIAEQCSAAhUKHla+vmLbem55/fkLj3MqV/M7y9YV/fAsQACAAQn43AwggACABNgIACyQBAX8gAARAIAEoAgQiAgRAIAEoAgggACACEQEADwsgABAmCwsfACAAIAEgAi8BABAINgIAIAEQBBogACACQQRqNgIEC0oBAX9BoCAoAgAiASAAaiIAQX9MBEBBiCBBMDYCAEF/DwsCQCAAPwBBEHRNDQAgABBmDQBBiCBBMDYCAEF/DwtBoCAgADYCACABC9cBAQh/Qbp/IQoCQCACKAIEIgggAigCACIJaiIOIAEgAGtLDQBBbCEKIAkgBCADKAIAIgtrSw0AIAAgCWoiBCACKAIIIgxrIQ0gACABQWBqIg8gCyAJQQAQKSADIAkgC2o2AgACQAJAIAwgBCAFa00EQCANIQUMAQsgDCAEIAZrSw0CIAcgDSAFayIAaiIBIAhqIAdNBEAgBCABIAgQDxoMAgsgBCABQQAgAGsQDyEBIAIgACAIaiIINgIEIAEgAGshBAsgBCAPIAUgCEEBECkLIA4hCgsgCgubAgEBfyMAQYABayINJAAgDSADNgJ8AkAgAkEDSwRAQX8hCQwBCwJAAkACQAJAIAJBAWsOAwADAgELIAZFBEBBuH8hCQwEC0FsIQkgBS0AACICIANLDQMgACAHIAJBAnQiAmooAgAgAiAIaigCABA7IAEgADYCAEEBIQkMAwsgASAJNgIAQQAhCQwCCyAKRQRAQWwhCQwCC0EAIQkgC0UgDEEZSHINAUEIIAR0QQhqIQBBACECA0AgAiAATw0CIAJBQGshAgwAAAsAC0FsIQkgDSANQfwAaiANQfgAaiAFIAYQFSICEAMNACANKAJ4IgMgBEsNACAAIA0gDSgCfCAHIAggAxAYIAEgADYCACACIQkLIA1BgAFqJAAgCQsLACAAIAEgAhALGgsQACAALwAAIAAtAAJBEHRyCy8AAn9BuH8gAUEISQ0AGkFyIAAoAAQiAEF3Sw0AGkG4fyAAQQhqIgAgACABSxsLCwkAIAAgATsAAAsDAAELigYBBX8gACAAKAIAIgVBfnE2AgBBACAAIAVBAXZqQYQgKAIAIgQgAEYbIQECQAJAIAAoAgQiAkUNACACKAIAIgNBAXENACACQQhqIgUgA0EBdkF4aiIDQQggA0EISxtnQR9zQQJ0QYAfaiIDKAIARgRAIAMgAigCDDYCAAsgAigCCCIDBEAgAyACKAIMNgIECyACKAIMIgMEQCADIAIoAgg2AgALIAIgAigCACAAKAIAQX5xajYCAEGEICEAAkACQCABRQ0AIAEgAjYCBCABKAIAIgNBAXENASADQQF2QXhqIgNBCCADQQhLG2dBH3NBAnRBgB9qIgMoAgAgAUEIakYEQCADIAEoAgw2AgALIAEoAggiAwRAIAMgASgCDDYCBAsgASgCDCIDBEAgAyABKAIINgIAQYQgKAIAIQQLIAIgAigCACABKAIAQX5xajYCACABIARGDQAgASABKAIAQQF2akEEaiEACyAAIAI2AgALIAIoAgBBAXZBeGoiAEEIIABBCEsbZ0Efc0ECdEGAH2oiASgCACEAIAEgBTYCACACIAA2AgwgAkEANgIIIABFDQEgACAFNgIADwsCQCABRQ0AIAEoAgAiAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAigCACABQQhqRgRAIAIgASgCDDYCAAsgASgCCCICBEAgAiABKAIMNgIECyABKAIMIgIEQCACIAEoAgg2AgBBhCAoAgAhBAsgACAAKAIAIAEoAgBBfnFqIgI2AgACQCABIARHBEAgASABKAIAQQF2aiAANgIEIAAoAgAhAgwBC0GEICAANgIACyACQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgIoAgAhASACIABBCGoiAjYCACAAIAE2AgwgAEEANgIIIAFFDQEgASACNgIADwsgBUEBdkF4aiIBQQggAUEISxtnQR9zQQJ0QYAfaiICKAIAIQEgAiAAQQhqIgI2AgAgACABNgIMIABBADYCCCABRQ0AIAEgAjYCAAsLDgAgAARAIABBeGoQJQsLgAIBA38CQCAAQQ9qQXhxQYQgKAIAKAIAQQF2ayICEB1Bf0YNAAJAQYQgKAIAIgAoAgAiAUEBcQ0AIAFBAXZBeGoiAUEIIAFBCEsbZ0Efc0ECdEGAH2oiASgCACAAQQhqRgRAIAEgACgCDDYCAAsgACgCCCIBBEAgASAAKAIMNgIECyAAKAIMIgFFDQAgASAAKAIINgIAC0EBIQEgACAAKAIAIAJBAXRqIgI2AgAgAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAygCACECIAMgAEEIaiIDNgIAIAAgAjYCDCAAQQA2AgggAkUNACACIAM2AgALIAELtwIBA38CQAJAIABBASAAGyICEDgiAA0AAkACQEGEICgCACIARQ0AIAAoAgAiA0EBcQ0AIAAgA0EBcjYCACADQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgAgAEEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigCACACaiAAQQZ2IgFBAnRBsB5qKAIAaiAAQSBxIgBFaiABRSAAQQV2cWoFQbh/CwsdACAAKAKQ4gEQWiAAQQA2AqDiASAAQgA3A5DiAQu1AwEFfyMAQZACayIKJABBuH8hBgJAIAVFDQAgBCwAACIIQf8BcSEHAkAgCEF/TARAIAdBgn9qQQF2IgggBU8NAkFsIQYgB0GBf2oiBUGAAk8NAiAEQQFqIQdBACEGA0AgBiAFTwRAIAUhBiAIIQcMAwUgACAGaiAHIAZBAXZqIgQtAABBBHY6AAAgACAGQQFyaiAELQAAQQ9xOgAAIAZBAmohBgwBCwAACwALIAcgBU8NASAAIARBAWogByAKEFMiBhADDQELIAYhBEEAIQYgAUEAQTQQECEJQQAhBQNAIAQgBkcEQCAAIAZqIggtAAAiAUELSwRAQWwhBgwDBSAJIAFBAnRqIgEgASgCAEEBajYCACAGQQFqIQZBASAILQAAdEEBdSAFaiEFDAILAAsLQWwhBiAFRQ0AIAUQFEEBaiIBQQxLDQAgAyABNgIAQQFBASABdCAFayIDEBQiAXQgA0cNACAAIARqIAFBAWoiADoAACAJIABBAnRqIgAgACgCAEEBajYCACAJKAIEIgBBAkkgAEEBcXINACACIARBAWo2AgAgB0EBaiEGCyAKQZACaiQAIAYLxhEBDH8jAEHwAGsiBSQAQWwhCwJAIANBCkkNACACLwAAIQogAi8AAiEJIAIvAAQhByAFQQhqIAQQDgJAIAMgByAJIApqakEGaiIMSQ0AIAUtAAohCCAFQdgAaiACQQZqIgIgChAGIgsQAw0BIAVBQGsgAiAKaiICIAkQBiILEAMNASAFQShqIAIgCWoiAiAHEAYiCxADDQEgBUEQaiACIAdqIAMgDGsQBiILEAMNASAAIAFqIg9BfWohECAEQQRqIQZBASELIAAgAUEDakECdiIDaiIMIANqIgIgA2oiDiEDIAIhBCAMIQcDQCALIAMgEElxBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgCS0AAyELIAcgBiAFQUBrIAgQAkECdGoiCS8BADsAACAFQUBrIAktAAIQASAJLQADIQogBCAGIAVBKGogCBACQQJ0aiIJLwEAOwAAIAVBKGogCS0AAhABIAktAAMhCSADIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgDS0AAyENIAAgC2oiCyAGIAVB2ABqIAgQAkECdGoiAC8BADsAACAFQdgAaiAALQACEAEgAC0AAyEAIAcgCmoiCiAGIAVBQGsgCBACQQJ0aiIHLwEAOwAAIAVBQGsgBy0AAhABIActAAMhByAEIAlqIgkgBiAFQShqIAgQAkECdGoiBC8BADsAACAFQShqIAQtAAIQASAELQADIQQgAyANaiIDIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgACALaiEAIAcgCmohByAEIAlqIQQgAyANLQADaiEDIAVB2ABqEA0gBUFAaxANciAFQShqEA1yIAVBEGoQDXJFIQsMAQsLIAQgDksgByACS3INAEFsIQsgACAMSw0BIAxBfWohCQNAQQAgACAJSSAFQdgAahAEGwRAIAAgBiAFQdgAaiAIEAJBAnRqIgovAQA7AAAgBUHYAGogCi0AAhABIAAgCi0AA2oiACAGIAVB2ABqIAgQAkECdGoiCi8BADsAACAFQdgAaiAKLQACEAEgACAKLQADaiEADAEFIAxBfmohCgNAIAVB2ABqEAQgACAKS3JFBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgACAJLQADaiEADAELCwNAIAAgCk0EQCAAIAYgBUHYAGogCBACQQJ0aiIJLwEAOwAAIAVB2ABqIAktAAIQASAAIAktAANqIQAMAQsLAkAgACAMTw0AIAAgBiAFQdgAaiAIEAIiAEECdGoiDC0AADoAACAMLQADQQFGBEAgBUHYAGogDC0AAhABDAELIAUoAlxBH0sNACAFQdgAaiAGIABBAnRqLQACEAEgBSgCXEEhSQ0AIAVBIDYCXAsgAkF9aiEMA0BBACAHIAxJIAVBQGsQBBsEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiIAIAYgBUFAayAIEAJBAnRqIgcvAQA7AAAgBUFAayAHLQACEAEgACAHLQADaiEHDAEFIAJBfmohDANAIAVBQGsQBCAHIAxLckUEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwNAIAcgDE0EQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwJAIAcgAk8NACAHIAYgBUFAayAIEAIiAEECdGoiAi0AADoAACACLQADQQFGBEAgBUFAayACLQACEAEMAQsgBSgCREEfSw0AIAVBQGsgBiAAQQJ0ai0AAhABIAUoAkRBIUkNACAFQSA2AkQLIA5BfWohAgNAQQAgBCACSSAFQShqEAQbBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2oiACAGIAVBKGogCBACQQJ0aiIELwEAOwAAIAVBKGogBC0AAhABIAAgBC0AA2ohBAwBBSAOQX5qIQIDQCAFQShqEAQgBCACS3JFBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsDQCAEIAJNBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsCQCAEIA5PDQAgBCAGIAVBKGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBKGogAi0AAhABDAELIAUoAixBH0sNACAFQShqIAYgAEECdGotAAIQASAFKAIsQSFJDQAgBUEgNgIsCwNAQQAgAyAQSSAFQRBqEAQbBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2oiACAGIAVBEGogCBACQQJ0aiICLwEAOwAAIAVBEGogAi0AAhABIAAgAi0AA2ohAwwBBSAPQX5qIQIDQCAFQRBqEAQgAyACS3JFBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsDQCADIAJNBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsCQCADIA9PDQAgAyAGIAVBEGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBEGogAi0AAhABDAELIAUoAhRBH0sNACAFQRBqIAYgAEECdGotAAIQASAFKAIUQSFJDQAgBUEgNgIUCyABQWwgBUHYAGoQCiAFQUBrEApxIAVBKGoQCnEgBUEQahAKcRshCwwJCwAACwALAAALAAsAAAsACwAACwALQWwhCwsgBUHwAGokACALC7UEAQ5/IwBBEGsiBiQAIAZBBGogABAOQVQhBQJAIARB3AtJDQAgBi0ABCEHIANB8ARqQQBB7AAQECEIIAdBDEsNACADQdwJaiIJIAggBkEIaiAGQQxqIAEgAhAxIhAQA0UEQCAGKAIMIgQgB0sNASADQdwFaiEPIANBpAVqIREgAEEEaiESIANBqAVqIQEgBCEFA0AgBSICQX9qIQUgCCACQQJ0aigCAEUNAAsgAkEBaiEOQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgASALaiAKNgIAIAVBAWohBSAKIAxqIQoMAQsLIAEgCjYCAEEAIQUgBigCCCELA0AgBSALRkUEQCABIAUgCWotAAAiDEECdGoiDSANKAIAIg1BAWo2AgAgDyANQQF0aiINIAw6AAEgDSAFOgAAIAVBAWohBQwBCwtBACEBIANBADYCqAUgBEF/cyAHaiEJQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgAyALaiABNgIAIAwgBSAJanQgAWohASAFQQFqIQUMAQsLIAcgBEEBaiIBIAJrIgRrQQFqIQgDQEEBIQUgBCAIT0UEQANAIAUgDk9FBEAgBUECdCIJIAMgBEE0bGpqIAMgCWooAgAgBHY2AgAgBUEBaiEFDAELCyAEQQFqIQQMAQsLIBIgByAPIAogESADIAIgARBkIAZBAToABSAGIAc6AAYgACAGKAIENgIACyAQIQULIAZBEGokACAFC8ENAQt/IwBB8ABrIgUkAEFsIQkCQCADQQpJDQAgAi8AACEKIAIvAAIhDCACLwAEIQYgBUEIaiAEEA4CQCADIAYgCiAMampBBmoiDUkNACAFLQAKIQcgBUHYAGogAkEGaiICIAoQBiIJEAMNASAFQUBrIAIgCmoiAiAMEAYiCRADDQEgBUEoaiACIAxqIgIgBhAGIgkQAw0BIAVBEGogAiAGaiADIA1rEAYiCRADDQEgACABaiIOQX1qIQ8gBEEEaiEGQQEhCSAAIAFBA2pBAnYiAmoiCiACaiIMIAJqIg0hAyAMIQQgCiECA0AgCSADIA9JcQRAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAACAGIAVBQGsgBxACQQF0aiIILQAAIQsgBUFAayAILQABEAEgAiALOgAAIAYgBUEoaiAHEAJBAXRqIggtAAAhCyAFQShqIAgtAAEQASAEIAs6AAAgBiAFQRBqIAcQAkEBdGoiCC0AACELIAVBEGogCC0AARABIAMgCzoAACAGIAVB2ABqIAcQAkEBdGoiCC0AACELIAVB2ABqIAgtAAEQASAAIAs6AAEgBiAFQUBrIAcQAkEBdGoiCC0AACELIAVBQGsgCC0AARABIAIgCzoAASAGIAVBKGogBxACQQF0aiIILQAAIQsgBUEoaiAILQABEAEgBCALOgABIAYgBUEQaiAHEAJBAXRqIggtAAAhCyAFQRBqIAgtAAEQASADIAs6AAEgA0ECaiEDIARBAmohBCACQQJqIQIgAEECaiEAIAkgBUHYAGoQDUVxIAVBQGsQDUVxIAVBKGoQDUVxIAVBEGoQDUVxIQkMAQsLIAQgDUsgAiAMS3INAEFsIQkgACAKSw0BIApBfWohCQNAIAVB2ABqEAQgACAJT3JFBEAgBiAFQdgAaiAHEAJBAXRqIggtAAAhCyAFQdgAaiAILQABEAEgACALOgAAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAASAAQQJqIQAMAQsLA0AgBUHYAGoQBCAAIApPckUEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCwNAIAAgCkkEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCyAMQX1qIQADQCAFQUBrEAQgAiAAT3JFBEAgBiAFQUBrIAcQAkEBdGoiCi0AACEJIAVBQGsgCi0AARABIAIgCToAACAGIAVBQGsgBxACQQF0aiIKLQAAIQkgBUFAayAKLQABEAEgAiAJOgABIAJBAmohAgwBCwsDQCAFQUBrEAQgAiAMT3JFBEAgBiAFQUBrIAcQAkEBdGoiAC0AACEKIAVBQGsgAC0AARABIAIgCjoAACACQQFqIQIMAQsLA0AgAiAMSQRAIAYgBUFAayAHEAJBAXRqIgAtAAAhCiAFQUBrIAAtAAEQASACIAo6AAAgAkEBaiECDAELCyANQX1qIQADQCAFQShqEAQgBCAAT3JFBEAgBiAFQShqIAcQAkEBdGoiAi0AACEKIAVBKGogAi0AARABIAQgCjoAACAGIAVBKGogBxACQQF0aiICLQAAIQogBUEoaiACLQABEAEgBCAKOgABIARBAmohBAwBCwsDQCAFQShqEAQgBCANT3JFBEAgBiAFQShqIAcQAkEBdGoiAC0AACECIAVBKGogAC0AARABIAQgAjoAACAEQQFqIQQMAQsLA0AgBCANSQRAIAYgBUEoaiAHEAJBAXRqIgAtAAAhAiAFQShqIAAtAAEQASAEIAI6AAAgBEEBaiEEDAELCwNAIAVBEGoQBCADIA9PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIAYgBUEQaiAHEAJBAXRqIgAtAAAhAiAFQRBqIAAtAAEQASADIAI6AAEgA0ECaiEDDAELCwNAIAVBEGoQBCADIA5PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIANBAWohAwwBCwsDQCADIA5JBEAgBiAFQRBqIAcQAkEBdGoiAC0AACECIAVBEGogAC0AARABIAMgAjoAACADQQFqIQMMAQsLIAFBbCAFQdgAahAKIAVBQGsQCnEgBUEoahAKcSAFQRBqEApxGyEJDAELQWwhCQsgBUHwAGokACAJC8oCAQR/IwBBIGsiBSQAIAUgBBAOIAUtAAIhByAFQQhqIAIgAxAGIgIQA0UEQCAEQQRqIQIgACABaiIDQX1qIQQDQCAFQQhqEAQgACAET3JFBEAgAiAFQQhqIAcQAkEBdGoiBi0AACEIIAVBCGogBi0AARABIAAgCDoAACACIAVBCGogBxACQQF0aiIGLQAAIQggBUEIaiAGLQABEAEgACAIOgABIABBAmohAAwBCwsDQCAFQQhqEAQgACADT3JFBEAgAiAFQQhqIAcQAkEBdGoiBC0AACEGIAVBCGogBC0AARABIAAgBjoAACAAQQFqIQAMAQsLA0AgACADT0UEQCACIAVBCGogBxACQQF0aiIELQAAIQYgBUEIaiAELQABEAEgACAGOgAAIABBAWohAAwBCwsgAUFsIAVBCGoQChshAgsgBUEgaiQAIAILtgMBCX8jAEEQayIGJAAgBkEANgIMIAZBADYCCEFUIQQCQAJAIANBQGsiDCADIAZBCGogBkEMaiABIAIQMSICEAMNACAGQQRqIAAQDiAGKAIMIgcgBi0ABEEBaksNASAAQQRqIQogBkEAOgAFIAYgBzoABiAAIAYoAgQ2AgAgB0EBaiEJQQEhBANAIAQgCUkEQCADIARBAnRqIgEoAgAhACABIAU2AgAgACAEQX9qdCAFaiEFIARBAWohBAwBCwsgB0EBaiEHQQAhBSAGKAIIIQkDQCAFIAlGDQEgAyAFIAxqLQAAIgRBAnRqIgBBASAEdEEBdSILIAAoAgAiAWoiADYCACAHIARrIQhBACEEAkAgC0EDTQRAA0AgBCALRg0CIAogASAEakEBdGoiACAIOgABIAAgBToAACAEQQFqIQQMAAALAAsDQCABIABPDQEgCiABQQF0aiIEIAg6AAEgBCAFOgAAIAQgCDoAAyAEIAU6AAIgBCAIOgAFIAQgBToABCAEIAg6AAcgBCAFOgAGIAFBBGohAQwAAAsACyAFQQFqIQUMAAALAAsgAiEECyAGQRBqJAAgBAutAQECfwJAQYQgKAIAIABHIAAoAgBBAXYiAyABa0F4aiICQXhxQQhHcgR/IAIFIAMQJ0UNASACQQhqC0EQSQ0AIAAgACgCACICQQFxIAAgAWpBD2pBeHEiASAAa0EBdHI2AgAgASAANgIEIAEgASgCAEEBcSAAIAJBAXZqIAFrIgJBAXRyNgIAQYQgIAEgAkH/////B3FqQQRqQYQgKAIAIABGGyABNgIAIAEQJQsLygIBBX8CQAJAAkAgAEEIIABBCEsbZ0EfcyAAaUEBR2oiAUEESSAAIAF2cg0AIAFBAnRB/B5qKAIAIgJFDQADQCACQXhqIgMoAgBBAXZBeGoiBSAATwRAIAIgBUEIIAVBCEsbZ0Efc0ECdEGAH2oiASgCAEYEQCABIAIoAgQ2AgALDAMLIARBHksNASAEQQFqIQQgAigCBCICDQALC0EAIQMgAUEgTw0BA0AgAUECdEGAH2ooAgAiAkUEQCABQR5LIQIgAUEBaiEBIAJFDQEMAwsLIAIgAkF4aiIDKAIAQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgBGBEAgASACKAIENgIACwsgAigCACIBBEAgASACKAIENgIECyACKAIEIgEEQCABIAIoAgA2AgALIAMgAygCAEEBcjYCACADIAAQNwsgAwvhCwINfwV+IwBB8ABrIgckACAHIAAoAvDhASIINgJcIAEgAmohDSAIIAAoAoDiAWohDwJAAkAgBUUEQCABIQQMAQsgACgCxOABIRAgACgCwOABIREgACgCvOABIQ4gAEEBNgKM4QFBACEIA0AgCEEDRwRAIAcgCEECdCICaiAAIAJqQazQAWooAgA2AkQgCEEBaiEIDAELC0FsIQwgB0EYaiADIAQQBhADDQEgB0EsaiAHQRhqIAAoAgAQEyAHQTRqIAdBGGogACgCCBATIAdBPGogB0EYaiAAKAIEEBMgDUFgaiESIAEhBEEAIQwDQCAHKAIwIAcoAixBA3RqKQIAIhRCEIinQf8BcSEIIAcoAkAgBygCPEEDdGopAgAiFUIQiKdB/wFxIQsgBygCOCAHKAI0QQN0aikCACIWQiCIpyEJIBVCIIghFyAUQiCIpyECAkAgFkIQiKdB/wFxIgNBAk8EQAJAIAZFIANBGUlyRQRAIAkgB0EYaiADQSAgBygCHGsiCiAKIANLGyIKEAUgAyAKayIDdGohCSAHQRhqEAQaIANFDQEgB0EYaiADEAUgCWohCQwBCyAHQRhqIAMQBSAJaiEJIAdBGGoQBBoLIAcpAkQhGCAHIAk2AkQgByAYNwNIDAELAkAgA0UEQCACBEAgBygCRCEJDAMLIAcoAkghCQwBCwJAAkAgB0EYakEBEAUgCSACRWpqIgNBA0YEQCAHKAJEQX9qIgMgA0VqIQkMAQsgA0ECdCAHaigCRCIJIAlFaiEJIANBAUYNAQsgByAHKAJINgJMCwsgByAHKAJENgJIIAcgCTYCRAsgF6chAyALBEAgB0EYaiALEAUgA2ohAwsgCCALakEUTwRAIAdBGGoQBBoLIAgEQCAHQRhqIAgQBSACaiECCyAHQRhqEAQaIAcgB0EYaiAUQhiIp0H/AXEQCCAUp0H//wNxajYCLCAHIAdBGGogFUIYiKdB/wFxEAggFadB//8DcWo2AjwgB0EYahAEGiAHIAdBGGogFkIYiKdB/wFxEAggFqdB//8DcWo2AjQgByACNgJgIAcoAlwhCiAHIAk2AmggByADNgJkAkACQAJAIAQgAiADaiILaiASSw0AIAIgCmoiEyAPSw0AIA0gBGsgC0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgAhDSAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogB0EoaiAfQhiIp0H/AXEQCCEOIAdB8ABqIARBBHRqIgsgCSANaiAIazYCDCALIAg2AgggCyADNgIEIAsgAjYCACAHIA4gH6dB//8DcWo2AkQgBEEBaiEEDAELCyAEIBdIDQEgEkFgaiEYIAdB4ABqIRogB0HkAGohGyABIQMDQCAHQShqEARBAksgBCAFTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEIIAcoAkggBygCREEDdGopAgAiH0IgiKchCSAeQiCIISAgHUIgiKchDAJAIB9CEIinQf8BcSICQQJPBEACQCAGRSACQRlJckUEQCAJIAdBKGogAkEgIAcoAixrIgogCiACSxsiChAFIAIgCmsiAnRqIQkgB0EoahAEGiACRQ0BIAdBKGogAhAFIAlqIQkMAQsgB0EoaiACEAUgCWohCSAHQShqEAQaCyAHKQJUISEgByAJNgJUIAcgITcDWAwBCwJAIAJFBEAgDARAIAcoAlQhCQwDCyAHKAJYIQkMAQsCQAJAIAdBKGpBARAFIAkgDEVqaiICQQNGBEAgBygCVEF/aiICIAJFaiEJDAELIAJBAnQgB2ooAlQiCSAJRWohCSACQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAk2AlQLICCnIRQgCARAIAdBKGogCBAFIBRqIRQLIAggC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgDGohDAsgB0EoahAEGiAHIAcoAmggDGoiGSAUajYCaCAbIBogCSAZSxsoAgAhHCAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogByAHQShqIB9CGIinQf8BcRAIIB+nQf//A3FqNgJEIAcgB0HwAGogBEEDcUEEdGoiDSkDCCIdNwPIASAHIA0pAwAiHjcDwAECQAJAAkAgBygCvAEiDiAepyICaiIWIBNLDQAgAyAHKALEASIKIAJqIgtqIBhLDQAgEiADayALQSBqTw0BCyAHIAcpA8gBNwMQIAcgBykDwAE3AwggAyASIAdBCGogB0G8AWogEyAPIBUgERAeIQsMAQsgAiADaiEIIAMgDhAHIAJBEU8EQCADQRBqIQIDQCACIA5BEGoiDhAHIAJBEGoiAiAISQ0ACwsgCCAdpyIOayECIAcgFjYCvAEgDiAIIA9rSwRAIA4gCCAVa0sEQEFsIQsMAgsgESACIA9rIgJqIhYgCmogEU0EQCAIIBYgChAPGgwCCyAIIBZBACACaxAPIQggByACIApqIgo2AsQBIAggAmshCCAPIQILIA5BEE8EQCAIIApqIQoDQCAIIAIQByACQRBqIQIgCEEQaiIIIApJDQALDAELAkAgDkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgDkECdCIKQcAeaigCAGoiAhAXIAIgCkHgHmooAgBrIQIgBygCxAEhCgwBCyAIIAIQDAsgCkEJSQ0AIAggCmohCiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAKSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAKSQ0ACwsgCxADBEAgCyEQDAQFIA0gDDYCACANIBkgHGogCWs2AgwgDSAJNgIIIA0gFDYCBCAEQQFqIQQgAyALaiEDDAILAAsLIAQgBUgNASAEIBdrIQtBACEEA0AgCyAFSARAIAcgB0HwAGogC0EDcUEEdGoiAikDCCIdNwPIASAHIAIpAwAiHjcDwAECQAJAAkAgBygCvAEiDCAepyICaiIKIBNLDQAgAyAHKALEASIJIAJqIhBqIBhLDQAgEiADayAQQSBqTw0BCyAHIAcpA8gBNwMgIAcgBykDwAE3AxggAyASIAdBGGogB0G8AWogEyAPIBUgERAeIRAMAQsgAiADaiEIIAMgDBAHIAJBEU8EQCADQRBqIQIDQCACIAxBEGoiDBAHIAJBEGoiAiAISQ0ACwsgCCAdpyIGayECIAcgCjYCvAEgBiAIIA9rSwRAIAYgCCAVa0sEQEFsIRAMAgsgESACIA9rIgJqIgwgCWogEU0EQCAIIAwgCRAPGgwCCyAIIAxBACACaxAPIQggByACIAlqIgk2AsQBIAggAmshCCAPIQILIAZBEE8EQCAIIAlqIQYDQCAIIAIQByACQRBqIQIgCEEQaiIIIAZJDQALDAELAkAgBkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgBkECdCIGQcAeaigCAGoiAhAXIAIgBkHgHmooAgBrIQIgBygCxAEhCQwBCyAIIAIQDAsgCUEJSQ0AIAggCWohBiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAGSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAGSQ0ACwsgEBADDQMgC0EBaiELIAMgEGohAwwBCwsDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIgUQAw0AIAMoAnwiBkEfSw0AIAMoAngiB0EJTw0AIABBiCBqIAMgBkGAC0GADCAHEBggA0E0NgJ8IAMgA0H8AGogA0H4AGogBCAFaiIEIAIgBGsQFSIFEAMNACADKAJ8IgZBNEsNACADKAJ4IgdBCk8NACAAQZAwaiADIAZBgA1B4A4gBxAYIANBIzYCfCADIANB/ABqIANB+ABqIAQgBWoiBCACIARrEBUiBRADDQAgAygCfCIGQSNLDQAgAygCeCIHQQpPDQAgACADIAZBwBBB0BEgBxAYIAQgBWoiBEEMaiIFIAJLDQAgAiAFayEFQQAhAgNAIAJBA0cEQCAEKAAAIgZBf2ogBU8NAiAAIAJBAnRqQZzQAWogBjYCACACQQFqIQIgBEEEaiEEDAELCyAEIAFrIQgLIANBgAFqJAAgCAtGAQN/IABBCGohAyAAKAIEIQJBACEAA0AgACACdkUEQCABIAMgAEEDdGotAAJBFktqIQEgAEEBaiEADAELCyABQQggAmt0C4YDAQV/Qbh/IQcCQCADRQ0AIAItAAAiBEUEQCABQQA2AgBBAUG4fyADQQFGGw8LAn8gAkEBaiIFIARBGHRBGHUiBkF/Sg0AGiAGQX9GBEAgA0EDSA0CIAUvAABBgP4BaiEEIAJBA2oMAQsgA0ECSA0BIAItAAEgBEEIdHJBgIB+aiEEIAJBAmoLIQUgASAENgIAIAVBAWoiASACIANqIgNLDQBBbCEHIABBEGogACAFLQAAIgVBBnZBI0EJIAEgAyABa0HAEEHQEUHwEiAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBmCBqIABBCGogBUEEdkEDcUEfQQggASABIAZqIAgbIgEgAyABa0GAC0GADEGAFyAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBoDBqIABBBGogBUECdkEDcUE0QQkgASABIAZqIAgbIgEgAyABa0GADUHgDkGQGSAAKAKM4QEgACgCnOIBIAQQHyIAEAMNACAAIAFqIAJrIQcLIAcLrQMBCn8jAEGABGsiCCQAAn9BUiACQf8BSw0AGkFUIANBDEsNABogAkEBaiELIABBBGohCUGAgAQgA0F/anRBEHUhCkEAIQJBASEEQQEgA3QiB0F/aiIMIQUDQCACIAtGRQRAAkAgASACQQF0Ig1qLwEAIgZB//8DRgRAIAkgBUECdGogAjoAAiAFQX9qIQVBASEGDAELIARBACAKIAZBEHRBEHVKGyEECyAIIA1qIAY7AQAgAkEBaiECDAELCyAAIAQ7AQIgACADOwEAIAdBA3YgB0EBdmpBA2ohBkEAIQRBACECA0AgBCALRkUEQCABIARBAXRqLgEAIQpBACEAA0AgACAKTkUEQCAJIAJBAnRqIAQ6AAIDQCACIAZqIAxxIgIgBUsNAAsgAEEBaiEADAELCyAEQQFqIQQMAQsLQX8gAg0AGkEAIQIDfyACIAdGBH9BAAUgCCAJIAJBAnRqIgAtAAJBAXRqIgEgAS8BACIBQQFqOwEAIAAgAyABEBRrIgU6AAMgACABIAVB/wFxdCAHazsBACACQQFqIQIMAQsLCyEFIAhBgARqJAAgBQvjBgEIf0FsIQcCQCACQQNJDQACQAJAAkACQCABLQAAIgNBA3EiCUEBaw4DAwEAAgsgACgCiOEBDQBBYg8LIAJBBUkNAkEDIQYgASgAACEFAn8CQAJAIANBAnZBA3EiCEF+aiIEQQFNBEAgBEEBaw0BDAILIAVBDnZB/wdxIQQgBUEEdkH/B3EhAyAIRQwCCyAFQRJ2IQRBBCEGIAVBBHZB//8AcSEDQQAMAQsgBUEEdkH//w9xIgNBgIAISw0DIAEtAARBCnQgBUEWdnIhBEEFIQZBAAshBSAEIAZqIgogAksNAgJAIANBgQZJDQAgACgCnOIBRQ0AQQAhAgNAIAJBg4ABSw0BIAJBQGshAgwAAAsACwJ/IAlBA0YEQCABIAZqIQEgAEHw4gFqIQIgACgCDCEGIAUEQCACIAMgASAEIAYQXwwCCyACIAMgASAEIAYQXQwBCyAAQbjQAWohAiABIAZqIQEgAEHw4gFqIQYgAEGo0ABqIQggBQRAIAggBiADIAEgBCACEF4MAQsgCCAGIAMgASAEIAIQXAsQAw0CIAAgAzYCgOIBIABBATYCiOEBIAAgAEHw4gFqNgLw4QEgCUECRgRAIAAgAEGo0ABqNgIMCyAAIANqIgBBiOMBakIANwAAIABBgOMBakIANwAAIABB+OIBakIANwAAIABB8OIBakIANwAAIAoPCwJ/AkACQAJAIANBAnZBA3FBf2oiBEECSw0AIARBAWsOAgACAQtBASEEIANBA3YMAgtBAiEEIAEvAABBBHYMAQtBAyEEIAEQIUEEdgsiAyAEaiIFQSBqIAJLBEAgBSACSw0CIABB8OIBaiABIARqIAMQCyEBIAAgAzYCgOIBIAAgATYC8OEBIAEgA2oiAEIANwAYIABCADcAECAAQgA3AAggAEIANwAAIAUPCyAAIAM2AoDiASAAIAEgBGo2AvDhASAFDwsCfwJAAkACQCADQQJ2QQNxQX9qIgRBAksNACAEQQFrDgIAAgELQQEhByADQQN2DAILQQIhByABLwAAQQR2DAELIAJBBEkgARAhIgJBj4CAAUtyDQFBAyEHIAJBBHYLIQIgAEHw4gFqIAEgB2otAAAgAkEgahAQIQEgACACNgKA4gEgACABNgLw4QEgB0EBaiEHCyAHC0sAIABC+erQ0OfJoeThADcDICAAQgA3AxggAELP1tO+0ser2UI3AxAgAELW64Lu6v2J9eAANwMIIABCADcDACAAQShqQQBBKBAQGgviAgICfwV+IABBKGoiASAAKAJIaiECAn4gACkDACIDQiBaBEAgACkDECIEQgeJIAApAwgiBUIBiXwgACkDGCIGQgyJfCAAKQMgIgdCEol8IAUQGSAEEBkgBhAZIAcQGQwBCyAAKQMYQsXP2bLx5brqJ3wLIAN8IQMDQCABQQhqIgAgAk0EQEIAIAEpAAAQCSADhUIbiUKHla+vmLbem55/fkLj3MqV/M7y9YV/fCEDIAAhAQwBCwsCQCABQQRqIgAgAksEQCABIQAMAQsgASgAAK1Ch5Wvr5i23puef34gA4VCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMLA0AgACACSQRAIAAxAABCxc/ZsvHluuonfiADhUILiUKHla+vmLbem55/fiEDIABBAWohAAwBCwsgA0IhiCADhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC+8CAgJ/BH4gACAAKQMAIAKtfDcDAAJAAkAgACgCSCIDIAJqIgRBH00EQCABRQ0BIAAgA2pBKGogASACECAgACgCSCACaiEEDAELIAEgAmohAgJ/IAMEQCAAQShqIgQgA2ogAUEgIANrECAgACAAKQMIIAQpAAAQCTcDCCAAIAApAxAgACkAMBAJNwMQIAAgACkDGCAAKQA4EAk3AxggACAAKQMgIABBQGspAAAQCTcDICAAKAJIIQMgAEEANgJIIAEgA2tBIGohAQsgAUEgaiACTQsEQCACQWBqIQMgACkDICEFIAApAxghBiAAKQMQIQcgACkDCCEIA0AgCCABKQAAEAkhCCAHIAEpAAgQCSEHIAYgASkAEBAJIQYgBSABKQAYEAkhBSABQSBqIgEgA00NAAsgACAFNwMgIAAgBjcDGCAAIAc3AxAgACAINwMICyABIAJPDQEgAEEoaiABIAIgAWsiBBAgCyAAIAQ2AkgLCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQEBogAwVBun8LCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQCxogAwVBun8LC6gCAQZ/IwBBEGsiByQAIABB2OABaikDAEKAgIAQViEIQbh/IQUCQCAEQf//B0sNACAAIAMgBBBCIgUQAyIGDQAgACgCnOIBIQkgACAHQQxqIAMgAyAFaiAGGyIKIARBACAFIAYbayIGEEAiAxADBEAgAyEFDAELIAcoAgwhBCABRQRAQbp/IQUgBEEASg0BCyAGIANrIQUgAyAKaiEDAkAgCQRAIABBADYCnOIBDAELAkACQAJAIARBBUgNACAAQdjgAWopAwBCgICACFgNAAwBCyAAQQA2ApziAQwBCyAAKAIIED8hBiAAQQA2ApziASAGQRRPDQELIAAgASACIAMgBSAEIAgQOSEFDAELIAAgASACIAMgBSAEIAgQOiEFCyAHQRBqJAAgBQtnACAAQdDgAWogASACIAAoAuzhARAuIgEQAwRAIAEPC0G4fyECAkAgAQ0AIABB7OABaigCACIBBEBBYCECIAAoApjiASABRw0BC0EAIQIgAEHw4AFqKAIARQ0AIABBkOEBahBDCyACCycBAX8QVyIERQRAQUAPCyAEIAAgASACIAMgBBBLEE8hACAEEFYgAAs/AQF/AkACQAJAIAAoAqDiAUEBaiIBQQJLDQAgAUEBaw4CAAECCyAAEDBBAA8LIABBADYCoOIBCyAAKAKU4gELvAMCB38BfiMAQRBrIgkkAEG4fyEGAkAgBCgCACIIQQVBCSAAKALs4QEiBRtJDQAgAygCACIHQQFBBSAFGyAFEC8iBRADBEAgBSEGDAELIAggBUEDakkNACAAIAcgBRBJIgYQAw0AIAEgAmohCiAAQZDhAWohCyAIIAVrIQIgBSAHaiEHIAEhBQNAIAcgAiAJECwiBhADDQEgAkF9aiICIAZJBEBBuH8hBgwCCyAJKAIAIghBAksEQEFsIQYMAgsgB0EDaiEHAn8CQAJAAkAgCEEBaw4CAgABCyAAIAUgCiAFayAHIAYQSAwCCyAFIAogBWsgByAGEEcMAQsgBSAKIAVrIActAAAgCSgCCBBGCyIIEAMEQCAIIQYMAgsgACgC8OABBEAgCyAFIAgQRQsgAiAGayECIAYgB2ohByAFIAhqIQUgCSgCBEUNAAsgACkD0OABIgxCf1IEQEFsIQYgDCAFIAFrrFINAQsgACgC8OABBEBBaiEGIAJBBEkNASALEEQhDCAHKAAAIAynRw0BIAdBBGohByACQXxqIQILIAMgBzYCACAEIAI2AgAgBSABayEGCyAJQRBqJAAgBgsuACAAECsCf0EAQQAQAw0AGiABRSACRXJFBEBBYiAAIAEgAhA9EAMNARoLQQALCzcAIAEEQCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBSQAIAVBCGogAiADEAYiAhADRQRAIAAgAWoiB0F9aiEGIAUgBBAOIARBBGohAiAFLQACIQMDQEEAIAAgBkkgBUEIahAEGwRAIAAgAiAFQQhqIAMQAkECdGoiBC8BADsAACAFQQhqIAQtAAIQASAAIAQtAANqIgQgAiAFQQhqIAMQAkECdGoiAC8BADsAACAFQQhqIAAtAAIQASAEIAAtAANqIQAMAQUgB0F+aiEEA0AgBUEIahAEIAAgBEtyRQRAIAAgAiAFQQhqIAMQAkECdGoiBi8BADsAACAFQQhqIAYtAAIQASAAIAYtAANqIQAMAQsLA0AgACAES0UEQCAAIAIgBUEIaiADEAJBAnRqIgYvAQA7AAAgBUEIaiAGLQACEAEgACAGLQADaiEADAELCwJAIAAgB08NACAAIAIgBUEIaiADEAIiA0ECdGoiAC0AADoAACAALQADQQFGBEAgBUEIaiAALQACEAEMAQsgBSgCDEEfSw0AIAVBCGogAiADQQJ0ai0AAhABIAUoAgxBIUkNACAFQSA2AgwLIAFBbCAFQQhqEAobIQILCwsgBUEgaiQAIAILkgIBBH8jAEFAaiIJJAAgCSADQTQQCyEDAkAgBEECSA0AIAMgBEECdGooAgAhCSADQTxqIAgQIyADQQE6AD8gAyACOgA+QQAhBCADKAI8IQoDQCAEIAlGDQEgACAEQQJ0aiAKNgEAIARBAWohBAwAAAsAC0EAIQkDQCAGIAlGRQRAIAMgBSAJQQF0aiIKLQABIgtBAnRqIgwoAgAhBCADQTxqIAotAABBCHQgCGpB//8DcRAjIANBAjoAPyADIAcgC2siCiACajoAPiAEQQEgASAKa3RqIQogAygCPCELA0AgACAEQQJ0aiALNgEAIARBAWoiBCAKSQ0ACyAMIAo2AgAgCUEBaiEJDAELCyADQUBrJAALowIBCX8jAEHQAGsiCSQAIAlBEGogBUE0EAsaIAcgBmshDyAHIAFrIRADQAJAIAMgCkcEQEEBIAEgByACIApBAXRqIgYtAAEiDGsiCGsiC3QhDSAGLQAAIQ4gCUEQaiAMQQJ0aiIMKAIAIQYgCyAPTwRAIAAgBkECdGogCyAIIAUgCEE0bGogCCAQaiIIQQEgCEEBShsiCCACIAQgCEECdGooAgAiCEEBdGogAyAIayAHIA4QYyAGIA1qIQgMAgsgCUEMaiAOECMgCUEBOgAPIAkgCDoADiAGIA1qIQggCSgCDCELA0AgBiAITw0CIAAgBkECdGogCzYBACAGQQFqIQYMAAALAAsgCUHQAGokAA8LIAwgCDYCACAKQQFqIQoMAAALAAs0ACAAIAMgBCAFEDYiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQNAVBuH8LCyMAIAA/AEEQdGtB//8DakEQdkAAQX9GBEBBAA8LQQAQAEEBCzsBAX8gAgRAA0AgACABIAJBgCAgAkGAIEkbIgMQCyEAIAFBgCBqIQEgAEGAIGohACACIANrIgINAAsLCwYAIAAQAwsLqBUJAEGICAsNAQAAAAEAAAACAAAAAgBBoAgLswYBAAAAAQAAAAIAAAACAAAAJgAAAIIAAAAhBQAASgAAAGcIAAAmAAAAwAEAAIAAAABJBQAASgAAAL4IAAApAAAALAIAAIAAAABJBQAASgAAAL4IAAAvAAAAygIAAIAAAACKBQAASgAAAIQJAAA1AAAAcwMAAIAAAACdBQAASgAAAKAJAAA9AAAAgQMAAIAAAADrBQAASwAAAD4KAABEAAAAngMAAIAAAABNBgAASwAAAKoKAABLAAAAswMAAIAAAADBBgAATQAAAB8NAABNAAAAUwQAAIAAAAAjCAAAUQAAAKYPAABUAAAAmQQAAIAAAABLCQAAVwAAALESAABYAAAA2gQAAIAAAABvCQAAXQAAACMUAABUAAAARQUAAIAAAABUCgAAagAAAIwUAABqAAAArwUAAIAAAAB2CQAAfAAAAE4QAAB8AAAA0gIAAIAAAABjBwAAkQAAAJAHAACSAAAAAAAAAAEAAAABAAAABQAAAA0AAAAdAAAAPQAAAH0AAAD9AAAA/QEAAP0DAAD9BwAA/Q8AAP0fAAD9PwAA/X8AAP3/AAD9/wEA/f8DAP3/BwD9/w8A/f8fAP3/PwD9/38A/f//AP3//wH9//8D/f//B/3//w/9//8f/f//P/3//38AAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACUAAAAnAAAAKQAAACsAAAAvAAAAMwAAADsAAABDAAAAUwAAAGMAAACDAAAAAwEAAAMCAAADBAAAAwgAAAMQAAADIAAAA0AAAAOAAAADAAEAQeAPC1EBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAQcQQC4sBAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABIAAAAUAAAAFgAAABgAAAAcAAAAIAAAACgAAAAwAAAAQAAAAIAAAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAQAAAAIAAAAAAAQBBkBIL5gQBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAAAEAAAAEAAAACAAAAAAAAAABAAEBBgAAAAAAAAQAAAAAEAAABAAAAAAgAAAFAQAAAAAAAAUDAAAAAAAABQQAAAAAAAAFBgAAAAAAAAUHAAAAAAAABQkAAAAAAAAFCgAAAAAAAAUMAAAAAAAABg4AAAAAAAEFEAAAAAAAAQUUAAAAAAABBRYAAAAAAAIFHAAAAAAAAwUgAAAAAAAEBTAAAAAgAAYFQAAAAAAABwWAAAAAAAAIBgABAAAAAAoGAAQAAAAADAYAEAAAIAAABAAAAAAAAAAEAQAAAAAAAAUCAAAAIAAABQQAAAAAAAAFBQAAACAAAAUHAAAAAAAABQgAAAAgAAAFCgAAAAAAAAULAAAAAAAABg0AAAAgAAEFEAAAAAAAAQUSAAAAIAABBRYAAAAAAAIFGAAAACAAAwUgAAAAAAADBSgAAAAAAAYEQAAAABAABgRAAAAAIAAHBYAAAAAAAAkGAAIAAAAACwYACAAAMAAABAAAAAAQAAAEAQAAACAAAAUCAAAAIAAABQMAAAAgAAAFBQAAACAAAAUGAAAAIAAABQgAAAAgAAAFCQAAACAAAAULAAAAIAAABQwAAAAAAAAGDwAAACAAAQUSAAAAIAABBRQAAAAgAAIFGAAAACAAAgUcAAAAIAADBSgAAAAgAAQFMAAAAAAAEAYAAAEAAAAPBgCAAAAAAA4GAEAAAAAADQYAIABBgBcLhwIBAAEBBQAAAAAAAAUAAAAAAAAGBD0AAAAAAAkF/QEAAAAADwX9fwAAAAAVBf3/HwAAAAMFBQAAAAAABwR9AAAAAAAMBf0PAAAAABIF/f8DAAAAFwX9/38AAAAFBR0AAAAAAAgE/QAAAAAADgX9PwAAAAAUBf3/DwAAAAIFAQAAABAABwR9AAAAAAALBf0HAAAAABEF/f8BAAAAFgX9/z8AAAAEBQ0AAAAQAAgE/QAAAAAADQX9HwAAAAATBf3/BwAAAAEFAQAAABAABgQ9AAAAAAAKBf0DAAAAABAF/f8AAAAAHAX9//8PAAAbBf3//wcAABoF/f//AwAAGQX9//8BAAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",Ig=new WeakMap;let Cg=0,Mg;class Ji extends la{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new hN,this.workerSourceURL="",this.workerConfig=null,typeof MSC_TRANSCODER<"u"&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}async detectSupportAsync(e){return this.workerConfig={astcSupported:await e.hasFeatureAsync("texture-compression-astc"),etc1Supported:await e.hasFeatureAsync("texture-compression-etc1"),etc2Supported:await e.hasFeatureAsync("texture-compression-etc2"),dxtSupported:await e.hasFeatureAsync("texture-compression-bc"),bptcSupported:await e.hasFeatureAsync("texture-compression-bptc"),pvrtcSupported:await e.hasFeatureAsync("texture-compression-pvrtc")},this}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-bc"),bptcSupported:e.hasFeature("texture-compression-bptc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:(this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},this.workerConfig.etc1Supported=!1),this}init(){if(!this.transcoderPending){const e=new Rl(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),n=new Rl(this.manager);n.setPath(this.transcoderPath),n.setResponseType("arraybuffer"),n.setWithCredentials(this.withCredentials);const i=n.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,i]).then(([s,o])=>{const c=Ji.BasisWorker.toString(),h=["/* constants */","let _EngineFormat = "+JSON.stringify(Ji.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(Ji.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(Ji.BasisFormat),"/* basis_transcoder.js */",s,"/* worker */",c.substring(c.indexOf("{")+1,c.lastIndexOf("}"))].join(`
3828
+ }`;class NL{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const i=new Sr,s=e.properties.get(i);s.__webglTexture=t.texture,(t.depthNear!=n.depthNear||t.depthFar!=n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}render(e,t){if(this.texture!==null){if(this.mesh===null){const n=t.cameras[0].viewport,i=new vn({vertexShader:DL,fragmentShader:LL,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new Wr(new du(20,20),i)}e.render(this.mesh,t)}}reset(){this.texture=null,this.mesh=null}}class UL extends io{constructor(e,t){super();const n=this;let i=null,s=1,o=null,c="local-floor",h=1,u=null,d=null,A=null,p=null,g=null,v=null;const E=new NL,m=t.getContextAttributes();let _=null,w=null;const x=[],I=[],R=new Ge;let S=null;const T=new cn;T.layers.enable(1),T.viewport=new Ft;const D=new cn;D.layers.enable(2),D.viewport=new Ft;const b=[T,D],M=new bL;M.layers.enable(1),M.layers.enable(2);let L=null,P=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(H){let fe=x[H];return fe===void 0&&(fe=new eg,x[H]=fe),fe.getTargetRaySpace()},this.getControllerGrip=function(H){let fe=x[H];return fe===void 0&&(fe=new eg,x[H]=fe),fe.getGripSpace()},this.getHand=function(H){let fe=x[H];return fe===void 0&&(fe=new eg,x[H]=fe),fe.getHandSpace()};function N(H){const fe=I.indexOf(H.inputSource);if(fe===-1)return;const Ae=x[fe];Ae!==void 0&&(Ae.update(H.inputSource,H.frame,u||o),Ae.dispatchEvent({type:H.type,data:H.inputSource}))}function j(){i.removeEventListener("select",N),i.removeEventListener("selectstart",N),i.removeEventListener("selectend",N),i.removeEventListener("squeeze",N),i.removeEventListener("squeezestart",N),i.removeEventListener("squeezeend",N),i.removeEventListener("end",j),i.removeEventListener("inputsourceschange",X);for(let H=0;H<x.length;H++){const fe=I[H];fe!==null&&(I[H]=null,x[H].disconnect(fe))}L=null,P=null,E.reset(),e.setRenderTarget(_),g=null,p=null,A=null,i=null,w=null,re.stop(),n.isPresenting=!1,e.setPixelRatio(S),e.setSize(R.width,R.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(H){s=H,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(H){c=H,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||o},this.setReferenceSpace=function(H){u=H},this.getBaseLayer=function(){return p!==null?p:g},this.getBinding=function(){return A},this.getFrame=function(){return v},this.getSession=function(){return i},this.setSession=async function(H){if(i=H,i!==null){if(_=e.getRenderTarget(),i.addEventListener("select",N),i.addEventListener("selectstart",N),i.addEventListener("selectend",N),i.addEventListener("squeeze",N),i.addEventListener("squeezestart",N),i.addEventListener("squeezeend",N),i.addEventListener("end",j),i.addEventListener("inputsourceschange",X),m.xrCompatible!==!0&&await t.makeXRCompatible(),S=e.getPixelRatio(),e.getSize(R),i.renderState.layers===void 0){const fe={antialias:m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:s};g=new XRWebGLLayer(i,t,fe),i.updateRenderState({baseLayer:g}),e.setPixelRatio(1),e.setSize(g.framebufferWidth,g.framebufferHeight,!1),w=new Mi(g.framebufferWidth,g.framebufferHeight,{format:Ar,type:pr,colorSpace:e.outputColorSpace,stencilBuffer:m.stencil})}else{let fe=null,Ae=null,ve=null;m.depth&&(ve=m.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,fe=m.stencil?$c:rl,Ae=m.stencil?Zc:wi);const ye={colorFormat:t.RGBA8,depthFormat:ve,scaleFactor:s};A=new XRWebGLBinding(i,t),p=A.createProjectionLayer(ye),i.updateRenderState({layers:[p]}),e.setPixelRatio(1),e.setSize(p.textureWidth,p.textureHeight,!1),w=new Mi(p.textureWidth,p.textureHeight,{format:Ar,type:pr,depthTexture:new s2(p.textureWidth,p.textureHeight,Ae,void 0,void 0,void 0,void 0,void 0,void 0,fe),stencilBuffer:m.stencil,colorSpace:e.outputColorSpace,samples:m.antialias?4:0});const Oe=e.properties.get(w);Oe.__ignoreDepthValues=p.ignoreDepthValues}w.isXRRenderTarget=!0,this.setFoveation(h),u=null,o=await i.requestReferenceSpace(c),re.setContext(i),re.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode};function X(H){for(let fe=0;fe<H.removed.length;fe++){const Ae=H.removed[fe],ve=I.indexOf(Ae);ve>=0&&(I[ve]=null,x[ve].disconnect(Ae))}for(let fe=0;fe<H.added.length;fe++){const Ae=H.added[fe];let ve=I.indexOf(Ae);if(ve===-1){for(let Oe=0;Oe<x.length;Oe++)if(Oe>=I.length){I.push(Ae),ve=Oe;break}else if(I[Oe]===null){I[Oe]=Ae,ve=Oe;break}if(ve===-1)break}const ye=x[ve];ye&&ye.connect(Ae)}}const K=new W,ne=new W;function V(H,fe,Ae){K.setFromMatrixPosition(fe.matrixWorld),ne.setFromMatrixPosition(Ae.matrixWorld);const ve=K.distanceTo(ne),ye=fe.projectionMatrix.elements,Oe=Ae.projectionMatrix.elements,it=ye[14]/(ye[10]-1),ae=ye[14]/(ye[10]+1),rt=(ye[9]+1)/ye[5],Pe=(ye[9]-1)/ye[5],lt=(ye[8]-1)/ye[0],Ye=(Oe[8]+1)/Oe[0],ct=it*lt,Y=it*Ye,k=ve/(-lt+Ye),ee=k*-lt;fe.matrixWorld.decompose(H.position,H.quaternion,H.scale),H.translateX(ee),H.translateZ(k),H.matrixWorld.compose(H.position,H.quaternion,H.scale),H.matrixWorldInverse.copy(H.matrixWorld).invert();const ue=it+k,pe=ae+k,ge=ct-ee,Ue=Y+(ve-ee),Ee=rt*ae/pe*ue,Qe=Pe*ae/pe*ue;H.projectionMatrix.makePerspective(ge,Ue,Ee,Qe,ue,pe),H.projectionMatrixInverse.copy(H.projectionMatrix).invert()}function te(H,fe){fe===null?H.matrixWorld.copy(H.matrix):H.matrixWorld.multiplyMatrices(fe.matrixWorld,H.matrix),H.matrixWorldInverse.copy(H.matrixWorld).invert()}this.updateCamera=function(H){if(i===null)return;E.texture!==null&&(H.near=E.depthNear,H.far=E.depthFar),M.near=D.near=T.near=H.near,M.far=D.far=T.far=H.far,(L!==M.near||P!==M.far)&&(i.updateRenderState({depthNear:M.near,depthFar:M.far}),L=M.near,P=M.far,T.near=L,T.far=P,D.near=L,D.far=P,T.updateProjectionMatrix(),D.updateProjectionMatrix(),H.updateProjectionMatrix());const fe=H.parent,Ae=M.cameras;te(M,fe);for(let ve=0;ve<Ae.length;ve++)te(Ae[ve],fe);Ae.length===2?V(M,T,D):M.projectionMatrix.copy(T.projectionMatrix),Q(H,M,fe)};function Q(H,fe,Ae){Ae===null?H.matrix.copy(fe.matrixWorld):(H.matrix.copy(Ae.matrixWorld),H.matrix.invert(),H.matrix.multiply(fe.matrixWorld)),H.matrix.decompose(H.position,H.quaternion,H.scale),H.updateMatrixWorld(!0),H.projectionMatrix.copy(fe.projectionMatrix),H.projectionMatrixInverse.copy(fe.projectionMatrixInverse),H.isPerspectiveCamera&&(H.fov=sl*2*Math.atan(1/H.projectionMatrix.elements[5]),H.zoom=1)}this.getCamera=function(){return M},this.getFoveation=function(){if(!(p===null&&g===null))return h},this.setFoveation=function(H){h=H,p!==null&&(p.fixedFoveation=H),g!==null&&g.fixedFoveation!==void 0&&(g.fixedFoveation=H)},this.hasDepthSensing=function(){return E.texture!==null};let z=null;function Z(H,fe){if(d=fe.getViewerPose(u||o),v=fe,d!==null){const Ae=d.views;g!==null&&(e.setRenderTargetFramebuffer(w,g.framebuffer),e.setRenderTarget(w));let ve=!1;Ae.length!==M.cameras.length&&(M.cameras.length=0,ve=!0);for(let Oe=0;Oe<Ae.length;Oe++){const it=Ae[Oe];let ae=null;if(g!==null)ae=g.getViewport(it);else{const Pe=A.getViewSubImage(p,it);ae=Pe.viewport,Oe===0&&(e.setRenderTargetTextures(w,Pe.colorTexture,p.ignoreDepthValues?void 0:Pe.depthStencilTexture),e.setRenderTarget(w))}let rt=b[Oe];rt===void 0&&(rt=new cn,rt.layers.enable(Oe),rt.viewport=new Ft,b[Oe]=rt),rt.matrix.fromArray(it.transform.matrix),rt.matrix.decompose(rt.position,rt.quaternion,rt.scale),rt.projectionMatrix.fromArray(it.projectionMatrix),rt.projectionMatrixInverse.copy(rt.projectionMatrix).invert(),rt.viewport.set(ae.x,ae.y,ae.width,ae.height),Oe===0&&(M.matrix.copy(rt.matrix),M.matrix.decompose(M.position,M.quaternion,M.scale)),ve===!0&&M.cameras.push(rt)}const ye=i.enabledFeatures;if(ye&&ye.includes("depth-sensing")){const Oe=A.getDepthInformation(Ae[0]);Oe&&Oe.isValid&&Oe.texture&&E.init(e,Oe,i.renderState)}}for(let Ae=0;Ae<x.length;Ae++){const ve=I[Ae],ye=x[Ae];ve!==null&&ye!==void 0&&ye.update(ve,fe,u||o)}E.render(e,M),z&&z(H,fe),fe.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:fe}),v=null}const re=new JE;re.setAnimationLoop(Z),this.setAnimationLoop=function(H){z=H},this.dispose=function(){}}}const fo=new Wi,PL=new tt;function kL(r,e){function t(m,_){m.matrixAutoUpdate===!0&&m.updateMatrix(),_.value.copy(m.matrix)}function n(m,_){_.color.getRGB(m.fogColor.value,WE(r)),_.isFog?(m.fogNear.value=_.near,m.fogFar.value=_.far):_.isFogExp2&&(m.fogDensity.value=_.density)}function i(m,_,w,x,I){_.isMeshBasicMaterial||_.isMeshLambertMaterial?s(m,_):_.isMeshToonMaterial?(s(m,_),A(m,_)):_.isMeshPhongMaterial?(s(m,_),d(m,_)):_.isMeshStandardMaterial?(s(m,_),p(m,_),_.isMeshPhysicalMaterial&&g(m,_,I)):_.isMeshMatcapMaterial?(s(m,_),v(m,_)):_.isMeshDepthMaterial?s(m,_):_.isMeshDistanceMaterial?(s(m,_),E(m,_)):_.isMeshNormalMaterial?s(m,_):_.isLineBasicMaterial?(o(m,_),_.isLineDashedMaterial&&c(m,_)):_.isPointsMaterial?h(m,_,w,x):_.isSpriteMaterial?u(m,_):_.isShadowMaterial?(m.color.value.copy(_.color),m.opacity.value=_.opacity):_.isShaderMaterial&&(_.uniformsNeedUpdate=!1)}function s(m,_){m.opacity.value=_.opacity,_.color&&m.diffuse.value.copy(_.color),_.emissive&&m.emissive.value.copy(_.emissive).multiplyScalar(_.emissiveIntensity),_.map&&(m.map.value=_.map,t(_.map,m.mapTransform)),_.alphaMap&&(m.alphaMap.value=_.alphaMap,t(_.alphaMap,m.alphaMapTransform)),_.bumpMap&&(m.bumpMap.value=_.bumpMap,t(_.bumpMap,m.bumpMapTransform),m.bumpScale.value=_.bumpScale,_.side===Pr&&(m.bumpScale.value*=-1)),_.normalMap&&(m.normalMap.value=_.normalMap,t(_.normalMap,m.normalMapTransform),m.normalScale.value.copy(_.normalScale),_.side===Pr&&m.normalScale.value.negate()),_.displacementMap&&(m.displacementMap.value=_.displacementMap,t(_.displacementMap,m.displacementMapTransform),m.displacementScale.value=_.displacementScale,m.displacementBias.value=_.displacementBias),_.emissiveMap&&(m.emissiveMap.value=_.emissiveMap,t(_.emissiveMap,m.emissiveMapTransform)),_.specularMap&&(m.specularMap.value=_.specularMap,t(_.specularMap,m.specularMapTransform)),_.alphaTest>0&&(m.alphaTest.value=_.alphaTest);const w=e.get(_),x=w.envMap,I=w.envMapRotation;if(x&&(m.envMap.value=x,fo.copy(I),fo.x*=-1,fo.y*=-1,fo.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(fo.y*=-1,fo.z*=-1),m.envMapRotation.value.setFromMatrix4(PL.makeRotationFromEuler(fo)),m.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=_.reflectivity,m.ior.value=_.ior,m.refractionRatio.value=_.refractionRatio),_.lightMap){m.lightMap.value=_.lightMap;const R=r._useLegacyLights===!0?Math.PI:1;m.lightMapIntensity.value=_.lightMapIntensity*R,t(_.lightMap,m.lightMapTransform)}_.aoMap&&(m.aoMap.value=_.aoMap,m.aoMapIntensity.value=_.aoMapIntensity,t(_.aoMap,m.aoMapTransform))}function o(m,_){m.diffuse.value.copy(_.color),m.opacity.value=_.opacity,_.map&&(m.map.value=_.map,t(_.map,m.mapTransform))}function c(m,_){m.dashSize.value=_.dashSize,m.totalSize.value=_.dashSize+_.gapSize,m.scale.value=_.scale}function h(m,_,w,x){m.diffuse.value.copy(_.color),m.opacity.value=_.opacity,m.size.value=_.size*w,m.scale.value=x*.5,_.map&&(m.map.value=_.map,t(_.map,m.uvTransform)),_.alphaMap&&(m.alphaMap.value=_.alphaMap,t(_.alphaMap,m.alphaMapTransform)),_.alphaTest>0&&(m.alphaTest.value=_.alphaTest)}function u(m,_){m.diffuse.value.copy(_.color),m.opacity.value=_.opacity,m.rotation.value=_.rotation,_.map&&(m.map.value=_.map,t(_.map,m.mapTransform)),_.alphaMap&&(m.alphaMap.value=_.alphaMap,t(_.alphaMap,m.alphaMapTransform)),_.alphaTest>0&&(m.alphaTest.value=_.alphaTest)}function d(m,_){m.specular.value.copy(_.specular),m.shininess.value=Math.max(_.shininess,1e-4)}function A(m,_){_.gradientMap&&(m.gradientMap.value=_.gradientMap)}function p(m,_){m.metalness.value=_.metalness,_.metalnessMap&&(m.metalnessMap.value=_.metalnessMap,t(_.metalnessMap,m.metalnessMapTransform)),m.roughness.value=_.roughness,_.roughnessMap&&(m.roughnessMap.value=_.roughnessMap,t(_.roughnessMap,m.roughnessMapTransform)),_.envMap&&(m.envMapIntensity.value=_.envMapIntensity)}function g(m,_,w){m.ior.value=_.ior,_.sheen>0&&(m.sheenColor.value.copy(_.sheenColor).multiplyScalar(_.sheen),m.sheenRoughness.value=_.sheenRoughness,_.sheenColorMap&&(m.sheenColorMap.value=_.sheenColorMap,t(_.sheenColorMap,m.sheenColorMapTransform)),_.sheenRoughnessMap&&(m.sheenRoughnessMap.value=_.sheenRoughnessMap,t(_.sheenRoughnessMap,m.sheenRoughnessMapTransform))),_.clearcoat>0&&(m.clearcoat.value=_.clearcoat,m.clearcoatRoughness.value=_.clearcoatRoughness,_.clearcoatMap&&(m.clearcoatMap.value=_.clearcoatMap,t(_.clearcoatMap,m.clearcoatMapTransform)),_.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=_.clearcoatRoughnessMap,t(_.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),_.clearcoatNormalMap&&(m.clearcoatNormalMap.value=_.clearcoatNormalMap,t(_.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(_.clearcoatNormalScale),_.side===Pr&&m.clearcoatNormalScale.value.negate())),_.iridescence>0&&(m.iridescence.value=_.iridescence,m.iridescenceIOR.value=_.iridescenceIOR,m.iridescenceThicknessMinimum.value=_.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=_.iridescenceThicknessRange[1],_.iridescenceMap&&(m.iridescenceMap.value=_.iridescenceMap,t(_.iridescenceMap,m.iridescenceMapTransform)),_.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=_.iridescenceThicknessMap,t(_.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),_.transmission>0&&(m.transmission.value=_.transmission,m.transmissionSamplerMap.value=w.texture,m.transmissionSamplerSize.value.set(w.width,w.height),_.transmissionMap&&(m.transmissionMap.value=_.transmissionMap,t(_.transmissionMap,m.transmissionMapTransform)),m.thickness.value=_.thickness,_.thicknessMap&&(m.thicknessMap.value=_.thicknessMap,t(_.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=_.attenuationDistance,m.attenuationColor.value.copy(_.attenuationColor)),_.anisotropy>0&&(m.anisotropyVector.value.set(_.anisotropy*Math.cos(_.anisotropyRotation),_.anisotropy*Math.sin(_.anisotropyRotation)),_.anisotropyMap&&(m.anisotropyMap.value=_.anisotropyMap,t(_.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=_.specularIntensity,m.specularColor.value.copy(_.specularColor),_.specularColorMap&&(m.specularColorMap.value=_.specularColorMap,t(_.specularColorMap,m.specularColorMapTransform)),_.specularIntensityMap&&(m.specularIntensityMap.value=_.specularIntensityMap,t(_.specularIntensityMap,m.specularIntensityMapTransform))}function v(m,_){_.matcap&&(m.matcap.value=_.matcap)}function E(m,_){const w=e.get(_).light;m.referencePosition.value.setFromMatrixPosition(w.matrixWorld),m.nearDistance.value=w.shadow.camera.near,m.farDistance.value=w.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function QL(r,e,t,n){let i={},s={},o=[];const c=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function h(w,x){const I=x.program;n.uniformBlockBinding(w,I)}function u(w,x){let I=i[w.id];I===void 0&&(v(w),I=d(w),i[w.id]=I,w.addEventListener("dispose",m));const R=x.program;n.updateUBOMapping(w,R);const S=e.render.frame;s[w.id]!==S&&(p(w),s[w.id]=S)}function d(w){const x=A();w.__bindingPointIndex=x;const I=r.createBuffer(),R=w.__size,S=w.usage;return r.bindBuffer(r.UNIFORM_BUFFER,I),r.bufferData(r.UNIFORM_BUFFER,R,S),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,x,I),I}function A(){for(let w=0;w<c;w++)if(o.indexOf(w)===-1)return o.push(w),w;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function p(w){const x=i[w.id],I=w.uniforms,R=w.__cache;r.bindBuffer(r.UNIFORM_BUFFER,x);for(let S=0,T=I.length;S<T;S++){const D=Array.isArray(I[S])?I[S]:[I[S]];for(let b=0,M=D.length;b<M;b++){const L=D[b];if(g(L,S,b,R)===!0){const P=L.__offset,N=Array.isArray(L.value)?L.value:[L.value];let j=0;for(let X=0;X<N.length;X++){const K=N[X],ne=E(K);typeof K=="number"||typeof K=="boolean"?(L.__data[0]=K,r.bufferSubData(r.UNIFORM_BUFFER,P+j,L.__data)):K.isMatrix3?(L.__data[0]=K.elements[0],L.__data[1]=K.elements[1],L.__data[2]=K.elements[2],L.__data[3]=0,L.__data[4]=K.elements[3],L.__data[5]=K.elements[4],L.__data[6]=K.elements[5],L.__data[7]=0,L.__data[8]=K.elements[6],L.__data[9]=K.elements[7],L.__data[10]=K.elements[8],L.__data[11]=0):(K.toArray(L.__data,j),j+=ne.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,P,L.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function g(w,x,I,R){const S=w.value,T=x+"_"+I;if(R[T]===void 0)return typeof S=="number"||typeof S=="boolean"?R[T]=S:R[T]=S.clone(),!0;{const D=R[T];if(typeof S=="number"||typeof S=="boolean"){if(D!==S)return R[T]=S,!0}else if(D.equals(S)===!1)return D.copy(S),!0}return!1}function v(w){const x=w.uniforms;let I=0;const R=16;for(let T=0,D=x.length;T<D;T++){const b=Array.isArray(x[T])?x[T]:[x[T]];for(let M=0,L=b.length;M<L;M++){const P=b[M],N=Array.isArray(P.value)?P.value:[P.value];for(let j=0,X=N.length;j<X;j++){const K=N[j],ne=E(K),V=I%R;V!==0&&R-V<ne.boundary&&(I+=R-V),P.__data=new Float32Array(ne.storage/Float32Array.BYTES_PER_ELEMENT),P.__offset=I,I+=ne.storage}}}const S=I%R;return S>0&&(I+=R-S),w.__size=I,w.__cache={},this}function E(w){const x={boundary:0,storage:0};return typeof w=="number"||typeof w=="boolean"?(x.boundary=4,x.storage=4):w.isVector2?(x.boundary=8,x.storage=8):w.isVector3||w.isColor?(x.boundary=16,x.storage=12):w.isVector4?(x.boundary=16,x.storage=16):w.isMatrix3?(x.boundary=48,x.storage=48):w.isMatrix4?(x.boundary=64,x.storage=64):w.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",w),x}function m(w){const x=w.target;x.removeEventListener("dispose",m);const I=o.indexOf(x.__bindingPointIndex);o.splice(I,1),r.deleteBuffer(i[x.id]),delete i[x.id],delete s[x.id]}function _(){for(const w in i)r.deleteBuffer(i[w]);o=[],i={},s={}}return{bind:h,update:u,dispose:_}}class OL{constructor(e={}){const{canvas:t=Rb(),context:n=null,depth:i=!0,stencil:s=!1,alpha:o=!1,antialias:c=!1,premultipliedAlpha:h=!0,preserveDrawingBuffer:u=!1,powerPreference:d="default",failIfMajorPerformanceCaveat:A=!1}=e;this.isWebGLRenderer=!0;let p;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=n.getContextAttributes().alpha}else p=o;const g=new Uint32Array(4),v=new Int32Array(4);let E=null,m=null;const _=[],w=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=kr,this._useLegacyLights=!1,this.toneMapping=Js,this.toneMappingExposure=1;const x=this;let I=!1,R=0,S=0,T=null,D=-1,b=null;const M=new Ft,L=new Ft;let P=null;const N=new qe(0);let j=0,X=t.width,K=t.height,ne=1,V=null,te=null;const Q=new Ft(0,0,X,K),z=new Ft(0,0,X,K);let Z=!1;const re=new jA;let H=!1,fe=!1;const Ae=new tt,ve=new Ge,ye=new W,Oe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function it(){return T===null?ne:1}let ae=n;function rt(F,ie){const he=t.getContext(F,ie);return he!==null?he:null}try{const F={alpha:!0,depth:i,stencil:s,antialias:c,premultipliedAlpha:h,preserveDrawingBuffer:u,powerPreference:d,failIfMajorPerformanceCaveat:A};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Gh}`),t.addEventListener("webglcontextlost",me,!1),t.addEventListener("webglcontextrestored",_e,!1),t.addEventListener("webglcontextcreationerror",Fe,!1),ae===null){const ie="webgl2";if(ae=rt(ie,F),ae===null)throw rt(ie)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(F){throw console.error("THREE.WebGLRenderer: "+F.message),F}let Pe,lt,Ye,ct,Y,k,ee,ue,pe,ge,Ue,Ee,Qe,He,Ce,Se,Ze,Ne,Re,at,ft,yt,_t,Et;function G(){Pe=new q6(ae),Pe.init(),lt=new H6(ae,Pe,e),yt=new BL(ae,Pe),Ye=new SL(ae),ct=new J6(ae),Y=new pL,k=new TL(ae,Pe,Ye,Y,lt,yt,ct),ee=new V6(x),ue=new Y6(x),pe=new n5(ae),_t=new F6(ae,pe),ge=new X6(ae,pe,ct,_t),Ue=new $6(ae,ge,pe,ct),Re=new Z6(ae,lt,k),Se=new G6(Y),Ee=new fL(x,ee,ue,Pe,lt,_t,Se),Qe=new kL(x,Y),He=new gL,Ce=new xL(Pe),Ne=new O6(x,ee,ue,Ye,Ue,p,h),Ze=new ML(x,Ue,lt),Et=new QL(ae,ct,lt,Ye),at=new z6(ae,Pe,ct),ft=new K6(ae,Pe,ct),ct.programs=Ee.programs,x.capabilities=lt,x.extensions=Pe,x.properties=Y,x.renderLists=He,x.shadowMap=Ze,x.state=Ye,x.info=ct}G();const O=new UL(x,ae);this.xr=O,this.getContext=function(){return ae},this.getContextAttributes=function(){return ae.getContextAttributes()},this.forceContextLoss=function(){const F=Pe.get("WEBGL_lose_context");F&&F.loseContext()},this.forceContextRestore=function(){const F=Pe.get("WEBGL_lose_context");F&&F.restoreContext()},this.getPixelRatio=function(){return ne},this.setPixelRatio=function(F){F!==void 0&&(ne=F,this.setSize(X,K,!1))},this.getSize=function(F){return F.set(X,K)},this.setSize=function(F,ie,he=!0){if(O.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}X=F,K=ie,t.width=Math.floor(F*ne),t.height=Math.floor(ie*ne),he===!0&&(t.style.width=F+"px",t.style.height=ie+"px"),this.setViewport(0,0,F,ie)},this.getDrawingBufferSize=function(F){return F.set(X*ne,K*ne).floor()},this.setDrawingBufferSize=function(F,ie,he){X=F,K=ie,ne=he,t.width=Math.floor(F*he),t.height=Math.floor(ie*he),this.setViewport(0,0,F,ie)},this.getCurrentViewport=function(F){return F.copy(M)},this.getViewport=function(F){return F.copy(Q)},this.setViewport=function(F,ie,he,de){F.isVector4?Q.set(F.x,F.y,F.z,F.w):Q.set(F,ie,he,de),Ye.viewport(M.copy(Q).multiplyScalar(ne).round())},this.getScissor=function(F){return F.copy(z)},this.setScissor=function(F,ie,he,de){F.isVector4?z.set(F.x,F.y,F.z,F.w):z.set(F,ie,he,de),Ye.scissor(L.copy(z).multiplyScalar(ne).round())},this.getScissorTest=function(){return Z},this.setScissorTest=function(F){Ye.setScissorTest(Z=F)},this.setOpaqueSort=function(F){V=F},this.setTransparentSort=function(F){te=F},this.getClearColor=function(F){return F.copy(Ne.getClearColor())},this.setClearColor=function(){Ne.setClearColor.apply(Ne,arguments)},this.getClearAlpha=function(){return Ne.getClearAlpha()},this.setClearAlpha=function(){Ne.setClearAlpha.apply(Ne,arguments)},this.clear=function(F=!0,ie=!0,he=!0){let de=0;if(F){let le=!1;if(T!==null){const Be=T.texture.format;le=Be===eu||Be===qh||Be===dA}if(le){const Be=T.texture.type,Xe=Be===pr||Be===wi||Be===hA||Be===Zc||Be===jy||Be===Wy,et=Ne.getClearColor(),nt=Ne.getClearAlpha(),We=et.r,ut=et.g,ot=et.b;Xe?(g[0]=We,g[1]=ut,g[2]=ot,g[3]=nt,ae.clearBufferuiv(ae.COLOR,0,g)):(v[0]=We,v[1]=ut,v[2]=ot,v[3]=nt,ae.clearBufferiv(ae.COLOR,0,v))}else de|=ae.COLOR_BUFFER_BIT}ie&&(de|=ae.DEPTH_BUFFER_BIT),he&&(de|=ae.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),ae.clear(de)},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(){t.removeEventListener("webglcontextlost",me,!1),t.removeEventListener("webglcontextrestored",_e,!1),t.removeEventListener("webglcontextcreationerror",Fe,!1),He.dispose(),Ce.dispose(),Y.dispose(),ee.dispose(),ue.dispose(),Ue.dispose(),_t.dispose(),Et.dispose(),Ee.dispose(),O.dispose(),O.removeEventListener("sessionstart",ur),O.removeEventListener("sessionend",Vt),mr.stop()};function me(F){F.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),I=!0}function _e(){console.log("THREE.WebGLRenderer: Context Restored."),I=!1;const F=ct.autoReset,ie=Ze.enabled,he=Ze.autoUpdate,de=Ze.needsUpdate,le=Ze.type;G(),ct.autoReset=F,Ze.enabled=ie,Ze.autoUpdate=he,Ze.needsUpdate=de,Ze.type=le}function Fe(F){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",F.statusMessage)}function De(F){const ie=F.target;ie.removeEventListener("dispose",De),pt(ie)}function pt(F){Dt(F),Y.remove(F)}function Dt(F){const ie=Y.get(F).programs;ie!==void 0&&(ie.forEach(function(he){Ee.releaseProgram(he)}),F.isShaderMaterial&&Ee.releaseShaderCache(F))}this.renderBufferDirect=function(F,ie,he,de,le,Be){ie===null&&(ie=Oe);const Xe=le.isMesh&&le.matrixWorld.determinant()<0,et=Ym(F,ie,he,de,le);Ye.setMaterial(de,Xe);let nt=he.index,We=1;if(de.wireframe===!0){if(nt=ge.getWireframeAttribute(he),nt===void 0)return;We=2}const ut=he.drawRange,ot=he.attributes.position;let Rr=ut.start*We,er=(ut.start+ut.count)*We;Be!==null&&(Rr=Math.max(Rr,Be.start*We),er=Math.min(er,(Be.start+Be.count)*We)),nt!==null?(Rr=Math.max(Rr,0),er=Math.min(er,nt.count)):ot!=null&&(Rr=Math.max(Rr,0),er=Math.min(er,ot.count));const bn=er-Rr;if(bn<0||bn===1/0)return;_t.setup(le,de,et,he,nt);let hi,jt=at;if(nt!==null&&(hi=pe.get(nt),jt=ft,jt.setIndex(hi)),le.isMesh)de.wireframe===!0?(Ye.setLineWidth(de.wireframeLinewidth*it()),jt.setMode(ae.LINES)):jt.setMode(ae.TRIANGLES);else if(le.isLine){let $e=de.linewidth;$e===void 0&&($e=1),Ye.setLineWidth($e*it()),le.isLineSegments?jt.setMode(ae.LINES):le.isLineLoop?jt.setMode(ae.LINE_LOOP):jt.setMode(ae.LINE_STRIP)}else le.isPoints?jt.setMode(ae.POINTS):le.isSprite&&jt.setMode(ae.TRIANGLES);if(le.isBatchedMesh)jt.renderMultiDraw(le._multiDrawStarts,le._multiDrawCounts,le._multiDrawCount);else if(le.isInstancedMesh)jt.renderInstances(Rr,bn,le.count);else if(he.isInstancedBufferGeometry){const $e=he._maxInstanceCount!==void 0?he._maxInstanceCount:1/0,ju=Math.min(he.instanceCount,$e);jt.renderInstances(Rr,bn,ju)}else jt.render(Rr,bn)};function Lt(F,ie,he){F.transparent===!0&&F.side===yi&&F.forceSinglePass===!1?(F.side=Pr,F.needsUpdate=!0,Ns(F,ie,he),F.side=vi,F.needsUpdate=!0,Ns(F,ie,he),F.side=yi):Ns(F,ie,he)}this.compile=function(F,ie,he=null){he===null&&(he=F),m=Ce.get(he),m.init(),w.push(m),he.traverseVisible(function(le){le.isLight&&le.layers.test(ie.layers)&&(m.pushLight(le),le.castShadow&&m.pushShadow(le))}),F!==he&&F.traverseVisible(function(le){le.isLight&&le.layers.test(ie.layers)&&(m.pushLight(le),le.castShadow&&m.pushShadow(le))}),m.setupLights(x._useLegacyLights);const de=new Set;return F.traverse(function(le){const Be=le.material;if(Be)if(Array.isArray(Be))for(let Xe=0;Xe<Be.length;Xe++){const et=Be[Xe];Lt(et,he,le),de.add(et)}else Lt(Be,he,le),de.add(Be)}),w.pop(),m=null,de},this.compileAsync=function(F,ie,he=null){const de=this.compile(F,ie,he);return new Promise(le=>{function Be(){if(de.forEach(function(Xe){Y.get(Xe).currentProgram.isReady()&&de.delete(Xe)}),de.size===0){le(F);return}setTimeout(Be,10)}Pe.get("KHR_parallel_shader_compile")!==null?Be():setTimeout(Be,10)})};let St=null;function At(F){St&&St(F)}function ur(){mr.stop()}function Vt(){mr.start()}const mr=new JE;mr.setAnimationLoop(At),typeof self<"u"&&mr.setContext(self),this.setAnimationLoop=function(F){St=F,O.setAnimationLoop(F),F===null?mr.stop():mr.start()},O.addEventListener("sessionstart",ur),O.addEventListener("sessionend",Vt),this.render=function(F,ie){if(ie!==void 0&&ie.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(I===!0)return;F.matrixWorldAutoUpdate===!0&&F.updateMatrixWorld(),ie.parent===null&&ie.matrixWorldAutoUpdate===!0&&ie.updateMatrixWorld(),O.enabled===!0&&O.isPresenting===!0&&(O.cameraAutoUpdate===!0&&O.updateCamera(ie),ie=O.getCamera()),F.isScene===!0&&F.onBeforeRender(x,F,ie,T),m=Ce.get(F,w.length),m.init(),w.push(m),Ae.multiplyMatrices(ie.projectionMatrix,ie.matrixWorldInverse),re.setFromProjectionMatrix(Ae),fe=this.localClippingEnabled,H=Se.init(this.clippingPlanes,fe),E=He.get(F,_.length),E.init(),_.push(E),Bn(F,ie,0,x.sortObjects),E.finish(),x.sortObjects===!0&&E.sort(V,te),this.info.render.frame++,H===!0&&Se.beginShadows();const he=m.state.shadowsArray;if(Ze.render(he,F,ie),H===!0&&Se.endShadows(),this.info.autoReset===!0&&this.info.reset(),(O.enabled===!1||O.isPresenting===!1||O.hasDepthSensing()===!1)&&Ne.render(E,F),m.setupLights(x._useLegacyLights),ie.isArrayCamera){const de=ie.cameras;for(let le=0,Be=de.length;le<Be;le++){const Xe=de[le];qt(E,F,Xe,Xe.viewport)}}else qt(E,F,ie);T!==null&&(k.updateMultisampleRenderTarget(T),k.updateRenderTargetMipmap(T)),F.isScene===!0&&F.onAfterRender(x,F,ie),_t.resetDefaultState(),D=-1,b=null,w.pop(),w.length>0?m=w[w.length-1]:m=null,_.pop(),_.length>0?E=_[_.length-1]:E=null};function Bn(F,ie,he,de){if(F.visible===!1)return;if(F.layers.test(ie.layers)){if(F.isGroup)he=F.renderOrder;else if(F.isLOD)F.autoUpdate===!0&&F.update(ie);else if(F.isLight)m.pushLight(F),F.castShadow&&m.pushShadow(F);else if(F.isSprite){if(!F.frustumCulled||re.intersectsSprite(F)){de&&ye.setFromMatrixPosition(F.matrixWorld).applyMatrix4(Ae);const Be=Ue.update(F),Xe=F.material;Xe.visible&&E.push(F,Be,Xe,he,ye.z,null)}}else if((F.isMesh||F.isLine||F.isPoints)&&(!F.frustumCulled||re.intersectsObject(F))){const Be=Ue.update(F),Xe=F.material;if(de&&(F.boundingSphere!==void 0?(F.boundingSphere===null&&F.computeBoundingSphere(),ye.copy(F.boundingSphere.center)):(Be.boundingSphere===null&&Be.computeBoundingSphere(),ye.copy(Be.boundingSphere.center)),ye.applyMatrix4(F.matrixWorld).applyMatrix4(Ae)),Array.isArray(Xe)){const et=Be.groups;for(let nt=0,We=et.length;nt<We;nt++){const ut=et[nt],ot=Xe[ut.materialIndex];ot&&ot.visible&&E.push(F,Be,ot,he,ye.z,ut)}}else Xe.visible&&E.push(F,Be,Xe,he,ye.z,null)}}const le=F.children;for(let Be=0,Xe=le.length;Be<Xe;Be++)Bn(le[Be],ie,he,de)}function qt(F,ie,he,de){const le=F.opaque,Be=F.transmissive,Xe=F.transparent;m.setupLightsView(he),H===!0&&Se.setGlobalState(x.clippingPlanes,he),Be.length>0&&ui(le,Be,ie,he),de&&Ye.viewport(M.copy(de)),le.length>0&&Kn(le,ie,he),Be.length>0&&Kn(Be,ie,he),Xe.length>0&&Kn(Xe,ie,he),Ye.buffers.depth.setTest(!0),Ye.buffers.depth.setMask(!0),Ye.buffers.color.setMask(!0),Ye.setPolygonOffset(!1)}function ui(F,ie,he,de){if((he.isScene===!0?he.overrideMaterial:null)!==null)return;if(m.state.transmissionRenderTarget===null){m.state.transmissionRenderTarget=new Mi(1,1,{generateMipmaps:!0,type:Pe.has("EXT_color_buffer_half_float")||Pe.has("EXT_color_buffer_float")?_n:pr,minFilter:xi,samples:4,stencilBuffer:s});const nt=Y.get(m.state.transmissionRenderTarget);nt.__isTransmissionRenderTarget=!0}const le=m.state.transmissionRenderTarget;x.getDrawingBufferSize(ve),le.setSize(ve.x,ve.y);const Be=x.getRenderTarget();x.setRenderTarget(le),x.getClearColor(N),j=x.getClearAlpha(),j<1&&x.setClearColor(16777215,.5),x.clear();const Xe=x.toneMapping;x.toneMapping=Js,Kn(F,he,de),k.updateMultisampleRenderTarget(le),k.updateRenderTargetMipmap(le);let et=!1;for(let nt=0,We=ie.length;nt<We;nt++){const ut=ie[nt],ot=ut.object,Rr=ut.geometry,er=ut.material,bn=ut.group;if(er.side===yi&&ot.layers.test(de.layers)){const hi=er.side;er.side=Pr,er.needsUpdate=!0,Ls(ot,he,de,Rr,er,bn),er.side=hi,er.needsUpdate=!0,et=!0}}et===!0&&(k.updateMultisampleRenderTarget(le),k.updateRenderTargetMipmap(le)),x.setRenderTarget(Be),x.setClearColor(N,j),x.toneMapping=Xe}function Kn(F,ie,he){const de=ie.isScene===!0?ie.overrideMaterial:null;for(let le=0,Be=F.length;le<Be;le++){const Xe=F[le],et=Xe.object,nt=Xe.geometry,We=de===null?Xe.material:de,ut=Xe.group;et.layers.test(he.layers)&&Ls(et,ie,he,nt,We,ut)}}function Ls(F,ie,he,de,le,Be){F.onBeforeRender(x,ie,he,de,le,Be),F.modelViewMatrix.multiplyMatrices(he.matrixWorldInverse,F.matrixWorld),F.normalMatrix.getNormalMatrix(F.modelViewMatrix),le.onBeforeRender(x,ie,he,de,F,Be),le.transparent===!0&&le.side===yi&&le.forceSinglePass===!1?(le.side=Pr,le.needsUpdate=!0,x.renderBufferDirect(he,ie,de,le,F,Be),le.side=vi,le.needsUpdate=!0,x.renderBufferDirect(he,ie,de,le,F,Be),le.side=yi):x.renderBufferDirect(he,ie,de,le,F,Be),F.onAfterRender(x,ie,he,de,le,Be)}function Ns(F,ie,he){ie.isScene!==!0&&(ie=Oe);const de=Y.get(F),le=m.state.lights,Be=m.state.shadowsArray,Xe=le.state.version,et=Ee.getParameters(F,le.state,Be,ie,he),nt=Ee.getProgramCacheKey(et);let We=de.programs;de.environment=F.isMeshStandardMaterial?ie.environment:null,de.fog=ie.fog,de.envMap=(F.isMeshStandardMaterial?ue:ee).get(F.envMap||de.environment),de.envMapRotation=de.environment!==null&&F.envMap===null?ie.environmentRotation:F.envMapRotation,We===void 0&&(F.addEventListener("dispose",De),We=new Map,de.programs=We);let ut=We.get(nt);if(ut!==void 0){if(de.currentProgram===ut&&de.lightsStateVersion===Xe)return xf(F,et),ut}else et.uniforms=Ee.getUniforms(F),F.onBuild(he,et,x),F.onBeforeCompile(et,x),ut=Ee.acquireProgram(et,nt),We.set(nt,ut),de.uniforms=et.uniforms;const ot=de.uniforms;return(!F.isShaderMaterial&&!F.isRawShaderMaterial||F.clipping===!0)&&(ot.clippingPlanes=Se.uniform),xf(F,et),de.needsLights=Us(F),de.lightsStateVersion=Xe,de.needsLights&&(ot.ambientLightColor.value=le.state.ambient,ot.lightProbe.value=le.state.probe,ot.directionalLights.value=le.state.directional,ot.directionalLightShadows.value=le.state.directionalShadow,ot.spotLights.value=le.state.spot,ot.spotLightShadows.value=le.state.spotShadow,ot.rectAreaLights.value=le.state.rectArea,ot.ltc_1.value=le.state.rectAreaLTC1,ot.ltc_2.value=le.state.rectAreaLTC2,ot.pointLights.value=le.state.point,ot.pointLightShadows.value=le.state.pointShadow,ot.hemisphereLights.value=le.state.hemi,ot.directionalShadowMap.value=le.state.directionalShadowMap,ot.directionalShadowMatrix.value=le.state.directionalShadowMatrix,ot.spotShadowMap.value=le.state.spotShadowMap,ot.spotLightMatrix.value=le.state.spotLightMatrix,ot.spotLightMap.value=le.state.spotLightMap,ot.pointShadowMap.value=le.state.pointShadowMap,ot.pointShadowMatrix.value=le.state.pointShadowMatrix),de.currentProgram=ut,de.uniformsList=null,ut}function sc(F){if(F.uniformsList===null){const ie=F.currentProgram.getUniforms();F.uniformsList=Td.seqWithValue(ie.seq,F.uniforms)}return F.uniformsList}function xf(F,ie){const he=Y.get(F);he.outputColorSpace=ie.outputColorSpace,he.batching=ie.batching,he.instancing=ie.instancing,he.instancingColor=ie.instancingColor,he.instancingMorph=ie.instancingMorph,he.skinning=ie.skinning,he.morphTargets=ie.morphTargets,he.morphNormals=ie.morphNormals,he.morphColors=ie.morphColors,he.morphTargetsCount=ie.morphTargetsCount,he.numClippingPlanes=ie.numClippingPlanes,he.numIntersection=ie.numClipIntersection,he.vertexAlphas=ie.vertexAlphas,he.vertexTangents=ie.vertexTangents,he.toneMapping=ie.toneMapping}function Ym(F,ie,he,de,le){ie.isScene!==!0&&(ie=Oe),k.resetTextureUnits();const Be=ie.fog,Xe=de.isMeshStandardMaterial?ie.environment:null,et=T===null?x.outputColorSpace:T.isXRRenderTarget===!0?T.texture.colorSpace:Cr,nt=(de.isMeshStandardMaterial?ue:ee).get(de.envMap||Xe),We=de.vertexColors===!0&&!!he.attributes.color&&he.attributes.color.itemSize===4,ut=!!he.attributes.tangent&&(!!de.normalMap||de.anisotropy>0),ot=!!he.morphAttributes.position,Rr=!!he.morphAttributes.normal,er=!!he.morphAttributes.color;let bn=Js;de.toneMapped&&(T===null||T.isXRRenderTarget===!0)&&(bn=x.toneMapping);const hi=he.morphAttributes.position||he.morphAttributes.normal||he.morphAttributes.color,jt=hi!==void 0?hi.length:0,$e=Y.get(de),ju=m.state.lights;if(H===!0&&(fe===!0||F!==b)){const Dn=F===b&&de.id===D;Se.setState(de,F,Dn)}let pn=!1;de.version===$e.__version?($e.needsLights&&$e.lightsStateVersion!==ju.state.version||$e.outputColorSpace!==et||le.isBatchedMesh&&$e.batching===!1||!le.isBatchedMesh&&$e.batching===!0||le.isInstancedMesh&&$e.instancing===!1||!le.isInstancedMesh&&$e.instancing===!0||le.isSkinnedMesh&&$e.skinning===!1||!le.isSkinnedMesh&&$e.skinning===!0||le.isInstancedMesh&&$e.instancingColor===!0&&le.instanceColor===null||le.isInstancedMesh&&$e.instancingColor===!1&&le.instanceColor!==null||le.isInstancedMesh&&$e.instancingMorph===!0&&le.morphTexture===null||le.isInstancedMesh&&$e.instancingMorph===!1&&le.morphTexture!==null||$e.envMap!==nt||de.fog===!0&&$e.fog!==Be||$e.numClippingPlanes!==void 0&&($e.numClippingPlanes!==Se.numPlanes||$e.numIntersection!==Se.numIntersection)||$e.vertexAlphas!==We||$e.vertexTangents!==ut||$e.morphTargets!==ot||$e.morphNormals!==Rr||$e.morphColors!==er||$e.toneMapping!==bn||$e.morphTargetsCount!==jt)&&(pn=!0):(pn=!0,$e.__version=de.version);let Ps=$e.currentProgram;pn===!0&&(Ps=Ns(de,ie,le));let wf=!1,bo=!1,wa=!1;const _r=Ps.getUniforms(),Rn=$e.uniforms;if(Ye.useProgram(Ps.program)&&(wf=!0,bo=!0,wa=!0),de.id!==D&&(D=de.id,bo=!0),wf||b!==F){_r.setValue(ae,"projectionMatrix",F.projectionMatrix),_r.setValue(ae,"viewMatrix",F.matrixWorldInverse);const Dn=_r.map.cameraPosition;Dn!==void 0&&Dn.setValue(ae,ye.setFromMatrixPosition(F.matrixWorld)),lt.logarithmicDepthBuffer&&_r.setValue(ae,"logDepthBufFC",2/(Math.log(F.far+1)/Math.LN2)),(de.isMeshPhongMaterial||de.isMeshToonMaterial||de.isMeshLambertMaterial||de.isMeshBasicMaterial||de.isMeshStandardMaterial||de.isShaderMaterial)&&_r.setValue(ae,"isOrthographic",F.isOrthographicCamera===!0),b!==F&&(b=F,bo=!0,wa=!0)}if(le.isSkinnedMesh){_r.setOptional(ae,le,"bindMatrix"),_r.setOptional(ae,le,"bindMatrixInverse");const Dn=le.skeleton;Dn&&(Dn.boneTexture===null&&Dn.computeBoneTexture(),_r.setValue(ae,"boneTexture",Dn.boneTexture,k))}le.isBatchedMesh&&(_r.setOptional(ae,le,"batchingTexture"),_r.setValue(ae,"batchingTexture",le._matricesTexture,k));const Ia=he.morphAttributes;if((Ia.position!==void 0||Ia.normal!==void 0||Ia.color!==void 0)&&Re.update(le,he,Ps),(bo||$e.receiveShadow!==le.receiveShadow)&&($e.receiveShadow=le.receiveShadow,_r.setValue(ae,"receiveShadow",le.receiveShadow)),de.isMeshGouraudMaterial&&de.envMap!==null&&(Rn.envMap.value=nt,Rn.flipEnvMap.value=nt.isCubeTexture&&nt.isRenderTargetTexture===!1?-1:1),de.isMeshStandardMaterial&&de.envMap===null&&ie.environment!==null&&(Rn.envMapIntensity.value=ie.environmentIntensity),bo&&(_r.setValue(ae,"toneMappingExposure",x.toneMappingExposure),$e.needsLights&&qm(Rn,wa),Be&&de.fog===!0&&Qe.refreshFogUniforms(Rn,Be),Qe.refreshMaterialUniforms(Rn,de,ne,K,m.state.transmissionRenderTarget),Td.upload(ae,sc($e),Rn,k)),de.isShaderMaterial&&de.uniformsNeedUpdate===!0&&(Td.upload(ae,sc($e),Rn,k),de.uniformsNeedUpdate=!1),de.isSpriteMaterial&&_r.setValue(ae,"center",le.center),_r.setValue(ae,"modelViewMatrix",le.modelViewMatrix),_r.setValue(ae,"normalMatrix",le.normalMatrix),_r.setValue(ae,"modelMatrix",le.matrixWorld),de.isShaderMaterial||de.isRawShaderMaterial){const Dn=de.uniformsGroups;for(let Wu=0,Yu=Dn.length;Wu<Yu;Wu++){const qu=Dn[Wu];Et.update(qu,Ps),Et.bind(qu,Ps)}}return Ps}function qm(F,ie){F.ambientLightColor.needsUpdate=ie,F.lightProbe.needsUpdate=ie,F.directionalLights.needsUpdate=ie,F.directionalLightShadows.needsUpdate=ie,F.pointLights.needsUpdate=ie,F.pointLightShadows.needsUpdate=ie,F.spotLights.needsUpdate=ie,F.spotLightShadows.needsUpdate=ie,F.rectAreaLights.needsUpdate=ie,F.hemisphereLights.needsUpdate=ie}function Us(F){return F.isMeshLambertMaterial||F.isMeshToonMaterial||F.isMeshPhongMaterial||F.isMeshStandardMaterial||F.isShadowMaterial||F.isShaderMaterial&&F.lights===!0}this.getActiveCubeFace=function(){return R},this.getActiveMipmapLevel=function(){return S},this.getRenderTarget=function(){return T},this.setRenderTargetTextures=function(F,ie,he){Y.get(F.texture).__webglTexture=ie,Y.get(F.depthTexture).__webglTexture=he;const de=Y.get(F);de.__hasExternalTextures=!0,de.__autoAllocateDepthBuffer=he===void 0,de.__autoAllocateDepthBuffer||Pe.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),de.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(F,ie){const he=Y.get(F);he.__webglFramebuffer=ie,he.__useDefaultFramebuffer=ie===void 0},this.setRenderTarget=function(F,ie=0,he=0){T=F,R=ie,S=he;let de=!0,le=null,Be=!1,Xe=!1;if(F){const et=Y.get(F);et.__useDefaultFramebuffer!==void 0?(Ye.bindFramebuffer(ae.FRAMEBUFFER,null),de=!1):et.__webglFramebuffer===void 0?k.setupRenderTarget(F):et.__hasExternalTextures&&k.rebindTextures(F,Y.get(F.texture).__webglTexture,Y.get(F.depthTexture).__webglTexture);const nt=F.texture;(nt.isData3DTexture||nt.isDataArrayTexture||nt.isCompressedArrayTexture)&&(Xe=!0);const We=Y.get(F).__webglFramebuffer;F.isWebGLCubeRenderTarget?(Array.isArray(We[ie])?le=We[ie][he]:le=We[ie],Be=!0):F.samples>0&&k.useMultisampledRTT(F)===!1?le=Y.get(F).__webglMultisampledFramebuffer:Array.isArray(We)?le=We[he]:le=We,M.copy(F.viewport),L.copy(F.scissor),P=F.scissorTest}else M.copy(Q).multiplyScalar(ne).floor(),L.copy(z).multiplyScalar(ne).floor(),P=Z;if(Ye.bindFramebuffer(ae.FRAMEBUFFER,le)&&de&&Ye.drawBuffers(F,le),Ye.viewport(M),Ye.scissor(L),Ye.setScissorTest(P),Be){const et=Y.get(F.texture);ae.framebufferTexture2D(ae.FRAMEBUFFER,ae.COLOR_ATTACHMENT0,ae.TEXTURE_CUBE_MAP_POSITIVE_X+ie,et.__webglTexture,he)}else if(Xe){const et=Y.get(F.texture),nt=ie||0;ae.framebufferTextureLayer(ae.FRAMEBUFFER,ae.COLOR_ATTACHMENT0,et.__webglTexture,he||0,nt)}D=-1},this.readRenderTargetPixels=function(F,ie,he,de,le,Be,Xe){if(!(F&&F.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let et=Y.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&Xe!==void 0&&(et=et[Xe]),et){Ye.bindFramebuffer(ae.FRAMEBUFFER,et);try{const nt=F.texture,We=nt.format,ut=nt.type;if(We!==Ar&&yt.convert(We)!==ae.getParameter(ae.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ot=ut===_n&&(Pe.has("EXT_color_buffer_half_float")||Pe.has("EXT_color_buffer_float"));if(ut!==pr&&yt.convert(ut)!==ae.getParameter(ae.IMPLEMENTATION_COLOR_READ_TYPE)&&ut!==or&&!ot){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ie>=0&&ie<=F.width-de&&he>=0&&he<=F.height-le&&ae.readPixels(ie,he,de,le,yt.convert(We),yt.convert(ut),Be)}finally{const nt=T!==null?Y.get(T).__webglFramebuffer:null;Ye.bindFramebuffer(ae.FRAMEBUFFER,nt)}}},this.copyFramebufferToTexture=function(F,ie,he=0){const de=Math.pow(2,-he),le=Math.floor(ie.image.width*de),Be=Math.floor(ie.image.height*de);k.setTexture2D(ie,0),ae.copyTexSubImage2D(ae.TEXTURE_2D,he,0,0,F.x,F.y,le,Be),Ye.unbindTexture()},this.copyTextureToTexture=function(F,ie,he,de=0){const le=ie.image.width,Be=ie.image.height,Xe=yt.convert(he.format),et=yt.convert(he.type);k.setTexture2D(he,0),ae.pixelStorei(ae.UNPACK_FLIP_Y_WEBGL,he.flipY),ae.pixelStorei(ae.UNPACK_PREMULTIPLY_ALPHA_WEBGL,he.premultiplyAlpha),ae.pixelStorei(ae.UNPACK_ALIGNMENT,he.unpackAlignment),ie.isDataTexture?ae.texSubImage2D(ae.TEXTURE_2D,de,F.x,F.y,le,Be,Xe,et,ie.image.data):ie.isCompressedTexture?ae.compressedTexSubImage2D(ae.TEXTURE_2D,de,F.x,F.y,ie.mipmaps[0].width,ie.mipmaps[0].height,Xe,ie.mipmaps[0].data):ae.texSubImage2D(ae.TEXTURE_2D,de,F.x,F.y,Xe,et,ie.image),de===0&&he.generateMipmaps&&ae.generateMipmap(ae.TEXTURE_2D),Ye.unbindTexture()},this.copyTextureToTexture3D=function(F,ie,he,de,le=0){const Be=Math.round(F.max.x-F.min.x),Xe=Math.round(F.max.y-F.min.y),et=F.max.z-F.min.z+1,nt=yt.convert(de.format),We=yt.convert(de.type);let ut;if(de.isData3DTexture)k.setTexture3D(de,0),ut=ae.TEXTURE_3D;else if(de.isDataArrayTexture||de.isCompressedArrayTexture)k.setTexture2DArray(de,0),ut=ae.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}ae.pixelStorei(ae.UNPACK_FLIP_Y_WEBGL,de.flipY),ae.pixelStorei(ae.UNPACK_PREMULTIPLY_ALPHA_WEBGL,de.premultiplyAlpha),ae.pixelStorei(ae.UNPACK_ALIGNMENT,de.unpackAlignment);const ot=ae.getParameter(ae.UNPACK_ROW_LENGTH),Rr=ae.getParameter(ae.UNPACK_IMAGE_HEIGHT),er=ae.getParameter(ae.UNPACK_SKIP_PIXELS),bn=ae.getParameter(ae.UNPACK_SKIP_ROWS),hi=ae.getParameter(ae.UNPACK_SKIP_IMAGES),jt=he.isCompressedTexture?he.mipmaps[le]:he.image;ae.pixelStorei(ae.UNPACK_ROW_LENGTH,jt.width),ae.pixelStorei(ae.UNPACK_IMAGE_HEIGHT,jt.height),ae.pixelStorei(ae.UNPACK_SKIP_PIXELS,F.min.x),ae.pixelStorei(ae.UNPACK_SKIP_ROWS,F.min.y),ae.pixelStorei(ae.UNPACK_SKIP_IMAGES,F.min.z),he.isDataTexture||he.isData3DTexture?ae.texSubImage3D(ut,le,ie.x,ie.y,ie.z,Be,Xe,et,nt,We,jt.data):de.isCompressedArrayTexture?ae.compressedTexSubImage3D(ut,le,ie.x,ie.y,ie.z,Be,Xe,et,nt,jt.data):ae.texSubImage3D(ut,le,ie.x,ie.y,ie.z,Be,Xe,et,nt,We,jt),ae.pixelStorei(ae.UNPACK_ROW_LENGTH,ot),ae.pixelStorei(ae.UNPACK_IMAGE_HEIGHT,Rr),ae.pixelStorei(ae.UNPACK_SKIP_PIXELS,er),ae.pixelStorei(ae.UNPACK_SKIP_ROWS,bn),ae.pixelStorei(ae.UNPACK_SKIP_IMAGES,hi),le===0&&de.generateMipmaps&&ae.generateMipmap(ut),Ye.unbindTexture()},this.initTexture=function(F){F.isCubeTexture?k.setTextureCube(F,0):F.isData3DTexture?k.setTexture3D(F,0):F.isDataArrayTexture||F.isCompressedArrayTexture?k.setTexture2DArray(F,0):k.setTexture2D(F,0),Ye.unbindTexture()},this.resetState=function(){R=0,S=0,T=null,Ye.reset(),_t.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return As}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===$h?"display-p3":"srgb",t.unpackColorSpace=Rt.workingColorSpace===ru?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class FL extends Zt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Wi,this.environmentIntensity=1,this.environmentRotation=new Wi,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class zL{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=wA,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Ii()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return wE("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}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,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;i<s;i++)this.array[e+i]=t.array[n+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Ii()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Ii()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(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}}}const un=new W;class tg{constructor(e,t,n,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=i}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,n=this.data.count;t<n;t++)un.fromBufferAttribute(this,t),un.applyMatrix4(e),this.setXYZ(t,un.x,un.y,un.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)un.fromBufferAttribute(this,t),un.applyNormalMatrix(e),this.setXYZ(t,un.x,un.y,un.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)un.fromBufferAttribute(this,t),un.transformDirection(e),this.setXYZ(t,un.x,un.y,un.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=Ci(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Nt(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Nt(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=Ci(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Ci(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Ci(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Ci(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array),i=Nt(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this}setXYZW(e,t,n,i,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array),i=Nt(i,this.array),s=Nt(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this.data.array[e+3]=s,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}return new Qr(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new tg(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}const S2=new W,T2=new Ft,B2=new Ft,HL=new W,b2=new tt,Bd=new W,rg=new Ti,R2=new tt,ng=new lu;class GL extends Wr{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=zy,this.bindMatrix=new tt,this.bindMatrixInverse=new tt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new yr),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Bd),this.boundingBox.expandByPoint(Bd)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Ti),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Bd),this.boundingSphere.expandByPoint(Bd)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const n=this.material,i=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),rg.copy(this.boundingSphere),rg.applyMatrix4(i),e.ray.intersectsSphere(rg)!==!1&&(R2.copy(i).invert(),ng.copy(e.ray).applyMatrix4(R2),!(this.boundingBox!==null&&ng.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,ng)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new Ft,t=this.geometry.attributes.skinWeight;for(let n=0,i=t.count;n<i;n++){e.fromBufferAttribute(t,n);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===zy?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===XB?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,i=this.geometry;T2.fromBufferAttribute(i.attributes.skinIndex,e),B2.fromBufferAttribute(i.attributes.skinWeight,e),S2.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=B2.getComponent(s);if(o!==0){const c=T2.getComponent(s);b2.multiplyMatrices(n.bones[c].matrixWorld,n.boneInverses[c]),t.addScaledVector(HL.copy(S2).applyMatrix4(b2),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}class D2 extends Zt{constructor(){super(),this.isBone=!0,this.type="Bone"}}class po extends Sr{constructor(e=null,t=1,n=1,i,s,o,c,h,u=dr,d=dr,A,p){super(null,o,c,h,u,d,i,s,A,p),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const L2=new tt,VL=new tt;class ig{constructor(e=[],t=[]){this.uuid=Ii(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)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 n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new tt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new tt;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let s=0,o=e.length;s<o;s++){const c=e[s]?e[s].matrixWorld:VL;L2.multiplyMatrices(c,t[s]),L2.toArray(n,s*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new ig(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new po(t,e,e,Ar,or);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,i=e.bones.length;n<i;n++){const s=e.bones[n];let o=t[s];o===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),o=new D2),this.bones.push(o),this.boneInverses.push(new tt().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let i=0,s=t.length;i<s;i++){const o=t[i];e.bones.push(o.uuid);const c=n[i];e.boneInverses.push(c.toArray())}return e}}class sg extends Qr{constructor(e,t,n,i=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const Ml=new tt,N2=new tt,bd=[],U2=new yr,jL=new tt,Au=new Wr,gu=new Ti;class WL extends Wr{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new sg(new Float32Array(n*16),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let i=0;i<n;i++)this.setMatrixAt(i,jL)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new yr),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Ml),U2.copy(e.boundingBox).applyMatrix4(Ml),this.boundingBox.union(U2)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new Ti),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Ml),gu.copy(e.boundingSphere).applyMatrix4(Ml),this.boundingSphere.union(gu)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const n=t.morphTargetInfluences,i=this.morphTexture.source.data.data,s=n.length+1,o=e*s+1;for(let c=0;c<n.length;c++)n[c]=i[o+c]}raycast(e,t){const n=this.matrixWorld,i=this.count;if(Au.geometry=this.geometry,Au.material=this.material,Au.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),gu.copy(this.boundingSphere),gu.applyMatrix4(n),e.ray.intersectsSphere(gu)!==!1))for(let s=0;s<i;s++){this.getMatrixAt(s,Ml),N2.multiplyMatrices(n,Ml),Au.matrixWorld=N2,Au.raycast(e,bd);for(let o=0,c=bd.length;o<c;o++){const h=bd[o];h.instanceId=s,h.object=this,t.push(h)}bd.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new sg(new Float32Array(this.instanceMatrix.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){const n=t.morphTargetInfluences,i=n.length+1;this.morphTexture===null&&(this.morphTexture=new po(new Float32Array(i*this.count),i,this.count,$s,or));const s=this.morphTexture.source.data.data;let o=0;for(let u=0;u<n.length;u++)o+=n[u];const c=this.geometry.morphTargetsRelative?1:1-o,h=i*e;s[h]=c,s.set(n,h+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null),this}}class P2 extends Yi{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new qe(16777215),this.map=null,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.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const k2=new W,Q2=new W,O2=new tt,ag=new lu,Rd=new Ti;class og extends Zt{constructor(e=new Hn,t=new P2){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=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[0];for(let i=1,s=t.count;i<s;i++)k2.fromBufferAttribute(t,i-1),Q2.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=k2.distanceTo(Q2);e.setAttribute("lineDistance",new Ri(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,s=e.params.Line.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Rd.copy(n.boundingSphere),Rd.applyMatrix4(i),Rd.radius+=s,e.ray.intersectsSphere(Rd)===!1)return;O2.copy(i).invert(),ag.copy(e.ray).applyMatrix4(O2);const c=s/((this.scale.x+this.scale.y+this.scale.z)/3),h=c*c,u=new W,d=new W,A=new W,p=new W,g=this.isLineSegments?2:1,v=n.index,E=n.attributes.position;if(v!==null){const m=Math.max(0,o.start),_=Math.min(v.count,o.start+o.count);for(let w=m,x=_-1;w<x;w+=g){const I=v.getX(w),R=v.getX(w+1);if(u.fromBufferAttribute(E,I),d.fromBufferAttribute(E,R),ag.distanceSqToSegment(u,d,p,A)>h)continue;p.applyMatrix4(this.matrixWorld);const S=e.ray.origin.distanceTo(p);S<e.near||S>e.far||t.push({distance:S,point:A.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}else{const m=Math.max(0,o.start),_=Math.min(E.count,o.start+o.count);for(let w=m,x=_-1;w<x;w+=g){if(u.fromBufferAttribute(E,w),d.fromBufferAttribute(E,w+1),ag.distanceSqToSegment(u,d,p,A)>h)continue;p.applyMatrix4(this.matrixWorld);const I=e.ray.origin.distanceTo(p);I<e.near||I>e.far||t.push({distance:I,point:A.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,s=n.length;i<s;i++){const o=n[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=i}}}}}const F2=new W,z2=new W;class YL extends og{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[];for(let i=0,s=t.count;i<s;i+=2)F2.fromBufferAttribute(t,i),z2.fromBufferAttribute(t,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+F2.distanceTo(z2);e.setAttribute("lineDistance",new Ri(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class qL extends og{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class H2 extends Yi{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new qe(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const G2=new tt,lg=new lu,Dd=new Ti,Ld=new W;class XL extends Zt{constructor(e=new Hn,t=new H2){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,s=e.params.Points.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Dd.copy(n.boundingSphere),Dd.applyMatrix4(i),Dd.radius+=s,e.ray.intersectsSphere(Dd)===!1)return;G2.copy(i).invert(),lg.copy(e.ray).applyMatrix4(G2);const c=s/((this.scale.x+this.scale.y+this.scale.z)/3),h=c*c,u=n.index,d=n.attributes.position;if(u!==null){const A=Math.max(0,o.start),p=Math.min(u.count,o.start+o.count);for(let g=A,v=p;g<v;g++){const E=u.getX(g);Ld.fromBufferAttribute(d,E),V2(Ld,E,h,i,e,t,this)}}else{const A=Math.max(0,o.start),p=Math.min(d.count,o.start+o.count);for(let g=A,v=p;g<v;g++)Ld.fromBufferAttribute(d,g),V2(Ld,g,h,i,e,t,this)}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,s=n.length;i<s;i++){const o=n[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=i}}}}}function V2(r,e,t,n,i,s,o){const c=lg.distanceSqToPoint(r);if(c<t){const h=new W;lg.closestPointToPoint(r,h),h.applyMatrix4(n);const u=i.ray.origin.distanceTo(h);if(u<i.near||u>i.far)return;s.push({distance:u,distanceToRay:Math.sqrt(c),point:h,index:e,face:null,object:o})}}class Nd extends Sr{constructor(e,t,n,i,s,o,c,h,u,d,A,p){super(null,o,c,h,u,d,i,s,A,p),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class KL extends Nd{constructor(e,t,n,i,s,o){super(e,t,n,s,o),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=Ei}}class JL extends Nd{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,ro),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class ZL extends vn{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class cg extends Yi{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new qe(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new qe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=gE,this.normalScale=new Ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Wi,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Di extends cg{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Ge(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Mr(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new qe(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new qe(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new qe(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}function Ud(r,e,t){return!r||!t&&r.constructor===e?r:typeof e.BYTES_PER_ELEMENT=="number"?new e(r):Array.prototype.slice.call(r)}function $L(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function e8(r){function e(i,s){return r[i]-r[s]}const t=r.length,n=new Array(t);for(let i=0;i!==t;++i)n[i]=i;return n.sort(e),n}function j2(r,e,t){const n=r.length,i=new r.constructor(n);for(let s=0,o=0;o!==n;++s){const c=t[s]*e;for(let h=0;h!==e;++h)i[o++]=r[c+h]}return i}function W2(r,e,t,n){let i=1,s=r[0];for(;s!==void 0&&s[n]===void 0;)s=r[i++];if(s===void 0)return;let o=s[n];if(o!==void 0)if(Array.isArray(o))do o=s[n],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=r[i++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[n],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=r[i++];while(s!==void 0);else do o=s[n],o!==void 0&&(e.push(s.time),t.push(o)),s=r[i++];while(s!==void 0)}class mu{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,i=t[n],s=t[n-1];e:{t:{let o;r:{n:if(!(e<i)){for(let c=n+2;;){if(i===void 0){if(e<s)break n;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===c)break;if(s=i,i=t[++n],e<i)break t}o=t.length;break r}if(!(e>=s)){const c=t[1];e<c&&(n=2,s=c);for(let h=n-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===h)break;if(i=s,s=t[--n-1],e>=s)break t}o=n,n=0;break r}break e}for(;n<o;){const c=n+o>>>1;e<t[c]?o=c:n=c+1}if(i=t[n],s=t[n-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,s,i)}return this.interpolate_(n,s,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i;for(let o=0;o!==i;++o)t[o]=n[s+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class t8 extends mu{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:dE,endingEnd:dE}}intervalChanged_(e,t,n){const i=this.parameterPositions;let s=e-2,o=e+1,c=i[s],h=i[o];if(c===void 0)switch(this.getSettings_().endingStart){case fE:s=e,c=2*t-n;break;case pE:s=i.length-2,c=t+i[s]-i[s+1];break;default:s=e,c=n}if(h===void 0)switch(this.getSettings_().endingEnd){case fE:o=e,h=2*n-t;break;case pE:o=1,h=n+i[1]-i[0];break;default:o=e-1,h=t}const u=(n-t)*.5,d=this.valueSize;this._weightPrev=u/(t-c),this._weightNext=u/(h-n),this._offsetPrev=s*d,this._offsetNext=o*d}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,c=this.valueSize,h=e*c,u=h-c,d=this._offsetPrev,A=this._offsetNext,p=this._weightPrev,g=this._weightNext,v=(n-t)/(i-t),E=v*v,m=E*v,_=-p*m+2*p*E-p*v,w=(1+p)*m+(-1.5-2*p)*E+(-.5+p)*v+1,x=(-1-g)*m+(1.5+g)*E+.5*v,I=g*m-g*E;for(let R=0;R!==c;++R)s[R]=_*o[d+R]+w*o[u+R]+x*o[h+R]+I*o[A+R];return s}}class r8 extends mu{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,c=this.valueSize,h=e*c,u=h-c,d=(n-t)/(i-t),A=1-d;for(let p=0;p!==c;++p)s[p]=o[u+p]*A+o[h+p]*d;return s}}class n8 extends mu{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class Ki{constructor(e,t,n,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Ud(t,this.TimeBufferType),this.values=Ud(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Ud(e.times,Array),values:Ud(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new n8(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new r8(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new t8(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case tu:t=this.InterpolantFactoryMethodDiscrete;break;case nl:t=this.InterpolantFactoryMethodLinear;break;case EA:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return tu;case this.InterpolantFactoryMethodLinear:return nl;case this.InterpolantFactoryMethodSmooth:return EA}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e}return this}trim(e,t){const n=this.times,i=n.length;let s=0,o=i-1;for(;s!==i&&n[s]<e;)++s;for(;o!==-1&&n[o]>t;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);const c=this.getValueSize();this.times=n.slice(s,o),this.values=this.values.slice(s*c,o*c)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let c=0;c!==s;c++){const h=n[c];if(typeof h=="number"&&isNaN(h)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,c,h),e=!1;break}if(o!==null&&o>h){console.error("THREE.KeyframeTrack: Out of order keys.",this,c,h,o),e=!1;break}o=h}if(i!==void 0&&$L(i))for(let c=0,h=i.length;c!==h;++c){const u=i[c];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,c,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===EA,s=e.length-1;let o=1;for(let c=1;c<s;++c){let h=!1;const u=e[c],d=e[c+1];if(u!==d&&(c!==1||u!==e[0]))if(i)h=!0;else{const A=c*n,p=A-n,g=A+n;for(let v=0;v!==n;++v){const E=t[A+v];if(E!==t[p+v]||E!==t[g+v]){h=!0;break}}}if(h){if(c!==o){e[o]=e[c];const A=c*n,p=o*n;for(let g=0;g!==n;++g)t[p+g]=t[A+g]}++o}}if(s>0){e[o]=e[s];for(let c=s*n,h=o*n,u=0;u!==n;++u)t[h+u]=t[c+u];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}Ki.prototype.TimeBufferType=Float32Array,Ki.prototype.ValueBufferType=Float32Array,Ki.prototype.DefaultInterpolation=nl;class Sl extends Ki{}Sl.prototype.ValueTypeName="bool",Sl.prototype.ValueBufferType=Array,Sl.prototype.DefaultInterpolation=tu,Sl.prototype.InterpolantFactoryMethodLinear=void 0,Sl.prototype.InterpolantFactoryMethodSmooth=void 0;class Y2 extends Ki{}Y2.prototype.ValueTypeName="color";class Tl extends Ki{}Tl.prototype.ValueTypeName="number";class i8 extends mu{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,c=this.valueSize,h=(n-t)/(i-t);let u=e*c;for(let d=u+c;u!==d;u+=4)ji.slerpFlat(s,0,o,u-c,o,u,h);return s}}class Ao extends Ki{InterpolantFactoryMethodLinear(e){return new i8(this.times,this.values,this.getValueSize(),e)}}Ao.prototype.ValueTypeName="quaternion",Ao.prototype.DefaultInterpolation=nl,Ao.prototype.InterpolantFactoryMethodSmooth=void 0;class Bl extends Ki{}Bl.prototype.ValueTypeName="string",Bl.prototype.ValueBufferType=Array,Bl.prototype.DefaultInterpolation=tu,Bl.prototype.InterpolantFactoryMethodLinear=void 0,Bl.prototype.InterpolantFactoryMethodSmooth=void 0;class bl extends Ki{}bl.prototype.ValueTypeName="vector";class s8{constructor(e="",t=-1,n=[],i=nb){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=Ii(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,c=n.length;o!==c;++o)t.push(o8(n[o]).scale(i));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=n.length;s!==o;++s)t.push(Ki.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const s=t.length,o=[];for(let c=0;c<s;c++){let h=[],u=[];h.push((c+s-1)%s,c,(c+1)%s),u.push(0,1,0);const d=e8(h);h=j2(h,1,d),u=j2(u,1,d),!i&&h[0]===0&&(h.push(s),u.push(u[0])),o.push(new Tl(".morphTargetInfluences["+t[c].name+"]",h,u).scale(1/n))}return new this(e,-1,o)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const i=e;n=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const i={},s=/^([\w-]*?)([\d]+)$/;for(let c=0,h=e.length;c<h;c++){const u=e[c],d=u.name.match(s);if(d&&d.length>1){const A=d[1];let p=i[A];p||(i[A]=p=[]),p.push(u)}}const o=[];for(const c in i)o.push(this.CreateFromMorphTargetSequence(c,i[c],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(d,A,p,g,v){if(p.length!==0){const E=[],m=[];W2(p,E,m,g),E.length!==0&&v.push(new d(A,E,m))}},i=[],s=e.name||"default",o=e.fps||30,c=e.blendMode;let h=e.length||-1;const u=e.hierarchy||[];for(let d=0;d<u.length;d++){const A=u[d].keys;if(!(!A||A.length===0))if(A[0].morphTargets){const p={};let g;for(g=0;g<A.length;g++)if(A[g].morphTargets)for(let v=0;v<A[g].morphTargets.length;v++)p[A[g].morphTargets[v]]=-1;for(const v in p){const E=[],m=[];for(let _=0;_!==A[g].morphTargets.length;++_){const w=A[g];E.push(w.time),m.push(w.morphTarget===v?1:0)}i.push(new Tl(".morphTargetInfluence["+v+"]",E,m))}h=p.length*o}else{const p=".bones["+t[d].name+"]";n(bl,p+".position",A,"pos",i),n(Ao,p+".quaternion",A,"rot",i),n(bl,p+".scale",A,"scl",i)}}return i.length===0?null:new this(s,h,i,c)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,i=e.length;n!==i;++n){const s=this.tracks[n];t=Math.max(t,s.times[s.times.length-1])}return this.duration=t,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(){const 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 a8(r){switch(r.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Tl;case"vector":case"vector2":case"vector3":case"vector4":return bl;case"color":return Y2;case"quaternion":return Ao;case"bool":case"boolean":return Sl;case"string":return Bl}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+r)}function o8(r){if(r.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=a8(r.type);if(r.times===void 0){const t=[],n=[];W2(r.keys,t,n,"value"),r.times=t,r.values=n}return e.parse!==void 0?e.parse(r):new e(r.name,r.times,r.values,r.interpolation)}const oa={enabled:!1,files:{},add:function(r,e){this.enabled!==!1&&(this.files[r]=e)},get:function(r){if(this.enabled!==!1)return this.files[r]},remove:function(r){delete this.files[r]},clear:function(){this.files={}}};class q2{constructor(e,t,n){const i=this;let s=!1,o=0,c=0,h;const u=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(d){c++,s===!1&&i.onStart!==void 0&&i.onStart(d,o,c),s=!0},this.itemEnd=function(d){o++,i.onProgress!==void 0&&i.onProgress(d,o,c),o===c&&(s=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(d){i.onError!==void 0&&i.onError(d)},this.resolveURL=function(d){return h?h(d):d},this.setURLModifier=function(d){return h=d,this},this.addHandler=function(d,A){return u.push(d,A),this},this.removeHandler=function(d){const A=u.indexOf(d);return A!==-1&&u.splice(A,2),this},this.getHandler=function(d){for(let A=0,p=u.length;A<p;A+=2){const g=u[A],v=u[A+1];if(g.global&&(g.lastIndex=0),g.test(d))return v}return null}}}const l8=new q2;class la{constructor(e){this.manager=e!==void 0?e:l8,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(i,s){n.load(e,i,t,s)})}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}}la.DEFAULT_MATERIAL_NAME="__DEFAULT";const ws={};class c8 extends Error{constructor(e,t){super(e),this.response=t}}class Rl extends la{constructor(e){super(e)}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=oa.get(e);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(s),this.manager.itemEnd(e)},0),s;if(ws[e]!==void 0){ws[e].push({onLoad:t,onProgress:n,onError:i});return}ws[e]=[],ws[e].push({onLoad:t,onProgress:n,onError:i});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),c=this.mimeType,h=this.responseType;fetch(o).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||u.body===void 0||u.body.getReader===void 0)return u;const d=ws[e],A=u.body.getReader(),p=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),g=p?parseInt(p):0,v=g!==0;let E=0;const m=new ReadableStream({start(_){w();function w(){A.read().then(({done:x,value:I})=>{if(x)_.close();else{E+=I.byteLength;const R=new ProgressEvent("progress",{lengthComputable:v,loaded:E,total:g});for(let S=0,T=d.length;S<T;S++){const D=d[S];D.onProgress&&D.onProgress(R)}_.enqueue(I),w()}})}}});return new Response(m)}else throw new c8(`fetch for "${u.url}" responded with ${u.status}: ${u.statusText}`,u)}).then(u=>{switch(h){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(d=>new DOMParser().parseFromString(d,c));case"json":return u.json();default:if(c===void 0)return u.text();{const d=/charset="?([^;"\s]*)"?/i.exec(c),A=d&&d[1]?d[1].toLowerCase():void 0,p=new TextDecoder(A);return u.arrayBuffer().then(g=>p.decode(g))}}}).then(u=>{oa.add(e,u);const d=ws[e];delete ws[e];for(let A=0,p=d.length;A<p;A++){const g=d[A];g.onLoad&&g.onLoad(u)}}).catch(u=>{const d=ws[e];if(d===void 0)throw this.manager.itemError(e),u;delete ws[e];for(let A=0,p=d.length;A<p;A++){const g=d[A];g.onError&&g.onError(u)}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}}class u8 extends la{constructor(e){super(e)}load(e,t,n,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=oa.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const c=su("img");function h(){d(),oa.add(e,this),t&&t(this),s.manager.itemEnd(e)}function u(A){d(),i&&i(A),s.manager.itemError(e),s.manager.itemEnd(e)}function d(){c.removeEventListener("load",h,!1),c.removeEventListener("error",u,!1)}return c.addEventListener("load",h,!1),c.addEventListener("error",u,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(c.crossOrigin=this.crossOrigin),s.manager.itemStart(e),c.src=e,c}}class h8 extends la{constructor(e){super(e)}load(e,t,n,i){const s=this,o=new po,c=new Rl(this.manager);return c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(s.withCredentials),c.load(e,function(h){let u;try{u=s.parse(h)}catch(d){if(i!==void 0)i(d);else{console.error(d);return}}u.image!==void 0?o.image=u.image:u.data!==void 0&&(o.image.width=u.width,o.image.height=u.height,o.image.data=u.data),o.wrapS=u.wrapS!==void 0?u.wrapS:Ei,o.wrapT=u.wrapT!==void 0?u.wrapT:Ei,o.magFilter=u.magFilter!==void 0?u.magFilter:fr,o.minFilter=u.minFilter!==void 0?u.minFilter:fr,o.anisotropy=u.anisotropy!==void 0?u.anisotropy:1,u.colorSpace!==void 0&&(o.colorSpace=u.colorSpace),u.flipY!==void 0&&(o.flipY=u.flipY),u.format!==void 0&&(o.format=u.format),u.type!==void 0&&(o.type=u.type),u.mipmaps!==void 0&&(o.mipmaps=u.mipmaps,o.minFilter=xi),u.mipmapCount===1&&(o.minFilter=fr),u.generateMipmaps!==void 0&&(o.generateMipmaps=u.generateMipmaps),o.needsUpdate=!0,t&&t(o,u)},n,i),o}}class X2 extends la{constructor(e){super(e)}load(e,t,n,i){const s=new Sr,o=new u8(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(c){s.image=c,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}}class Pd extends Zt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new qe(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){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}class d8 extends Pd{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Zt.DEFAULT_UP),this.updateMatrix(),this.groundColor=new qe(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const ug=new tt,K2=new W,J2=new W;class hg{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ge(512,512),this.map=null,this.mapPass=null,this.matrix=new tt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new jA,this._frameExtents=new Ge(1,1),this._viewportCount=1,this._viewports=[new Ft(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;K2.setFromMatrixPosition(e.matrixWorld),t.position.copy(K2),J2.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(J2),t.updateMatrixWorld(),ug.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ug),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(ug)}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(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class f8 extends hg{constructor(){super(new cn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=sl*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(n!==t.fov||i!==t.aspect||s!==t.far)&&(t.fov=n,t.aspect=i,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class p8 extends Pd{constructor(e,t,n=0,i=Math.PI/3,s=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Zt.DEFAULT_UP),this.updateMatrix(),this.target=new Zt,this.distance=n,this.angle=i,this.penumbra=s,this.decay=o,this.map=null,this.shadow=new f8}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}}const Z2=new tt,_u=new W,dg=new W;class A8 extends hg{constructor(){super(new cn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Ge(4,2),this._viewportCount=6,this._viewports=[new Ft(2,1,1,1),new Ft(0,1,1,1),new Ft(3,1,1,1),new Ft(1,1,1,1),new Ft(3,0,1,1),new Ft(1,0,1,1)],this._cubeDirections=[new W(1,0,0),new W(-1,0,0),new W(0,0,1),new W(0,0,-1),new W(0,1,0),new W(0,-1,0)],this._cubeUps=[new W(0,1,0),new W(0,1,0),new W(0,1,0),new W(0,1,0),new W(0,0,1),new W(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,i=this.matrix,s=e.distance||n.far;s!==n.far&&(n.far=s,n.updateProjectionMatrix()),_u.setFromMatrixPosition(e.matrixWorld),n.position.copy(_u),dg.copy(n.position),dg.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(dg),n.updateMatrixWorld(),i.makeTranslation(-_u.x,-_u.y,-_u.z),Z2.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Z2)}}class g8 extends Pd{constructor(e,t,n=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new A8}get power(){return this.intensity*4*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}}class m8 extends hg{constructor(){super(new fu(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class $2 extends Pd{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Zt.DEFAULT_UP),this.updateMatrix(),this.target=new Zt,this.shadow=new m8}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class vu{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class _8 extends la{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=oa.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(u=>{t&&t(u),s.manager.itemEnd(e)}).catch(u=>{i&&i(u)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const c={};c.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",c.headers=this.requestHeader;const h=fetch(e,c).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(u){return oa.add(e,u),t&&t(u),s.manager.itemEnd(e),u}).catch(function(u){i&&i(u),oa.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});oa.add(e,h),s.manager.itemStart(e)}}class v8{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=ex(),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){const t=ex();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function ex(){return(typeof performance>"u"?Date:performance).now()}const fg="\\[\\]\\.:\\/",y8=new RegExp("["+fg+"]","g"),pg="[^"+fg+"]",E8="[^"+fg.replace("\\.","")+"]",x8=/((?:WC+[\/:])*)/.source.replace("WC",pg),w8=/(WCOD+)?/.source.replace("WCOD",E8),I8=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",pg),C8=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",pg),M8=new RegExp("^"+x8+w8+I8+C8+"$"),S8=["material","materials","bones","map"];class T8{constructor(e,t,n){const i=n||Ut.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class Ut{constructor(e,t,n){this.path=t,this.parsedPath=n||Ut.parseTrackName(t),this.node=Ut.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new Ut.Composite(e,t,n):new Ut(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(y8,"")}static parseTrackName(e){const t=M8.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const s=n.nodeName.substring(i+1);S8.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(s){for(let o=0;o<s.length;o++){const c=s[o];if(c.name===t||c.uuid===t)return c;const h=n(c.children);if(h)return h}return null},i=n(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)e[t++]=n[i]}_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){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=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;const t=this.parsedPath,n=t.objectName,i=t.propertyName;let s=t.propertyIndex;if(e||(e=Ut.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let u=t.objectIndex;switch(n){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let d=0;d<e.length;d++)if(e[d].name===u){u=d;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(u!==void 0){if(e[u]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[u]}}const o=e[i];if(o===void 0){const u=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+i+" but it wasn't found.",e);return}let c=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?c=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(c=this.Versioning.MatrixWorldNeedsUpdate);let h=this.BindingType.Direct;if(s!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[s]!==void 0&&(s=e.morphTargetDictionary[s])}h=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(h=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(h=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[h],this.setValue=this.SetterByBindingTypeAndVersioning[h][c]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Ut.Composite=T8,Ut.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Ut.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Ut.prototype.GetterByBindingType=[Ut.prototype._getValue_direct,Ut.prototype._getValue_array,Ut.prototype._getValue_arrayElement,Ut.prototype._getValue_toArray],Ut.prototype.SetterByBindingTypeAndVersioning=[[Ut.prototype._setValue_direct,Ut.prototype._setValue_direct_setNeedsUpdate,Ut.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Ut.prototype._setValue_array,Ut.prototype._setValue_array_setNeedsUpdate,Ut.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Ut.prototype._setValue_arrayElement,Ut.prototype._setValue_arrayElement_setNeedsUpdate,Ut.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Ut.prototype._setValue_fromArray,Ut.prototype._setValue_fromArray_setNeedsUpdate,Ut.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class tx{constructor(e=1,t=0,n=0){return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,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,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Mr(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const rx=new W,kd=new W;class Is{constructor(e=new W,t=new W){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){rx.subVectors(e,this.start),kd.subVectors(this.end,this.start);const n=kd.dot(kd);let i=kd.dot(rx)/n;return t&&(i=Mr(i,0,1)),i}closestPointToPoint(e,t,n){const i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).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)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Gh}})),typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Gh);const nx={type:"change"},Ag={type:"start"},ix={type:"end"},Qd=new lu,sx=new qi,B8=Math.cos(70*CA.DEG2RAD);class b8 extends io{constructor(e,t){super(),this.object=e,this.domElement=t,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new W,this.cursor=new W,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Zo.ROTATE,MIDDLE:Zo.DOLLY,RIGHT:Zo.PAN},this.touches={ONE:$o.ROTATE,TWO:$o.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return c.phi},this.getAzimuthalAngle=function(){return c.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(G){G.addEventListener("keydown",Se),this._domElementKeyEvents=G},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",Se),this._domElementKeyEvents=null},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(nx),n.update(),s=i.NONE},this.update=function(){const G=new W,O=new ji().setFromUnitVectors(e.up,new W(0,1,0)),me=O.clone().invert(),_e=new W,Fe=new ji,De=new W,pt=2*Math.PI;return function(Dt=null){const Lt=n.object.position;G.copy(Lt).sub(n.target),G.applyQuaternion(O),c.setFromVector3(G),n.autoRotate&&s===i.NONE&&P(M(Dt)),n.enableDamping?(c.theta+=h.theta*n.dampingFactor,c.phi+=h.phi*n.dampingFactor):(c.theta+=h.theta,c.phi+=h.phi);let St=n.minAzimuthAngle,At=n.maxAzimuthAngle;isFinite(St)&&isFinite(At)&&(St<-Math.PI?St+=pt:St>Math.PI&&(St-=pt),At<-Math.PI?At+=pt:At>Math.PI&&(At-=pt),St<=At?c.theta=Math.max(St,Math.min(At,c.theta)):c.theta=c.theta>(St+At)/2?Math.max(St,c.theta):Math.min(At,c.theta)),c.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,c.phi)),c.makeSafe(),n.enableDamping===!0?n.target.addScaledVector(d,n.dampingFactor):n.target.add(d),n.target.sub(n.cursor),n.target.clampLength(n.minTargetRadius,n.maxTargetRadius),n.target.add(n.cursor);let ur=!1;if(n.zoomToCursor&&S||n.object.isOrthographicCamera)c.radius=Q(c.radius);else{const Vt=c.radius;c.radius=Q(c.radius*u),ur=Vt!=c.radius}if(G.setFromSpherical(c),G.applyQuaternion(me),Lt.copy(n.target).add(G),n.object.lookAt(n.target),n.enableDamping===!0?(h.theta*=1-n.dampingFactor,h.phi*=1-n.dampingFactor,d.multiplyScalar(1-n.dampingFactor)):(h.set(0,0,0),d.set(0,0,0)),n.zoomToCursor&&S){let Vt=null;if(n.object.isPerspectiveCamera){const mr=G.length();Vt=Q(mr*u);const Bn=mr-Vt;n.object.position.addScaledVector(I,Bn),n.object.updateMatrixWorld(),ur=!!Bn}else if(n.object.isOrthographicCamera){const mr=new W(R.x,R.y,0);mr.unproject(n.object);const Bn=n.object.zoom;n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/u)),n.object.updateProjectionMatrix(),ur=Bn!==n.object.zoom;const qt=new W(R.x,R.y,0);qt.unproject(n.object),n.object.position.sub(qt).add(mr),n.object.updateMatrixWorld(),Vt=G.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;Vt!==null&&(this.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(Vt).add(n.object.position):(Qd.origin.copy(n.object.position),Qd.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(Qd.direction))<B8?e.lookAt(n.target):(sx.setFromNormalAndCoplanarPoint(n.object.up,n.target),Qd.intersectPlane(sx,n.target))))}else if(n.object.isOrthographicCamera){const Vt=n.object.zoom;n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/u)),Vt!==n.object.zoom&&(n.object.updateProjectionMatrix(),ur=!0)}return u=1,S=!1,ur||_e.distanceToSquared(n.object.position)>o||8*(1-Fe.dot(n.object.quaternion))>o||De.distanceToSquared(n.target)>o?(n.dispatchEvent(nx),_e.copy(n.object.position),Fe.copy(n.object.quaternion),De.copy(n.target),!0):!1}}(),this.dispose=function(){n.domElement.removeEventListener("contextmenu",Re),n.domElement.removeEventListener("pointerdown",ee),n.domElement.removeEventListener("pointercancel",pe),n.domElement.removeEventListener("wheel",Ee),n.domElement.removeEventListener("pointermove",ue),n.domElement.removeEventListener("pointerup",pe),n.domElement.getRootNode().removeEventListener("keydown",He,{capture:!0}),n._domElementKeyEvents!==null&&(n._domElementKeyEvents.removeEventListener("keydown",Se),n._domElementKeyEvents=null)};const n=this,i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let s=i.NONE;const o=1e-6,c=new tx,h=new tx;let u=1;const d=new W,A=new Ge,p=new Ge,g=new Ge,v=new Ge,E=new Ge,m=new Ge,_=new Ge,w=new Ge,x=new Ge,I=new W,R=new Ge;let S=!1;const T=[],D={};let b=!1;function M(G){return G!==null?2*Math.PI/60*n.autoRotateSpeed*G:2*Math.PI/60/60*n.autoRotateSpeed}function L(G){const O=Math.abs(G*.01);return Math.pow(.95,n.zoomSpeed*O)}function P(G){h.theta-=G}function N(G){h.phi-=G}const j=function(){const G=new W;return function(O,me){G.setFromMatrixColumn(me,0),G.multiplyScalar(-O),d.add(G)}}(),X=function(){const G=new W;return function(O,me){n.screenSpacePanning===!0?G.setFromMatrixColumn(me,1):(G.setFromMatrixColumn(me,0),G.crossVectors(n.object.up,G)),G.multiplyScalar(O),d.add(G)}}(),K=function(){const G=new W;return function(O,me){const _e=n.domElement;if(n.object.isPerspectiveCamera){const Fe=n.object.position;G.copy(Fe).sub(n.target);let De=G.length();De*=Math.tan(n.object.fov/2*Math.PI/180),j(2*O*De/_e.clientHeight,n.object.matrix),X(2*me*De/_e.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(j(O*(n.object.right-n.object.left)/n.object.zoom/_e.clientWidth,n.object.matrix),X(me*(n.object.top-n.object.bottom)/n.object.zoom/_e.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function ne(G){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?u/=G:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function V(G){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?u*=G:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function te(G,O){if(!n.zoomToCursor)return;S=!0;const me=n.domElement.getBoundingClientRect(),_e=G-me.left,Fe=O-me.top,De=me.width,pt=me.height;R.x=_e/De*2-1,R.y=-(Fe/pt)*2+1,I.set(R.x,R.y,1).unproject(n.object).sub(n.object.position).normalize()}function Q(G){return Math.max(n.minDistance,Math.min(n.maxDistance,G))}function z(G){A.set(G.clientX,G.clientY)}function Z(G){te(G.clientX,G.clientX),_.set(G.clientX,G.clientY)}function re(G){v.set(G.clientX,G.clientY)}function H(G){p.set(G.clientX,G.clientY),g.subVectors(p,A).multiplyScalar(n.rotateSpeed);const O=n.domElement;P(2*Math.PI*g.x/O.clientHeight),N(2*Math.PI*g.y/O.clientHeight),A.copy(p),n.update()}function fe(G){w.set(G.clientX,G.clientY),x.subVectors(w,_),x.y>0?ne(L(x.y)):x.y<0&&V(L(x.y)),_.copy(w),n.update()}function Ae(G){E.set(G.clientX,G.clientY),m.subVectors(E,v).multiplyScalar(n.panSpeed),K(m.x,m.y),v.copy(E),n.update()}function ve(G){te(G.clientX,G.clientY),G.deltaY<0?V(L(G.deltaY)):G.deltaY>0&&ne(L(G.deltaY)),n.update()}function ye(G){let O=!1;switch(G.code){case n.keys.UP:G.ctrlKey||G.metaKey||G.shiftKey?N(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(0,n.keyPanSpeed),O=!0;break;case n.keys.BOTTOM:G.ctrlKey||G.metaKey||G.shiftKey?N(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(0,-n.keyPanSpeed),O=!0;break;case n.keys.LEFT:G.ctrlKey||G.metaKey||G.shiftKey?P(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(n.keyPanSpeed,0),O=!0;break;case n.keys.RIGHT:G.ctrlKey||G.metaKey||G.shiftKey?P(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(-n.keyPanSpeed,0),O=!0;break}O&&(G.preventDefault(),n.update())}function Oe(G){if(T.length===1)A.set(G.pageX,G.pageY);else{const O=Et(G),me=.5*(G.pageX+O.x),_e=.5*(G.pageY+O.y);A.set(me,_e)}}function it(G){if(T.length===1)v.set(G.pageX,G.pageY);else{const O=Et(G),me=.5*(G.pageX+O.x),_e=.5*(G.pageY+O.y);v.set(me,_e)}}function ae(G){const O=Et(G),me=G.pageX-O.x,_e=G.pageY-O.y,Fe=Math.sqrt(me*me+_e*_e);_.set(0,Fe)}function rt(G){n.enableZoom&&ae(G),n.enablePan&&it(G)}function Pe(G){n.enableZoom&&ae(G),n.enableRotate&&Oe(G)}function lt(G){if(T.length==1)p.set(G.pageX,G.pageY);else{const me=Et(G),_e=.5*(G.pageX+me.x),Fe=.5*(G.pageY+me.y);p.set(_e,Fe)}g.subVectors(p,A).multiplyScalar(n.rotateSpeed);const O=n.domElement;P(2*Math.PI*g.x/O.clientHeight),N(2*Math.PI*g.y/O.clientHeight),A.copy(p)}function Ye(G){if(T.length===1)E.set(G.pageX,G.pageY);else{const O=Et(G),me=.5*(G.pageX+O.x),_e=.5*(G.pageY+O.y);E.set(me,_e)}m.subVectors(E,v).multiplyScalar(n.panSpeed),K(m.x,m.y),v.copy(E)}function ct(G){const O=Et(G),me=G.pageX-O.x,_e=G.pageY-O.y,Fe=Math.sqrt(me*me+_e*_e);w.set(0,Fe),x.set(0,Math.pow(w.y/_.y,n.zoomSpeed)),ne(x.y),_.copy(w);const De=(G.pageX+O.x)*.5,pt=(G.pageY+O.y)*.5;te(De,pt)}function Y(G){n.enableZoom&&ct(G),n.enablePan&&Ye(G)}function k(G){n.enableZoom&&ct(G),n.enableRotate&&lt(G)}function ee(G){n.enabled!==!1&&(T.length===0&&(n.domElement.setPointerCapture(G.pointerId),n.domElement.addEventListener("pointermove",ue),n.domElement.addEventListener("pointerup",pe)),!yt(G)&&(at(G),G.pointerType==="touch"?Ze(G):ge(G)))}function ue(G){n.enabled!==!1&&(G.pointerType==="touch"?Ne(G):Ue(G))}function pe(G){switch(ft(G),T.length){case 0:n.domElement.releasePointerCapture(G.pointerId),n.domElement.removeEventListener("pointermove",ue),n.domElement.removeEventListener("pointerup",pe),n.dispatchEvent(ix),s=i.NONE;break;case 1:const O=T[0],me=D[O];Ze({pointerId:O,pageX:me.x,pageY:me.y});break}}function ge(G){let O;switch(G.button){case 0:O=n.mouseButtons.LEFT;break;case 1:O=n.mouseButtons.MIDDLE;break;case 2:O=n.mouseButtons.RIGHT;break;default:O=-1}switch(O){case Zo.DOLLY:if(n.enableZoom===!1)return;Z(G),s=i.DOLLY;break;case Zo.ROTATE:if(G.ctrlKey||G.metaKey||G.shiftKey){if(n.enablePan===!1)return;re(G),s=i.PAN}else{if(n.enableRotate===!1)return;z(G),s=i.ROTATE}break;case Zo.PAN:if(G.ctrlKey||G.metaKey||G.shiftKey){if(n.enableRotate===!1)return;z(G),s=i.ROTATE}else{if(n.enablePan===!1)return;re(G),s=i.PAN}break;default:s=i.NONE}s!==i.NONE&&n.dispatchEvent(Ag)}function Ue(G){switch(s){case i.ROTATE:if(n.enableRotate===!1)return;H(G);break;case i.DOLLY:if(n.enableZoom===!1)return;fe(G);break;case i.PAN:if(n.enablePan===!1)return;Ae(G);break}}function Ee(G){n.enabled===!1||n.enableZoom===!1||s!==i.NONE||(G.preventDefault(),n.dispatchEvent(Ag),ve(Qe(G)),n.dispatchEvent(ix))}function Qe(G){const O=G.deltaMode,me={clientX:G.clientX,clientY:G.clientY,deltaY:G.deltaY};switch(O){case 1:me.deltaY*=16;break;case 2:me.deltaY*=100;break}return G.ctrlKey&&!b&&(me.deltaY*=10),me}function He(G){G.key==="Control"&&(b=!0,n.domElement.getRootNode().addEventListener("keyup",Ce,{passive:!0,capture:!0}))}function Ce(G){G.key==="Control"&&(b=!1,n.domElement.getRootNode().removeEventListener("keyup",Ce,{passive:!0,capture:!0}))}function Se(G){n.enabled===!1||n.enablePan===!1||ye(G)}function Ze(G){switch(_t(G),T.length){case 1:switch(n.touches.ONE){case $o.ROTATE:if(n.enableRotate===!1)return;Oe(G),s=i.TOUCH_ROTATE;break;case $o.PAN:if(n.enablePan===!1)return;it(G),s=i.TOUCH_PAN;break;default:s=i.NONE}break;case 2:switch(n.touches.TWO){case $o.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;rt(G),s=i.TOUCH_DOLLY_PAN;break;case $o.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;Pe(G),s=i.TOUCH_DOLLY_ROTATE;break;default:s=i.NONE}break;default:s=i.NONE}s!==i.NONE&&n.dispatchEvent(Ag)}function Ne(G){switch(_t(G),s){case i.TOUCH_ROTATE:if(n.enableRotate===!1)return;lt(G),n.update();break;case i.TOUCH_PAN:if(n.enablePan===!1)return;Ye(G),n.update();break;case i.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Y(G),n.update();break;case i.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;k(G),n.update();break;default:s=i.NONE}}function Re(G){n.enabled!==!1&&G.preventDefault()}function at(G){T.push(G.pointerId)}function ft(G){delete D[G.pointerId];for(let O=0;O<T.length;O++)if(T[O]==G.pointerId){T.splice(O,1);return}}function yt(G){for(let O=0;O<T.length;O++)if(T[O]==G.pointerId)return!0;return!1}function _t(G){let O=D[G.pointerId];O===void 0&&(O=new Ge,D[G.pointerId]=O),O.set(G.pageX,G.pageY)}function Et(G){const O=G.pointerId===T[0]?T[1]:T[0];return D[O]}n.domElement.addEventListener("contextmenu",Re),n.domElement.addEventListener("pointerdown",ee),n.domElement.addEventListener("pointercancel",pe),n.domElement.addEventListener("wheel",Ee,{passive:!1}),n.domElement.getRootNode().addEventListener("keydown",He,{passive:!0,capture:!0}),this.update()}}function ax(r,e){if(e===ib)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),r;if(e===xA||e===AE){let t=r.getIndex();if(t===null){const o=[],c=r.getAttribute("position");if(c!==void 0){for(let h=0;h<c.count;h++)o.push(h);r.setIndex(o),t=r.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),r}const n=t.count-2,i=[];if(e===xA)for(let o=1;o<=n;o++)i.push(t.getX(0)),i.push(t.getX(o)),i.push(t.getX(o+1));else for(let o=0;o<n;o++)o%2===0?(i.push(t.getX(o)),i.push(t.getX(o+1)),i.push(t.getX(o+2))):(i.push(t.getX(o+2)),i.push(t.getX(o+1)),i.push(t.getX(o)));i.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=r.clone();return s.setIndex(i),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),r}class R8 extends la{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new P8(t)}),this.register(function(t){return new j8(t)}),this.register(function(t){return new W8(t)}),this.register(function(t){return new Y8(t)}),this.register(function(t){return new Q8(t)}),this.register(function(t){return new O8(t)}),this.register(function(t){return new F8(t)}),this.register(function(t){return new z8(t)}),this.register(function(t){return new U8(t)}),this.register(function(t){return new H8(t)}),this.register(function(t){return new k8(t)}),this.register(function(t){return new V8(t)}),this.register(function(t){return new G8(t)}),this.register(function(t){return new L8(t)}),this.register(function(t){return new q8(t)}),this.register(function(t){return new X8(t)})}load(e,t,n,i){const s=this;let o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){const u=vu.extractUrlBase(e);o=vu.resolveURL(u,this.path)}else o=vu.extractUrlBase(e);this.manager.itemStart(e);const c=function(u){i?i(u):console.error(u),s.manager.itemError(e),s.manager.itemEnd(e)},h=new Rl(this.manager);h.setPath(this.path),h.setResponseType("arraybuffer"),h.setRequestHeader(this.requestHeader),h.setWithCredentials(this.withCredentials),h.load(e,function(u){try{s.parse(u,o,function(d){t(d),s.manager.itemEnd(e)},c)}catch(d){c(d)}},n,c)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let s;const o={},c={},h=new TextDecoder;if(typeof e=="string")s=JSON.parse(e);else if(e instanceof ArrayBuffer)if(h.decode(new Uint8Array(e,0,4))===ox){try{o[xt.KHR_BINARY_GLTF]=new K8(e)}catch(d){i&&i(d);return}s=JSON.parse(o[xt.KHR_BINARY_GLTF].content)}else s=JSON.parse(h.decode(e));else s=e;if(s.asset===void 0||s.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const u=new cN(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});u.fileLoader.setRequestHeader(this.requestHeader);for(let d=0;d<this.pluginCallbacks.length;d++){const A=this.pluginCallbacks[d](u);A.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),c[A.name]=A,o[A.name]=!0}if(s.extensionsUsed)for(let d=0;d<s.extensionsUsed.length;++d){const A=s.extensionsUsed[d],p=s.extensionsRequired||[];switch(A){case xt.KHR_MATERIALS_UNLIT:o[A]=new N8;break;case xt.KHR_DRACO_MESH_COMPRESSION:o[A]=new J8(s,this.dracoLoader);break;case xt.KHR_TEXTURE_TRANSFORM:o[A]=new Z8;break;case xt.KHR_MESH_QUANTIZATION:o[A]=new $8;break;default:p.indexOf(A)>=0&&c[A]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+A+'".')}}u.setExtensions(o),u.setPlugins(c),u.parse(n,i)}parseAsync(e,t){const n=this;return new Promise(function(i,s){n.parse(e,t,i,s)})}}function D8(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}const xt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class L8{constructor(e){this.parser=e,this.name=xt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n<i;n++){const s=t[n];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let i=t.cache.get(n);if(i)return i;const s=t.json,o=((s.extensions&&s.extensions[this.name]||{}).lights||[])[e];let c;const h=new qe(16777215);o.color!==void 0&&h.setRGB(o.color[0],o.color[1],o.color[2],Cr);const u=o.range!==void 0?o.range:0;switch(o.type){case"directional":c=new $2(h),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new g8(h),c.distance=u;break;case"spot":c=new p8(h),c.distance=u,o.spot=o.spot||{},o.spot.innerConeAngle=o.spot.innerConeAngle!==void 0?o.spot.innerConeAngle:0,o.spot.outerConeAngle=o.spot.outerConeAngle!==void 0?o.spot.outerConeAngle:Math.PI/4,c.angle=o.spot.outerConeAngle,c.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return c.position.set(0,0,0),c.decay=2,ua(c,o),o.intensity!==void 0&&(c.intensity=o.intensity),c.name=t.createUniqueName(o.name||"light_"+e),i=Promise.resolve(c),t.cache.add(n,i),i}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,i=n.json.nodes[e],s=(i.extensions&&i.extensions[this.name]||{}).light;return s===void 0?null:this._loadLight(s).then(function(o){return n._getNodeRef(t.cache,s,o)})}}class N8{constructor(){this.name=xt.KHR_MATERIALS_UNLIT}getMaterialType(){return Es}extendParams(e,t,n){const i=[];e.color=new qe(1,1,1),e.opacity=1;const s=t.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const o=s.baseColorFactor;e.color.setRGB(o[0],o[1],o[2],Cr),e.opacity=o[3]}s.baseColorTexture!==void 0&&i.push(n.assignTexture(e,"map",s.baseColorTexture,kr))}return Promise.all(i)}}class U8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=n.extensions[this.name].emissiveStrength;return i!==void 0&&(t.emissiveIntensity=i),Promise.resolve()}}class P8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Di}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];if(o.clearcoatFactor!==void 0&&(t.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&s.push(n.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&s.push(n.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(s.push(n.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){const c=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new Ge(c,c)}return Promise.all(s)}}class k8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Di}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.iridescenceFactor!==void 0&&(t.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&s.push(n.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(t.iridescenceIOR=o.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&s.push(n.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(s)}}class Q8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_SHEEN}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Di}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[];t.sheenColor=new qe(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=i.extensions[this.name];if(o.sheenColorFactor!==void 0){const c=o.sheenColorFactor;t.sheenColor.setRGB(c[0],c[1],c[2],Cr)}return o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&s.push(n.assignTexture(t,"sheenColorMap",o.sheenColorTexture,kr)),o.sheenRoughnessTexture!==void 0&&s.push(n.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(s)}}class O8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Di}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.transmissionFactor!==void 0&&(t.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&s.push(n.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(s)}}class F8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_VOLUME}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Di}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];t.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&s.push(n.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const c=o.attenuationColor||[1,1,1];return t.attenuationColor=new qe().setRGB(c[0],c[1],c[2],Cr),Promise.all(s)}}class z8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_IOR}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Di}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=n.extensions[this.name];return t.ior=i.ior!==void 0?i.ior:1.5,Promise.resolve()}}class H8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_SPECULAR}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Di}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];t.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&s.push(n.assignTexture(t,"specularIntensityMap",o.specularTexture));const c=o.specularColorFactor||[1,1,1];return t.specularColor=new qe().setRGB(c[0],c[1],c[2],Cr),o.specularColorTexture!==void 0&&s.push(n.assignTexture(t,"specularColorMap",o.specularColorTexture,kr)),Promise.all(s)}}class G8{constructor(e){this.parser=e,this.name=xt.EXT_MATERIALS_BUMP}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Di}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return t.bumpScale=o.bumpFactor!==void 0?o.bumpFactor:1,o.bumpTexture!==void 0&&s.push(n.assignTexture(t,"bumpMap",o.bumpTexture)),Promise.all(s)}}class V8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Di}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.anisotropyStrength!==void 0&&(t.anisotropy=o.anisotropyStrength),o.anisotropyRotation!==void 0&&(t.anisotropyRotation=o.anisotropyRotation),o.anisotropyTexture!==void 0&&s.push(n.assignTexture(t,"anisotropyMap",o.anisotropyTexture)),Promise.all(s)}}class j8{constructor(e){this.parser=e,this.name=xt.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,i=n.textures[e];if(!i.extensions||!i.extensions[this.name])return null;const s=i.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,o)}}class W8{constructor(e){this.parser=e,this.name=xt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],c=i.images[o.source];let h=n.textureLoader;if(c.uri){const u=n.options.manager.getHandler(c.uri);u!==null&&(h=u)}return this.detectSupport().then(function(u){if(u)return n.loadTextureImage(e,o.source,h);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class Y8{constructor(e){this.parser=e,this.name=xt.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],c=i.images[o.source];let h=n.textureLoader;if(c.uri){const u=n.options.manager.getHandler(c.uri);u!==null&&(h=u)}return this.detectSupport().then(function(u){if(u)return n.loadTextureImage(e,o.source,h);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class q8{constructor(e){this.name=xt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const i=n.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(c){const h=i.byteOffset||0,u=i.byteLength||0,d=i.count,A=i.byteStride,p=new Uint8Array(c,h,u);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(d,A,p,i.mode,i.filter).then(function(g){return g.buffer}):o.ready.then(function(){const g=new ArrayBuffer(d*A);return o.decodeGltfBuffer(new Uint8Array(g),d,A,p,i.mode,i.filter),g})})}else return null}}class X8{constructor(e){this.name=xt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const i=t.meshes[n.mesh];for(const h of i.primitives)if(h.mode!==ni.TRIANGLES&&h.mode!==ni.TRIANGLE_STRIP&&h.mode!==ni.TRIANGLE_FAN&&h.mode!==void 0)return null;const s=n.extensions[this.name].attributes,o=[],c={};for(const h in s)o.push(this.parser.getDependency("accessor",s[h]).then(u=>(c[h]=u,c[h])));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then(h=>{const u=h.pop(),d=u.isGroup?u.children:[u],A=h[0].count,p=[];for(const g of d){const v=new tt,E=new W,m=new ji,_=new W(1,1,1),w=new WL(g.geometry,g.material,A);for(let x=0;x<A;x++)c.TRANSLATION&&E.fromBufferAttribute(c.TRANSLATION,x),c.ROTATION&&m.fromBufferAttribute(c.ROTATION,x),c.SCALE&&_.fromBufferAttribute(c.SCALE,x),w.setMatrixAt(x,v.compose(E,m,_));for(const x in c)if(x==="_COLOR_0"){const I=c[x];w.instanceColor=new sg(I.array,I.itemSize,I.normalized)}else x!=="TRANSLATION"&&x!=="ROTATION"&&x!=="SCALE"&&g.geometry.setAttribute(x,c[x]);Zt.prototype.copy.call(w,g),this.parser.assignFinalMaterial(w),p.push(w)}return u.isGroup?(u.clear(),u.add(...p),u):p[0]}))}}const ox="glTF",yu=12,lx={JSON:1313821514,BIN:5130562};class K8{constructor(e){this.name=xt.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,yu),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==ox)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-yu,s=new DataView(e,yu);let o=0;for(;o<i;){const c=s.getUint32(o,!0);o+=4;const h=s.getUint32(o,!0);if(o+=4,h===lx.JSON){const u=new Uint8Array(e,yu+o,c);this.content=n.decode(u)}else if(h===lx.BIN){const u=yu+o;this.body=e.slice(u,u+c)}o+=c}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class J8{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=xt.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,i=this.dracoLoader,s=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,c={},h={},u={};for(const d in o){const A=mg[d]||d.toLowerCase();c[A]=o[d]}for(const d in e.attributes){const A=mg[d]||d.toLowerCase();if(o[d]!==void 0){const p=n.accessors[e.attributes[d]],g=Dl[p.componentType];u[A]=g.name,h[A]=p.normalized===!0}}return t.getDependency("bufferView",s).then(function(d){return new Promise(function(A,p){i.decodeDracoFile(d,function(g){for(const v in g.attributes){const E=g.attributes[v],m=h[v];m!==void 0&&(E.normalized=m)}A(g)},c,u,Cr,p)})})}}class Z8{constructor(){this.name=xt.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class $8{constructor(){this.name=xt.KHR_MESH_QUANTIZATION}}class cx extends mu{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let o=0;o!==i;o++)t[o]=n[s+o];return t}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,c=this.valueSize,h=c*2,u=c*3,d=i-t,A=(n-t)/d,p=A*A,g=p*A,v=e*u,E=v-u,m=-2*g+3*p,_=g-p,w=1-m,x=_-p+A;for(let I=0;I!==c;I++){const R=o[E+I+c],S=o[E+I+h]*d,T=o[v+I+c],D=o[v+I]*d;s[I]=w*R+x*S+m*T+_*D}return s}}const eN=new ji;class tN extends cx{interpolate_(e,t,n,i){const s=super.interpolate_(e,t,n,i);return eN.fromArray(s).normalize().toArray(s),s}}const ni={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},Dl={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},ux={9728:dr,9729:fr,9984:Gy,9985:Yh,9986:Kc,9987:xi},hx={33071:Ei,33648:Wh,10497:Zs},gg={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},mg={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},ca={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},rN={CUBICSPLINE:void 0,LINEAR:nl,STEP:tu},_g={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function nN(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new cg({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:vi})),r.DefaultMaterial}function go(r,e,t){for(const n in t.extensions)r[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function ua(r,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(r.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function iN(r,e,t){let n=!1,i=!1,s=!1;for(let u=0,d=e.length;u<d;u++){const A=e[u];if(A.POSITION!==void 0&&(n=!0),A.NORMAL!==void 0&&(i=!0),A.COLOR_0!==void 0&&(s=!0),n&&i&&s)break}if(!n&&!i&&!s)return Promise.resolve(r);const o=[],c=[],h=[];for(let u=0,d=e.length;u<d;u++){const A=e[u];if(n){const p=A.POSITION!==void 0?t.getDependency("accessor",A.POSITION):r.attributes.position;o.push(p)}if(i){const p=A.NORMAL!==void 0?t.getDependency("accessor",A.NORMAL):r.attributes.normal;c.push(p)}if(s){const p=A.COLOR_0!==void 0?t.getDependency("accessor",A.COLOR_0):r.attributes.color;h.push(p)}}return Promise.all([Promise.all(o),Promise.all(c),Promise.all(h)]).then(function(u){const d=u[0],A=u[1],p=u[2];return n&&(r.morphAttributes.position=d),i&&(r.morphAttributes.normal=A),s&&(r.morphAttributes.color=p),r.morphTargetsRelative=!0,r})}function sN(r,e){if(r.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)r.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(r.morphTargetInfluences.length===t.length){r.morphTargetDictionary={};for(let n=0,i=t.length;n<i;n++)r.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function aN(r){let e;const t=r.extensions&&r.extensions[xt.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+vg(t.attributes):e=r.indices+":"+vg(r.attributes)+":"+r.mode,r.targets!==void 0)for(let n=0,i=r.targets.length;n<i;n++)e+=":"+vg(r.targets[n]);return e}function vg(r){let e="";const t=Object.keys(r).sort();for(let n=0,i=t.length;n<i;n++)e+=t[n]+":"+r[t[n]]+";";return e}function yg(r){switch(r){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function oN(r){return r.search(/\.jpe?g($|\?)/i)>0||r.search(/^data\:image\/jpeg/)===0?"image/jpeg":r.search(/\.webp($|\?)/i)>0||r.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const lN=new tt;class cN{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new D8,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,i=!1,s=-1;typeof navigator<"u"&&(n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,i=navigator.userAgent.indexOf("Firefox")>-1,s=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||n||i&&s<98?this.textureLoader=new X2(this.options.manager):this.textureLoader=new _8(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Rl(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,i=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(o){const c={scene:o[0][i.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:i.asset,parser:n,userData:{}};return go(s,c,i),ua(c,i),Promise.all(n._invokeAll(function(h){return h.afterRoot&&h.afterRoot(c)})).then(function(){for(const h of c.scenes)h.updateMatrixWorld();e(c)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let i=0,s=t.length;i<s;i++){const o=t[i].joints;for(let c=0,h=o.length;c<h;c++)e[o[c]].isBone=!0}for(let i=0,s=e.length;i<s;i++){const o=e[i];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(n[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const i=n.clone(),s=(o,c)=>{const h=this.associations.get(o);h!=null&&this.associations.set(c,h);for(const[u,d]of o.children.entries())s(d,c.children[u])};return s(n,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const i=e(t[n]);if(i)return i}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let i=0;i<t.length;i++){const s=e(t[i]);s&&n.push(s)}return n}getDependency(e,t){const n=e+":"+t;let i=this.cache.get(n);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this._invokeOne(function(s){return s.loadNode&&s.loadNode(t)});break;case"mesh":i=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(t)});break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(t)});break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(t)});break;case"texture":i=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(t)});break;case"skin":i=this.loadSkin(t);break;case"animation":i=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(t)});break;case"camera":i=this.loadCamera(t);break;default:if(i=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(e,t)}),!i)throw new Error("Unknown type: "+e);break}this.cache.add(n,i)}return i}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,i=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(i.map(function(s,o){return n.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[xt.KHR_BINARY_GLTF].body);const i=this.options;return new Promise(function(s,o){n.load(vu.resolveURL(t.uri,i.path),s,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(n){const i=t.byteLength||0,s=t.byteOffset||0;return n.slice(s,s+i)})}loadAccessor(e){const t=this,n=this.json,i=this.json.accessors[e];if(i.bufferView===void 0&&i.sparse===void 0){const o=gg[i.type],c=Dl[i.componentType],h=i.normalized===!0,u=new c(i.count*o);return Promise.resolve(new Qr(u,o,h))}const s=[];return i.bufferView!==void 0?s.push(this.getDependency("bufferView",i.bufferView)):s.push(null),i.sparse!==void 0&&(s.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(s).then(function(o){const c=o[0],h=gg[i.type],u=Dl[i.componentType],d=u.BYTES_PER_ELEMENT,A=d*h,p=i.byteOffset||0,g=i.bufferView!==void 0?n.bufferViews[i.bufferView].byteStride:void 0,v=i.normalized===!0;let E,m;if(g&&g!==A){const _=Math.floor(p/g),w="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+_+":"+i.count;let x=t.cache.get(w);x||(E=new u(c,_*g,i.count*g/d),x=new zL(E,g/d),t.cache.add(w,x)),m=new tg(x,h,p%g/d,v)}else c===null?E=new u(i.count*h):E=new u(c,p,i.count*h),m=new Qr(E,h,v);if(i.sparse!==void 0){const _=gg.SCALAR,w=Dl[i.sparse.indices.componentType],x=i.sparse.indices.byteOffset||0,I=i.sparse.values.byteOffset||0,R=new w(o[1],x,i.sparse.count*_),S=new u(o[2],I,i.sparse.count*h);c!==null&&(m=new Qr(m.array.slice(),m.itemSize,m.normalized));for(let T=0,D=R.length;T<D;T++){const b=R[T];if(m.setX(b,S[T*h]),h>=2&&m.setY(b,S[T*h+1]),h>=3&&m.setZ(b,S[T*h+2]),h>=4&&m.setW(b,S[T*h+3]),h>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return m})}loadTexture(e){const t=this.json,n=this.options,i=t.textures[e].source,s=t.images[i];let o=this.textureLoader;if(s.uri){const c=n.manager.getHandler(s.uri);c!==null&&(o=c)}return this.loadTextureImage(e,i,o)}loadTextureImage(e,t,n){const i=this,s=this.json,o=s.textures[e],c=s.images[t],h=(c.uri||c.bufferView)+":"+o.sampler;if(this.textureCache[h])return this.textureCache[h];const u=this.loadImageSource(t,n).then(function(d){d.flipY=!1,d.name=o.name||c.name||"",d.name===""&&typeof c.uri=="string"&&c.uri.startsWith("data:image/")===!1&&(d.name=c.uri);const A=(s.samplers||{})[o.sampler]||{};return d.magFilter=ux[A.magFilter]||fr,d.minFilter=ux[A.minFilter]||xi,d.wrapS=hx[A.wrapS]||Zs,d.wrapT=hx[A.wrapT]||Zs,i.associations.set(d,{textures:e}),d}).catch(function(){return null});return this.textureCache[h]=u,u}loadImageSource(e,t){const n=this,i=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(A=>A.clone());const o=i.images[e],c=self.URL||self.webkitURL;let h=o.uri||"",u=!1;if(o.bufferView!==void 0)h=n.getDependency("bufferView",o.bufferView).then(function(A){u=!0;const p=new Blob([A],{type:o.mimeType});return h=c.createObjectURL(p),h});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const d=Promise.resolve(h).then(function(A){return new Promise(function(p,g){let v=p;t.isImageBitmapLoader===!0&&(v=function(E){const m=new Sr(E);m.needsUpdate=!0,p(m)}),t.load(vu.resolveURL(A,s.path),v,void 0,g)})}).then(function(A){return u===!0&&c.revokeObjectURL(h),A.userData.mimeType=o.mimeType||oN(o.uri),A}).catch(function(A){throw console.error("THREE.GLTFLoader: Couldn't load texture",h),A});return this.sourceCache[e]=d,d}assignTexture(e,t,n,i){const s=this;return this.getDependency("texture",n.index).then(function(o){if(!o)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(o=o.clone(),o.channel=n.texCoord),s.extensions[xt.KHR_TEXTURE_TRANSFORM]){const c=n.extensions!==void 0?n.extensions[xt.KHR_TEXTURE_TRANSFORM]:void 0;if(c){const h=s.associations.get(o);o=s.extensions[xt.KHR_TEXTURE_TRANSFORM].extendTexture(o,c),s.associations.set(o,h)}}return i!==void 0&&(o.colorSpace=i),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const i=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const c="PointsMaterial:"+n.uuid;let h=this.cache.get(c);h||(h=new H2,Yi.prototype.copy.call(h,n),h.color.copy(n.color),h.map=n.map,h.sizeAttenuation=!1,this.cache.add(c,h)),n=h}else if(e.isLine){const c="LineBasicMaterial:"+n.uuid;let h=this.cache.get(c);h||(h=new P2,Yi.prototype.copy.call(h,n),h.color.copy(n.color),h.map=n.map,this.cache.add(c,h)),n=h}if(i||s||o){let c="ClonedMaterial:"+n.uuid+":";i&&(c+="derivative-tangents:"),s&&(c+="vertex-colors:"),o&&(c+="flat-shading:");let h=this.cache.get(c);h||(h=n.clone(),s&&(h.vertexColors=!0),o&&(h.flatShading=!0),i&&(h.normalScale&&(h.normalScale.y*=-1),h.clearcoatNormalScale&&(h.clearcoatNormalScale.y*=-1)),this.cache.add(c,h),this.associations.set(h,this.associations.get(n))),n=h}e.material=n}getMaterialType(){return cg}loadMaterial(e){const t=this,n=this.json,i=this.extensions,s=n.materials[e];let o;const c={},h=s.extensions||{},u=[];if(h[xt.KHR_MATERIALS_UNLIT]){const A=i[xt.KHR_MATERIALS_UNLIT];o=A.getMaterialType(),u.push(A.extendParams(c,s,t))}else{const A=s.pbrMetallicRoughness||{};if(c.color=new qe(1,1,1),c.opacity=1,Array.isArray(A.baseColorFactor)){const p=A.baseColorFactor;c.color.setRGB(p[0],p[1],p[2],Cr),c.opacity=p[3]}A.baseColorTexture!==void 0&&u.push(t.assignTexture(c,"map",A.baseColorTexture,kr)),c.metalness=A.metallicFactor!==void 0?A.metallicFactor:1,c.roughness=A.roughnessFactor!==void 0?A.roughnessFactor:1,A.metallicRoughnessTexture!==void 0&&(u.push(t.assignTexture(c,"metalnessMap",A.metallicRoughnessTexture)),u.push(t.assignTexture(c,"roughnessMap",A.metallicRoughnessTexture))),o=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,c)})))}s.doubleSided===!0&&(c.side=yi);const d=s.alphaMode||_g.OPAQUE;if(d===_g.BLEND?(c.transparent=!0,c.depthWrite=!1):(c.transparent=!1,d===_g.MASK&&(c.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==Es&&(u.push(t.assignTexture(c,"normalMap",s.normalTexture)),c.normalScale=new Ge(1,1),s.normalTexture.scale!==void 0)){const A=s.normalTexture.scale;c.normalScale.set(A,A)}if(s.occlusionTexture!==void 0&&o!==Es&&(u.push(t.assignTexture(c,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(c.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==Es){const A=s.emissiveFactor;c.emissive=new qe().setRGB(A[0],A[1],A[2],Cr)}return s.emissiveTexture!==void 0&&o!==Es&&u.push(t.assignTexture(c,"emissiveMap",s.emissiveTexture,kr)),Promise.all(u).then(function(){const A=new o(c);return s.name&&(A.name=s.name),ua(A,s),t.associations.set(A,{materials:e}),s.extensions&&go(i,A,s),A})}createUniqueName(e){const t=Ut.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,i=this.primitiveCache;function s(c){return n[xt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(c,t).then(function(h){return dx(h,c,t)})}const o=[];for(let c=0,h=e.length;c<h;c++){const u=e[c],d=aN(u),A=i[d];if(A)o.push(A.promise);else{let p;u.extensions&&u.extensions[xt.KHR_DRACO_MESH_COMPRESSION]?p=s(u):p=dx(new Hn,u,t),i[d]={primitive:u,promise:p},o.push(p)}}return Promise.all(o)}loadMesh(e){const t=this,n=this.json,i=this.extensions,s=n.meshes[e],o=s.primitives,c=[];for(let h=0,u=o.length;h<u;h++){const d=o[h].material===void 0?nN(this.cache):this.getDependency("material",o[h].material);c.push(d)}return c.push(t.loadGeometries(o)),Promise.all(c).then(function(h){const u=h.slice(0,h.length-1),d=h[h.length-1],A=[];for(let g=0,v=d.length;g<v;g++){const E=d[g],m=o[g];let _;const w=u[g];if(m.mode===ni.TRIANGLES||m.mode===ni.TRIANGLE_STRIP||m.mode===ni.TRIANGLE_FAN||m.mode===void 0)_=s.isSkinnedMesh===!0?new GL(E,w):new Wr(E,w),_.isSkinnedMesh===!0&&_.normalizeSkinWeights(),m.mode===ni.TRIANGLE_STRIP?_.geometry=ax(_.geometry,AE):m.mode===ni.TRIANGLE_FAN&&(_.geometry=ax(_.geometry,xA));else if(m.mode===ni.LINES)_=new YL(E,w);else if(m.mode===ni.LINE_STRIP)_=new og(E,w);else if(m.mode===ni.LINE_LOOP)_=new qL(E,w);else if(m.mode===ni.POINTS)_=new XL(E,w);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+m.mode);Object.keys(_.geometry.morphAttributes).length>0&&sN(_,s),_.name=t.createUniqueName(s.name||"mesh_"+e),ua(_,s),m.extensions&&go(i,_,m),t.assignFinalMaterial(_),A.push(_)}for(let g=0,v=A.length;g<v;g++)t.associations.set(A[g],{meshes:e,primitives:g});if(A.length===1)return s.extensions&&go(i,A[0],s),A[0];const p=new aa;s.extensions&&go(i,p,s),t.associations.set(p,{meshes:e});for(let g=0,v=A.length;g<v;g++)p.add(A[g]);return p})}loadCamera(e){let t;const n=this.json.cameras[e],i=n[n.type];if(!i){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new cn(CA.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):n.type==="orthographic"&&(t=new fu(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),ua(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let i=0,s=t.joints.length;i<s;i++)n.push(this._loadNodeShallow(t.joints[i]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(i){const s=i.pop(),o=i,c=[],h=[];for(let u=0,d=o.length;u<d;u++){const A=o[u];if(A){c.push(A);const p=new tt;s!==null&&p.fromArray(s.array,u*16),h.push(p)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[u])}return new ig(c,h)})}loadAnimation(e){const t=this.json,n=this,i=t.animations[e],s=i.name?i.name:"animation_"+e,o=[],c=[],h=[],u=[],d=[];for(let A=0,p=i.channels.length;A<p;A++){const g=i.channels[A],v=i.samplers[g.sampler],E=g.target,m=E.node,_=i.parameters!==void 0?i.parameters[v.input]:v.input,w=i.parameters!==void 0?i.parameters[v.output]:v.output;E.node!==void 0&&(o.push(this.getDependency("node",m)),c.push(this.getDependency("accessor",_)),h.push(this.getDependency("accessor",w)),u.push(v),d.push(E))}return Promise.all([Promise.all(o),Promise.all(c),Promise.all(h),Promise.all(u),Promise.all(d)]).then(function(A){const p=A[0],g=A[1],v=A[2],E=A[3],m=A[4],_=[];for(let w=0,x=p.length;w<x;w++){const I=p[w],R=g[w],S=v[w],T=E[w],D=m[w];if(I===void 0)continue;I.updateMatrix&&I.updateMatrix();const b=n._createAnimationTracks(I,R,S,T,D);if(b)for(let M=0;M<b.length;M++)_.push(b[M])}return new s8(s,void 0,_)})}createNodeMesh(e){const t=this.json,n=this,i=t.nodes[e];return i.mesh===void 0?null:n.getDependency("mesh",i.mesh).then(function(s){const o=n._getNodeRef(n.meshCache,i.mesh,s);return i.weights!==void 0&&o.traverse(function(c){if(c.isMesh)for(let h=0,u=i.weights.length;h<u;h++)c.morphTargetInfluences[h]=i.weights[h]}),o})}loadNode(e){const t=this.json,n=this,i=t.nodes[e],s=n._loadNodeShallow(e),o=[],c=i.children||[];for(let u=0,d=c.length;u<d;u++)o.push(n.getDependency("node",c[u]));const h=i.skin===void 0?Promise.resolve(null):n.getDependency("skin",i.skin);return Promise.all([s,Promise.all(o),h]).then(function(u){const d=u[0],A=u[1],p=u[2];p!==null&&d.traverse(function(g){g.isSkinnedMesh&&g.bind(p,lN)});for(let g=0,v=A.length;g<v;g++)d.add(A[g]);return d})}_loadNodeShallow(e){const t=this.json,n=this.extensions,i=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const s=t.nodes[e],o=s.name?i.createUniqueName(s.name):"",c=[],h=i._invokeOne(function(u){return u.createNodeMesh&&u.createNodeMesh(e)});return h&&c.push(h),s.camera!==void 0&&c.push(i.getDependency("camera",s.camera).then(function(u){return i._getNodeRef(i.cameraCache,s.camera,u)})),i._invokeAll(function(u){return u.createNodeAttachment&&u.createNodeAttachment(e)}).forEach(function(u){c.push(u)}),this.nodeCache[e]=Promise.all(c).then(function(u){let d;if(s.isBone===!0?d=new D2:u.length>1?d=new aa:u.length===1?d=u[0]:d=new Zt,d!==u[0])for(let A=0,p=u.length;A<p;A++)d.add(u[A]);if(s.name&&(d.userData.name=s.name,d.name=o),ua(d,s),s.extensions&&go(n,d,s),s.matrix!==void 0){const A=new tt;A.fromArray(s.matrix),d.applyMatrix4(A)}else s.translation!==void 0&&d.position.fromArray(s.translation),s.rotation!==void 0&&d.quaternion.fromArray(s.rotation),s.scale!==void 0&&d.scale.fromArray(s.scale);return i.associations.has(d)||i.associations.set(d,{}),i.associations.get(d).nodes=e,d}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],i=this,s=new aa;n.name&&(s.name=i.createUniqueName(n.name)),ua(s,n),n.extensions&&go(t,s,n);const o=n.nodes||[],c=[];for(let h=0,u=o.length;h<u;h++)c.push(i.getDependency("node",o[h]));return Promise.all(c).then(function(h){for(let d=0,A=h.length;d<A;d++)s.add(h[d]);const u=d=>{const A=new Map;for(const[p,g]of i.associations)(p instanceof Yi||p instanceof Sr)&&A.set(p,g);return d.traverse(p=>{const g=i.associations.get(p);g!=null&&A.set(p,g)}),A};return i.associations=u(s),s})}_createAnimationTracks(e,t,n,i,s){const o=[],c=e.name?e.name:e.uuid,h=[];ca[s.path]===ca.weights?e.traverse(function(p){p.morphTargetInfluences&&h.push(p.name?p.name:p.uuid)}):h.push(c);let u;switch(ca[s.path]){case ca.weights:u=Tl;break;case ca.rotation:u=Ao;break;case ca.position:case ca.scale:u=bl;break;default:switch(n.itemSize){case 1:u=Tl;break;case 2:case 3:default:u=bl;break}break}const d=i.interpolation!==void 0?rN[i.interpolation]:nl,A=this._getArrayFromAccessor(n);for(let p=0,g=h.length;p<g;p++){const v=new u(h[p]+"."+ca[s.path],t.array,A,d);i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(v),o.push(v)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=yg(t.constructor),i=new Float32Array(t.length);for(let s=0,o=t.length;s<o;s++)i[s]=t[s]*n;t=i}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(t){const n=this instanceof Ao?tN:cx;return new n(this.times,this.values,this.getValueSize()/3,t)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function uN(r,e,t){const n=e.attributes,i=new yr;if(n.POSITION!==void 0){const c=t.json.accessors[n.POSITION],h=c.min,u=c.max;if(h!==void 0&&u!==void 0){if(i.set(new W(h[0],h[1],h[2]),new W(u[0],u[1],u[2])),c.normalized){const d=yg(Dl[c.componentType]);i.min.multiplyScalar(d),i.max.multiplyScalar(d)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const c=new W,h=new W;for(let u=0,d=s.length;u<d;u++){const A=s[u];if(A.POSITION!==void 0){const p=t.json.accessors[A.POSITION],g=p.min,v=p.max;if(g!==void 0&&v!==void 0){if(h.setX(Math.max(Math.abs(g[0]),Math.abs(v[0]))),h.setY(Math.max(Math.abs(g[1]),Math.abs(v[1]))),h.setZ(Math.max(Math.abs(g[2]),Math.abs(v[2]))),p.normalized){const E=yg(Dl[p.componentType]);h.multiplyScalar(E)}c.max(h)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(c)}r.boundingBox=i;const o=new Ti;i.getCenter(o.center),o.radius=i.min.distanceTo(i.max)/2,r.boundingSphere=o}function dx(r,e,t){const n=e.attributes,i=[];function s(o,c){return t.getDependency("accessor",o).then(function(h){r.setAttribute(c,h)})}for(const o in n){const c=mg[o]||o.toLowerCase();c in r.attributes||i.push(s(n[o],c))}if(e.indices!==void 0&&!r.index){const o=t.getDependency("accessor",e.indices).then(function(c){r.setIndex(c)});i.push(o)}return Rt.workingColorSpace!==Cr&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Rt.workingColorSpace}" not supported.`),ua(r,e),uN(r,e,t),Promise.all(i).then(function(){return e.targets!==void 0?iN(r,e.targets,t):r})}class hN{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}_onMessage(e,t){const n=this.workersResolve[e];if(n&&n(t),this.queue.length){const{resolve:i,msg:s,transfer:o}=this.queue.shift();this.workersResolve[e]=i,this.workers[e].postMessage(s,o)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(n=>{const i=this._getIdleWorker();i!==-1?(this._initWorker(i),this.workerStatus|=1<<i,this.workersResolve[i]=n,this.workers[i].postMessage(e,t)):this.queue.push({resolve:n,msg:e,transfer:t})})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}const dN=0,fx=2,fN=1,px=2,pN=0,AN=1,gN=10,mN=0,Ax=9,gx=15,mx=16,_x=22,vx=37,yx=43,Ex=76,xx=83,wx=97,Ix=100,Cx=103,Mx=109,Sx=165,Tx=166;class _N{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class Eu{constructor(e,t,n,i){this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=i,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+4294967296*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_skip(e){return this._offset+=e,this}_scan(e,t=0){const n=this._offset;let i=0;for(;this._dataView.getUint8(this._offset)!==t&&i<e;)i++,this._offset++;return i<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,i)}}const hn=[171,75,84,88,32,50,48,187,13,10,26,10];function Bx(r){return typeof TextDecoder<"u"?new TextDecoder().decode(r):Buffer.from(r).toString("utf8")}function vN(r){const e=new Uint8Array(r.buffer,r.byteOffset,hn.length);if(e[0]!==hn[0]||e[1]!==hn[1]||e[2]!==hn[2]||e[3]!==hn[3]||e[4]!==hn[4]||e[5]!==hn[5]||e[6]!==hn[6]||e[7]!==hn[7]||e[8]!==hn[8]||e[9]!==hn[9]||e[10]!==hn[10]||e[11]!==hn[11])throw new Error("Missing KTX 2.0 identifier.");const t=new _N,n=17*Uint32Array.BYTES_PER_ELEMENT,i=new Eu(r,hn.length,n,!0);t.vkFormat=i._nextUint32(),t.typeSize=i._nextUint32(),t.pixelWidth=i._nextUint32(),t.pixelHeight=i._nextUint32(),t.pixelDepth=i._nextUint32(),t.layerCount=i._nextUint32(),t.faceCount=i._nextUint32();const s=i._nextUint32();t.supercompressionScheme=i._nextUint32();const o=i._nextUint32(),c=i._nextUint32(),h=i._nextUint32(),u=i._nextUint32(),d=i._nextUint64(),A=i._nextUint64(),p=new Eu(r,hn.length+n,3*s*8,!0);for(let ne=0;ne<s;ne++)t.levels.push({levelData:new Uint8Array(r.buffer,r.byteOffset+p._nextUint64(),p._nextUint64()),uncompressedByteLength:p._nextUint64()});const g=new Eu(r,o,c,!0),v={vendorId:g._skip(4)._nextUint16(),descriptorType:g._nextUint16(),versionNumber:g._nextUint16(),descriptorBlockSize:g._nextUint16(),colorModel:g._nextUint8(),colorPrimaries:g._nextUint8(),transferFunction:g._nextUint8(),flags:g._nextUint8(),texelBlockDimension:[g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8()],bytesPlane:[g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8()],samples:[]},E=(v.descriptorBlockSize/4-6)/4;for(let ne=0;ne<E;ne++){const V={bitOffset:g._nextUint16(),bitLength:g._nextUint8(),channelType:g._nextUint8(),samplePosition:[g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};64&V.channelType?(V.sampleLower=g._nextInt32(),V.sampleUpper=g._nextInt32()):(V.sampleLower=g._nextUint32(),V.sampleUpper=g._nextUint32()),v.samples[ne]=V}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(v);const m=new Eu(r,h,u,!0);for(;m._offset<u;){const ne=m._nextUint32(),V=m._scan(ne),te=Bx(V),Q=m._scan(ne-V.byteLength);t.keyValue[te]=te.match(/^ktx/i)?Bx(Q):Q,m._offset%4&&m._skip(4-m._offset%4)}if(A<=0)return t;const _=new Eu(r,d,A,!0),w=_._nextUint16(),x=_._nextUint16(),I=_._nextUint32(),R=_._nextUint32(),S=_._nextUint32(),T=_._nextUint32(),D=[];for(let ne=0;ne<s;ne++)D.push({imageFlags:_._nextUint32(),rgbSliceByteOffset:_._nextUint32(),rgbSliceByteLength:_._nextUint32(),alphaSliceByteOffset:_._nextUint32(),alphaSliceByteLength:_._nextUint32()});const b=d+_._offset,M=b+I,L=M+R,P=L+S,N=new Uint8Array(r.buffer,r.byteOffset+b,I),j=new Uint8Array(r.buffer,r.byteOffset+M,R),X=new Uint8Array(r.buffer,r.byteOffset+L,S),K=new Uint8Array(r.buffer,r.byteOffset+P,T);return t.globalData={endpointCount:w,selectorCount:x,imageDescs:D,endpointsData:N,selectorsData:j,tablesData:X,extendedData:K},t}let Eg,Cs,xg;const wg={env:{emscripten_notify_memory_growth:function(r){xg=new Uint8Array(Cs.exports.memory.buffer)}}};class yN{init(){return Eg||(Eg=typeof fetch<"u"?fetch("data:application/wasm;base64,"+bx).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,wg)).then(this._init):WebAssembly.instantiate(Buffer.from(bx,"base64"),wg).then(this._init),Eg)}_init(e){Cs=e.instance,wg.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!Cs)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,i=Cs.exports.malloc(n);xg.set(e,i),t=t||Number(Cs.exports.ZSTD_findDecompressedSize(i,n));const s=Cs.exports.malloc(t),o=Cs.exports.ZSTD_decompress(s,t,i,n),c=xg.slice(s,s+o);return Cs.exports.free(i),Cs.exports.free(s),c}}const bx="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoiAzYCCCAAIAMoAAA2AgAgAUF/ai0AACIBBEAgAEEIIAEQFGs2AgQgAg8LIABBADYCBEF/DwsgACABNgIIIAAgAS0AACIDNgIAIAJBfmoiBEEBTQRAIARBAWtFBEAgACABLQACQRB0IANyIgM2AgALIAAgAS0AAUEIdCADajYCAAsgASACakF/ai0AACIBRQRAIABBADYCBEFsDwsgAEEoIAEQFCACQQN0ams2AgQgAgsWACAAIAEpAAA3AAAgACABKQAINwAICy8BAX8gAUECdEGgHWooAgAgACgCAEEgIAEgACgCBGprQR9xdnEhAiAAIAEQASACCyEAIAFCz9bTvtLHq9lCfiAAfEIfiUKHla+vmLbem55/fgsdAQF/IAAoAgggACgCDEYEfyAAKAIEQSBGBUEACwuCBAEDfyACQYDAAE8EQCAAIAEgAhBnIAAPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAkEBSARAIAAhAgwBCyAAQQNxRQRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADTw0BIAJBA3ENAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAgAkEBaiECDAELCyAGIA5LQQAgBiAFQQN1aiIHIAxLG0UEQCAHKAAAIAVBB3EiBXYhBAwCCyAEQQJ2IQQLIAYhBwsCfyALQX9qIAQgAEF/anEiBiAAQQF0QX9qIgggCWsiEUkNABogBCAIcSIEQQAgESAEIABIG2shBiALCyEIIA0gAkEBdGogBkF/aiIEOwEAIAlBASAGayAEIAZBAUgbayEJA0AgCSAASARAIABBAXUhACALQX9qIQsMAQsLAn8gByAOS0EAIAcgBSAIaiIFQQN1aiIGIAxLG0UEQCAFQQdxDAELIAUgDCIGIAdrQQN0awshBSACQQFqIQIgBEUhCCAGKAAAIAVBH3F2IQQMAQsLQWwgCUEBRyAFQSBKcg0BGiABIAJBf2o2AgAgBiAFQQdqQQN1aiADawwBC0FQCyEAIApBEGokACAACwkAQQFBBSAAGwsMACAAIAEoAAA2AAALqgMBCn8jAEHwAGsiCiQAIAJBAWohDiAAQQhqIQtBgIAEIAVBf2p0QRB1IQxBACECQQEhBkEBIAV0IglBf2oiDyEIA0AgAiAORkUEQAJAIAEgAkEBdCINai8BACIHQf//A0YEQCALIAhBA3RqIAI2AgQgCEF/aiEIQQEhBwwBCyAGQQAgDCAHQRB0QRB1ShshBgsgCiANaiAHOwEAIAJBAWohAgwBCwsgACAFNgIEIAAgBjYCACAJQQN2IAlBAXZqQQNqIQxBACEAQQAhBkEAIQIDQCAGIA5GBEADQAJAIAAgCUYNACAKIAsgAEEDdGoiASgCBCIGQQF0aiICIAIvAQAiAkEBajsBACABIAUgAhAUayIIOgADIAEgAiAIQf8BcXQgCWs7AQAgASAEIAZBAnQiAmooAgA6AAIgASACIANqKAIANgIEIABBAWohAAwBCwsFIAEgBkEBdGouAQAhDUEAIQcDQCAHIA1ORQRAIAsgAkEDdGogBjYCBANAIAIgDGogD3EiAiAISw0ACyAHQQFqIQcMAQsLIAZBAWohBgwBCwsgCkHwAGokAAsjAEIAIAEQCSAAhUKHla+vmLbem55/fkLj3MqV/M7y9YV/fAsQACAAQn43AwggACABNgIACyQBAX8gAARAIAEoAgQiAgRAIAEoAgggACACEQEADwsgABAmCwsfACAAIAEgAi8BABAINgIAIAEQBBogACACQQRqNgIEC0oBAX9BoCAoAgAiASAAaiIAQX9MBEBBiCBBMDYCAEF/DwsCQCAAPwBBEHRNDQAgABBmDQBBiCBBMDYCAEF/DwtBoCAgADYCACABC9cBAQh/Qbp/IQoCQCACKAIEIgggAigCACIJaiIOIAEgAGtLDQBBbCEKIAkgBCADKAIAIgtrSw0AIAAgCWoiBCACKAIIIgxrIQ0gACABQWBqIg8gCyAJQQAQKSADIAkgC2o2AgACQAJAIAwgBCAFa00EQCANIQUMAQsgDCAEIAZrSw0CIAcgDSAFayIAaiIBIAhqIAdNBEAgBCABIAgQDxoMAgsgBCABQQAgAGsQDyEBIAIgACAIaiIINgIEIAEgAGshBAsgBCAPIAUgCEEBECkLIA4hCgsgCgubAgEBfyMAQYABayINJAAgDSADNgJ8AkAgAkEDSwRAQX8hCQwBCwJAAkACQAJAIAJBAWsOAwADAgELIAZFBEBBuH8hCQwEC0FsIQkgBS0AACICIANLDQMgACAHIAJBAnQiAmooAgAgAiAIaigCABA7IAEgADYCAEEBIQkMAwsgASAJNgIAQQAhCQwCCyAKRQRAQWwhCQwCC0EAIQkgC0UgDEEZSHINAUEIIAR0QQhqIQBBACECA0AgAiAATw0CIAJBQGshAgwAAAsAC0FsIQkgDSANQfwAaiANQfgAaiAFIAYQFSICEAMNACANKAJ4IgMgBEsNACAAIA0gDSgCfCAHIAggAxAYIAEgADYCACACIQkLIA1BgAFqJAAgCQsLACAAIAEgAhALGgsQACAALwAAIAAtAAJBEHRyCy8AAn9BuH8gAUEISQ0AGkFyIAAoAAQiAEF3Sw0AGkG4fyAAQQhqIgAgACABSxsLCwkAIAAgATsAAAsDAAELigYBBX8gACAAKAIAIgVBfnE2AgBBACAAIAVBAXZqQYQgKAIAIgQgAEYbIQECQAJAIAAoAgQiAkUNACACKAIAIgNBAXENACACQQhqIgUgA0EBdkF4aiIDQQggA0EISxtnQR9zQQJ0QYAfaiIDKAIARgRAIAMgAigCDDYCAAsgAigCCCIDBEAgAyACKAIMNgIECyACKAIMIgMEQCADIAIoAgg2AgALIAIgAigCACAAKAIAQX5xajYCAEGEICEAAkACQCABRQ0AIAEgAjYCBCABKAIAIgNBAXENASADQQF2QXhqIgNBCCADQQhLG2dBH3NBAnRBgB9qIgMoAgAgAUEIakYEQCADIAEoAgw2AgALIAEoAggiAwRAIAMgASgCDDYCBAsgASgCDCIDBEAgAyABKAIINgIAQYQgKAIAIQQLIAIgAigCACABKAIAQX5xajYCACABIARGDQAgASABKAIAQQF2akEEaiEACyAAIAI2AgALIAIoAgBBAXZBeGoiAEEIIABBCEsbZ0Efc0ECdEGAH2oiASgCACEAIAEgBTYCACACIAA2AgwgAkEANgIIIABFDQEgACAFNgIADwsCQCABRQ0AIAEoAgAiAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAigCACABQQhqRgRAIAIgASgCDDYCAAsgASgCCCICBEAgAiABKAIMNgIECyABKAIMIgIEQCACIAEoAgg2AgBBhCAoAgAhBAsgACAAKAIAIAEoAgBBfnFqIgI2AgACQCABIARHBEAgASABKAIAQQF2aiAANgIEIAAoAgAhAgwBC0GEICAANgIACyACQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgIoAgAhASACIABBCGoiAjYCACAAIAE2AgwgAEEANgIIIAFFDQEgASACNgIADwsgBUEBdkF4aiIBQQggAUEISxtnQR9zQQJ0QYAfaiICKAIAIQEgAiAAQQhqIgI2AgAgACABNgIMIABBADYCCCABRQ0AIAEgAjYCAAsLDgAgAARAIABBeGoQJQsLgAIBA38CQCAAQQ9qQXhxQYQgKAIAKAIAQQF2ayICEB1Bf0YNAAJAQYQgKAIAIgAoAgAiAUEBcQ0AIAFBAXZBeGoiAUEIIAFBCEsbZ0Efc0ECdEGAH2oiASgCACAAQQhqRgRAIAEgACgCDDYCAAsgACgCCCIBBEAgASAAKAIMNgIECyAAKAIMIgFFDQAgASAAKAIINgIAC0EBIQEgACAAKAIAIAJBAXRqIgI2AgAgAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAygCACECIAMgAEEIaiIDNgIAIAAgAjYCDCAAQQA2AgggAkUNACACIAM2AgALIAELtwIBA38CQAJAIABBASAAGyICEDgiAA0AAkACQEGEICgCACIARQ0AIAAoAgAiA0EBcQ0AIAAgA0EBcjYCACADQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgAgAEEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigCACACaiAAQQZ2IgFBAnRBsB5qKAIAaiAAQSBxIgBFaiABRSAAQQV2cWoFQbh/CwsdACAAKAKQ4gEQWiAAQQA2AqDiASAAQgA3A5DiAQu1AwEFfyMAQZACayIKJABBuH8hBgJAIAVFDQAgBCwAACIIQf8BcSEHAkAgCEF/TARAIAdBgn9qQQF2IgggBU8NAkFsIQYgB0GBf2oiBUGAAk8NAiAEQQFqIQdBACEGA0AgBiAFTwRAIAUhBiAIIQcMAwUgACAGaiAHIAZBAXZqIgQtAABBBHY6AAAgACAGQQFyaiAELQAAQQ9xOgAAIAZBAmohBgwBCwAACwALIAcgBU8NASAAIARBAWogByAKEFMiBhADDQELIAYhBEEAIQYgAUEAQTQQECEJQQAhBQNAIAQgBkcEQCAAIAZqIggtAAAiAUELSwRAQWwhBgwDBSAJIAFBAnRqIgEgASgCAEEBajYCACAGQQFqIQZBASAILQAAdEEBdSAFaiEFDAILAAsLQWwhBiAFRQ0AIAUQFEEBaiIBQQxLDQAgAyABNgIAQQFBASABdCAFayIDEBQiAXQgA0cNACAAIARqIAFBAWoiADoAACAJIABBAnRqIgAgACgCAEEBajYCACAJKAIEIgBBAkkgAEEBcXINACACIARBAWo2AgAgB0EBaiEGCyAKQZACaiQAIAYLxhEBDH8jAEHwAGsiBSQAQWwhCwJAIANBCkkNACACLwAAIQogAi8AAiEJIAIvAAQhByAFQQhqIAQQDgJAIAMgByAJIApqakEGaiIMSQ0AIAUtAAohCCAFQdgAaiACQQZqIgIgChAGIgsQAw0BIAVBQGsgAiAKaiICIAkQBiILEAMNASAFQShqIAIgCWoiAiAHEAYiCxADDQEgBUEQaiACIAdqIAMgDGsQBiILEAMNASAAIAFqIg9BfWohECAEQQRqIQZBASELIAAgAUEDakECdiIDaiIMIANqIgIgA2oiDiEDIAIhBCAMIQcDQCALIAMgEElxBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgCS0AAyELIAcgBiAFQUBrIAgQAkECdGoiCS8BADsAACAFQUBrIAktAAIQASAJLQADIQogBCAGIAVBKGogCBACQQJ0aiIJLwEAOwAAIAVBKGogCS0AAhABIAktAAMhCSADIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgDS0AAyENIAAgC2oiCyAGIAVB2ABqIAgQAkECdGoiAC8BADsAACAFQdgAaiAALQACEAEgAC0AAyEAIAcgCmoiCiAGIAVBQGsgCBACQQJ0aiIHLwEAOwAAIAVBQGsgBy0AAhABIActAAMhByAEIAlqIgkgBiAFQShqIAgQAkECdGoiBC8BADsAACAFQShqIAQtAAIQASAELQADIQQgAyANaiIDIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgACALaiEAIAcgCmohByAEIAlqIQQgAyANLQADaiEDIAVB2ABqEA0gBUFAaxANciAFQShqEA1yIAVBEGoQDXJFIQsMAQsLIAQgDksgByACS3INAEFsIQsgACAMSw0BIAxBfWohCQNAQQAgACAJSSAFQdgAahAEGwRAIAAgBiAFQdgAaiAIEAJBAnRqIgovAQA7AAAgBUHYAGogCi0AAhABIAAgCi0AA2oiACAGIAVB2ABqIAgQAkECdGoiCi8BADsAACAFQdgAaiAKLQACEAEgACAKLQADaiEADAEFIAxBfmohCgNAIAVB2ABqEAQgACAKS3JFBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgACAJLQADaiEADAELCwNAIAAgCk0EQCAAIAYgBUHYAGogCBACQQJ0aiIJLwEAOwAAIAVB2ABqIAktAAIQASAAIAktAANqIQAMAQsLAkAgACAMTw0AIAAgBiAFQdgAaiAIEAIiAEECdGoiDC0AADoAACAMLQADQQFGBEAgBUHYAGogDC0AAhABDAELIAUoAlxBH0sNACAFQdgAaiAGIABBAnRqLQACEAEgBSgCXEEhSQ0AIAVBIDYCXAsgAkF9aiEMA0BBACAHIAxJIAVBQGsQBBsEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiIAIAYgBUFAayAIEAJBAnRqIgcvAQA7AAAgBUFAayAHLQACEAEgACAHLQADaiEHDAEFIAJBfmohDANAIAVBQGsQBCAHIAxLckUEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwNAIAcgDE0EQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwJAIAcgAk8NACAHIAYgBUFAayAIEAIiAEECdGoiAi0AADoAACACLQADQQFGBEAgBUFAayACLQACEAEMAQsgBSgCREEfSw0AIAVBQGsgBiAAQQJ0ai0AAhABIAUoAkRBIUkNACAFQSA2AkQLIA5BfWohAgNAQQAgBCACSSAFQShqEAQbBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2oiACAGIAVBKGogCBACQQJ0aiIELwEAOwAAIAVBKGogBC0AAhABIAAgBC0AA2ohBAwBBSAOQX5qIQIDQCAFQShqEAQgBCACS3JFBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsDQCAEIAJNBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsCQCAEIA5PDQAgBCAGIAVBKGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBKGogAi0AAhABDAELIAUoAixBH0sNACAFQShqIAYgAEECdGotAAIQASAFKAIsQSFJDQAgBUEgNgIsCwNAQQAgAyAQSSAFQRBqEAQbBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2oiACAGIAVBEGogCBACQQJ0aiICLwEAOwAAIAVBEGogAi0AAhABIAAgAi0AA2ohAwwBBSAPQX5qIQIDQCAFQRBqEAQgAyACS3JFBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsDQCADIAJNBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsCQCADIA9PDQAgAyAGIAVBEGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBEGogAi0AAhABDAELIAUoAhRBH0sNACAFQRBqIAYgAEECdGotAAIQASAFKAIUQSFJDQAgBUEgNgIUCyABQWwgBUHYAGoQCiAFQUBrEApxIAVBKGoQCnEgBUEQahAKcRshCwwJCwAACwALAAALAAsAAAsACwAACwALQWwhCwsgBUHwAGokACALC7UEAQ5/IwBBEGsiBiQAIAZBBGogABAOQVQhBQJAIARB3AtJDQAgBi0ABCEHIANB8ARqQQBB7AAQECEIIAdBDEsNACADQdwJaiIJIAggBkEIaiAGQQxqIAEgAhAxIhAQA0UEQCAGKAIMIgQgB0sNASADQdwFaiEPIANBpAVqIREgAEEEaiESIANBqAVqIQEgBCEFA0AgBSICQX9qIQUgCCACQQJ0aigCAEUNAAsgAkEBaiEOQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgASALaiAKNgIAIAVBAWohBSAKIAxqIQoMAQsLIAEgCjYCAEEAIQUgBigCCCELA0AgBSALRkUEQCABIAUgCWotAAAiDEECdGoiDSANKAIAIg1BAWo2AgAgDyANQQF0aiINIAw6AAEgDSAFOgAAIAVBAWohBQwBCwtBACEBIANBADYCqAUgBEF/cyAHaiEJQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgAyALaiABNgIAIAwgBSAJanQgAWohASAFQQFqIQUMAQsLIAcgBEEBaiIBIAJrIgRrQQFqIQgDQEEBIQUgBCAIT0UEQANAIAUgDk9FBEAgBUECdCIJIAMgBEE0bGpqIAMgCWooAgAgBHY2AgAgBUEBaiEFDAELCyAEQQFqIQQMAQsLIBIgByAPIAogESADIAIgARBkIAZBAToABSAGIAc6AAYgACAGKAIENgIACyAQIQULIAZBEGokACAFC8ENAQt/IwBB8ABrIgUkAEFsIQkCQCADQQpJDQAgAi8AACEKIAIvAAIhDCACLwAEIQYgBUEIaiAEEA4CQCADIAYgCiAMampBBmoiDUkNACAFLQAKIQcgBUHYAGogAkEGaiICIAoQBiIJEAMNASAFQUBrIAIgCmoiAiAMEAYiCRADDQEgBUEoaiACIAxqIgIgBhAGIgkQAw0BIAVBEGogAiAGaiADIA1rEAYiCRADDQEgACABaiIOQX1qIQ8gBEEEaiEGQQEhCSAAIAFBA2pBAnYiAmoiCiACaiIMIAJqIg0hAyAMIQQgCiECA0AgCSADIA9JcQRAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAACAGIAVBQGsgBxACQQF0aiIILQAAIQsgBUFAayAILQABEAEgAiALOgAAIAYgBUEoaiAHEAJBAXRqIggtAAAhCyAFQShqIAgtAAEQASAEIAs6AAAgBiAFQRBqIAcQAkEBdGoiCC0AACELIAVBEGogCC0AARABIAMgCzoAACAGIAVB2ABqIAcQAkEBdGoiCC0AACELIAVB2ABqIAgtAAEQASAAIAs6AAEgBiAFQUBrIAcQAkEBdGoiCC0AACELIAVBQGsgCC0AARABIAIgCzoAASAGIAVBKGogBxACQQF0aiIILQAAIQsgBUEoaiAILQABEAEgBCALOgABIAYgBUEQaiAHEAJBAXRqIggtAAAhCyAFQRBqIAgtAAEQASADIAs6AAEgA0ECaiEDIARBAmohBCACQQJqIQIgAEECaiEAIAkgBUHYAGoQDUVxIAVBQGsQDUVxIAVBKGoQDUVxIAVBEGoQDUVxIQkMAQsLIAQgDUsgAiAMS3INAEFsIQkgACAKSw0BIApBfWohCQNAIAVB2ABqEAQgACAJT3JFBEAgBiAFQdgAaiAHEAJBAXRqIggtAAAhCyAFQdgAaiAILQABEAEgACALOgAAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAASAAQQJqIQAMAQsLA0AgBUHYAGoQBCAAIApPckUEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCwNAIAAgCkkEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCyAMQX1qIQADQCAFQUBrEAQgAiAAT3JFBEAgBiAFQUBrIAcQAkEBdGoiCi0AACEJIAVBQGsgCi0AARABIAIgCToAACAGIAVBQGsgBxACQQF0aiIKLQAAIQkgBUFAayAKLQABEAEgAiAJOgABIAJBAmohAgwBCwsDQCAFQUBrEAQgAiAMT3JFBEAgBiAFQUBrIAcQAkEBdGoiAC0AACEKIAVBQGsgAC0AARABIAIgCjoAACACQQFqIQIMAQsLA0AgAiAMSQRAIAYgBUFAayAHEAJBAXRqIgAtAAAhCiAFQUBrIAAtAAEQASACIAo6AAAgAkEBaiECDAELCyANQX1qIQADQCAFQShqEAQgBCAAT3JFBEAgBiAFQShqIAcQAkEBdGoiAi0AACEKIAVBKGogAi0AARABIAQgCjoAACAGIAVBKGogBxACQQF0aiICLQAAIQogBUEoaiACLQABEAEgBCAKOgABIARBAmohBAwBCwsDQCAFQShqEAQgBCANT3JFBEAgBiAFQShqIAcQAkEBdGoiAC0AACECIAVBKGogAC0AARABIAQgAjoAACAEQQFqIQQMAQsLA0AgBCANSQRAIAYgBUEoaiAHEAJBAXRqIgAtAAAhAiAFQShqIAAtAAEQASAEIAI6AAAgBEEBaiEEDAELCwNAIAVBEGoQBCADIA9PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIAYgBUEQaiAHEAJBAXRqIgAtAAAhAiAFQRBqIAAtAAEQASADIAI6AAEgA0ECaiEDDAELCwNAIAVBEGoQBCADIA5PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIANBAWohAwwBCwsDQCADIA5JBEAgBiAFQRBqIAcQAkEBdGoiAC0AACECIAVBEGogAC0AARABIAMgAjoAACADQQFqIQMMAQsLIAFBbCAFQdgAahAKIAVBQGsQCnEgBUEoahAKcSAFQRBqEApxGyEJDAELQWwhCQsgBUHwAGokACAJC8oCAQR/IwBBIGsiBSQAIAUgBBAOIAUtAAIhByAFQQhqIAIgAxAGIgIQA0UEQCAEQQRqIQIgACABaiIDQX1qIQQDQCAFQQhqEAQgACAET3JFBEAgAiAFQQhqIAcQAkEBdGoiBi0AACEIIAVBCGogBi0AARABIAAgCDoAACACIAVBCGogBxACQQF0aiIGLQAAIQggBUEIaiAGLQABEAEgACAIOgABIABBAmohAAwBCwsDQCAFQQhqEAQgACADT3JFBEAgAiAFQQhqIAcQAkEBdGoiBC0AACEGIAVBCGogBC0AARABIAAgBjoAACAAQQFqIQAMAQsLA0AgACADT0UEQCACIAVBCGogBxACQQF0aiIELQAAIQYgBUEIaiAELQABEAEgACAGOgAAIABBAWohAAwBCwsgAUFsIAVBCGoQChshAgsgBUEgaiQAIAILtgMBCX8jAEEQayIGJAAgBkEANgIMIAZBADYCCEFUIQQCQAJAIANBQGsiDCADIAZBCGogBkEMaiABIAIQMSICEAMNACAGQQRqIAAQDiAGKAIMIgcgBi0ABEEBaksNASAAQQRqIQogBkEAOgAFIAYgBzoABiAAIAYoAgQ2AgAgB0EBaiEJQQEhBANAIAQgCUkEQCADIARBAnRqIgEoAgAhACABIAU2AgAgACAEQX9qdCAFaiEFIARBAWohBAwBCwsgB0EBaiEHQQAhBSAGKAIIIQkDQCAFIAlGDQEgAyAFIAxqLQAAIgRBAnRqIgBBASAEdEEBdSILIAAoAgAiAWoiADYCACAHIARrIQhBACEEAkAgC0EDTQRAA0AgBCALRg0CIAogASAEakEBdGoiACAIOgABIAAgBToAACAEQQFqIQQMAAALAAsDQCABIABPDQEgCiABQQF0aiIEIAg6AAEgBCAFOgAAIAQgCDoAAyAEIAU6AAIgBCAIOgAFIAQgBToABCAEIAg6AAcgBCAFOgAGIAFBBGohAQwAAAsACyAFQQFqIQUMAAALAAsgAiEECyAGQRBqJAAgBAutAQECfwJAQYQgKAIAIABHIAAoAgBBAXYiAyABa0F4aiICQXhxQQhHcgR/IAIFIAMQJ0UNASACQQhqC0EQSQ0AIAAgACgCACICQQFxIAAgAWpBD2pBeHEiASAAa0EBdHI2AgAgASAANgIEIAEgASgCAEEBcSAAIAJBAXZqIAFrIgJBAXRyNgIAQYQgIAEgAkH/////B3FqQQRqQYQgKAIAIABGGyABNgIAIAEQJQsLygIBBX8CQAJAAkAgAEEIIABBCEsbZ0EfcyAAaUEBR2oiAUEESSAAIAF2cg0AIAFBAnRB/B5qKAIAIgJFDQADQCACQXhqIgMoAgBBAXZBeGoiBSAATwRAIAIgBUEIIAVBCEsbZ0Efc0ECdEGAH2oiASgCAEYEQCABIAIoAgQ2AgALDAMLIARBHksNASAEQQFqIQQgAigCBCICDQALC0EAIQMgAUEgTw0BA0AgAUECdEGAH2ooAgAiAkUEQCABQR5LIQIgAUEBaiEBIAJFDQEMAwsLIAIgAkF4aiIDKAIAQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgBGBEAgASACKAIENgIACwsgAigCACIBBEAgASACKAIENgIECyACKAIEIgEEQCABIAIoAgA2AgALIAMgAygCAEEBcjYCACADIAAQNwsgAwvhCwINfwV+IwBB8ABrIgckACAHIAAoAvDhASIINgJcIAEgAmohDSAIIAAoAoDiAWohDwJAAkAgBUUEQCABIQQMAQsgACgCxOABIRAgACgCwOABIREgACgCvOABIQ4gAEEBNgKM4QFBACEIA0AgCEEDRwRAIAcgCEECdCICaiAAIAJqQazQAWooAgA2AkQgCEEBaiEIDAELC0FsIQwgB0EYaiADIAQQBhADDQEgB0EsaiAHQRhqIAAoAgAQEyAHQTRqIAdBGGogACgCCBATIAdBPGogB0EYaiAAKAIEEBMgDUFgaiESIAEhBEEAIQwDQCAHKAIwIAcoAixBA3RqKQIAIhRCEIinQf8BcSEIIAcoAkAgBygCPEEDdGopAgAiFUIQiKdB/wFxIQsgBygCOCAHKAI0QQN0aikCACIWQiCIpyEJIBVCIIghFyAUQiCIpyECAkAgFkIQiKdB/wFxIgNBAk8EQAJAIAZFIANBGUlyRQRAIAkgB0EYaiADQSAgBygCHGsiCiAKIANLGyIKEAUgAyAKayIDdGohCSAHQRhqEAQaIANFDQEgB0EYaiADEAUgCWohCQwBCyAHQRhqIAMQBSAJaiEJIAdBGGoQBBoLIAcpAkQhGCAHIAk2AkQgByAYNwNIDAELAkAgA0UEQCACBEAgBygCRCEJDAMLIAcoAkghCQwBCwJAAkAgB0EYakEBEAUgCSACRWpqIgNBA0YEQCAHKAJEQX9qIgMgA0VqIQkMAQsgA0ECdCAHaigCRCIJIAlFaiEJIANBAUYNAQsgByAHKAJINgJMCwsgByAHKAJENgJIIAcgCTYCRAsgF6chAyALBEAgB0EYaiALEAUgA2ohAwsgCCALakEUTwRAIAdBGGoQBBoLIAgEQCAHQRhqIAgQBSACaiECCyAHQRhqEAQaIAcgB0EYaiAUQhiIp0H/AXEQCCAUp0H//wNxajYCLCAHIAdBGGogFUIYiKdB/wFxEAggFadB//8DcWo2AjwgB0EYahAEGiAHIAdBGGogFkIYiKdB/wFxEAggFqdB//8DcWo2AjQgByACNgJgIAcoAlwhCiAHIAk2AmggByADNgJkAkACQAJAIAQgAiADaiILaiASSw0AIAIgCmoiEyAPSw0AIA0gBGsgC0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgAhDSAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogB0EoaiAfQhiIp0H/AXEQCCEOIAdB8ABqIARBBHRqIgsgCSANaiAIazYCDCALIAg2AgggCyADNgIEIAsgAjYCACAHIA4gH6dB//8DcWo2AkQgBEEBaiEEDAELCyAEIBdIDQEgEkFgaiEYIAdB4ABqIRogB0HkAGohGyABIQMDQCAHQShqEARBAksgBCAFTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEIIAcoAkggBygCREEDdGopAgAiH0IgiKchCSAeQiCIISAgHUIgiKchDAJAIB9CEIinQf8BcSICQQJPBEACQCAGRSACQRlJckUEQCAJIAdBKGogAkEgIAcoAixrIgogCiACSxsiChAFIAIgCmsiAnRqIQkgB0EoahAEGiACRQ0BIAdBKGogAhAFIAlqIQkMAQsgB0EoaiACEAUgCWohCSAHQShqEAQaCyAHKQJUISEgByAJNgJUIAcgITcDWAwBCwJAIAJFBEAgDARAIAcoAlQhCQwDCyAHKAJYIQkMAQsCQAJAIAdBKGpBARAFIAkgDEVqaiICQQNGBEAgBygCVEF/aiICIAJFaiEJDAELIAJBAnQgB2ooAlQiCSAJRWohCSACQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAk2AlQLICCnIRQgCARAIAdBKGogCBAFIBRqIRQLIAggC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgDGohDAsgB0EoahAEGiAHIAcoAmggDGoiGSAUajYCaCAbIBogCSAZSxsoAgAhHCAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogByAHQShqIB9CGIinQf8BcRAIIB+nQf//A3FqNgJEIAcgB0HwAGogBEEDcUEEdGoiDSkDCCIdNwPIASAHIA0pAwAiHjcDwAECQAJAAkAgBygCvAEiDiAepyICaiIWIBNLDQAgAyAHKALEASIKIAJqIgtqIBhLDQAgEiADayALQSBqTw0BCyAHIAcpA8gBNwMQIAcgBykDwAE3AwggAyASIAdBCGogB0G8AWogEyAPIBUgERAeIQsMAQsgAiADaiEIIAMgDhAHIAJBEU8EQCADQRBqIQIDQCACIA5BEGoiDhAHIAJBEGoiAiAISQ0ACwsgCCAdpyIOayECIAcgFjYCvAEgDiAIIA9rSwRAIA4gCCAVa0sEQEFsIQsMAgsgESACIA9rIgJqIhYgCmogEU0EQCAIIBYgChAPGgwCCyAIIBZBACACaxAPIQggByACIApqIgo2AsQBIAggAmshCCAPIQILIA5BEE8EQCAIIApqIQoDQCAIIAIQByACQRBqIQIgCEEQaiIIIApJDQALDAELAkAgDkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgDkECdCIKQcAeaigCAGoiAhAXIAIgCkHgHmooAgBrIQIgBygCxAEhCgwBCyAIIAIQDAsgCkEJSQ0AIAggCmohCiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAKSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAKSQ0ACwsgCxADBEAgCyEQDAQFIA0gDDYCACANIBkgHGogCWs2AgwgDSAJNgIIIA0gFDYCBCAEQQFqIQQgAyALaiEDDAILAAsLIAQgBUgNASAEIBdrIQtBACEEA0AgCyAFSARAIAcgB0HwAGogC0EDcUEEdGoiAikDCCIdNwPIASAHIAIpAwAiHjcDwAECQAJAAkAgBygCvAEiDCAepyICaiIKIBNLDQAgAyAHKALEASIJIAJqIhBqIBhLDQAgEiADayAQQSBqTw0BCyAHIAcpA8gBNwMgIAcgBykDwAE3AxggAyASIAdBGGogB0G8AWogEyAPIBUgERAeIRAMAQsgAiADaiEIIAMgDBAHIAJBEU8EQCADQRBqIQIDQCACIAxBEGoiDBAHIAJBEGoiAiAISQ0ACwsgCCAdpyIGayECIAcgCjYCvAEgBiAIIA9rSwRAIAYgCCAVa0sEQEFsIRAMAgsgESACIA9rIgJqIgwgCWogEU0EQCAIIAwgCRAPGgwCCyAIIAxBACACaxAPIQggByACIAlqIgk2AsQBIAggAmshCCAPIQILIAZBEE8EQCAIIAlqIQYDQCAIIAIQByACQRBqIQIgCEEQaiIIIAZJDQALDAELAkAgBkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgBkECdCIGQcAeaigCAGoiAhAXIAIgBkHgHmooAgBrIQIgBygCxAEhCQwBCyAIIAIQDAsgCUEJSQ0AIAggCWohBiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAGSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAGSQ0ACwsgEBADDQMgC0EBaiELIAMgEGohAwwBCwsDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIgUQAw0AIAMoAnwiBkEfSw0AIAMoAngiB0EJTw0AIABBiCBqIAMgBkGAC0GADCAHEBggA0E0NgJ8IAMgA0H8AGogA0H4AGogBCAFaiIEIAIgBGsQFSIFEAMNACADKAJ8IgZBNEsNACADKAJ4IgdBCk8NACAAQZAwaiADIAZBgA1B4A4gBxAYIANBIzYCfCADIANB/ABqIANB+ABqIAQgBWoiBCACIARrEBUiBRADDQAgAygCfCIGQSNLDQAgAygCeCIHQQpPDQAgACADIAZBwBBB0BEgBxAYIAQgBWoiBEEMaiIFIAJLDQAgAiAFayEFQQAhAgNAIAJBA0cEQCAEKAAAIgZBf2ogBU8NAiAAIAJBAnRqQZzQAWogBjYCACACQQFqIQIgBEEEaiEEDAELCyAEIAFrIQgLIANBgAFqJAAgCAtGAQN/IABBCGohAyAAKAIEIQJBACEAA0AgACACdkUEQCABIAMgAEEDdGotAAJBFktqIQEgAEEBaiEADAELCyABQQggAmt0C4YDAQV/Qbh/IQcCQCADRQ0AIAItAAAiBEUEQCABQQA2AgBBAUG4fyADQQFGGw8LAn8gAkEBaiIFIARBGHRBGHUiBkF/Sg0AGiAGQX9GBEAgA0EDSA0CIAUvAABBgP4BaiEEIAJBA2oMAQsgA0ECSA0BIAItAAEgBEEIdHJBgIB+aiEEIAJBAmoLIQUgASAENgIAIAVBAWoiASACIANqIgNLDQBBbCEHIABBEGogACAFLQAAIgVBBnZBI0EJIAEgAyABa0HAEEHQEUHwEiAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBmCBqIABBCGogBUEEdkEDcUEfQQggASABIAZqIAgbIgEgAyABa0GAC0GADEGAFyAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBoDBqIABBBGogBUECdkEDcUE0QQkgASABIAZqIAgbIgEgAyABa0GADUHgDkGQGSAAKAKM4QEgACgCnOIBIAQQHyIAEAMNACAAIAFqIAJrIQcLIAcLrQMBCn8jAEGABGsiCCQAAn9BUiACQf8BSw0AGkFUIANBDEsNABogAkEBaiELIABBBGohCUGAgAQgA0F/anRBEHUhCkEAIQJBASEEQQEgA3QiB0F/aiIMIQUDQCACIAtGRQRAAkAgASACQQF0Ig1qLwEAIgZB//8DRgRAIAkgBUECdGogAjoAAiAFQX9qIQVBASEGDAELIARBACAKIAZBEHRBEHVKGyEECyAIIA1qIAY7AQAgAkEBaiECDAELCyAAIAQ7AQIgACADOwEAIAdBA3YgB0EBdmpBA2ohBkEAIQRBACECA0AgBCALRkUEQCABIARBAXRqLgEAIQpBACEAA0AgACAKTkUEQCAJIAJBAnRqIAQ6AAIDQCACIAZqIAxxIgIgBUsNAAsgAEEBaiEADAELCyAEQQFqIQQMAQsLQX8gAg0AGkEAIQIDfyACIAdGBH9BAAUgCCAJIAJBAnRqIgAtAAJBAXRqIgEgAS8BACIBQQFqOwEAIAAgAyABEBRrIgU6AAMgACABIAVB/wFxdCAHazsBACACQQFqIQIMAQsLCyEFIAhBgARqJAAgBQvjBgEIf0FsIQcCQCACQQNJDQACQAJAAkACQCABLQAAIgNBA3EiCUEBaw4DAwEAAgsgACgCiOEBDQBBYg8LIAJBBUkNAkEDIQYgASgAACEFAn8CQAJAIANBAnZBA3EiCEF+aiIEQQFNBEAgBEEBaw0BDAILIAVBDnZB/wdxIQQgBUEEdkH/B3EhAyAIRQwCCyAFQRJ2IQRBBCEGIAVBBHZB//8AcSEDQQAMAQsgBUEEdkH//w9xIgNBgIAISw0DIAEtAARBCnQgBUEWdnIhBEEFIQZBAAshBSAEIAZqIgogAksNAgJAIANBgQZJDQAgACgCnOIBRQ0AQQAhAgNAIAJBg4ABSw0BIAJBQGshAgwAAAsACwJ/IAlBA0YEQCABIAZqIQEgAEHw4gFqIQIgACgCDCEGIAUEQCACIAMgASAEIAYQXwwCCyACIAMgASAEIAYQXQwBCyAAQbjQAWohAiABIAZqIQEgAEHw4gFqIQYgAEGo0ABqIQggBQRAIAggBiADIAEgBCACEF4MAQsgCCAGIAMgASAEIAIQXAsQAw0CIAAgAzYCgOIBIABBATYCiOEBIAAgAEHw4gFqNgLw4QEgCUECRgRAIAAgAEGo0ABqNgIMCyAAIANqIgBBiOMBakIANwAAIABBgOMBakIANwAAIABB+OIBakIANwAAIABB8OIBakIANwAAIAoPCwJ/AkACQAJAIANBAnZBA3FBf2oiBEECSw0AIARBAWsOAgACAQtBASEEIANBA3YMAgtBAiEEIAEvAABBBHYMAQtBAyEEIAEQIUEEdgsiAyAEaiIFQSBqIAJLBEAgBSACSw0CIABB8OIBaiABIARqIAMQCyEBIAAgAzYCgOIBIAAgATYC8OEBIAEgA2oiAEIANwAYIABCADcAECAAQgA3AAggAEIANwAAIAUPCyAAIAM2AoDiASAAIAEgBGo2AvDhASAFDwsCfwJAAkACQCADQQJ2QQNxQX9qIgRBAksNACAEQQFrDgIAAgELQQEhByADQQN2DAILQQIhByABLwAAQQR2DAELIAJBBEkgARAhIgJBj4CAAUtyDQFBAyEHIAJBBHYLIQIgAEHw4gFqIAEgB2otAAAgAkEgahAQIQEgACACNgKA4gEgACABNgLw4QEgB0EBaiEHCyAHC0sAIABC+erQ0OfJoeThADcDICAAQgA3AxggAELP1tO+0ser2UI3AxAgAELW64Lu6v2J9eAANwMIIABCADcDACAAQShqQQBBKBAQGgviAgICfwV+IABBKGoiASAAKAJIaiECAn4gACkDACIDQiBaBEAgACkDECIEQgeJIAApAwgiBUIBiXwgACkDGCIGQgyJfCAAKQMgIgdCEol8IAUQGSAEEBkgBhAZIAcQGQwBCyAAKQMYQsXP2bLx5brqJ3wLIAN8IQMDQCABQQhqIgAgAk0EQEIAIAEpAAAQCSADhUIbiUKHla+vmLbem55/fkLj3MqV/M7y9YV/fCEDIAAhAQwBCwsCQCABQQRqIgAgAksEQCABIQAMAQsgASgAAK1Ch5Wvr5i23puef34gA4VCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMLA0AgACACSQRAIAAxAABCxc/ZsvHluuonfiADhUILiUKHla+vmLbem55/fiEDIABBAWohAAwBCwsgA0IhiCADhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC+8CAgJ/BH4gACAAKQMAIAKtfDcDAAJAAkAgACgCSCIDIAJqIgRBH00EQCABRQ0BIAAgA2pBKGogASACECAgACgCSCACaiEEDAELIAEgAmohAgJ/IAMEQCAAQShqIgQgA2ogAUEgIANrECAgACAAKQMIIAQpAAAQCTcDCCAAIAApAxAgACkAMBAJNwMQIAAgACkDGCAAKQA4EAk3AxggACAAKQMgIABBQGspAAAQCTcDICAAKAJIIQMgAEEANgJIIAEgA2tBIGohAQsgAUEgaiACTQsEQCACQWBqIQMgACkDICEFIAApAxghBiAAKQMQIQcgACkDCCEIA0AgCCABKQAAEAkhCCAHIAEpAAgQCSEHIAYgASkAEBAJIQYgBSABKQAYEAkhBSABQSBqIgEgA00NAAsgACAFNwMgIAAgBjcDGCAAIAc3AxAgACAINwMICyABIAJPDQEgAEEoaiABIAIgAWsiBBAgCyAAIAQ2AkgLCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQEBogAwVBun8LCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQCxogAwVBun8LC6gCAQZ/IwBBEGsiByQAIABB2OABaikDAEKAgIAQViEIQbh/IQUCQCAEQf//B0sNACAAIAMgBBBCIgUQAyIGDQAgACgCnOIBIQkgACAHQQxqIAMgAyAFaiAGGyIKIARBACAFIAYbayIGEEAiAxADBEAgAyEFDAELIAcoAgwhBCABRQRAQbp/IQUgBEEASg0BCyAGIANrIQUgAyAKaiEDAkAgCQRAIABBADYCnOIBDAELAkACQAJAIARBBUgNACAAQdjgAWopAwBCgICACFgNAAwBCyAAQQA2ApziAQwBCyAAKAIIED8hBiAAQQA2ApziASAGQRRPDQELIAAgASACIAMgBSAEIAgQOSEFDAELIAAgASACIAMgBSAEIAgQOiEFCyAHQRBqJAAgBQtnACAAQdDgAWogASACIAAoAuzhARAuIgEQAwRAIAEPC0G4fyECAkAgAQ0AIABB7OABaigCACIBBEBBYCECIAAoApjiASABRw0BC0EAIQIgAEHw4AFqKAIARQ0AIABBkOEBahBDCyACCycBAX8QVyIERQRAQUAPCyAEIAAgASACIAMgBBBLEE8hACAEEFYgAAs/AQF/AkACQAJAIAAoAqDiAUEBaiIBQQJLDQAgAUEBaw4CAAECCyAAEDBBAA8LIABBADYCoOIBCyAAKAKU4gELvAMCB38BfiMAQRBrIgkkAEG4fyEGAkAgBCgCACIIQQVBCSAAKALs4QEiBRtJDQAgAygCACIHQQFBBSAFGyAFEC8iBRADBEAgBSEGDAELIAggBUEDakkNACAAIAcgBRBJIgYQAw0AIAEgAmohCiAAQZDhAWohCyAIIAVrIQIgBSAHaiEHIAEhBQNAIAcgAiAJECwiBhADDQEgAkF9aiICIAZJBEBBuH8hBgwCCyAJKAIAIghBAksEQEFsIQYMAgsgB0EDaiEHAn8CQAJAAkAgCEEBaw4CAgABCyAAIAUgCiAFayAHIAYQSAwCCyAFIAogBWsgByAGEEcMAQsgBSAKIAVrIActAAAgCSgCCBBGCyIIEAMEQCAIIQYMAgsgACgC8OABBEAgCyAFIAgQRQsgAiAGayECIAYgB2ohByAFIAhqIQUgCSgCBEUNAAsgACkD0OABIgxCf1IEQEFsIQYgDCAFIAFrrFINAQsgACgC8OABBEBBaiEGIAJBBEkNASALEEQhDCAHKAAAIAynRw0BIAdBBGohByACQXxqIQILIAMgBzYCACAEIAI2AgAgBSABayEGCyAJQRBqJAAgBgsuACAAECsCf0EAQQAQAw0AGiABRSACRXJFBEBBYiAAIAEgAhA9EAMNARoLQQALCzcAIAEEQCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBSQAIAVBCGogAiADEAYiAhADRQRAIAAgAWoiB0F9aiEGIAUgBBAOIARBBGohAiAFLQACIQMDQEEAIAAgBkkgBUEIahAEGwRAIAAgAiAFQQhqIAMQAkECdGoiBC8BADsAACAFQQhqIAQtAAIQASAAIAQtAANqIgQgAiAFQQhqIAMQAkECdGoiAC8BADsAACAFQQhqIAAtAAIQASAEIAAtAANqIQAMAQUgB0F+aiEEA0AgBUEIahAEIAAgBEtyRQRAIAAgAiAFQQhqIAMQAkECdGoiBi8BADsAACAFQQhqIAYtAAIQASAAIAYtAANqIQAMAQsLA0AgACAES0UEQCAAIAIgBUEIaiADEAJBAnRqIgYvAQA7AAAgBUEIaiAGLQACEAEgACAGLQADaiEADAELCwJAIAAgB08NACAAIAIgBUEIaiADEAIiA0ECdGoiAC0AADoAACAALQADQQFGBEAgBUEIaiAALQACEAEMAQsgBSgCDEEfSw0AIAVBCGogAiADQQJ0ai0AAhABIAUoAgxBIUkNACAFQSA2AgwLIAFBbCAFQQhqEAobIQILCwsgBUEgaiQAIAILkgIBBH8jAEFAaiIJJAAgCSADQTQQCyEDAkAgBEECSA0AIAMgBEECdGooAgAhCSADQTxqIAgQIyADQQE6AD8gAyACOgA+QQAhBCADKAI8IQoDQCAEIAlGDQEgACAEQQJ0aiAKNgEAIARBAWohBAwAAAsAC0EAIQkDQCAGIAlGRQRAIAMgBSAJQQF0aiIKLQABIgtBAnRqIgwoAgAhBCADQTxqIAotAABBCHQgCGpB//8DcRAjIANBAjoAPyADIAcgC2siCiACajoAPiAEQQEgASAKa3RqIQogAygCPCELA0AgACAEQQJ0aiALNgEAIARBAWoiBCAKSQ0ACyAMIAo2AgAgCUEBaiEJDAELCyADQUBrJAALowIBCX8jAEHQAGsiCSQAIAlBEGogBUE0EAsaIAcgBmshDyAHIAFrIRADQAJAIAMgCkcEQEEBIAEgByACIApBAXRqIgYtAAEiDGsiCGsiC3QhDSAGLQAAIQ4gCUEQaiAMQQJ0aiIMKAIAIQYgCyAPTwRAIAAgBkECdGogCyAIIAUgCEE0bGogCCAQaiIIQQEgCEEBShsiCCACIAQgCEECdGooAgAiCEEBdGogAyAIayAHIA4QYyAGIA1qIQgMAgsgCUEMaiAOECMgCUEBOgAPIAkgCDoADiAGIA1qIQggCSgCDCELA0AgBiAITw0CIAAgBkECdGogCzYBACAGQQFqIQYMAAALAAsgCUHQAGokAA8LIAwgCDYCACAKQQFqIQoMAAALAAs0ACAAIAMgBCAFEDYiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQNAVBuH8LCyMAIAA/AEEQdGtB//8DakEQdkAAQX9GBEBBAA8LQQAQAEEBCzsBAX8gAgRAA0AgACABIAJBgCAgAkGAIEkbIgMQCyEAIAFBgCBqIQEgAEGAIGohACACIANrIgINAAsLCwYAIAAQAwsLqBUJAEGICAsNAQAAAAEAAAACAAAAAgBBoAgLswYBAAAAAQAAAAIAAAACAAAAJgAAAIIAAAAhBQAASgAAAGcIAAAmAAAAwAEAAIAAAABJBQAASgAAAL4IAAApAAAALAIAAIAAAABJBQAASgAAAL4IAAAvAAAAygIAAIAAAACKBQAASgAAAIQJAAA1AAAAcwMAAIAAAACdBQAASgAAAKAJAAA9AAAAgQMAAIAAAADrBQAASwAAAD4KAABEAAAAngMAAIAAAABNBgAASwAAAKoKAABLAAAAswMAAIAAAADBBgAATQAAAB8NAABNAAAAUwQAAIAAAAAjCAAAUQAAAKYPAABUAAAAmQQAAIAAAABLCQAAVwAAALESAABYAAAA2gQAAIAAAABvCQAAXQAAACMUAABUAAAARQUAAIAAAABUCgAAagAAAIwUAABqAAAArwUAAIAAAAB2CQAAfAAAAE4QAAB8AAAA0gIAAIAAAABjBwAAkQAAAJAHAACSAAAAAAAAAAEAAAABAAAABQAAAA0AAAAdAAAAPQAAAH0AAAD9AAAA/QEAAP0DAAD9BwAA/Q8AAP0fAAD9PwAA/X8AAP3/AAD9/wEA/f8DAP3/BwD9/w8A/f8fAP3/PwD9/38A/f//AP3//wH9//8D/f//B/3//w/9//8f/f//P/3//38AAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACUAAAAnAAAAKQAAACsAAAAvAAAAMwAAADsAAABDAAAAUwAAAGMAAACDAAAAAwEAAAMCAAADBAAAAwgAAAMQAAADIAAAA0AAAAOAAAADAAEAQeAPC1EBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAQcQQC4sBAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABIAAAAUAAAAFgAAABgAAAAcAAAAIAAAACgAAAAwAAAAQAAAAIAAAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAQAAAAIAAAAAAAQBBkBIL5gQBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAAAEAAAAEAAAACAAAAAAAAAABAAEBBgAAAAAAAAQAAAAAEAAABAAAAAAgAAAFAQAAAAAAAAUDAAAAAAAABQQAAAAAAAAFBgAAAAAAAAUHAAAAAAAABQkAAAAAAAAFCgAAAAAAAAUMAAAAAAAABg4AAAAAAAEFEAAAAAAAAQUUAAAAAAABBRYAAAAAAAIFHAAAAAAAAwUgAAAAAAAEBTAAAAAgAAYFQAAAAAAABwWAAAAAAAAIBgABAAAAAAoGAAQAAAAADAYAEAAAIAAABAAAAAAAAAAEAQAAAAAAAAUCAAAAIAAABQQAAAAAAAAFBQAAACAAAAUHAAAAAAAABQgAAAAgAAAFCgAAAAAAAAULAAAAAAAABg0AAAAgAAEFEAAAAAAAAQUSAAAAIAABBRYAAAAAAAIFGAAAACAAAwUgAAAAAAADBSgAAAAAAAYEQAAAABAABgRAAAAAIAAHBYAAAAAAAAkGAAIAAAAACwYACAAAMAAABAAAAAAQAAAEAQAAACAAAAUCAAAAIAAABQMAAAAgAAAFBQAAACAAAAUGAAAAIAAABQgAAAAgAAAFCQAAACAAAAULAAAAIAAABQwAAAAAAAAGDwAAACAAAQUSAAAAIAABBRQAAAAgAAIFGAAAACAAAgUcAAAAIAADBSgAAAAgAAQFMAAAAAAAEAYAAAEAAAAPBgCAAAAAAA4GAEAAAAAADQYAIABBgBcLhwIBAAEBBQAAAAAAAAUAAAAAAAAGBD0AAAAAAAkF/QEAAAAADwX9fwAAAAAVBf3/HwAAAAMFBQAAAAAABwR9AAAAAAAMBf0PAAAAABIF/f8DAAAAFwX9/38AAAAFBR0AAAAAAAgE/QAAAAAADgX9PwAAAAAUBf3/DwAAAAIFAQAAABAABwR9AAAAAAALBf0HAAAAABEF/f8BAAAAFgX9/z8AAAAEBQ0AAAAQAAgE/QAAAAAADQX9HwAAAAATBf3/BwAAAAEFAQAAABAABgQ9AAAAAAAKBf0DAAAAABAF/f8AAAAAHAX9//8PAAAbBf3//wcAABoF/f//AwAAGQX9//8BAAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",Ig=new WeakMap;let Cg=0,Mg;class Ji extends la{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new hN,this.workerSourceURL="",this.workerConfig=null,typeof MSC_TRANSCODER<"u"&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}async detectSupportAsync(e){return this.workerConfig={astcSupported:await e.hasFeatureAsync("texture-compression-astc"),etc1Supported:await e.hasFeatureAsync("texture-compression-etc1"),etc2Supported:await e.hasFeatureAsync("texture-compression-etc2"),dxtSupported:await e.hasFeatureAsync("texture-compression-bc"),bptcSupported:await e.hasFeatureAsync("texture-compression-bptc"),pvrtcSupported:await e.hasFeatureAsync("texture-compression-pvrtc")},this}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-bc"),bptcSupported:e.hasFeature("texture-compression-bptc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:(this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},this.workerConfig.etc1Supported=!1),this}init(){if(!this.transcoderPending){const e=new Rl(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),n=new Rl(this.manager);n.setPath(this.transcoderPath),n.setResponseType("arraybuffer"),n.setWithCredentials(this.withCredentials);const i=n.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,i]).then(([s,o])=>{const c=Ji.BasisWorker.toString(),h=["/* constants */","let _EngineFormat = "+JSON.stringify(Ji.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(Ji.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(Ji.BasisFormat),"/* basis_transcoder.js */",s,"/* worker */",c.substring(c.indexOf("{")+1,c.lastIndexOf("}"))].join(`
3829
3829
  `);this.workerSourceURL=URL.createObjectURL(new Blob([h])),this.transcoderBinary=o,this.workerPool.setWorkerCreator(()=>{const u=new Worker(this.workerSourceURL),d=this.transcoderBinary.slice(0);return u.postMessage({type:"init",config:this.workerConfig,transcoderBinary:d},[d]),u})}),Cg>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),Cg++}return this.transcoderPending}load(e,t,n,i){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const s=new Rl(this.manager);s.setResponseType("arraybuffer"),s.setWithCredentials(this.withCredentials),s.load(e,o=>{if(Ig.has(o))return Ig.get(o).promise.then(t).catch(i);this._createTexture(o).then(c=>t?t(c):null).catch(i)},n,i)}_createTextureFrom(e,t){const{faces:n,width:i,height:s,format:o,type:c,error:h,dfdFlags:u}=e;if(c==="error")return Promise.reject(h);let d;if(t.faceCount===6)d=new JL(n,o,pr);else{const A=n[0].mipmaps;d=t.layerCount>1?new KL(A,i,s,t.layerCount,o,pr):new Nd(A,i,s,o,pr)}return d.minFilter=n[0].mipmaps.length===1?fr:xi,d.magFilter=fr,d.generateMipmaps=!1,d.needsUpdate=!0,d.colorSpace=Rx(t),d.premultiplyAlpha=!!(u&fN),d}async _createTexture(e,t={}){const n=vN(new Uint8Array(e));if(n.vkFormat!==mN)return xN(n);const i=t,s=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:i},[e])).then(o=>this._createTextureFrom(o.data,n));return Ig.set(e,{promise:s}),s}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),Cg--,this}}Ji.BasisFormat={ETC1S:0,UASTC_4x4:1},Ji.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16},Ji.EngineFormat={RGBAFormat:Ar,RGBA_ASTC_4x4_Format:yA,RGBA_BPTC_Format:Zh,RGBA_ETC2_EAC_Format:vA,RGBA_PVRTC_4BPPV1_Format:gA,RGBA_S3TC_DXT5_Format:Kh,RGB_ETC1_Format:mA,RGB_ETC2_Format:_A,RGB_PVRTC_4BPPV1_Format:AA,RGB_S3TC_DXT1_Format:Xh},Ji.BasisWorker=function(){let r,e,t;const n=_EngineFormat,i=_TranscoderFormat,s=_BasisFormat;self.addEventListener("message",function(v){const E=v.data;switch(E.type){case"init":r=E.config,o(E.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:m,buffers:_,width:w,height:x,hasAlpha:I,format:R,dfdFlags:S}=c(E.buffer);self.postMessage({type:"transcode",id:E.id,faces:m,width:w,height:x,hasAlpha:I,format:R,dfdFlags:S},_)}catch(m){console.error(m),self.postMessage({type:"error",id:E.id,error:m.message})}});break}});function o(v){e=new Promise(E=>{t={wasmBinary:v,onRuntimeInitialized:E},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function c(v){const E=new t.KTX2File(new Uint8Array(v));function m(){E.close(),E.delete()}if(!E.isValid())throw m(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");const _=E.isUASTC()?s.UASTC_4x4:s.ETC1S,w=E.getWidth(),x=E.getHeight(),I=E.getLayers()||1,R=E.getLevels(),S=E.getFaces(),T=E.getHasAlpha(),D=E.getDFDFlags(),{transcoderFormat:b,engineFormat:M}=A(_,w,x,T);if(!w||!x||!R)throw m(),new Error("THREE.KTX2Loader: Invalid texture");if(!E.startTranscoding())throw m(),new Error("THREE.KTX2Loader: .startTranscoding failed");const L=[],P=[];for(let N=0;N<S;N++){const j=[];for(let X=0;X<R;X++){const K=[];let ne,V;for(let Q=0;Q<I;Q++){const z=E.getImageLevelInfo(X,Q,N);N===0&&X===0&&Q===0&&(z.origWidth%4!==0||z.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),R>1?(ne=z.origWidth,V=z.origHeight):(ne=z.width,V=z.height);const Z=new Uint8Array(E.getImageTranscodedSizeInBytes(X,Q,0,b));if(!E.transcodeImage(Z,X,Q,N,b,0,-1,-1))throw m(),new Error("THREE.KTX2Loader: .transcodeImage failed.");K.push(Z)}const te=g(K);j.push({data:te,width:ne,height:V}),P.push(te.buffer)}L.push({mipmaps:j,width:w,height:x,format:M})}return m(),{faces:L,buffers:P,width:w,height:x,hasAlpha:T,format:M,dfdFlags:D}}const h=[{if:"astcSupported",basisFormat:[s.UASTC_4x4],transcoderFormat:[i.ASTC_4x4,i.ASTC_4x4],engineFormat:[n.RGBA_ASTC_4x4_Format,n.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.BC7_M5,i.BC7_M5],engineFormat:[n.RGBA_BPTC_Format,n.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.BC1,i.BC3],engineFormat:[n.RGB_S3TC_DXT1_Format,n.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.ETC1,i.ETC2],engineFormat:[n.RGB_ETC2_Format,n.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.ETC1],engineFormat:[n.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.PVRTC1_4_RGB,i.PVRTC1_4_RGBA],engineFormat:[n.RGB_PVRTC_4BPPV1_Format,n.RGBA_PVRTC_4BPPV1_Format],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0}],u=h.sort(function(v,E){return v.priorityETC1S-E.priorityETC1S}),d=h.sort(function(v,E){return v.priorityUASTC-E.priorityUASTC});function A(v,E,m,_){let w,x;const I=v===s.ETC1S?u:d;for(let R=0;R<I.length;R++){const S=I[R];if(r[S.if]&&S.basisFormat.includes(v)&&!(_&&S.transcoderFormat.length<2)&&!(S.needsPowerOfTwo&&!(p(E)&&p(m))))return w=S.transcoderFormat[_?1:0],x=S.engineFormat[_?1:0],{transcoderFormat:w,engineFormat:x}}return console.warn("THREE.KTX2Loader: No suitable compressed texture format found. Decoding to RGBA32."),w=i.RGBA32,x=n.RGBAFormat,{transcoderFormat:w,engineFormat:x}}function p(v){return v<=2?!0:(v&v-1)===0&&v!==0}function g(v){if(v.length===1)return v[0];let E=0;for(let w=0;w<v.length;w++){const x=v[w];E+=x.byteLength}const m=new Uint8Array(E);let _=0;for(let w=0;w<v.length;w++){const x=v[w];m.set(x,_),_+=x.byteLength}return m}};const EN=new Set([Ar,no,$s]),Sg={[Mx]:Ar,[wx]:Ar,[vx]:Ar,[yx]:Ar,[Cx]:no,[xx]:no,[mx]:no,[_x]:no,[Ix]:$s,[Ex]:$s,[gx]:$s,[Ax]:$s,[Tx]:Jh,[Sx]:Jh},Tg={[Mx]:or,[wx]:_n,[vx]:pr,[yx]:pr,[Cx]:or,[xx]:_n,[mx]:pr,[_x]:pr,[Ix]:or,[Ex]:_n,[gx]:pr,[Ax]:pr,[Tx]:pr,[Sx]:pr};async function xN(r){const{vkFormat:e}=r;if(Sg[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");let t;r.supercompressionScheme===fx&&(Mg||(Mg=new Promise(async s=>{const o=new yN;await o.init(),s(o)})),t=await Mg);const n=[];for(let s=0;s<r.levels.length;s++){const o=Math.max(1,r.pixelWidth>>s),c=Math.max(1,r.pixelHeight>>s),h=r.pixelDepth?Math.max(1,r.pixelDepth>>s):0,u=r.levels[s];let d;if(r.supercompressionScheme===dN)d=u.levelData;else if(r.supercompressionScheme===fx)d=t.decode(u.levelData,u.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let A;Tg[e]===or?A=new Float32Array(d.buffer,d.byteOffset,d.byteLength/Float32Array.BYTES_PER_ELEMENT):Tg[e]===_n?A=new Uint16Array(d.buffer,d.byteOffset,d.byteLength/Uint16Array.BYTES_PER_ELEMENT):A=d,n.push({data:A,width:o,height:c,depth:h})}let i;if(EN.has(Sg[e]))i=r.pixelDepth===0?new po(n[0].data,r.pixelWidth,r.pixelHeight):new TE(n[0].data,r.pixelWidth,r.pixelHeight,r.pixelDepth);else{if(r.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");i=new Nd(n,r.pixelWidth,r.pixelHeight)}return i.mipmaps=n,i.type=Tg[e],i.format=Sg[e],i.colorSpace=Rx(r),i.needsUpdate=!0,Promise.resolve(i)}function Rx(r){const e=r.dataFormatDescriptor[0];return e.colorPrimaries===AN?e.transferFunction===px?kr:Cr:e.colorPrimaries===gN?e.transferFunction===px?$h:ru:(e.colorPrimaries===pN||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),ps)}class wN extends h8{constructor(e){super(e),this.type=_n}parse(e){const t=function(_,w){switch(_){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(w||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(w||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(w||""));default:case 4:throw new Error("THREE.RGBELoader: Memory Error: "+(w||""))}},n=`
3830
3830
  `,i=function(_,w,x){w=w||1024;let I=_.pos,R=-1,S=0,T="",D=String.fromCharCode.apply(null,new Uint16Array(_.subarray(I,I+128)));for(;0>(R=D.indexOf(n))&&S<w&&I<_.byteLength;)T+=D,S+=D.length,I+=128,D+=String.fromCharCode.apply(null,new Uint16Array(_.subarray(I,I+128)));return-1<R?(x!==!1&&(_.pos+=S+R+1),T+D.slice(0,R)):!1},s=function(_){const w=/^#\?(\S+)/,x=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,I=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,R=/^\s*FORMAT=(\S+)\s*$/,S=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,T={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let D,b;for((_.pos>=_.byteLength||!(D=i(_)))&&t(1,"no header found"),(b=D.match(w))||t(3,"bad initial token"),T.valid|=1,T.programtype=b[1],T.string+=D+`
3831
3831
  `;D=i(_),D!==!1;){if(T.string+=D+`
@@ -3853,7 +3853,7 @@ void main() {
3853
3853
  gl_FragColor = opacity * texel;
3854
3854
 
3855
3855
 
3856
- }`};class xu{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}const CN=new fu(-1,1,1,-1,0,1);class MN extends zn{constructor(){super(),this.setAttribute("position",new Ri([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Ri([0,2,0,0,2,0],2))}}const SN=new MN;class Dx{constructor(e){this._mesh=new Wr(SN,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,CN)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}class TN extends xu{constructor(e,t){super(),this.textureID=t!==void 0?t:"tDiffuse",e instanceof vn?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=wd.clone(e.uniforms),this.material=new vn({name:e.name!==void 0?e.name:"unspecified",defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new Dx(this.material)}render(e,t,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}dispose(){this.material.dispose(),this.fsQuad.dispose()}}class Lx extends xu{constructor(e,t){super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,t,n){const i=e.getContext(),s=e.state;s.buffers.color.setMask(!1),s.buffers.depth.setMask(!1),s.buffers.color.setLocked(!0),s.buffers.depth.setLocked(!0);let o,c;this.inverse?(o=0,c=1):(o=1,c=0),s.buffers.stencil.setTest(!0),s.buffers.stencil.setOp(i.REPLACE,i.REPLACE,i.REPLACE),s.buffers.stencil.setFunc(i.ALWAYS,o,4294967295),s.buffers.stencil.setClear(c),s.buffers.stencil.setLocked(!0),e.setRenderTarget(n),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),s.buffers.color.setLocked(!1),s.buffers.depth.setLocked(!1),s.buffers.color.setMask(!0),s.buffers.depth.setMask(!0),s.buffers.stencil.setLocked(!1),s.buffers.stencil.setFunc(i.EQUAL,1,4294967295),s.buffers.stencil.setOp(i.KEEP,i.KEEP,i.KEEP),s.buffers.stencil.setLocked(!0)}}class BN extends xu{constructor(){super(),this.needsSwap=!1}render(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}}class bN{constructor(e,t){if(this.renderer=e,this._pixelRatio=e.getPixelRatio(),t===void 0){const n=e.getSize(new Ge);this._width=n.width,this._height=n.height,t=new Mi(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:_n}),t.texture.name="EffectComposer.rt1"}else this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],this.copyPass=new TN(IN),this.copyPass.material.blending=fs,this.clock=new v8}swapBuffers(){const e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){const t=this.passes.indexOf(e);t!==-1&&this.passes.splice(t,1)}isLastEnabledPass(e){for(let t=e+1;t<this.passes.length;t++)if(this.passes[t].enabled)return!1;return!0}render(e){e===void 0&&(e=this.clock.getDelta());const t=this.renderer.getRenderTarget();let n=!1;for(let i=0,s=this.passes.length;i<s;i++){const o=this.passes[i];if(o.enabled!==!1){if(o.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(i),o.render(this.renderer,this.writeBuffer,this.readBuffer,e,n),o.needsSwap){if(n){const c=this.renderer.getContext(),h=this.renderer.state.buffers.stencil;h.setFunc(c.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),h.setFunc(c.EQUAL,1,4294967295)}this.swapBuffers()}Lx!==void 0&&(o instanceof Lx?n=!0:o instanceof BN&&(n=!1))}}this.renderer.setRenderTarget(t)}reset(e){if(e===void 0){const t=this.renderer.getSize(new Ge);this._pixelRatio=this.renderer.getPixelRatio(),this._width=t.width,this._height=t.height,e=this.renderTarget1.clone(),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(e,t){this._width=e,this._height=t;const n=this._width*this._pixelRatio,i=this._height*this._pixelRatio;this.renderTarget1.setSize(n,i),this.renderTarget2.setSize(n,i);for(let s=0;s<this.passes.length;s++)this.passes[s].setSize(n,i)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.copyPass.dispose()}}const RN={name:"OutputShader",uniforms:{tDiffuse:{value:null},toneMappingExposure:{value:1}},vertexShader:`
3856
+ }`};class xu{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}const CN=new fu(-1,1,1,-1,0,1);class MN extends Hn{constructor(){super(),this.setAttribute("position",new Ri([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Ri([0,2,0,0,2,0],2))}}const SN=new MN;class Dx{constructor(e){this._mesh=new Wr(SN,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,CN)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}class TN extends xu{constructor(e,t){super(),this.textureID=t!==void 0?t:"tDiffuse",e instanceof vn?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=wd.clone(e.uniforms),this.material=new vn({name:e.name!==void 0?e.name:"unspecified",defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new Dx(this.material)}render(e,t,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}dispose(){this.material.dispose(),this.fsQuad.dispose()}}class Lx extends xu{constructor(e,t){super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,t,n){const i=e.getContext(),s=e.state;s.buffers.color.setMask(!1),s.buffers.depth.setMask(!1),s.buffers.color.setLocked(!0),s.buffers.depth.setLocked(!0);let o,c;this.inverse?(o=0,c=1):(o=1,c=0),s.buffers.stencil.setTest(!0),s.buffers.stencil.setOp(i.REPLACE,i.REPLACE,i.REPLACE),s.buffers.stencil.setFunc(i.ALWAYS,o,4294967295),s.buffers.stencil.setClear(c),s.buffers.stencil.setLocked(!0),e.setRenderTarget(n),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),s.buffers.color.setLocked(!1),s.buffers.depth.setLocked(!1),s.buffers.color.setMask(!0),s.buffers.depth.setMask(!0),s.buffers.stencil.setLocked(!1),s.buffers.stencil.setFunc(i.EQUAL,1,4294967295),s.buffers.stencil.setOp(i.KEEP,i.KEEP,i.KEEP),s.buffers.stencil.setLocked(!0)}}class BN extends xu{constructor(){super(),this.needsSwap=!1}render(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}}class bN{constructor(e,t){if(this.renderer=e,this._pixelRatio=e.getPixelRatio(),t===void 0){const n=e.getSize(new Ge);this._width=n.width,this._height=n.height,t=new Mi(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:_n}),t.texture.name="EffectComposer.rt1"}else this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],this.copyPass=new TN(IN),this.copyPass.material.blending=fs,this.clock=new v8}swapBuffers(){const e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){const t=this.passes.indexOf(e);t!==-1&&this.passes.splice(t,1)}isLastEnabledPass(e){for(let t=e+1;t<this.passes.length;t++)if(this.passes[t].enabled)return!1;return!0}render(e){e===void 0&&(e=this.clock.getDelta());const t=this.renderer.getRenderTarget();let n=!1;for(let i=0,s=this.passes.length;i<s;i++){const o=this.passes[i];if(o.enabled!==!1){if(o.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(i),o.render(this.renderer,this.writeBuffer,this.readBuffer,e,n),o.needsSwap){if(n){const c=this.renderer.getContext(),h=this.renderer.state.buffers.stencil;h.setFunc(c.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),h.setFunc(c.EQUAL,1,4294967295)}this.swapBuffers()}Lx!==void 0&&(o instanceof Lx?n=!0:o instanceof BN&&(n=!1))}}this.renderer.setRenderTarget(t)}reset(e){if(e===void 0){const t=this.renderer.getSize(new Ge);this._pixelRatio=this.renderer.getPixelRatio(),this._width=t.width,this._height=t.height,e=this.renderTarget1.clone(),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(e,t){this._width=e,this._height=t;const n=this._width*this._pixelRatio,i=this._height*this._pixelRatio;this.renderTarget1.setSize(n,i),this.renderTarget2.setSize(n,i);for(let s=0;s<this.passes.length;s++)this.passes[s].setSize(n,i)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.copyPass.dispose()}}const RN={name:"OutputShader",uniforms:{tDiffuse:{value:null},toneMappingExposure:{value:1}},vertexShader:`
3857
3857
  precision highp float;
3858
3858
 
3859
3859
  uniform mat4 modelViewMatrix;
@@ -3984,7 +3984,7 @@ void main() {
3984
3984
 
3985
3985
  gl_FragColor = sum;
3986
3986
 
3987
- }`},Nx=0,PN=1,Ux=2,Px=2,Bg=1.25,kx=1,mo=6*4+4+4,Od=65535,kN=Math.pow(2,-24),bg=Symbol("SKIP_GENERATION");function Qx(r){return r.index?r.index.count:r.attributes.position.count}function Ll(r){return Qx(r)/3}function Ox(r,e=ArrayBuffer){return r>65535?new Uint32Array(new e(4*r)):new Uint16Array(new e(2*r))}function QN(r,e){if(!r.index){const t=r.attributes.position.count,n=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,i=Ox(t,n);r.setIndex(new Qr(i,1));for(let s=0;s<t;s++)i[s]=s}}function Fx(r){const e=Ll(r),t=r.drawRange,n=t.start/3,i=(t.start+t.count)/3,s=Math.max(0,n),o=Math.min(e,i)-s;return[{offset:Math.floor(s),count:Math.floor(o)}]}function zx(r){if(!r.groups||!r.groups.length)return Fx(r);const e=[],t=new Set,n=r.drawRange,i=n.start/3,s=(n.start+n.count)/3;for(const c of r.groups){const h=c.start/3,u=(c.start+c.count)/3;t.add(Math.max(i,h)),t.add(Math.min(s,u))}const o=Array.from(t.values()).sort((c,h)=>c-h);for(let c=0;c<o.length-1;c++){const h=o[c],u=o[c+1];e.push({offset:Math.floor(h),count:Math.floor(u-h)})}return e}function ON(r){if(r.groups.length===0)return!1;const e=Ll(r),t=zx(r).sort((s,o)=>s.offset-o.offset),n=t[t.length-1];n.count=Math.min(e-n.offset,n.count);let i=0;return t.forEach(({count:s})=>i+=s),e!==i}function rr(r,e,t){return t.min.x=e[r],t.min.y=e[r+1],t.min.z=e[r+2],t.max.x=e[r+3],t.max.y=e[r+4],t.max.z=e[r+5],t}function FN(r){r[0]=r[1]=r[2]=1/0,r[3]=r[4]=r[5]=-1/0}function Hx(r){let e=-1,t=-1/0;for(let n=0;n<3;n++){const i=r[n+3]-r[n];i>t&&(t=i,e=n)}return e}function Gx(r,e){e.set(r)}function Vx(r,e,t){let n,i;for(let s=0;s<3;s++){const o=s+3;n=r[s],i=e[s],t[s]=n<i?n:i,n=r[o],i=e[o],t[o]=n>i?n:i}}function Fd(r,e,t){for(let n=0;n<3;n++){const i=e[r+2*n],s=e[r+2*n+1],o=i-s,c=i+s;o<t[n]&&(t[n]=o),c>t[n+3]&&(t[n+3]=c)}}function wu(r){const e=r[3]-r[0],t=r[4]-r[1],n=r[5]-r[2];return 2*(e*t+t*n+n*e)}function Rg(r,e,t,n,i=null){let s=1/0,o=1/0,c=1/0,h=-1/0,u=-1/0,d=-1/0,A=1/0,p=1/0,g=1/0,v=-1/0,E=-1/0,m=-1/0;const _=i!==null;for(let w=e*6,x=(e+t)*6;w<x;w+=6){const I=r[w+0],R=r[w+1],S=I-R,T=I+R;S<s&&(s=S),T>h&&(h=T),_&&I<A&&(A=I),_&&I>v&&(v=I);const D=r[w+2],b=r[w+3],M=D-b,L=D+b;M<o&&(o=M),L>u&&(u=L),_&&D<p&&(p=D),_&&D>E&&(E=D);const P=r[w+4],N=r[w+5],j=P-N,X=P+N;j<c&&(c=j),X>d&&(d=X),_&&P<g&&(g=P),_&&P>m&&(m=P)}n[0]=s,n[1]=o,n[2]=c,n[3]=h,n[4]=u,n[5]=d,_&&(i[0]=A,i[1]=p,i[2]=g,i[3]=v,i[4]=E,i[5]=m)}function zN(r,e,t,n){let i=1/0,s=1/0,o=1/0,c=-1/0,h=-1/0,u=-1/0;for(let d=e*6,A=(e+t)*6;d<A;d+=6){const p=r[d+0];p<i&&(i=p),p>c&&(c=p);const g=r[d+2];g<s&&(s=g),g>h&&(h=g);const v=r[d+4];v<o&&(o=v),v>u&&(u=v)}n[0]=i,n[1]=s,n[2]=o,n[3]=c,n[4]=h,n[5]=u}function HN(r,e){FN(e);const t=r.attributes.position,n=r.index?r.index.array:null,i=Ll(r),s=new Float32Array(i*6),o=t.normalized,c=t.array,h=t.offset||0;let u=3;t.isInterleavedBufferAttribute&&(u=t.data.stride);const d=["getX","getY","getZ"];for(let A=0;A<i;A++){const p=A*3,g=A*6;let v=p+0,E=p+1,m=p+2;n&&(v=n[v],E=n[E],m=n[m]),o||(v=v*u+h,E=E*u+h,m=m*u+h);for(let _=0;_<3;_++){let w,x,I;o?(w=t[d[_]](v),x=t[d[_]](E),I=t[d[_]](m)):(w=c[v+_],x=c[E+_],I=c[m+_]);let R=w;x<R&&(R=x),I<R&&(R=I);let S=w;x>S&&(S=x),I>S&&(S=I);const T=(S-R)/2,D=_*2;s[g+D+0]=R+T,s[g+D+1]=T+(Math.abs(R)+T)*kN,R<e[_]&&(e[_]=R),S>e[_+3]&&(e[_+3]=S)}}return s}const Ms=32,GN=(r,e)=>r.candidate-e.candidate,ha=new Array(Ms).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),zd=new Float32Array(6);function VN(r,e,t,n,i,s){let o=-1,c=0;if(s===Nx)o=Hx(e),o!==-1&&(c=(e[o]+e[o+3])/2);else if(s===PN)o=Hx(r),o!==-1&&(c=jN(t,n,i,o));else if(s===Ux){const h=wu(r);let u=Bg*i;const d=n*6,A=(n+i)*6;for(let p=0;p<3;p++){const g=e[p],v=(e[p+3]-g)/Ms;if(i<Ms/4){const E=[...ha];E.length=i;let m=0;for(let w=d;w<A;w+=6,m++){const x=E[m];x.candidate=t[w+2*p],x.count=0;const{bounds:I,leftCacheBounds:R,rightCacheBounds:S}=x;for(let T=0;T<3;T++)S[T]=1/0,S[T+3]=-1/0,R[T]=1/0,R[T+3]=-1/0,I[T]=1/0,I[T+3]=-1/0;Fd(w,t,I)}E.sort(GN);let _=i;for(let w=0;w<_;w++){const x=E[w];for(;w+1<_&&E[w+1].candidate===x.candidate;)E.splice(w+1,1),_--}for(let w=d;w<A;w+=6){const x=t[w+2*p];for(let I=0;I<_;I++){const R=E[I];x>=R.candidate?Fd(w,t,R.rightCacheBounds):(Fd(w,t,R.leftCacheBounds),R.count++)}}for(let w=0;w<_;w++){const x=E[w],I=x.count,R=i-x.count,S=x.leftCacheBounds,T=x.rightCacheBounds;let D=0;I!==0&&(D=wu(S)/h);let b=0;R!==0&&(b=wu(T)/h);const M=kx+Bg*(D*I+b*R);M<u&&(o=p,u=M,c=x.candidate)}}else{for(let _=0;_<Ms;_++){const w=ha[_];w.count=0,w.candidate=g+v+_*v;const x=w.bounds;for(let I=0;I<3;I++)x[I]=1/0,x[I+3]=-1/0}for(let _=d;_<A;_+=6){let w=~~((t[_+2*p]-g)/v);w>=Ms&&(w=Ms-1);const x=ha[w];x.count++,Fd(_,t,x.bounds)}const E=ha[Ms-1];Gx(E.bounds,E.rightCacheBounds);for(let _=Ms-2;_>=0;_--){const w=ha[_],x=ha[_+1];Vx(w.bounds,x.rightCacheBounds,w.rightCacheBounds)}let m=0;for(let _=0;_<Ms-1;_++){const w=ha[_],x=w.count,I=w.bounds,R=ha[_+1].rightCacheBounds;x!==0&&(m===0?Gx(I,zd):Vx(I,zd,zd)),m+=x;let S=0,T=0;m!==0&&(S=wu(zd)/h);const D=i-m;D!==0&&(T=wu(R)/h);const b=kx+Bg*(S*m+T*D);b<u&&(o=p,u=b,c=w.candidate)}}}}else console.warn(`MeshBVH: Invalid build strategy value ${s} used.`);return{axis:o,pos:c}}function jN(r,e,t,n){let i=0;for(let s=e,o=e+t;s<o;s++)i+=r[s*6+n*2];return i/t}class Hd{constructor(){}}function WN(r,e,t,n,i,s){let o=n,c=n+i-1;const h=s.pos,u=s.axis*2;for(;;){for(;o<=c&&t[o*6+u]<h;)o++;for(;o<=c&&t[c*6+u]>=h;)c--;if(o<c){for(let d=0;d<3;d++){let A=e[o*3+d];e[o*3+d]=e[c*3+d],e[c*3+d]=A}for(let d=0;d<6;d++){let A=t[o*6+d];t[o*6+d]=t[c*6+d],t[c*6+d]=A}o++,c--}else return o}}function YN(r,e,t,n,i,s){let o=n,c=n+i-1;const h=s.pos,u=s.axis*2;for(;;){for(;o<=c&&t[o*6+u]<h;)o++;for(;o<=c&&t[c*6+u]>=h;)c--;if(o<c){let d=r[o];r[o]=r[c],r[c]=d;for(let A=0;A<6;A++){let p=t[o*6+A];t[o*6+A]=t[c*6+A],t[c*6+A]=p}o++,c--}else return o}}function qN(r,e){const t=(r.index?r.index.count:r.attributes.position.count)/3,n=t>2**16,i=n?4:2,s=e?new SharedArrayBuffer(t*i):new ArrayBuffer(t*i),o=n?new Uint32Array(s):new Uint16Array(s);for(let c=0,h=o.length;c<h;c++)o[c]=c;return o}function XN(r,e){const t=r.geometry,n=t.index?t.index.array:null,i=e.maxDepth,s=e.verbose,o=e.maxLeafTris,c=e.strategy,h=e.onProgress,u=Ll(t),d=r._indirectBuffer;let A=!1;const p=new Float32Array(6),g=new Float32Array(6),v=HN(t,p),E=e.indirect?YN:WN,m=[],_=e.indirect?Fx(t):zx(t);if(_.length===1){const I=_[0],R=new Hd;R.boundingData=p,zN(v,I.offset,I.count,g),x(R,I.offset,I.count,g),m.push(R)}else for(let I of _){const R=new Hd;R.boundingData=new Float32Array(6),Rg(v,I.offset,I.count,R.boundingData,g),x(R,I.offset,I.count,g),m.push(R)}return m;function w(I){h&&h(I/u)}function x(I,R,S,T=null,D=0){if(!A&&D>=i&&(A=!0,s&&(console.warn(`MeshBVH: Max depth of ${i} reached when generating BVH. Consider increasing maxDepth.`),console.warn(t))),S<=o||D>=i)return w(R+S),I.offset=R,I.count=S,I;const b=VN(I.boundingData,T,v,R,S,c);if(b.axis===-1)return w(R+S),I.offset=R,I.count=S,I;const M=E(d,n,v,R,S,b);if(M===R||M===R+S)w(R+S),I.offset=R,I.count=S;else{I.splitAxis=b.axis;const L=new Hd,P=R,N=M-R;I.left=L,L.boundingData=new Float32Array(6),Rg(v,P,N,L.boundingData,g),x(L,P,N,g,D+1);const j=new Hd,X=M,K=S-N;I.right=j,j.boundingData=new Float32Array(6),Rg(v,X,K,j.boundingData,g),x(j,X,K,g,D+1)}return I}}function KN(r,e){const t=r.geometry;e.indirect&&(r._indirectBuffer=qN(t,e.useSharedArrayBuffer),ON(t)&&!e.verbose&&console.warn('MeshBVH: Provided geometry contains groups that do not fully span the vertex contents while using the "indirect" option. BVH may incorrectly report intersections on unrendered portions of the geometry.')),r._indirectBuffer||QN(t,e);const n=XN(r,e);let i,s,o;const c=[],h=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let A=0;A<n.length;A++){const p=n[A];let g=u(p);const v=new h(mo*g);i=new Float32Array(v),s=new Uint32Array(v),o=new Uint16Array(v),d(0,p),c.push(v)}r._roots=c;return;function u(A){return A.count?1:1+u(A.left)+u(A.right)}function d(A,p){const g=A/4,v=A/2,E=!!p.count,m=p.boundingData;for(let _=0;_<6;_++)i[g+_]=m[_];if(E){const _=p.offset,w=p.count;return s[g+6]=_,o[v+14]=w,o[v+15]=Od,A+mo}else{const _=p.left,w=p.right,x=p.splitAxis;let I;if(I=d(A+mo,_),I/4>Math.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return s[g+6]=I/4,I=d(I,w),s[g+7]=x,I}}}class Ss{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(e,t){let n=1/0,i=-1/0;for(let s=0,o=e.length;s<o;s++){const c=e[s][t];n=c<n?c:n,i=c>i?c:i}this.min=n,this.max=i}setFromPoints(e,t){let n=1/0,i=-1/0;for(let s=0,o=t.length;s<o;s++){const c=t[s],h=e.dot(c);n=h<n?h:n,i=h>i?h:i}this.min=n,this.max=i}isSeparated(e){return this.min>e.max||e.min>this.max}}Ss.prototype.setFromBox=function(){const r=new W;return function(e,t){const n=t.min,i=t.max;let s=1/0,o=-1/0;for(let c=0;c<=1;c++)for(let h=0;h<=1;h++)for(let u=0;u<=1;u++){r.x=n.x*c+i.x*(1-c),r.y=n.y*h+i.y*(1-h),r.z=n.z*u+i.z*(1-u);const d=e.dot(r);s=Math.min(d,s),o=Math.max(d,o)}this.min=s,this.max=o}}();const JN=function(){const r=new W,e=new W,t=new W;return function(n,i,s){const o=n.start,c=r,h=i.start,u=e;t.subVectors(o,h),r.subVectors(n.end,n.start),e.subVectors(i.end,i.start);const d=t.dot(u),A=u.dot(c),p=u.dot(u),g=t.dot(c),v=c.dot(c)*p-A*A;let E,m;v!==0?E=(d*A-g*p)/v:E=0,m=(d+E*A)/p,s.x=E,s.y=m}}(),Dg=function(){const r=new Ge,e=new W,t=new W;return function(n,i,s,o){JN(n,i,r);let c=r.x,h=r.y;if(c>=0&&c<=1&&h>=0&&h<=1){n.at(c,s),i.at(h,o);return}else if(c>=0&&c<=1){h<0?i.at(0,o):i.at(1,o),n.closestPointToPoint(o,!0,s);return}else if(h>=0&&h<=1){c<0?n.at(0,s):n.at(1,s),i.closestPointToPoint(s,!0,o);return}else{let u;c<0?u=n.start:u=n.end;let d;h<0?d=i.start:d=i.end;const A=e,p=t;if(n.closestPointToPoint(d,!0,e),i.closestPointToPoint(u,!0,t),A.distanceToSquared(d)<=p.distanceToSquared(u)){s.copy(A),o.copy(d);return}else{s.copy(u),o.copy(p);return}}}}(),ZN=function(){const r=new W,e=new W,t=new qi,n=new Is;return function(i,s){const{radius:o,center:c}=i,{a:h,b:u,c:d}=s;if(n.start=h,n.end=u,n.closestPointToPoint(c,!0,r).distanceTo(c)<=o||(n.start=h,n.end=d,n.closestPointToPoint(c,!0,r).distanceTo(c)<=o)||(n.start=u,n.end=d,n.closestPointToPoint(c,!0,r).distanceTo(c)<=o))return!0;const A=s.getPlane(t);if(Math.abs(A.distanceToPoint(c))<=o){const p=A.projectPoint(c,e);if(s.containsPoint(p))return!0}return!1}}(),$N=1e-15;function Lg(r){return Math.abs(r)<$N}class Li extends on{constructor(...e){super(...e),this.isExtendedTriangle=!0,this.satAxes=new Array(4).fill().map(()=>new W),this.satBounds=new Array(4).fill().map(()=>new Ss),this.points=[this.a,this.b,this.c],this.sphere=new Ti,this.plane=new qi,this.needsUpdate=!0}intersectsSphere(e){return ZN(e,this)}update(){const e=this.a,t=this.b,n=this.c,i=this.points,s=this.satAxes,o=this.satBounds,c=s[0],h=o[0];this.getNormal(c),h.setFromPoints(c,i);const u=s[1],d=o[1];u.subVectors(e,t),d.setFromPoints(u,i);const A=s[2],p=o[2];A.subVectors(t,n),p.setFromPoints(A,i);const g=s[3],v=o[3];g.subVectors(n,e),v.setFromPoints(g,i),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(c,e),this.needsUpdate=!1}}Li.prototype.closestPointToSegment=function(){const r=new W,e=new W,t=new Is;return function(n,i=null,s=null){const{start:o,end:c}=n,h=this.points;let u,d=1/0;for(let A=0;A<3;A++){const p=(A+1)%3;t.start.copy(h[A]),t.end.copy(h[p]),Dg(t,n,r,e),u=r.distanceToSquared(e),u<d&&(d=u,i&&i.copy(r),s&&s.copy(e))}return this.closestPointToPoint(o,r),u=o.distanceToSquared(r),u<d&&(d=u,i&&i.copy(r),s&&s.copy(o)),this.closestPointToPoint(c,r),u=c.distanceToSquared(r),u<d&&(d=u,i&&i.copy(r),s&&s.copy(c)),Math.sqrt(d)}}(),Li.prototype.intersectsTriangle=function(){const r=new Li,e=new Array(3),t=new Array(3),n=new Ss,i=new Ss,s=new W,o=new W,c=new W,h=new W,u=new W,d=new Is,A=new Is,p=new Is,g=new W;function v(E,m,_){const w=E.points;let x=0,I=-1;for(let R=0;R<3;R++){const{start:S,end:T}=d;S.copy(w[R]),T.copy(w[(R+1)%3]),d.delta(o);const D=Lg(m.distanceToPoint(S));if(Lg(m.normal.dot(o))&&D){_.copy(d),x=2;break}const b=m.intersectLine(d,g);if(!b&&D&&g.copy(S),(b||D)&&!Lg(g.distanceTo(T))){if(x<=1)(x===1?_.start:_.end).copy(g),D&&(I=x);else if(x>=2){(I===1?_.start:_.end).copy(g),x=2;break}if(x++,x===2&&I===-1)break}}return x}return function(E,m=null,_=!1){this.needsUpdate&&this.update(),E.isExtendedTriangle?E.needsUpdate&&E.update():(r.copy(E),r.update(),E=r);const w=this.plane,x=E.plane;if(Math.abs(w.normal.dot(x.normal))>1-1e-10){const I=this.satBounds,R=this.satAxes;t[0]=E.a,t[1]=E.b,t[2]=E.c;for(let D=0;D<4;D++){const b=I[D],M=R[D];if(n.setFromPoints(M,t),b.isSeparated(n))return!1}const S=E.satBounds,T=E.satAxes;e[0]=this.a,e[1]=this.b,e[2]=this.c;for(let D=0;D<4;D++){const b=S[D],M=T[D];if(n.setFromPoints(M,e),b.isSeparated(n))return!1}for(let D=0;D<4;D++){const b=R[D];for(let M=0;M<4;M++){const L=T[M];if(s.crossVectors(b,L),n.setFromPoints(s,e),i.setFromPoints(s,t),n.isSeparated(i))return!1}}return m&&(_||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),m.start.set(0,0,0),m.end.set(0,0,0)),!0}else{const I=v(this,x,A);if(I===1&&E.containsPoint(A.end))return m&&(m.start.copy(A.end),m.end.copy(A.end)),!0;if(I!==2)return!1;const R=v(E,w,p);if(R===1&&this.containsPoint(p.end))return m&&(m.start.copy(p.end),m.end.copy(p.end)),!0;if(R!==2)return!1;if(A.delta(c),p.delta(h),c.dot(h)<0){let P=p.start;p.start=p.end,p.end=P}const S=A.start.dot(c),T=A.end.dot(c),D=p.start.dot(c),b=p.end.dot(c),M=T<D,L=S<b;return S!==b&&D!==T&&M===L?!1:(m&&(u.subVectors(A.start,p.start),u.dot(c)>0?m.start.copy(A.start):m.start.copy(p.start),u.subVectors(A.end,p.end),u.dot(c)<0?m.end.copy(A.end):m.end.copy(p.end)),!0)}}}(),Li.prototype.distanceToPoint=function(){const r=new W;return function(e){return this.closestPointToPoint(e,r),e.distanceTo(r)}}(),Li.prototype.distanceToTriangle=function(){const r=new W,e=new W,t=["a","b","c"],n=new Is,i=new Is;return function(s,o=null,c=null){const h=o||c?n:null;if(this.intersectsTriangle(s,h))return(o||c)&&(o&&h.getCenter(o),c&&h.getCenter(c)),0;let u=1/0;for(let d=0;d<3;d++){let A;const p=t[d],g=s[p];this.closestPointToPoint(g,r),A=g.distanceToSquared(r),A<u&&(u=A,o&&o.copy(r),c&&c.copy(g));const v=this[p];s.closestPointToPoint(v,r),A=v.distanceToSquared(r),A<u&&(u=A,o&&o.copy(v),c&&c.copy(r))}for(let d=0;d<3;d++){const A=t[d],p=t[(d+1)%3];n.set(this[A],this[p]);for(let g=0;g<3;g++){const v=t[g],E=t[(g+1)%3];i.set(s[v],s[E]),Dg(n,i,r,e);const m=r.distanceToSquared(e);m<u&&(u=m,o&&o.copy(r),c&&c.copy(e))}}return Math.sqrt(u)}}();class dn{constructor(e,t,n){this.isOrientedBox=!0,this.min=new W,this.max=new W,this.matrix=new tt,this.invMatrix=new tt,this.points=new Array(8).fill().map(()=>new W),this.satAxes=new Array(3).fill().map(()=>new W),this.satBounds=new Array(3).fill().map(()=>new Ss),this.alignedSatBounds=new Array(3).fill().map(()=>new Ss),this.needsUpdate=!1,e&&this.min.copy(e),t&&this.max.copy(t),n&&this.matrix.copy(n)}set(e,t,n){this.min.copy(e),this.max.copy(t),this.matrix.copy(n),this.needsUpdate=!0}copy(e){this.min.copy(e.min),this.max.copy(e.max),this.matrix.copy(e.matrix),this.needsUpdate=!0}}dn.prototype.update=function(){return function(){const r=this.matrix,e=this.min,t=this.max,n=this.points;for(let h=0;h<=1;h++)for(let u=0;u<=1;u++)for(let d=0;d<=1;d++){const A=1*h|2*u|4*d,p=n[A];p.x=h?t.x:e.x,p.y=u?t.y:e.y,p.z=d?t.z:e.z,p.applyMatrix4(r)}const i=this.satBounds,s=this.satAxes,o=n[0];for(let h=0;h<3;h++){const u=s[h],d=i[h],A=1<<h,p=n[A];u.subVectors(o,p),d.setFromPoints(u,n)}const c=this.alignedSatBounds;c[0].setFromPointsField(n,"x"),c[1].setFromPointsField(n,"y"),c[2].setFromPointsField(n,"z"),this.invMatrix.copy(this.matrix).invert(),this.needsUpdate=!1}}(),dn.prototype.intersectsBox=function(){const r=new Ss;return function(e){this.needsUpdate&&this.update();const t=e.min,n=e.max,i=this.satBounds,s=this.satAxes,o=this.alignedSatBounds;if(r.min=t.x,r.max=n.x,o[0].isSeparated(r)||(r.min=t.y,r.max=n.y,o[1].isSeparated(r))||(r.min=t.z,r.max=n.z,o[2].isSeparated(r)))return!1;for(let c=0;c<3;c++){const h=s[c],u=i[c];if(r.setFromBox(h,e),u.isSeparated(r))return!1}return!0}}(),dn.prototype.intersectsTriangle=function(){const r=new Li,e=new Array(3),t=new Ss,n=new Ss,i=new W;return function(s){this.needsUpdate&&this.update(),s.isExtendedTriangle?s.needsUpdate&&s.update():(r.copy(s),r.update(),s=r);const o=this.satBounds,c=this.satAxes;e[0]=s.a,e[1]=s.b,e[2]=s.c;for(let A=0;A<3;A++){const p=o[A],g=c[A];if(t.setFromPoints(g,e),p.isSeparated(t))return!1}const h=s.satBounds,u=s.satAxes,d=this.points;for(let A=0;A<3;A++){const p=h[A],g=u[A];if(t.setFromPoints(g,d),p.isSeparated(t))return!1}for(let A=0;A<3;A++){const p=c[A];for(let g=0;g<4;g++){const v=u[g];if(i.crossVectors(p,v),t.setFromPoints(i,e),n.setFromPoints(i,d),t.isSeparated(n))return!1}}return!0}}(),dn.prototype.closestPointToPoint=function(){return function(r,e){return this.needsUpdate&&this.update(),e.copy(r).applyMatrix4(this.invMatrix).clamp(this.min,this.max).applyMatrix4(this.matrix),e}}(),dn.prototype.distanceToPoint=function(){const r=new W;return function(e){return this.closestPointToPoint(e,r),e.distanceTo(r)}}(),dn.prototype.distanceToBox=function(){const r=["x","y","z"],e=new Array(12).fill().map(()=>new Is),t=new Array(12).fill().map(()=>new Is),n=new W,i=new W;return function(s,o=0,c=null,h=null){if(this.needsUpdate&&this.update(),this.intersectsBox(s))return(c||h)&&(s.getCenter(i),this.closestPointToPoint(i,n),s.closestPointToPoint(n,i),c&&c.copy(n),h&&h.copy(i)),0;const u=o*o,d=s.min,A=s.max,p=this.points;let g=1/0;for(let E=0;E<8;E++){const m=p[E];i.copy(m).clamp(d,A);const _=m.distanceToSquared(i);if(_<g&&(g=_,c&&c.copy(m),h&&h.copy(i),_<u))return Math.sqrt(_)}let v=0;for(let E=0;E<3;E++)for(let m=0;m<=1;m++)for(let _=0;_<=1;_++){const w=(E+1)%3,x=(E+2)%3,I=m<<w|_<<x,R=1<<E|m<<w|_<<x,S=p[I],T=p[R];e[v].set(S,T);const D=r[E],b=r[w],M=r[x],L=t[v],P=L.start,N=L.end;P[D]=d[D],P[b]=m?d[b]:A[b],P[M]=_?d[M]:A[b],N[D]=A[D],N[b]=m?d[b]:A[b],N[M]=_?d[M]:A[b],v++}for(let E=0;E<=1;E++)for(let m=0;m<=1;m++)for(let _=0;_<=1;_++){i.x=E?A.x:d.x,i.y=m?A.y:d.y,i.z=_?A.z:d.z,this.closestPointToPoint(i,n);const w=i.distanceToSquared(n);if(w<g&&(g=w,c&&c.copy(n),h&&h.copy(i),w<u))return Math.sqrt(w)}for(let E=0;E<12;E++){const m=e[E];for(let _=0;_<12;_++){const w=t[_];Dg(m,w,n,i);const x=n.distanceToSquared(i);if(x<g&&(g=x,c&&c.copy(n),h&&h.copy(i),x<u))return Math.sqrt(x)}}return Math.sqrt(g)}}();class Ng{constructor(e){this._getNewPrimitive=e,this._primitives=[]}getPrimitive(){const e=this._primitives;return e.length===0?this._getNewPrimitive():e.pop()}releasePrimitive(e){this._primitives.push(e)}}class eU extends Ng{constructor(){super(()=>new Li)}}const ii=new eU;function yn(r,e){return e[r+15]===65535}function En(r,e){return e[r+6]}function Hn(r,e){return e[r+14]}function si(r){return r+8}function Gn(r,e){return e[r+6]}function Ug(r,e){return e[r+7]}class tU{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const e=[];let t=null;this.setBuffer=n=>{t&&e.push(t),t=n,this.float32Array=new Float32Array(n),this.uint16Array=new Uint16Array(n),this.uint32Array=new Uint32Array(n)},this.clearBuffer=()=>{t=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,e.length!==0&&this.setBuffer(e.pop())}}}const Yt=new tU;let da,Nl;const Ul=[],Gd=new Ng(()=>new yr);function rU(r,e,t,n,i,s){da=Gd.getPrimitive(),Nl=Gd.getPrimitive(),Ul.push(da,Nl),Yt.setBuffer(r._roots[e]);const o=Pg(0,r.geometry,t,n,i,s);Yt.clearBuffer(),Gd.releasePrimitive(da),Gd.releasePrimitive(Nl),Ul.pop(),Ul.pop();const c=Ul.length;return c>0&&(Nl=Ul[c-1],da=Ul[c-2]),o}function Pg(r,e,t,n,i=null,s=0,o=0){const{float32Array:c,uint16Array:h,uint32Array:u}=Yt;let d=r*2;if(yn(d,h)){const A=En(r,u),p=Hn(d,h);return rr(r,c,da),n(A,p,!1,o,s+r,da)}else{let A=function(L){const{uint16Array:P,uint32Array:N}=Yt;let j=L*2;for(;!yn(j,P);)L=si(L),j=L*2;return En(L,N)},p=function(L){const{uint16Array:P,uint32Array:N}=Yt;let j=L*2;for(;!yn(j,P);)L=Gn(L,N),j=L*2;return En(L,N)+Hn(j,P)};const g=si(r),v=Gn(r,u);let E=g,m=v,_,w,x,I;if(i&&(x=da,I=Nl,rr(E,c,x),rr(m,c,I),_=i(x),w=i(I),w<_)){E=v,m=g;const L=_;_=w,w=L,x=I}x||(x=da,rr(E,c,x));const R=yn(E*2,h),S=t(x,R,_,o+1,s+E);let T;if(S===Px){const L=A(E),P=p(E)-L;T=n(L,P,!0,o+1,s+E,x)}else T=S&&Pg(E,e,t,n,i,s,o+1);if(T)return!0;I=Nl,rr(m,c,I);const D=yn(m*2,h),b=t(I,D,w,o+1,s+m);let M;if(b===Px){const L=A(m),P=p(m)-L;M=n(L,P,!0,o+1,s+m,I)}else M=b&&Pg(m,e,t,n,i,s,o+1);return!!M}}const Iu=new W,kg=new W;function nU(r,e,t={},n=0,i=1/0){const s=n*n,o=i*i;let c=1/0,h=null;if(r.shapecast({boundsTraverseOrder:d=>(Iu.copy(e).clamp(d.min,d.max),Iu.distanceToSquared(e)),intersectsBounds:(d,A,p)=>p<c&&p<o,intersectsTriangle:(d,A)=>{d.closestPointToPoint(e,Iu);const p=e.distanceToSquared(Iu);return p<c&&(kg.copy(Iu),c=p,h=A),p<s}}),c===1/0)return null;const u=Math.sqrt(c);return t.point?t.point.copy(kg):t.point=kg.clone(),t.distance=u,t.faceIndex=h,t}const Pl=new W,kl=new W,Ql=new W,Vd=new Ge,jd=new Ge,Wd=new Ge,jx=new W,Wx=new W,Yx=new W,Yd=new W;function iU(r,e,t,n,i,s){let o;return s===Pr?o=r.intersectTriangle(n,t,e,!0,i):o=r.intersectTriangle(e,t,n,s!==yi,i),o===null?null:{distance:r.origin.distanceTo(i),point:i.clone()}}function sU(r,e,t,n,i,s,o,c,h){Pl.fromBufferAttribute(e,s),kl.fromBufferAttribute(e,o),Ql.fromBufferAttribute(e,c);const u=iU(r,Pl,kl,Ql,Yd,h);if(u){n&&(Vd.fromBufferAttribute(n,s),jd.fromBufferAttribute(n,o),Wd.fromBufferAttribute(n,c),u.uv=on.getInterpolation(Yd,Pl,kl,Ql,Vd,jd,Wd,new Ge)),i&&(Vd.fromBufferAttribute(i,s),jd.fromBufferAttribute(i,o),Wd.fromBufferAttribute(i,c),u.uv1=on.getInterpolation(Yd,Pl,kl,Ql,Vd,jd,Wd,new Ge)),t&&(jx.fromBufferAttribute(t,s),Wx.fromBufferAttribute(t,o),Yx.fromBufferAttribute(t,c),u.normal=on.getInterpolation(Yd,Pl,kl,Ql,jx,Wx,Yx,new W),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));const d={a:s,b:o,c,normal:new W,materialIndex:0};on.getNormal(Pl,kl,Ql,d.normal),u.face=d,u.faceIndex=s}return u}function qd(r,e,t,n,i){const s=n*3;let o=s+0,c=s+1,h=s+2;const u=r.index;r.index&&(o=u.getX(o),c=u.getX(c),h=u.getX(h));const{position:d,normal:A,uv:p,uv1:g}=r.attributes,v=sU(t,d,A,p,g,o,c,h,e);return v?(v.faceIndex=n,i&&i.push(v),v):null}function xr(r,e,t,n){const i=r.a,s=r.b,o=r.c;let c=e,h=e+1,u=e+2;t&&(c=t.getX(c),h=t.getX(h),u=t.getX(u)),i.x=n.getX(c),i.y=n.getY(c),i.z=n.getZ(c),s.x=n.getX(h),s.y=n.getY(h),s.z=n.getZ(h),o.x=n.getX(u),o.y=n.getY(u),o.z=n.getZ(u)}function aU(r,e,t,n,i,s){const{geometry:o,_indirectBuffer:c}=r;for(let h=n,u=n+i;h<u;h++)qd(o,e,t,h,s)}function oU(r,e,t,n,i){const{geometry:s,_indirectBuffer:o}=r;let c=1/0,h=null;for(let u=n,d=n+i;u<d;u++){let A;A=qd(s,e,t,u),A&&A.distance<c&&(h=A,c=A.distance)}return h}function lU(r,e,t,n,i,s,o){const{geometry:c}=t,{index:h}=c,u=c.attributes.position;for(let d=r,A=e+r;d<A;d++){let p;if(p=d,xr(o,p*3,h,u),o.needsUpdate=!0,n(o,p,i,s))return!0}return!1}function cU(r,e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=r.geometry,n=t.index?t.index.array:null,i=t.attributes.position;let s,o,c,h,u=0;const d=r._roots;for(let p=0,g=d.length;p<g;p++)s=d[p],o=new Uint32Array(s),c=new Uint16Array(s),h=new Float32Array(s),A(0,u),u+=s.byteLength;function A(p,g,v=!1){const E=p*2;if(c[E+15]===Od){const m=o[p+6],_=c[E+14];let w=1/0,x=1/0,I=1/0,R=-1/0,S=-1/0,T=-1/0;for(let D=3*m,b=3*(m+_);D<b;D++){let M=n[D];const L=i.getX(M),P=i.getY(M),N=i.getZ(M);L<w&&(w=L),L>R&&(R=L),P<x&&(x=P),P>S&&(S=P),N<I&&(I=N),N>T&&(T=N)}return h[p+0]!==w||h[p+1]!==x||h[p+2]!==I||h[p+3]!==R||h[p+4]!==S||h[p+5]!==T?(h[p+0]=w,h[p+1]=x,h[p+2]=I,h[p+3]=R,h[p+4]=S,h[p+5]=T,!0):!1}else{const m=p+8,_=o[p+6],w=m+g,x=_+g;let I=v,R=!1,S=!1;e?I||(R=e.has(w),S=e.has(x),I=!R&&!S):(R=!0,S=!0);const T=I||R,D=I||S;let b=!1;T&&(b=A(m,g,I));let M=!1;D&&(M=A(_,g,I));const L=b||M;if(L)for(let P=0;P<3;P++){const N=m+P,j=_+P,X=h[N],K=h[N+3],ne=h[j],V=h[j+3];h[p+P]=X<ne?X:ne,h[p+P+3]=K>V?K:V}return L}}}const qx=new yr;function fa(r,e,t,n){return rr(r,e,qx),t.intersectBox(qx,n)}function uU(r,e,t,n,i,s){const{geometry:o,_indirectBuffer:c}=r;for(let h=n,u=n+i;h<u;h++){let d=c?c[h]:h;qd(o,e,t,d,s)}}function hU(r,e,t,n,i){const{geometry:s,_indirectBuffer:o}=r;let c=1/0,h=null;for(let u=n,d=n+i;u<d;u++){let A;A=qd(s,e,t,o?o[u]:u),A&&A.distance<c&&(h=A,c=A.distance)}return h}function dU(r,e,t,n,i,s,o){const{geometry:c}=t,{index:h}=c,u=c.attributes.position;for(let d=r,A=e+r;d<A;d++){let p;if(p=t.resolveTriangleIndex(d),xr(o,p*3,h,u),o.needsUpdate=!0,n(o,p,i,s))return!0}return!1}const Xx=new W;function fU(r,e,t,n,i){Yt.setBuffer(r._roots[e]),Qg(0,r,t,n,i),Yt.clearBuffer()}function Qg(r,e,t,n,i){const{float32Array:s,uint16Array:o,uint32Array:c}=Yt,h=r*2;if(yn(h,o)){const u=En(r,c),d=Hn(h,o);aU(e,t,n,u,d,i)}else{const u=si(r);fa(u,s,n,Xx)&&Qg(u,e,t,n,i);const d=Gn(r,c);fa(d,s,n,Xx)&&Qg(d,e,t,n,i)}}const Kx=new W,pU=["x","y","z"];function AU(r,e,t,n){Yt.setBuffer(r._roots[e]);const i=Og(0,r,t,n);return Yt.clearBuffer(),i}function Og(r,e,t,n){const{float32Array:i,uint16Array:s,uint32Array:o}=Yt;let c=r*2;if(yn(c,s)){const h=En(r,o),u=Hn(c,s);return oU(e,t,n,h,u)}else{const h=Ug(r,o),u=pU[h],d=n.direction[u]>=0;let A,p;d?(A=si(r),p=Gn(r,o)):(A=Gn(r,o),p=si(r));const g=fa(A,i,n,Kx)?Og(A,e,t,n):null;if(g){const E=g.point[u];if(d?E<=i[p+h]:E>=i[p+h+3])return g}const v=fa(p,i,n,Kx)?Og(p,e,t,n):null;return g&&v?g.distance<=v.distance?g:v:g||v||null}}const Xd=new yr,Ol=new Li,Fl=new Li,Cu=new tt,Jx=new dn,Kd=new dn;function gU(r,e,t,n){Yt.setBuffer(r._roots[e]);const i=Fg(0,r,t,n);return Yt.clearBuffer(),i}function Fg(r,e,t,n,i=null){const{float32Array:s,uint16Array:o,uint32Array:c}=Yt;let h=r*2;if(i===null&&(t.boundingBox||t.computeBoundingBox(),Jx.set(t.boundingBox.min,t.boundingBox.max,n),i=Jx),yn(h,o)){const u=e.geometry,d=u.index,A=u.attributes.position,p=t.index,g=t.attributes.position,v=En(r,c),E=Hn(h,o);if(Cu.copy(n).invert(),t.boundsTree)return rr(r,s,Kd),Kd.matrix.copy(Cu),Kd.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:m=>Kd.intersectsBox(m),intersectsTriangle:m=>{m.a.applyMatrix4(n),m.b.applyMatrix4(n),m.c.applyMatrix4(n),m.needsUpdate=!0;for(let _=v*3,w=(E+v)*3;_<w;_+=3)if(xr(Fl,_,d,A),Fl.needsUpdate=!0,m.intersectsTriangle(Fl))return!0;return!1}});for(let m=v*3,_=(E+v)*3;m<_;m+=3){xr(Ol,m,d,A),Ol.a.applyMatrix4(Cu),Ol.b.applyMatrix4(Cu),Ol.c.applyMatrix4(Cu),Ol.needsUpdate=!0;for(let w=0,x=p.count;w<x;w+=3)if(xr(Fl,w,p,g),Fl.needsUpdate=!0,Ol.intersectsTriangle(Fl))return!0}}else{const u=r+8,d=c[r+6];return rr(u,s,Xd),!!(i.intersectsBox(Xd)&&Fg(u,e,t,n,i)||(rr(d,s,Xd),i.intersectsBox(Xd)&&Fg(d,e,t,n,i)))}}const Jd=new tt,zg=new dn,Mu=new dn,mU=new W,_U=new W,vU=new W,yU=new W;function EU(r,e,t,n={},i={},s=0,o=1/0){e.boundingBox||e.computeBoundingBox(),zg.set(e.boundingBox.min,e.boundingBox.max,t),zg.needsUpdate=!0;const c=r.geometry,h=c.attributes.position,u=c.index,d=e.attributes.position,A=e.index,p=ii.getPrimitive(),g=ii.getPrimitive();let v=mU,E=_U,m=null,_=null;i&&(m=vU,_=yU);let w=1/0,x=null,I=null;return Jd.copy(t).invert(),Mu.matrix.copy(Jd),r.shapecast({boundsTraverseOrder:R=>zg.distanceToBox(R),intersectsBounds:(R,S,T)=>T<w&&T<o?(S&&(Mu.min.copy(R.min),Mu.max.copy(R.max),Mu.needsUpdate=!0),!0):!1,intersectsRange:(R,S)=>{if(e.boundsTree)return e.boundsTree.shapecast({boundsTraverseOrder:T=>Mu.distanceToBox(T),intersectsBounds:(T,D,b)=>b<w&&b<o,intersectsRange:(T,D)=>{for(let b=T,M=T+D;b<M;b++){xr(g,3*b,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let L=R,P=R+S;L<P;L++){xr(p,3*L,u,h),p.needsUpdate=!0;const N=p.distanceToTriangle(g,v,m);if(N<w&&(E.copy(v),_&&_.copy(m),w=N,x=L,I=b),N<s)return!0}}}});{const T=Ll(e);for(let D=0,b=T;D<b;D++){xr(g,3*D,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let M=R,L=R+S;M<L;M++){xr(p,3*M,u,h),p.needsUpdate=!0;const P=p.distanceToTriangle(g,v,m);if(P<w&&(E.copy(v),_&&_.copy(m),w=P,x=M,I=D),P<s)return!0}}}}}),ii.releasePrimitive(p),ii.releasePrimitive(g),w===1/0?null:(n.point?n.point.copy(E):n.point=E.clone(),n.distance=w,n.faceIndex=x,i&&(i.point?i.point.copy(_):i.point=_.clone(),i.point.applyMatrix4(Jd),E.applyMatrix4(Jd),i.distance=E.sub(i.point).length(),i.faceIndex=I),n)}function xU(r,e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=r.geometry,n=t.index?t.index.array:null,i=t.attributes.position;let s,o,c,h,u=0;const d=r._roots;for(let p=0,g=d.length;p<g;p++)s=d[p],o=new Uint32Array(s),c=new Uint16Array(s),h=new Float32Array(s),A(0,u),u+=s.byteLength;function A(p,g,v=!1){const E=p*2;if(c[E+15]===Od){const m=o[p+6],_=c[E+14];let w=1/0,x=1/0,I=1/0,R=-1/0,S=-1/0,T=-1/0;for(let D=m,b=m+_;D<b;D++){const M=3*r.resolveTriangleIndex(D);for(let L=0;L<3;L++){let P=M+L;P=n?n[P]:P;const N=i.getX(P),j=i.getY(P),X=i.getZ(P);N<w&&(w=N),N>R&&(R=N),j<x&&(x=j),j>S&&(S=j),X<I&&(I=X),X>T&&(T=X)}}return h[p+0]!==w||h[p+1]!==x||h[p+2]!==I||h[p+3]!==R||h[p+4]!==S||h[p+5]!==T?(h[p+0]=w,h[p+1]=x,h[p+2]=I,h[p+3]=R,h[p+4]=S,h[p+5]=T,!0):!1}else{const m=p+8,_=o[p+6],w=m+g,x=_+g;let I=v,R=!1,S=!1;e?I||(R=e.has(w),S=e.has(x),I=!R&&!S):(R=!0,S=!0);const T=I||R,D=I||S;let b=!1;T&&(b=A(m,g,I));let M=!1;D&&(M=A(_,g,I));const L=b||M;if(L)for(let P=0;P<3;P++){const N=m+P,j=_+P,X=h[N],K=h[N+3],ne=h[j],V=h[j+3];h[p+P]=X<ne?X:ne,h[p+P+3]=K>V?K:V}return L}}}const Zx=new W;function wU(r,e,t,n,i){Yt.setBuffer(r._roots[e]),Hg(0,r,t,n,i),Yt.clearBuffer()}function Hg(r,e,t,n,i){const{float32Array:s,uint16Array:o,uint32Array:c}=Yt,h=r*2;if(yn(h,o)){const u=En(r,c),d=Hn(h,o);uU(e,t,n,u,d,i)}else{const u=si(r);fa(u,s,n,Zx)&&Hg(u,e,t,n,i);const d=Gn(r,c);fa(d,s,n,Zx)&&Hg(d,e,t,n,i)}}const $x=new W,IU=["x","y","z"];function CU(r,e,t,n){Yt.setBuffer(r._roots[e]);const i=Gg(0,r,t,n);return Yt.clearBuffer(),i}function Gg(r,e,t,n){const{float32Array:i,uint16Array:s,uint32Array:o}=Yt;let c=r*2;if(yn(c,s)){const h=En(r,o),u=Hn(c,s);return hU(e,t,n,h,u)}else{const h=Ug(r,o),u=IU[h],d=n.direction[u]>=0;let A,p;d?(A=si(r),p=Gn(r,o)):(A=Gn(r,o),p=si(r));const g=fa(A,i,n,$x)?Gg(A,e,t,n):null;if(g){const E=g.point[u];if(d?E<=i[p+h]:E>=i[p+h+3])return g}const v=fa(p,i,n,$x)?Gg(p,e,t,n):null;return g&&v?g.distance<=v.distance?g:v:g||v||null}}const Zd=new yr,zl=new Li,Hl=new Li,Su=new tt,ew=new dn,$d=new dn;function MU(r,e,t,n){Yt.setBuffer(r._roots[e]);const i=Vg(0,r,t,n);return Yt.clearBuffer(),i}function Vg(r,e,t,n,i=null){const{float32Array:s,uint16Array:o,uint32Array:c}=Yt;let h=r*2;if(i===null&&(t.boundingBox||t.computeBoundingBox(),ew.set(t.boundingBox.min,t.boundingBox.max,n),i=ew),yn(h,o)){const u=e.geometry,d=u.index,A=u.attributes.position,p=t.index,g=t.attributes.position,v=En(r,c),E=Hn(h,o);if(Su.copy(n).invert(),t.boundsTree)return rr(r,s,$d),$d.matrix.copy(Su),$d.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:m=>$d.intersectsBox(m),intersectsTriangle:m=>{m.a.applyMatrix4(n),m.b.applyMatrix4(n),m.c.applyMatrix4(n),m.needsUpdate=!0;for(let _=v,w=E+v;_<w;_++)if(xr(Hl,3*e.resolveTriangleIndex(_),d,A),Hl.needsUpdate=!0,m.intersectsTriangle(Hl))return!0;return!1}});for(let m=v,_=E+v;m<_;m++){const w=e.resolveTriangleIndex(m);xr(zl,3*w,d,A),zl.a.applyMatrix4(Su),zl.b.applyMatrix4(Su),zl.c.applyMatrix4(Su),zl.needsUpdate=!0;for(let x=0,I=p.count;x<I;x+=3)if(xr(Hl,x,p,g),Hl.needsUpdate=!0,zl.intersectsTriangle(Hl))return!0}}else{const u=r+8,d=c[r+6];return rr(u,s,Zd),!!(i.intersectsBox(Zd)&&Vg(u,e,t,n,i)||(rr(d,s,Zd),i.intersectsBox(Zd)&&Vg(d,e,t,n,i)))}}const ef=new tt,jg=new dn,Tu=new dn,SU=new W,TU=new W,BU=new W,bU=new W;function RU(r,e,t,n={},i={},s=0,o=1/0){e.boundingBox||e.computeBoundingBox(),jg.set(e.boundingBox.min,e.boundingBox.max,t),jg.needsUpdate=!0;const c=r.geometry,h=c.attributes.position,u=c.index,d=e.attributes.position,A=e.index,p=ii.getPrimitive(),g=ii.getPrimitive();let v=SU,E=TU,m=null,_=null;i&&(m=BU,_=bU);let w=1/0,x=null,I=null;return ef.copy(t).invert(),Tu.matrix.copy(ef),r.shapecast({boundsTraverseOrder:R=>jg.distanceToBox(R),intersectsBounds:(R,S,T)=>T<w&&T<o?(S&&(Tu.min.copy(R.min),Tu.max.copy(R.max),Tu.needsUpdate=!0),!0):!1,intersectsRange:(R,S)=>{if(e.boundsTree){const T=e.boundsTree;return T.shapecast({boundsTraverseOrder:D=>Tu.distanceToBox(D),intersectsBounds:(D,b,M)=>M<w&&M<o,intersectsRange:(D,b)=>{for(let M=D,L=D+b;M<L;M++){const P=T.resolveTriangleIndex(M);xr(g,3*P,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let N=R,j=R+S;N<j;N++){const X=r.resolveTriangleIndex(N);xr(p,3*X,u,h),p.needsUpdate=!0;const K=p.distanceToTriangle(g,v,m);if(K<w&&(E.copy(v),_&&_.copy(m),w=K,x=N,I=M),K<s)return!0}}}})}else{const T=Ll(e);for(let D=0,b=T;D<b;D++){xr(g,3*D,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let M=R,L=R+S;M<L;M++){const P=r.resolveTriangleIndex(M);xr(p,3*P,u,h),p.needsUpdate=!0;const N=p.distanceToTriangle(g,v,m);if(N<w&&(E.copy(v),_&&_.copy(m),w=N,x=M,I=D),N<s)return!0}}}}}),ii.releasePrimitive(p),ii.releasePrimitive(g),w===1/0?null:(n.point?n.point.copy(E):n.point=E.clone(),n.distance=w,n.faceIndex=x,i&&(i.point?i.point.copy(_):i.point=_.clone(),i.point.applyMatrix4(ef),E.applyMatrix4(ef),i.distance=E.sub(i.point).length(),i.faceIndex=I),n)}function DU(){return typeof SharedArrayBuffer<"u"}const Bu=new Yt.constructor,tf=new Yt.constructor,pa=new Ng(()=>new yr),Gl=new yr,Vl=new yr,Wg=new yr,Yg=new yr;let qg=!1;function LU(r,e,t,n){if(qg)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");qg=!0;const i=r._roots,s=e._roots;let o,c=0,h=0;const u=new tt().copy(t).invert();for(let d=0,A=i.length;d<A;d++){Bu.setBuffer(i[d]),h=0;const p=pa.getPrimitive();rr(0,Bu.float32Array,p),p.applyMatrix4(u);for(let g=0,v=s.length;g<v&&(tf.setBuffer(s[d]),o=Ni(0,0,t,u,n,c,h,0,0,p),tf.clearBuffer(),h+=s[g].length,!o);g++);if(pa.releasePrimitive(p),Bu.clearBuffer(),c+=i[d].length,o)break}return qg=!1,o}function Ni(r,e,t,n,i,s=0,o=0,c=0,h=0,u=null,d=!1){let A,p;d?(A=tf,p=Bu):(A=Bu,p=tf);const g=A.float32Array,v=A.uint32Array,E=A.uint16Array,m=p.float32Array,_=p.uint32Array,w=p.uint16Array,x=r*2,I=e*2,R=yn(x,E),S=yn(I,w);let T=!1;if(S&&R)d?T=i(En(e,_),Hn(e*2,w),En(r,v),Hn(r*2,E),h,o+e,c,s+r):T=i(En(r,v),Hn(r*2,E),En(e,_),Hn(e*2,w),c,s+r,h,o+e);else if(S){const D=pa.getPrimitive();rr(e,m,D),D.applyMatrix4(t);const b=si(r),M=Gn(r,v);rr(b,g,Gl),rr(M,g,Vl);const L=D.intersectsBox(Gl),P=D.intersectsBox(Vl);T=L&&Ni(e,b,n,t,i,o,s,h,c+1,D,!d)||P&&Ni(e,M,n,t,i,o,s,h,c+1,D,!d),pa.releasePrimitive(D)}else{const D=si(e),b=Gn(e,_);rr(D,m,Wg),rr(b,m,Yg);const M=u.intersectsBox(Wg),L=u.intersectsBox(Yg);if(M&&L)T=Ni(r,D,t,n,i,s,o,c,h+1,u,d)||Ni(r,b,t,n,i,s,o,c,h+1,u,d);else if(M)if(R)T=Ni(r,D,t,n,i,s,o,c,h+1,u,d);else{const P=pa.getPrimitive();P.copy(Wg).applyMatrix4(t);const N=si(r),j=Gn(r,v);rr(N,g,Gl),rr(j,g,Vl);const X=P.intersectsBox(Gl),K=P.intersectsBox(Vl);T=X&&Ni(D,N,n,t,i,o,s,h,c+1,P,!d)||K&&Ni(D,j,n,t,i,o,s,h,c+1,P,!d),pa.releasePrimitive(P)}else if(L)if(R)T=Ni(r,b,t,n,i,s,o,c,h+1,u,d);else{const P=pa.getPrimitive();P.copy(Yg).applyMatrix4(t);const N=si(r),j=Gn(r,v);rr(N,g,Gl),rr(j,g,Vl);const X=P.intersectsBox(Gl),K=P.intersectsBox(Vl);T=X&&Ni(b,N,n,t,i,o,s,h,c+1,P,!d)||K&&Ni(b,j,n,t,i,o,s,h,c+1,P,!d),pa.releasePrimitive(P)}}return T}const rf=new dn,tw=new yr;class Xg{static serialize(e,t={}){t={cloneBuffers:!0,...t};const n=e.geometry,i=e._roots,s=e._indirectBuffer,o=n.getIndex();let c;return t.cloneBuffers?c={roots:i.map(h=>h.slice()),index:o.array.slice(),indirectBuffer:s?s.slice():null}:c={roots:i,index:o.array,indirectBuffer:s},c}static deserialize(e,t,n={}){n={setIndex:!0,indirect:!!e.indirectBuffer,...n};const{index:i,roots:s,indirectBuffer:o}=e,c=new Xg(t,{...n,[bg]:!0});if(c._roots=s,c._indirectBuffer=o||null,n.setIndex){const h=t.getIndex();if(h===null){const u=new Qr(e.index,1,!1);t.setIndex(u)}else h.array!==i&&(h.array.set(i),h.needsUpdate=!0)}return c}get indirect(){return!!this._indirectBuffer}constructor(e,t={}){if(e.isBufferGeometry){if(e.index&&e.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("MeshBVH: Only BufferGeometries are supported.");if(t=Object.assign({strategy:Nx,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,[bg]:!1},t),t.useSharedArrayBuffer&&!DU())throw new Error("MeshBVH: SharedArrayBuffer is not available.");this.geometry=e,this._roots=null,this._indirectBuffer=null,t[bg]||(KN(this,t),!e.boundingBox&&t.setBoundingBox&&(e.boundingBox=this.getBoundingBox(new yr)));const{_indirectBuffer:n}=this;this.resolveTriangleIndex=t.indirect?i=>n[i]:i=>i}refit(e=null){return(this.indirect?xU:cU)(this,e)}traverse(e,t=0){const n=this._roots[t],i=new Uint32Array(n),s=new Uint16Array(n);o(0);function o(c,h=0){const u=c*2,d=s[u+15]===Od;if(d){const A=i[c+6],p=s[u+14];e(h,d,new Float32Array(n,c*4,6),A,p)}else{const A=c+mo/4,p=i[c+6],g=i[c+7];e(h,d,new Float32Array(n,c*4,6),g)||(o(A,h+1),o(p,h+1))}}}raycast(e,t=vi){const n=this._roots,i=this.geometry,s=[],o=t.isMaterial,c=Array.isArray(t),h=i.groups,u=o?t.side:t,d=this.indirect?wU:fU;for(let A=0,p=n.length;A<p;A++){const g=c?t[h[A].materialIndex].side:u,v=s.length;if(d(this,A,g,e,s),c){const E=h[A].materialIndex;for(let m=v,_=s.length;m<_;m++)s[m].face.materialIndex=E}}return s}raycastFirst(e,t=vi){const n=this._roots,i=this.geometry,s=t.isMaterial,o=Array.isArray(t);let c=null;const h=i.groups,u=s?t.side:t,d=this.indirect?CU:AU;for(let A=0,p=n.length;A<p;A++){const g=o?t[h[A].materialIndex].side:u,v=d(this,A,g,e);v!=null&&(c==null||v.distance<c.distance)&&(c=v,o&&(v.face.materialIndex=h[A].materialIndex))}return c}intersectsGeometry(e,t){let n=!1;const i=this._roots,s=this.indirect?MU:gU;for(let o=0,c=i.length;o<c&&(n=s(this,o,e,t),!n);o++);return n}shapecast(e){const t=ii.getPrimitive(),n=this.indirect?dU:lU;let{boundsTraverseOrder:i,intersectsBounds:s,intersectsRange:o,intersectsTriangle:c}=e;if(o&&c){const A=o;o=(p,g,v,E,m)=>A(p,g,v,E,m)?!0:n(p,g,this,c,v,E,t)}else o||(c?o=(A,p,g,v)=>n(A,p,this,c,g,v,t):o=(A,p,g)=>g);let h=!1,u=0;const d=this._roots;for(let A=0,p=d.length;A<p;A++){const g=d[A];if(h=rU(this,A,s,o,i,u),h)break;u+=g.byteLength}return ii.releasePrimitive(t),h}bvhcast(e,t,n){let{intersectsRanges:i,intersectsTriangles:s}=n;const o=ii.getPrimitive(),c=this.geometry.index,h=this.geometry.attributes.position,u=this.indirect?v=>{const E=this.resolveTriangleIndex(v);xr(o,E*3,c,h)}:v=>{xr(o,v*3,c,h)},d=ii.getPrimitive(),A=e.geometry.index,p=e.geometry.attributes.position,g=e.indirect?v=>{const E=e.resolveTriangleIndex(v);xr(d,E*3,A,p)}:v=>{xr(d,v*3,A,p)};if(s){const v=(E,m,_,w,x,I,R,S)=>{for(let T=_,D=_+w;T<D;T++){g(T),d.a.applyMatrix4(t),d.b.applyMatrix4(t),d.c.applyMatrix4(t),d.needsUpdate=!0;for(let b=E,M=E+m;b<M;b++)if(u(b),o.needsUpdate=!0,s(o,d,b,T,x,I,R,S))return!0}return!1};if(i){const E=i;i=function(m,_,w,x,I,R,S,T){return E(m,_,w,x,I,R,S,T)?!0:v(m,_,w,x,I,R,S,T)}}else i=v}return LU(this,e,t,i)}intersectsBox(e,t){return rf.set(e.min,e.max,t),rf.needsUpdate=!0,this.shapecast({intersectsBounds:n=>rf.intersectsBox(n),intersectsTriangle:n=>rf.intersectsTriangle(n)})}intersectsSphere(e){return this.shapecast({intersectsBounds:t=>e.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(e)})}closestPointToGeometry(e,t,n={},i={},s=0,o=1/0){return(this.indirect?RU:EU)(this,e,t,n,i,s,o)}closestPointToPoint(e,t={},n=0,i=1/0){return nU(this,e,t,n,i)}getBoundingBox(e){return e.makeEmpty(),this._roots.forEach(t=>{rr(0,new Float32Array(t),tw),e.union(tw)}),e}}function NU(r){switch(r){case 1:return"R";case 2:return"RG";case 3:return"RGBA";case 4:return"RGBA"}throw new Error}function UU(r){switch(r){case 1:return $s;case 2:return no;case 3:return Ar;case 4:return Ar}}function rw(r){switch(r){case 1:return dA;case 2:return qh;case 3:return eu;case 4:return eu}}class nw extends po{constructor(){super(),this.minFilter=dr,this.magFilter=dr,this.generateMipmaps=!1,this.overrideItemSize=null,this._forcedType=null}updateFrom(e){const t=this.overrideItemSize,n=e.itemSize,i=e.count;if(t!==null){if(n*i%t!==0)throw new Error("VertexAttributeTexture: overrideItemSize must divide evenly into buffer length.");e.itemSize=t,e.count=i*n/t}const s=e.itemSize,o=e.count,c=e.normalized,h=e.array.constructor,u=h.BYTES_PER_ELEMENT;let d=this._forcedType,A=s;if(d===null)switch(h){case Float32Array:d=or;break;case Uint8Array:case Uint16Array:case Uint32Array:d=wi;break;case Int8Array:case Int16Array:case Int32Array:d=Jc;break}let p,g,v,E,m=NU(s);switch(d){case or:v=1,g=UU(s),c&&u===1?(E=h,m+="8",h===Uint8Array?p=pr:(p=uA,m+="_SNORM")):(E=Float32Array,m+="32F",p=or);break;case Jc:m+=u*8+"I",v=c?Math.pow(2,h.BYTES_PER_ELEMENT*8-1):1,g=rw(s),u===1?(E=Int8Array,p=uA):u===2?(E=Int16Array,p=Vy):(E=Int32Array,p=Jc);break;case wi:m+=u*8+"UI",v=c?Math.pow(2,h.BYTES_PER_ELEMENT*8-1):1,g=rw(s),u===1?(E=Uint8Array,p=pr):u===2?(E=Uint16Array,p=hA):(E=Uint32Array,p=wi);break}A===3&&(g===Ar||g===eu)&&(A=4);const _=Math.ceil(Math.sqrt(o)),w=A*_*_,x=new E(w),I=e.normalized;e.normalized=!1;for(let R=0;R<o;R++){const S=A*R;x[S]=e.getX(R)/v,s>=2&&(x[S+1]=e.getY(R)/v),s>=3&&(x[S+2]=e.getZ(R)/v,A===4&&(x[S+3]=1)),s>=4&&(x[S+3]=e.getW(R)/v)}e.normalized=I,this.internalFormat=m,this.format=g,this.type=p,this.image.width=_,this.image.height=_,this.image.data=x,this.needsUpdate=!0,this.dispose(),e.itemSize=n,e.count=i}}class PU extends nw{constructor(){super(),this._forcedType=wi}}class kU extends nw{constructor(){super(),this._forcedType=or}}class iw{constructor(){this.index=new PU,this.position=new kU,this.bvhBounds=new po,this.bvhContents=new po,this._cachedIndexAttr=null,this.index.overrideItemSize=3}updateFrom(e){const{geometry:t}=e;if(OU(e,this.bvhBounds,this.bvhContents),this.position.updateFrom(t.attributes.position),e.indirect){const n=e._indirectBuffer;if(this._cachedIndexAttr===null||this._cachedIndexAttr.count!==n.length)if(t.index)this._cachedIndexAttr=t.index.clone();else{const i=Ox(Qx(t));this._cachedIndexAttr=new Qr(i,1,!1)}QU(t,n,this._cachedIndexAttr),this.index.updateFrom(this._cachedIndexAttr)}else this.index.updateFrom(t.index)}dispose(){const{index:e,position:t,bvhBounds:n,bvhContents:i}=this;e&&e.dispose(),t&&t.dispose(),n&&n.dispose(),i&&i.dispose()}}function QU(r,e,t){const n=t.array,i=r.index?r.index.array:null;for(let s=0,o=e.length;s<o;s++){const c=3*s,h=3*e[s];for(let u=0;u<3;u++)n[c+u]=i?i[h+u]:h+u}}function OU(r,e,t){const n=r._roots;if(n.length!==1)throw new Error("MeshBVHUniformStruct: Multi-root BVHs not supported.");const i=n[0],s=new Uint16Array(i),o=new Uint32Array(i),c=new Float32Array(i),h=i.byteLength/mo,u=2*Math.ceil(Math.sqrt(h/2)),d=new Float32Array(4*u*u),A=Math.ceil(Math.sqrt(h)),p=new Uint32Array(2*A*A);for(let g=0;g<h;g++){const v=g*mo/4,E=v*2,m=v;for(let _=0;_<3;_++)d[8*g+0+_]=c[m+0+_],d[8*g+4+_]=c[m+3+_];if(yn(E,s)){const _=Hn(E,s),w=En(v,o),x=4294901760|_;p[g*2+0]=x,p[g*2+1]=w}else{const _=4*Gn(v,o)/mo,w=Ug(v,o);p[g*2+0]=w,p[g*2+1]=_}}e.image.data=d,e.image.width=u,e.image.height=u,e.format=Ar,e.type=or,e.internalFormat="RGBA32F",e.minFilter=dr,e.magFilter=dr,e.generateMipmaps=!1,e.needsUpdate=!0,e.dispose(),t.image.data=p,t.image.width=A,t.image.height=A,t.format=qh,t.type=wi,t.internalFormat="RG32UI",t.minFilter=dr,t.magFilter=dr,t.generateMipmaps=!1,t.needsUpdate=!0,t.dispose()}const FU=`
3987
+ }`},Nx=0,PN=1,Ux=2,Px=2,Bg=1.25,kx=1,mo=6*4+4+4,Od=65535,kN=Math.pow(2,-24),bg=Symbol("SKIP_GENERATION");function Qx(r){return r.index?r.index.count:r.attributes.position.count}function Ll(r){return Qx(r)/3}function Ox(r,e=ArrayBuffer){return r>65535?new Uint32Array(new e(4*r)):new Uint16Array(new e(2*r))}function QN(r,e){if(!r.index){const t=r.attributes.position.count,n=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,i=Ox(t,n);r.setIndex(new Qr(i,1));for(let s=0;s<t;s++)i[s]=s}}function Fx(r){const e=Ll(r),t=r.drawRange,n=t.start/3,i=(t.start+t.count)/3,s=Math.max(0,n),o=Math.min(e,i)-s;return[{offset:Math.floor(s),count:Math.floor(o)}]}function zx(r){if(!r.groups||!r.groups.length)return Fx(r);const e=[],t=new Set,n=r.drawRange,i=n.start/3,s=(n.start+n.count)/3;for(const c of r.groups){const h=c.start/3,u=(c.start+c.count)/3;t.add(Math.max(i,h)),t.add(Math.min(s,u))}const o=Array.from(t.values()).sort((c,h)=>c-h);for(let c=0;c<o.length-1;c++){const h=o[c],u=o[c+1];e.push({offset:Math.floor(h),count:Math.floor(u-h)})}return e}function ON(r){if(r.groups.length===0)return!1;const e=Ll(r),t=zx(r).sort((s,o)=>s.offset-o.offset),n=t[t.length-1];n.count=Math.min(e-n.offset,n.count);let i=0;return t.forEach(({count:s})=>i+=s),e!==i}function rr(r,e,t){return t.min.x=e[r],t.min.y=e[r+1],t.min.z=e[r+2],t.max.x=e[r+3],t.max.y=e[r+4],t.max.z=e[r+5],t}function FN(r){r[0]=r[1]=r[2]=1/0,r[3]=r[4]=r[5]=-1/0}function Hx(r){let e=-1,t=-1/0;for(let n=0;n<3;n++){const i=r[n+3]-r[n];i>t&&(t=i,e=n)}return e}function Gx(r,e){e.set(r)}function Vx(r,e,t){let n,i;for(let s=0;s<3;s++){const o=s+3;n=r[s],i=e[s],t[s]=n<i?n:i,n=r[o],i=e[o],t[o]=n>i?n:i}}function Fd(r,e,t){for(let n=0;n<3;n++){const i=e[r+2*n],s=e[r+2*n+1],o=i-s,c=i+s;o<t[n]&&(t[n]=o),c>t[n+3]&&(t[n+3]=c)}}function wu(r){const e=r[3]-r[0],t=r[4]-r[1],n=r[5]-r[2];return 2*(e*t+t*n+n*e)}function Rg(r,e,t,n,i=null){let s=1/0,o=1/0,c=1/0,h=-1/0,u=-1/0,d=-1/0,A=1/0,p=1/0,g=1/0,v=-1/0,E=-1/0,m=-1/0;const _=i!==null;for(let w=e*6,x=(e+t)*6;w<x;w+=6){const I=r[w+0],R=r[w+1],S=I-R,T=I+R;S<s&&(s=S),T>h&&(h=T),_&&I<A&&(A=I),_&&I>v&&(v=I);const D=r[w+2],b=r[w+3],M=D-b,L=D+b;M<o&&(o=M),L>u&&(u=L),_&&D<p&&(p=D),_&&D>E&&(E=D);const P=r[w+4],N=r[w+5],j=P-N,X=P+N;j<c&&(c=j),X>d&&(d=X),_&&P<g&&(g=P),_&&P>m&&(m=P)}n[0]=s,n[1]=o,n[2]=c,n[3]=h,n[4]=u,n[5]=d,_&&(i[0]=A,i[1]=p,i[2]=g,i[3]=v,i[4]=E,i[5]=m)}function zN(r,e,t,n){let i=1/0,s=1/0,o=1/0,c=-1/0,h=-1/0,u=-1/0;for(let d=e*6,A=(e+t)*6;d<A;d+=6){const p=r[d+0];p<i&&(i=p),p>c&&(c=p);const g=r[d+2];g<s&&(s=g),g>h&&(h=g);const v=r[d+4];v<o&&(o=v),v>u&&(u=v)}n[0]=i,n[1]=s,n[2]=o,n[3]=c,n[4]=h,n[5]=u}function HN(r,e){FN(e);const t=r.attributes.position,n=r.index?r.index.array:null,i=Ll(r),s=new Float32Array(i*6),o=t.normalized,c=t.array,h=t.offset||0;let u=3;t.isInterleavedBufferAttribute&&(u=t.data.stride);const d=["getX","getY","getZ"];for(let A=0;A<i;A++){const p=A*3,g=A*6;let v=p+0,E=p+1,m=p+2;n&&(v=n[v],E=n[E],m=n[m]),o||(v=v*u+h,E=E*u+h,m=m*u+h);for(let _=0;_<3;_++){let w,x,I;o?(w=t[d[_]](v),x=t[d[_]](E),I=t[d[_]](m)):(w=c[v+_],x=c[E+_],I=c[m+_]);let R=w;x<R&&(R=x),I<R&&(R=I);let S=w;x>S&&(S=x),I>S&&(S=I);const T=(S-R)/2,D=_*2;s[g+D+0]=R+T,s[g+D+1]=T+(Math.abs(R)+T)*kN,R<e[_]&&(e[_]=R),S>e[_+3]&&(e[_+3]=S)}}return s}const Ms=32,GN=(r,e)=>r.candidate-e.candidate,ha=new Array(Ms).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),zd=new Float32Array(6);function VN(r,e,t,n,i,s){let o=-1,c=0;if(s===Nx)o=Hx(e),o!==-1&&(c=(e[o]+e[o+3])/2);else if(s===PN)o=Hx(r),o!==-1&&(c=jN(t,n,i,o));else if(s===Ux){const h=wu(r);let u=Bg*i;const d=n*6,A=(n+i)*6;for(let p=0;p<3;p++){const g=e[p],v=(e[p+3]-g)/Ms;if(i<Ms/4){const E=[...ha];E.length=i;let m=0;for(let w=d;w<A;w+=6,m++){const x=E[m];x.candidate=t[w+2*p],x.count=0;const{bounds:I,leftCacheBounds:R,rightCacheBounds:S}=x;for(let T=0;T<3;T++)S[T]=1/0,S[T+3]=-1/0,R[T]=1/0,R[T+3]=-1/0,I[T]=1/0,I[T+3]=-1/0;Fd(w,t,I)}E.sort(GN);let _=i;for(let w=0;w<_;w++){const x=E[w];for(;w+1<_&&E[w+1].candidate===x.candidate;)E.splice(w+1,1),_--}for(let w=d;w<A;w+=6){const x=t[w+2*p];for(let I=0;I<_;I++){const R=E[I];x>=R.candidate?Fd(w,t,R.rightCacheBounds):(Fd(w,t,R.leftCacheBounds),R.count++)}}for(let w=0;w<_;w++){const x=E[w],I=x.count,R=i-x.count,S=x.leftCacheBounds,T=x.rightCacheBounds;let D=0;I!==0&&(D=wu(S)/h);let b=0;R!==0&&(b=wu(T)/h);const M=kx+Bg*(D*I+b*R);M<u&&(o=p,u=M,c=x.candidate)}}else{for(let _=0;_<Ms;_++){const w=ha[_];w.count=0,w.candidate=g+v+_*v;const x=w.bounds;for(let I=0;I<3;I++)x[I]=1/0,x[I+3]=-1/0}for(let _=d;_<A;_+=6){let w=~~((t[_+2*p]-g)/v);w>=Ms&&(w=Ms-1);const x=ha[w];x.count++,Fd(_,t,x.bounds)}const E=ha[Ms-1];Gx(E.bounds,E.rightCacheBounds);for(let _=Ms-2;_>=0;_--){const w=ha[_],x=ha[_+1];Vx(w.bounds,x.rightCacheBounds,w.rightCacheBounds)}let m=0;for(let _=0;_<Ms-1;_++){const w=ha[_],x=w.count,I=w.bounds,R=ha[_+1].rightCacheBounds;x!==0&&(m===0?Gx(I,zd):Vx(I,zd,zd)),m+=x;let S=0,T=0;m!==0&&(S=wu(zd)/h);const D=i-m;D!==0&&(T=wu(R)/h);const b=kx+Bg*(S*m+T*D);b<u&&(o=p,u=b,c=w.candidate)}}}}else console.warn(`MeshBVH: Invalid build strategy value ${s} used.`);return{axis:o,pos:c}}function jN(r,e,t,n){let i=0;for(let s=e,o=e+t;s<o;s++)i+=r[s*6+n*2];return i/t}class Hd{constructor(){}}function WN(r,e,t,n,i,s){let o=n,c=n+i-1;const h=s.pos,u=s.axis*2;for(;;){for(;o<=c&&t[o*6+u]<h;)o++;for(;o<=c&&t[c*6+u]>=h;)c--;if(o<c){for(let d=0;d<3;d++){let A=e[o*3+d];e[o*3+d]=e[c*3+d],e[c*3+d]=A}for(let d=0;d<6;d++){let A=t[o*6+d];t[o*6+d]=t[c*6+d],t[c*6+d]=A}o++,c--}else return o}}function YN(r,e,t,n,i,s){let o=n,c=n+i-1;const h=s.pos,u=s.axis*2;for(;;){for(;o<=c&&t[o*6+u]<h;)o++;for(;o<=c&&t[c*6+u]>=h;)c--;if(o<c){let d=r[o];r[o]=r[c],r[c]=d;for(let A=0;A<6;A++){let p=t[o*6+A];t[o*6+A]=t[c*6+A],t[c*6+A]=p}o++,c--}else return o}}function qN(r,e){const t=(r.index?r.index.count:r.attributes.position.count)/3,n=t>2**16,i=n?4:2,s=e?new SharedArrayBuffer(t*i):new ArrayBuffer(t*i),o=n?new Uint32Array(s):new Uint16Array(s);for(let c=0,h=o.length;c<h;c++)o[c]=c;return o}function XN(r,e){const t=r.geometry,n=t.index?t.index.array:null,i=e.maxDepth,s=e.verbose,o=e.maxLeafTris,c=e.strategy,h=e.onProgress,u=Ll(t),d=r._indirectBuffer;let A=!1;const p=new Float32Array(6),g=new Float32Array(6),v=HN(t,p),E=e.indirect?YN:WN,m=[],_=e.indirect?Fx(t):zx(t);if(_.length===1){const I=_[0],R=new Hd;R.boundingData=p,zN(v,I.offset,I.count,g),x(R,I.offset,I.count,g),m.push(R)}else for(let I of _){const R=new Hd;R.boundingData=new Float32Array(6),Rg(v,I.offset,I.count,R.boundingData,g),x(R,I.offset,I.count,g),m.push(R)}return m;function w(I){h&&h(I/u)}function x(I,R,S,T=null,D=0){if(!A&&D>=i&&(A=!0,s&&(console.warn(`MeshBVH: Max depth of ${i} reached when generating BVH. Consider increasing maxDepth.`),console.warn(t))),S<=o||D>=i)return w(R+S),I.offset=R,I.count=S,I;const b=VN(I.boundingData,T,v,R,S,c);if(b.axis===-1)return w(R+S),I.offset=R,I.count=S,I;const M=E(d,n,v,R,S,b);if(M===R||M===R+S)w(R+S),I.offset=R,I.count=S;else{I.splitAxis=b.axis;const L=new Hd,P=R,N=M-R;I.left=L,L.boundingData=new Float32Array(6),Rg(v,P,N,L.boundingData,g),x(L,P,N,g,D+1);const j=new Hd,X=M,K=S-N;I.right=j,j.boundingData=new Float32Array(6),Rg(v,X,K,j.boundingData,g),x(j,X,K,g,D+1)}return I}}function KN(r,e){const t=r.geometry;e.indirect&&(r._indirectBuffer=qN(t,e.useSharedArrayBuffer),ON(t)&&!e.verbose&&console.warn('MeshBVH: Provided geometry contains groups that do not fully span the vertex contents while using the "indirect" option. BVH may incorrectly report intersections on unrendered portions of the geometry.')),r._indirectBuffer||QN(t,e);const n=XN(r,e);let i,s,o;const c=[],h=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let A=0;A<n.length;A++){const p=n[A];let g=u(p);const v=new h(mo*g);i=new Float32Array(v),s=new Uint32Array(v),o=new Uint16Array(v),d(0,p),c.push(v)}r._roots=c;return;function u(A){return A.count?1:1+u(A.left)+u(A.right)}function d(A,p){const g=A/4,v=A/2,E=!!p.count,m=p.boundingData;for(let _=0;_<6;_++)i[g+_]=m[_];if(E){const _=p.offset,w=p.count;return s[g+6]=_,o[v+14]=w,o[v+15]=Od,A+mo}else{const _=p.left,w=p.right,x=p.splitAxis;let I;if(I=d(A+mo,_),I/4>Math.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return s[g+6]=I/4,I=d(I,w),s[g+7]=x,I}}}class Ss{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(e,t){let n=1/0,i=-1/0;for(let s=0,o=e.length;s<o;s++){const c=e[s][t];n=c<n?c:n,i=c>i?c:i}this.min=n,this.max=i}setFromPoints(e,t){let n=1/0,i=-1/0;for(let s=0,o=t.length;s<o;s++){const c=t[s],h=e.dot(c);n=h<n?h:n,i=h>i?h:i}this.min=n,this.max=i}isSeparated(e){return this.min>e.max||e.min>this.max}}Ss.prototype.setFromBox=function(){const r=new W;return function(e,t){const n=t.min,i=t.max;let s=1/0,o=-1/0;for(let c=0;c<=1;c++)for(let h=0;h<=1;h++)for(let u=0;u<=1;u++){r.x=n.x*c+i.x*(1-c),r.y=n.y*h+i.y*(1-h),r.z=n.z*u+i.z*(1-u);const d=e.dot(r);s=Math.min(d,s),o=Math.max(d,o)}this.min=s,this.max=o}}();const JN=function(){const r=new W,e=new W,t=new W;return function(n,i,s){const o=n.start,c=r,h=i.start,u=e;t.subVectors(o,h),r.subVectors(n.end,n.start),e.subVectors(i.end,i.start);const d=t.dot(u),A=u.dot(c),p=u.dot(u),g=t.dot(c),v=c.dot(c)*p-A*A;let E,m;v!==0?E=(d*A-g*p)/v:E=0,m=(d+E*A)/p,s.x=E,s.y=m}}(),Dg=function(){const r=new Ge,e=new W,t=new W;return function(n,i,s,o){JN(n,i,r);let c=r.x,h=r.y;if(c>=0&&c<=1&&h>=0&&h<=1){n.at(c,s),i.at(h,o);return}else if(c>=0&&c<=1){h<0?i.at(0,o):i.at(1,o),n.closestPointToPoint(o,!0,s);return}else if(h>=0&&h<=1){c<0?n.at(0,s):n.at(1,s),i.closestPointToPoint(s,!0,o);return}else{let u;c<0?u=n.start:u=n.end;let d;h<0?d=i.start:d=i.end;const A=e,p=t;if(n.closestPointToPoint(d,!0,e),i.closestPointToPoint(u,!0,t),A.distanceToSquared(d)<=p.distanceToSquared(u)){s.copy(A),o.copy(d);return}else{s.copy(u),o.copy(p);return}}}}(),ZN=function(){const r=new W,e=new W,t=new qi,n=new Is;return function(i,s){const{radius:o,center:c}=i,{a:h,b:u,c:d}=s;if(n.start=h,n.end=u,n.closestPointToPoint(c,!0,r).distanceTo(c)<=o||(n.start=h,n.end=d,n.closestPointToPoint(c,!0,r).distanceTo(c)<=o)||(n.start=u,n.end=d,n.closestPointToPoint(c,!0,r).distanceTo(c)<=o))return!0;const A=s.getPlane(t);if(Math.abs(A.distanceToPoint(c))<=o){const p=A.projectPoint(c,e);if(s.containsPoint(p))return!0}return!1}}(),$N=1e-15;function Lg(r){return Math.abs(r)<$N}class Li extends on{constructor(...e){super(...e),this.isExtendedTriangle=!0,this.satAxes=new Array(4).fill().map(()=>new W),this.satBounds=new Array(4).fill().map(()=>new Ss),this.points=[this.a,this.b,this.c],this.sphere=new Ti,this.plane=new qi,this.needsUpdate=!0}intersectsSphere(e){return ZN(e,this)}update(){const e=this.a,t=this.b,n=this.c,i=this.points,s=this.satAxes,o=this.satBounds,c=s[0],h=o[0];this.getNormal(c),h.setFromPoints(c,i);const u=s[1],d=o[1];u.subVectors(e,t),d.setFromPoints(u,i);const A=s[2],p=o[2];A.subVectors(t,n),p.setFromPoints(A,i);const g=s[3],v=o[3];g.subVectors(n,e),v.setFromPoints(g,i),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(c,e),this.needsUpdate=!1}}Li.prototype.closestPointToSegment=function(){const r=new W,e=new W,t=new Is;return function(n,i=null,s=null){const{start:o,end:c}=n,h=this.points;let u,d=1/0;for(let A=0;A<3;A++){const p=(A+1)%3;t.start.copy(h[A]),t.end.copy(h[p]),Dg(t,n,r,e),u=r.distanceToSquared(e),u<d&&(d=u,i&&i.copy(r),s&&s.copy(e))}return this.closestPointToPoint(o,r),u=o.distanceToSquared(r),u<d&&(d=u,i&&i.copy(r),s&&s.copy(o)),this.closestPointToPoint(c,r),u=c.distanceToSquared(r),u<d&&(d=u,i&&i.copy(r),s&&s.copy(c)),Math.sqrt(d)}}(),Li.prototype.intersectsTriangle=function(){const r=new Li,e=new Array(3),t=new Array(3),n=new Ss,i=new Ss,s=new W,o=new W,c=new W,h=new W,u=new W,d=new Is,A=new Is,p=new Is,g=new W;function v(E,m,_){const w=E.points;let x=0,I=-1;for(let R=0;R<3;R++){const{start:S,end:T}=d;S.copy(w[R]),T.copy(w[(R+1)%3]),d.delta(o);const D=Lg(m.distanceToPoint(S));if(Lg(m.normal.dot(o))&&D){_.copy(d),x=2;break}const b=m.intersectLine(d,g);if(!b&&D&&g.copy(S),(b||D)&&!Lg(g.distanceTo(T))){if(x<=1)(x===1?_.start:_.end).copy(g),D&&(I=x);else if(x>=2){(I===1?_.start:_.end).copy(g),x=2;break}if(x++,x===2&&I===-1)break}}return x}return function(E,m=null,_=!1){this.needsUpdate&&this.update(),E.isExtendedTriangle?E.needsUpdate&&E.update():(r.copy(E),r.update(),E=r);const w=this.plane,x=E.plane;if(Math.abs(w.normal.dot(x.normal))>1-1e-10){const I=this.satBounds,R=this.satAxes;t[0]=E.a,t[1]=E.b,t[2]=E.c;for(let D=0;D<4;D++){const b=I[D],M=R[D];if(n.setFromPoints(M,t),b.isSeparated(n))return!1}const S=E.satBounds,T=E.satAxes;e[0]=this.a,e[1]=this.b,e[2]=this.c;for(let D=0;D<4;D++){const b=S[D],M=T[D];if(n.setFromPoints(M,e),b.isSeparated(n))return!1}for(let D=0;D<4;D++){const b=R[D];for(let M=0;M<4;M++){const L=T[M];if(s.crossVectors(b,L),n.setFromPoints(s,e),i.setFromPoints(s,t),n.isSeparated(i))return!1}}return m&&(_||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),m.start.set(0,0,0),m.end.set(0,0,0)),!0}else{const I=v(this,x,A);if(I===1&&E.containsPoint(A.end))return m&&(m.start.copy(A.end),m.end.copy(A.end)),!0;if(I!==2)return!1;const R=v(E,w,p);if(R===1&&this.containsPoint(p.end))return m&&(m.start.copy(p.end),m.end.copy(p.end)),!0;if(R!==2)return!1;if(A.delta(c),p.delta(h),c.dot(h)<0){let P=p.start;p.start=p.end,p.end=P}const S=A.start.dot(c),T=A.end.dot(c),D=p.start.dot(c),b=p.end.dot(c),M=T<D,L=S<b;return S!==b&&D!==T&&M===L?!1:(m&&(u.subVectors(A.start,p.start),u.dot(c)>0?m.start.copy(A.start):m.start.copy(p.start),u.subVectors(A.end,p.end),u.dot(c)<0?m.end.copy(A.end):m.end.copy(p.end)),!0)}}}(),Li.prototype.distanceToPoint=function(){const r=new W;return function(e){return this.closestPointToPoint(e,r),e.distanceTo(r)}}(),Li.prototype.distanceToTriangle=function(){const r=new W,e=new W,t=["a","b","c"],n=new Is,i=new Is;return function(s,o=null,c=null){const h=o||c?n:null;if(this.intersectsTriangle(s,h))return(o||c)&&(o&&h.getCenter(o),c&&h.getCenter(c)),0;let u=1/0;for(let d=0;d<3;d++){let A;const p=t[d],g=s[p];this.closestPointToPoint(g,r),A=g.distanceToSquared(r),A<u&&(u=A,o&&o.copy(r),c&&c.copy(g));const v=this[p];s.closestPointToPoint(v,r),A=v.distanceToSquared(r),A<u&&(u=A,o&&o.copy(v),c&&c.copy(r))}for(let d=0;d<3;d++){const A=t[d],p=t[(d+1)%3];n.set(this[A],this[p]);for(let g=0;g<3;g++){const v=t[g],E=t[(g+1)%3];i.set(s[v],s[E]),Dg(n,i,r,e);const m=r.distanceToSquared(e);m<u&&(u=m,o&&o.copy(r),c&&c.copy(e))}}return Math.sqrt(u)}}();class dn{constructor(e,t,n){this.isOrientedBox=!0,this.min=new W,this.max=new W,this.matrix=new tt,this.invMatrix=new tt,this.points=new Array(8).fill().map(()=>new W),this.satAxes=new Array(3).fill().map(()=>new W),this.satBounds=new Array(3).fill().map(()=>new Ss),this.alignedSatBounds=new Array(3).fill().map(()=>new Ss),this.needsUpdate=!1,e&&this.min.copy(e),t&&this.max.copy(t),n&&this.matrix.copy(n)}set(e,t,n){this.min.copy(e),this.max.copy(t),this.matrix.copy(n),this.needsUpdate=!0}copy(e){this.min.copy(e.min),this.max.copy(e.max),this.matrix.copy(e.matrix),this.needsUpdate=!0}}dn.prototype.update=function(){return function(){const r=this.matrix,e=this.min,t=this.max,n=this.points;for(let h=0;h<=1;h++)for(let u=0;u<=1;u++)for(let d=0;d<=1;d++){const A=1*h|2*u|4*d,p=n[A];p.x=h?t.x:e.x,p.y=u?t.y:e.y,p.z=d?t.z:e.z,p.applyMatrix4(r)}const i=this.satBounds,s=this.satAxes,o=n[0];for(let h=0;h<3;h++){const u=s[h],d=i[h],A=1<<h,p=n[A];u.subVectors(o,p),d.setFromPoints(u,n)}const c=this.alignedSatBounds;c[0].setFromPointsField(n,"x"),c[1].setFromPointsField(n,"y"),c[2].setFromPointsField(n,"z"),this.invMatrix.copy(this.matrix).invert(),this.needsUpdate=!1}}(),dn.prototype.intersectsBox=function(){const r=new Ss;return function(e){this.needsUpdate&&this.update();const t=e.min,n=e.max,i=this.satBounds,s=this.satAxes,o=this.alignedSatBounds;if(r.min=t.x,r.max=n.x,o[0].isSeparated(r)||(r.min=t.y,r.max=n.y,o[1].isSeparated(r))||(r.min=t.z,r.max=n.z,o[2].isSeparated(r)))return!1;for(let c=0;c<3;c++){const h=s[c],u=i[c];if(r.setFromBox(h,e),u.isSeparated(r))return!1}return!0}}(),dn.prototype.intersectsTriangle=function(){const r=new Li,e=new Array(3),t=new Ss,n=new Ss,i=new W;return function(s){this.needsUpdate&&this.update(),s.isExtendedTriangle?s.needsUpdate&&s.update():(r.copy(s),r.update(),s=r);const o=this.satBounds,c=this.satAxes;e[0]=s.a,e[1]=s.b,e[2]=s.c;for(let A=0;A<3;A++){const p=o[A],g=c[A];if(t.setFromPoints(g,e),p.isSeparated(t))return!1}const h=s.satBounds,u=s.satAxes,d=this.points;for(let A=0;A<3;A++){const p=h[A],g=u[A];if(t.setFromPoints(g,d),p.isSeparated(t))return!1}for(let A=0;A<3;A++){const p=c[A];for(let g=0;g<4;g++){const v=u[g];if(i.crossVectors(p,v),t.setFromPoints(i,e),n.setFromPoints(i,d),t.isSeparated(n))return!1}}return!0}}(),dn.prototype.closestPointToPoint=function(){return function(r,e){return this.needsUpdate&&this.update(),e.copy(r).applyMatrix4(this.invMatrix).clamp(this.min,this.max).applyMatrix4(this.matrix),e}}(),dn.prototype.distanceToPoint=function(){const r=new W;return function(e){return this.closestPointToPoint(e,r),e.distanceTo(r)}}(),dn.prototype.distanceToBox=function(){const r=["x","y","z"],e=new Array(12).fill().map(()=>new Is),t=new Array(12).fill().map(()=>new Is),n=new W,i=new W;return function(s,o=0,c=null,h=null){if(this.needsUpdate&&this.update(),this.intersectsBox(s))return(c||h)&&(s.getCenter(i),this.closestPointToPoint(i,n),s.closestPointToPoint(n,i),c&&c.copy(n),h&&h.copy(i)),0;const u=o*o,d=s.min,A=s.max,p=this.points;let g=1/0;for(let E=0;E<8;E++){const m=p[E];i.copy(m).clamp(d,A);const _=m.distanceToSquared(i);if(_<g&&(g=_,c&&c.copy(m),h&&h.copy(i),_<u))return Math.sqrt(_)}let v=0;for(let E=0;E<3;E++)for(let m=0;m<=1;m++)for(let _=0;_<=1;_++){const w=(E+1)%3,x=(E+2)%3,I=m<<w|_<<x,R=1<<E|m<<w|_<<x,S=p[I],T=p[R];e[v].set(S,T);const D=r[E],b=r[w],M=r[x],L=t[v],P=L.start,N=L.end;P[D]=d[D],P[b]=m?d[b]:A[b],P[M]=_?d[M]:A[b],N[D]=A[D],N[b]=m?d[b]:A[b],N[M]=_?d[M]:A[b],v++}for(let E=0;E<=1;E++)for(let m=0;m<=1;m++)for(let _=0;_<=1;_++){i.x=E?A.x:d.x,i.y=m?A.y:d.y,i.z=_?A.z:d.z,this.closestPointToPoint(i,n);const w=i.distanceToSquared(n);if(w<g&&(g=w,c&&c.copy(n),h&&h.copy(i),w<u))return Math.sqrt(w)}for(let E=0;E<12;E++){const m=e[E];for(let _=0;_<12;_++){const w=t[_];Dg(m,w,n,i);const x=n.distanceToSquared(i);if(x<g&&(g=x,c&&c.copy(n),h&&h.copy(i),x<u))return Math.sqrt(x)}}return Math.sqrt(g)}}();class Ng{constructor(e){this._getNewPrimitive=e,this._primitives=[]}getPrimitive(){const e=this._primitives;return e.length===0?this._getNewPrimitive():e.pop()}releasePrimitive(e){this._primitives.push(e)}}class eU extends Ng{constructor(){super(()=>new Li)}}const ii=new eU;function yn(r,e){return e[r+15]===65535}function En(r,e){return e[r+6]}function Gn(r,e){return e[r+14]}function si(r){return r+8}function Vn(r,e){return e[r+6]}function Ug(r,e){return e[r+7]}class tU{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const e=[];let t=null;this.setBuffer=n=>{t&&e.push(t),t=n,this.float32Array=new Float32Array(n),this.uint16Array=new Uint16Array(n),this.uint32Array=new Uint32Array(n)},this.clearBuffer=()=>{t=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,e.length!==0&&this.setBuffer(e.pop())}}}const Yt=new tU;let da,Nl;const Ul=[],Gd=new Ng(()=>new yr);function rU(r,e,t,n,i,s){da=Gd.getPrimitive(),Nl=Gd.getPrimitive(),Ul.push(da,Nl),Yt.setBuffer(r._roots[e]);const o=Pg(0,r.geometry,t,n,i,s);Yt.clearBuffer(),Gd.releasePrimitive(da),Gd.releasePrimitive(Nl),Ul.pop(),Ul.pop();const c=Ul.length;return c>0&&(Nl=Ul[c-1],da=Ul[c-2]),o}function Pg(r,e,t,n,i=null,s=0,o=0){const{float32Array:c,uint16Array:h,uint32Array:u}=Yt;let d=r*2;if(yn(d,h)){const A=En(r,u),p=Gn(d,h);return rr(r,c,da),n(A,p,!1,o,s+r,da)}else{let A=function(L){const{uint16Array:P,uint32Array:N}=Yt;let j=L*2;for(;!yn(j,P);)L=si(L),j=L*2;return En(L,N)},p=function(L){const{uint16Array:P,uint32Array:N}=Yt;let j=L*2;for(;!yn(j,P);)L=Vn(L,N),j=L*2;return En(L,N)+Gn(j,P)};const g=si(r),v=Vn(r,u);let E=g,m=v,_,w,x,I;if(i&&(x=da,I=Nl,rr(E,c,x),rr(m,c,I),_=i(x),w=i(I),w<_)){E=v,m=g;const L=_;_=w,w=L,x=I}x||(x=da,rr(E,c,x));const R=yn(E*2,h),S=t(x,R,_,o+1,s+E);let T;if(S===Px){const L=A(E),P=p(E)-L;T=n(L,P,!0,o+1,s+E,x)}else T=S&&Pg(E,e,t,n,i,s,o+1);if(T)return!0;I=Nl,rr(m,c,I);const D=yn(m*2,h),b=t(I,D,w,o+1,s+m);let M;if(b===Px){const L=A(m),P=p(m)-L;M=n(L,P,!0,o+1,s+m,I)}else M=b&&Pg(m,e,t,n,i,s,o+1);return!!M}}const Iu=new W,kg=new W;function nU(r,e,t={},n=0,i=1/0){const s=n*n,o=i*i;let c=1/0,h=null;if(r.shapecast({boundsTraverseOrder:d=>(Iu.copy(e).clamp(d.min,d.max),Iu.distanceToSquared(e)),intersectsBounds:(d,A,p)=>p<c&&p<o,intersectsTriangle:(d,A)=>{d.closestPointToPoint(e,Iu);const p=e.distanceToSquared(Iu);return p<c&&(kg.copy(Iu),c=p,h=A),p<s}}),c===1/0)return null;const u=Math.sqrt(c);return t.point?t.point.copy(kg):t.point=kg.clone(),t.distance=u,t.faceIndex=h,t}const Pl=new W,kl=new W,Ql=new W,Vd=new Ge,jd=new Ge,Wd=new Ge,jx=new W,Wx=new W,Yx=new W,Yd=new W;function iU(r,e,t,n,i,s){let o;return s===Pr?o=r.intersectTriangle(n,t,e,!0,i):o=r.intersectTriangle(e,t,n,s!==yi,i),o===null?null:{distance:r.origin.distanceTo(i),point:i.clone()}}function sU(r,e,t,n,i,s,o,c,h){Pl.fromBufferAttribute(e,s),kl.fromBufferAttribute(e,o),Ql.fromBufferAttribute(e,c);const u=iU(r,Pl,kl,Ql,Yd,h);if(u){n&&(Vd.fromBufferAttribute(n,s),jd.fromBufferAttribute(n,o),Wd.fromBufferAttribute(n,c),u.uv=on.getInterpolation(Yd,Pl,kl,Ql,Vd,jd,Wd,new Ge)),i&&(Vd.fromBufferAttribute(i,s),jd.fromBufferAttribute(i,o),Wd.fromBufferAttribute(i,c),u.uv1=on.getInterpolation(Yd,Pl,kl,Ql,Vd,jd,Wd,new Ge)),t&&(jx.fromBufferAttribute(t,s),Wx.fromBufferAttribute(t,o),Yx.fromBufferAttribute(t,c),u.normal=on.getInterpolation(Yd,Pl,kl,Ql,jx,Wx,Yx,new W),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));const d={a:s,b:o,c,normal:new W,materialIndex:0};on.getNormal(Pl,kl,Ql,d.normal),u.face=d,u.faceIndex=s}return u}function qd(r,e,t,n,i){const s=n*3;let o=s+0,c=s+1,h=s+2;const u=r.index;r.index&&(o=u.getX(o),c=u.getX(c),h=u.getX(h));const{position:d,normal:A,uv:p,uv1:g}=r.attributes,v=sU(t,d,A,p,g,o,c,h,e);return v?(v.faceIndex=n,i&&i.push(v),v):null}function xr(r,e,t,n){const i=r.a,s=r.b,o=r.c;let c=e,h=e+1,u=e+2;t&&(c=t.getX(c),h=t.getX(h),u=t.getX(u)),i.x=n.getX(c),i.y=n.getY(c),i.z=n.getZ(c),s.x=n.getX(h),s.y=n.getY(h),s.z=n.getZ(h),o.x=n.getX(u),o.y=n.getY(u),o.z=n.getZ(u)}function aU(r,e,t,n,i,s){const{geometry:o,_indirectBuffer:c}=r;for(let h=n,u=n+i;h<u;h++)qd(o,e,t,h,s)}function oU(r,e,t,n,i){const{geometry:s,_indirectBuffer:o}=r;let c=1/0,h=null;for(let u=n,d=n+i;u<d;u++){let A;A=qd(s,e,t,u),A&&A.distance<c&&(h=A,c=A.distance)}return h}function lU(r,e,t,n,i,s,o){const{geometry:c}=t,{index:h}=c,u=c.attributes.position;for(let d=r,A=e+r;d<A;d++){let p;if(p=d,xr(o,p*3,h,u),o.needsUpdate=!0,n(o,p,i,s))return!0}return!1}function cU(r,e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=r.geometry,n=t.index?t.index.array:null,i=t.attributes.position;let s,o,c,h,u=0;const d=r._roots;for(let p=0,g=d.length;p<g;p++)s=d[p],o=new Uint32Array(s),c=new Uint16Array(s),h=new Float32Array(s),A(0,u),u+=s.byteLength;function A(p,g,v=!1){const E=p*2;if(c[E+15]===Od){const m=o[p+6],_=c[E+14];let w=1/0,x=1/0,I=1/0,R=-1/0,S=-1/0,T=-1/0;for(let D=3*m,b=3*(m+_);D<b;D++){let M=n[D];const L=i.getX(M),P=i.getY(M),N=i.getZ(M);L<w&&(w=L),L>R&&(R=L),P<x&&(x=P),P>S&&(S=P),N<I&&(I=N),N>T&&(T=N)}return h[p+0]!==w||h[p+1]!==x||h[p+2]!==I||h[p+3]!==R||h[p+4]!==S||h[p+5]!==T?(h[p+0]=w,h[p+1]=x,h[p+2]=I,h[p+3]=R,h[p+4]=S,h[p+5]=T,!0):!1}else{const m=p+8,_=o[p+6],w=m+g,x=_+g;let I=v,R=!1,S=!1;e?I||(R=e.has(w),S=e.has(x),I=!R&&!S):(R=!0,S=!0);const T=I||R,D=I||S;let b=!1;T&&(b=A(m,g,I));let M=!1;D&&(M=A(_,g,I));const L=b||M;if(L)for(let P=0;P<3;P++){const N=m+P,j=_+P,X=h[N],K=h[N+3],ne=h[j],V=h[j+3];h[p+P]=X<ne?X:ne,h[p+P+3]=K>V?K:V}return L}}}const qx=new yr;function fa(r,e,t,n){return rr(r,e,qx),t.intersectBox(qx,n)}function uU(r,e,t,n,i,s){const{geometry:o,_indirectBuffer:c}=r;for(let h=n,u=n+i;h<u;h++){let d=c?c[h]:h;qd(o,e,t,d,s)}}function hU(r,e,t,n,i){const{geometry:s,_indirectBuffer:o}=r;let c=1/0,h=null;for(let u=n,d=n+i;u<d;u++){let A;A=qd(s,e,t,o?o[u]:u),A&&A.distance<c&&(h=A,c=A.distance)}return h}function dU(r,e,t,n,i,s,o){const{geometry:c}=t,{index:h}=c,u=c.attributes.position;for(let d=r,A=e+r;d<A;d++){let p;if(p=t.resolveTriangleIndex(d),xr(o,p*3,h,u),o.needsUpdate=!0,n(o,p,i,s))return!0}return!1}const Xx=new W;function fU(r,e,t,n,i){Yt.setBuffer(r._roots[e]),Qg(0,r,t,n,i),Yt.clearBuffer()}function Qg(r,e,t,n,i){const{float32Array:s,uint16Array:o,uint32Array:c}=Yt,h=r*2;if(yn(h,o)){const u=En(r,c),d=Gn(h,o);aU(e,t,n,u,d,i)}else{const u=si(r);fa(u,s,n,Xx)&&Qg(u,e,t,n,i);const d=Vn(r,c);fa(d,s,n,Xx)&&Qg(d,e,t,n,i)}}const Kx=new W,pU=["x","y","z"];function AU(r,e,t,n){Yt.setBuffer(r._roots[e]);const i=Og(0,r,t,n);return Yt.clearBuffer(),i}function Og(r,e,t,n){const{float32Array:i,uint16Array:s,uint32Array:o}=Yt;let c=r*2;if(yn(c,s)){const h=En(r,o),u=Gn(c,s);return oU(e,t,n,h,u)}else{const h=Ug(r,o),u=pU[h],d=n.direction[u]>=0;let A,p;d?(A=si(r),p=Vn(r,o)):(A=Vn(r,o),p=si(r));const g=fa(A,i,n,Kx)?Og(A,e,t,n):null;if(g){const E=g.point[u];if(d?E<=i[p+h]:E>=i[p+h+3])return g}const v=fa(p,i,n,Kx)?Og(p,e,t,n):null;return g&&v?g.distance<=v.distance?g:v:g||v||null}}const Xd=new yr,Ol=new Li,Fl=new Li,Cu=new tt,Jx=new dn,Kd=new dn;function gU(r,e,t,n){Yt.setBuffer(r._roots[e]);const i=Fg(0,r,t,n);return Yt.clearBuffer(),i}function Fg(r,e,t,n,i=null){const{float32Array:s,uint16Array:o,uint32Array:c}=Yt;let h=r*2;if(i===null&&(t.boundingBox||t.computeBoundingBox(),Jx.set(t.boundingBox.min,t.boundingBox.max,n),i=Jx),yn(h,o)){const u=e.geometry,d=u.index,A=u.attributes.position,p=t.index,g=t.attributes.position,v=En(r,c),E=Gn(h,o);if(Cu.copy(n).invert(),t.boundsTree)return rr(r,s,Kd),Kd.matrix.copy(Cu),Kd.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:m=>Kd.intersectsBox(m),intersectsTriangle:m=>{m.a.applyMatrix4(n),m.b.applyMatrix4(n),m.c.applyMatrix4(n),m.needsUpdate=!0;for(let _=v*3,w=(E+v)*3;_<w;_+=3)if(xr(Fl,_,d,A),Fl.needsUpdate=!0,m.intersectsTriangle(Fl))return!0;return!1}});for(let m=v*3,_=(E+v)*3;m<_;m+=3){xr(Ol,m,d,A),Ol.a.applyMatrix4(Cu),Ol.b.applyMatrix4(Cu),Ol.c.applyMatrix4(Cu),Ol.needsUpdate=!0;for(let w=0,x=p.count;w<x;w+=3)if(xr(Fl,w,p,g),Fl.needsUpdate=!0,Ol.intersectsTriangle(Fl))return!0}}else{const u=r+8,d=c[r+6];return rr(u,s,Xd),!!(i.intersectsBox(Xd)&&Fg(u,e,t,n,i)||(rr(d,s,Xd),i.intersectsBox(Xd)&&Fg(d,e,t,n,i)))}}const Jd=new tt,zg=new dn,Mu=new dn,mU=new W,_U=new W,vU=new W,yU=new W;function EU(r,e,t,n={},i={},s=0,o=1/0){e.boundingBox||e.computeBoundingBox(),zg.set(e.boundingBox.min,e.boundingBox.max,t),zg.needsUpdate=!0;const c=r.geometry,h=c.attributes.position,u=c.index,d=e.attributes.position,A=e.index,p=ii.getPrimitive(),g=ii.getPrimitive();let v=mU,E=_U,m=null,_=null;i&&(m=vU,_=yU);let w=1/0,x=null,I=null;return Jd.copy(t).invert(),Mu.matrix.copy(Jd),r.shapecast({boundsTraverseOrder:R=>zg.distanceToBox(R),intersectsBounds:(R,S,T)=>T<w&&T<o?(S&&(Mu.min.copy(R.min),Mu.max.copy(R.max),Mu.needsUpdate=!0),!0):!1,intersectsRange:(R,S)=>{if(e.boundsTree)return e.boundsTree.shapecast({boundsTraverseOrder:T=>Mu.distanceToBox(T),intersectsBounds:(T,D,b)=>b<w&&b<o,intersectsRange:(T,D)=>{for(let b=T,M=T+D;b<M;b++){xr(g,3*b,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let L=R,P=R+S;L<P;L++){xr(p,3*L,u,h),p.needsUpdate=!0;const N=p.distanceToTriangle(g,v,m);if(N<w&&(E.copy(v),_&&_.copy(m),w=N,x=L,I=b),N<s)return!0}}}});{const T=Ll(e);for(let D=0,b=T;D<b;D++){xr(g,3*D,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let M=R,L=R+S;M<L;M++){xr(p,3*M,u,h),p.needsUpdate=!0;const P=p.distanceToTriangle(g,v,m);if(P<w&&(E.copy(v),_&&_.copy(m),w=P,x=M,I=D),P<s)return!0}}}}}),ii.releasePrimitive(p),ii.releasePrimitive(g),w===1/0?null:(n.point?n.point.copy(E):n.point=E.clone(),n.distance=w,n.faceIndex=x,i&&(i.point?i.point.copy(_):i.point=_.clone(),i.point.applyMatrix4(Jd),E.applyMatrix4(Jd),i.distance=E.sub(i.point).length(),i.faceIndex=I),n)}function xU(r,e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=r.geometry,n=t.index?t.index.array:null,i=t.attributes.position;let s,o,c,h,u=0;const d=r._roots;for(let p=0,g=d.length;p<g;p++)s=d[p],o=new Uint32Array(s),c=new Uint16Array(s),h=new Float32Array(s),A(0,u),u+=s.byteLength;function A(p,g,v=!1){const E=p*2;if(c[E+15]===Od){const m=o[p+6],_=c[E+14];let w=1/0,x=1/0,I=1/0,R=-1/0,S=-1/0,T=-1/0;for(let D=m,b=m+_;D<b;D++){const M=3*r.resolveTriangleIndex(D);for(let L=0;L<3;L++){let P=M+L;P=n?n[P]:P;const N=i.getX(P),j=i.getY(P),X=i.getZ(P);N<w&&(w=N),N>R&&(R=N),j<x&&(x=j),j>S&&(S=j),X<I&&(I=X),X>T&&(T=X)}}return h[p+0]!==w||h[p+1]!==x||h[p+2]!==I||h[p+3]!==R||h[p+4]!==S||h[p+5]!==T?(h[p+0]=w,h[p+1]=x,h[p+2]=I,h[p+3]=R,h[p+4]=S,h[p+5]=T,!0):!1}else{const m=p+8,_=o[p+6],w=m+g,x=_+g;let I=v,R=!1,S=!1;e?I||(R=e.has(w),S=e.has(x),I=!R&&!S):(R=!0,S=!0);const T=I||R,D=I||S;let b=!1;T&&(b=A(m,g,I));let M=!1;D&&(M=A(_,g,I));const L=b||M;if(L)for(let P=0;P<3;P++){const N=m+P,j=_+P,X=h[N],K=h[N+3],ne=h[j],V=h[j+3];h[p+P]=X<ne?X:ne,h[p+P+3]=K>V?K:V}return L}}}const Zx=new W;function wU(r,e,t,n,i){Yt.setBuffer(r._roots[e]),Hg(0,r,t,n,i),Yt.clearBuffer()}function Hg(r,e,t,n,i){const{float32Array:s,uint16Array:o,uint32Array:c}=Yt,h=r*2;if(yn(h,o)){const u=En(r,c),d=Gn(h,o);uU(e,t,n,u,d,i)}else{const u=si(r);fa(u,s,n,Zx)&&Hg(u,e,t,n,i);const d=Vn(r,c);fa(d,s,n,Zx)&&Hg(d,e,t,n,i)}}const $x=new W,IU=["x","y","z"];function CU(r,e,t,n){Yt.setBuffer(r._roots[e]);const i=Gg(0,r,t,n);return Yt.clearBuffer(),i}function Gg(r,e,t,n){const{float32Array:i,uint16Array:s,uint32Array:o}=Yt;let c=r*2;if(yn(c,s)){const h=En(r,o),u=Gn(c,s);return hU(e,t,n,h,u)}else{const h=Ug(r,o),u=IU[h],d=n.direction[u]>=0;let A,p;d?(A=si(r),p=Vn(r,o)):(A=Vn(r,o),p=si(r));const g=fa(A,i,n,$x)?Gg(A,e,t,n):null;if(g){const E=g.point[u];if(d?E<=i[p+h]:E>=i[p+h+3])return g}const v=fa(p,i,n,$x)?Gg(p,e,t,n):null;return g&&v?g.distance<=v.distance?g:v:g||v||null}}const Zd=new yr,zl=new Li,Hl=new Li,Su=new tt,ew=new dn,$d=new dn;function MU(r,e,t,n){Yt.setBuffer(r._roots[e]);const i=Vg(0,r,t,n);return Yt.clearBuffer(),i}function Vg(r,e,t,n,i=null){const{float32Array:s,uint16Array:o,uint32Array:c}=Yt;let h=r*2;if(i===null&&(t.boundingBox||t.computeBoundingBox(),ew.set(t.boundingBox.min,t.boundingBox.max,n),i=ew),yn(h,o)){const u=e.geometry,d=u.index,A=u.attributes.position,p=t.index,g=t.attributes.position,v=En(r,c),E=Gn(h,o);if(Su.copy(n).invert(),t.boundsTree)return rr(r,s,$d),$d.matrix.copy(Su),$d.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:m=>$d.intersectsBox(m),intersectsTriangle:m=>{m.a.applyMatrix4(n),m.b.applyMatrix4(n),m.c.applyMatrix4(n),m.needsUpdate=!0;for(let _=v,w=E+v;_<w;_++)if(xr(Hl,3*e.resolveTriangleIndex(_),d,A),Hl.needsUpdate=!0,m.intersectsTriangle(Hl))return!0;return!1}});for(let m=v,_=E+v;m<_;m++){const w=e.resolveTriangleIndex(m);xr(zl,3*w,d,A),zl.a.applyMatrix4(Su),zl.b.applyMatrix4(Su),zl.c.applyMatrix4(Su),zl.needsUpdate=!0;for(let x=0,I=p.count;x<I;x+=3)if(xr(Hl,x,p,g),Hl.needsUpdate=!0,zl.intersectsTriangle(Hl))return!0}}else{const u=r+8,d=c[r+6];return rr(u,s,Zd),!!(i.intersectsBox(Zd)&&Vg(u,e,t,n,i)||(rr(d,s,Zd),i.intersectsBox(Zd)&&Vg(d,e,t,n,i)))}}const ef=new tt,jg=new dn,Tu=new dn,SU=new W,TU=new W,BU=new W,bU=new W;function RU(r,e,t,n={},i={},s=0,o=1/0){e.boundingBox||e.computeBoundingBox(),jg.set(e.boundingBox.min,e.boundingBox.max,t),jg.needsUpdate=!0;const c=r.geometry,h=c.attributes.position,u=c.index,d=e.attributes.position,A=e.index,p=ii.getPrimitive(),g=ii.getPrimitive();let v=SU,E=TU,m=null,_=null;i&&(m=BU,_=bU);let w=1/0,x=null,I=null;return ef.copy(t).invert(),Tu.matrix.copy(ef),r.shapecast({boundsTraverseOrder:R=>jg.distanceToBox(R),intersectsBounds:(R,S,T)=>T<w&&T<o?(S&&(Tu.min.copy(R.min),Tu.max.copy(R.max),Tu.needsUpdate=!0),!0):!1,intersectsRange:(R,S)=>{if(e.boundsTree){const T=e.boundsTree;return T.shapecast({boundsTraverseOrder:D=>Tu.distanceToBox(D),intersectsBounds:(D,b,M)=>M<w&&M<o,intersectsRange:(D,b)=>{for(let M=D,L=D+b;M<L;M++){const P=T.resolveTriangleIndex(M);xr(g,3*P,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let N=R,j=R+S;N<j;N++){const X=r.resolveTriangleIndex(N);xr(p,3*X,u,h),p.needsUpdate=!0;const K=p.distanceToTriangle(g,v,m);if(K<w&&(E.copy(v),_&&_.copy(m),w=K,x=N,I=M),K<s)return!0}}}})}else{const T=Ll(e);for(let D=0,b=T;D<b;D++){xr(g,3*D,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let M=R,L=R+S;M<L;M++){const P=r.resolveTriangleIndex(M);xr(p,3*P,u,h),p.needsUpdate=!0;const N=p.distanceToTriangle(g,v,m);if(N<w&&(E.copy(v),_&&_.copy(m),w=N,x=M,I=D),N<s)return!0}}}}}),ii.releasePrimitive(p),ii.releasePrimitive(g),w===1/0?null:(n.point?n.point.copy(E):n.point=E.clone(),n.distance=w,n.faceIndex=x,i&&(i.point?i.point.copy(_):i.point=_.clone(),i.point.applyMatrix4(ef),E.applyMatrix4(ef),i.distance=E.sub(i.point).length(),i.faceIndex=I),n)}function DU(){return typeof SharedArrayBuffer<"u"}const Bu=new Yt.constructor,tf=new Yt.constructor,pa=new Ng(()=>new yr),Gl=new yr,Vl=new yr,Wg=new yr,Yg=new yr;let qg=!1;function LU(r,e,t,n){if(qg)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");qg=!0;const i=r._roots,s=e._roots;let o,c=0,h=0;const u=new tt().copy(t).invert();for(let d=0,A=i.length;d<A;d++){Bu.setBuffer(i[d]),h=0;const p=pa.getPrimitive();rr(0,Bu.float32Array,p),p.applyMatrix4(u);for(let g=0,v=s.length;g<v&&(tf.setBuffer(s[d]),o=Ni(0,0,t,u,n,c,h,0,0,p),tf.clearBuffer(),h+=s[g].length,!o);g++);if(pa.releasePrimitive(p),Bu.clearBuffer(),c+=i[d].length,o)break}return qg=!1,o}function Ni(r,e,t,n,i,s=0,o=0,c=0,h=0,u=null,d=!1){let A,p;d?(A=tf,p=Bu):(A=Bu,p=tf);const g=A.float32Array,v=A.uint32Array,E=A.uint16Array,m=p.float32Array,_=p.uint32Array,w=p.uint16Array,x=r*2,I=e*2,R=yn(x,E),S=yn(I,w);let T=!1;if(S&&R)d?T=i(En(e,_),Gn(e*2,w),En(r,v),Gn(r*2,E),h,o+e,c,s+r):T=i(En(r,v),Gn(r*2,E),En(e,_),Gn(e*2,w),c,s+r,h,o+e);else if(S){const D=pa.getPrimitive();rr(e,m,D),D.applyMatrix4(t);const b=si(r),M=Vn(r,v);rr(b,g,Gl),rr(M,g,Vl);const L=D.intersectsBox(Gl),P=D.intersectsBox(Vl);T=L&&Ni(e,b,n,t,i,o,s,h,c+1,D,!d)||P&&Ni(e,M,n,t,i,o,s,h,c+1,D,!d),pa.releasePrimitive(D)}else{const D=si(e),b=Vn(e,_);rr(D,m,Wg),rr(b,m,Yg);const M=u.intersectsBox(Wg),L=u.intersectsBox(Yg);if(M&&L)T=Ni(r,D,t,n,i,s,o,c,h+1,u,d)||Ni(r,b,t,n,i,s,o,c,h+1,u,d);else if(M)if(R)T=Ni(r,D,t,n,i,s,o,c,h+1,u,d);else{const P=pa.getPrimitive();P.copy(Wg).applyMatrix4(t);const N=si(r),j=Vn(r,v);rr(N,g,Gl),rr(j,g,Vl);const X=P.intersectsBox(Gl),K=P.intersectsBox(Vl);T=X&&Ni(D,N,n,t,i,o,s,h,c+1,P,!d)||K&&Ni(D,j,n,t,i,o,s,h,c+1,P,!d),pa.releasePrimitive(P)}else if(L)if(R)T=Ni(r,b,t,n,i,s,o,c,h+1,u,d);else{const P=pa.getPrimitive();P.copy(Yg).applyMatrix4(t);const N=si(r),j=Vn(r,v);rr(N,g,Gl),rr(j,g,Vl);const X=P.intersectsBox(Gl),K=P.intersectsBox(Vl);T=X&&Ni(b,N,n,t,i,o,s,h,c+1,P,!d)||K&&Ni(b,j,n,t,i,o,s,h,c+1,P,!d),pa.releasePrimitive(P)}}return T}const rf=new dn,tw=new yr;class Xg{static serialize(e,t={}){t={cloneBuffers:!0,...t};const n=e.geometry,i=e._roots,s=e._indirectBuffer,o=n.getIndex();let c;return t.cloneBuffers?c={roots:i.map(h=>h.slice()),index:o.array.slice(),indirectBuffer:s?s.slice():null}:c={roots:i,index:o.array,indirectBuffer:s},c}static deserialize(e,t,n={}){n={setIndex:!0,indirect:!!e.indirectBuffer,...n};const{index:i,roots:s,indirectBuffer:o}=e,c=new Xg(t,{...n,[bg]:!0});if(c._roots=s,c._indirectBuffer=o||null,n.setIndex){const h=t.getIndex();if(h===null){const u=new Qr(e.index,1,!1);t.setIndex(u)}else h.array!==i&&(h.array.set(i),h.needsUpdate=!0)}return c}get indirect(){return!!this._indirectBuffer}constructor(e,t={}){if(e.isBufferGeometry){if(e.index&&e.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("MeshBVH: Only BufferGeometries are supported.");if(t=Object.assign({strategy:Nx,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,[bg]:!1},t),t.useSharedArrayBuffer&&!DU())throw new Error("MeshBVH: SharedArrayBuffer is not available.");this.geometry=e,this._roots=null,this._indirectBuffer=null,t[bg]||(KN(this,t),!e.boundingBox&&t.setBoundingBox&&(e.boundingBox=this.getBoundingBox(new yr)));const{_indirectBuffer:n}=this;this.resolveTriangleIndex=t.indirect?i=>n[i]:i=>i}refit(e=null){return(this.indirect?xU:cU)(this,e)}traverse(e,t=0){const n=this._roots[t],i=new Uint32Array(n),s=new Uint16Array(n);o(0);function o(c,h=0){const u=c*2,d=s[u+15]===Od;if(d){const A=i[c+6],p=s[u+14];e(h,d,new Float32Array(n,c*4,6),A,p)}else{const A=c+mo/4,p=i[c+6],g=i[c+7];e(h,d,new Float32Array(n,c*4,6),g)||(o(A,h+1),o(p,h+1))}}}raycast(e,t=vi){const n=this._roots,i=this.geometry,s=[],o=t.isMaterial,c=Array.isArray(t),h=i.groups,u=o?t.side:t,d=this.indirect?wU:fU;for(let A=0,p=n.length;A<p;A++){const g=c?t[h[A].materialIndex].side:u,v=s.length;if(d(this,A,g,e,s),c){const E=h[A].materialIndex;for(let m=v,_=s.length;m<_;m++)s[m].face.materialIndex=E}}return s}raycastFirst(e,t=vi){const n=this._roots,i=this.geometry,s=t.isMaterial,o=Array.isArray(t);let c=null;const h=i.groups,u=s?t.side:t,d=this.indirect?CU:AU;for(let A=0,p=n.length;A<p;A++){const g=o?t[h[A].materialIndex].side:u,v=d(this,A,g,e);v!=null&&(c==null||v.distance<c.distance)&&(c=v,o&&(v.face.materialIndex=h[A].materialIndex))}return c}intersectsGeometry(e,t){let n=!1;const i=this._roots,s=this.indirect?MU:gU;for(let o=0,c=i.length;o<c&&(n=s(this,o,e,t),!n);o++);return n}shapecast(e){const t=ii.getPrimitive(),n=this.indirect?dU:lU;let{boundsTraverseOrder:i,intersectsBounds:s,intersectsRange:o,intersectsTriangle:c}=e;if(o&&c){const A=o;o=(p,g,v,E,m)=>A(p,g,v,E,m)?!0:n(p,g,this,c,v,E,t)}else o||(c?o=(A,p,g,v)=>n(A,p,this,c,g,v,t):o=(A,p,g)=>g);let h=!1,u=0;const d=this._roots;for(let A=0,p=d.length;A<p;A++){const g=d[A];if(h=rU(this,A,s,o,i,u),h)break;u+=g.byteLength}return ii.releasePrimitive(t),h}bvhcast(e,t,n){let{intersectsRanges:i,intersectsTriangles:s}=n;const o=ii.getPrimitive(),c=this.geometry.index,h=this.geometry.attributes.position,u=this.indirect?v=>{const E=this.resolveTriangleIndex(v);xr(o,E*3,c,h)}:v=>{xr(o,v*3,c,h)},d=ii.getPrimitive(),A=e.geometry.index,p=e.geometry.attributes.position,g=e.indirect?v=>{const E=e.resolveTriangleIndex(v);xr(d,E*3,A,p)}:v=>{xr(d,v*3,A,p)};if(s){const v=(E,m,_,w,x,I,R,S)=>{for(let T=_,D=_+w;T<D;T++){g(T),d.a.applyMatrix4(t),d.b.applyMatrix4(t),d.c.applyMatrix4(t),d.needsUpdate=!0;for(let b=E,M=E+m;b<M;b++)if(u(b),o.needsUpdate=!0,s(o,d,b,T,x,I,R,S))return!0}return!1};if(i){const E=i;i=function(m,_,w,x,I,R,S,T){return E(m,_,w,x,I,R,S,T)?!0:v(m,_,w,x,I,R,S,T)}}else i=v}return LU(this,e,t,i)}intersectsBox(e,t){return rf.set(e.min,e.max,t),rf.needsUpdate=!0,this.shapecast({intersectsBounds:n=>rf.intersectsBox(n),intersectsTriangle:n=>rf.intersectsTriangle(n)})}intersectsSphere(e){return this.shapecast({intersectsBounds:t=>e.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(e)})}closestPointToGeometry(e,t,n={},i={},s=0,o=1/0){return(this.indirect?RU:EU)(this,e,t,n,i,s,o)}closestPointToPoint(e,t={},n=0,i=1/0){return nU(this,e,t,n,i)}getBoundingBox(e){return e.makeEmpty(),this._roots.forEach(t=>{rr(0,new Float32Array(t),tw),e.union(tw)}),e}}function NU(r){switch(r){case 1:return"R";case 2:return"RG";case 3:return"RGBA";case 4:return"RGBA"}throw new Error}function UU(r){switch(r){case 1:return $s;case 2:return no;case 3:return Ar;case 4:return Ar}}function rw(r){switch(r){case 1:return dA;case 2:return qh;case 3:return eu;case 4:return eu}}class nw extends po{constructor(){super(),this.minFilter=dr,this.magFilter=dr,this.generateMipmaps=!1,this.overrideItemSize=null,this._forcedType=null}updateFrom(e){const t=this.overrideItemSize,n=e.itemSize,i=e.count;if(t!==null){if(n*i%t!==0)throw new Error("VertexAttributeTexture: overrideItemSize must divide evenly into buffer length.");e.itemSize=t,e.count=i*n/t}const s=e.itemSize,o=e.count,c=e.normalized,h=e.array.constructor,u=h.BYTES_PER_ELEMENT;let d=this._forcedType,A=s;if(d===null)switch(h){case Float32Array:d=or;break;case Uint8Array:case Uint16Array:case Uint32Array:d=wi;break;case Int8Array:case Int16Array:case Int32Array:d=Jc;break}let p,g,v,E,m=NU(s);switch(d){case or:v=1,g=UU(s),c&&u===1?(E=h,m+="8",h===Uint8Array?p=pr:(p=uA,m+="_SNORM")):(E=Float32Array,m+="32F",p=or);break;case Jc:m+=u*8+"I",v=c?Math.pow(2,h.BYTES_PER_ELEMENT*8-1):1,g=rw(s),u===1?(E=Int8Array,p=uA):u===2?(E=Int16Array,p=Vy):(E=Int32Array,p=Jc);break;case wi:m+=u*8+"UI",v=c?Math.pow(2,h.BYTES_PER_ELEMENT*8-1):1,g=rw(s),u===1?(E=Uint8Array,p=pr):u===2?(E=Uint16Array,p=hA):(E=Uint32Array,p=wi);break}A===3&&(g===Ar||g===eu)&&(A=4);const _=Math.ceil(Math.sqrt(o)),w=A*_*_,x=new E(w),I=e.normalized;e.normalized=!1;for(let R=0;R<o;R++){const S=A*R;x[S]=e.getX(R)/v,s>=2&&(x[S+1]=e.getY(R)/v),s>=3&&(x[S+2]=e.getZ(R)/v,A===4&&(x[S+3]=1)),s>=4&&(x[S+3]=e.getW(R)/v)}e.normalized=I,this.internalFormat=m,this.format=g,this.type=p,this.image.width=_,this.image.height=_,this.image.data=x,this.needsUpdate=!0,this.dispose(),e.itemSize=n,e.count=i}}class PU extends nw{constructor(){super(),this._forcedType=wi}}class kU extends nw{constructor(){super(),this._forcedType=or}}class iw{constructor(){this.index=new PU,this.position=new kU,this.bvhBounds=new po,this.bvhContents=new po,this._cachedIndexAttr=null,this.index.overrideItemSize=3}updateFrom(e){const{geometry:t}=e;if(OU(e,this.bvhBounds,this.bvhContents),this.position.updateFrom(t.attributes.position),e.indirect){const n=e._indirectBuffer;if(this._cachedIndexAttr===null||this._cachedIndexAttr.count!==n.length)if(t.index)this._cachedIndexAttr=t.index.clone();else{const i=Ox(Qx(t));this._cachedIndexAttr=new Qr(i,1,!1)}QU(t,n,this._cachedIndexAttr),this.index.updateFrom(this._cachedIndexAttr)}else this.index.updateFrom(t.index)}dispose(){const{index:e,position:t,bvhBounds:n,bvhContents:i}=this;e&&e.dispose(),t&&t.dispose(),n&&n.dispose(),i&&i.dispose()}}function QU(r,e,t){const n=t.array,i=r.index?r.index.array:null;for(let s=0,o=e.length;s<o;s++){const c=3*s,h=3*e[s];for(let u=0;u<3;u++)n[c+u]=i?i[h+u]:h+u}}function OU(r,e,t){const n=r._roots;if(n.length!==1)throw new Error("MeshBVHUniformStruct: Multi-root BVHs not supported.");const i=n[0],s=new Uint16Array(i),o=new Uint32Array(i),c=new Float32Array(i),h=i.byteLength/mo,u=2*Math.ceil(Math.sqrt(h/2)),d=new Float32Array(4*u*u),A=Math.ceil(Math.sqrt(h)),p=new Uint32Array(2*A*A);for(let g=0;g<h;g++){const v=g*mo/4,E=v*2,m=v;for(let _=0;_<3;_++)d[8*g+0+_]=c[m+0+_],d[8*g+4+_]=c[m+3+_];if(yn(E,s)){const _=Gn(E,s),w=En(v,o),x=4294901760|_;p[g*2+0]=x,p[g*2+1]=w}else{const _=4*Vn(v,o)/mo,w=Ug(v,o);p[g*2+0]=w,p[g*2+1]=_}}e.image.data=d,e.image.width=u,e.image.height=u,e.format=Ar,e.type=or,e.internalFormat="RGBA32F",e.minFilter=dr,e.magFilter=dr,e.generateMipmaps=!1,e.needsUpdate=!0,e.dispose(),t.image.data=p,t.image.width=A,t.image.height=A,t.format=qh,t.type=wi,t.internalFormat="RG32UI",t.minFilter=dr,t.magFilter=dr,t.generateMipmaps=!1,t.needsUpdate=!0,t.dispose()}const FU=`
3988
3988
  #ifndef TRI_INTERSECT_EPSILON
3989
3989
  #define TRI_INTERSECT_EPSILON 1e-5
3990
3990
  #endif
@@ -4406,7 +4406,7 @@ bool bvhIntersectFirstHit(
4406
4406
  * Subject to the terms at https://gsap.com/standard-license or for
4407
4407
  * Club GSAP members, the agreement issued with that membership.
4408
4408
  * @author: Jack Doyle, jack@greensock.com
4409
- */var Vn={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},jl={duration:.5,overwrite:!1,delay:0},Kg,Jr,$t,ai=1e8,Gt=1/ai,Jg=Math.PI*2,WU=Jg/4,YU=0,aw=Math.sqrt,qU=Math.cos,XU=Math.sin,Fr=function(r){return typeof r=="string"},lr=function(r){return typeof r=="function"},Bs=function(r){return typeof r=="number"},Zg=function(r){return typeof r>"u"},Zi=function(r){return typeof r=="object"},xn=function(r){return r!==!1},$g=function(){return typeof window<"u"},nf=function(r){return lr(r)||Fr(r)},ow=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Zr=Array.isArray,em=/(?:-?\.?\d|\.)+/gi,lw=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Wl=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,tm=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,cw=/[+-]=-?[.\d]+/,uw=/[^,'"\[\]\s]+/gi,KU=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,nr,$i,rm,nm,jn={},sf={},hw,dw=function(r){return(sf=vo(r,jn))&&Cn},im=function(r,e){return console.warn("Invalid property",r,"set to",e,"Missing plugin? gsap.registerPlugin()")},bu=function(r,e){return!e&&console.warn(r)},fw=function(r,e){return r&&(jn[r]=e)&&sf&&(sf[r]=e)||jn},Ru=function(){return 0},JU={suppressEvents:!0,isStart:!0,kill:!1},af={suppressEvents:!0,kill:!1},ZU={suppressEvents:!0},sm={},Aa=[],am={},pw,Wn={},om={},Aw=30,of=[],lm="",cm=function(r){var e=r[0],t,n;if(Zi(e)||lr(e)||(r=[r]),!(t=(e._gsap||{}).harness)){for(n=of.length;n--&&!of[n].targetTest(e););t=of[n]}for(n=r.length;n--;)r[n]&&(r[n]._gsap||(r[n]._gsap=new Vw(r[n],t)))||r.splice(n,1);return r},_o=function(r){return r._gsap||cm(ci(r))[0]._gsap},gw=function(r,e,t){return(t=r[e])&&lr(t)?r[e]():Zg(t)&&r.getAttribute&&r.getAttribute(e)||t},wn=function(r,e){return(r=r.split(",")).forEach(e)||r},gr=function(r){return Math.round(r*1e5)/1e5||0},zr=function(r){return Math.round(r*1e7)/1e7||0},Yl=function(r,e){var t=e.charAt(0),n=parseFloat(e.substr(2));return r=parseFloat(r),t==="+"?r+n:t==="-"?r-n:t==="*"?r*n:r/n},$U=function(r,e){for(var t=e.length,n=0;r.indexOf(e[n])<0&&++n<t;);return n<t},lf=function(){var r=Aa.length,e=Aa.slice(0),t,n;for(am={},Aa.length=0,t=0;t<r;t++)n=e[t],n&&n._lazy&&(n.render(n._lazy[0],n._lazy[1],!0)._lazy=0)},mw=function(r,e,t,n){Aa.length&&!Jr&&lf(),r.render(e,t,n||Jr&&e<0&&(r._initted||r._startAt)),Aa.length&&!Jr&&lf()},_w=function(r){var e=parseFloat(r);return(e||e===0)&&(r+"").match(uw).length<2?e:Fr(r)?r.trim():r},vw=function(r){return r},oi=function(r,e){for(var t in e)t in r||(r[t]=e[t]);return r},eP=function(r){return function(e,t){for(var n in t)n in e||n==="duration"&&r||n==="ease"||(e[n]=t[n])}},vo=function(r,e){for(var t in e)r[t]=e[t];return r},yw=function r(e,t){for(var n in t)n!=="__proto__"&&n!=="constructor"&&n!=="prototype"&&(e[n]=Zi(t[n])?r(e[n]||(e[n]={}),t[n]):t[n]);return e},cf=function(r,e){var t={},n;for(n in r)n in e||(t[n]=r[n]);return t},Du=function(r){var e=r.parent||nr,t=r.keyframes?eP(Zr(r.keyframes)):oi;if(xn(r.inherit))for(;e;)t(r,e.vars.defaults),e=e.parent||e._dp;return r},tP=function(r,e){for(var t=r.length,n=t===e.length;n&&t--&&r[t]===e[t];);return t<0},Ew=function(r,e,t,n,i){t===void 0&&(t="_first"),n===void 0&&(n="_last");var s=r[n],o;if(i)for(o=e[i];s&&s[i]>o;)s=s._prev;return s?(e._next=s._next,s._next=e):(e._next=r[t],r[t]=e),e._next?e._next._prev=e:r[n]=e,e._prev=s,e.parent=e._dp=r,e},uf=function(r,e,t,n){t===void 0&&(t="_first"),n===void 0&&(n="_last");var i=e._prev,s=e._next;i?i._next=s:r[t]===e&&(r[t]=s),s?s._prev=i:r[n]===e&&(r[n]=i),e._next=e._prev=e.parent=null},ga=function(r,e){r.parent&&(!e||r.parent.autoRemoveChildren)&&r.parent.remove&&r.parent.remove(r),r._act=0},yo=function(r,e){if(r&&(!e||e._end>r._dur||e._start<0))for(var t=r;t;)t._dirty=1,t=t.parent;return r},rP=function(r){for(var e=r.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return r},um=function(r,e,t,n){return r._startAt&&(Jr?r._startAt.revert(af):r.vars.immediateRender&&!r.vars.autoRevert||r._startAt.render(e,!0,n))},nP=function r(e){return!e||e._ts&&r(e.parent)},xw=function(r){return r._repeat?ql(r._tTime,r=r.duration()+r._rDelay)*r:0},ql=function(r,e){var t=Math.floor(r/=e);return r&&t===r?t-1:t},hf=function(r,e){return(r-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},df=function(r){return r._end=zr(r._start+(r._tDur/Math.abs(r._ts||r._rts||Gt)||0))},ff=function(r,e){var t=r._dp;return t&&t.smoothChildTiming&&r._ts&&(r._start=zr(t._time-(r._ts>0?e/r._ts:((r._dirty?r.totalDuration():r._tDur)-e)/-r._ts)),df(r),t._dirty||yo(t,r)),r},ww=function(r,e){var t;if((e._time||!e._dur&&e._initted||e._start<r._time&&(e._dur||!e.add))&&(t=hf(r.rawTime(),e),(!e._dur||Nu(0,e.totalDuration(),t)-e._tTime>Gt)&&e.render(t,!0)),yo(r,e)._dp&&r._initted&&r._time>=r._dur&&r._ts){if(r._dur<r.duration())for(t=r;t._dp;)t.rawTime()>=0&&t.totalTime(t._tTime),t=t._dp;r._zTime=-Gt}},es=function(r,e,t,n){return e.parent&&ga(e),e._start=zr((Bs(t)?t:t||r!==nr?li(r,t,e):r._time)+e._delay),e._end=zr(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),Ew(r,e,"_first","_last",r._sort?"_start":0),hm(e)||(r._recent=e),n||ww(r,e),r._ts<0&&ff(r,r._tTime),r},Iw=function(r,e){return(jn.ScrollTrigger||im("scrollTrigger",e))&&jn.ScrollTrigger.create(e,r)},Cw=function(r,e,t,n,i){if(ym(r,e,i),!r._initted)return 1;if(!t&&r._pt&&!Jr&&(r._dur&&r.vars.lazy!==!1||!r._dur&&r.vars.lazy)&&pw!==qn.frame)return Aa.push(r),r._lazy=[i,n],1},iP=function r(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||r(t))},hm=function(r){var e=r.data;return e==="isFromStart"||e==="isStart"},sP=function(r,e,t,n){var i=r.ratio,s=e<0||!e&&(!r._start&&iP(r)&&!(!r._initted&&hm(r))||(r._ts<0||r._dp._ts<0)&&!hm(r))?0:1,o=r._rDelay,c=0,h,u,d;if(o&&r._repeat&&(c=Nu(0,r._tDur,e),u=ql(c,o),r._yoyo&&u&1&&(s=1-s),u!==ql(r._tTime,o)&&(i=1-s,r.vars.repeatRefresh&&r._initted&&r.invalidate())),s!==i||Jr||n||r._zTime===Gt||!e&&r._zTime){if(!r._initted&&Cw(r,e,n,t,c))return;for(d=r._zTime,r._zTime=e||(t?Gt:0),t||(t=e&&!d),r.ratio=s,r._from&&(s=1-s),r._time=0,r._tTime=c,h=r._pt;h;)h.r(s,h.d),h=h._next;e<0&&um(r,e,t,!0),r._onUpdate&&!t&&Yn(r,"onUpdate"),c&&r._repeat&&!t&&r.parent&&Yn(r,"onRepeat"),(e>=r._tDur||e<0)&&r.ratio===s&&(s&&ga(r,1),!t&&!Jr&&(Yn(r,s?"onComplete":"onReverseComplete",!0),r._prom&&r._prom()))}else r._zTime||(r._zTime=e)},aP=function(r,e,t){var n;if(t>e)for(n=r._first;n&&n._start<=t;){if(n.data==="isPause"&&n._start>e)return n;n=n._next}else for(n=r._last;n&&n._start>=t;){if(n.data==="isPause"&&n._start<e)return n;n=n._prev}},Xl=function(r,e,t,n){var i=r._repeat,s=zr(e)||0,o=r._tTime/r._tDur;return o&&!n&&(r._time*=s/r._dur),r._dur=s,r._tDur=i?i<0?1e10:zr(s*(i+1)+r._rDelay*i):s,o>0&&!n&&ff(r,r._tTime=r._tDur*o),r.parent&&df(r),t||yo(r.parent,r),r},Mw=function(r){return r instanceof fn?yo(r):Xl(r,r._dur)},oP={_start:0,endTime:Ru,totalDuration:Ru},li=function r(e,t,n){var i=e.labels,s=e._recent||oP,o=e.duration()>=ai?s.endTime(!1):e._dur,c,h,u;return Fr(t)&&(isNaN(t)||t in i)?(h=t.charAt(0),u=t.substr(-1)==="%",c=t.indexOf("="),h==="<"||h===">"?(c>=0&&(t=t.replace(/=/,"")),(h==="<"?s._start:s.endTime(s._repeat>=0))+(parseFloat(t.substr(1))||0)*(u?(c<0?s:n).totalDuration()/100:1)):c<0?(t in i||(i[t]=o),i[t]):(h=parseFloat(t.charAt(c-1)+t.substr(c+1)),u&&n&&(h=h/100*(Zr(n)?n[0]:n).totalDuration()),c>1?r(e,t.substr(0,c-1),n)+h:o+h)):t==null?o:+t},Lu=function(r,e,t){var n=Bs(e[1]),i=(n?2:1)+(r<2?0:1),s=e[i],o,c;if(n&&(s.duration=e[1]),s.parent=t,r){for(o=s,c=t;c&&!("immediateRender"in o);)o=c.vars.defaults||{},c=xn(c.vars.inherit)&&c.parent;s.immediateRender=xn(o.immediateRender),r<2?s.runBackwards=1:s.startAt=e[i-1]}return new wr(e[0],s,e[i+1])},ma=function(r,e){return r||r===0?e(r):e},Nu=function(r,e,t){return t<r?r:t>e?e:t},$r=function(r,e){return!Fr(r)||!(e=KU.exec(r))?"":e[1]},lP=function(r,e,t){return ma(t,function(n){return Nu(r,e,n)})},dm=[].slice,Sw=function(r,e){return r&&Zi(r)&&"length"in r&&(!e&&!r.length||r.length-1 in r&&Zi(r[0]))&&!r.nodeType&&r!==$i},cP=function(r,e,t){return t===void 0&&(t=[]),r.forEach(function(n){var i;return Fr(n)&&!e||Sw(n,1)?(i=t).push.apply(i,ci(n)):t.push(n)})||t},ci=function(r,e,t){return $t&&!e&&$t.selector?$t.selector(r):Fr(r)&&!t&&(rm||!Jl())?dm.call((e||nm).querySelectorAll(r),0):Zr(r)?cP(r,t):Sw(r)?dm.call(r,0):r?[r]:[]},fm=function(r){return r=ci(r)[0]||bu("Invalid scope")||{},function(e){var t=r.current||r.nativeElement||r;return ci(e,t.querySelectorAll?t:t===r?bu("Invalid scope")||nm.createElement("div"):r)}},Tw=function(r){return r.sort(function(){return .5-Math.random()})},Bw=function(r){if(lr(r))return r;var e=Zi(r)?r:{each:r},t=Eo(e.ease),n=e.from||0,i=parseFloat(e.base)||0,s={},o=n>0&&n<1,c=isNaN(n)||o,h=e.axis,u=n,d=n;return Fr(n)?u=d={center:.5,edges:.5,end:1}[n]||0:!o&&c&&(u=n[0],d=n[1]),function(A,p,g){var v=(g||e).length,E=s[v],m,_,w,x,I,R,S,T,D;if(!E){if(D=e.grid==="auto"?0:(e.grid||[1,ai])[1],!D){for(S=-ai;S<(S=g[D++].getBoundingClientRect().left)&&D<v;);D<v&&D--}for(E=s[v]=[],m=c?Math.min(D,v)*u-.5:n%D,_=D===ai?0:c?v*d/D-.5:n/D|0,S=0,T=ai,R=0;R<v;R++)w=R%D-m,x=_-(R/D|0),E[R]=I=h?Math.abs(h==="y"?x:w):aw(w*w+x*x),I>S&&(S=I),I<T&&(T=I);n==="random"&&Tw(E),E.max=S-T,E.min=T,E.v=v=(parseFloat(e.amount)||parseFloat(e.each)*(D>v?v-1:h?h==="y"?v/D:D:Math.max(D,v/D))||0)*(n==="edges"?-1:1),E.b=v<0?i-v:i,E.u=$r(e.amount||e.each)||0,t=t&&v<0?zw(t):t}return v=(E[A]-E.min)/E.max||0,zr(E.b+(t?t(v):v)*E.v)+E.u}},pm=function(r){var e=Math.pow(10,((r+"").split(".")[1]||"").length);return function(t){var n=zr(Math.round(parseFloat(t)/r)*r*e);return(n-n%1)/e+(Bs(t)?0:$r(t))}},bw=function(r,e){var t=Zr(r),n,i;return!t&&Zi(r)&&(n=t=r.radius||ai,r.values?(r=ci(r.values),(i=!Bs(r[0]))&&(n*=n)):r=pm(r.increment)),ma(e,t?lr(r)?function(s){return i=r(s),Math.abs(i-s)<=n?i:s}:function(s){for(var o=parseFloat(i?s.x:s),c=parseFloat(i?s.y:0),h=ai,u=0,d=r.length,A,p;d--;)i?(A=r[d].x-o,p=r[d].y-c,A=A*A+p*p):A=Math.abs(r[d]-o),A<h&&(h=A,u=d);return u=!n||h<=n?r[u]:s,i||u===s||Bs(s)?u:u+$r(s)}:pm(r))},Rw=function(r,e,t,n){return ma(Zr(r)?!e:t===!0?!!(t=0):!n,function(){return Zr(r)?r[~~(Math.random()*r.length)]:(t=t||1e-5)&&(n=t<1?Math.pow(10,(t+"").length-2):1)&&Math.floor(Math.round((r-t/2+Math.random()*(e-r+t*.99))/t)*t*n)/n})},uP=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return function(n){return e.reduce(function(i,s){return s(i)},n)}},hP=function(r,e){return function(t){return r(parseFloat(t))+(e||$r(t))}},dP=function(r,e,t){return Lw(r,e,0,1,t)},Dw=function(r,e,t){return ma(t,function(n){return r[~~e(n)]})},fP=function r(e,t,n){var i=t-e;return Zr(e)?Dw(e,r(0,e.length),t):ma(n,function(s){return(i+(s-e)%i)%i+e})},pP=function r(e,t,n){var i=t-e,s=i*2;return Zr(e)?Dw(e,r(0,e.length-1),t):ma(n,function(o){return o=(s+(o-e)%s)%s||0,e+(o>i?s-o:o)})},Uu=function(r){for(var e=0,t="",n,i,s,o;~(n=r.indexOf("random(",e));)s=r.indexOf(")",n),o=r.charAt(n+7)==="[",i=r.substr(n+7,s-n-7).match(o?uw:em),t+=r.substr(e,n-e)+Rw(o?i:+i[0],o?0:+i[1],+i[2]||1e-5),e=s+1;return t+r.substr(e,r.length-e)},Lw=function(r,e,t,n,i){var s=e-r,o=n-t;return ma(i,function(c){return t+((c-r)/s*o||0)})},AP=function r(e,t,n,i){var s=isNaN(e+t)?0:function(g){return(1-g)*e+g*t};if(!s){var o=Fr(e),c={},h,u,d,A,p;if(n===!0&&(i=1)&&(n=null),o)e={p:e},t={p:t};else if(Zr(e)&&!Zr(t)){for(d=[],A=e.length,p=A-2,u=1;u<A;u++)d.push(r(e[u-1],e[u]));A--,s=function(g){g*=A;var v=Math.min(p,~~g);return d[v](g-v)},n=t}else i||(e=vo(Zr(e)?[]:{},e));if(!d){for(h in t)_m.call(c,e,h,"get",t[h]);s=function(g){return wm(g,c)||(o?e.p:e)}}}return ma(n,s)},Nw=function(r,e,t){var n=r.labels,i=ai,s,o,c;for(s in n)o=n[s]-e,o<0==!!t&&o&&i>(o=Math.abs(o))&&(c=s,i=o);return c},Yn=function(r,e,t){var n=r.vars,i=n[e],s=$t,o=r._ctx,c,h,u;if(i)return c=n[e+"Params"],h=n.callbackScope||r,t&&Aa.length&&lf(),o&&($t=o),u=c?i.apply(h,c):i.call(h),$t=s,u},Pu=function(r){return ga(r),r.scrollTrigger&&r.scrollTrigger.kill(!!Jr),r.progress()<1&&Yn(r,"onInterrupt"),r},Kl,Uw=[],Pw=function(r){if(r)if(r=!r.name&&r.default||r,$g()||r.headless){var e=r.name,t=lr(r),n=e&&!t&&r.init?function(){this._props=[]}:r,i={init:Ru,render:wm,add:_m,kill:RP,modifier:bP,rawVars:0},s={targetTest:0,get:0,getSetter:xm,aliases:{},register:0};if(Jl(),r!==n){if(Wn[e])return;oi(n,oi(cf(r,i),s)),vo(n.prototype,vo(i,cf(r,s))),Wn[n.prop=e]=n,r.targetTest&&(of.push(n),sm[e]=1),e=(e==="css"?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}fw(e,n),r.register&&r.register(Cn,n,In)}else Uw.push(r)},zt=255,ku={aqua:[0,zt,zt],lime:[0,zt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,zt],navy:[0,0,128],white:[zt,zt,zt],olive:[128,128,0],yellow:[zt,zt,0],orange:[zt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[zt,0,0],pink:[zt,192,203],cyan:[0,zt,zt],transparent:[zt,zt,zt,0]},Am=function(r,e,t){return r+=r<0?1:r>1?-1:0,(r*6<1?e+(t-e)*r*6:r<.5?t:r*3<2?e+(t-e)*(2/3-r)*6:e)*zt+.5|0},kw=function(r,e,t){var n=r?Bs(r)?[r>>16,r>>8&zt,r&zt]:0:ku.black,i,s,o,c,h,u,d,A,p,g;if(!n){if(r.substr(-1)===","&&(r=r.substr(0,r.length-1)),ku[r])n=ku[r];else if(r.charAt(0)==="#"){if(r.length<6&&(i=r.charAt(1),s=r.charAt(2),o=r.charAt(3),r="#"+i+i+s+s+o+o+(r.length===5?r.charAt(4)+r.charAt(4):"")),r.length===9)return n=parseInt(r.substr(1,6),16),[n>>16,n>>8&zt,n&zt,parseInt(r.substr(7),16)/255];r=parseInt(r.substr(1),16),n=[r>>16,r>>8&zt,r&zt]}else if(r.substr(0,3)==="hsl"){if(n=g=r.match(em),!e)c=+n[0]%360/360,h=+n[1]/100,u=+n[2]/100,s=u<=.5?u*(h+1):u+h-u*h,i=u*2-s,n.length>3&&(n[3]*=1),n[0]=Am(c+1/3,i,s),n[1]=Am(c,i,s),n[2]=Am(c-1/3,i,s);else if(~r.indexOf("="))return n=r.match(lw),t&&n.length<4&&(n[3]=1),n}else n=r.match(em)||ku.transparent;n=n.map(Number)}return e&&!g&&(i=n[0]/zt,s=n[1]/zt,o=n[2]/zt,d=Math.max(i,s,o),A=Math.min(i,s,o),u=(d+A)/2,d===A?c=h=0:(p=d-A,h=u>.5?p/(2-d-A):p/(d+A),c=d===i?(s-o)/p+(s<o?6:0):d===s?(o-i)/p+2:(i-s)/p+4,c*=60),n[0]=~~(c+.5),n[1]=~~(h*100+.5),n[2]=~~(u*100+.5)),t&&n.length<4&&(n[3]=1),n},Qw=function(r){var e=[],t=[],n=-1;return r.split(_a).forEach(function(i){var s=i.match(Wl)||[];e.push.apply(e,s),t.push(n+=s.length+1)}),e.c=t,e},Ow=function(r,e,t){var n="",i=(r+n).match(_a),s=e?"hsla(":"rgba(",o=0,c,h,u,d;if(!i)return r;if(i=i.map(function(A){return(A=kw(A,e,1))&&s+(e?A[0]+","+A[1]+"%,"+A[2]+"%,"+A[3]:A.join(","))+")"}),t&&(u=Qw(r),c=t.c,c.join(n)!==u.c.join(n)))for(h=r.replace(_a,"1").split(Wl),d=h.length-1;o<d;o++)n+=h[o]+(~c.indexOf(o)?i.shift()||s+"0,0,0,0)":(u.length?u:i.length?i:t).shift());if(!h)for(h=r.split(_a),d=h.length-1;o<d;o++)n+=h[o]+i[o];return n+h[d]},_a=function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in ku)r+="|"+e+"\\b";return new RegExp(r+")","gi")}(),gP=/hsl[a]?\(/,Fw=function(r){var e=r.join(" "),t;if(_a.lastIndex=0,_a.test(e))return t=gP.test(e),r[1]=Ow(r[1],t),r[0]=Ow(r[0],t,Qw(r[1])),!0},Qu,qn=function(){var r=Date.now,e=500,t=33,n=r(),i=n,s=1e3/240,o=s,c=[],h,u,d,A,p,g,v=function E(m){var _=r()-i,w=m===!0,x,I,R,S;if((_>e||_<0)&&(n+=_-t),i+=_,R=i-n,x=R-o,(x>0||w)&&(S=++A.frame,p=R-A.time*1e3,A.time=R=R/1e3,o+=x+(x>=s?4:s-x),I=1),w||(h=u(E)),I)for(g=0;g<c.length;g++)c[g](R,p,S,m)};return A={time:0,frame:0,tick:function(){v(!0)},deltaRatio:function(E){return p/(1e3/(E||60))},wake:function(){hw&&(!rm&&$g()&&($i=rm=window,nm=$i.document||{},jn.gsap=Cn,($i.gsapVersions||($i.gsapVersions=[])).push(Cn.version),dw(sf||$i.GreenSockGlobals||!$i.gsap&&$i||{}),Uw.forEach(Pw)),d=typeof requestAnimationFrame<"u"&&requestAnimationFrame,h&&A.sleep(),u=d||function(E){return setTimeout(E,o-A.time*1e3+1|0)},Qu=1,v(2))},sleep:function(){(d?cancelAnimationFrame:clearTimeout)(h),Qu=0,u=Ru},lagSmoothing:function(E,m){e=E||1/0,t=Math.min(m||33,e)},fps:function(E){s=1e3/(E||240),o=A.time*1e3+s},add:function(E,m,_){var w=m?function(x,I,R,S){E(x,I,R,S),A.remove(w)}:E;return A.remove(E),c[_?"unshift":"push"](w),Jl(),w},remove:function(E,m){~(m=c.indexOf(E))&&c.splice(m,1)&&g>=m&&g--},_listeners:c},A}(),Jl=function(){return!Qu&&qn.wake()},Ct={},mP=/^[\d.\-M][\d.\-,\s]/,_P=/["']/g,vP=function(r){for(var e={},t=r.substr(1,r.length-3).split(":"),n=t[0],i=1,s=t.length,o,c,h;i<s;i++)c=t[i],o=i!==s-1?c.lastIndexOf(","):c.length,h=c.substr(0,o),e[n]=isNaN(h)?h.replace(_P,"").trim():+h,n=c.substr(o+1).trim();return e},yP=function(r){var e=r.indexOf("(")+1,t=r.indexOf(")"),n=r.indexOf("(",e);return r.substring(e,~n&&n<t?r.indexOf(")",t+1):t)},EP=function(r){var e=(r+"").split("("),t=Ct[e[0]];return t&&e.length>1&&t.config?t.config.apply(null,~r.indexOf("{")?[vP(e[1])]:yP(r).split(",").map(_w)):Ct._CE&&mP.test(r)?Ct._CE("",r):t},zw=function(r){return function(e){return 1-r(1-e)}},Hw=function r(e,t){for(var n=e._first,i;n;)n instanceof fn?r(n,t):n.vars.yoyoEase&&(!n._yoyo||!n._repeat)&&n._yoyo!==t&&(n.timeline?r(n.timeline,t):(i=n._ease,n._ease=n._yEase,n._yEase=i,n._yoyo=t)),n=n._next},Eo=function(r,e){return r&&(lr(r)?r:Ct[r]||EP(r))||e},xo=function(r,e,t,n){t===void 0&&(t=function(o){return 1-e(1-o)}),n===void 0&&(n=function(o){return o<.5?e(o*2)/2:1-e((1-o)*2)/2});var i={easeIn:e,easeOut:t,easeInOut:n},s;return wn(r,function(o){Ct[o]=jn[o]=i,Ct[s=o.toLowerCase()]=t;for(var c in i)Ct[s+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=Ct[o+"."+c]=i[c]}),i},Gw=function(r){return function(e){return e<.5?(1-r(1-e*2))/2:.5+r((e-.5)*2)/2}},gm=function r(e,t,n){var i=t>=1?t:1,s=(n||(e?.3:.45))/(t<1?t:1),o=s/Jg*(Math.asin(1/i)||0),c=function(u){return u===1?1:i*Math.pow(2,-10*u)*XU((u-o)*s)+1},h=e==="out"?c:e==="in"?function(u){return 1-c(1-u)}:Gw(c);return s=Jg/s,h.config=function(u,d){return r(e,u,d)},h},mm=function r(e,t){t===void 0&&(t=1.70158);var n=function(s){return s?--s*s*((t+1)*s+t)+1:0},i=e==="out"?n:e==="in"?function(s){return 1-n(1-s)}:Gw(n);return i.config=function(s){return r(e,s)},i};wn("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,e){var t=e<5?e+1:e;xo(r+",Power"+(t-1),e?function(n){return Math.pow(n,t)}:function(n){return n},function(n){return 1-Math.pow(1-n,t)},function(n){return n<.5?Math.pow(n*2,t)/2:1-Math.pow((1-n)*2,t)/2})}),Ct.Linear.easeNone=Ct.none=Ct.Linear.easeIn,xo("Elastic",gm("in"),gm("out"),gm()),function(r,e){var t=1/e,n=2*t,i=2.5*t,s=function(o){return o<t?r*o*o:o<n?r*Math.pow(o-1.5/e,2)+.75:o<i?r*(o-=2.25/e)*o+.9375:r*Math.pow(o-2.625/e,2)+.984375};xo("Bounce",function(o){return 1-s(1-o)},s)}(7.5625,2.75),xo("Expo",function(r){return r?Math.pow(2,10*(r-1)):0}),xo("Circ",function(r){return-(aw(1-r*r)-1)}),xo("Sine",function(r){return r===1?1:-qU(r*WU)+1}),xo("Back",mm("in"),mm("out"),mm()),Ct.SteppedEase=Ct.steps=jn.SteppedEase={config:function(r,e){r===void 0&&(r=1);var t=1/r,n=r+(e?0:1),i=e?1:0,s=1-Gt;return function(o){return((n*Nu(0,s,o)|0)+i)*t}}},jl.ease=Ct["quad.out"],wn("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return lm+=r+","+r+"Params,"});var Vw=function(r,e){this.id=YU++,r._gsap=this,this.target=r,this.harness=e,this.get=e?e.get:gw,this.set=e?e.getSetter:xm},Ou=function(){function r(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,Xl(this,+t.duration,1,1),this.data=t.data,$t&&(this._ctx=$t,$t.data.push(this)),Qu||qn.wake()}var e=r.prototype;return e.delay=function(t){return t||t===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+t-this._delay),this._delay=t,this):this._delay},e.duration=function(t){return arguments.length?this.totalDuration(this._repeat>0?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur},e.totalDuration=function(t){return arguments.length?(this._dirty=0,Xl(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(t,n){if(Jl(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(ff(this,t),!i._dp||i.parent||ww(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&&t<this._tDur||this._ts<0&&t>0||!this._tDur&&!t)&&es(this._dp,this,this._start-this._delay)}return(this._tTime!==t||!this._dur&&!n||this._initted&&Math.abs(this._zTime)===Gt||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),mw(this,t,n)),this},e.time=function(t,n){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+xw(this))%(this._dur+this._rDelay)||(t?this._dur:0),n):this._time},e.totalProgress=function(t,n){return arguments.length?this.totalTime(this.totalDuration()*t,n):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},e.progress=function(t,n){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-t:t)+xw(this),n):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(t,n){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*i,n):this._repeat?ql(this._tTime,i)+1:1},e.timeScale=function(t,n){if(!arguments.length)return this._rts===-Gt?0:this._rts;if(this._rts===t)return this;var i=this.parent&&this._ts?hf(this.parent._time,this):this._tTime;return this._rts=+t||0,this._ts=this._ps||t===-Gt?0:this._rts,this.totalTime(Nu(-Math.abs(this._delay),this._tDur,i),n!==!1),df(this),rP(this)},e.paused=function(t){return arguments.length?(this._ps!==t&&(this._ps=t,t?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Jl(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Gt&&(this._tTime-=Gt)))),this):this._ps},e.startTime=function(t){if(arguments.length){this._start=t;var n=this.parent||this._dp;return n&&(n._sort||!this.parent)&&es(n,this,t-this._delay),this}return this._start},e.endTime=function(t){return this._start+(xn(t)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(t){var n=this.parent||this._dp;return n?t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?hf(n.rawTime(t),this):this._tTime:this._tTime},e.revert=function(t){t===void 0&&(t=ZU);var n=Jr;return Jr=t,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(t),this.totalTime(-.01,t.suppressEvents)),this.data!=="nested"&&t.kill!==!1&&this.kill(),Jr=n,this},e.globalTime=function(t){for(var n=this,i=arguments.length?t:n.rawTime();n;)i=n._start+i/(Math.abs(n._ts)||1),n=n._dp;return!this.parent&&this._sat?this._sat.globalTime(t):i},e.repeat=function(t){return arguments.length?(this._repeat=t===1/0?-2:t,Mw(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(t){if(arguments.length){var n=this._time;return this._rDelay=t,Mw(this),n?this.time(n):this}return this._rDelay},e.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},e.seek=function(t,n){return this.totalTime(li(this,t),xn(n))},e.restart=function(t,n){return this.play().totalTime(t?-this._delay:0,xn(n))},e.play=function(t,n){return t!=null&&this.seek(t,n),this.reversed(!1).paused(!1)},e.reverse=function(t,n){return t!=null&&this.seek(t||this.totalDuration(),n),this.reversed(!0).paused(!1)},e.pause=function(t,n){return t!=null&&this.seek(t,n),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(t){return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-Gt:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-Gt,this},e.isActive=function(){var t=this.parent||this._dp,n=this._start,i;return!!(!t||this._ts&&this._initted&&t.isActive()&&(i=t.rawTime(!0))>=n&&i<this.endTime(!0)-Gt)},e.eventCallback=function(t,n,i){var s=this.vars;return arguments.length>1?(n?(s[t]=n,i&&(s[t+"Params"]=i),t==="onUpdate"&&(this._onUpdate=n)):delete s[t],this):s[t]},e.then=function(t){var n=this;return new Promise(function(i){var s=lr(t)?t:vw,o=function(){var c=n.then;n.then=null,lr(s)&&(s=s(n))&&(s.then||s===n)&&(n.then=c),i(s),n.then=c};n._initted&&n.totalProgress()===1&&n._ts>=0||!n._tTime&&n._ts<0?o():n._prom=o})},e.kill=function(){Pu(this)},r}();oi(Ou.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:-Gt,_prom:0,_ps:!1,_rts:1});var fn=function(r){sw(e,r);function e(n,i){var s;return n===void 0&&(n={}),s=r.call(this,n)||this,s.labels={},s.smoothChildTiming=!!n.smoothChildTiming,s.autoRemoveChildren=!!n.autoRemoveChildren,s._sort=xn(n.sortChildren),nr&&es(n.parent||nr,Ts(s),i),n.reversed&&s.reverse(),n.paused&&s.paused(!0),n.scrollTrigger&&Iw(Ts(s),n.scrollTrigger),s}var t=e.prototype;return t.to=function(n,i,s){return Lu(0,arguments,this),this},t.from=function(n,i,s){return Lu(1,arguments,this),this},t.fromTo=function(n,i,s,o){return Lu(2,arguments,this),this},t.set=function(n,i,s){return i.duration=0,i.parent=this,Du(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new wr(n,i,li(this,s),1),this},t.call=function(n,i,s){return es(this,wr.delayedCall(0,n,i),s)},t.staggerTo=function(n,i,s,o,c,h,u){return s.duration=i,s.stagger=s.stagger||o,s.onComplete=h,s.onCompleteParams=u,s.parent=this,new wr(n,s,li(this,c)),this},t.staggerFrom=function(n,i,s,o,c,h,u){return s.runBackwards=1,Du(s).immediateRender=xn(s.immediateRender),this.staggerTo(n,i,s,o,c,h,u)},t.staggerFromTo=function(n,i,s,o,c,h,u,d){return o.startAt=s,Du(o).immediateRender=xn(o.immediateRender),this.staggerTo(n,i,o,c,h,u,d)},t.render=function(n,i,s){var o=this._time,c=this._dirty?this.totalDuration():this._tDur,h=this._dur,u=n<=0?0:zr(n),d=this._zTime<0!=n<0&&(this._initted||!h),A,p,g,v,E,m,_,w,x,I,R,S;if(this!==nr&&u>c&&n>=0&&(u=c),u!==this._tTime||s||d){if(o!==this._time&&h&&(u+=this._time-o,n+=this._time-o),A=u,x=this._start,w=this._ts,m=!w,d&&(h||(o=this._zTime),(n||!i)&&(this._zTime=n)),this._repeat){if(R=this._yoyo,E=h+this._rDelay,this._repeat<-1&&n<0)return this.totalTime(E*100+n,i,s);if(A=zr(u%E),u===c?(v=this._repeat,A=h):(v=~~(u/E),v&&v===u/E&&(A=h,v--),A>h&&(A=h)),I=ql(this._tTime,E),!o&&this._tTime&&I!==v&&this._tTime-I*E-this._dur<=0&&(I=v),R&&v&1&&(A=h-A,S=1),v!==I&&!this._lock){var T=R&&I&1,D=T===(R&&v&1);if(v<I&&(T=!T),o=T?0:u%h?h:u,this._lock=1,this.render(o||(S?0:zr(v*E)),i,!h)._lock=0,this._tTime=u,!i&&this.parent&&Yn(this,"onRepeat"),this.vars.repeatRefresh&&!S&&(this.invalidate()._lock=1),o&&o!==this._time||m!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(h=this._dur,c=this._tDur,D&&(this._lock=2,o=T?h:-1e-4,this.render(o,!0),this.vars.repeatRefresh&&!S&&this.invalidate()),this._lock=0,!this._ts&&!m)return this;Hw(this,S)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(_=aP(this,zr(o),zr(A)),_&&(u-=A-(A=_._start))),this._tTime=u,this._time=A,this._act=!w,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=n,o=0),!o&&A&&!i&&!v&&(Yn(this,"onStart"),this._tTime!==u))return this;if(A>=o&&n>=0)for(p=this._first;p;){if(g=p._next,(p._act||A>=p._start)&&p._ts&&_!==p){if(p.parent!==this)return this.render(n,i,s);if(p.render(p._ts>0?(A-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(A-p._start)*p._ts,i,s),A!==this._time||!this._ts&&!m){_=0,g&&(u+=this._zTime=-Gt);break}}p=g}else{p=this._last;for(var b=n<0?n:A;p;){if(g=p._prev,(p._act||b<=p._end)&&p._ts&&_!==p){if(p.parent!==this)return this.render(n,i,s);if(p.render(p._ts>0?(b-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(b-p._start)*p._ts,i,s||Jr&&(p._initted||p._startAt)),A!==this._time||!this._ts&&!m){_=0,g&&(u+=this._zTime=b?-Gt:Gt);break}}p=g}}if(_&&!i&&(this.pause(),_.render(A>=o?0:-Gt)._zTime=A>=o?1:-1,this._ts))return this._start=x,df(this),this.render(n,i,s);this._onUpdate&&!i&&Yn(this,"onUpdate",!0),(u===c&&this._tTime>=this.totalDuration()||!u&&o)&&(x===this._start||Math.abs(w)!==Math.abs(this._ts))&&(this._lock||((n||!h)&&(u===c&&this._ts>0||!u&&this._ts<0)&&ga(this,1),!i&&!(n<0&&!o)&&(u||o||!c)&&(Yn(this,u===c&&n>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(u<c&&this.timeScale()>0)&&this._prom())))}return this},t.add=function(n,i){var s=this;if(Bs(i)||(i=li(this,i,n)),!(n instanceof Ou)){if(Zr(n))return n.forEach(function(o){return s.add(o,i)}),this;if(Fr(n))return this.addLabel(n,i);if(lr(n))n=wr.delayedCall(0,n);else return this}return this!==n?es(this,n,i):this},t.getChildren=function(n,i,s,o){n===void 0&&(n=!0),i===void 0&&(i=!0),s===void 0&&(s=!0),o===void 0&&(o=-ai);for(var c=[],h=this._first;h;)h._start>=o&&(h instanceof wr?i&&c.push(h):(s&&c.push(h),n&&c.push.apply(c,h.getChildren(!0,i,s)))),h=h._next;return c},t.getById=function(n){for(var i=this.getChildren(1,1,1),s=i.length;s--;)if(i[s].vars.id===n)return i[s]},t.remove=function(n){return Fr(n)?this.removeLabel(n):lr(n)?this.killTweensOf(n):(uf(this,n),n===this._recent&&(this._recent=this._last),yo(this))},t.totalTime=function(n,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=zr(qn.time-(this._ts>0?n/this._ts:(this.totalDuration()-n)/-this._ts))),r.prototype.totalTime.call(this,n,i),this._forcing=0,this):this._tTime},t.addLabel=function(n,i){return this.labels[n]=li(this,i),this},t.removeLabel=function(n){return delete this.labels[n],this},t.addPause=function(n,i,s){var o=wr.delayedCall(0,i||Ru,s);return o.data="isPause",this._hasPause=1,es(this,o,li(this,n))},t.removePause=function(n){var i=this._first;for(n=li(this,n);i;)i._start===n&&i.data==="isPause"&&ga(i),i=i._next},t.killTweensOf=function(n,i,s){for(var o=this.getTweensOf(n,s),c=o.length;c--;)va!==o[c]&&o[c].kill(n,i);return this},t.getTweensOf=function(n,i){for(var s=[],o=ci(n),c=this._first,h=Bs(i),u;c;)c instanceof wr?$U(c._targets,o)&&(h?(!va||c._initted&&c._ts)&&c.globalTime(0)<=i&&c.globalTime(c.totalDuration())>i:!i||c.isActive())&&s.push(c):(u=c.getTweensOf(o,i)).length&&s.push.apply(s,u),c=c._next;return s},t.tweenTo=function(n,i){i=i||{};var s=this,o=li(s,n),c=i,h=c.startAt,u=c.onStart,d=c.onStartParams,A=c.immediateRender,p,g=wr.to(s,oi({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:i.duration||Math.abs((o-(h&&"time"in h?h.time:s._time))/s.timeScale())||Gt,onStart:function(){if(s.pause(),!p){var v=i.duration||Math.abs((o-(h&&"time"in h?h.time:s._time))/s.timeScale());g._dur!==v&&Xl(g,v,0,1).render(g._time,!0,!0),p=1}u&&u.apply(g,d||[])}},i));return A?g.render(0):g},t.tweenFromTo=function(n,i,s){return this.tweenTo(i,oi({startAt:{time:li(this,n)}},s))},t.recent=function(){return this._recent},t.nextLabel=function(n){return n===void 0&&(n=this._time),Nw(this,li(this,n))},t.previousLabel=function(n){return n===void 0&&(n=this._time),Nw(this,li(this,n),1)},t.currentLabel=function(n){return arguments.length?this.seek(n,!0):this.previousLabel(this._time+Gt)},t.shiftChildren=function(n,i,s){s===void 0&&(s=0);for(var o=this._first,c=this.labels,h;o;)o._start>=s&&(o._start+=n,o._end+=n),o=o._next;if(i)for(h in c)c[h]>=s&&(c[h]+=n);return yo(this)},t.invalidate=function(n){var i=this._first;for(this._lock=0;i;)i.invalidate(n),i=i._next;return r.prototype.invalidate.call(this,n)},t.clear=function(n){n===void 0&&(n=!0);for(var i=this._first,s;i;)s=i._next,this.remove(i),i=s;return this._dp&&(this._time=this._tTime=this._pTime=0),n&&(this.labels={}),yo(this)},t.totalDuration=function(n){var i=0,s=this,o=s._last,c=ai,h,u,d;if(arguments.length)return s.timeScale((s._repeat<0?s.duration():s.totalDuration())/(s.reversed()?-n:n));if(s._dirty){for(d=s.parent;o;)h=o._prev,o._dirty&&o.totalDuration(),u=o._start,u>c&&s._sort&&o._ts&&!s._lock?(s._lock=1,es(s,o,u-o._delay,1)._lock=0):c=u,u<0&&o._ts&&(i-=u,(!d&&!s._dp||d&&d.smoothChildTiming)&&(s._start+=u/s._ts,s._time-=u,s._tTime-=u),s.shiftChildren(-u,!1,-1/0),c=0),o._end>i&&o._ts&&(i=o._end),o=h;Xl(s,s===nr&&s._time>i?s._time:i,1,1),s._dirty=0}return s._tDur},e.updateRoot=function(n){if(nr._ts&&(mw(nr,hf(n,nr)),pw=qn.frame),qn.frame>=Aw){Aw+=Vn.autoSleep||120;var i=nr._first;if((!i||!i._ts)&&Vn.autoSleep&&qn._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||qn.sleep()}}},e}(Ou);oi(fn.prototype,{_lock:0,_hasPause:0,_forcing:0});var xP=function(r,e,t,n,i,s,o){var c=new In(this._pt,r,e,0,1,Kw,null,i),h=0,u=0,d,A,p,g,v,E,m,_;for(c.b=t,c.e=n,t+="",n+="",(m=~n.indexOf("random("))&&(n=Uu(n)),s&&(_=[t,n],s(_,r,e),t=_[0],n=_[1]),A=t.match(tm)||[];d=tm.exec(n);)g=d[0],v=n.substring(h,d.index),p?p=(p+1)%5:v.substr(-5)==="rgba("&&(p=1),g!==A[u++]&&(E=parseFloat(A[u-1])||0,c._pt={_next:c._pt,p:v||u===1?v:",",s:E,c:g.charAt(1)==="="?Yl(E,g)-E:parseFloat(g)-E,m:p&&p<4?Math.round:0},h=tm.lastIndex);return c.c=h<n.length?n.substring(h,n.length):"",c.fp=o,(cw.test(n)||m)&&(c.e=0),this._pt=c,c},_m=function(r,e,t,n,i,s,o,c,h,u){lr(n)&&(n=n(i||0,r,s));var d=r[e],A=t!=="get"?t:lr(d)?h?r[e.indexOf("set")||!lr(r["get"+e.substr(3)])?e:"get"+e.substr(3)](h):r[e]():d,p=lr(d)?h?SP:qw:Em,g;if(Fr(n)&&(~n.indexOf("random(")&&(n=Uu(n)),n.charAt(1)==="="&&(g=Yl(A,n)+($r(A)||0),(g||g===0)&&(n=g))),!u||A!==n||vm)return!isNaN(A*n)&&n!==""?(g=new In(this._pt,r,e,+A||0,n-(A||0),typeof d=="boolean"?BP:Xw,0,p),h&&(g.fp=h),o&&g.modifier(o,this,r),this._pt=g):(!d&&!(e in r)&&im(e,n),xP.call(this,r,e,A,n,p,c||Vn.stringFilter,h))},wP=function(r,e,t,n,i){if(lr(r)&&(r=Fu(r,i,e,t,n)),!Zi(r)||r.style&&r.nodeType||Zr(r)||ow(r))return Fr(r)?Fu(r,i,e,t,n):r;var s={},o;for(o in r)s[o]=Fu(r[o],i,e,t,n);return s},jw=function(r,e,t,n,i,s){var o,c,h,u;if(Wn[r]&&(o=new Wn[r]).init(i,o.rawVars?e[r]:wP(e[r],n,i,s,t),t,n,s)!==!1&&(t._pt=c=new In(t._pt,i,r,0,1,o.render,o,0,o.priority),t!==Kl))for(h=t._ptLookup[t._targets.indexOf(i)],u=o._props.length;u--;)h[o._props[u]]=c;return o},va,vm,ym=function r(e,t,n){var i=e.vars,s=i.ease,o=i.startAt,c=i.immediateRender,h=i.lazy,u=i.onUpdate,d=i.runBackwards,A=i.yoyoEase,p=i.keyframes,g=i.autoRevert,v=e._dur,E=e._startAt,m=e._targets,_=e.parent,w=_&&_.data==="nested"?_.vars.targets:m,x=e._overwrite==="auto"&&!Kg,I=e.timeline,R,S,T,D,b,M,L,P,N,j,X,K,ne;if(I&&(!p||!s)&&(s="none"),e._ease=Eo(s,jl.ease),e._yEase=A?zw(Eo(A===!0?s:A,jl.ease)):0,A&&e._yoyo&&!e._repeat&&(A=e._yEase,e._yEase=e._ease,e._ease=A),e._from=!I&&!!i.runBackwards,!I||p&&!i.stagger){if(P=m[0]?_o(m[0]).harness:0,K=P&&i[P.prop],R=cf(i,sm),E&&(E._zTime<0&&E.progress(1),t<0&&d&&c&&!g?E.render(-1,!0):E.revert(d&&v?af:JU),E._lazy=0),o){if(ga(e._startAt=wr.set(m,oi({data:"isStart",overwrite:!1,parent:_,immediateRender:!0,lazy:!E&&xn(h),startAt:null,delay:0,onUpdate:u&&function(){return Yn(e,"onUpdate")},stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,t<0&&(Jr||!c&&!g)&&e._startAt.revert(af),c&&v&&t<=0&&n<=0){t&&(e._zTime=t);return}}else if(d&&v&&!E){if(t&&(c=!1),T=oi({overwrite:!1,data:"isFromStart",lazy:c&&!E&&xn(h),immediateRender:c,stagger:0,parent:_},R),K&&(T[P.prop]=K),ga(e._startAt=wr.set(m,T)),e._startAt._dp=0,e._startAt._sat=e,t<0&&(Jr?e._startAt.revert(af):e._startAt.render(-1,!0)),e._zTime=t,!c)r(e._startAt,Gt,Gt);else if(!t)return}for(e._pt=e._ptCache=0,h=v&&xn(h)||h&&!v,S=0;S<m.length;S++){if(b=m[S],L=b._gsap||cm(m)[S]._gsap,e._ptLookup[S]=j={},am[L.id]&&Aa.length&&lf(),X=w===m?S:w.indexOf(b),P&&(N=new P).init(b,K||R,e,X,w)!==!1&&(e._pt=D=new In(e._pt,b,N.name,0,1,N.render,N,0,N.priority),N._props.forEach(function(V){j[V]=D}),N.priority&&(M=1)),!P||K)for(T in R)Wn[T]&&(N=jw(T,R,e,X,b,w))?N.priority&&(M=1):j[T]=D=_m.call(e,b,T,"get",R[T],X,w,0,i.stringFilter);e._op&&e._op[S]&&e.kill(b,e._op[S]),x&&e._pt&&(va=e,nr.killTweensOf(b,j,e.globalTime(t)),ne=!e.parent,va=0),e._pt&&h&&(am[L.id]=1)}M&&Jw(e),e._onInit&&e._onInit(e)}e._onUpdate=u,e._initted=(!e._op||e._pt)&&!ne,p&&t<=0&&I.render(ai,!0,!0)},IP=function(r,e,t,n,i,s,o,c){var h=(r._pt&&r._ptCache||(r._ptCache={}))[e],u,d,A,p;if(!h)for(h=r._ptCache[e]=[],A=r._ptLookup,p=r._targets.length;p--;){if(u=A[p][e],u&&u.d&&u.d._pt)for(u=u.d._pt;u&&u.p!==e&&u.fp!==e;)u=u._next;if(!u)return vm=1,r.vars[e]="+=0",ym(r,o),vm=0,c?bu(e+" not eligible for reset"):1;h.push(u)}for(p=h.length;p--;)d=h[p],u=d._pt||d,u.s=(n||n===0)&&!i?n:u.s+(n||0)+s*u.c,u.c=t-u.s,d.e&&(d.e=gr(t)+$r(d.e)),d.b&&(d.b=u.s+$r(d.b))},CP=function(r,e){var t=r[0]?_o(r[0]).harness:0,n=t&&t.aliases,i,s,o,c;if(!n)return e;i=vo({},e);for(s in n)if(s in i)for(c=n[s].split(","),o=c.length;o--;)i[c[o]]=i[s];return i},MP=function(r,e,t,n){var i=e.ease||n||"power1.inOut",s,o;if(Zr(e))o=t[r]||(t[r]=[]),e.forEach(function(c,h){return o.push({t:h/(e.length-1)*100,v:c,e:i})});else for(s in e)o=t[s]||(t[s]=[]),s==="ease"||o.push({t:parseFloat(r),v:e[s],e:i})},Fu=function(r,e,t,n,i){return lr(r)?r.call(e,t,n,i):Fr(r)&&~r.indexOf("random(")?Uu(r):r},Ww=lm+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",Yw={};wn(Ww+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return Yw[r]=1});var wr=function(r){sw(e,r);function e(n,i,s,o){var c;typeof i=="number"&&(s.duration=i,i=s,s=null),c=r.call(this,o?i:Du(i))||this;var h=c.vars,u=h.duration,d=h.delay,A=h.immediateRender,p=h.stagger,g=h.overwrite,v=h.keyframes,E=h.defaults,m=h.scrollTrigger,_=h.yoyoEase,w=i.parent||nr,x=(Zr(n)||ow(n)?Bs(n[0]):"length"in i)?[n]:ci(n),I,R,S,T,D,b,M,L;if(c._targets=x.length?cm(x):bu("GSAP target "+n+" not found. https://gsap.com",!Vn.nullTargetWarn)||[],c._ptLookup=[],c._overwrite=g,v||p||nf(u)||nf(d)){if(i=c.vars,I=c.timeline=new fn({data:"nested",defaults:E||{},targets:w&&w.data==="nested"?w.vars.targets:x}),I.kill(),I.parent=I._dp=Ts(c),I._start=0,p||nf(u)||nf(d)){if(T=x.length,M=p&&Bw(p),Zi(p))for(D in p)~Ww.indexOf(D)&&(L||(L={}),L[D]=p[D]);for(R=0;R<T;R++)S=cf(i,Yw),S.stagger=0,_&&(S.yoyoEase=_),L&&vo(S,L),b=x[R],S.duration=+Fu(u,Ts(c),R,b,x),S.delay=(+Fu(d,Ts(c),R,b,x)||0)-c._delay,!p&&T===1&&S.delay&&(c._delay=d=S.delay,c._start+=d,S.delay=0),I.to(b,S,M?M(R,b,x):0),I._ease=Ct.none;I.duration()?u=d=0:c.timeline=0}else if(v){Du(oi(I.vars.defaults,{ease:"none"})),I._ease=Eo(v.ease||i.ease||"none");var P=0,N,j,X;if(Zr(v))v.forEach(function(K){return I.to(x,K,">")}),I.duration();else{S={};for(D in v)D==="ease"||D==="easeEach"||MP(D,v[D],S,v.easeEach);for(D in S)for(N=S[D].sort(function(K,ne){return K.t-ne.t}),P=0,R=0;R<N.length;R++)j=N[R],X={ease:j.e,duration:(j.t-(R?N[R-1].t:0))/100*u},X[D]=j.v,I.to(x,X,P),P+=X.duration;I.duration()<u&&I.to({},{duration:u-I.duration()})}}u||c.duration(u=I.duration())}else c.timeline=0;return g===!0&&!Kg&&(va=Ts(c),nr.killTweensOf(x),va=0),es(w,Ts(c),s),i.reversed&&c.reverse(),i.paused&&c.paused(!0),(A||!u&&!v&&c._start===zr(w._time)&&xn(A)&&nP(Ts(c))&&w.data!=="nested")&&(c._tTime=-Gt,c.render(Math.max(0,-d)||0)),m&&Iw(Ts(c),m),c}var t=e.prototype;return t.render=function(n,i,s){var o=this._time,c=this._tDur,h=this._dur,u=n<0,d=n>c-Gt&&!u?c:n<Gt?0:n,A,p,g,v,E,m,_,w,x;if(!h)sP(this,n,i,s);else if(d!==this._tTime||!n||s||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==u){if(A=d,w=this.timeline,this._repeat){if(v=h+this._rDelay,this._repeat<-1&&u)return this.totalTime(v*100+n,i,s);if(A=zr(d%v),d===c?(g=this._repeat,A=h):(g=~~(d/v),g&&g===zr(d/v)&&(A=h,g--),A>h&&(A=h)),m=this._yoyo&&g&1,m&&(x=this._yEase,A=h-A),E=ql(this._tTime,v),A===o&&!s&&this._initted&&g===E)return this._tTime=d,this;g!==E&&(w&&this._yEase&&Hw(w,m),this.vars.repeatRefresh&&!m&&!this._lock&&this._time!==v&&this._initted&&(this._lock=s=1,this.render(zr(v*g),!0).invalidate()._lock=0))}if(!this._initted){if(Cw(this,u?n:A,s,i,d))return this._tTime=0,this;if(o!==this._time&&!(s&&this.vars.repeatRefresh&&g!==E))return this;if(h!==this._dur)return this.render(n,i,s)}if(this._tTime=d,this._time=A,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=_=(x||this._ease)(A/h),this._from&&(this.ratio=_=1-_),A&&!o&&!i&&!g&&(Yn(this,"onStart"),this._tTime!==d))return this;for(p=this._pt;p;)p.r(_,p.d),p=p._next;w&&w.render(n<0?n:w._dur*w._ease(A/this._dur),i,s)||this._startAt&&(this._zTime=n),this._onUpdate&&!i&&(u&&um(this,n,i,s),Yn(this,"onUpdate")),this._repeat&&g!==E&&this.vars.onRepeat&&!i&&this.parent&&Yn(this,"onRepeat"),(d===this._tDur||!d)&&this._tTime===d&&(u&&!this._onUpdate&&um(this,n,!0,!0),(n||!h)&&(d===this._tDur&&this._ts>0||!d&&this._ts<0)&&ga(this,1),!i&&!(u&&!o)&&(d||o||m)&&(Yn(this,d===c?"onComplete":"onReverseComplete",!0),this._prom&&!(d<c&&this.timeScale()>0)&&this._prom()))}return this},t.targets=function(){return this._targets},t.invalidate=function(n){return(!n||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(n),r.prototype.invalidate.call(this,n)},t.resetTo=function(n,i,s,o,c){Qu||qn.wake(),this._ts||this.play();var h=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||ym(this,h),u=this._ease(h/this._dur),IP(this,n,i,s,o,u,h,c)?this.resetTo(n,i,s,o,1):(ff(this,0),this.parent||Ew(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(n,i){if(i===void 0&&(i="all"),!n&&(!i||i==="all"))return this._lazy=this._pt=0,this.parent?Pu(this):this;if(this.timeline){var s=this.timeline.totalDuration();return this.timeline.killTweensOf(n,i,va&&va.vars.overwrite!==!0)._first||Pu(this),this.parent&&s!==this.timeline.totalDuration()&&Xl(this,this._dur*this.timeline._tDur/s,0,1),this}var o=this._targets,c=n?ci(n):o,h=this._ptLookup,u=this._pt,d,A,p,g,v,E,m;if((!i||i==="all")&&tP(o,c))return i==="all"&&(this._pt=0),Pu(this);for(d=this._op=this._op||[],i!=="all"&&(Fr(i)&&(v={},wn(i,function(_){return v[_]=1}),i=v),i=CP(o,i)),m=o.length;m--;)if(~c.indexOf(o[m])){A=h[m],i==="all"?(d[m]=i,g=A,p={}):(p=d[m]=d[m]||{},g=i);for(v in g)E=A&&A[v],E&&((!("kill"in E.d)||E.d.kill(v)===!0)&&uf(this,E,"_pt"),delete A[v]),p!=="all"&&(p[v]=1)}return this._initted&&!this._pt&&u&&Pu(this),this},e.to=function(n,i){return new e(n,i,arguments[2])},e.from=function(n,i){return Lu(1,arguments)},e.delayedCall=function(n,i,s,o){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:n,onComplete:i,onReverseComplete:i,onCompleteParams:s,onReverseCompleteParams:s,callbackScope:o})},e.fromTo=function(n,i,s){return Lu(2,arguments)},e.set=function(n,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new e(n,i)},e.killTweensOf=function(n,i,s){return nr.killTweensOf(n,i,s)},e}(Ou);oi(wr.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),wn("staggerTo,staggerFrom,staggerFromTo",function(r){wr[r]=function(){var e=new fn,t=dm.call(arguments,0);return t.splice(r==="staggerFromTo"?5:4,0,0),e[r].apply(e,t)}});var Em=function(r,e,t){return r[e]=t},qw=function(r,e,t){return r[e](t)},SP=function(r,e,t,n){return r[e](n.fp,t)},TP=function(r,e,t){return r.setAttribute(e,t)},xm=function(r,e){return lr(r[e])?qw:Zg(r[e])&&r.setAttribute?TP:Em},Xw=function(r,e){return e.set(e.t,e.p,Math.round((e.s+e.c*r)*1e6)/1e6,e)},BP=function(r,e){return e.set(e.t,e.p,!!(e.s+e.c*r),e)},Kw=function(r,e){var t=e._pt,n="";if(!r&&e.b)n=e.b;else if(r===1&&e.e)n=e.e;else{for(;t;)n=t.p+(t.m?t.m(t.s+t.c*r):Math.round((t.s+t.c*r)*1e4)/1e4)+n,t=t._next;n+=e.c}e.set(e.t,e.p,n,e)},wm=function(r,e){for(var t=e._pt;t;)t.r(r,t.d),t=t._next},bP=function(r,e,t,n){for(var i=this._pt,s;i;)s=i._next,i.p===n&&i.modifier(r,e,t),i=s},RP=function(r){for(var e=this._pt,t,n;e;)n=e._next,e.p===r&&!e.op||e.op===r?uf(this,e,"_pt"):e.dep||(t=1),e=n;return!t},DP=function(r,e,t,n){n.mSet(r,e,n.m.call(n.tween,t,n.mt),n)},Jw=function(r){for(var e=r._pt,t,n,i,s;e;){for(t=e._next,n=i;n&&n.pr>e.pr;)n=n._next;(e._prev=n?n._prev:s)?e._prev._next=e:i=e,(e._next=n)?n._prev=e:s=e,e=t}r._pt=i},In=function(){function r(t,n,i,s,o,c,h,u,d){this.t=n,this.s=s,this.c=o,this.p=i,this.r=c||Xw,this.d=h||this,this.set=u||Em,this.pr=d||0,this._next=t,t&&(t._prev=this)}var e=r.prototype;return e.modifier=function(t,n,i){this.mSet=this.mSet||this.set,this.set=DP,this.m=t,this.mt=i,this.tween=n},r}();wn(lm+"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(r){return sm[r]=1}),jn.TweenMax=jn.TweenLite=wr,jn.TimelineLite=jn.TimelineMax=fn,nr=new fn({sortChildren:!1,defaults:jl,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),Vn.stringFilter=Fw;var wo=[],pf={},LP=[],Zw=0,NP=0,Im=function(r){return(pf[r]||LP).map(function(e){return e()})},Cm=function(){var r=Date.now(),e=[];r-Zw>2&&(Im("matchMediaInit"),wo.forEach(function(t){var n=t.queries,i=t.conditions,s,o,c,h;for(o in n)s=$i.matchMedia(n[o]).matches,s&&(c=1),s!==i[o]&&(i[o]=s,h=1);h&&(t.revert(),c&&e.push(t))}),Im("matchMediaRevert"),e.forEach(function(t){return t.onMatch(t,function(n){return t.add(null,n)})}),Zw=r,Im("matchMedia"))},$w=function(){function r(t,n){this.selector=n&&fm(n),this.data=[],this._r=[],this.isReverted=!1,this.id=NP++,t&&this.add(t)}var e=r.prototype;return e.add=function(t,n,i){lr(t)&&(i=n,n=t,t=lr);var s=this,o=function(){var c=$t,h=s.selector,u;return c&&c!==s&&c.data.push(s),i&&(s.selector=fm(i)),$t=s,u=n.apply(s,arguments),lr(u)&&s._r.push(u),$t=c,s.selector=h,s.isReverted=!1,u};return s.last=o,t===lr?o(s,function(c){return s.add(null,c)}):t?s[t]=o:o},e.ignore=function(t){var n=$t;$t=null,t(this),$t=n},e.getTweens=function(){var t=[];return this.data.forEach(function(n){return n instanceof r?t.push.apply(t,n.getTweens()):n instanceof wr&&!(n.parent&&n.parent.data==="nested")&&t.push(n)}),t},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(t,n){var i=this;if(t?function(){for(var o=i.getTweens(),c=i.data.length,h;c--;)h=i.data[c],h.data==="isFlip"&&(h.revert(),h.getChildren(!0,!0,!1).forEach(function(u){return o.splice(o.indexOf(u),1)}));for(o.map(function(u){return{g:u._dur||u._delay||u._sat&&!u._sat.vars.immediateRender?u.globalTime(0):-1/0,t:u}}).sort(function(u,d){return d.g-u.g||-1/0}).forEach(function(u){return u.t.revert(t)}),c=i.data.length;c--;)h=i.data[c],h instanceof fn?h.data!=="nested"&&(h.scrollTrigger&&h.scrollTrigger.revert(),h.kill()):!(h instanceof wr)&&h.revert&&h.revert(t);i._r.forEach(function(u){return u(t,i)}),i.isReverted=!0}():this.data.forEach(function(o){return o.kill&&o.kill()}),this.clear(),n)for(var s=wo.length;s--;)wo[s].id===this.id&&wo.splice(s,1)},e.revert=function(t){this.kill(t||{})},r}(),UP=function(){function r(t){this.contexts=[],this.scope=t,$t&&$t.data.push(this)}var e=r.prototype;return e.add=function(t,n,i){Zi(t)||(t={matches:t});var s=new $w(0,i||this.scope),o=s.conditions={},c,h,u;$t&&!s.selector&&(s.selector=$t.selector),this.contexts.push(s),n=s.add("onMatch",n),s.queries=t;for(h in t)h==="all"?u=1:(c=$i.matchMedia(t[h]),c&&(wo.indexOf(s)<0&&wo.push(s),(o[h]=c.matches)&&(u=1),c.addListener?c.addListener(Cm):c.addEventListener("change",Cm)));return u&&n(s,function(d){return s.add(null,d)}),this},e.revert=function(t){this.kill(t||{})},e.kill=function(t){this.contexts.forEach(function(n){return n.kill(t,!0)})},r}(),Af={registerPlugin:function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];e.forEach(function(n){return Pw(n)})},timeline:function(r){return new fn(r)},getTweensOf:function(r,e){return nr.getTweensOf(r,e)},getProperty:function(r,e,t,n){Fr(r)&&(r=ci(r)[0]);var i=_o(r||{}).get,s=t?vw:_w;return t==="native"&&(t=""),r&&(e?s((Wn[e]&&Wn[e].get||i)(r,e,t,n)):function(o,c,h){return s((Wn[o]&&Wn[o].get||i)(r,o,c,h))})},quickSetter:function(r,e,t){if(r=ci(r),r.length>1){var n=r.map(function(u){return Cn.quickSetter(u,e,t)}),i=n.length;return function(u){for(var d=i;d--;)n[d](u)}}r=r[0]||{};var s=Wn[e],o=_o(r),c=o.harness&&(o.harness.aliases||{})[e]||e,h=s?function(u){var d=new s;Kl._pt=0,d.init(r,t?u+t:u,Kl,0,[r]),d.render(1,d),Kl._pt&&wm(1,Kl)}:o.set(r,c);return s?h:function(u){return h(r,c,t?u+t:u,o,1)}},quickTo:function(r,e,t){var n,i=Cn.to(r,vo((n={},n[e]="+=0.1",n.paused=!0,n),t||{})),s=function(o,c,h){return i.resetTo(e,o,c,h)};return s.tween=i,s},isTweening:function(r){return nr.getTweensOf(r,!0).length>0},defaults:function(r){return r&&r.ease&&(r.ease=Eo(r.ease,jl.ease)),yw(jl,r||{})},config:function(r){return yw(Vn,r||{})},registerEffect:function(r){var e=r.name,t=r.effect,n=r.plugins,i=r.defaults,s=r.extendTimeline;(n||"").split(",").forEach(function(o){return o&&!Wn[o]&&!jn[o]&&bu(e+" effect requires "+o+" plugin.")}),om[e]=function(o,c,h){return t(ci(o),oi(c||{},i),h)},s&&(fn.prototype[e]=function(o,c,h){return this.add(om[e](o,Zi(c)?c:(h=c)&&{},this),h)})},registerEase:function(r,e){Ct[r]=Eo(e)},parseEase:function(r,e){return arguments.length?Eo(r,e):Ct},getById:function(r){return nr.getById(r)},exportRoot:function(r,e){r===void 0&&(r={});var t=new fn(r),n,i;for(t.smoothChildTiming=xn(r.smoothChildTiming),nr.remove(t),t._dp=0,t._time=t._tTime=nr._time,n=nr._first;n;)i=n._next,(e||!(!n._dur&&n instanceof wr&&n.vars.onComplete===n._targets[0]))&&es(t,n,n._start-n._delay),n=i;return es(nr,t,0),t},context:function(r,e){return r?new $w(r,e):$t},matchMedia:function(r){return new UP(r)},matchMediaRefresh:function(){return wo.forEach(function(r){var e=r.conditions,t,n;for(n in e)e[n]&&(e[n]=!1,t=1);t&&r.revert()})||Cm()},addEventListener:function(r,e){var t=pf[r]||(pf[r]=[]);~t.indexOf(e)||t.push(e)},removeEventListener:function(r,e){var t=pf[r],n=t&&t.indexOf(e);n>=0&&t.splice(n,1)},utils:{wrap:fP,wrapYoyo:pP,distribute:Bw,random:Rw,snap:bw,normalize:dP,getUnit:$r,clamp:lP,splitColor:kw,toArray:ci,selector:fm,mapRange:Lw,pipe:uP,unitize:hP,interpolate:AP,shuffle:Tw},install:dw,effects:om,ticker:qn,updateRoot:fn.updateRoot,plugins:Wn,globalTimeline:nr,core:{PropTween:In,globals:fw,Tween:wr,Timeline:fn,Animation:Ou,getCache:_o,_removeLinkedListItem:uf,reverting:function(){return Jr},context:function(r){return r&&$t&&($t.data.push(r),r._ctx=$t),$t},suppressOverwrites:function(r){return Kg=r}}};wn("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return Af[r]=wr[r]}),qn.add(fn.updateRoot),Kl=Af.to({},{duration:0});var PP=function(r,e){for(var t=r._pt;t&&t.p!==e&&t.op!==e&&t.fp!==e;)t=t._next;return t},kP=function(r,e){var t=r._targets,n,i,s;for(n in e)for(i=t.length;i--;)s=r._ptLookup[i][n],s&&(s=s.d)&&(s._pt&&(s=PP(s,n)),s&&s.modifier&&s.modifier(e[n],r,t[i],n))},Mm=function(r,e){return{name:r,rawVars:1,init:function(t,n,i){i._onInit=function(s){var o,c;if(Fr(n)&&(o={},wn(n,function(h){return o[h]=1}),n=o),e){o={};for(c in n)o[c]=e(n[c]);n=o}kP(s,n)}}}},Cn=Af.registerPlugin({name:"attr",init:function(r,e,t,n,i){var s,o,c;this.tween=t;for(s in e)c=r.getAttribute(s)||"",o=this.add(r,"setAttribute",(c||0)+"",e[s],n,i,0,0,s),o.op=s,o.b=c,this._props.push(s)},render:function(r,e){for(var t=e._pt;t;)Jr?t.set(t.t,t.p,t.b,t):t.r(r,t.d),t=t._next}},{name:"endArray",init:function(r,e){for(var t=e.length;t--;)this.add(r,t,r[t]||0,e[t],0,0,0,0,0,1)}},Mm("roundProps",pm),Mm("modifiers"),Mm("snap",bw))||Af;wr.version=fn.version=Cn.version="3.12.5",hw=1,$g()&&Jl(),Ct.Power0,Ct.Power1,Ct.Power2,Ct.Power3,Ct.Power4,Ct.Linear,Ct.Quad,Ct.Cubic,Ct.Quart,Ct.Quint,Ct.Strong,Ct.Elastic,Ct.Back,Ct.SteppedEase,Ct.Bounce,Ct.Sine,Ct.Expo,Ct.Circ;/*!
4409
+ */var jn={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},jl={duration:.5,overwrite:!1,delay:0},Kg,Jr,$t,ai=1e8,Gt=1/ai,Jg=Math.PI*2,WU=Jg/4,YU=0,aw=Math.sqrt,qU=Math.cos,XU=Math.sin,Fr=function(r){return typeof r=="string"},lr=function(r){return typeof r=="function"},Bs=function(r){return typeof r=="number"},Zg=function(r){return typeof r>"u"},Zi=function(r){return typeof r=="object"},xn=function(r){return r!==!1},$g=function(){return typeof window<"u"},nf=function(r){return lr(r)||Fr(r)},ow=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Zr=Array.isArray,em=/(?:-?\.?\d|\.)+/gi,lw=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Wl=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,tm=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,cw=/[+-]=-?[.\d]+/,uw=/[^,'"\[\]\s]+/gi,KU=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,nr,$i,rm,nm,Wn={},sf={},hw,dw=function(r){return(sf=vo(r,Wn))&&Cn},im=function(r,e){return console.warn("Invalid property",r,"set to",e,"Missing plugin? gsap.registerPlugin()")},bu=function(r,e){return!e&&console.warn(r)},fw=function(r,e){return r&&(Wn[r]=e)&&sf&&(sf[r]=e)||Wn},Ru=function(){return 0},JU={suppressEvents:!0,isStart:!0,kill:!1},af={suppressEvents:!0,kill:!1},ZU={suppressEvents:!0},sm={},Aa=[],am={},pw,Yn={},om={},Aw=30,of=[],lm="",cm=function(r){var e=r[0],t,n;if(Zi(e)||lr(e)||(r=[r]),!(t=(e._gsap||{}).harness)){for(n=of.length;n--&&!of[n].targetTest(e););t=of[n]}for(n=r.length;n--;)r[n]&&(r[n]._gsap||(r[n]._gsap=new Vw(r[n],t)))||r.splice(n,1);return r},_o=function(r){return r._gsap||cm(ci(r))[0]._gsap},gw=function(r,e,t){return(t=r[e])&&lr(t)?r[e]():Zg(t)&&r.getAttribute&&r.getAttribute(e)||t},wn=function(r,e){return(r=r.split(",")).forEach(e)||r},gr=function(r){return Math.round(r*1e5)/1e5||0},zr=function(r){return Math.round(r*1e7)/1e7||0},Yl=function(r,e){var t=e.charAt(0),n=parseFloat(e.substr(2));return r=parseFloat(r),t==="+"?r+n:t==="-"?r-n:t==="*"?r*n:r/n},$U=function(r,e){for(var t=e.length,n=0;r.indexOf(e[n])<0&&++n<t;);return n<t},lf=function(){var r=Aa.length,e=Aa.slice(0),t,n;for(am={},Aa.length=0,t=0;t<r;t++)n=e[t],n&&n._lazy&&(n.render(n._lazy[0],n._lazy[1],!0)._lazy=0)},mw=function(r,e,t,n){Aa.length&&!Jr&&lf(),r.render(e,t,n||Jr&&e<0&&(r._initted||r._startAt)),Aa.length&&!Jr&&lf()},_w=function(r){var e=parseFloat(r);return(e||e===0)&&(r+"").match(uw).length<2?e:Fr(r)?r.trim():r},vw=function(r){return r},oi=function(r,e){for(var t in e)t in r||(r[t]=e[t]);return r},eP=function(r){return function(e,t){for(var n in t)n in e||n==="duration"&&r||n==="ease"||(e[n]=t[n])}},vo=function(r,e){for(var t in e)r[t]=e[t];return r},yw=function r(e,t){for(var n in t)n!=="__proto__"&&n!=="constructor"&&n!=="prototype"&&(e[n]=Zi(t[n])?r(e[n]||(e[n]={}),t[n]):t[n]);return e},cf=function(r,e){var t={},n;for(n in r)n in e||(t[n]=r[n]);return t},Du=function(r){var e=r.parent||nr,t=r.keyframes?eP(Zr(r.keyframes)):oi;if(xn(r.inherit))for(;e;)t(r,e.vars.defaults),e=e.parent||e._dp;return r},tP=function(r,e){for(var t=r.length,n=t===e.length;n&&t--&&r[t]===e[t];);return t<0},Ew=function(r,e,t,n,i){t===void 0&&(t="_first"),n===void 0&&(n="_last");var s=r[n],o;if(i)for(o=e[i];s&&s[i]>o;)s=s._prev;return s?(e._next=s._next,s._next=e):(e._next=r[t],r[t]=e),e._next?e._next._prev=e:r[n]=e,e._prev=s,e.parent=e._dp=r,e},uf=function(r,e,t,n){t===void 0&&(t="_first"),n===void 0&&(n="_last");var i=e._prev,s=e._next;i?i._next=s:r[t]===e&&(r[t]=s),s?s._prev=i:r[n]===e&&(r[n]=i),e._next=e._prev=e.parent=null},ga=function(r,e){r.parent&&(!e||r.parent.autoRemoveChildren)&&r.parent.remove&&r.parent.remove(r),r._act=0},yo=function(r,e){if(r&&(!e||e._end>r._dur||e._start<0))for(var t=r;t;)t._dirty=1,t=t.parent;return r},rP=function(r){for(var e=r.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return r},um=function(r,e,t,n){return r._startAt&&(Jr?r._startAt.revert(af):r.vars.immediateRender&&!r.vars.autoRevert||r._startAt.render(e,!0,n))},nP=function r(e){return!e||e._ts&&r(e.parent)},xw=function(r){return r._repeat?ql(r._tTime,r=r.duration()+r._rDelay)*r:0},ql=function(r,e){var t=Math.floor(r/=e);return r&&t===r?t-1:t},hf=function(r,e){return(r-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},df=function(r){return r._end=zr(r._start+(r._tDur/Math.abs(r._ts||r._rts||Gt)||0))},ff=function(r,e){var t=r._dp;return t&&t.smoothChildTiming&&r._ts&&(r._start=zr(t._time-(r._ts>0?e/r._ts:((r._dirty?r.totalDuration():r._tDur)-e)/-r._ts)),df(r),t._dirty||yo(t,r)),r},ww=function(r,e){var t;if((e._time||!e._dur&&e._initted||e._start<r._time&&(e._dur||!e.add))&&(t=hf(r.rawTime(),e),(!e._dur||Nu(0,e.totalDuration(),t)-e._tTime>Gt)&&e.render(t,!0)),yo(r,e)._dp&&r._initted&&r._time>=r._dur&&r._ts){if(r._dur<r.duration())for(t=r;t._dp;)t.rawTime()>=0&&t.totalTime(t._tTime),t=t._dp;r._zTime=-Gt}},es=function(r,e,t,n){return e.parent&&ga(e),e._start=zr((Bs(t)?t:t||r!==nr?li(r,t,e):r._time)+e._delay),e._end=zr(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),Ew(r,e,"_first","_last",r._sort?"_start":0),hm(e)||(r._recent=e),n||ww(r,e),r._ts<0&&ff(r,r._tTime),r},Iw=function(r,e){return(Wn.ScrollTrigger||im("scrollTrigger",e))&&Wn.ScrollTrigger.create(e,r)},Cw=function(r,e,t,n,i){if(ym(r,e,i),!r._initted)return 1;if(!t&&r._pt&&!Jr&&(r._dur&&r.vars.lazy!==!1||!r._dur&&r.vars.lazy)&&pw!==Xn.frame)return Aa.push(r),r._lazy=[i,n],1},iP=function r(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||r(t))},hm=function(r){var e=r.data;return e==="isFromStart"||e==="isStart"},sP=function(r,e,t,n){var i=r.ratio,s=e<0||!e&&(!r._start&&iP(r)&&!(!r._initted&&hm(r))||(r._ts<0||r._dp._ts<0)&&!hm(r))?0:1,o=r._rDelay,c=0,h,u,d;if(o&&r._repeat&&(c=Nu(0,r._tDur,e),u=ql(c,o),r._yoyo&&u&1&&(s=1-s),u!==ql(r._tTime,o)&&(i=1-s,r.vars.repeatRefresh&&r._initted&&r.invalidate())),s!==i||Jr||n||r._zTime===Gt||!e&&r._zTime){if(!r._initted&&Cw(r,e,n,t,c))return;for(d=r._zTime,r._zTime=e||(t?Gt:0),t||(t=e&&!d),r.ratio=s,r._from&&(s=1-s),r._time=0,r._tTime=c,h=r._pt;h;)h.r(s,h.d),h=h._next;e<0&&um(r,e,t,!0),r._onUpdate&&!t&&qn(r,"onUpdate"),c&&r._repeat&&!t&&r.parent&&qn(r,"onRepeat"),(e>=r._tDur||e<0)&&r.ratio===s&&(s&&ga(r,1),!t&&!Jr&&(qn(r,s?"onComplete":"onReverseComplete",!0),r._prom&&r._prom()))}else r._zTime||(r._zTime=e)},aP=function(r,e,t){var n;if(t>e)for(n=r._first;n&&n._start<=t;){if(n.data==="isPause"&&n._start>e)return n;n=n._next}else for(n=r._last;n&&n._start>=t;){if(n.data==="isPause"&&n._start<e)return n;n=n._prev}},Xl=function(r,e,t,n){var i=r._repeat,s=zr(e)||0,o=r._tTime/r._tDur;return o&&!n&&(r._time*=s/r._dur),r._dur=s,r._tDur=i?i<0?1e10:zr(s*(i+1)+r._rDelay*i):s,o>0&&!n&&ff(r,r._tTime=r._tDur*o),r.parent&&df(r),t||yo(r.parent,r),r},Mw=function(r){return r instanceof fn?yo(r):Xl(r,r._dur)},oP={_start:0,endTime:Ru,totalDuration:Ru},li=function r(e,t,n){var i=e.labels,s=e._recent||oP,o=e.duration()>=ai?s.endTime(!1):e._dur,c,h,u;return Fr(t)&&(isNaN(t)||t in i)?(h=t.charAt(0),u=t.substr(-1)==="%",c=t.indexOf("="),h==="<"||h===">"?(c>=0&&(t=t.replace(/=/,"")),(h==="<"?s._start:s.endTime(s._repeat>=0))+(parseFloat(t.substr(1))||0)*(u?(c<0?s:n).totalDuration()/100:1)):c<0?(t in i||(i[t]=o),i[t]):(h=parseFloat(t.charAt(c-1)+t.substr(c+1)),u&&n&&(h=h/100*(Zr(n)?n[0]:n).totalDuration()),c>1?r(e,t.substr(0,c-1),n)+h:o+h)):t==null?o:+t},Lu=function(r,e,t){var n=Bs(e[1]),i=(n?2:1)+(r<2?0:1),s=e[i],o,c;if(n&&(s.duration=e[1]),s.parent=t,r){for(o=s,c=t;c&&!("immediateRender"in o);)o=c.vars.defaults||{},c=xn(c.vars.inherit)&&c.parent;s.immediateRender=xn(o.immediateRender),r<2?s.runBackwards=1:s.startAt=e[i-1]}return new wr(e[0],s,e[i+1])},ma=function(r,e){return r||r===0?e(r):e},Nu=function(r,e,t){return t<r?r:t>e?e:t},$r=function(r,e){return!Fr(r)||!(e=KU.exec(r))?"":e[1]},lP=function(r,e,t){return ma(t,function(n){return Nu(r,e,n)})},dm=[].slice,Sw=function(r,e){return r&&Zi(r)&&"length"in r&&(!e&&!r.length||r.length-1 in r&&Zi(r[0]))&&!r.nodeType&&r!==$i},cP=function(r,e,t){return t===void 0&&(t=[]),r.forEach(function(n){var i;return Fr(n)&&!e||Sw(n,1)?(i=t).push.apply(i,ci(n)):t.push(n)})||t},ci=function(r,e,t){return $t&&!e&&$t.selector?$t.selector(r):Fr(r)&&!t&&(rm||!Jl())?dm.call((e||nm).querySelectorAll(r),0):Zr(r)?cP(r,t):Sw(r)?dm.call(r,0):r?[r]:[]},fm=function(r){return r=ci(r)[0]||bu("Invalid scope")||{},function(e){var t=r.current||r.nativeElement||r;return ci(e,t.querySelectorAll?t:t===r?bu("Invalid scope")||nm.createElement("div"):r)}},Tw=function(r){return r.sort(function(){return .5-Math.random()})},Bw=function(r){if(lr(r))return r;var e=Zi(r)?r:{each:r},t=Eo(e.ease),n=e.from||0,i=parseFloat(e.base)||0,s={},o=n>0&&n<1,c=isNaN(n)||o,h=e.axis,u=n,d=n;return Fr(n)?u=d={center:.5,edges:.5,end:1}[n]||0:!o&&c&&(u=n[0],d=n[1]),function(A,p,g){var v=(g||e).length,E=s[v],m,_,w,x,I,R,S,T,D;if(!E){if(D=e.grid==="auto"?0:(e.grid||[1,ai])[1],!D){for(S=-ai;S<(S=g[D++].getBoundingClientRect().left)&&D<v;);D<v&&D--}for(E=s[v]=[],m=c?Math.min(D,v)*u-.5:n%D,_=D===ai?0:c?v*d/D-.5:n/D|0,S=0,T=ai,R=0;R<v;R++)w=R%D-m,x=_-(R/D|0),E[R]=I=h?Math.abs(h==="y"?x:w):aw(w*w+x*x),I>S&&(S=I),I<T&&(T=I);n==="random"&&Tw(E),E.max=S-T,E.min=T,E.v=v=(parseFloat(e.amount)||parseFloat(e.each)*(D>v?v-1:h?h==="y"?v/D:D:Math.max(D,v/D))||0)*(n==="edges"?-1:1),E.b=v<0?i-v:i,E.u=$r(e.amount||e.each)||0,t=t&&v<0?zw(t):t}return v=(E[A]-E.min)/E.max||0,zr(E.b+(t?t(v):v)*E.v)+E.u}},pm=function(r){var e=Math.pow(10,((r+"").split(".")[1]||"").length);return function(t){var n=zr(Math.round(parseFloat(t)/r)*r*e);return(n-n%1)/e+(Bs(t)?0:$r(t))}},bw=function(r,e){var t=Zr(r),n,i;return!t&&Zi(r)&&(n=t=r.radius||ai,r.values?(r=ci(r.values),(i=!Bs(r[0]))&&(n*=n)):r=pm(r.increment)),ma(e,t?lr(r)?function(s){return i=r(s),Math.abs(i-s)<=n?i:s}:function(s){for(var o=parseFloat(i?s.x:s),c=parseFloat(i?s.y:0),h=ai,u=0,d=r.length,A,p;d--;)i?(A=r[d].x-o,p=r[d].y-c,A=A*A+p*p):A=Math.abs(r[d]-o),A<h&&(h=A,u=d);return u=!n||h<=n?r[u]:s,i||u===s||Bs(s)?u:u+$r(s)}:pm(r))},Rw=function(r,e,t,n){return ma(Zr(r)?!e:t===!0?!!(t=0):!n,function(){return Zr(r)?r[~~(Math.random()*r.length)]:(t=t||1e-5)&&(n=t<1?Math.pow(10,(t+"").length-2):1)&&Math.floor(Math.round((r-t/2+Math.random()*(e-r+t*.99))/t)*t*n)/n})},uP=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return function(n){return e.reduce(function(i,s){return s(i)},n)}},hP=function(r,e){return function(t){return r(parseFloat(t))+(e||$r(t))}},dP=function(r,e,t){return Lw(r,e,0,1,t)},Dw=function(r,e,t){return ma(t,function(n){return r[~~e(n)]})},fP=function r(e,t,n){var i=t-e;return Zr(e)?Dw(e,r(0,e.length),t):ma(n,function(s){return(i+(s-e)%i)%i+e})},pP=function r(e,t,n){var i=t-e,s=i*2;return Zr(e)?Dw(e,r(0,e.length-1),t):ma(n,function(o){return o=(s+(o-e)%s)%s||0,e+(o>i?s-o:o)})},Uu=function(r){for(var e=0,t="",n,i,s,o;~(n=r.indexOf("random(",e));)s=r.indexOf(")",n),o=r.charAt(n+7)==="[",i=r.substr(n+7,s-n-7).match(o?uw:em),t+=r.substr(e,n-e)+Rw(o?i:+i[0],o?0:+i[1],+i[2]||1e-5),e=s+1;return t+r.substr(e,r.length-e)},Lw=function(r,e,t,n,i){var s=e-r,o=n-t;return ma(i,function(c){return t+((c-r)/s*o||0)})},AP=function r(e,t,n,i){var s=isNaN(e+t)?0:function(g){return(1-g)*e+g*t};if(!s){var o=Fr(e),c={},h,u,d,A,p;if(n===!0&&(i=1)&&(n=null),o)e={p:e},t={p:t};else if(Zr(e)&&!Zr(t)){for(d=[],A=e.length,p=A-2,u=1;u<A;u++)d.push(r(e[u-1],e[u]));A--,s=function(g){g*=A;var v=Math.min(p,~~g);return d[v](g-v)},n=t}else i||(e=vo(Zr(e)?[]:{},e));if(!d){for(h in t)_m.call(c,e,h,"get",t[h]);s=function(g){return wm(g,c)||(o?e.p:e)}}}return ma(n,s)},Nw=function(r,e,t){var n=r.labels,i=ai,s,o,c;for(s in n)o=n[s]-e,o<0==!!t&&o&&i>(o=Math.abs(o))&&(c=s,i=o);return c},qn=function(r,e,t){var n=r.vars,i=n[e],s=$t,o=r._ctx,c,h,u;if(i)return c=n[e+"Params"],h=n.callbackScope||r,t&&Aa.length&&lf(),o&&($t=o),u=c?i.apply(h,c):i.call(h),$t=s,u},Pu=function(r){return ga(r),r.scrollTrigger&&r.scrollTrigger.kill(!!Jr),r.progress()<1&&qn(r,"onInterrupt"),r},Kl,Uw=[],Pw=function(r){if(r)if(r=!r.name&&r.default||r,$g()||r.headless){var e=r.name,t=lr(r),n=e&&!t&&r.init?function(){this._props=[]}:r,i={init:Ru,render:wm,add:_m,kill:RP,modifier:bP,rawVars:0},s={targetTest:0,get:0,getSetter:xm,aliases:{},register:0};if(Jl(),r!==n){if(Yn[e])return;oi(n,oi(cf(r,i),s)),vo(n.prototype,vo(i,cf(r,s))),Yn[n.prop=e]=n,r.targetTest&&(of.push(n),sm[e]=1),e=(e==="css"?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}fw(e,n),r.register&&r.register(Cn,n,In)}else Uw.push(r)},zt=255,ku={aqua:[0,zt,zt],lime:[0,zt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,zt],navy:[0,0,128],white:[zt,zt,zt],olive:[128,128,0],yellow:[zt,zt,0],orange:[zt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[zt,0,0],pink:[zt,192,203],cyan:[0,zt,zt],transparent:[zt,zt,zt,0]},Am=function(r,e,t){return r+=r<0?1:r>1?-1:0,(r*6<1?e+(t-e)*r*6:r<.5?t:r*3<2?e+(t-e)*(2/3-r)*6:e)*zt+.5|0},kw=function(r,e,t){var n=r?Bs(r)?[r>>16,r>>8&zt,r&zt]:0:ku.black,i,s,o,c,h,u,d,A,p,g;if(!n){if(r.substr(-1)===","&&(r=r.substr(0,r.length-1)),ku[r])n=ku[r];else if(r.charAt(0)==="#"){if(r.length<6&&(i=r.charAt(1),s=r.charAt(2),o=r.charAt(3),r="#"+i+i+s+s+o+o+(r.length===5?r.charAt(4)+r.charAt(4):"")),r.length===9)return n=parseInt(r.substr(1,6),16),[n>>16,n>>8&zt,n&zt,parseInt(r.substr(7),16)/255];r=parseInt(r.substr(1),16),n=[r>>16,r>>8&zt,r&zt]}else if(r.substr(0,3)==="hsl"){if(n=g=r.match(em),!e)c=+n[0]%360/360,h=+n[1]/100,u=+n[2]/100,s=u<=.5?u*(h+1):u+h-u*h,i=u*2-s,n.length>3&&(n[3]*=1),n[0]=Am(c+1/3,i,s),n[1]=Am(c,i,s),n[2]=Am(c-1/3,i,s);else if(~r.indexOf("="))return n=r.match(lw),t&&n.length<4&&(n[3]=1),n}else n=r.match(em)||ku.transparent;n=n.map(Number)}return e&&!g&&(i=n[0]/zt,s=n[1]/zt,o=n[2]/zt,d=Math.max(i,s,o),A=Math.min(i,s,o),u=(d+A)/2,d===A?c=h=0:(p=d-A,h=u>.5?p/(2-d-A):p/(d+A),c=d===i?(s-o)/p+(s<o?6:0):d===s?(o-i)/p+2:(i-s)/p+4,c*=60),n[0]=~~(c+.5),n[1]=~~(h*100+.5),n[2]=~~(u*100+.5)),t&&n.length<4&&(n[3]=1),n},Qw=function(r){var e=[],t=[],n=-1;return r.split(_a).forEach(function(i){var s=i.match(Wl)||[];e.push.apply(e,s),t.push(n+=s.length+1)}),e.c=t,e},Ow=function(r,e,t){var n="",i=(r+n).match(_a),s=e?"hsla(":"rgba(",o=0,c,h,u,d;if(!i)return r;if(i=i.map(function(A){return(A=kw(A,e,1))&&s+(e?A[0]+","+A[1]+"%,"+A[2]+"%,"+A[3]:A.join(","))+")"}),t&&(u=Qw(r),c=t.c,c.join(n)!==u.c.join(n)))for(h=r.replace(_a,"1").split(Wl),d=h.length-1;o<d;o++)n+=h[o]+(~c.indexOf(o)?i.shift()||s+"0,0,0,0)":(u.length?u:i.length?i:t).shift());if(!h)for(h=r.split(_a),d=h.length-1;o<d;o++)n+=h[o]+i[o];return n+h[d]},_a=function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in ku)r+="|"+e+"\\b";return new RegExp(r+")","gi")}(),gP=/hsl[a]?\(/,Fw=function(r){var e=r.join(" "),t;if(_a.lastIndex=0,_a.test(e))return t=gP.test(e),r[1]=Ow(r[1],t),r[0]=Ow(r[0],t,Qw(r[1])),!0},Qu,Xn=function(){var r=Date.now,e=500,t=33,n=r(),i=n,s=1e3/240,o=s,c=[],h,u,d,A,p,g,v=function E(m){var _=r()-i,w=m===!0,x,I,R,S;if((_>e||_<0)&&(n+=_-t),i+=_,R=i-n,x=R-o,(x>0||w)&&(S=++A.frame,p=R-A.time*1e3,A.time=R=R/1e3,o+=x+(x>=s?4:s-x),I=1),w||(h=u(E)),I)for(g=0;g<c.length;g++)c[g](R,p,S,m)};return A={time:0,frame:0,tick:function(){v(!0)},deltaRatio:function(E){return p/(1e3/(E||60))},wake:function(){hw&&(!rm&&$g()&&($i=rm=window,nm=$i.document||{},Wn.gsap=Cn,($i.gsapVersions||($i.gsapVersions=[])).push(Cn.version),dw(sf||$i.GreenSockGlobals||!$i.gsap&&$i||{}),Uw.forEach(Pw)),d=typeof requestAnimationFrame<"u"&&requestAnimationFrame,h&&A.sleep(),u=d||function(E){return setTimeout(E,o-A.time*1e3+1|0)},Qu=1,v(2))},sleep:function(){(d?cancelAnimationFrame:clearTimeout)(h),Qu=0,u=Ru},lagSmoothing:function(E,m){e=E||1/0,t=Math.min(m||33,e)},fps:function(E){s=1e3/(E||240),o=A.time*1e3+s},add:function(E,m,_){var w=m?function(x,I,R,S){E(x,I,R,S),A.remove(w)}:E;return A.remove(E),c[_?"unshift":"push"](w),Jl(),w},remove:function(E,m){~(m=c.indexOf(E))&&c.splice(m,1)&&g>=m&&g--},_listeners:c},A}(),Jl=function(){return!Qu&&Xn.wake()},Ct={},mP=/^[\d.\-M][\d.\-,\s]/,_P=/["']/g,vP=function(r){for(var e={},t=r.substr(1,r.length-3).split(":"),n=t[0],i=1,s=t.length,o,c,h;i<s;i++)c=t[i],o=i!==s-1?c.lastIndexOf(","):c.length,h=c.substr(0,o),e[n]=isNaN(h)?h.replace(_P,"").trim():+h,n=c.substr(o+1).trim();return e},yP=function(r){var e=r.indexOf("(")+1,t=r.indexOf(")"),n=r.indexOf("(",e);return r.substring(e,~n&&n<t?r.indexOf(")",t+1):t)},EP=function(r){var e=(r+"").split("("),t=Ct[e[0]];return t&&e.length>1&&t.config?t.config.apply(null,~r.indexOf("{")?[vP(e[1])]:yP(r).split(",").map(_w)):Ct._CE&&mP.test(r)?Ct._CE("",r):t},zw=function(r){return function(e){return 1-r(1-e)}},Hw=function r(e,t){for(var n=e._first,i;n;)n instanceof fn?r(n,t):n.vars.yoyoEase&&(!n._yoyo||!n._repeat)&&n._yoyo!==t&&(n.timeline?r(n.timeline,t):(i=n._ease,n._ease=n._yEase,n._yEase=i,n._yoyo=t)),n=n._next},Eo=function(r,e){return r&&(lr(r)?r:Ct[r]||EP(r))||e},xo=function(r,e,t,n){t===void 0&&(t=function(o){return 1-e(1-o)}),n===void 0&&(n=function(o){return o<.5?e(o*2)/2:1-e((1-o)*2)/2});var i={easeIn:e,easeOut:t,easeInOut:n},s;return wn(r,function(o){Ct[o]=Wn[o]=i,Ct[s=o.toLowerCase()]=t;for(var c in i)Ct[s+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=Ct[o+"."+c]=i[c]}),i},Gw=function(r){return function(e){return e<.5?(1-r(1-e*2))/2:.5+r((e-.5)*2)/2}},gm=function r(e,t,n){var i=t>=1?t:1,s=(n||(e?.3:.45))/(t<1?t:1),o=s/Jg*(Math.asin(1/i)||0),c=function(u){return u===1?1:i*Math.pow(2,-10*u)*XU((u-o)*s)+1},h=e==="out"?c:e==="in"?function(u){return 1-c(1-u)}:Gw(c);return s=Jg/s,h.config=function(u,d){return r(e,u,d)},h},mm=function r(e,t){t===void 0&&(t=1.70158);var n=function(s){return s?--s*s*((t+1)*s+t)+1:0},i=e==="out"?n:e==="in"?function(s){return 1-n(1-s)}:Gw(n);return i.config=function(s){return r(e,s)},i};wn("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,e){var t=e<5?e+1:e;xo(r+",Power"+(t-1),e?function(n){return Math.pow(n,t)}:function(n){return n},function(n){return 1-Math.pow(1-n,t)},function(n){return n<.5?Math.pow(n*2,t)/2:1-Math.pow((1-n)*2,t)/2})}),Ct.Linear.easeNone=Ct.none=Ct.Linear.easeIn,xo("Elastic",gm("in"),gm("out"),gm()),function(r,e){var t=1/e,n=2*t,i=2.5*t,s=function(o){return o<t?r*o*o:o<n?r*Math.pow(o-1.5/e,2)+.75:o<i?r*(o-=2.25/e)*o+.9375:r*Math.pow(o-2.625/e,2)+.984375};xo("Bounce",function(o){return 1-s(1-o)},s)}(7.5625,2.75),xo("Expo",function(r){return r?Math.pow(2,10*(r-1)):0}),xo("Circ",function(r){return-(aw(1-r*r)-1)}),xo("Sine",function(r){return r===1?1:-qU(r*WU)+1}),xo("Back",mm("in"),mm("out"),mm()),Ct.SteppedEase=Ct.steps=Wn.SteppedEase={config:function(r,e){r===void 0&&(r=1);var t=1/r,n=r+(e?0:1),i=e?1:0,s=1-Gt;return function(o){return((n*Nu(0,s,o)|0)+i)*t}}},jl.ease=Ct["quad.out"],wn("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return lm+=r+","+r+"Params,"});var Vw=function(r,e){this.id=YU++,r._gsap=this,this.target=r,this.harness=e,this.get=e?e.get:gw,this.set=e?e.getSetter:xm},Ou=function(){function r(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,Xl(this,+t.duration,1,1),this.data=t.data,$t&&(this._ctx=$t,$t.data.push(this)),Qu||Xn.wake()}var e=r.prototype;return e.delay=function(t){return t||t===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+t-this._delay),this._delay=t,this):this._delay},e.duration=function(t){return arguments.length?this.totalDuration(this._repeat>0?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur},e.totalDuration=function(t){return arguments.length?(this._dirty=0,Xl(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(t,n){if(Jl(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(ff(this,t),!i._dp||i.parent||ww(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&&t<this._tDur||this._ts<0&&t>0||!this._tDur&&!t)&&es(this._dp,this,this._start-this._delay)}return(this._tTime!==t||!this._dur&&!n||this._initted&&Math.abs(this._zTime)===Gt||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),mw(this,t,n)),this},e.time=function(t,n){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+xw(this))%(this._dur+this._rDelay)||(t?this._dur:0),n):this._time},e.totalProgress=function(t,n){return arguments.length?this.totalTime(this.totalDuration()*t,n):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},e.progress=function(t,n){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-t:t)+xw(this),n):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(t,n){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*i,n):this._repeat?ql(this._tTime,i)+1:1},e.timeScale=function(t,n){if(!arguments.length)return this._rts===-Gt?0:this._rts;if(this._rts===t)return this;var i=this.parent&&this._ts?hf(this.parent._time,this):this._tTime;return this._rts=+t||0,this._ts=this._ps||t===-Gt?0:this._rts,this.totalTime(Nu(-Math.abs(this._delay),this._tDur,i),n!==!1),df(this),rP(this)},e.paused=function(t){return arguments.length?(this._ps!==t&&(this._ps=t,t?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Jl(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Gt&&(this._tTime-=Gt)))),this):this._ps},e.startTime=function(t){if(arguments.length){this._start=t;var n=this.parent||this._dp;return n&&(n._sort||!this.parent)&&es(n,this,t-this._delay),this}return this._start},e.endTime=function(t){return this._start+(xn(t)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(t){var n=this.parent||this._dp;return n?t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?hf(n.rawTime(t),this):this._tTime:this._tTime},e.revert=function(t){t===void 0&&(t=ZU);var n=Jr;return Jr=t,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(t),this.totalTime(-.01,t.suppressEvents)),this.data!=="nested"&&t.kill!==!1&&this.kill(),Jr=n,this},e.globalTime=function(t){for(var n=this,i=arguments.length?t:n.rawTime();n;)i=n._start+i/(Math.abs(n._ts)||1),n=n._dp;return!this.parent&&this._sat?this._sat.globalTime(t):i},e.repeat=function(t){return arguments.length?(this._repeat=t===1/0?-2:t,Mw(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(t){if(arguments.length){var n=this._time;return this._rDelay=t,Mw(this),n?this.time(n):this}return this._rDelay},e.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},e.seek=function(t,n){return this.totalTime(li(this,t),xn(n))},e.restart=function(t,n){return this.play().totalTime(t?-this._delay:0,xn(n))},e.play=function(t,n){return t!=null&&this.seek(t,n),this.reversed(!1).paused(!1)},e.reverse=function(t,n){return t!=null&&this.seek(t||this.totalDuration(),n),this.reversed(!0).paused(!1)},e.pause=function(t,n){return t!=null&&this.seek(t,n),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(t){return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-Gt:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-Gt,this},e.isActive=function(){var t=this.parent||this._dp,n=this._start,i;return!!(!t||this._ts&&this._initted&&t.isActive()&&(i=t.rawTime(!0))>=n&&i<this.endTime(!0)-Gt)},e.eventCallback=function(t,n,i){var s=this.vars;return arguments.length>1?(n?(s[t]=n,i&&(s[t+"Params"]=i),t==="onUpdate"&&(this._onUpdate=n)):delete s[t],this):s[t]},e.then=function(t){var n=this;return new Promise(function(i){var s=lr(t)?t:vw,o=function(){var c=n.then;n.then=null,lr(s)&&(s=s(n))&&(s.then||s===n)&&(n.then=c),i(s),n.then=c};n._initted&&n.totalProgress()===1&&n._ts>=0||!n._tTime&&n._ts<0?o():n._prom=o})},e.kill=function(){Pu(this)},r}();oi(Ou.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:-Gt,_prom:0,_ps:!1,_rts:1});var fn=function(r){sw(e,r);function e(n,i){var s;return n===void 0&&(n={}),s=r.call(this,n)||this,s.labels={},s.smoothChildTiming=!!n.smoothChildTiming,s.autoRemoveChildren=!!n.autoRemoveChildren,s._sort=xn(n.sortChildren),nr&&es(n.parent||nr,Ts(s),i),n.reversed&&s.reverse(),n.paused&&s.paused(!0),n.scrollTrigger&&Iw(Ts(s),n.scrollTrigger),s}var t=e.prototype;return t.to=function(n,i,s){return Lu(0,arguments,this),this},t.from=function(n,i,s){return Lu(1,arguments,this),this},t.fromTo=function(n,i,s,o){return Lu(2,arguments,this),this},t.set=function(n,i,s){return i.duration=0,i.parent=this,Du(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new wr(n,i,li(this,s),1),this},t.call=function(n,i,s){return es(this,wr.delayedCall(0,n,i),s)},t.staggerTo=function(n,i,s,o,c,h,u){return s.duration=i,s.stagger=s.stagger||o,s.onComplete=h,s.onCompleteParams=u,s.parent=this,new wr(n,s,li(this,c)),this},t.staggerFrom=function(n,i,s,o,c,h,u){return s.runBackwards=1,Du(s).immediateRender=xn(s.immediateRender),this.staggerTo(n,i,s,o,c,h,u)},t.staggerFromTo=function(n,i,s,o,c,h,u,d){return o.startAt=s,Du(o).immediateRender=xn(o.immediateRender),this.staggerTo(n,i,o,c,h,u,d)},t.render=function(n,i,s){var o=this._time,c=this._dirty?this.totalDuration():this._tDur,h=this._dur,u=n<=0?0:zr(n),d=this._zTime<0!=n<0&&(this._initted||!h),A,p,g,v,E,m,_,w,x,I,R,S;if(this!==nr&&u>c&&n>=0&&(u=c),u!==this._tTime||s||d){if(o!==this._time&&h&&(u+=this._time-o,n+=this._time-o),A=u,x=this._start,w=this._ts,m=!w,d&&(h||(o=this._zTime),(n||!i)&&(this._zTime=n)),this._repeat){if(R=this._yoyo,E=h+this._rDelay,this._repeat<-1&&n<0)return this.totalTime(E*100+n,i,s);if(A=zr(u%E),u===c?(v=this._repeat,A=h):(v=~~(u/E),v&&v===u/E&&(A=h,v--),A>h&&(A=h)),I=ql(this._tTime,E),!o&&this._tTime&&I!==v&&this._tTime-I*E-this._dur<=0&&(I=v),R&&v&1&&(A=h-A,S=1),v!==I&&!this._lock){var T=R&&I&1,D=T===(R&&v&1);if(v<I&&(T=!T),o=T?0:u%h?h:u,this._lock=1,this.render(o||(S?0:zr(v*E)),i,!h)._lock=0,this._tTime=u,!i&&this.parent&&qn(this,"onRepeat"),this.vars.repeatRefresh&&!S&&(this.invalidate()._lock=1),o&&o!==this._time||m!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(h=this._dur,c=this._tDur,D&&(this._lock=2,o=T?h:-1e-4,this.render(o,!0),this.vars.repeatRefresh&&!S&&this.invalidate()),this._lock=0,!this._ts&&!m)return this;Hw(this,S)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(_=aP(this,zr(o),zr(A)),_&&(u-=A-(A=_._start))),this._tTime=u,this._time=A,this._act=!w,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=n,o=0),!o&&A&&!i&&!v&&(qn(this,"onStart"),this._tTime!==u))return this;if(A>=o&&n>=0)for(p=this._first;p;){if(g=p._next,(p._act||A>=p._start)&&p._ts&&_!==p){if(p.parent!==this)return this.render(n,i,s);if(p.render(p._ts>0?(A-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(A-p._start)*p._ts,i,s),A!==this._time||!this._ts&&!m){_=0,g&&(u+=this._zTime=-Gt);break}}p=g}else{p=this._last;for(var b=n<0?n:A;p;){if(g=p._prev,(p._act||b<=p._end)&&p._ts&&_!==p){if(p.parent!==this)return this.render(n,i,s);if(p.render(p._ts>0?(b-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(b-p._start)*p._ts,i,s||Jr&&(p._initted||p._startAt)),A!==this._time||!this._ts&&!m){_=0,g&&(u+=this._zTime=b?-Gt:Gt);break}}p=g}}if(_&&!i&&(this.pause(),_.render(A>=o?0:-Gt)._zTime=A>=o?1:-1,this._ts))return this._start=x,df(this),this.render(n,i,s);this._onUpdate&&!i&&qn(this,"onUpdate",!0),(u===c&&this._tTime>=this.totalDuration()||!u&&o)&&(x===this._start||Math.abs(w)!==Math.abs(this._ts))&&(this._lock||((n||!h)&&(u===c&&this._ts>0||!u&&this._ts<0)&&ga(this,1),!i&&!(n<0&&!o)&&(u||o||!c)&&(qn(this,u===c&&n>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(u<c&&this.timeScale()>0)&&this._prom())))}return this},t.add=function(n,i){var s=this;if(Bs(i)||(i=li(this,i,n)),!(n instanceof Ou)){if(Zr(n))return n.forEach(function(o){return s.add(o,i)}),this;if(Fr(n))return this.addLabel(n,i);if(lr(n))n=wr.delayedCall(0,n);else return this}return this!==n?es(this,n,i):this},t.getChildren=function(n,i,s,o){n===void 0&&(n=!0),i===void 0&&(i=!0),s===void 0&&(s=!0),o===void 0&&(o=-ai);for(var c=[],h=this._first;h;)h._start>=o&&(h instanceof wr?i&&c.push(h):(s&&c.push(h),n&&c.push.apply(c,h.getChildren(!0,i,s)))),h=h._next;return c},t.getById=function(n){for(var i=this.getChildren(1,1,1),s=i.length;s--;)if(i[s].vars.id===n)return i[s]},t.remove=function(n){return Fr(n)?this.removeLabel(n):lr(n)?this.killTweensOf(n):(uf(this,n),n===this._recent&&(this._recent=this._last),yo(this))},t.totalTime=function(n,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=zr(Xn.time-(this._ts>0?n/this._ts:(this.totalDuration()-n)/-this._ts))),r.prototype.totalTime.call(this,n,i),this._forcing=0,this):this._tTime},t.addLabel=function(n,i){return this.labels[n]=li(this,i),this},t.removeLabel=function(n){return delete this.labels[n],this},t.addPause=function(n,i,s){var o=wr.delayedCall(0,i||Ru,s);return o.data="isPause",this._hasPause=1,es(this,o,li(this,n))},t.removePause=function(n){var i=this._first;for(n=li(this,n);i;)i._start===n&&i.data==="isPause"&&ga(i),i=i._next},t.killTweensOf=function(n,i,s){for(var o=this.getTweensOf(n,s),c=o.length;c--;)va!==o[c]&&o[c].kill(n,i);return this},t.getTweensOf=function(n,i){for(var s=[],o=ci(n),c=this._first,h=Bs(i),u;c;)c instanceof wr?$U(c._targets,o)&&(h?(!va||c._initted&&c._ts)&&c.globalTime(0)<=i&&c.globalTime(c.totalDuration())>i:!i||c.isActive())&&s.push(c):(u=c.getTweensOf(o,i)).length&&s.push.apply(s,u),c=c._next;return s},t.tweenTo=function(n,i){i=i||{};var s=this,o=li(s,n),c=i,h=c.startAt,u=c.onStart,d=c.onStartParams,A=c.immediateRender,p,g=wr.to(s,oi({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:i.duration||Math.abs((o-(h&&"time"in h?h.time:s._time))/s.timeScale())||Gt,onStart:function(){if(s.pause(),!p){var v=i.duration||Math.abs((o-(h&&"time"in h?h.time:s._time))/s.timeScale());g._dur!==v&&Xl(g,v,0,1).render(g._time,!0,!0),p=1}u&&u.apply(g,d||[])}},i));return A?g.render(0):g},t.tweenFromTo=function(n,i,s){return this.tweenTo(i,oi({startAt:{time:li(this,n)}},s))},t.recent=function(){return this._recent},t.nextLabel=function(n){return n===void 0&&(n=this._time),Nw(this,li(this,n))},t.previousLabel=function(n){return n===void 0&&(n=this._time),Nw(this,li(this,n),1)},t.currentLabel=function(n){return arguments.length?this.seek(n,!0):this.previousLabel(this._time+Gt)},t.shiftChildren=function(n,i,s){s===void 0&&(s=0);for(var o=this._first,c=this.labels,h;o;)o._start>=s&&(o._start+=n,o._end+=n),o=o._next;if(i)for(h in c)c[h]>=s&&(c[h]+=n);return yo(this)},t.invalidate=function(n){var i=this._first;for(this._lock=0;i;)i.invalidate(n),i=i._next;return r.prototype.invalidate.call(this,n)},t.clear=function(n){n===void 0&&(n=!0);for(var i=this._first,s;i;)s=i._next,this.remove(i),i=s;return this._dp&&(this._time=this._tTime=this._pTime=0),n&&(this.labels={}),yo(this)},t.totalDuration=function(n){var i=0,s=this,o=s._last,c=ai,h,u,d;if(arguments.length)return s.timeScale((s._repeat<0?s.duration():s.totalDuration())/(s.reversed()?-n:n));if(s._dirty){for(d=s.parent;o;)h=o._prev,o._dirty&&o.totalDuration(),u=o._start,u>c&&s._sort&&o._ts&&!s._lock?(s._lock=1,es(s,o,u-o._delay,1)._lock=0):c=u,u<0&&o._ts&&(i-=u,(!d&&!s._dp||d&&d.smoothChildTiming)&&(s._start+=u/s._ts,s._time-=u,s._tTime-=u),s.shiftChildren(-u,!1,-1/0),c=0),o._end>i&&o._ts&&(i=o._end),o=h;Xl(s,s===nr&&s._time>i?s._time:i,1,1),s._dirty=0}return s._tDur},e.updateRoot=function(n){if(nr._ts&&(mw(nr,hf(n,nr)),pw=Xn.frame),Xn.frame>=Aw){Aw+=jn.autoSleep||120;var i=nr._first;if((!i||!i._ts)&&jn.autoSleep&&Xn._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||Xn.sleep()}}},e}(Ou);oi(fn.prototype,{_lock:0,_hasPause:0,_forcing:0});var xP=function(r,e,t,n,i,s,o){var c=new In(this._pt,r,e,0,1,Kw,null,i),h=0,u=0,d,A,p,g,v,E,m,_;for(c.b=t,c.e=n,t+="",n+="",(m=~n.indexOf("random("))&&(n=Uu(n)),s&&(_=[t,n],s(_,r,e),t=_[0],n=_[1]),A=t.match(tm)||[];d=tm.exec(n);)g=d[0],v=n.substring(h,d.index),p?p=(p+1)%5:v.substr(-5)==="rgba("&&(p=1),g!==A[u++]&&(E=parseFloat(A[u-1])||0,c._pt={_next:c._pt,p:v||u===1?v:",",s:E,c:g.charAt(1)==="="?Yl(E,g)-E:parseFloat(g)-E,m:p&&p<4?Math.round:0},h=tm.lastIndex);return c.c=h<n.length?n.substring(h,n.length):"",c.fp=o,(cw.test(n)||m)&&(c.e=0),this._pt=c,c},_m=function(r,e,t,n,i,s,o,c,h,u){lr(n)&&(n=n(i||0,r,s));var d=r[e],A=t!=="get"?t:lr(d)?h?r[e.indexOf("set")||!lr(r["get"+e.substr(3)])?e:"get"+e.substr(3)](h):r[e]():d,p=lr(d)?h?SP:qw:Em,g;if(Fr(n)&&(~n.indexOf("random(")&&(n=Uu(n)),n.charAt(1)==="="&&(g=Yl(A,n)+($r(A)||0),(g||g===0)&&(n=g))),!u||A!==n||vm)return!isNaN(A*n)&&n!==""?(g=new In(this._pt,r,e,+A||0,n-(A||0),typeof d=="boolean"?BP:Xw,0,p),h&&(g.fp=h),o&&g.modifier(o,this,r),this._pt=g):(!d&&!(e in r)&&im(e,n),xP.call(this,r,e,A,n,p,c||jn.stringFilter,h))},wP=function(r,e,t,n,i){if(lr(r)&&(r=Fu(r,i,e,t,n)),!Zi(r)||r.style&&r.nodeType||Zr(r)||ow(r))return Fr(r)?Fu(r,i,e,t,n):r;var s={},o;for(o in r)s[o]=Fu(r[o],i,e,t,n);return s},jw=function(r,e,t,n,i,s){var o,c,h,u;if(Yn[r]&&(o=new Yn[r]).init(i,o.rawVars?e[r]:wP(e[r],n,i,s,t),t,n,s)!==!1&&(t._pt=c=new In(t._pt,i,r,0,1,o.render,o,0,o.priority),t!==Kl))for(h=t._ptLookup[t._targets.indexOf(i)],u=o._props.length;u--;)h[o._props[u]]=c;return o},va,vm,ym=function r(e,t,n){var i=e.vars,s=i.ease,o=i.startAt,c=i.immediateRender,h=i.lazy,u=i.onUpdate,d=i.runBackwards,A=i.yoyoEase,p=i.keyframes,g=i.autoRevert,v=e._dur,E=e._startAt,m=e._targets,_=e.parent,w=_&&_.data==="nested"?_.vars.targets:m,x=e._overwrite==="auto"&&!Kg,I=e.timeline,R,S,T,D,b,M,L,P,N,j,X,K,ne;if(I&&(!p||!s)&&(s="none"),e._ease=Eo(s,jl.ease),e._yEase=A?zw(Eo(A===!0?s:A,jl.ease)):0,A&&e._yoyo&&!e._repeat&&(A=e._yEase,e._yEase=e._ease,e._ease=A),e._from=!I&&!!i.runBackwards,!I||p&&!i.stagger){if(P=m[0]?_o(m[0]).harness:0,K=P&&i[P.prop],R=cf(i,sm),E&&(E._zTime<0&&E.progress(1),t<0&&d&&c&&!g?E.render(-1,!0):E.revert(d&&v?af:JU),E._lazy=0),o){if(ga(e._startAt=wr.set(m,oi({data:"isStart",overwrite:!1,parent:_,immediateRender:!0,lazy:!E&&xn(h),startAt:null,delay:0,onUpdate:u&&function(){return qn(e,"onUpdate")},stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,t<0&&(Jr||!c&&!g)&&e._startAt.revert(af),c&&v&&t<=0&&n<=0){t&&(e._zTime=t);return}}else if(d&&v&&!E){if(t&&(c=!1),T=oi({overwrite:!1,data:"isFromStart",lazy:c&&!E&&xn(h),immediateRender:c,stagger:0,parent:_},R),K&&(T[P.prop]=K),ga(e._startAt=wr.set(m,T)),e._startAt._dp=0,e._startAt._sat=e,t<0&&(Jr?e._startAt.revert(af):e._startAt.render(-1,!0)),e._zTime=t,!c)r(e._startAt,Gt,Gt);else if(!t)return}for(e._pt=e._ptCache=0,h=v&&xn(h)||h&&!v,S=0;S<m.length;S++){if(b=m[S],L=b._gsap||cm(m)[S]._gsap,e._ptLookup[S]=j={},am[L.id]&&Aa.length&&lf(),X=w===m?S:w.indexOf(b),P&&(N=new P).init(b,K||R,e,X,w)!==!1&&(e._pt=D=new In(e._pt,b,N.name,0,1,N.render,N,0,N.priority),N._props.forEach(function(V){j[V]=D}),N.priority&&(M=1)),!P||K)for(T in R)Yn[T]&&(N=jw(T,R,e,X,b,w))?N.priority&&(M=1):j[T]=D=_m.call(e,b,T,"get",R[T],X,w,0,i.stringFilter);e._op&&e._op[S]&&e.kill(b,e._op[S]),x&&e._pt&&(va=e,nr.killTweensOf(b,j,e.globalTime(t)),ne=!e.parent,va=0),e._pt&&h&&(am[L.id]=1)}M&&Jw(e),e._onInit&&e._onInit(e)}e._onUpdate=u,e._initted=(!e._op||e._pt)&&!ne,p&&t<=0&&I.render(ai,!0,!0)},IP=function(r,e,t,n,i,s,o,c){var h=(r._pt&&r._ptCache||(r._ptCache={}))[e],u,d,A,p;if(!h)for(h=r._ptCache[e]=[],A=r._ptLookup,p=r._targets.length;p--;){if(u=A[p][e],u&&u.d&&u.d._pt)for(u=u.d._pt;u&&u.p!==e&&u.fp!==e;)u=u._next;if(!u)return vm=1,r.vars[e]="+=0",ym(r,o),vm=0,c?bu(e+" not eligible for reset"):1;h.push(u)}for(p=h.length;p--;)d=h[p],u=d._pt||d,u.s=(n||n===0)&&!i?n:u.s+(n||0)+s*u.c,u.c=t-u.s,d.e&&(d.e=gr(t)+$r(d.e)),d.b&&(d.b=u.s+$r(d.b))},CP=function(r,e){var t=r[0]?_o(r[0]).harness:0,n=t&&t.aliases,i,s,o,c;if(!n)return e;i=vo({},e);for(s in n)if(s in i)for(c=n[s].split(","),o=c.length;o--;)i[c[o]]=i[s];return i},MP=function(r,e,t,n){var i=e.ease||n||"power1.inOut",s,o;if(Zr(e))o=t[r]||(t[r]=[]),e.forEach(function(c,h){return o.push({t:h/(e.length-1)*100,v:c,e:i})});else for(s in e)o=t[s]||(t[s]=[]),s==="ease"||o.push({t:parseFloat(r),v:e[s],e:i})},Fu=function(r,e,t,n,i){return lr(r)?r.call(e,t,n,i):Fr(r)&&~r.indexOf("random(")?Uu(r):r},Ww=lm+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",Yw={};wn(Ww+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return Yw[r]=1});var wr=function(r){sw(e,r);function e(n,i,s,o){var c;typeof i=="number"&&(s.duration=i,i=s,s=null),c=r.call(this,o?i:Du(i))||this;var h=c.vars,u=h.duration,d=h.delay,A=h.immediateRender,p=h.stagger,g=h.overwrite,v=h.keyframes,E=h.defaults,m=h.scrollTrigger,_=h.yoyoEase,w=i.parent||nr,x=(Zr(n)||ow(n)?Bs(n[0]):"length"in i)?[n]:ci(n),I,R,S,T,D,b,M,L;if(c._targets=x.length?cm(x):bu("GSAP target "+n+" not found. https://gsap.com",!jn.nullTargetWarn)||[],c._ptLookup=[],c._overwrite=g,v||p||nf(u)||nf(d)){if(i=c.vars,I=c.timeline=new fn({data:"nested",defaults:E||{},targets:w&&w.data==="nested"?w.vars.targets:x}),I.kill(),I.parent=I._dp=Ts(c),I._start=0,p||nf(u)||nf(d)){if(T=x.length,M=p&&Bw(p),Zi(p))for(D in p)~Ww.indexOf(D)&&(L||(L={}),L[D]=p[D]);for(R=0;R<T;R++)S=cf(i,Yw),S.stagger=0,_&&(S.yoyoEase=_),L&&vo(S,L),b=x[R],S.duration=+Fu(u,Ts(c),R,b,x),S.delay=(+Fu(d,Ts(c),R,b,x)||0)-c._delay,!p&&T===1&&S.delay&&(c._delay=d=S.delay,c._start+=d,S.delay=0),I.to(b,S,M?M(R,b,x):0),I._ease=Ct.none;I.duration()?u=d=0:c.timeline=0}else if(v){Du(oi(I.vars.defaults,{ease:"none"})),I._ease=Eo(v.ease||i.ease||"none");var P=0,N,j,X;if(Zr(v))v.forEach(function(K){return I.to(x,K,">")}),I.duration();else{S={};for(D in v)D==="ease"||D==="easeEach"||MP(D,v[D],S,v.easeEach);for(D in S)for(N=S[D].sort(function(K,ne){return K.t-ne.t}),P=0,R=0;R<N.length;R++)j=N[R],X={ease:j.e,duration:(j.t-(R?N[R-1].t:0))/100*u},X[D]=j.v,I.to(x,X,P),P+=X.duration;I.duration()<u&&I.to({},{duration:u-I.duration()})}}u||c.duration(u=I.duration())}else c.timeline=0;return g===!0&&!Kg&&(va=Ts(c),nr.killTweensOf(x),va=0),es(w,Ts(c),s),i.reversed&&c.reverse(),i.paused&&c.paused(!0),(A||!u&&!v&&c._start===zr(w._time)&&xn(A)&&nP(Ts(c))&&w.data!=="nested")&&(c._tTime=-Gt,c.render(Math.max(0,-d)||0)),m&&Iw(Ts(c),m),c}var t=e.prototype;return t.render=function(n,i,s){var o=this._time,c=this._tDur,h=this._dur,u=n<0,d=n>c-Gt&&!u?c:n<Gt?0:n,A,p,g,v,E,m,_,w,x;if(!h)sP(this,n,i,s);else if(d!==this._tTime||!n||s||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==u){if(A=d,w=this.timeline,this._repeat){if(v=h+this._rDelay,this._repeat<-1&&u)return this.totalTime(v*100+n,i,s);if(A=zr(d%v),d===c?(g=this._repeat,A=h):(g=~~(d/v),g&&g===zr(d/v)&&(A=h,g--),A>h&&(A=h)),m=this._yoyo&&g&1,m&&(x=this._yEase,A=h-A),E=ql(this._tTime,v),A===o&&!s&&this._initted&&g===E)return this._tTime=d,this;g!==E&&(w&&this._yEase&&Hw(w,m),this.vars.repeatRefresh&&!m&&!this._lock&&this._time!==v&&this._initted&&(this._lock=s=1,this.render(zr(v*g),!0).invalidate()._lock=0))}if(!this._initted){if(Cw(this,u?n:A,s,i,d))return this._tTime=0,this;if(o!==this._time&&!(s&&this.vars.repeatRefresh&&g!==E))return this;if(h!==this._dur)return this.render(n,i,s)}if(this._tTime=d,this._time=A,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=_=(x||this._ease)(A/h),this._from&&(this.ratio=_=1-_),A&&!o&&!i&&!g&&(qn(this,"onStart"),this._tTime!==d))return this;for(p=this._pt;p;)p.r(_,p.d),p=p._next;w&&w.render(n<0?n:w._dur*w._ease(A/this._dur),i,s)||this._startAt&&(this._zTime=n),this._onUpdate&&!i&&(u&&um(this,n,i,s),qn(this,"onUpdate")),this._repeat&&g!==E&&this.vars.onRepeat&&!i&&this.parent&&qn(this,"onRepeat"),(d===this._tDur||!d)&&this._tTime===d&&(u&&!this._onUpdate&&um(this,n,!0,!0),(n||!h)&&(d===this._tDur&&this._ts>0||!d&&this._ts<0)&&ga(this,1),!i&&!(u&&!o)&&(d||o||m)&&(qn(this,d===c?"onComplete":"onReverseComplete",!0),this._prom&&!(d<c&&this.timeScale()>0)&&this._prom()))}return this},t.targets=function(){return this._targets},t.invalidate=function(n){return(!n||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(n),r.prototype.invalidate.call(this,n)},t.resetTo=function(n,i,s,o,c){Qu||Xn.wake(),this._ts||this.play();var h=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||ym(this,h),u=this._ease(h/this._dur),IP(this,n,i,s,o,u,h,c)?this.resetTo(n,i,s,o,1):(ff(this,0),this.parent||Ew(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(n,i){if(i===void 0&&(i="all"),!n&&(!i||i==="all"))return this._lazy=this._pt=0,this.parent?Pu(this):this;if(this.timeline){var s=this.timeline.totalDuration();return this.timeline.killTweensOf(n,i,va&&va.vars.overwrite!==!0)._first||Pu(this),this.parent&&s!==this.timeline.totalDuration()&&Xl(this,this._dur*this.timeline._tDur/s,0,1),this}var o=this._targets,c=n?ci(n):o,h=this._ptLookup,u=this._pt,d,A,p,g,v,E,m;if((!i||i==="all")&&tP(o,c))return i==="all"&&(this._pt=0),Pu(this);for(d=this._op=this._op||[],i!=="all"&&(Fr(i)&&(v={},wn(i,function(_){return v[_]=1}),i=v),i=CP(o,i)),m=o.length;m--;)if(~c.indexOf(o[m])){A=h[m],i==="all"?(d[m]=i,g=A,p={}):(p=d[m]=d[m]||{},g=i);for(v in g)E=A&&A[v],E&&((!("kill"in E.d)||E.d.kill(v)===!0)&&uf(this,E,"_pt"),delete A[v]),p!=="all"&&(p[v]=1)}return this._initted&&!this._pt&&u&&Pu(this),this},e.to=function(n,i){return new e(n,i,arguments[2])},e.from=function(n,i){return Lu(1,arguments)},e.delayedCall=function(n,i,s,o){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:n,onComplete:i,onReverseComplete:i,onCompleteParams:s,onReverseCompleteParams:s,callbackScope:o})},e.fromTo=function(n,i,s){return Lu(2,arguments)},e.set=function(n,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new e(n,i)},e.killTweensOf=function(n,i,s){return nr.killTweensOf(n,i,s)},e}(Ou);oi(wr.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),wn("staggerTo,staggerFrom,staggerFromTo",function(r){wr[r]=function(){var e=new fn,t=dm.call(arguments,0);return t.splice(r==="staggerFromTo"?5:4,0,0),e[r].apply(e,t)}});var Em=function(r,e,t){return r[e]=t},qw=function(r,e,t){return r[e](t)},SP=function(r,e,t,n){return r[e](n.fp,t)},TP=function(r,e,t){return r.setAttribute(e,t)},xm=function(r,e){return lr(r[e])?qw:Zg(r[e])&&r.setAttribute?TP:Em},Xw=function(r,e){return e.set(e.t,e.p,Math.round((e.s+e.c*r)*1e6)/1e6,e)},BP=function(r,e){return e.set(e.t,e.p,!!(e.s+e.c*r),e)},Kw=function(r,e){var t=e._pt,n="";if(!r&&e.b)n=e.b;else if(r===1&&e.e)n=e.e;else{for(;t;)n=t.p+(t.m?t.m(t.s+t.c*r):Math.round((t.s+t.c*r)*1e4)/1e4)+n,t=t._next;n+=e.c}e.set(e.t,e.p,n,e)},wm=function(r,e){for(var t=e._pt;t;)t.r(r,t.d),t=t._next},bP=function(r,e,t,n){for(var i=this._pt,s;i;)s=i._next,i.p===n&&i.modifier(r,e,t),i=s},RP=function(r){for(var e=this._pt,t,n;e;)n=e._next,e.p===r&&!e.op||e.op===r?uf(this,e,"_pt"):e.dep||(t=1),e=n;return!t},DP=function(r,e,t,n){n.mSet(r,e,n.m.call(n.tween,t,n.mt),n)},Jw=function(r){for(var e=r._pt,t,n,i,s;e;){for(t=e._next,n=i;n&&n.pr>e.pr;)n=n._next;(e._prev=n?n._prev:s)?e._prev._next=e:i=e,(e._next=n)?n._prev=e:s=e,e=t}r._pt=i},In=function(){function r(t,n,i,s,o,c,h,u,d){this.t=n,this.s=s,this.c=o,this.p=i,this.r=c||Xw,this.d=h||this,this.set=u||Em,this.pr=d||0,this._next=t,t&&(t._prev=this)}var e=r.prototype;return e.modifier=function(t,n,i){this.mSet=this.mSet||this.set,this.set=DP,this.m=t,this.mt=i,this.tween=n},r}();wn(lm+"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(r){return sm[r]=1}),Wn.TweenMax=Wn.TweenLite=wr,Wn.TimelineLite=Wn.TimelineMax=fn,nr=new fn({sortChildren:!1,defaults:jl,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),jn.stringFilter=Fw;var wo=[],pf={},LP=[],Zw=0,NP=0,Im=function(r){return(pf[r]||LP).map(function(e){return e()})},Cm=function(){var r=Date.now(),e=[];r-Zw>2&&(Im("matchMediaInit"),wo.forEach(function(t){var n=t.queries,i=t.conditions,s,o,c,h;for(o in n)s=$i.matchMedia(n[o]).matches,s&&(c=1),s!==i[o]&&(i[o]=s,h=1);h&&(t.revert(),c&&e.push(t))}),Im("matchMediaRevert"),e.forEach(function(t){return t.onMatch(t,function(n){return t.add(null,n)})}),Zw=r,Im("matchMedia"))},$w=function(){function r(t,n){this.selector=n&&fm(n),this.data=[],this._r=[],this.isReverted=!1,this.id=NP++,t&&this.add(t)}var e=r.prototype;return e.add=function(t,n,i){lr(t)&&(i=n,n=t,t=lr);var s=this,o=function(){var c=$t,h=s.selector,u;return c&&c!==s&&c.data.push(s),i&&(s.selector=fm(i)),$t=s,u=n.apply(s,arguments),lr(u)&&s._r.push(u),$t=c,s.selector=h,s.isReverted=!1,u};return s.last=o,t===lr?o(s,function(c){return s.add(null,c)}):t?s[t]=o:o},e.ignore=function(t){var n=$t;$t=null,t(this),$t=n},e.getTweens=function(){var t=[];return this.data.forEach(function(n){return n instanceof r?t.push.apply(t,n.getTweens()):n instanceof wr&&!(n.parent&&n.parent.data==="nested")&&t.push(n)}),t},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(t,n){var i=this;if(t?function(){for(var o=i.getTweens(),c=i.data.length,h;c--;)h=i.data[c],h.data==="isFlip"&&(h.revert(),h.getChildren(!0,!0,!1).forEach(function(u){return o.splice(o.indexOf(u),1)}));for(o.map(function(u){return{g:u._dur||u._delay||u._sat&&!u._sat.vars.immediateRender?u.globalTime(0):-1/0,t:u}}).sort(function(u,d){return d.g-u.g||-1/0}).forEach(function(u){return u.t.revert(t)}),c=i.data.length;c--;)h=i.data[c],h instanceof fn?h.data!=="nested"&&(h.scrollTrigger&&h.scrollTrigger.revert(),h.kill()):!(h instanceof wr)&&h.revert&&h.revert(t);i._r.forEach(function(u){return u(t,i)}),i.isReverted=!0}():this.data.forEach(function(o){return o.kill&&o.kill()}),this.clear(),n)for(var s=wo.length;s--;)wo[s].id===this.id&&wo.splice(s,1)},e.revert=function(t){this.kill(t||{})},r}(),UP=function(){function r(t){this.contexts=[],this.scope=t,$t&&$t.data.push(this)}var e=r.prototype;return e.add=function(t,n,i){Zi(t)||(t={matches:t});var s=new $w(0,i||this.scope),o=s.conditions={},c,h,u;$t&&!s.selector&&(s.selector=$t.selector),this.contexts.push(s),n=s.add("onMatch",n),s.queries=t;for(h in t)h==="all"?u=1:(c=$i.matchMedia(t[h]),c&&(wo.indexOf(s)<0&&wo.push(s),(o[h]=c.matches)&&(u=1),c.addListener?c.addListener(Cm):c.addEventListener("change",Cm)));return u&&n(s,function(d){return s.add(null,d)}),this},e.revert=function(t){this.kill(t||{})},e.kill=function(t){this.contexts.forEach(function(n){return n.kill(t,!0)})},r}(),Af={registerPlugin:function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];e.forEach(function(n){return Pw(n)})},timeline:function(r){return new fn(r)},getTweensOf:function(r,e){return nr.getTweensOf(r,e)},getProperty:function(r,e,t,n){Fr(r)&&(r=ci(r)[0]);var i=_o(r||{}).get,s=t?vw:_w;return t==="native"&&(t=""),r&&(e?s((Yn[e]&&Yn[e].get||i)(r,e,t,n)):function(o,c,h){return s((Yn[o]&&Yn[o].get||i)(r,o,c,h))})},quickSetter:function(r,e,t){if(r=ci(r),r.length>1){var n=r.map(function(u){return Cn.quickSetter(u,e,t)}),i=n.length;return function(u){for(var d=i;d--;)n[d](u)}}r=r[0]||{};var s=Yn[e],o=_o(r),c=o.harness&&(o.harness.aliases||{})[e]||e,h=s?function(u){var d=new s;Kl._pt=0,d.init(r,t?u+t:u,Kl,0,[r]),d.render(1,d),Kl._pt&&wm(1,Kl)}:o.set(r,c);return s?h:function(u){return h(r,c,t?u+t:u,o,1)}},quickTo:function(r,e,t){var n,i=Cn.to(r,vo((n={},n[e]="+=0.1",n.paused=!0,n),t||{})),s=function(o,c,h){return i.resetTo(e,o,c,h)};return s.tween=i,s},isTweening:function(r){return nr.getTweensOf(r,!0).length>0},defaults:function(r){return r&&r.ease&&(r.ease=Eo(r.ease,jl.ease)),yw(jl,r||{})},config:function(r){return yw(jn,r||{})},registerEffect:function(r){var e=r.name,t=r.effect,n=r.plugins,i=r.defaults,s=r.extendTimeline;(n||"").split(",").forEach(function(o){return o&&!Yn[o]&&!Wn[o]&&bu(e+" effect requires "+o+" plugin.")}),om[e]=function(o,c,h){return t(ci(o),oi(c||{},i),h)},s&&(fn.prototype[e]=function(o,c,h){return this.add(om[e](o,Zi(c)?c:(h=c)&&{},this),h)})},registerEase:function(r,e){Ct[r]=Eo(e)},parseEase:function(r,e){return arguments.length?Eo(r,e):Ct},getById:function(r){return nr.getById(r)},exportRoot:function(r,e){r===void 0&&(r={});var t=new fn(r),n,i;for(t.smoothChildTiming=xn(r.smoothChildTiming),nr.remove(t),t._dp=0,t._time=t._tTime=nr._time,n=nr._first;n;)i=n._next,(e||!(!n._dur&&n instanceof wr&&n.vars.onComplete===n._targets[0]))&&es(t,n,n._start-n._delay),n=i;return es(nr,t,0),t},context:function(r,e){return r?new $w(r,e):$t},matchMedia:function(r){return new UP(r)},matchMediaRefresh:function(){return wo.forEach(function(r){var e=r.conditions,t,n;for(n in e)e[n]&&(e[n]=!1,t=1);t&&r.revert()})||Cm()},addEventListener:function(r,e){var t=pf[r]||(pf[r]=[]);~t.indexOf(e)||t.push(e)},removeEventListener:function(r,e){var t=pf[r],n=t&&t.indexOf(e);n>=0&&t.splice(n,1)},utils:{wrap:fP,wrapYoyo:pP,distribute:Bw,random:Rw,snap:bw,normalize:dP,getUnit:$r,clamp:lP,splitColor:kw,toArray:ci,selector:fm,mapRange:Lw,pipe:uP,unitize:hP,interpolate:AP,shuffle:Tw},install:dw,effects:om,ticker:Xn,updateRoot:fn.updateRoot,plugins:Yn,globalTimeline:nr,core:{PropTween:In,globals:fw,Tween:wr,Timeline:fn,Animation:Ou,getCache:_o,_removeLinkedListItem:uf,reverting:function(){return Jr},context:function(r){return r&&$t&&($t.data.push(r),r._ctx=$t),$t},suppressOverwrites:function(r){return Kg=r}}};wn("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return Af[r]=wr[r]}),Xn.add(fn.updateRoot),Kl=Af.to({},{duration:0});var PP=function(r,e){for(var t=r._pt;t&&t.p!==e&&t.op!==e&&t.fp!==e;)t=t._next;return t},kP=function(r,e){var t=r._targets,n,i,s;for(n in e)for(i=t.length;i--;)s=r._ptLookup[i][n],s&&(s=s.d)&&(s._pt&&(s=PP(s,n)),s&&s.modifier&&s.modifier(e[n],r,t[i],n))},Mm=function(r,e){return{name:r,rawVars:1,init:function(t,n,i){i._onInit=function(s){var o,c;if(Fr(n)&&(o={},wn(n,function(h){return o[h]=1}),n=o),e){o={};for(c in n)o[c]=e(n[c]);n=o}kP(s,n)}}}},Cn=Af.registerPlugin({name:"attr",init:function(r,e,t,n,i){var s,o,c;this.tween=t;for(s in e)c=r.getAttribute(s)||"",o=this.add(r,"setAttribute",(c||0)+"",e[s],n,i,0,0,s),o.op=s,o.b=c,this._props.push(s)},render:function(r,e){for(var t=e._pt;t;)Jr?t.set(t.t,t.p,t.b,t):t.r(r,t.d),t=t._next}},{name:"endArray",init:function(r,e){for(var t=e.length;t--;)this.add(r,t,r[t]||0,e[t],0,0,0,0,0,1)}},Mm("roundProps",pm),Mm("modifiers"),Mm("snap",bw))||Af;wr.version=fn.version=Cn.version="3.12.5",hw=1,$g()&&Jl(),Ct.Power0,Ct.Power1,Ct.Power2,Ct.Power3,Ct.Power4,Ct.Linear,Ct.Quad,Ct.Cubic,Ct.Quart,Ct.Quint,Ct.Strong,Ct.Elastic,Ct.Back,Ct.SteppedEase,Ct.Bounce,Ct.Sine,Ct.Expo,Ct.Circ;/*!
4410
4410
  * CSSPlugin 3.12.5
4411
4411
  * https://gsap.com
4412
4412
  *
@@ -4414,7 +4414,7 @@ bool bvhIntersectFirstHit(
4414
4414
  * Subject to the terms at https://gsap.com/standard-license or for
4415
4415
  * Club GSAP members, the agreement issued with that membership.
4416
4416
  * @author: Jack Doyle, jack@greensock.com
4417
- */var eI,ya,Zl,Sm,Io,tI,Tm,QP=function(){return typeof window<"u"},bs={},Co=180/Math.PI,$l=Math.PI/180,ec=Math.atan2,rI=1e8,Bm=/([A-Z])/g,OP=/(left|right|width|margin|padding|x)/i,FP=/[\s,\(]\S/,ts={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},bm=function(r,e){return e.set(e.t,e.p,Math.round((e.s+e.c*r)*1e4)/1e4+e.u,e)},zP=function(r,e){return e.set(e.t,e.p,r===1?e.e:Math.round((e.s+e.c*r)*1e4)/1e4+e.u,e)},HP=function(r,e){return e.set(e.t,e.p,r?Math.round((e.s+e.c*r)*1e4)/1e4+e.u:e.b,e)},GP=function(r,e){var t=e.s+e.c*r;e.set(e.t,e.p,~~(t+(t<0?-.5:.5))+e.u,e)},nI=function(r,e){return e.set(e.t,e.p,r?e.e:e.b,e)},iI=function(r,e){return e.set(e.t,e.p,r!==1?e.b:e.e,e)},VP=function(r,e,t){return r.style[e]=t},jP=function(r,e,t){return r.style.setProperty(e,t)},WP=function(r,e,t){return r._gsap[e]=t},YP=function(r,e,t){return r._gsap.scaleX=r._gsap.scaleY=t},qP=function(r,e,t,n,i){var s=r._gsap;s.scaleX=s.scaleY=t,s.renderTransform(i,s)},XP=function(r,e,t,n,i){var s=r._gsap;s[e]=t,s.renderTransform(i,s)},ir="transform",Mn=ir+"Origin",KP=function r(e,t){var n=this,i=this.target,s=i.style,o=i._gsap;if(e in bs&&s){if(this.tfm=this.tfm||{},e!=="transform")e=ts[e]||e,~e.indexOf(",")?e.split(",").forEach(function(c){return n.tfm[c]=Rs(i,c)}):this.tfm[e]=o.x?o[e]:Rs(i,e),e===Mn&&(this.tfm.zOrigin=o.zOrigin);else return ts.transform.split(",").forEach(function(c){return r.call(n,c,t)});if(this.props.indexOf(ir)>=0)return;o.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(Mn,t,"")),e=ir}(s||t)&&this.props.push(e,t,s[e])},sI=function(r){r.translate&&(r.removeProperty("translate"),r.removeProperty("scale"),r.removeProperty("rotate"))},JP=function(){var r=this.props,e=this.target,t=e.style,n=e._gsap,i,s;for(i=0;i<r.length;i+=3)r[i+1]?e[r[i]]=r[i+2]:r[i+2]?t[r[i]]=r[i+2]:t.removeProperty(r[i].substr(0,2)==="--"?r[i]:r[i].replace(Bm,"-$1").toLowerCase());if(this.tfm){for(s in this.tfm)n[s]=this.tfm[s];n.svg&&(n.renderTransform(),e.setAttribute("data-svg-origin",this.svgo||"")),i=Tm(),(!i||!i.isStart)&&!t[ir]&&(sI(t),n.zOrigin&&t[Mn]&&(t[Mn]+=" "+n.zOrigin+"px",n.zOrigin=0,n.renderTransform()),n.uncache=1)}},aI=function(r,e){var t={target:r,props:[],revert:JP,save:KP};return r._gsap||Cn.core.getCache(r),e&&e.split(",").forEach(function(n){return t.save(n)}),t},oI,Rm=function(r,e){var t=ya.createElementNS?ya.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),r):ya.createElement(r);return t&&t.style?t:ya.createElement(r)},rs=function r(e,t,n){var i=getComputedStyle(e);return i[t]||i.getPropertyValue(t.replace(Bm,"-$1").toLowerCase())||i.getPropertyValue(t)||!n&&r(e,tc(t)||t,1)||""},lI="O,Moz,ms,Ms,Webkit".split(","),tc=function(r,e,t){var n=e||Io,i=n.style,s=5;if(r in i&&!t)return r;for(r=r.charAt(0).toUpperCase()+r.substr(1);s--&&!(lI[s]+r in i););return s<0?null:(s===3?"ms":s>=0?lI[s]:"")+r},Dm=function(){QP()&&window.document&&(eI=window,ya=eI.document,Zl=ya.documentElement,Io=Rm("div")||{style:{}},Rm("div"),ir=tc(ir),Mn=ir+"Origin",Io.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",oI=!!tc("perspective"),Tm=Cn.core.reverting,Sm=1)},Lm=function r(e){var t=Rm("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=this.parentNode,i=this.nextSibling,s=this.style.cssText,o;if(Zl.appendChild(t),t.appendChild(this),this.style.display="block",e)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=r}catch{}else this._gsapBBox&&(o=this._gsapBBox());return n&&(i?n.insertBefore(this,i):n.appendChild(this)),Zl.removeChild(t),this.style.cssText=s,o},cI=function(r,e){for(var t=e.length;t--;)if(r.hasAttribute(e[t]))return r.getAttribute(e[t])},uI=function(r){var e;try{e=r.getBBox()}catch{e=Lm.call(r,!0)}return e&&(e.width||e.height)||r.getBBox===Lm||(e=Lm.call(r,!0)),e&&!e.width&&!e.x&&!e.y?{x:+cI(r,["x","cx","x1"])||0,y:+cI(r,["y","cy","y1"])||0,width:0,height:0}:e},hI=function(r){return!!(r.getCTM&&(!r.parentNode||r.ownerSVGElement)&&uI(r))},Mo=function(r,e){if(e){var t=r.style,n;e in bs&&e!==Mn&&(e=ir),t.removeProperty?(n=e.substr(0,2),(n==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),t.removeProperty(n==="--"?e:e.replace(Bm,"-$1").toLowerCase())):t.removeAttribute(e)}},Ea=function(r,e,t,n,i,s){var o=new In(r._pt,e,t,0,1,s?iI:nI);return r._pt=o,o.b=n,o.e=i,r._props.push(t),o},dI={deg:1,rad:1,turn:1},ZP={grid:1,flex:1},xa=function r(e,t,n,i){var s=parseFloat(n)||0,o=(n+"").trim().substr((s+"").length)||"px",c=Io.style,h=OP.test(t),u=e.tagName.toLowerCase()==="svg",d=(u?"client":"offset")+(h?"Width":"Height"),A=100,p=i==="px",g=i==="%",v,E,m,_;if(i===o||!s||dI[i]||dI[o])return s;if(o!=="px"&&!p&&(s=r(e,t,n,"px")),_=e.getCTM&&hI(e),(g||o==="%")&&(bs[t]||~t.indexOf("adius")))return v=_?e.getBBox()[h?"width":"height"]:e[d],gr(g?s/v*A:s/100*v);if(c[h?"width":"height"]=A+(p?o:i),E=~t.indexOf("adius")||i==="em"&&e.appendChild&&!u?e:e.parentNode,_&&(E=(e.ownerSVGElement||{}).parentNode),(!E||E===ya||!E.appendChild)&&(E=ya.body),m=E._gsap,m&&g&&m.width&&h&&m.time===qn.time&&!m.uncache)return gr(s/m.width*A);if(g&&(t==="height"||t==="width")){var w=e.style[t];e.style[t]=A+i,v=e[d],w?e.style[t]=w:Mo(e,t)}else(g||o==="%")&&!ZP[rs(E,"display")]&&(c.position=rs(e,"position")),E===e&&(c.position="static"),E.appendChild(Io),v=Io[d],E.removeChild(Io),c.position="absolute";return h&&g&&(m=_o(E),m.time=qn.time,m.width=E[d]),gr(p?v*s/A:v&&s?A/v*s:0)},Rs=function(r,e,t,n){var i;return Sm||Dm(),e in ts&&e!=="transform"&&(e=ts[e],~e.indexOf(",")&&(e=e.split(",")[0])),bs[e]&&e!=="transform"?(i=Hu(r,n),i=e!=="transformOrigin"?i[e]:i.svg?i.origin:mf(rs(r,Mn))+" "+i.zOrigin+"px"):(i=r.style[e],(!i||i==="auto"||n||~(i+"").indexOf("calc("))&&(i=gf[e]&&gf[e](r,e,t)||rs(r,e)||gw(r,e)||(e==="opacity"?1:0))),t&&!~(i+"").trim().indexOf(" ")?xa(r,e,i,t)+t:i},$P=function(r,e,t,n){if(!t||t==="none"){var i=tc(e,r,1),s=i&&rs(r,i,1);s&&s!==t?(e=i,t=s):e==="borderColor"&&(t=rs(r,"borderTopColor"))}var o=new In(this._pt,r.style,e,0,1,Kw),c=0,h=0,u,d,A,p,g,v,E,m,_,w,x,I;if(o.b=t,o.e=n,t+="",n+="",n==="auto"&&(v=r.style[e],r.style[e]=n,n=rs(r,e)||n,v?r.style[e]=v:Mo(r,e)),u=[t,n],Fw(u),t=u[0],n=u[1],A=t.match(Wl)||[],I=n.match(Wl)||[],I.length){for(;d=Wl.exec(n);)E=d[0],_=n.substring(c,d.index),g?g=(g+1)%5:(_.substr(-5)==="rgba("||_.substr(-5)==="hsla(")&&(g=1),E!==(v=A[h++]||"")&&(p=parseFloat(v)||0,x=v.substr((p+"").length),E.charAt(1)==="="&&(E=Yl(p,E)+x),m=parseFloat(E),w=E.substr((m+"").length),c=Wl.lastIndex-w.length,w||(w=w||Vn.units[e]||x,c===n.length&&(n+=w,o.e+=w)),x!==w&&(p=xa(r,e,v,w)||0),o._pt={_next:o._pt,p:_||h===1?_:",",s:p,c:m-p,m:g&&g<4||e==="zIndex"?Math.round:0});o.c=c<n.length?n.substring(c,n.length):""}else o.r=e==="display"&&n==="none"?iI:nI;return cw.test(n)&&(o.e=0),this._pt=o,o},fI={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},ek=function(r){var e=r.split(" "),t=e[0],n=e[1]||"50%";return(t==="top"||t==="bottom"||n==="left"||n==="right")&&(r=t,t=n,n=r),e[0]=fI[t]||t,e[1]=fI[n]||n,e.join(" ")},tk=function(r,e){if(e.tween&&e.tween._time===e.tween._dur){var t=e.t,n=t.style,i=e.u,s=t._gsap,o,c,h;if(i==="all"||i===!0)n.cssText="",c=1;else for(i=i.split(","),h=i.length;--h>-1;)o=i[h],bs[o]&&(c=1,o=o==="transformOrigin"?Mn:ir),Mo(t,o);c&&(Mo(t,ir),s&&(s.svg&&t.removeAttribute("transform"),Hu(t,1),s.uncache=1,sI(n)))}},gf={clearProps:function(r,e,t,n,i){if(i.data!=="isFromStart"){var s=r._pt=new In(r._pt,e,t,0,0,tk);return s.u=n,s.pr=-10,s.tween=i,r._props.push(t),1}}},zu=[1,0,0,1,0,0],pI={},AI=function(r){return r==="matrix(1, 0, 0, 1, 0, 0)"||r==="none"||!r},gI=function(r){var e=rs(r,ir);return AI(e)?zu:e.substr(7).match(lw).map(gr)},Nm=function(r,e){var t=r._gsap||_o(r),n=r.style,i=gI(r),s,o,c,h;return t.svg&&r.getAttribute("transform")?(c=r.transform.baseVal.consolidate().matrix,i=[c.a,c.b,c.c,c.d,c.e,c.f],i.join(",")==="1,0,0,1,0,0"?zu:i):(i===zu&&!r.offsetParent&&r!==Zl&&!t.svg&&(c=n.display,n.display="block",s=r.parentNode,(!s||!r.offsetParent)&&(h=1,o=r.nextElementSibling,Zl.appendChild(r)),i=gI(r),c?n.display=c:Mo(r,"display"),h&&(o?s.insertBefore(r,o):s?s.appendChild(r):Zl.removeChild(r))),e&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},Um=function(r,e,t,n,i,s){var o=r._gsap,c=i||Nm(r,!0),h=o.xOrigin||0,u=o.yOrigin||0,d=o.xOffset||0,A=o.yOffset||0,p=c[0],g=c[1],v=c[2],E=c[3],m=c[4],_=c[5],w=e.split(" "),x=parseFloat(w[0])||0,I=parseFloat(w[1])||0,R,S,T,D;t?c!==zu&&(S=p*E-g*v)&&(T=x*(E/S)+I*(-v/S)+(v*_-E*m)/S,D=x*(-g/S)+I*(p/S)-(p*_-g*m)/S,x=T,I=D):(R=uI(r),x=R.x+(~w[0].indexOf("%")?x/100*R.width:x),I=R.y+(~(w[1]||w[0]).indexOf("%")?I/100*R.height:I)),n||n!==!1&&o.smooth?(m=x-h,_=I-u,o.xOffset=d+(m*p+_*v)-m,o.yOffset=A+(m*g+_*E)-_):o.xOffset=o.yOffset=0,o.xOrigin=x,o.yOrigin=I,o.smooth=!!n,o.origin=e,o.originIsAbsolute=!!t,r.style[Mn]="0px 0px",s&&(Ea(s,o,"xOrigin",h,x),Ea(s,o,"yOrigin",u,I),Ea(s,o,"xOffset",d,o.xOffset),Ea(s,o,"yOffset",A,o.yOffset)),r.setAttribute("data-svg-origin",x+" "+I)},Hu=function(r,e){var t=r._gsap||new Vw(r);if("x"in t&&!e&&!t.uncache)return t;var n=r.style,i=t.scaleX<0,s="px",o="deg",c=getComputedStyle(r),h=rs(r,Mn)||"0",u,d,A,p,g,v,E,m,_,w,x,I,R,S,T,D,b,M,L,P,N,j,X,K,ne,V,te,Q,z,Z,re,H;return u=d=A=v=E=m=_=w=x=0,p=g=1,t.svg=!!(r.getCTM&&hI(r)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(n[ir]=(c.translate!=="none"?"translate3d("+(c.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(c.rotate!=="none"?"rotate("+c.rotate+") ":"")+(c.scale!=="none"?"scale("+c.scale.split(" ").join(",")+") ":"")+(c[ir]!=="none"?c[ir]:"")),n.scale=n.rotate=n.translate="none"),S=Nm(r,t.svg),t.svg&&(t.uncache?(ne=r.getBBox(),h=t.xOrigin-ne.x+"px "+(t.yOrigin-ne.y)+"px",K=""):K=!e&&r.getAttribute("data-svg-origin"),Um(r,K||h,!!K||t.originIsAbsolute,t.smooth!==!1,S)),I=t.xOrigin||0,R=t.yOrigin||0,S!==zu&&(M=S[0],L=S[1],P=S[2],N=S[3],u=j=S[4],d=X=S[5],S.length===6?(p=Math.sqrt(M*M+L*L),g=Math.sqrt(N*N+P*P),v=M||L?ec(L,M)*Co:0,_=P||N?ec(P,N)*Co+v:0,_&&(g*=Math.abs(Math.cos(_*$l))),t.svg&&(u-=I-(I*M+R*P),d-=R-(I*L+R*N))):(H=S[6],Z=S[7],te=S[8],Q=S[9],z=S[10],re=S[11],u=S[12],d=S[13],A=S[14],T=ec(H,z),E=T*Co,T&&(D=Math.cos(-T),b=Math.sin(-T),K=j*D+te*b,ne=X*D+Q*b,V=H*D+z*b,te=j*-b+te*D,Q=X*-b+Q*D,z=H*-b+z*D,re=Z*-b+re*D,j=K,X=ne,H=V),T=ec(-P,z),m=T*Co,T&&(D=Math.cos(-T),b=Math.sin(-T),K=M*D-te*b,ne=L*D-Q*b,V=P*D-z*b,re=N*b+re*D,M=K,L=ne,P=V),T=ec(L,M),v=T*Co,T&&(D=Math.cos(T),b=Math.sin(T),K=M*D+L*b,ne=j*D+X*b,L=L*D-M*b,X=X*D-j*b,M=K,j=ne),E&&Math.abs(E)+Math.abs(v)>359.9&&(E=v=0,m=180-m),p=gr(Math.sqrt(M*M+L*L+P*P)),g=gr(Math.sqrt(X*X+H*H)),T=ec(j,X),_=Math.abs(T)>2e-4?T*Co:0,x=re?1/(re<0?-re:re):0),t.svg&&(K=r.getAttribute("transform"),t.forceCSS=r.setAttribute("transform","")||!AI(rs(r,ir)),K&&r.setAttribute("transform",K))),Math.abs(_)>90&&Math.abs(_)<270&&(i?(p*=-1,_+=v<=0?180:-180,v+=v<=0?180:-180):(g*=-1,_+=_<=0?180:-180)),e=e||t.uncache,t.x=u-((t.xPercent=u&&(!e&&t.xPercent||(Math.round(r.offsetWidth/2)===Math.round(-u)?-50:0)))?r.offsetWidth*t.xPercent/100:0)+s,t.y=d-((t.yPercent=d&&(!e&&t.yPercent||(Math.round(r.offsetHeight/2)===Math.round(-d)?-50:0)))?r.offsetHeight*t.yPercent/100:0)+s,t.z=A+s,t.scaleX=gr(p),t.scaleY=gr(g),t.rotation=gr(v)+o,t.rotationX=gr(E)+o,t.rotationY=gr(m)+o,t.skewX=_+o,t.skewY=w+o,t.transformPerspective=x+s,(t.zOrigin=parseFloat(h.split(" ")[2])||!e&&t.zOrigin||0)&&(n[Mn]=mf(h)),t.xOffset=t.yOffset=0,t.force3D=Vn.force3D,t.renderTransform=t.svg?nk:oI?mI:rk,t.uncache=0,t},mf=function(r){return(r=r.split(" "))[0]+" "+r[1]},Pm=function(r,e,t){var n=$r(e);return gr(parseFloat(e)+parseFloat(xa(r,"x",t+"px",n)))+n},rk=function(r,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,mI(r,e)},So="0deg",Gu="0px",To=") ",mI=function(r,e){var t=e||this,n=t.xPercent,i=t.yPercent,s=t.x,o=t.y,c=t.z,h=t.rotation,u=t.rotationY,d=t.rotationX,A=t.skewX,p=t.skewY,g=t.scaleX,v=t.scaleY,E=t.transformPerspective,m=t.force3D,_=t.target,w=t.zOrigin,x="",I=m==="auto"&&r&&r!==1||m===!0;if(w&&(d!==So||u!==So)){var R=parseFloat(u)*$l,S=Math.sin(R),T=Math.cos(R),D;R=parseFloat(d)*$l,D=Math.cos(R),s=Pm(_,s,S*D*-w),o=Pm(_,o,-Math.sin(R)*-w),c=Pm(_,c,T*D*-w+w)}E!==Gu&&(x+="perspective("+E+To),(n||i)&&(x+="translate("+n+"%, "+i+"%) "),(I||s!==Gu||o!==Gu||c!==Gu)&&(x+=c!==Gu||I?"translate3d("+s+", "+o+", "+c+") ":"translate("+s+", "+o+To),h!==So&&(x+="rotate("+h+To),u!==So&&(x+="rotateY("+u+To),d!==So&&(x+="rotateX("+d+To),(A!==So||p!==So)&&(x+="skew("+A+", "+p+To),(g!==1||v!==1)&&(x+="scale("+g+", "+v+To),_.style[ir]=x||"translate(0, 0)"},nk=function(r,e){var t=e||this,n=t.xPercent,i=t.yPercent,s=t.x,o=t.y,c=t.rotation,h=t.skewX,u=t.skewY,d=t.scaleX,A=t.scaleY,p=t.target,g=t.xOrigin,v=t.yOrigin,E=t.xOffset,m=t.yOffset,_=t.forceCSS,w=parseFloat(s),x=parseFloat(o),I,R,S,T,D;c=parseFloat(c),h=parseFloat(h),u=parseFloat(u),u&&(u=parseFloat(u),h+=u,c+=u),c||h?(c*=$l,h*=$l,I=Math.cos(c)*d,R=Math.sin(c)*d,S=Math.sin(c-h)*-A,T=Math.cos(c-h)*A,h&&(u*=$l,D=Math.tan(h-u),D=Math.sqrt(1+D*D),S*=D,T*=D,u&&(D=Math.tan(u),D=Math.sqrt(1+D*D),I*=D,R*=D)),I=gr(I),R=gr(R),S=gr(S),T=gr(T)):(I=d,T=A,R=S=0),(w&&!~(s+"").indexOf("px")||x&&!~(o+"").indexOf("px"))&&(w=xa(p,"x",s,"px"),x=xa(p,"y",o,"px")),(g||v||E||m)&&(w=gr(w+g-(g*I+v*S)+E),x=gr(x+v-(g*R+v*T)+m)),(n||i)&&(D=p.getBBox(),w=gr(w+n/100*D.width),x=gr(x+i/100*D.height)),D="matrix("+I+","+R+","+S+","+T+","+w+","+x+")",p.setAttribute("transform",D),_&&(p.style[ir]=D)},ik=function(r,e,t,n,i){var s=360,o=Fr(i),c=parseFloat(i)*(o&&~i.indexOf("rad")?Co:1),h=c-n,u=n+h+"deg",d,A;return o&&(d=i.split("_")[1],d==="short"&&(h%=s,h!==h%(s/2)&&(h+=h<0?s:-s)),d==="cw"&&h<0?h=(h+s*rI)%s-~~(h/s)*s:d==="ccw"&&h>0&&(h=(h-s*rI)%s-~~(h/s)*s)),r._pt=A=new In(r._pt,e,t,n,h,zP),A.e=u,A.u="deg",r._props.push(t),A},_I=function(r,e){for(var t in e)r[t]=e[t];return r},sk=function(r,e,t){var n=_I({},t._gsap),i="perspective,force3D,transformOrigin,svgOrigin",s=t.style,o,c,h,u,d,A,p,g;n.svg?(h=t.getAttribute("transform"),t.setAttribute("transform",""),s[ir]=e,o=Hu(t,1),Mo(t,ir),t.setAttribute("transform",h)):(h=getComputedStyle(t)[ir],s[ir]=e,o=Hu(t,1),s[ir]=h);for(c in bs)h=n[c],u=o[c],h!==u&&i.indexOf(c)<0&&(p=$r(h),g=$r(u),d=p!==g?xa(t,c,h,g):parseFloat(h),A=parseFloat(u),r._pt=new In(r._pt,o,c,d,A-d,bm),r._pt.u=g||0,r._props.push(c));_I(o,n)};wn("padding,margin,Width,Radius",function(r,e){var t="Top",n="Right",i="Bottom",s="Left",o=(e<3?[t,n,i,s]:[t+s,t+n,i+n,i+s]).map(function(c){return e<2?r+c:"border"+c+r});gf[e>1?"border"+r:r]=function(c,h,u,d,A){var p,g;if(arguments.length<4)return p=o.map(function(v){return Rs(c,v,u)}),g=p.join(" "),g.split(p[0]).length===5?p[0]:g;p=(d+"").split(" "),g={},o.forEach(function(v,E){return g[v]=p[E]=p[E]||p[(E-1)/2|0]}),c.init(h,g,A)}});var vI={name:"css",register:Dm,targetTest:function(r){return r.style&&r.nodeType},init:function(r,e,t,n,i){var s=this._props,o=r.style,c=t.vars.startAt,h,u,d,A,p,g,v,E,m,_,w,x,I,R,S,T;Sm||Dm(),this.styles=this.styles||aI(r),T=this.styles.props,this.tween=t;for(v in e)if(v!=="autoRound"&&(u=e[v],!(Wn[v]&&jw(v,e,t,n,r,i)))){if(p=typeof u,g=gf[v],p==="function"&&(u=u.call(t,n,r,i),p=typeof u),p==="string"&&~u.indexOf("random(")&&(u=Uu(u)),g)g(this,r,v,u,t)&&(S=1);else if(v.substr(0,2)==="--")h=(getComputedStyle(r).getPropertyValue(v)+"").trim(),u+="",_a.lastIndex=0,_a.test(h)||(E=$r(h),m=$r(u)),m?E!==m&&(h=xa(r,v,h,m)+m):E&&(u+=E),this.add(o,"setProperty",h,u,n,i,0,0,v),s.push(v),T.push(v,0,o[v]);else if(p!=="undefined"){if(c&&v in c?(h=typeof c[v]=="function"?c[v].call(t,n,r,i):c[v],Fr(h)&&~h.indexOf("random(")&&(h=Uu(h)),$r(h+"")||h==="auto"||(h+=Vn.units[v]||$r(Rs(r,v))||""),(h+"").charAt(1)==="="&&(h=Rs(r,v))):h=Rs(r,v),A=parseFloat(h),_=p==="string"&&u.charAt(1)==="="&&u.substr(0,2),_&&(u=u.substr(2)),d=parseFloat(u),v in ts&&(v==="autoAlpha"&&(A===1&&Rs(r,"visibility")==="hidden"&&d&&(A=0),T.push("visibility",0,o.visibility),Ea(this,o,"visibility",A?"inherit":"hidden",d?"inherit":"hidden",!d)),v!=="scale"&&v!=="transform"&&(v=ts[v],~v.indexOf(",")&&(v=v.split(",")[0]))),w=v in bs,w){if(this.styles.save(v),x||(I=r._gsap,I.renderTransform&&!e.parseTransform||Hu(r,e.parseTransform),R=e.smoothOrigin!==!1&&I.smooth,x=this._pt=new In(this._pt,o,ir,0,1,I.renderTransform,I,0,-1),x.dep=1),v==="scale")this._pt=new In(this._pt,I,"scaleY",I.scaleY,(_?Yl(I.scaleY,_+d):d)-I.scaleY||0,bm),this._pt.u=0,s.push("scaleY",v),v+="X";else if(v==="transformOrigin"){T.push(Mn,0,o[Mn]),u=ek(u),I.svg?Um(r,u,0,R,0,this):(m=parseFloat(u.split(" ")[2])||0,m!==I.zOrigin&&Ea(this,I,"zOrigin",I.zOrigin,m),Ea(this,o,v,mf(h),mf(u)));continue}else if(v==="svgOrigin"){Um(r,u,1,R,0,this);continue}else if(v in pI){ik(this,I,v,A,_?Yl(A,_+u):u);continue}else if(v==="smoothOrigin"){Ea(this,I,"smooth",I.smooth,u);continue}else if(v==="force3D"){I[v]=u;continue}else if(v==="transform"){sk(this,u,r);continue}}else v in o||(v=tc(v)||v);if(w||(d||d===0)&&(A||A===0)&&!FP.test(u)&&v in o)E=(h+"").substr((A+"").length),d||(d=0),m=$r(u)||(v in Vn.units?Vn.units[v]:E),E!==m&&(A=xa(r,v,h,m)),this._pt=new In(this._pt,w?I:o,v,A,(_?Yl(A,_+d):d)-A,!w&&(m==="px"||v==="zIndex")&&e.autoRound!==!1?GP:bm),this._pt.u=m||0,E!==m&&m!=="%"&&(this._pt.b=h,this._pt.r=HP);else if(v in o)$P.call(this,r,v,h,_?_+u:u);else if(v in r)this.add(r,v,h||r[v],_?_+u:u,n,i);else if(v!=="parseTransform"){im(v,u);continue}w||(v in o?T.push(v,0,o[v]):T.push(v,1,h||r[v])),s.push(v)}}S&&Jw(this)},render:function(r,e){if(e.tween._time||!Tm())for(var t=e._pt;t;)t.r(r,t.d),t=t._next;else e.styles.revert()},get:Rs,aliases:ts,getSetter:function(r,e,t){var n=ts[e];return n&&n.indexOf(",")<0&&(e=n),e in bs&&e!==Mn&&(r._gsap.x||Rs(r,"x"))?t&&tI===t?e==="scale"?YP:WP:(tI=t||{})&&(e==="scale"?qP:XP):r.style&&!Zg(r.style[e])?VP:~e.indexOf("-")?jP:xm(r,e)},core:{_removeProperty:Mo,_getMatrix:Nm}};Cn.utils.checkPrefix=tc,Cn.core.getStyleSaver=aI,function(r,e,t,n){var i=wn(r+","+e+","+t,function(s){bs[s]=1});wn(e,function(s){Vn.units[s]="deg",pI[s]=1}),ts[i[13]]=r+","+e,wn(n,function(s){var o=s.split(":");ts[o[1]]=i[o[0]]})}("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY"),wn("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){Vn.units[r]="px"}),Cn.registerPlugin(vI);var yI=Cn.registerPlugin(vI)||Cn;yI.core.Tween;const Bo=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),ak={Front:{value:Bo?new W(4.7,1.9,7.5):new W(1.8,.65,2.5)},Back:{value:Bo?new W(0,1.9,-7.5):new W(0,.65,-4)},Left:{value:Bo?new W(-9.14,1.17,3):new W(-3.5,.4,1)},Right:{value:Bo?new W(9.14,1.17,3):new W(3.5,.4,1)},Top:{value:Bo?new W(0,9.23,3):new W(0,3.5,1)},Bottom:{value:Bo?new W(.6,-9.23,3):new W(.1,-3.5,1)}};let en,cr,rc=!1,_f=!1,km=!1,Qm=!1,Om,Fm;const ok=new Di({metalness:0,roughness:1,ior:1,opacity:1,clearcoat:0,color:new qe(16777215),transparent:!1,shadowSide:Pr,depthWrite:!0,map:null,alphaMap:null,aoMap:null,roughnessMap:null,metalnessMap:null,normalMap:null});let nc;const zm=[0,.4,.7,1],EI=[.85,.62,.3,0],xI=[new qe(16777215),new qe(16777215),new qe(16777215),new qe(16777215)],br={resolution:{value:new Ge(0,0)},color:{value:new qe(16777215)},metalness:{value:1},maxX:{value:.1},minX:{value:-.1},minY:{value:-.1},maxY:{value:.1},uAlpha:{value:!1},colors:{value:xI},positions:{value:zm},opacities:{value:EI}},wI=new wN;document.getElementById("gui-container");const Ds=new jU,lk=1;new UA().set(lk),new Es({color:"black"});class ck{constructor(){kt(this,"scene"),kt(this,"camera"),kt(this,"renderer"),kt(this,"canvas"),kt(this,"canvasSize"),kt(this,"isInitialised"),kt(this,"orgId"),kt(this,"textureLoader"),this.scene=new FL,this.canvasSize=new Ge,this.isInitialised=!1,this.textureLoader=new X2,this.orgId=""}async intialize(){this.canvas=document.querySelector("canvas.sprie-config-webgl");const e=this.canvas.clientWidth,t=this.canvas.clientHeight;this.canvasSize.set(e,t),this.camera=new cn(12,e/t,.1,1e4),this.camera.lookAt(0,0,0),this.renderer=new OL({canvas:this.canvas,alpha:!0,antialias:!0}),this.resizeRenderer(),wI.load("https://sprie-jarvis-public.s3.eu-west-2.amazonaws.com/environment_desaturated.hdr",n=>{n.mapping=Xc,this.scene.environment=n}),this.isInitialised=!0}resizeRenderer(){var e;const t=Math.min(window.devicePixelRatio,2),n=Math.floor(this.canvas.clientWidth*t),i=Math.floor(this.canvas.clientHeight*t),s=this.canvas.width!==n||this.canvas.height!==i;return s&&((e=this.renderer)==null||e.setSize(n,i,!1)),s}initGemstoneDependencies(){var e;wI.load("https://sprie-jarvis-public.s3.eu-west-2.amazonaws.com/environment_gemstones.hdr",A=>{A.mapping=Xc,Ds.uniforms.envMap.value=A,nc=A});const t=.01,n=A=>A&&A.isCubeTexture;Ds.uniforms.aberrationStrength.value=t,Ds.uniforms.resolution.value=this.canvasSize;const i={},s=n(nc),o=((s?(e=nc==null?void 0:nc.image[0])==null?void 0:e.width:nc==null?void 0:nc.image.width)??1024)/4,c=Math.floor(Math.log2(o)),h=Math.pow(2,c),u=3*Math.max(h,16*7),d=4*h;s&&(i.ENVMAP_TYPE_CUBEM=""),i.CUBEUV_TEXEL_WIDTH=`${1/u}`,i.CUBEUV_TEXEL_HEIGHT=`${1/d}`,i.CUBEUV_MAX_MIP=`${c}.0`,i.CHROMATIC_ABERRATIONS="",i.FAST_CHROMA="",Ds.defines=i}cleanUp(){this.renderer&&this.renderer.dispose()}async LoadEncryptedGlb(e,t,n){const i=await mB(t,n);if(!i||!i.decodedData)throw new Error("Asset auth error.");return new Promise(s=>{e.parse(i.decodedData,"",o=>{s({result:o})})})}async downloadModel(e,t){return await Cp.DownloadMA({orgId:e,assetsId:t})}getCustomisations(e){return[e==null?void 0:e.find(t=>(t==null?void 0:t.type)=="Lens"),e==null?void 0:e.find(t=>(t==null?void 0:t.type)=="Orbital")]}async loadFirstFrame(e,t,n){if(t&&e){const i=await this.downloadModel(e,t._id);let s;n?s=n:s=t.customisation;const[o,c]=this.getCustomisations(s);_f=!!o,rc=!!c,rc||(km=!0,Qm=!0),await this.renderModel(i.asset.cloudfrontUrl,i.decryptionKey).then(async()=>new Promise(async(h,u)=>{o&&this.updateLensMaterial(o),h(),c?await this.updateOrbitalMaterial(c).then(()=>{h()}):h()}))}else return}async changeFrame(e,t,n){if(t&&e){_f=!1,rc=!1;const i=await this.downloadModel(e,t._id),[s,o]=this.getCustomisations(n),[c,h]=this.getCustomisations(t.customisation);_f=!!(c||s&&(s==null?void 0:s.sku)!=="lens-default"),rc=!!(h||o&&(o==null?void 0:o.sku)!=="orbital-default"),await this.renderModel(i.asset.cloudfrontUrl,i.decryptionKey).then(async()=>new Promise(async(u,d)=>{s.sku=="lens-default"?(c&&this.updateLensMaterial(c),u()):(this.updateLensMaterial(s),u()),(o==null?void 0:o.sku)=="orbital-default"?h&&await this.updateOrbitalMaterial(h).then(()=>{u()}):await this.updateOrbitalMaterial(o).then(()=>{u()})}))}}async changeLens(e,t,n,i){return new Promise((s,o)=>{if(n)this.changeFrame(t,i,e).then(()=>{s()});else{Om&&(Om.visible=!0);const c=e.find(h=>h.type=="Lens");this.updateLensMaterial(c),km=!0,s()}})}async changeOrbital(e){return new Promise(async(t,n)=>{Fm&&(Fm.visible=!0),await this.updateOrbitalMaterial(e).then(()=>{Qm=!0,t()})})}async renderModel(e,t){const n=new R8;e&&await this.loadEyewearFromGLTF(n,e,this.renderer,t)}getMinY(e){let t=Number.POSITIVE_INFINITY;if(e.geometry instanceof zn){const n=e.geometry.getAttribute("position");if(n){const i=n.array;for(let s=0;s<i.length;s+=3){const o=new W(i[s],i[s+1],i[s+2]),c=e.localToWorld(o.clone());t=Math.min(t,c.y)}}}return t}updateScene(e){e.scene.scale.set(7,7,7),e.scene.position.y-=.08}adjustSceneHeight(e,t){let n=-.315-t;e.scene.position.y+=n,br.minY.value+=n,br.maxY.value+=n}calculateLensExtents(e){let t=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;if(e.geometry instanceof zn){const i=e.geometry.getAttribute("position");if(i){const s=i.array;for(let o=0;o<s.length;o+=3){const c=new W(s[o],s[o+1],s[o+2]),h=e.localToWorld(c.clone());t=Math.min(t,h.y),n=Math.max(n,h.y)}}}br.minY.value=t,br.maxY.value=n}setupLensMaterial(e,t){_f&&t.material&&t.material.name=="Lenses"&&(this.calculateLensExtents(t),Om=t,en=new Di({metalness:0,roughness:.05,ior:1,opacity:.6,clearcoat:1,color:new qe(16777215),transparent:!0,shadowSide:Pr,depthWrite:!1}),t.material=en,en&&(en.onBeforeCompile=function(n){n.uniforms.resolution=br.resolution,n.uniforms.color=br.color,n.uniforms.uAlpha=br.uAlpha,n.uniforms.colors=br.colors,n.uniforms.positions=br.positions,n.uniforms.opacities=br.opacities,n.uniforms.minX=br.minX,n.uniforms.maxX=br.maxX,n.uniforms.minY=br.minY,n.uniforms.maxY=br.maxY,n.vertexShader=`
4417
+ */var eI,ya,Zl,Sm,Io,tI,Tm,QP=function(){return typeof window<"u"},bs={},Co=180/Math.PI,$l=Math.PI/180,ec=Math.atan2,rI=1e8,Bm=/([A-Z])/g,OP=/(left|right|width|margin|padding|x)/i,FP=/[\s,\(]\S/,ts={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},bm=function(r,e){return e.set(e.t,e.p,Math.round((e.s+e.c*r)*1e4)/1e4+e.u,e)},zP=function(r,e){return e.set(e.t,e.p,r===1?e.e:Math.round((e.s+e.c*r)*1e4)/1e4+e.u,e)},HP=function(r,e){return e.set(e.t,e.p,r?Math.round((e.s+e.c*r)*1e4)/1e4+e.u:e.b,e)},GP=function(r,e){var t=e.s+e.c*r;e.set(e.t,e.p,~~(t+(t<0?-.5:.5))+e.u,e)},nI=function(r,e){return e.set(e.t,e.p,r?e.e:e.b,e)},iI=function(r,e){return e.set(e.t,e.p,r!==1?e.b:e.e,e)},VP=function(r,e,t){return r.style[e]=t},jP=function(r,e,t){return r.style.setProperty(e,t)},WP=function(r,e,t){return r._gsap[e]=t},YP=function(r,e,t){return r._gsap.scaleX=r._gsap.scaleY=t},qP=function(r,e,t,n,i){var s=r._gsap;s.scaleX=s.scaleY=t,s.renderTransform(i,s)},XP=function(r,e,t,n,i){var s=r._gsap;s[e]=t,s.renderTransform(i,s)},ir="transform",Mn=ir+"Origin",KP=function r(e,t){var n=this,i=this.target,s=i.style,o=i._gsap;if(e in bs&&s){if(this.tfm=this.tfm||{},e!=="transform")e=ts[e]||e,~e.indexOf(",")?e.split(",").forEach(function(c){return n.tfm[c]=Rs(i,c)}):this.tfm[e]=o.x?o[e]:Rs(i,e),e===Mn&&(this.tfm.zOrigin=o.zOrigin);else return ts.transform.split(",").forEach(function(c){return r.call(n,c,t)});if(this.props.indexOf(ir)>=0)return;o.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(Mn,t,"")),e=ir}(s||t)&&this.props.push(e,t,s[e])},sI=function(r){r.translate&&(r.removeProperty("translate"),r.removeProperty("scale"),r.removeProperty("rotate"))},JP=function(){var r=this.props,e=this.target,t=e.style,n=e._gsap,i,s;for(i=0;i<r.length;i+=3)r[i+1]?e[r[i]]=r[i+2]:r[i+2]?t[r[i]]=r[i+2]:t.removeProperty(r[i].substr(0,2)==="--"?r[i]:r[i].replace(Bm,"-$1").toLowerCase());if(this.tfm){for(s in this.tfm)n[s]=this.tfm[s];n.svg&&(n.renderTransform(),e.setAttribute("data-svg-origin",this.svgo||"")),i=Tm(),(!i||!i.isStart)&&!t[ir]&&(sI(t),n.zOrigin&&t[Mn]&&(t[Mn]+=" "+n.zOrigin+"px",n.zOrigin=0,n.renderTransform()),n.uncache=1)}},aI=function(r,e){var t={target:r,props:[],revert:JP,save:KP};return r._gsap||Cn.core.getCache(r),e&&e.split(",").forEach(function(n){return t.save(n)}),t},oI,Rm=function(r,e){var t=ya.createElementNS?ya.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),r):ya.createElement(r);return t&&t.style?t:ya.createElement(r)},rs=function r(e,t,n){var i=getComputedStyle(e);return i[t]||i.getPropertyValue(t.replace(Bm,"-$1").toLowerCase())||i.getPropertyValue(t)||!n&&r(e,tc(t)||t,1)||""},lI="O,Moz,ms,Ms,Webkit".split(","),tc=function(r,e,t){var n=e||Io,i=n.style,s=5;if(r in i&&!t)return r;for(r=r.charAt(0).toUpperCase()+r.substr(1);s--&&!(lI[s]+r in i););return s<0?null:(s===3?"ms":s>=0?lI[s]:"")+r},Dm=function(){QP()&&window.document&&(eI=window,ya=eI.document,Zl=ya.documentElement,Io=Rm("div")||{style:{}},Rm("div"),ir=tc(ir),Mn=ir+"Origin",Io.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",oI=!!tc("perspective"),Tm=Cn.core.reverting,Sm=1)},Lm=function r(e){var t=Rm("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=this.parentNode,i=this.nextSibling,s=this.style.cssText,o;if(Zl.appendChild(t),t.appendChild(this),this.style.display="block",e)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=r}catch{}else this._gsapBBox&&(o=this._gsapBBox());return n&&(i?n.insertBefore(this,i):n.appendChild(this)),Zl.removeChild(t),this.style.cssText=s,o},cI=function(r,e){for(var t=e.length;t--;)if(r.hasAttribute(e[t]))return r.getAttribute(e[t])},uI=function(r){var e;try{e=r.getBBox()}catch{e=Lm.call(r,!0)}return e&&(e.width||e.height)||r.getBBox===Lm||(e=Lm.call(r,!0)),e&&!e.width&&!e.x&&!e.y?{x:+cI(r,["x","cx","x1"])||0,y:+cI(r,["y","cy","y1"])||0,width:0,height:0}:e},hI=function(r){return!!(r.getCTM&&(!r.parentNode||r.ownerSVGElement)&&uI(r))},Mo=function(r,e){if(e){var t=r.style,n;e in bs&&e!==Mn&&(e=ir),t.removeProperty?(n=e.substr(0,2),(n==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),t.removeProperty(n==="--"?e:e.replace(Bm,"-$1").toLowerCase())):t.removeAttribute(e)}},Ea=function(r,e,t,n,i,s){var o=new In(r._pt,e,t,0,1,s?iI:nI);return r._pt=o,o.b=n,o.e=i,r._props.push(t),o},dI={deg:1,rad:1,turn:1},ZP={grid:1,flex:1},xa=function r(e,t,n,i){var s=parseFloat(n)||0,o=(n+"").trim().substr((s+"").length)||"px",c=Io.style,h=OP.test(t),u=e.tagName.toLowerCase()==="svg",d=(u?"client":"offset")+(h?"Width":"Height"),A=100,p=i==="px",g=i==="%",v,E,m,_;if(i===o||!s||dI[i]||dI[o])return s;if(o!=="px"&&!p&&(s=r(e,t,n,"px")),_=e.getCTM&&hI(e),(g||o==="%")&&(bs[t]||~t.indexOf("adius")))return v=_?e.getBBox()[h?"width":"height"]:e[d],gr(g?s/v*A:s/100*v);if(c[h?"width":"height"]=A+(p?o:i),E=~t.indexOf("adius")||i==="em"&&e.appendChild&&!u?e:e.parentNode,_&&(E=(e.ownerSVGElement||{}).parentNode),(!E||E===ya||!E.appendChild)&&(E=ya.body),m=E._gsap,m&&g&&m.width&&h&&m.time===Xn.time&&!m.uncache)return gr(s/m.width*A);if(g&&(t==="height"||t==="width")){var w=e.style[t];e.style[t]=A+i,v=e[d],w?e.style[t]=w:Mo(e,t)}else(g||o==="%")&&!ZP[rs(E,"display")]&&(c.position=rs(e,"position")),E===e&&(c.position="static"),E.appendChild(Io),v=Io[d],E.removeChild(Io),c.position="absolute";return h&&g&&(m=_o(E),m.time=Xn.time,m.width=E[d]),gr(p?v*s/A:v&&s?A/v*s:0)},Rs=function(r,e,t,n){var i;return Sm||Dm(),e in ts&&e!=="transform"&&(e=ts[e],~e.indexOf(",")&&(e=e.split(",")[0])),bs[e]&&e!=="transform"?(i=Hu(r,n),i=e!=="transformOrigin"?i[e]:i.svg?i.origin:mf(rs(r,Mn))+" "+i.zOrigin+"px"):(i=r.style[e],(!i||i==="auto"||n||~(i+"").indexOf("calc("))&&(i=gf[e]&&gf[e](r,e,t)||rs(r,e)||gw(r,e)||(e==="opacity"?1:0))),t&&!~(i+"").trim().indexOf(" ")?xa(r,e,i,t)+t:i},$P=function(r,e,t,n){if(!t||t==="none"){var i=tc(e,r,1),s=i&&rs(r,i,1);s&&s!==t?(e=i,t=s):e==="borderColor"&&(t=rs(r,"borderTopColor"))}var o=new In(this._pt,r.style,e,0,1,Kw),c=0,h=0,u,d,A,p,g,v,E,m,_,w,x,I;if(o.b=t,o.e=n,t+="",n+="",n==="auto"&&(v=r.style[e],r.style[e]=n,n=rs(r,e)||n,v?r.style[e]=v:Mo(r,e)),u=[t,n],Fw(u),t=u[0],n=u[1],A=t.match(Wl)||[],I=n.match(Wl)||[],I.length){for(;d=Wl.exec(n);)E=d[0],_=n.substring(c,d.index),g?g=(g+1)%5:(_.substr(-5)==="rgba("||_.substr(-5)==="hsla(")&&(g=1),E!==(v=A[h++]||"")&&(p=parseFloat(v)||0,x=v.substr((p+"").length),E.charAt(1)==="="&&(E=Yl(p,E)+x),m=parseFloat(E),w=E.substr((m+"").length),c=Wl.lastIndex-w.length,w||(w=w||jn.units[e]||x,c===n.length&&(n+=w,o.e+=w)),x!==w&&(p=xa(r,e,v,w)||0),o._pt={_next:o._pt,p:_||h===1?_:",",s:p,c:m-p,m:g&&g<4||e==="zIndex"?Math.round:0});o.c=c<n.length?n.substring(c,n.length):""}else o.r=e==="display"&&n==="none"?iI:nI;return cw.test(n)&&(o.e=0),this._pt=o,o},fI={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},ek=function(r){var e=r.split(" "),t=e[0],n=e[1]||"50%";return(t==="top"||t==="bottom"||n==="left"||n==="right")&&(r=t,t=n,n=r),e[0]=fI[t]||t,e[1]=fI[n]||n,e.join(" ")},tk=function(r,e){if(e.tween&&e.tween._time===e.tween._dur){var t=e.t,n=t.style,i=e.u,s=t._gsap,o,c,h;if(i==="all"||i===!0)n.cssText="",c=1;else for(i=i.split(","),h=i.length;--h>-1;)o=i[h],bs[o]&&(c=1,o=o==="transformOrigin"?Mn:ir),Mo(t,o);c&&(Mo(t,ir),s&&(s.svg&&t.removeAttribute("transform"),Hu(t,1),s.uncache=1,sI(n)))}},gf={clearProps:function(r,e,t,n,i){if(i.data!=="isFromStart"){var s=r._pt=new In(r._pt,e,t,0,0,tk);return s.u=n,s.pr=-10,s.tween=i,r._props.push(t),1}}},zu=[1,0,0,1,0,0],pI={},AI=function(r){return r==="matrix(1, 0, 0, 1, 0, 0)"||r==="none"||!r},gI=function(r){var e=rs(r,ir);return AI(e)?zu:e.substr(7).match(lw).map(gr)},Nm=function(r,e){var t=r._gsap||_o(r),n=r.style,i=gI(r),s,o,c,h;return t.svg&&r.getAttribute("transform")?(c=r.transform.baseVal.consolidate().matrix,i=[c.a,c.b,c.c,c.d,c.e,c.f],i.join(",")==="1,0,0,1,0,0"?zu:i):(i===zu&&!r.offsetParent&&r!==Zl&&!t.svg&&(c=n.display,n.display="block",s=r.parentNode,(!s||!r.offsetParent)&&(h=1,o=r.nextElementSibling,Zl.appendChild(r)),i=gI(r),c?n.display=c:Mo(r,"display"),h&&(o?s.insertBefore(r,o):s?s.appendChild(r):Zl.removeChild(r))),e&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},Um=function(r,e,t,n,i,s){var o=r._gsap,c=i||Nm(r,!0),h=o.xOrigin||0,u=o.yOrigin||0,d=o.xOffset||0,A=o.yOffset||0,p=c[0],g=c[1],v=c[2],E=c[3],m=c[4],_=c[5],w=e.split(" "),x=parseFloat(w[0])||0,I=parseFloat(w[1])||0,R,S,T,D;t?c!==zu&&(S=p*E-g*v)&&(T=x*(E/S)+I*(-v/S)+(v*_-E*m)/S,D=x*(-g/S)+I*(p/S)-(p*_-g*m)/S,x=T,I=D):(R=uI(r),x=R.x+(~w[0].indexOf("%")?x/100*R.width:x),I=R.y+(~(w[1]||w[0]).indexOf("%")?I/100*R.height:I)),n||n!==!1&&o.smooth?(m=x-h,_=I-u,o.xOffset=d+(m*p+_*v)-m,o.yOffset=A+(m*g+_*E)-_):o.xOffset=o.yOffset=0,o.xOrigin=x,o.yOrigin=I,o.smooth=!!n,o.origin=e,o.originIsAbsolute=!!t,r.style[Mn]="0px 0px",s&&(Ea(s,o,"xOrigin",h,x),Ea(s,o,"yOrigin",u,I),Ea(s,o,"xOffset",d,o.xOffset),Ea(s,o,"yOffset",A,o.yOffset)),r.setAttribute("data-svg-origin",x+" "+I)},Hu=function(r,e){var t=r._gsap||new Vw(r);if("x"in t&&!e&&!t.uncache)return t;var n=r.style,i=t.scaleX<0,s="px",o="deg",c=getComputedStyle(r),h=rs(r,Mn)||"0",u,d,A,p,g,v,E,m,_,w,x,I,R,S,T,D,b,M,L,P,N,j,X,K,ne,V,te,Q,z,Z,re,H;return u=d=A=v=E=m=_=w=x=0,p=g=1,t.svg=!!(r.getCTM&&hI(r)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(n[ir]=(c.translate!=="none"?"translate3d("+(c.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(c.rotate!=="none"?"rotate("+c.rotate+") ":"")+(c.scale!=="none"?"scale("+c.scale.split(" ").join(",")+") ":"")+(c[ir]!=="none"?c[ir]:"")),n.scale=n.rotate=n.translate="none"),S=Nm(r,t.svg),t.svg&&(t.uncache?(ne=r.getBBox(),h=t.xOrigin-ne.x+"px "+(t.yOrigin-ne.y)+"px",K=""):K=!e&&r.getAttribute("data-svg-origin"),Um(r,K||h,!!K||t.originIsAbsolute,t.smooth!==!1,S)),I=t.xOrigin||0,R=t.yOrigin||0,S!==zu&&(M=S[0],L=S[1],P=S[2],N=S[3],u=j=S[4],d=X=S[5],S.length===6?(p=Math.sqrt(M*M+L*L),g=Math.sqrt(N*N+P*P),v=M||L?ec(L,M)*Co:0,_=P||N?ec(P,N)*Co+v:0,_&&(g*=Math.abs(Math.cos(_*$l))),t.svg&&(u-=I-(I*M+R*P),d-=R-(I*L+R*N))):(H=S[6],Z=S[7],te=S[8],Q=S[9],z=S[10],re=S[11],u=S[12],d=S[13],A=S[14],T=ec(H,z),E=T*Co,T&&(D=Math.cos(-T),b=Math.sin(-T),K=j*D+te*b,ne=X*D+Q*b,V=H*D+z*b,te=j*-b+te*D,Q=X*-b+Q*D,z=H*-b+z*D,re=Z*-b+re*D,j=K,X=ne,H=V),T=ec(-P,z),m=T*Co,T&&(D=Math.cos(-T),b=Math.sin(-T),K=M*D-te*b,ne=L*D-Q*b,V=P*D-z*b,re=N*b+re*D,M=K,L=ne,P=V),T=ec(L,M),v=T*Co,T&&(D=Math.cos(T),b=Math.sin(T),K=M*D+L*b,ne=j*D+X*b,L=L*D-M*b,X=X*D-j*b,M=K,j=ne),E&&Math.abs(E)+Math.abs(v)>359.9&&(E=v=0,m=180-m),p=gr(Math.sqrt(M*M+L*L+P*P)),g=gr(Math.sqrt(X*X+H*H)),T=ec(j,X),_=Math.abs(T)>2e-4?T*Co:0,x=re?1/(re<0?-re:re):0),t.svg&&(K=r.getAttribute("transform"),t.forceCSS=r.setAttribute("transform","")||!AI(rs(r,ir)),K&&r.setAttribute("transform",K))),Math.abs(_)>90&&Math.abs(_)<270&&(i?(p*=-1,_+=v<=0?180:-180,v+=v<=0?180:-180):(g*=-1,_+=_<=0?180:-180)),e=e||t.uncache,t.x=u-((t.xPercent=u&&(!e&&t.xPercent||(Math.round(r.offsetWidth/2)===Math.round(-u)?-50:0)))?r.offsetWidth*t.xPercent/100:0)+s,t.y=d-((t.yPercent=d&&(!e&&t.yPercent||(Math.round(r.offsetHeight/2)===Math.round(-d)?-50:0)))?r.offsetHeight*t.yPercent/100:0)+s,t.z=A+s,t.scaleX=gr(p),t.scaleY=gr(g),t.rotation=gr(v)+o,t.rotationX=gr(E)+o,t.rotationY=gr(m)+o,t.skewX=_+o,t.skewY=w+o,t.transformPerspective=x+s,(t.zOrigin=parseFloat(h.split(" ")[2])||!e&&t.zOrigin||0)&&(n[Mn]=mf(h)),t.xOffset=t.yOffset=0,t.force3D=jn.force3D,t.renderTransform=t.svg?nk:oI?mI:rk,t.uncache=0,t},mf=function(r){return(r=r.split(" "))[0]+" "+r[1]},Pm=function(r,e,t){var n=$r(e);return gr(parseFloat(e)+parseFloat(xa(r,"x",t+"px",n)))+n},rk=function(r,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,mI(r,e)},So="0deg",Gu="0px",To=") ",mI=function(r,e){var t=e||this,n=t.xPercent,i=t.yPercent,s=t.x,o=t.y,c=t.z,h=t.rotation,u=t.rotationY,d=t.rotationX,A=t.skewX,p=t.skewY,g=t.scaleX,v=t.scaleY,E=t.transformPerspective,m=t.force3D,_=t.target,w=t.zOrigin,x="",I=m==="auto"&&r&&r!==1||m===!0;if(w&&(d!==So||u!==So)){var R=parseFloat(u)*$l,S=Math.sin(R),T=Math.cos(R),D;R=parseFloat(d)*$l,D=Math.cos(R),s=Pm(_,s,S*D*-w),o=Pm(_,o,-Math.sin(R)*-w),c=Pm(_,c,T*D*-w+w)}E!==Gu&&(x+="perspective("+E+To),(n||i)&&(x+="translate("+n+"%, "+i+"%) "),(I||s!==Gu||o!==Gu||c!==Gu)&&(x+=c!==Gu||I?"translate3d("+s+", "+o+", "+c+") ":"translate("+s+", "+o+To),h!==So&&(x+="rotate("+h+To),u!==So&&(x+="rotateY("+u+To),d!==So&&(x+="rotateX("+d+To),(A!==So||p!==So)&&(x+="skew("+A+", "+p+To),(g!==1||v!==1)&&(x+="scale("+g+", "+v+To),_.style[ir]=x||"translate(0, 0)"},nk=function(r,e){var t=e||this,n=t.xPercent,i=t.yPercent,s=t.x,o=t.y,c=t.rotation,h=t.skewX,u=t.skewY,d=t.scaleX,A=t.scaleY,p=t.target,g=t.xOrigin,v=t.yOrigin,E=t.xOffset,m=t.yOffset,_=t.forceCSS,w=parseFloat(s),x=parseFloat(o),I,R,S,T,D;c=parseFloat(c),h=parseFloat(h),u=parseFloat(u),u&&(u=parseFloat(u),h+=u,c+=u),c||h?(c*=$l,h*=$l,I=Math.cos(c)*d,R=Math.sin(c)*d,S=Math.sin(c-h)*-A,T=Math.cos(c-h)*A,h&&(u*=$l,D=Math.tan(h-u),D=Math.sqrt(1+D*D),S*=D,T*=D,u&&(D=Math.tan(u),D=Math.sqrt(1+D*D),I*=D,R*=D)),I=gr(I),R=gr(R),S=gr(S),T=gr(T)):(I=d,T=A,R=S=0),(w&&!~(s+"").indexOf("px")||x&&!~(o+"").indexOf("px"))&&(w=xa(p,"x",s,"px"),x=xa(p,"y",o,"px")),(g||v||E||m)&&(w=gr(w+g-(g*I+v*S)+E),x=gr(x+v-(g*R+v*T)+m)),(n||i)&&(D=p.getBBox(),w=gr(w+n/100*D.width),x=gr(x+i/100*D.height)),D="matrix("+I+","+R+","+S+","+T+","+w+","+x+")",p.setAttribute("transform",D),_&&(p.style[ir]=D)},ik=function(r,e,t,n,i){var s=360,o=Fr(i),c=parseFloat(i)*(o&&~i.indexOf("rad")?Co:1),h=c-n,u=n+h+"deg",d,A;return o&&(d=i.split("_")[1],d==="short"&&(h%=s,h!==h%(s/2)&&(h+=h<0?s:-s)),d==="cw"&&h<0?h=(h+s*rI)%s-~~(h/s)*s:d==="ccw"&&h>0&&(h=(h-s*rI)%s-~~(h/s)*s)),r._pt=A=new In(r._pt,e,t,n,h,zP),A.e=u,A.u="deg",r._props.push(t),A},_I=function(r,e){for(var t in e)r[t]=e[t];return r},sk=function(r,e,t){var n=_I({},t._gsap),i="perspective,force3D,transformOrigin,svgOrigin",s=t.style,o,c,h,u,d,A,p,g;n.svg?(h=t.getAttribute("transform"),t.setAttribute("transform",""),s[ir]=e,o=Hu(t,1),Mo(t,ir),t.setAttribute("transform",h)):(h=getComputedStyle(t)[ir],s[ir]=e,o=Hu(t,1),s[ir]=h);for(c in bs)h=n[c],u=o[c],h!==u&&i.indexOf(c)<0&&(p=$r(h),g=$r(u),d=p!==g?xa(t,c,h,g):parseFloat(h),A=parseFloat(u),r._pt=new In(r._pt,o,c,d,A-d,bm),r._pt.u=g||0,r._props.push(c));_I(o,n)};wn("padding,margin,Width,Radius",function(r,e){var t="Top",n="Right",i="Bottom",s="Left",o=(e<3?[t,n,i,s]:[t+s,t+n,i+n,i+s]).map(function(c){return e<2?r+c:"border"+c+r});gf[e>1?"border"+r:r]=function(c,h,u,d,A){var p,g;if(arguments.length<4)return p=o.map(function(v){return Rs(c,v,u)}),g=p.join(" "),g.split(p[0]).length===5?p[0]:g;p=(d+"").split(" "),g={},o.forEach(function(v,E){return g[v]=p[E]=p[E]||p[(E-1)/2|0]}),c.init(h,g,A)}});var vI={name:"css",register:Dm,targetTest:function(r){return r.style&&r.nodeType},init:function(r,e,t,n,i){var s=this._props,o=r.style,c=t.vars.startAt,h,u,d,A,p,g,v,E,m,_,w,x,I,R,S,T;Sm||Dm(),this.styles=this.styles||aI(r),T=this.styles.props,this.tween=t;for(v in e)if(v!=="autoRound"&&(u=e[v],!(Yn[v]&&jw(v,e,t,n,r,i)))){if(p=typeof u,g=gf[v],p==="function"&&(u=u.call(t,n,r,i),p=typeof u),p==="string"&&~u.indexOf("random(")&&(u=Uu(u)),g)g(this,r,v,u,t)&&(S=1);else if(v.substr(0,2)==="--")h=(getComputedStyle(r).getPropertyValue(v)+"").trim(),u+="",_a.lastIndex=0,_a.test(h)||(E=$r(h),m=$r(u)),m?E!==m&&(h=xa(r,v,h,m)+m):E&&(u+=E),this.add(o,"setProperty",h,u,n,i,0,0,v),s.push(v),T.push(v,0,o[v]);else if(p!=="undefined"){if(c&&v in c?(h=typeof c[v]=="function"?c[v].call(t,n,r,i):c[v],Fr(h)&&~h.indexOf("random(")&&(h=Uu(h)),$r(h+"")||h==="auto"||(h+=jn.units[v]||$r(Rs(r,v))||""),(h+"").charAt(1)==="="&&(h=Rs(r,v))):h=Rs(r,v),A=parseFloat(h),_=p==="string"&&u.charAt(1)==="="&&u.substr(0,2),_&&(u=u.substr(2)),d=parseFloat(u),v in ts&&(v==="autoAlpha"&&(A===1&&Rs(r,"visibility")==="hidden"&&d&&(A=0),T.push("visibility",0,o.visibility),Ea(this,o,"visibility",A?"inherit":"hidden",d?"inherit":"hidden",!d)),v!=="scale"&&v!=="transform"&&(v=ts[v],~v.indexOf(",")&&(v=v.split(",")[0]))),w=v in bs,w){if(this.styles.save(v),x||(I=r._gsap,I.renderTransform&&!e.parseTransform||Hu(r,e.parseTransform),R=e.smoothOrigin!==!1&&I.smooth,x=this._pt=new In(this._pt,o,ir,0,1,I.renderTransform,I,0,-1),x.dep=1),v==="scale")this._pt=new In(this._pt,I,"scaleY",I.scaleY,(_?Yl(I.scaleY,_+d):d)-I.scaleY||0,bm),this._pt.u=0,s.push("scaleY",v),v+="X";else if(v==="transformOrigin"){T.push(Mn,0,o[Mn]),u=ek(u),I.svg?Um(r,u,0,R,0,this):(m=parseFloat(u.split(" ")[2])||0,m!==I.zOrigin&&Ea(this,I,"zOrigin",I.zOrigin,m),Ea(this,o,v,mf(h),mf(u)));continue}else if(v==="svgOrigin"){Um(r,u,1,R,0,this);continue}else if(v in pI){ik(this,I,v,A,_?Yl(A,_+u):u);continue}else if(v==="smoothOrigin"){Ea(this,I,"smooth",I.smooth,u);continue}else if(v==="force3D"){I[v]=u;continue}else if(v==="transform"){sk(this,u,r);continue}}else v in o||(v=tc(v)||v);if(w||(d||d===0)&&(A||A===0)&&!FP.test(u)&&v in o)E=(h+"").substr((A+"").length),d||(d=0),m=$r(u)||(v in jn.units?jn.units[v]:E),E!==m&&(A=xa(r,v,h,m)),this._pt=new In(this._pt,w?I:o,v,A,(_?Yl(A,_+d):d)-A,!w&&(m==="px"||v==="zIndex")&&e.autoRound!==!1?GP:bm),this._pt.u=m||0,E!==m&&m!=="%"&&(this._pt.b=h,this._pt.r=HP);else if(v in o)$P.call(this,r,v,h,_?_+u:u);else if(v in r)this.add(r,v,h||r[v],_?_+u:u,n,i);else if(v!=="parseTransform"){im(v,u);continue}w||(v in o?T.push(v,0,o[v]):T.push(v,1,h||r[v])),s.push(v)}}S&&Jw(this)},render:function(r,e){if(e.tween._time||!Tm())for(var t=e._pt;t;)t.r(r,t.d),t=t._next;else e.styles.revert()},get:Rs,aliases:ts,getSetter:function(r,e,t){var n=ts[e];return n&&n.indexOf(",")<0&&(e=n),e in bs&&e!==Mn&&(r._gsap.x||Rs(r,"x"))?t&&tI===t?e==="scale"?YP:WP:(tI=t||{})&&(e==="scale"?qP:XP):r.style&&!Zg(r.style[e])?VP:~e.indexOf("-")?jP:xm(r,e)},core:{_removeProperty:Mo,_getMatrix:Nm}};Cn.utils.checkPrefix=tc,Cn.core.getStyleSaver=aI,function(r,e,t,n){var i=wn(r+","+e+","+t,function(s){bs[s]=1});wn(e,function(s){jn.units[s]="deg",pI[s]=1}),ts[i[13]]=r+","+e,wn(n,function(s){var o=s.split(":");ts[o[1]]=i[o[0]]})}("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY"),wn("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){jn.units[r]="px"}),Cn.registerPlugin(vI);var yI=Cn.registerPlugin(vI)||Cn;yI.core.Tween;const Bo=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),ak={Front:{value:Bo?new W(4.7,1.9,7.5):new W(1.8,.65,2.5)},Back:{value:Bo?new W(0,1.9,-7.5):new W(0,.65,-4)},Left:{value:Bo?new W(-9.14,1.17,3):new W(-3.5,.4,1)},Right:{value:Bo?new W(9.14,1.17,3):new W(3.5,.4,1)},Top:{value:Bo?new W(0,9.23,3):new W(0,3.5,1)},Bottom:{value:Bo?new W(.6,-9.23,3):new W(.1,-3.5,1)}};let en,cr,rc=!1,_f=!1,km=!1,Qm=!1,Om,Fm;const ok=new Di({metalness:0,roughness:1,ior:1,opacity:1,clearcoat:0,color:new qe(16777215),transparent:!1,shadowSide:Pr,depthWrite:!0,map:null,alphaMap:null,aoMap:null,roughnessMap:null,metalnessMap:null,normalMap:null});let nc;const zm=[0,.4,.7,1],EI=[.85,.62,.3,0],xI=[new qe(16777215),new qe(16777215),new qe(16777215),new qe(16777215)],br={resolution:{value:new Ge(0,0)},color:{value:new qe(16777215)},metalness:{value:1},maxX:{value:.1},minX:{value:-.1},minY:{value:-.1},maxY:{value:.1},uAlpha:{value:!1},colors:{value:xI},positions:{value:zm},opacities:{value:EI}},wI=new wN;document.getElementById("gui-container");const Ds=new jU,lk=1;new UA().set(lk),new Es({color:"black"});class ck{constructor(){kt(this,"scene"),kt(this,"camera"),kt(this,"renderer"),kt(this,"canvas"),kt(this,"canvasSize"),kt(this,"isInitialised"),kt(this,"orgId"),kt(this,"textureLoader"),this.scene=new FL,this.canvasSize=new Ge,this.isInitialised=!1,this.textureLoader=new X2,this.orgId=""}async intialize(){this.canvas=document.querySelector("canvas.sprie-config-webgl");const e=this.canvas.clientWidth,t=this.canvas.clientHeight;this.canvasSize.set(e,t),this.camera=new cn(12,e/t,.1,1e4),this.camera.lookAt(0,0,0),this.renderer=new OL({canvas:this.canvas,alpha:!0,antialias:!0}),this.resizeRenderer(),wI.load("https://sprie-jarvis-public.s3.eu-west-2.amazonaws.com/environment_desaturated.hdr",n=>{n.mapping=Xc,this.scene.environment=n}),this.isInitialised=!0}resizeRenderer(){var e;const t=Math.min(window.devicePixelRatio,2),n=Math.floor(this.canvas.clientWidth*t),i=Math.floor(this.canvas.clientHeight*t),s=this.canvas.width!==n||this.canvas.height!==i;return s&&((e=this.renderer)==null||e.setSize(n,i,!1)),s}initGemstoneDependencies(){var e;wI.load("https://sprie-jarvis-public.s3.eu-west-2.amazonaws.com/environment_gemstones.hdr",A=>{A.mapping=Xc,Ds.uniforms.envMap.value=A,nc=A});const t=.01,n=A=>A&&A.isCubeTexture;Ds.uniforms.aberrationStrength.value=t,Ds.uniforms.resolution.value=this.canvasSize;const i={},s=n(nc),o=((s?(e=nc==null?void 0:nc.image[0])==null?void 0:e.width:nc==null?void 0:nc.image.width)??1024)/4,c=Math.floor(Math.log2(o)),h=Math.pow(2,c),u=3*Math.max(h,16*7),d=4*h;s&&(i.ENVMAP_TYPE_CUBEM=""),i.CUBEUV_TEXEL_WIDTH=`${1/u}`,i.CUBEUV_TEXEL_HEIGHT=`${1/d}`,i.CUBEUV_MAX_MIP=`${c}.0`,i.CHROMATIC_ABERRATIONS="",i.FAST_CHROMA="",Ds.defines=i}cleanUp(){this.renderer&&this.renderer.dispose()}async LoadEncryptedGlb(e,t,n){const i=await mB(t,n);if(!i||!i.decodedData)throw new Error("Asset auth error.");return new Promise(s=>{e.parse(i.decodedData,"",o=>{s({result:o})})})}async downloadModel(e,t){return await Cp.DownloadMA({orgId:e,assetsId:t})}getCustomisations(e){return[e==null?void 0:e.find(t=>(t==null?void 0:t.type)=="Lens"),e==null?void 0:e.find(t=>(t==null?void 0:t.type)=="Orbital")]}async loadFirstFrame(e,t,n){if(t&&e){const i=await this.downloadModel(e,t._id);let s;n?s=n:s=t.customisation;const[o,c]=this.getCustomisations(s);_f=!!o,rc=!!c,rc||(km=!0,Qm=!0),await this.renderModel(i.asset.cloudfrontUrl,i.decryptionKey).then(async()=>new Promise(async(h,u)=>{o&&this.updateLensMaterial(o),h(),c?await this.updateOrbitalMaterial(c).then(()=>{h()}):h()}))}else return}async changeFrame(e,t,n){if(t&&e){_f=!1,rc=!1;const i=await this.downloadModel(e,t._id),[s,o]=this.getCustomisations(n),[c,h]=this.getCustomisations(t.customisation);_f=!!(c||s&&(s==null?void 0:s.sku)!=="lens-default"),rc=!!(h||o&&(o==null?void 0:o.sku)!=="orbital-default"),await this.renderModel(i.asset.cloudfrontUrl,i.decryptionKey).then(async()=>new Promise(async(u,d)=>{s.sku=="lens-default"?(c&&this.updateLensMaterial(c),u()):(this.updateLensMaterial(s),u()),(o==null?void 0:o.sku)=="orbital-default"?h&&await this.updateOrbitalMaterial(h).then(()=>{u()}):await this.updateOrbitalMaterial(o).then(()=>{u()})}))}}async changeLens(e,t,n,i){return new Promise((s,o)=>{if(n)this.changeFrame(t,i,e).then(()=>{s()});else{Om&&(Om.visible=!0);const c=e.find(h=>h.type=="Lens");this.updateLensMaterial(c),km=!0,s()}})}async changeOrbital(e){return new Promise(async(t,n)=>{Fm&&(Fm.visible=!0),await this.updateOrbitalMaterial(e).then(()=>{Qm=!0,t()})})}async renderModel(e,t){const n=new R8;e&&await this.loadEyewearFromGLTF(n,e,this.renderer,t)}getMinY(e){let t=Number.POSITIVE_INFINITY;if(e.geometry instanceof Hn){const n=e.geometry.getAttribute("position");if(n){const i=n.array;for(let s=0;s<i.length;s+=3){const o=new W(i[s],i[s+1],i[s+2]),c=e.localToWorld(o.clone());t=Math.min(t,c.y)}}}return t}updateScene(e){e.scene.scale.set(7,7,7),e.scene.position.y-=.08}adjustSceneHeight(e,t){let n=-.315-t;e.scene.position.y+=n,br.minY.value+=n,br.maxY.value+=n}calculateLensExtents(e){let t=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;if(e.geometry instanceof Hn){const i=e.geometry.getAttribute("position");if(i){const s=i.array;for(let o=0;o<s.length;o+=3){const c=new W(s[o],s[o+1],s[o+2]),h=e.localToWorld(c.clone());t=Math.min(t,h.y),n=Math.max(n,h.y)}}}br.minY.value=t,br.maxY.value=n}setupLensMaterial(e,t){_f&&t.material&&t.material.name=="Lenses"&&(this.calculateLensExtents(t),Om=t,en=new Di({metalness:0,roughness:.05,ior:1,opacity:.6,clearcoat:1,color:new qe(16777215),transparent:!0,shadowSide:Pr,depthWrite:!1}),t.material=en,en&&(en.onBeforeCompile=function(n){n.uniforms.resolution=br.resolution,n.uniforms.color=br.color,n.uniforms.uAlpha=br.uAlpha,n.uniforms.colors=br.colors,n.uniforms.positions=br.positions,n.uniforms.opacities=br.opacities,n.uniforms.minX=br.minX,n.uniforms.maxX=br.maxX,n.uniforms.minY=br.minY,n.uniforms.maxY=br.maxY,n.vertexShader=`
4418
4418
  varying vec3 vPosition;
4419
4419
  varying vec3 localPosition;
4420
4420
  varying vec2 vUv;
@@ -4462,7 +4462,7 @@ bool bvhIntersectFirstHit(
4462
4462
  `)},en.needsUpdate=!0,rc&&(t.visible=km)))}setupOrbitalMaterial(e){rc&&e.material&&e.material.name.toLowerCase()=="frame-stems"&&(Fm=e,cr=ok,cr.envMap=this.scene.environment,e.material=cr,cr.needsUpdate=!0,e.visible=Qm)}setupGemstoneMaterial(e){e.material&&e.name.toLowerCase().includes("diamond")&&(this.initGemstoneDependencies(),Ds.uniforms.bvh.value=new iw,Ds.uniforms.bvh.value.updateFrom(new Xg(e.geometry.clone().toNonIndexed(),{strategy:Ux})),e.material=Ds)}async loadEyewearFromGLTF(e,t,n,i){const s=new q2,o=new Ji(s).setTranscoderPath("https://unpkg.com/three@0.146.0/examples/js/libs/basis/");e.setKTX2Loader(o.detectSupport(n));const c=i,h=t.includes(".glb");let u;return h?u=await e.loadAsync(t):u=await this.LoadEncryptedGlb(e,t,c).then(d=>{let A=d.result;this.updateScene(A);let p=Number.POSITIVE_INFINITY;A.scene.traverse(g=>{g.isMesh&&(p=Math.min(p,this.getMinY(g)),this.setupLensMaterial(A,g),this.setupOrbitalMaterial(g),this.setupGemstoneMaterial(g),g.matrixAutoUpdate=!0)}),this.adjustSceneHeight(A,p),this.loadModelInsideScene(d.result.scene)}),u==null?void 0:u.scene}updateLensMaterial(e){if(en){if(e.direction=="u")en.color=new qe(e.color),en.opacity=e.opacity,br.uAlpha.value=!1;else if(e.direction=="tb"){const t=e.gradientColors;br.uAlpha.value=!0;let n=0;t.forEach(()=>{br.colors.value[n]=new qe(t[n].color),br.positions.value[n]=t[n].position,br.opacities.value[n]=t[n].alpha,n++})}e.finish=="MIRBLKHMC"?(en.clearcoat=1,en.clearcoatRoughness=0):e.finish=="HMCCR"?(en.clearcoat=0,en.clearcoatRoughness=1):e.finish=="MIRSILHMC"&&(en.clearcoat=1,en.clearcoatRoughness=0),en.roughness=e.roughness,en.metalness=e.metalness}}async downloadTexture(e){return await this.textureLoader.loadAsync(e).then(t=>(t.colorSpace=kr,t.flipY=!1,t.magFilter=fr,t.minFilter=KB,t.wrapS=Zs,t.wrapT=Zs,t))}async updateOrbitalMaterial(e){cr&&e&&(e.texture&&(e.texture.baseColor&&await this.downloadTexture(e.texture.baseColor).then(t=>{cr.map=t}),e.texture.opacity&&await this.downloadTexture(e.texture.opacity).then(t=>{cr.transmissionMap=t}),e.texture.orm&&await this.downloadTexture(e.texture.orm).then(t=>{cr.aoMap=t,cr.roughnessMap=t,cr.metalnessMap=t})),e.ior>1?(cr.ior=1.45,cr.thickness=.0035):(cr.ior=1,cr.thickness=0),cr.opacity=1,cr.transmission=1,cr.transparent=!1,cr.clearcoat=0,cr.roughness=1,cr.metalness=e.metalness,cr.shadowSide=Pr,cr.depthWrite=!0)}snapCamToPos(e){var t;if(!this.camera||!this.renderer)return;const n=(t=ak[e])==null?void 0:t.value;yI.to(this.camera.position,{duration:1,ease:"sine.inOut",x:n.x,y:n.y,z:n.z})}setupAndRenderScene(){if(!this.camera||!this.renderer)return;this.scene.add(this.camera);const e=new d8(16777215,16777215,2);e.color.setHSL(.6,1,.6),e.groundColor.setHSL(.095,1,.75),e.position.set(0,50,0),this.scene.add(e);const t=new $2(16777215,1.5);t.color.setHSL(.1,1,.95),t.position.set(-1,1.75,1),t.position.multiplyScalar(30),this.scene.add(t);const n=new b8(this.camera,this.canvas);n.target.set(.003059340956040225,-.13425621157020154,-.2564218846390263),this.renderer.getSize(new Ge),Bo?(this.camera.position.set(4.7,1.9,7.5),n.minDistance=2.5,n.maxDistance=11,n.rotateSpeed=.8):(this.camera.position.set(1.8,.65,2.5),n.minDistance=1.5,n.maxDistance=5,n.rotateSpeed=.5),n.enableDamping=!0,n.dampingFactor=.2,n.enablePan=!0,n.minPolarAngle=-Math.PI*5/36,n.maxPolarAngle=Math.PI*3/5,n.update(),this.renderer.toneMapping=lA,this.renderer.toneMappingExposure=1.2,this.renderer.setClearColor(15724527),this.renderer.outputColorSpace=kr;const i=2.5,s=2.5,o=.4,c={shadow:{blur:.6,darkness:1,opacity:.6},plane:{color:"#ffffff",opacity:1},showWireframe:!1},h=new aa;h.position.y=-.315,this.scene.add(h);const u=new Mi(256,256);u.texture.generateMipmaps=!1;const d=new Mi(256,256);d.texture.generateMipmaps=!1;const A=new du(i,s).rotateX(Math.PI/2),p=new Es({map:u.texture,opacity:c.shadow.opacity,transparent:!0,depthWrite:!1}),g=new Wr(A,p);g.renderOrder=1,h.add(g),g.scale.y=-1;const v=new Wr(A);v.visible=!1,h.add(v);const E=new fu(-i/2,i/2,s/2,-s/2,0,o);E.rotation.x=Math.PI/2,h.add(E);const m=new M2;m.userData.darkness={value:c.shadow.darkness},m.onBeforeCompile=L=>{const P=L;P.uniforms.darkness=m.userData.darkness,P.fragmentShader=`
4463
4463
  uniform float darkness;
4464
4464
  ${L.fragmentShader.replace("gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );","gl_FragColor = vec4( vec3( 0.0 ), ( 1.0 - fragCoordZ ) * darkness );")}
4465
- `},m.depthTest=!1,m.depthWrite=!1;const _=new vn(NN);_.depthTest=!1;const w=new vn(UN);w.depthTest=!1;function x(L,P){v.visible=!0,v.material=_,v.material.uniforms.tDiffuse.value=u.texture,_.uniforms.h.value=L*1/256,P.setRenderTarget(d),P.render(v,E),v.material=w,v.material.uniforms.tDiffuse.value=d.texture,w.uniforms.v.value=L*1/256,P.setRenderTarget(u),P.render(v,E),v.visible=!1}E.far=.125,I();function I(){E.updateProjectionMatrix()}const R=new DN,S=new LN(this.scene,this.camera);S.clearAlpha=0;const T=this.renderer.getDrawingBufferSize(new Ge),D=new Mi(T.width,T.height,{samples:4,type:_n}),b=new bN(this.renderer,D);b.addPass(S),b.addPass(R);const M=()=>{var L;n.update(),this.resizeRenderer()&&(this.camera.aspect=this.canvas.clientWidth/this.canvas.clientHeight,(L=this.camera)==null||L.updateProjectionMatrix());const P=this.scene.background;if(this.scene.background=null,this.scene.overrideMaterial=m,!this.renderer||!this.camera)return;const N=this.renderer.getClearAlpha();this.renderer.setClearAlpha(0),this.renderer.clear(),this.renderer.setRenderTarget(u),this.renderer.render(this.scene,E),this.scene.overrideMaterial=null,x(c.shadow.blur,this.renderer),x(c.shadow.blur*.4,this.renderer),this.renderer.setRenderTarget(null),this.renderer.setClearAlpha(N),this.scene.background=P,Ds.uniforms.viewMatrixInverse.value=this.camera.matrixWorld,Ds.uniforms.projectionMatrixInverse.value=this.camera.projectionMatrixInverse,requestAnimationFrame(M),b.render()};M()}loadModelInsideScene(e){this.scene.traverse(t=>{t.name=="Scene"&&(this.scene.remove(t),t.traverse(n=>{n instanceof Wr&&(n.geometry.dispose(),n.material.dispose())}))}),this.scene.add(e)}}class uk{constructor(){kt(this,"customRenderer"),this.customRenderer=new ck}async Init(){this.customRenderer.isInitialised||(await this.customRenderer.intialize(),this.customRenderer.setupAndRenderScene())}loadFirstFrame(e,t,n){return new Promise((i,s)=>{this.customRenderer.loadFirstFrame(e,t,n).then(()=>{i(1)}).catch(o=>{s(o)})})}changeFrame(e,t,n){return this.customRenderer.changeFrame(e,t,n)}changeLens(e,t,n,i){return this.customRenderer.changeLens(e,t,n,i)}changeOrbital(e){return this.customRenderer.changeOrbital(e)}snapCamToPos(e){this.customRenderer.snapCamToPos(e)}}class II{constructor(e){kt(this,"orgId"),kt(this,"rendererService"),kt(this,"isLoading",!1),kt(this,"userContainerId"),kt(this,"containerElement",null),kt(this,"defaultSelectorId","dita-3dconfig-element"),kt(this,"defaultCanvasStyle",{width:"100%",height:"100%"}),kt(this,"customisationArr",[]),kt(this,"assetDetails",null),this.userContainerId=e.userContainerId,this.rendererService=new uk,this.orgId=e.orgId}prepareDOM(){const e=this.userContainerId??this.defaultSelectorId,t=document.getElementById(e);if(!t)throw new Error(`Container not found to embed 3d-configurator ${this.defaultSelectorId}`);this.containerElement=t;const n=document.createElement("canvas");return n.className="sprie-config-webgl",t.innerHTML="",t.appendChild(n),Object.assign(n.style,this.defaultCanvasStyle),!0}snapCameraToPos(e){this.rendererService.snapCamToPos(e)}async loadFrame(e){return this.assetDetails=e.data.assetDetails,this.customisationArr=e.data.customisation,this.prepareDOM(),await this.rendererService.Init(),await this.rendererService.loadFirstFrame(this.orgId,this.assetDetails,this.customisationArr),this}changeFrame(e,t){return this.rendererService.changeFrame(this.orgId,e,t)}changeLens(e,t,n){return this.rendererService.changeLens(e,this.orgId,t,n)}changeOrbital(e){return this.rendererService.changeOrbital(e)}unmount(){this.containerElement&&(this.containerElement.innerHTML="",this.containerElement.style.height="0px",this.containerElement.style.width="auto")}}class CI{constructor(){kt(this,"events"),kt(this,"authService"),kt(this,"instanceArr"),this.authService=new BM,this.events=new OM,this.instanceArr=[]}async Init(e){await this.authService.Init(e),Bc.setJWT(this.authService.authPayload.JWT)}async loadBySKU(e){const t=await Cp.FetchAssetBySKUOrBarcode({sku:e.SKU,barcode:null});return await this.renderAsset({data:{assetDetails:t,customisation:t.customisation}})}async renderAsset(e){return new II({orgId:this.authService.authPayload.ORGID,userContainerId:e.containerId}).loadFrame({containerId:e.containerId,data:{assetDetails:e.data.assetDetails,customisation:e.data.customisation}})}async getInstance(e){return new II({orgId:this.authService.authPayload.ORGID,userContainerId:e.containerId})}}window.ThreeDConfigurator=CI;const RQ="",DQ="";function hk({frameList:r,selectedFrame:e,modelLoading:t,onChangeFrame:n}){const i=window.innerWidth<=576;return Te.jsx("div",{className:"sprie-config-palette",style:{padding:"0 4rem 1.6rem 4rem",marginTop:i?"1rem":"0"},children:r==null?void 0:r.map(s=>Te.jsxs("div",{className:"sprie-config-palette-img-box",children:[Te.jsx("button",{style:{border:"0",cursor:t?"default":"pointer",width:i?45:60,height:i?45:60},onClick:()=>n(s),disabled:t,children:Te.jsx("img",{src:s.variantImage,alt:s.name+"image",className:`sprie-config-image ${i?"mobile-view":""}`,style:{transform:(e==null?void 0:e._id)===s._id?"scale(1.2,1.2)":"scale(1,1)"}})}),(e==null?void 0:e._id)===s._id&&Te.jsx("p",{className:"sprie-config-palette-img-text",children:Te.jsx("span",{className:"sprie-config-palette-imgName",children:s.name})})]},s._id))})}function dk({lensList:r,selectedLens:e,selectedDitaLens:t,modelLoading:n,onChangeLens:i}){const s=window.innerWidth<=576;return Te.jsx("div",{className:"sprie-config-palette",style:{padding:"0 1.2rem 1.6rem 1.2rem",marginTop:s?"1rem":"0",gap:s?".3rem":"1rem"},children:r==null?void 0:r.map(o=>Te.jsxs("div",{className:"sprie-config-palette-img-box",children:[Te.jsx("button",{style:{border:"0",cursor:n?"default":"pointer",width:s?45:60,height:s?45:60},onClick:()=>i(o),disabled:n,children:Te.jsx("img",{src:o.thumbnail,alt:o.name+"image",className:`sprie-config-image ${s?"mobile-view":""}`,style:{border:(e==null?void 0:e._id)===o._id?"1px solid #9d9b9c":"0",borderRadius:"50%",padding:"1px"}})}),(e==null?void 0:e._id)===o._id&&Te.jsxs("p",{className:"sprie-config-palette-img-text",style:{bottom:"-1.2rem",textAlign:"center"},children:[Te.jsx("span",{className:"sprie-config-palette-imgName",children:`${o.name}`}),Te.jsx("span",{className:"sprie-config-price-tag",children:(t==null?void 0:t.variantId)==0?"":` (+ ${t==null?void 0:t.variantPrice}.00 ${t==null?void 0:t.priceCurrency})`})]})]},o._id))})}const LQ="";function fk({heading:r,onEngravingLinkClicked:e,onChecked:t,onTextAdded:n}){const[i,s]=gt.useState(""),[o,c]=gt.useState(!1),[h,u]=gt.useState(!1),d=gt.useRef(null);return gt.useEffect(()=>{t(o),o&&d.current?(d.current.style.backgroundColor="#ffffff",d.current.focus()):!o&&d.current&&(d.current.style.backgroundColor="transparent",d.current.blur(),s(""))}),gt.useEffect(()=>{h&&i!=""&&n(i)},[h]),Te.jsxs("div",{className:"sprie-config-engraving-block",style:{marginTop:".5rem"},children:[Te.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".8rem"},children:[Te.jsx("input",{type:"checkbox",className:"sprie-config-engraving-checkbox",onChange:A=>{c(A.target.checked)},checked:o}),Te.jsxs("p",{style:{fontSize:".9rem",color:"#4d4d4d",fontWeight:"500",margin:"0"},children:["Add ","Laser Engraving"," ",Te.jsx("span",{style:{fontWeight:"400"},children:"(OPTIONAL)"})]})]}),Te.jsxs("div",{className:"sprie-config-engraving-inputField-block",children:[Te.jsx("input",{type:"text",ref:d,className:"sprie-config-engraving-inputField",placeholder:"ADD CUSTOM TEXT",value:i,onChange:A=>s(A.target.value),maxLength:15,style:{padding:"0.7rem"},disabled:!o,onBlur:A=>u(!0),onFocus:A=>u(!1)}),Te.jsx("span",{className:"sprie-config-engraving-inputInfo",children:`${i.length}/15 characters`}),Te.jsx("p",{onClick:e,className:"sprie-config-engraving-link",children:"About Custom Laser Engraving"})]})]})}const NQ="";function pk({totalSteps:r,currentStep:e}){const t=window.innerWidth<=576;return Te.jsx("div",{className:"step-tracker-block",style:{margin:t?"1rem 0":".7rem 0 1rem 0",paddingBottom:"1.5rem"},children:Te.jsx("div",{className:"step-tracker",children:Array.from({length:r}).map((n,i)=>Te.jsx("div",{className:`step-circle ${i+1===e?"active":""}`},i))})})}function Ak({nextSlide:r,previousSlide:e,currentIndex:t,stepsName:n,isLastStep:i}){return Te.jsxs("div",{className:"carousel-header",children:[Te.jsx("button",{className:"carousel-btn prev",onClick:e,style:{visibility:t!==0?"visible":"hidden"},children:Te.jsx("i",{className:"arrow left-arrow",style:{padding:".25rem"}})}),Te.jsxs("p",{children:[Te.jsx("span",{className:"step-syntax",children:`STEP ${t+1}: `}),Te.jsx("span",{className:"select-syntax",children:n[t]})]}),Te.jsx("button",{className:"carousel-btn next",onClick:r,style:{visibility:i?"hidden":"visible"},children:Te.jsx("i",{className:"arrow right-arrow",style:{padding:".25rem"}})})]})}function gk({setShowAddToCart:r,children:e}){var u;const[t,n]=gt.useState(0),i=Sh.Children.toArray(e),s=t===i.length-1,o=(u=i.map(d=>d))==null?void 0:u.map(d=>d.props.heading),c=()=>{n(d=>d===0?Sh.Children.count(e)-1:d-1)},h=()=>{n(d=>d===Sh.Children.count(e)-1?0:d+1)};return gt.useEffect(()=>{r(!!s)},[s]),Te.jsxs("div",{className:"carousel",children:[Te.jsx(Ak,{nextSlide:h,previousSlide:c,currentIndex:t,stepsName:o,isLastStep:s}),Te.jsx(pk,{totalSteps:o==null?void 0:o.length,currentStep:t+1}),Te.jsx("div",{className:"carousel-container",children:i.map((d,A)=>Te.jsx("div",{className:"carousel-item",style:{transform:`translateX(-${t*100}%)`},children:d},A))})]})}const UQ="";function MI({conditionRequired:r,onButtonClick:e}){const[t,n]=gt.useState(!1),i=gt.useRef(null),s=gt.useRef(null);return gt.useEffect(()=>{s.current&&(s.current.disabled=!t)},[t]),gt.useEffect(()=>{i.current&&(i.current.style.display=r?"flex":"none"),s.current&&(s.current.disabled=r)},[r]),Te.jsxs("div",{className:"sprie-config-add-to-cart-block",children:[Te.jsxs("label",{htmlFor:"Sprie-Config-return-policy-checkbox",id:"Sprie-Config-return-policy-label",ref:i,style:{display:"none"},children:[Te.jsx("input",{type:"checkbox",id:"Sprie-Config-return-policy-checkbox",name:"sprie-config-return-policy-checkbox",onChange:o=>n(o.target.checked),checked:t}),Te.jsxs("p",{children:["I agree this customized Item cannot be returned or exchanged.",Te.jsx("span",{style:{color:"red"},children:"*"})]})]}),Te.jsx("button",{className:"sprie-config-add-to-cart-btn",ref:s,onClick:e,children:"ADD TO CART"})]})}const Xn=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent);function mk({orbitalList:r,selectedOrbital:e,modelLoading:t,onChangeOrbital:n}){return Te.jsx("div",{className:"sprie-config-palette",style:{padding:"0 1.2rem 1.6rem 1.2rem",marginTop:Xn?"1rem":"0",gap:Xn?".3rem":"1rem"},children:r==null?void 0:r.map(i=>Te.jsxs("div",{className:"sprie-config-palette-img-box",children:[Te.jsx("button",{style:{border:"0",cursor:t?"default":"pointer",width:Xn?45:60,height:Xn?45:60},onClick:()=>n(i),disabled:t,children:Te.jsx("img",{src:i.thumbnail,alt:i.name+"image",className:`sprie-config-image ${Xn?"mobile-view":""}`,style:{border:(e==null?void 0:e._id)===i._id?"1px solid #9d9b9c":"0",borderRadius:"50%",padding:"1px"}})}),(e==null?void 0:e._id)===i._id&&Te.jsx("p",{className:"sprie-config-palette-img-text",style:{bottom:"-1.5rem"},children:Te.jsx("span",{className:"sprie-config-palette-imgName",children:i.name})})]},i._id))})}const _k="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIKICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiB3aWR0aD0iMzIwLjAwMDAwMHB0IiBoZWlnaHQ9IjY2LjAwMDAwMHB0IiB2aWV3Qm94PSIwIDAgMzIwLjAwMDAwMCA2Ni4wMDAwMDAiCiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCBtZWV0Ij4KCjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAuMDAwMDAwLDY2LjAwMDAwMCkgc2NhbGUoMC4xMDAwMDAsLTAuMTAwMDAwKSIKZmlsbD0iIzAwMDAwMCIgc3Ryb2tlPSJub25lIj4KPHBhdGggZD0iTTAgNjUxIGMwIC02IDkgLTExIDIxIC0xMSAxMSAwIDI5IC01IDQwIC0xMCAxOCAtMTAgMTkgLTI0IDE5IC0zMDAKMCAtMjc2IC0xIC0yOTAgLTE5IC0zMDAgLTExIC01IC0yOSAtMTAgLTQwIC0xMCAtMTIgMCAtMjEgLTQgLTIxIC0xMCAwIC0xNAo0NDUgLTEzIDUxMiAxIDEwNyAyMyAxOTAgODUgMjM5IDE3OSAyMCAzNyAyNCA2MCAyNCAxMzUgMCA3OCAtNCA5NyAtMjggMTQ3Ci0zNCA3MCAtMTAwIDEzMCAtMTc2IDE2MCAtNTIgMjEgLTc1IDIzIC0zMTMgMjYgLTE4MCAyIC0yNTggMCAtMjU4IC03eiBtNDcwCi0zNiBjMTUgLTggMzggLTI3IDQ5IC00MSAyMCAtMjUgMjEgLTM5IDIxIC0yMzggMCAtMTk0IC0yIC0yMTQgLTIwIC0yNDQgLTExCi0xOCAtMzYgLTQwIC01NSAtNDggLTQ2IC0xOSAtMTM1IC0xOCAtMTYzIDIgLTIyIDE1IC0yMiAxNyAtMjIgMzAwIGwwIDI4NCA4MAowIGM1MiAwIDkxIC01IDExMCAtMTV6Ii8+CjxwYXRoIGQ9Ik05ODAgNjUwIGMwIC01IDExIC0xMCAyNCAtMTAgNTUgMCA1NiAtNyA1NiAtMzEwIDAgLTMwMyAtMSAtMzEwIC01NgotMzEwIC0xMyAwIC0yNCAtNCAtMjQgLTEwIDAgLTYgNjcgLTEwIDE4MCAtMTAgMTEzIDAgMTgwIDQgMTgwIDEwIDAgNiAtMTEgMTAKLTIzIDEwIC0xMyAwIC0zMSA4IC00MCAxOCAtMTUgMTYgLTE3IDUyIC0xNyAyOTQgMCAyNTQgMSAyNzYgMTggMjkxIDEwIDEwIDI4CjE3IDQwIDE3IDEyIDAgMjIgNSAyMiAxMCAwIDYgLTY3IDEwIC0xODAgMTAgLTExMyAwIC0xODAgLTQgLTE4MCAtMTB6Ii8+CjxwYXRoIGQ9Ik0xNTI2IDYwMSBjLTI1IC0zMyAtNDYgLTY0IC00NiAtNzAgMCAtNiAyNCA1IDU0IDI0IDUzIDM0IDE1OSA3NQoxOTQgNzUgMTAgMCAyOCAtMTAgNDAgLTIzIDIxIC0yMyAyMiAtMzAgMjIgLTI4OSAwIC0yODkgLTIgLTI5OCAtNTYgLTI5OCAtMTMKMCAtMjQgLTQgLTI0IC0xMCAwIC02IDY3IC0xMCAxODAgLTEwIDExMyAwIDE4MCA0IDE4MCAxMCAwIDYgLTExIDEwIC0yNCAxMAotNTQgMCAtNTYgOSAtNTYgMjk0IDAgMjUxIDEgMjY1IDIxIDI5MCAxMSAxNCAzMCAyNiA0MiAyNiAzNyAtMSAxNTMgLTQ2IDIwMQotNzggMjUgLTE3IDQ2IC0yNyA0NiAtMjEgMCA2IC0yMSAzNyAtNDYgNzAgbC00NyA1OSAtMzE3IDAgLTMxNyAwIC00NyAtNTl6Ii8+CjxwYXRoIGQ9Ik0yNDU1IDY1MCBjMyAtNSAxNSAtMTAgMjYgLTEwIDMwIDAgNjUgLTI3IDk3IC03NiBsMjkgLTQzIC05MCAtMTc4CmMtMTM2IC0yNzAgLTE2MyAtMzEzIC0xOTggLTMyMCAtNTkgLTExIC0yNiAtMjMgNjYgLTIzIDg5IDAgMTIxIDExIDc1IDI1IC0yOQo5IC0yNiA1NSAxMCAxMjYgbDMxIDYwIDE1MSAtMyAxNTEgLTMgMzkgLTczIGMzMCAtNTkgMzYgLTc3IDI4IC05MyAtNiAtMTAKLTIwIC0xOSAtMzAgLTE5IC0xMSAwIC0yMCAtNCAtMjAgLTEwIDAgLTYgNzAgLTEwIDE5MCAtMTAgMTIwIDAgMTkwIDQgMTkwIDEwCjAgNiAtMTEgMTAgLTI0IDEwIC0xNCAwIC0zNiAxMCAtNTAgMjMgLTE1IDEyIC0xMDYgMTU1IC0yMDQgMzE3IGwtMTc3IDI5NQotMTQ4IDMgYy0xMDAgMiAtMTQ2IC0xIC0xNDIgLTh6IG0yNTggLTM5OCBjLTM1IC0yIC05MiAtMiAtMTI3IDAgbC02NCAzIDYwCjExMyA2MCAxMTMgNjcgLTExMyA2NyAtMTEzIC02MyAtM3oiLz4KPC9nPgo8L3N2Zz4K",vk="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI4LjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA4ODYgNjk4IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA4ODYgNjk4OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGw6IzkxODQ3RTt9Cjwvc3R5bGU+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik04NDAuMDEsNDEuMDFjLTM2LjcxLTMxLjU2LTEwOC45NC01Ny45Ny0yNDQuNi00LjU2Yy0yMC40Nyw4LjA2LTQxLjQ2LDE3LjU3LTYyLjc1LDI4LjM2CgljMTkuMzgtNC42Niw0MzEuNTItMTAxLDE3NS42MSwxOTkuNDJsLTAuMDQsMGMtMjUuODUsMzUuNS01Ny44Miw3Mi4wOC05NC40MiwxMDcuOTdsLTMyLjcyLTI4LjE0bC02LjQ0LDE0MS43NmwxNjQuODQtNS41NwoJbC00NC4zNC0zOC4xMmM2NS41NC02My43NCwxMTcuODUtMTI5Ljk0LDE1MC4yMi0xOTAuNzdDOTA3LjQ0LDEzNC42OSw4NzYuNzEsNzIuNTcsODQwLjAxLDQxLjAxeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNTYyLjE3LDQyNS42N2MtNjQuNDcsNDYuMi0xMzIuNjcsODYuMjItMTk4LjQzLDExNi43NmMtMC4wOSwwLjA0LTAuMTcsMC4wOC0wLjI1LDAuMTMKCUMtMTkuMjcsNzMwLjcyLDczLjg2LDQ0MS4xMyw4OC4wNyw0MDEuNDVsLTIuMDktMS41MWMtMTQuNjcsMTcuOTMtMjcuNiwzNS42MS0zOC41Myw1Mi44NEMtMjQuNCw1NjYsMTEuMTYsNjI2LjI3LDUzLjY0LDY1Ni44OQoJYzQyLjQ4LDMwLjYzLDEyNi4wNyw1Ni4yNSwyODMuMDUsNC40M2M5OS0zMi42OSwyMDguNTgtODkuNywzMTAuMDYtMTYxLjE5bC04My43Ny0wLjQ2TDU2Mi4xNyw0MjUuNjd6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0yMTIuOSwxOTcuNzRjMCwzNS41NC0yNS43Myw1Mi44MS00MS45OCw1Mi44MXYxLjAxYzIwLjY1LDAsNDYuMzcsMTUuOTEsNDYuMzcsNTEuNDUKCWMwLDM3LjkxLTM0LjE5LDYzLjk4LTgzLjYxLDYzLjk4Yy00My42NywwLTcxLjA5LTE3LjI3LTgzLjk1LTU0Ljg0bDQyLjMxLTE4Ljk2YzQuNzQsMjQuMzcsMTcuMjYsMzYuMjIsNDEuOTgsMzYuMjIKCWMyMy43LDAsMzcuOTEtMTIuODcsMzcuNTctMzIuNWMtMC4zNC0yMC45OS0xMy4yLTI4Ljc4LTM5Ljk0LTI4Ljc4aC0xMS4xN3YtMzIuNWg5LjQ4YzI0LjM3LDAsMzYuNTYtOS44MiwzNi41Ni0yOS43OQoJYzAuMzQtMjAuNjUtMTEuNTEtMzEuNDgtMzEuODItMzEuNDhjLTIwLjY1LDAtMzMuODUsMTAuODMtMzYuOSwzMS44MmwtNDEuNjQtMTUuMjNjOC44LTM2LjksNDAuNjItNTQuMTYsODAuNTYtNTQuMTYKCUMxODUuODIsMTM2LjgxLDIxMi45LDE2Mi41NCwyMTIuOSwxOTcuNzR6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0zOTYuOTgsMTg1LjU2bC0zOS4yNywxOC4yOGMtNS40Mi0xNy42LTE3LjI2LTI4LjQzLTM4LjkzLTI4LjQzYy0yOC43OCwwLTQ5LjA4LDMwLjgtNDkuMDgsNzYuMTZ2NS43NmgxLjAxCgljNy40NS0yMy4wMiwzMS4xNC0zMy41MSw1Ni44Ny0zMy41MWM0Mi45OSwwLDczLjEyLDI3LjQyLDczLjEyLDcwLjQxYzAsNDQuMzQtMzAuOCw3Mi43OC04Mi42LDcyLjc4CgljLTU4LjIzLDAtOTAuMzgtNDIuOTktOTAuMzgtMTE1LjA5YzAtNzcuNTIsNDAuNjItMTE1LjA5LDk0LjExLTExNS4wOUMzNTcuNzEsMTM2LjgxLDM4NC4xMiwxNTAuMzUsMzk2Ljk4LDE4NS41NnogTTI4MC41MywyOTMuNTQKCWMwLDIyLjM0LDE1LjIzLDM2LjIyLDM4LjI1LDM2LjIyYzI0LjAzLDAsMzcuOTEtMTMuMiwzNy45MS0zNi4yMmMwLTIyLTEzLjg4LTM1LjU0LTM3LjkxLTM1LjU0CglDMjk1Ljc2LDI1OCwyODAuNTMsMjcyLjIyLDI4MC41MywyOTMuNTR6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MTQuNzgsMjUxLjkxYzAtNzUuNDksMzAuMTMtMTE1LjA5LDg5LjM3LTExNS4wOXM4OS4zNywzOS42LDg5LjM3LDExNS4wOVM1NjMuMzgsMzY3LDUwNC4xNSwzNjcKCVM0MTQuNzgsMzI3LjM5LDQxNC43OCwyNTEuOTF6IE01NDYuOCwyNTEuOTFjMC01My4xNS0xMy44OC03Ny41Mi00Mi42NS03Ny41MmMtMjguNzcsMC00Mi42NSwyNC4zNy00Mi42NSw3Ny41MgoJYzAsNTMuMTUsMTMuODgsNzcuNTIsNDIuNjUsNzcuNTJDNTMyLjkyLDMyOS40Myw1NDYuOCwzMDUuMDUsNTQ2LjgsMjUxLjkxeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNTg4LjIsMTI4LjEzYzAtMTguNjMsMTMuNzgtMzIuMDIsMzIuOTktMzIuMDJjMTkuMjEsMCwzMi45OSwxMy4zOSwzMi45OSwzMi4wMnMtMTMuNzgsMzIuMDItMzIuOTksMzIuMDIKCUM2MDEuOTcsMTYwLjE0LDU4OC4yLDE0Ni43Niw1ODguMiwxMjguMTN6IE02NDAuNTksMTI4LjEzYzAtMTEuMjUtOC4xNS0xOS40LTE5LjQtMTkuNHMtMTkuNCw4LjE1LTE5LjQsMTkuNHM4LjE1LDE5LjQsMTkuNCwxOS40CglTNjQwLjU5LDEzOS4zOCw2NDAuNTksMTI4LjEzeiIvPgo8L3N2Zz4K",yk="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciICB2aWV3Qm94PSIwIDAgNjQgNjQiIHdpZHRoPSI0OHB4IiBoZWlnaHQ9IjQ4cHgiPjxwYXRoIGQ9Ik0gMTYgMTQgQyAxNS40ODggMTQgMTQuOTc2OTM4IDE0LjE5NDkzNyAxNC41ODU5MzggMTQuNTg1OTM4IEMgMTMuODA0OTM3IDE1LjM2NjkzNyAxMy44MDQ5MzcgMTYuNjMzMDYzIDE0LjU4NTkzOCAxNy40MTQwNjIgTCAyOS4xNzE4NzUgMzIgTCAxNC41ODU5MzggNDYuNTg1OTM4IEMgMTMuODA0OTM4IDQ3LjM2NjkzOCAxMy44MDQ5MzcgNDguNjMzMDYzIDE0LjU4NTkzOCA0OS40MTQwNjIgQyAxNC45NzY5MzcgNDkuODA1MDYyIDE1LjQ4OCA1MCAxNiA1MCBDIDE2LjUxMiA1MCAxNy4wMjMwNjIgNDkuODA1MDYyIDE3LjQxNDA2MiA0OS40MTQwNjIgTCAzMiAzNC44MjgxMjUgTCA0Ni41ODU5MzggNDkuNDE0MDYyIEMgNDcuMzY2OTM4IDUwLjE5NTA2MyA0OC42MzMwNjMgNTAuMTk1MDYyIDQ5LjQxNDA2MiA0OS40MTQwNjIgQyA1MC4xOTUwNjMgNDguNjMzMDYyIDUwLjE5NTA2MiA0Ny4zNjY5MzcgNDkuNDE0MDYyIDQ2LjU4NTkzOCBMIDM0LjgyODEyNSAzMiBMIDQ5LjQxNDA2MiAxNy40MTQwNjIgQyA1MC4xOTUwNjMgMTYuNjMzMDYzIDUwLjE5NTA2MiAxNS4zNjY5MzggNDkuNDE0MDYyIDE0LjU4NTkzOCBDIDQ4LjYzMzA2MiAxMy44MDQ5MzggNDcuMzY2OTM3IDEzLjgwNDkzOCA0Ni41ODU5MzggMTQuNTg1OTM4IEwgMzIgMjkuMTcxODc1IEwgMTcuNDE0MDYyIDE0LjU4NTkzOCBDIDE3LjAyMzA2MiAxNC4xOTQ5MzggMTYuNTEyIDE0IDE2IDE0IHoiLz48L3N2Zz4=";var vf=(r=>(r.Front="Front",r.Back="Back",r.Left="Left",r.Right="Right",r.Top="Top",r.Bottom="Bottom",r))(vf||{});const PQ="";function Ek({snapCameraTo:r}){const e=Object.keys(vf).map(s=>({label:vf[s],isDisabled:!0})),[t,n]=gt.useState(),i=s=>{n(s),r(s)};return Te.jsx("div",{className:"sprie-3d-snap-button-block",children:e.map((s,o)=>Te.jsx("button",{className:"sprie-3d-snap-button",style:{backgroundColor:t!==s.label?"#ccc":"#000",color:t!==s.label?"#f3f3f3":"#fff"},onClick:()=>{i(vf[s.label])},children:s.label},o))})}function xk({frameName:r,customEvent:e,apiService:t,frameList:n,lensList:i,orbitalList:s,showOrbitalList:o,viewerOnly:c,domService:h,ThreeDConfigurator:u,dataVariants:d,dataLenses:A,dataOrbitals:p,firstDitaVariant:g}){var k;const[v,E]=gt.useState(),[m,_]=gt.useState(),[w,x]=gt.useState(),[I,R]=gt.useState(!1),[S,T]=gt.useState(!1),[D,b]=gt.useState(Xn?S?35:30:S?28:25),[M,L]=gt.useState(Xn?10:8);gt.useState(60);const[P,N]=gt.useState(),[j,X]=gt.useState(),[K,ne]=gt.useState(),[V,te]=gt.useState(!1),[Q,z]=gt.useState("placeholder"),Z=gt.useRef(null);(k=Z.current)==null||k.clientHeight;const re=gt.useRef();re.current=h;const H={variantId:0,variantName:"defaultName",variantPrice:0,priceCurrency:"defaultCurrency",varinatSku:"lens-default"},fe={variantId:0,variantName:"defaultName",variantPrice:0,priceCurrency:"defaultCurrency",varinatSku:"orbital-default"},Ae=ee=>{re.current&&re.current.snapCameraToPos(ee)},ve=async(ee,ue)=>{ee._id===(v==null?void 0:v._id)&&!ue||re.current&&(R(!0),re.current.changeFrame(ee,[m,w]).then(()=>{R(!1)}),E(ee),N(d==null?void 0:d.find(pe=>pe.varinatSku==ee.sku)),(v==null?void 0:v.name.toLowerCase())!=="default"&&(m==null?void 0:m.name.toLowerCase())!=="default"&&(K==null||K.variantName.toLowerCase()))},ye=ee=>ee==null?void 0:ee.customisation.find(pe=>pe.type=="Lens"),Oe=async ee=>{if(!re.current||ee==m)return;const ue=ee.sku=="lens-default",pe=ye(v),ge=rt();!pe&&ue?(R(!0),re.current.changeLens([ee,w],!0,v).then(()=>{R(!1)})):!pe&&!ue?(m==null?void 0:m.sku)=="lens-default"?(R(!0),re.current.changeLens([ee,w],!0,v).then(()=>{R(!1)})):re.current.changeLens([ee,w],!1,v):pe&&ue?re.current.changeLens([pe,w],!1,v):re.current.changeLens([ee,w],!1,v),ee.sku=="lens-default"?X(H):X(A==null?void 0:A.find(Ue=>{var Ee;return Ue.variantId==Number((Ee=ee.metadata.find(Qe=>Qe.key==ge))==null?void 0:Ee.value)?Ue:null})),_(ee),(v==null?void 0:v.name.toLowerCase())!=="default"&&(m==null?void 0:m.name.toLowerCase())!=="default"&&(K==null||K.variantName.toLowerCase())},it=async ee=>{re.current&&ee!=w&&(R(!0),await re.current.changeOrbital(ee).then(()=>{ne(p==null?void 0:p.find(ue=>ue.variantId==Number(ee.sku))),R(!1)}),x(ee),(v==null?void 0:v.name.toLowerCase())!=="default"&&(m==null?void 0:m.name.toLowerCase())!=="default"&&(K==null||K.variantName.toLowerCase()))},ae=()=>(P==null?void 0:P.variantPrice)+((j==null?void 0:j.varinatSku)!=="lens-default"?j==null?void 0:j.variantPrice:0),rt=()=>{var pe;const ee=(pe=v.metadata.find(ge=>ge.key=="baseCurve"))==null?void 0:pe.value;let ue="variantId";return ee=="2B"?ue="2bVariantId":ee=="6B"&&(ue="6bVariantId"),ue},Pe=ee=>{te(ee)},lt=ee=>{z(ee)},Ye=()=>{var ee,ue;Xn?(ee=document.querySelector('[id$="main-laser-etch-popover"]'))==null||ee.setAttribute("open",""):(ue=document.querySelector('[id$="main-laser-etch-drawer"]'))==null||ue.setAttribute("open","")},ct=()=>{if(v&&m&&K&&!(v.name.toLowerCase().includes("default")||m.name.toLowerCase().includes("default")||K.variantName.toLowerCase().includes("default"))){const ee=v.metadata.find(Se=>Se.key=="variantId"),ue=v.metadata.find(Se=>Se.key=="baseCurve");let pe="variantId";ue&&ue.value=="2B"?pe="2bVariantId":ue&&ue.value=="6B"&&(pe="6bVariantId");const ge=m.metadata.find(Se=>Se.key==pe),Ue=ee?Number(ee.value):null,Ee=ge?Number(ge.value):null,Qe=K!=null&&K.variantId?Number(K.variantId):null,He={frameIdentifier:Ue,lensIdentifier:Ee,orbitalIdentifier:Qe};e.emitEvent("onAddToCart",He);const Ce=[];if(Ee&&ge){const Se={id:Ee,quantity:1,properties:null};Ce.push(Se)}if(Qe&&(K!=null&&K.variantId)){const Se={id:Qe,quantity:1,properties:null};Ce.push(Se)}if(V){const Se={id:44745490890985,quantity:1,properties:null};Ce.push(Se)}if(ee){const Se={id:Ue,quantity:1,properties:V?{customText:Q}:null};Ce.push(Se)}t.HandleShopifyAddToCart(Ce)}},Y=()=>{var ee,ue;Xn?(ee=document.querySelector(".popover.hidden-lap-and-up.popover-full"))==null||ee.removeAttribute("open"):(ue=document.querySelector(".drawer.drawer--full.hidden-phone.lens-customizer"))==null||ue.removeAttribute("open")};return gt.useEffect(()=>{b(Xn?S?35:30:S?28:25)},[S]),gt.useEffect(()=>{n&&E(n[0]),i&&_(i[0]),s&&x(s[0])},[n,i,s]),gt.useEffect(()=>{N(g),X(H),ne(fe)},[g]),gt.useEffect(()=>{},[V,Q]),Te.jsxs("section",{id:"sprie-config-main-container",ref:Z,children:[Te.jsxs("header",{id:"sprie-config-main-header",style:{height:`${M}%`},children:[Te.jsxs("div",{id:"sprie-config-header-content",children:[Te.jsx("img",{src:_k,alt:"dita-logo",width:97,height:20}),Te.jsxs("p",{style:{margin:"0"},className:"sprie-config-mainHeader-frameName",children:[r," CUSTOMIZER"]})]}),Te.jsx("button",{className:"sprie-config-main-header-close",onClick:Y,children:Te.jsx("img",{src:yk,alt:"close",style:{width:"2rem",height:"2rem"}})})]}),Te.jsxs("section",{id:"sprie-config-viewer-container",style:{height:`${100-(D+M)}%`},children:[Te.jsx("img",{src:vk,alt:"360deg-logo",width:44,height:34}),Te.jsx(Ek,{snapCameraTo:Ae}),I&&Te.jsx("div",{className:"sprie-config-loadingFrame",children:Te.jsx("div",{className:"sprie-config-loader"})}),Te.jsx("div",{style:{width:"100%",height:"100%"},id:"holder-canvas"})]}),Te.jsxs("section",{id:"Sprie-config-Customisation-block",style:{paddingTop:"1.5rem",height:`${D}%`},children:[Te.jsxs("div",{className:"sprie-config-price-block",children:[Te.jsx("p",{id:"sprie-config-price-text",style:{bottom:Xn?"100%":"",margin:"0 0.8rem 0.5rem 0"},children:`${ae()}.00 ${P==null?void 0:P.priceCurrency} `}),!Xn&&S&&Te.jsx(MI,{conditionRequired:!0,onButtonClick:ct}),S&&Te.jsx("p",{id:"sprie-config-process-time-text",style:{fontSize:".9rem",textAlign:"right",marginTop:"0",marginBottom:"0.5rem"},children:"Please Allow 7-10 Days for Customization Process."})]}),Te.jsxs(gk,{setShowAddToCart:T,children:[Te.jsx(hk,{modelLoading:I,frameList:n,selectedFrame:v,onChangeFrame:ve,heading:"SELECT FRAME"}),o&&Te.jsx(mk,{orbitalList:s,selectedOrbital:w,modelLoading:I,onChangeOrbital:it,heading:"SELECT ORBITAL"}),Te.jsx(dk,{modelLoading:I,lensList:i,selectedLens:m,selectedDitaLens:j,onChangeLens:Oe,heading:"SELECT LENS COLOR"}),Te.jsx(fk,{heading:"LASER ENGRAVING",onEngravingLinkClicked:Ye,onChecked:Pe,onTextAdded:lt})]}),Xn&&S&&Te.jsx("div",{style:{position:"absolute",bottom:"0%",width:"100%"},children:Te.jsx(MI,{conditionRequired:!0,onButtonClick:ct})})]})]})}function wk({apiService:r,sku:e,events:t,viewerOnly:n=!1}){var A;const i=gt.useRef(),[s,o]=gt.useState(null),c=(s==null?void 0:s.frameName)||"",h=(s==null?void 0:s.frameList)||null,u=(s==null?void 0:s.lensList)||null,d=(s==null?void 0:s.orbitalList)||null;return s!=null&&s.dataVariants,s!=null&&s.dataLenses,s!=null&&s.dataOrbitals,gt.useEffect(()=>((async()=>{var m,_;i.current=new CI,await((m=i.current)==null?void 0:m.Init(r.apiKey));const p=await r.FetchAssetBySKUOrBarcode({sku:e,barcode:null}),g=await r.FetchCustomisationList("Lens"),v=await r.FetchCustomisationList("Orbital"),E=await i.current.getInstance({containerId:"holder-canvas"});await E.loadFrame({containerId:"holder-canvas",data:{assetDetails:p,customisation:p==null?void 0:p.customisation}}),o({frameList:p==null?void 0:p.variants,lensList:g==null?void 0:g.data,orbitalList:v==null?void 0:v.data,frameName:p==null?void 0:p.group.name,showOrbitals:((_=p==null?void 0:p.customisation)==null?void 0:_.filter(w=>w.type==="Orbital").length)>0,domService:E,dataVariants:await r.PopulateDataList("data-variants"),dataLenses:await r.PopulateDataList("data-lenses"),dataOrbitals:await r.PopulateDataList("data-orbital")})})(),()=>{i.current=void 0}),[r,e]),Te.jsxs(Te.Fragment,{children:[(!h||!u)&&Te.jsx("div",{className:"sprie-config-loadingBox",children:"Loading..."}),Te.jsx(xk,{customEvent:t,frameName:c,apiService:r,frameList:h,lensList:u,orbitalList:d,showOrbitalList:(s==null?void 0:s.showOrbitals)||!1,viewerOnly:n,ThreeDConfigurator:i.current,domService:s==null?void 0:s.domService,dataVariants:s==null?void 0:s.dataVariants,dataLenses:s==null?void 0:s.dataLenses,dataOrbitals:s==null?void 0:s.dataOrbitals,firstDitaVariant:(A=s==null?void 0:s.dataVariants)==null?void 0:A.find(p=>p.varinatSku==e)})]})}var Hm={},SI={exports:{}},Sn={},Gm={exports:{}},Vm={};/**
4465
+ `},m.depthTest=!1,m.depthWrite=!1;const _=new vn(NN);_.depthTest=!1;const w=new vn(UN);w.depthTest=!1;function x(L,P){v.visible=!0,v.material=_,v.material.uniforms.tDiffuse.value=u.texture,_.uniforms.h.value=L*1/256,P.setRenderTarget(d),P.render(v,E),v.material=w,v.material.uniforms.tDiffuse.value=d.texture,w.uniforms.v.value=L*1/256,P.setRenderTarget(u),P.render(v,E),v.visible=!1}E.far=.125,I();function I(){E.updateProjectionMatrix()}const R=new DN,S=new LN(this.scene,this.camera);S.clearAlpha=0;const T=this.renderer.getDrawingBufferSize(new Ge),D=new Mi(T.width,T.height,{samples:4,type:_n}),b=new bN(this.renderer,D);b.addPass(S),b.addPass(R);const M=()=>{var L;n.update(),this.resizeRenderer()&&(this.camera.aspect=this.canvas.clientWidth/this.canvas.clientHeight,(L=this.camera)==null||L.updateProjectionMatrix());const P=this.scene.background;if(this.scene.background=null,this.scene.overrideMaterial=m,!this.renderer||!this.camera)return;const N=this.renderer.getClearAlpha();this.renderer.setClearAlpha(0),this.renderer.clear(),this.renderer.setRenderTarget(u),this.renderer.render(this.scene,E),this.scene.overrideMaterial=null,x(c.shadow.blur,this.renderer),x(c.shadow.blur*.4,this.renderer),this.renderer.setRenderTarget(null),this.renderer.setClearAlpha(N),this.scene.background=P,Ds.uniforms.viewMatrixInverse.value=this.camera.matrixWorld,Ds.uniforms.projectionMatrixInverse.value=this.camera.projectionMatrixInverse,requestAnimationFrame(M),b.render()};M()}loadModelInsideScene(e){this.scene.traverse(t=>{t.name=="Scene"&&(this.scene.remove(t),t.traverse(n=>{n instanceof Wr&&(n.geometry.dispose(),n.material.dispose())}))}),this.scene.add(e)}}class uk{constructor(){kt(this,"customRenderer"),this.customRenderer=new ck}async Init(){this.customRenderer.isInitialised||(await this.customRenderer.intialize(),this.customRenderer.setupAndRenderScene())}loadFirstFrame(e,t,n){return new Promise((i,s)=>{this.customRenderer.loadFirstFrame(e,t,n).then(()=>{i(1)}).catch(o=>{s(o)})})}changeFrame(e,t,n){return this.customRenderer.changeFrame(e,t,n)}changeLens(e,t,n,i){return this.customRenderer.changeLens(e,t,n,i)}changeOrbital(e){return this.customRenderer.changeOrbital(e)}snapCamToPos(e){this.customRenderer.snapCamToPos(e)}}class II{constructor(e){kt(this,"orgId"),kt(this,"rendererService"),kt(this,"isLoading",!1),kt(this,"userContainerId"),kt(this,"containerElement",null),kt(this,"defaultSelectorId","dita-3dconfig-element"),kt(this,"defaultCanvasStyle",{width:"100%",height:"100%"}),kt(this,"customisationArr",[]),kt(this,"assetDetails",null),this.userContainerId=e.userContainerId,this.rendererService=new uk,this.orgId=e.orgId}prepareDOM(){const e=this.userContainerId??this.defaultSelectorId,t=document.getElementById(e);if(!t)throw new Error(`Container not found to embed 3d-configurator ${this.defaultSelectorId}`);this.containerElement=t;const n=document.createElement("canvas");return n.className="sprie-config-webgl",t.innerHTML="",t.appendChild(n),Object.assign(n.style,this.defaultCanvasStyle),!0}snapCameraToPos(e){this.rendererService.snapCamToPos(e)}async loadFrame(e){return this.assetDetails=e.data.assetDetails,this.customisationArr=e.data.customisation,this.prepareDOM(),await this.rendererService.Init(),await this.rendererService.loadFirstFrame(this.orgId,this.assetDetails,this.customisationArr),this}changeFrame(e,t){return this.rendererService.changeFrame(this.orgId,e,t)}changeLens(e,t,n){return this.rendererService.changeLens(e,this.orgId,t,n)}changeOrbital(e){return this.rendererService.changeOrbital(e)}unmount(){this.containerElement&&(this.containerElement.innerHTML="",this.containerElement.style.height="0px",this.containerElement.style.width="auto")}}class CI{constructor(){kt(this,"events"),kt(this,"authService"),kt(this,"instanceArr"),this.authService=new BM,this.events=new OM,this.instanceArr=[]}async Init(e){await this.authService.Init(e),Bc.setJWT(this.authService.authPayload.JWT)}async loadBySKU(e){const t=await Cp.FetchAssetBySKUOrBarcode({sku:e.SKU,barcode:null});return await this.renderAsset({data:{assetDetails:t,customisation:t.customisation}})}async renderAsset(e){return new II({orgId:this.authService.authPayload.ORGID,userContainerId:e.containerId}).loadFrame({containerId:e.containerId,data:{assetDetails:e.data.assetDetails,customisation:e.data.customisation}})}async getInstance(e){return new II({orgId:this.authService.authPayload.ORGID,userContainerId:e.containerId})}}window.ThreeDConfigurator=CI;const RQ="",DQ="";function hk({frameList:r,selectedFrame:e,modelLoading:t,onChangeFrame:n}){const i=window.innerWidth<=576;return Te.jsx("div",{className:"sprie-config-palette",style:{padding:"0 4rem 1.6rem 4rem",marginTop:i?"1rem":"0"},children:r==null?void 0:r.map(s=>Te.jsxs("div",{className:"sprie-config-palette-img-box",children:[Te.jsx("button",{style:{border:"0",cursor:t?"default":"pointer",width:i?45:60,height:i?45:60},onClick:()=>n(s),disabled:t,children:Te.jsx("img",{src:s.variantImage,alt:s.name+"image",className:`sprie-config-image ${i?"mobile-view":""}`,style:{transform:(e==null?void 0:e._id)===s._id?"scale(1.2,1.2)":"scale(1,1)"}})}),(e==null?void 0:e._id)===s._id&&Te.jsx("p",{className:"sprie-config-palette-img-text",children:Te.jsx("span",{className:"sprie-config-palette-imgName",children:s.name})})]},s._id))})}function dk({lensList:r,selectedLens:e,selectedDitaLens:t,modelLoading:n,onChangeLens:i}){const s=window.innerWidth<=576;return Te.jsx("div",{className:"sprie-config-palette",style:{padding:"0 1.2rem 1.6rem 1.2rem",marginTop:s?"1rem":"0",gap:s?".3rem":"1rem"},children:r==null?void 0:r.map(o=>Te.jsxs("div",{className:"sprie-config-palette-img-box",children:[Te.jsx("button",{style:{border:"0",cursor:n?"default":"pointer",width:s?45:60,height:s?45:60},onClick:()=>i(o),disabled:n,children:Te.jsx("img",{src:o.thumbnail,alt:o.name+"image",className:`sprie-config-image ${s?"mobile-view":""}`,style:{border:(e==null?void 0:e._id)===o._id?"1px solid #9d9b9c":"0",borderRadius:"50%",padding:"1px"}})}),(e==null?void 0:e._id)===o._id&&Te.jsxs("p",{className:"sprie-config-palette-img-text",style:{bottom:"-1.2rem",textAlign:"center"},children:[Te.jsx("span",{className:"sprie-config-palette-imgName",children:`${o.name}`}),Te.jsx("span",{className:"sprie-config-price-tag",children:(t==null?void 0:t.variantId)==0?"":` (+ ${t==null?void 0:t.variantPrice}.00 ${t==null?void 0:t.priceCurrency})`})]})]},o._id))})}const LQ="";function fk({heading:r,onEngravingLinkClicked:e,onChecked:t,onTextAdded:n}){const[i,s]=gt.useState(""),[o,c]=gt.useState(!1),[h,u]=gt.useState(!1),d=gt.useRef(null);return gt.useEffect(()=>{t(o),o&&d.current?(d.current.style.backgroundColor="#ffffff",d.current.focus()):!o&&d.current&&(d.current.style.backgroundColor="transparent",d.current.blur(),s(""))}),gt.useEffect(()=>{h&&i!=""&&n(i)},[h]),Te.jsxs("div",{className:"sprie-config-engraving-block",style:{marginTop:".5rem"},children:[Te.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".8rem"},children:[Te.jsx("input",{type:"checkbox",className:"sprie-config-engraving-checkbox",onChange:A=>{c(A.target.checked)},checked:o}),Te.jsxs("p",{style:{fontSize:".9rem",color:"#4d4d4d",fontWeight:"500",margin:"0"},children:["Add ","Laser Engraving"," ",Te.jsx("span",{style:{fontWeight:"400"},children:"(OPTIONAL)"})]})]}),Te.jsxs("div",{className:"sprie-config-engraving-inputField-block",children:[Te.jsx("input",{type:"text",ref:d,className:"sprie-config-engraving-inputField",placeholder:"ADD CUSTOM TEXT",value:i,onChange:A=>s(A.target.value),maxLength:15,style:{padding:"0.7rem"},disabled:!o,onBlur:A=>u(!0),onFocus:A=>u(!1)}),Te.jsx("span",{className:"sprie-config-engraving-inputInfo",children:`${i.length}/15 characters`}),Te.jsx("p",{onClick:e,className:"sprie-config-engraving-link",children:"About Custom Laser Engraving"})]})]})}const NQ="";function pk({totalSteps:r,currentStep:e}){const t=window.innerWidth<=576;return Te.jsx("div",{className:"step-tracker-block",style:{margin:t?"1rem 0":".7rem 0 1rem 0",paddingBottom:"1.5rem"},children:Te.jsx("div",{className:"step-tracker",children:Array.from({length:r}).map((n,i)=>Te.jsx("div",{className:`step-circle ${i+1===e?"active":""}`},i))})})}function Ak({nextSlide:r,previousSlide:e,currentIndex:t,stepsName:n,isLastStep:i}){return Te.jsxs("div",{className:"carousel-header",children:[Te.jsx("button",{className:"carousel-btn prev",onClick:e,style:{visibility:t!==0?"visible":"hidden"},children:Te.jsx("i",{className:"arrow left-arrow",style:{padding:".25rem"}})}),Te.jsxs("p",{children:[Te.jsx("span",{className:"step-syntax",children:`STEP ${t+1}: `}),Te.jsx("span",{className:"select-syntax",children:n[t]})]}),Te.jsx("button",{className:"carousel-btn next",onClick:r,style:{visibility:i?"hidden":"visible"},children:Te.jsx("i",{className:"arrow right-arrow",style:{padding:".25rem"}})})]})}function gk({setShowAddToCart:r,children:e}){var u;const[t,n]=gt.useState(0),i=Sh.Children.toArray(e),s=t===i.length-1,o=(u=i.map(d=>d))==null?void 0:u.map(d=>d.props.heading),c=()=>{n(d=>d===0?Sh.Children.count(e)-1:d-1)},h=()=>{n(d=>d===Sh.Children.count(e)-1?0:d+1)};return gt.useEffect(()=>{r(!!s)},[s]),Te.jsxs("div",{className:"carousel",children:[Te.jsx(Ak,{nextSlide:h,previousSlide:c,currentIndex:t,stepsName:o,isLastStep:s}),Te.jsx(pk,{totalSteps:o==null?void 0:o.length,currentStep:t+1}),Te.jsx("div",{className:"carousel-container",children:i.map((d,A)=>Te.jsx("div",{className:"carousel-item",style:{transform:`translateX(-${t*100}%)`},children:d},A))})]})}const UQ="";function MI({conditionRequired:r,onButtonClick:e}){const[t,n]=gt.useState(!1),i=gt.useRef(null),s=gt.useRef(null);return gt.useEffect(()=>{s.current&&(s.current.disabled=!t)},[t]),gt.useEffect(()=>{i.current&&(i.current.style.display=r?"flex":"none"),s.current&&(s.current.disabled=r)},[r]),Te.jsxs("div",{className:"sprie-config-add-to-cart-block",children:[Te.jsxs("label",{htmlFor:"Sprie-Config-return-policy-checkbox",id:"Sprie-Config-return-policy-label",ref:i,style:{display:"none"},children:[Te.jsx("input",{type:"checkbox",id:"Sprie-Config-return-policy-checkbox",name:"sprie-config-return-policy-checkbox",onChange:o=>n(o.target.checked),checked:t}),Te.jsxs("p",{children:["I agree this customized Item cannot be returned or exchanged.",Te.jsx("span",{style:{color:"red"},children:"*"})]})]}),Te.jsx("button",{className:"sprie-config-add-to-cart-btn",ref:s,onClick:e,children:"ADD TO CART"})]})}const Sn=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent);function mk({orbitalList:r,selectedOrbital:e,modelLoading:t,onChangeOrbital:n}){return Te.jsx("div",{className:"sprie-config-palette",style:{padding:"0 1.2rem 1.6rem 1.2rem",marginTop:Sn?"1rem":"0",gap:Sn?".3rem":"1rem"},children:r==null?void 0:r.map(i=>Te.jsxs("div",{className:"sprie-config-palette-img-box",children:[Te.jsx("button",{style:{border:"0",cursor:t?"default":"pointer",width:Sn?45:60,height:Sn?45:60},onClick:()=>n(i),disabled:t,children:Te.jsx("img",{src:i.thumbnail,alt:i.name+"image",className:`sprie-config-image ${Sn?"mobile-view":""}`,style:{border:(e==null?void 0:e._id)===i._id?"1px solid #9d9b9c":"0",borderRadius:"50%",padding:"1px"}})}),(e==null?void 0:e._id)===i._id&&Te.jsx("p",{className:"sprie-config-palette-img-text",style:{bottom:"-1.5rem"},children:Te.jsx("span",{className:"sprie-config-palette-imgName",children:i.name})})]},i._id))})}const _k="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIKICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiB3aWR0aD0iMzIwLjAwMDAwMHB0IiBoZWlnaHQ9IjY2LjAwMDAwMHB0IiB2aWV3Qm94PSIwIDAgMzIwLjAwMDAwMCA2Ni4wMDAwMDAiCiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCBtZWV0Ij4KCjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAuMDAwMDAwLDY2LjAwMDAwMCkgc2NhbGUoMC4xMDAwMDAsLTAuMTAwMDAwKSIKZmlsbD0iIzAwMDAwMCIgc3Ryb2tlPSJub25lIj4KPHBhdGggZD0iTTAgNjUxIGMwIC02IDkgLTExIDIxIC0xMSAxMSAwIDI5IC01IDQwIC0xMCAxOCAtMTAgMTkgLTI0IDE5IC0zMDAKMCAtMjc2IC0xIC0yOTAgLTE5IC0zMDAgLTExIC01IC0yOSAtMTAgLTQwIC0xMCAtMTIgMCAtMjEgLTQgLTIxIC0xMCAwIC0xNAo0NDUgLTEzIDUxMiAxIDEwNyAyMyAxOTAgODUgMjM5IDE3OSAyMCAzNyAyNCA2MCAyNCAxMzUgMCA3OCAtNCA5NyAtMjggMTQ3Ci0zNCA3MCAtMTAwIDEzMCAtMTc2IDE2MCAtNTIgMjEgLTc1IDIzIC0zMTMgMjYgLTE4MCAyIC0yNTggMCAtMjU4IC03eiBtNDcwCi0zNiBjMTUgLTggMzggLTI3IDQ5IC00MSAyMCAtMjUgMjEgLTM5IDIxIC0yMzggMCAtMTk0IC0yIC0yMTQgLTIwIC0yNDQgLTExCi0xOCAtMzYgLTQwIC01NSAtNDggLTQ2IC0xOSAtMTM1IC0xOCAtMTYzIDIgLTIyIDE1IC0yMiAxNyAtMjIgMzAwIGwwIDI4NCA4MAowIGM1MiAwIDkxIC01IDExMCAtMTV6Ii8+CjxwYXRoIGQ9Ik05ODAgNjUwIGMwIC01IDExIC0xMCAyNCAtMTAgNTUgMCA1NiAtNyA1NiAtMzEwIDAgLTMwMyAtMSAtMzEwIC01NgotMzEwIC0xMyAwIC0yNCAtNCAtMjQgLTEwIDAgLTYgNjcgLTEwIDE4MCAtMTAgMTEzIDAgMTgwIDQgMTgwIDEwIDAgNiAtMTEgMTAKLTIzIDEwIC0xMyAwIC0zMSA4IC00MCAxOCAtMTUgMTYgLTE3IDUyIC0xNyAyOTQgMCAyNTQgMSAyNzYgMTggMjkxIDEwIDEwIDI4CjE3IDQwIDE3IDEyIDAgMjIgNSAyMiAxMCAwIDYgLTY3IDEwIC0xODAgMTAgLTExMyAwIC0xODAgLTQgLTE4MCAtMTB6Ii8+CjxwYXRoIGQ9Ik0xNTI2IDYwMSBjLTI1IC0zMyAtNDYgLTY0IC00NiAtNzAgMCAtNiAyNCA1IDU0IDI0IDUzIDM0IDE1OSA3NQoxOTQgNzUgMTAgMCAyOCAtMTAgNDAgLTIzIDIxIC0yMyAyMiAtMzAgMjIgLTI4OSAwIC0yODkgLTIgLTI5OCAtNTYgLTI5OCAtMTMKMCAtMjQgLTQgLTI0IC0xMCAwIC02IDY3IC0xMCAxODAgLTEwIDExMyAwIDE4MCA0IDE4MCAxMCAwIDYgLTExIDEwIC0yNCAxMAotNTQgMCAtNTYgOSAtNTYgMjk0IDAgMjUxIDEgMjY1IDIxIDI5MCAxMSAxNCAzMCAyNiA0MiAyNiAzNyAtMSAxNTMgLTQ2IDIwMQotNzggMjUgLTE3IDQ2IC0yNyA0NiAtMjEgMCA2IC0yMSAzNyAtNDYgNzAgbC00NyA1OSAtMzE3IDAgLTMxNyAwIC00NyAtNTl6Ii8+CjxwYXRoIGQ9Ik0yNDU1IDY1MCBjMyAtNSAxNSAtMTAgMjYgLTEwIDMwIDAgNjUgLTI3IDk3IC03NiBsMjkgLTQzIC05MCAtMTc4CmMtMTM2IC0yNzAgLTE2MyAtMzEzIC0xOTggLTMyMCAtNTkgLTExIC0yNiAtMjMgNjYgLTIzIDg5IDAgMTIxIDExIDc1IDI1IC0yOQo5IC0yNiA1NSAxMCAxMjYgbDMxIDYwIDE1MSAtMyAxNTEgLTMgMzkgLTczIGMzMCAtNTkgMzYgLTc3IDI4IC05MyAtNiAtMTAKLTIwIC0xOSAtMzAgLTE5IC0xMSAwIC0yMCAtNCAtMjAgLTEwIDAgLTYgNzAgLTEwIDE5MCAtMTAgMTIwIDAgMTkwIDQgMTkwIDEwCjAgNiAtMTEgMTAgLTI0IDEwIC0xNCAwIC0zNiAxMCAtNTAgMjMgLTE1IDEyIC0xMDYgMTU1IC0yMDQgMzE3IGwtMTc3IDI5NQotMTQ4IDMgYy0xMDAgMiAtMTQ2IC0xIC0xNDIgLTh6IG0yNTggLTM5OCBjLTM1IC0yIC05MiAtMiAtMTI3IDAgbC02NCAzIDYwCjExMyA2MCAxMTMgNjcgLTExMyA2NyAtMTEzIC02MyAtM3oiLz4KPC9nPgo8L3N2Zz4K",vk="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI4LjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA4ODYgNjk4IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA4ODYgNjk4OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGw6IzkxODQ3RTt9Cjwvc3R5bGU+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik04NDAuMDEsNDEuMDFjLTM2LjcxLTMxLjU2LTEwOC45NC01Ny45Ny0yNDQuNi00LjU2Yy0yMC40Nyw4LjA2LTQxLjQ2LDE3LjU3LTYyLjc1LDI4LjM2CgljMTkuMzgtNC42Niw0MzEuNTItMTAxLDE3NS42MSwxOTkuNDJsLTAuMDQsMGMtMjUuODUsMzUuNS01Ny44Miw3Mi4wOC05NC40MiwxMDcuOTdsLTMyLjcyLTI4LjE0bC02LjQ0LDE0MS43NmwxNjQuODQtNS41NwoJbC00NC4zNC0zOC4xMmM2NS41NC02My43NCwxMTcuODUtMTI5Ljk0LDE1MC4yMi0xOTAuNzdDOTA3LjQ0LDEzNC42OSw4NzYuNzEsNzIuNTcsODQwLjAxLDQxLjAxeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNTYyLjE3LDQyNS42N2MtNjQuNDcsNDYuMi0xMzIuNjcsODYuMjItMTk4LjQzLDExNi43NmMtMC4wOSwwLjA0LTAuMTcsMC4wOC0wLjI1LDAuMTMKCUMtMTkuMjcsNzMwLjcyLDczLjg2LDQ0MS4xMyw4OC4wNyw0MDEuNDVsLTIuMDktMS41MWMtMTQuNjcsMTcuOTMtMjcuNiwzNS42MS0zOC41Myw1Mi44NEMtMjQuNCw1NjYsMTEuMTYsNjI2LjI3LDUzLjY0LDY1Ni44OQoJYzQyLjQ4LDMwLjYzLDEyNi4wNyw1Ni4yNSwyODMuMDUsNC40M2M5OS0zMi42OSwyMDguNTgtODkuNywzMTAuMDYtMTYxLjE5bC04My43Ny0wLjQ2TDU2Mi4xNyw0MjUuNjd6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0yMTIuOSwxOTcuNzRjMCwzNS41NC0yNS43Myw1Mi44MS00MS45OCw1Mi44MXYxLjAxYzIwLjY1LDAsNDYuMzcsMTUuOTEsNDYuMzcsNTEuNDUKCWMwLDM3LjkxLTM0LjE5LDYzLjk4LTgzLjYxLDYzLjk4Yy00My42NywwLTcxLjA5LTE3LjI3LTgzLjk1LTU0Ljg0bDQyLjMxLTE4Ljk2YzQuNzQsMjQuMzcsMTcuMjYsMzYuMjIsNDEuOTgsMzYuMjIKCWMyMy43LDAsMzcuOTEtMTIuODcsMzcuNTctMzIuNWMtMC4zNC0yMC45OS0xMy4yLTI4Ljc4LTM5Ljk0LTI4Ljc4aC0xMS4xN3YtMzIuNWg5LjQ4YzI0LjM3LDAsMzYuNTYtOS44MiwzNi41Ni0yOS43OQoJYzAuMzQtMjAuNjUtMTEuNTEtMzEuNDgtMzEuODItMzEuNDhjLTIwLjY1LDAtMzMuODUsMTAuODMtMzYuOSwzMS44MmwtNDEuNjQtMTUuMjNjOC44LTM2LjksNDAuNjItNTQuMTYsODAuNTYtNTQuMTYKCUMxODUuODIsMTM2LjgxLDIxMi45LDE2Mi41NCwyMTIuOSwxOTcuNzR6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0zOTYuOTgsMTg1LjU2bC0zOS4yNywxOC4yOGMtNS40Mi0xNy42LTE3LjI2LTI4LjQzLTM4LjkzLTI4LjQzYy0yOC43OCwwLTQ5LjA4LDMwLjgtNDkuMDgsNzYuMTZ2NS43NmgxLjAxCgljNy40NS0yMy4wMiwzMS4xNC0zMy41MSw1Ni44Ny0zMy41MWM0Mi45OSwwLDczLjEyLDI3LjQyLDczLjEyLDcwLjQxYzAsNDQuMzQtMzAuOCw3Mi43OC04Mi42LDcyLjc4CgljLTU4LjIzLDAtOTAuMzgtNDIuOTktOTAuMzgtMTE1LjA5YzAtNzcuNTIsNDAuNjItMTE1LjA5LDk0LjExLTExNS4wOUMzNTcuNzEsMTM2LjgxLDM4NC4xMiwxNTAuMzUsMzk2Ljk4LDE4NS41NnogTTI4MC41MywyOTMuNTQKCWMwLDIyLjM0LDE1LjIzLDM2LjIyLDM4LjI1LDM2LjIyYzI0LjAzLDAsMzcuOTEtMTMuMiwzNy45MS0zNi4yMmMwLTIyLTEzLjg4LTM1LjU0LTM3LjkxLTM1LjU0CglDMjk1Ljc2LDI1OCwyODAuNTMsMjcyLjIyLDI4MC41MywyOTMuNTR6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MTQuNzgsMjUxLjkxYzAtNzUuNDksMzAuMTMtMTE1LjA5LDg5LjM3LTExNS4wOXM4OS4zNywzOS42LDg5LjM3LDExNS4wOVM1NjMuMzgsMzY3LDUwNC4xNSwzNjcKCVM0MTQuNzgsMzI3LjM5LDQxNC43OCwyNTEuOTF6IE01NDYuOCwyNTEuOTFjMC01My4xNS0xMy44OC03Ny41Mi00Mi42NS03Ny41MmMtMjguNzcsMC00Mi42NSwyNC4zNy00Mi42NSw3Ny41MgoJYzAsNTMuMTUsMTMuODgsNzcuNTIsNDIuNjUsNzcuNTJDNTMyLjkyLDMyOS40Myw1NDYuOCwzMDUuMDUsNTQ2LjgsMjUxLjkxeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNTg4LjIsMTI4LjEzYzAtMTguNjMsMTMuNzgtMzIuMDIsMzIuOTktMzIuMDJjMTkuMjEsMCwzMi45OSwxMy4zOSwzMi45OSwzMi4wMnMtMTMuNzgsMzIuMDItMzIuOTksMzIuMDIKCUM2MDEuOTcsMTYwLjE0LDU4OC4yLDE0Ni43Niw1ODguMiwxMjguMTN6IE02NDAuNTksMTI4LjEzYzAtMTEuMjUtOC4xNS0xOS40LTE5LjQtMTkuNHMtMTkuNCw4LjE1LTE5LjQsMTkuNHM4LjE1LDE5LjQsMTkuNCwxOS40CglTNjQwLjU5LDEzOS4zOCw2NDAuNTksMTI4LjEzeiIvPgo8L3N2Zz4K",yk="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciICB2aWV3Qm94PSIwIDAgNjQgNjQiIHdpZHRoPSI0OHB4IiBoZWlnaHQ9IjQ4cHgiPjxwYXRoIGQ9Ik0gMTYgMTQgQyAxNS40ODggMTQgMTQuOTc2OTM4IDE0LjE5NDkzNyAxNC41ODU5MzggMTQuNTg1OTM4IEMgMTMuODA0OTM3IDE1LjM2NjkzNyAxMy44MDQ5MzcgMTYuNjMzMDYzIDE0LjU4NTkzOCAxNy40MTQwNjIgTCAyOS4xNzE4NzUgMzIgTCAxNC41ODU5MzggNDYuNTg1OTM4IEMgMTMuODA0OTM4IDQ3LjM2NjkzOCAxMy44MDQ5MzcgNDguNjMzMDYzIDE0LjU4NTkzOCA0OS40MTQwNjIgQyAxNC45NzY5MzcgNDkuODA1MDYyIDE1LjQ4OCA1MCAxNiA1MCBDIDE2LjUxMiA1MCAxNy4wMjMwNjIgNDkuODA1MDYyIDE3LjQxNDA2MiA0OS40MTQwNjIgTCAzMiAzNC44MjgxMjUgTCA0Ni41ODU5MzggNDkuNDE0MDYyIEMgNDcuMzY2OTM4IDUwLjE5NTA2MyA0OC42MzMwNjMgNTAuMTk1MDYyIDQ5LjQxNDA2MiA0OS40MTQwNjIgQyA1MC4xOTUwNjMgNDguNjMzMDYyIDUwLjE5NTA2MiA0Ny4zNjY5MzcgNDkuNDE0MDYyIDQ2LjU4NTkzOCBMIDM0LjgyODEyNSAzMiBMIDQ5LjQxNDA2MiAxNy40MTQwNjIgQyA1MC4xOTUwNjMgMTYuNjMzMDYzIDUwLjE5NTA2MiAxNS4zNjY5MzggNDkuNDE0MDYyIDE0LjU4NTkzOCBDIDQ4LjYzMzA2MiAxMy44MDQ5MzggNDcuMzY2OTM3IDEzLjgwNDkzOCA0Ni41ODU5MzggMTQuNTg1OTM4IEwgMzIgMjkuMTcxODc1IEwgMTcuNDE0MDYyIDE0LjU4NTkzOCBDIDE3LjAyMzA2MiAxNC4xOTQ5MzggMTYuNTEyIDE0IDE2IDE0IHoiLz48L3N2Zz4=";var vf=(r=>(r.Front="Front",r.Back="Back",r.Left="Left",r.Right="Right",r.Top="Top",r.Bottom="Bottom",r))(vf||{});const PQ="";function Ek({snapCameraTo:r}){const e=Object.keys(vf).map(s=>({label:vf[s],isDisabled:!0})),[t,n]=gt.useState(),i=s=>{n(s),r(s)};return Te.jsx("div",{className:"sprie-3d-snap-button-block",children:e.map((s,o)=>Te.jsx("button",{className:"sprie-3d-snap-button",style:{backgroundColor:t!==s.label?"#ccc":"#000",color:t!==s.label?"#f3f3f3":"#fff"},onClick:()=>{i(vf[s.label])},children:s.label},o))})}function xk({frameName:r,customEvent:e,apiService:t,frameList:n,lensList:i,orbitalList:s,showOrbitalList:o,viewerOnly:c,domService:h,ThreeDConfigurator:u,dataVariants:d,dataLenses:A,dataOrbitals:p,firstDitaVariant:g}){var k;const[v,E]=gt.useState(),[m,_]=gt.useState(),[w,x]=gt.useState(),[I,R]=gt.useState(!1),[S,T]=gt.useState(!1),[D,b]=gt.useState(Sn?S?35:30:S?28:25),[M,L]=gt.useState(Sn?10:8);gt.useState(60);const[P,N]=gt.useState(),[j,X]=gt.useState(),[K,ne]=gt.useState(),[V,te]=gt.useState(!1),[Q,z]=gt.useState("placeholder"),Z=gt.useRef(null);(k=Z.current)==null||k.clientHeight;const re=gt.useRef();re.current=h;const H={variantId:0,variantName:"defaultName",variantPrice:0,priceCurrency:"defaultCurrency",varinatSku:"lens-default"},fe={variantId:0,variantName:"defaultName",variantPrice:0,priceCurrency:"defaultCurrency",varinatSku:"orbital-default"},Ae=ee=>{re.current&&re.current.snapCameraToPos(ee)},ve=async(ee,ue)=>{ee._id===(v==null?void 0:v._id)&&!ue||re.current&&(R(!0),re.current.changeFrame(ee,[m,w]).then(()=>{R(!1)}),E(ee),N(d==null?void 0:d.find(pe=>pe.varinatSku==ee.sku)),(v==null?void 0:v.name.toLowerCase())!=="default"&&(m==null?void 0:m.name.toLowerCase())!=="default"&&(K==null||K.variantName.toLowerCase()))},ye=ee=>ee==null?void 0:ee.customisation.find(pe=>pe.type=="Lens"),Oe=async ee=>{if(!re.current||ee==m)return;const ue=ee.sku=="lens-default",pe=ye(v),ge=rt();!pe&&ue?(R(!0),re.current.changeLens([ee,w],!0,v).then(()=>{R(!1)})):!pe&&!ue?(m==null?void 0:m.sku)=="lens-default"?(R(!0),re.current.changeLens([ee,w],!0,v).then(()=>{R(!1)})):re.current.changeLens([ee,w],!1,v):pe&&ue?re.current.changeLens([pe,w],!1,v):re.current.changeLens([ee,w],!1,v),ee.sku=="lens-default"?X(H):X(A==null?void 0:A.find(Ue=>{var Ee;return Ue.variantId==Number((Ee=ee.metadata.find(Qe=>Qe.key==ge))==null?void 0:Ee.value)?Ue:null})),_(ee),(v==null?void 0:v.name.toLowerCase())!=="default"&&(m==null?void 0:m.name.toLowerCase())!=="default"&&(K==null||K.variantName.toLowerCase())},it=async ee=>{re.current&&ee!=w&&(R(!0),await re.current.changeOrbital(ee).then(()=>{ne(p==null?void 0:p.find(ue=>ue.variantId==Number(ee.sku))),R(!1)}),x(ee),(v==null?void 0:v.name.toLowerCase())!=="default"&&(m==null?void 0:m.name.toLowerCase())!=="default"&&(K==null||K.variantName.toLowerCase()))},ae=()=>(P==null?void 0:P.variantPrice)+((j==null?void 0:j.varinatSku)!=="lens-default"?j==null?void 0:j.variantPrice:0),rt=()=>{var pe;const ee=(pe=v.metadata.find(ge=>ge.key=="baseCurve"))==null?void 0:pe.value;let ue="variantId";return ee=="2B"?ue="2bVariantId":ee=="6B"&&(ue="6bVariantId"),ue},Pe=ee=>{te(ee)},lt=ee=>{z(ee)},Ye=()=>{var ee,ue;Sn?(ee=document.querySelector('[id$="main-laser-etch-popover"]'))==null||ee.setAttribute("open",""):(ue=document.querySelector('[id$="main-laser-etch-drawer"]'))==null||ue.setAttribute("open","")},ct=()=>{if(v&&m&&K&&!(v.name.toLowerCase().includes("default")||m.name.toLowerCase().includes("default")||K.variantName.toLowerCase().includes("default"))){const ee=v.metadata.find(Se=>Se.key=="variantId"),ue=v.metadata.find(Se=>Se.key=="baseCurve");let pe="variantId";ue&&ue.value=="2B"?pe="2bVariantId":ue&&ue.value=="6B"&&(pe="6bVariantId");const ge=m.metadata.find(Se=>Se.key==pe),Ue=ee?Number(ee.value):null,Ee=ge?Number(ge.value):null,Qe=K!=null&&K.variantId?Number(K.variantId):null,He={frameIdentifier:Ue,lensIdentifier:Ee,orbitalIdentifier:Qe};e.emitEvent("onAddToCart",He);const Ce=[];if(Ee&&ge){const Se={id:Ee,quantity:1,properties:null};Ce.push(Se)}if(Qe&&(K!=null&&K.variantId)){const Se={id:Qe,quantity:1,properties:null};Ce.push(Se)}if(V){const Se={id:44745490890985,quantity:1,properties:null};Ce.push(Se)}if(ee){const Se={id:Ue,quantity:1,properties:V?{customText:Q}:null};Ce.push(Se)}t.HandleShopifyAddToCart(Ce)}},Y=()=>{var ee,ue;Sn?(ee=document.querySelector(".popover.hidden-lap-and-up.popover-full"))==null||ee.removeAttribute("open"):(ue=document.querySelector(".drawer.drawer--full.hidden-phone.lens-customizer"))==null||ue.removeAttribute("open")};return gt.useEffect(()=>{b(Sn?S?35:30:S?28:25)},[S]),gt.useEffect(()=>{n&&E(n[0]),i&&_(i[0]),s&&x(s[0])},[n,i,s]),gt.useEffect(()=>{N(g),X(H),ne(fe)},[g]),gt.useEffect(()=>{},[V,Q]),Te.jsxs("section",{id:"sprie-config-main-container",ref:Z,children:[Te.jsxs("header",{id:"sprie-config-main-header",style:{height:`${M}%`},children:[Te.jsxs("div",{id:"sprie-config-header-content",children:[Te.jsx("img",{src:_k,alt:"dita-logo",width:97,height:20}),Te.jsxs("p",{style:{margin:"0"},className:"sprie-config-mainHeader-frameName",children:[r," CUSTOMIZER"]})]}),Te.jsx("button",{className:"sprie-config-main-header-close",onClick:Y,children:Te.jsx("img",{src:yk,alt:"close",style:{width:"2rem",height:"2rem"}})})]}),Te.jsxs("section",{id:"sprie-config-viewer-container",style:{height:`${100-(D+M-(Sn?S?13.5:12:0))}%`},children:[Te.jsx("img",{src:vk,alt:"360deg-logo",width:44,height:34}),Te.jsx(Ek,{snapCameraTo:Ae}),I&&Te.jsx("div",{className:"sprie-config-loadingFrame",children:Te.jsx("div",{className:"sprie-config-loader"})}),Te.jsx("div",{style:{width:"100%",height:"100%"},id:"holder-canvas"})]}),Te.jsxs("section",{id:"Sprie-config-Customisation-block",style:{paddingTop:"1.5rem",height:`${D}%`},children:[Te.jsxs("div",{className:"sprie-config-price-block",children:[Te.jsx("p",{id:"sprie-config-price-text",style:{bottom:Sn?"100%":"",margin:"0 0.8rem 0.5rem 0"},children:`${ae()}.00 ${P==null?void 0:P.priceCurrency} `}),!Sn&&S&&Te.jsx(MI,{conditionRequired:!0,onButtonClick:ct}),S&&Te.jsx("p",{id:"sprie-config-process-time-text",style:{fontSize:".9rem",textAlign:"right",marginTop:"0",marginBottom:"0.5rem"},children:"Please Allow 7-10 Days for Customization Process."})]}),Te.jsxs(gk,{setShowAddToCart:T,children:[Te.jsx(hk,{modelLoading:I,frameList:n,selectedFrame:v,onChangeFrame:ve,heading:"SELECT FRAME"}),o&&Te.jsx(mk,{orbitalList:s,selectedOrbital:w,modelLoading:I,onChangeOrbital:it,heading:"SELECT ORBITAL"}),Te.jsx(dk,{modelLoading:I,lensList:i,selectedLens:m,selectedDitaLens:j,onChangeLens:Oe,heading:"SELECT LENS COLOR"}),Te.jsx(fk,{heading:"LASER ENGRAVING",onEngravingLinkClicked:Ye,onChecked:Pe,onTextAdded:lt})]}),Sn&&S&&Te.jsx("div",{style:{position:"absolute",bottom:"0%",width:"100%"},children:Te.jsx(MI,{conditionRequired:!0,onButtonClick:ct})})]})]})}function wk({apiService:r,sku:e,events:t,viewerOnly:n=!1}){var A;const i=gt.useRef(),[s,o]=gt.useState(null),c=(s==null?void 0:s.frameName)||"",h=(s==null?void 0:s.frameList)||null,u=(s==null?void 0:s.lensList)||null,d=(s==null?void 0:s.orbitalList)||null;return s!=null&&s.dataVariants,s!=null&&s.dataLenses,s!=null&&s.dataOrbitals,gt.useEffect(()=>((async()=>{var m,_;i.current=new CI,await((m=i.current)==null?void 0:m.Init(r.apiKey));const p=await r.FetchAssetBySKUOrBarcode({sku:e,barcode:null}),g=await r.FetchCustomisationList("Lens"),v=await r.FetchCustomisationList("Orbital"),E=await i.current.getInstance({containerId:"holder-canvas"});await E.loadFrame({containerId:"holder-canvas",data:{assetDetails:p,customisation:p==null?void 0:p.customisation}}),o({frameList:p==null?void 0:p.variants,lensList:g==null?void 0:g.data,orbitalList:v==null?void 0:v.data,frameName:p==null?void 0:p.group.name,showOrbitals:((_=p==null?void 0:p.customisation)==null?void 0:_.filter(w=>w.type==="Orbital").length)>0,domService:E,dataVariants:await r.PopulateDataList("data-variants"),dataLenses:await r.PopulateDataList("data-lenses"),dataOrbitals:await r.PopulateDataList("data-orbital")})})(),()=>{i.current=void 0}),[r,e]),Te.jsxs(Te.Fragment,{children:[(!h||!u)&&Te.jsx("div",{className:"sprie-config-loadingBox",children:"Loading..."}),Te.jsx(xk,{customEvent:t,frameName:c,apiService:r,frameList:h,lensList:u,orbitalList:d,showOrbitalList:(s==null?void 0:s.showOrbitals)||!1,viewerOnly:n,ThreeDConfigurator:i.current,domService:s==null?void 0:s.domService,dataVariants:s==null?void 0:s.dataVariants,dataLenses:s==null?void 0:s.dataLenses,dataOrbitals:s==null?void 0:s.dataOrbitals,firstDitaVariant:(A=s==null?void 0:s.dataVariants)==null?void 0:A.find(p=>p.varinatSku==e)})]})}var Hm={},SI={exports:{}},Tn={},Gm={exports:{}},Vm={};/**
4466
4466
  * @license React
4467
4467
  * scheduler.production.min.js
4468
4468
  *
@@ -4478,11 +4478,11 @@ bool bvhIntersectFirstHit(
4478
4478
  *
4479
4479
  * This source code is licensed under the MIT license found in the
4480
4480
  * LICENSE file in the root directory of this source tree.
4481
- */var bI;function Mk(){if(bI)return Sn;bI=1;var r=gt,e=Ck();function t(a){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+a,f=1;f<arguments.length;f++)l+="&args[]="+encodeURIComponent(arguments[f]);return"Minified React error #"+a+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,i={};function s(a,l){o(a,l),o(a+"Capture",l)}function o(a,l){for(i[a]=l,a=0;a<l.length;a++)n.add(l[a])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,u=/^[: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]*$/,d={},A={};function p(a){return h.call(A,a)?!0:h.call(d,a)?!1:u.test(a)?A[a]=!0:(d[a]=!0,!1)}function g(a,l,f,y){if(f!==null&&f.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return y?!1:f!==null?!f.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function v(a,l,f,y){if(l===null||typeof l>"u"||g(a,l,f,y))return!0;if(y)return!1;if(f!==null)switch(f.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function E(a,l,f,y,C,B,U){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=y,this.attributeNamespace=C,this.mustUseProperty=f,this.propertyName=a,this.type=l,this.sanitizeURL=B,this.removeEmptyString=U}var m={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){m[a]=new E(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var l=a[0];m[l]=new E(l,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){m[a]=new E(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){m[a]=new E(a,2,!1,a,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(a){m[a]=new E(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){m[a]=new E(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){m[a]=new E(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){m[a]=new E(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){m[a]=new E(a,5,!1,a.toLowerCase(),null,!1,!1)});var _=/[\-:]([a-z])/g;function w(a){return a[1].toUpperCase()}"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(a){var l=a.replace(_,w);m[l]=new E(l,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var l=a.replace(_,w);m[l]=new E(l,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var l=a.replace(_,w);m[l]=new E(l,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){m[a]=new E(a,1,!1,a.toLowerCase(),null,!1,!1)}),m.xlinkHref=new E("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){m[a]=new E(a,1,!1,a.toLowerCase(),null,!0,!0)});function x(a,l,f,y){var C=m.hasOwnProperty(l)?m[l]:null;(C!==null?C.type!==0:y||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(v(l,f,C,y)&&(f=null),y||C===null?p(l)&&(f===null?a.removeAttribute(l):a.setAttribute(l,""+f)):C.mustUseProperty?a[C.propertyName]=f===null?C.type===3?!1:"":f:(l=C.attributeName,y=C.attributeNamespace,f===null?a.removeAttribute(l):(C=C.type,f=C===3||C===4&&f===!0?"":""+f,y?a.setAttributeNS(y,l,f):a.setAttribute(l,f))))}var I=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,R=Symbol.for("react.element"),S=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),M=Symbol.for("react.provider"),L=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),ne=Symbol.for("react.offscreen"),V=Symbol.iterator;function te(a){return a===null||typeof a!="object"?null:(a=V&&a[V]||a["@@iterator"],typeof a=="function"?a:null)}var Q=Object.assign,z;function Z(a){if(z===void 0)try{throw Error()}catch(f){var l=f.stack.trim().match(/\n( *(at )?)/);z=l&&l[1]||""}return`
4481
+ */var bI;function Mk(){if(bI)return Tn;bI=1;var r=gt,e=Ck();function t(a){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+a,f=1;f<arguments.length;f++)l+="&args[]="+encodeURIComponent(arguments[f]);return"Minified React error #"+a+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,i={};function s(a,l){o(a,l),o(a+"Capture",l)}function o(a,l){for(i[a]=l,a=0;a<l.length;a++)n.add(l[a])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,u=/^[: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]*$/,d={},A={};function p(a){return h.call(A,a)?!0:h.call(d,a)?!1:u.test(a)?A[a]=!0:(d[a]=!0,!1)}function g(a,l,f,y){if(f!==null&&f.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return y?!1:f!==null?!f.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function v(a,l,f,y){if(l===null||typeof l>"u"||g(a,l,f,y))return!0;if(y)return!1;if(f!==null)switch(f.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function E(a,l,f,y,C,B,U){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=y,this.attributeNamespace=C,this.mustUseProperty=f,this.propertyName=a,this.type=l,this.sanitizeURL=B,this.removeEmptyString=U}var m={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){m[a]=new E(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var l=a[0];m[l]=new E(l,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){m[a]=new E(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){m[a]=new E(a,2,!1,a,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(a){m[a]=new E(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){m[a]=new E(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){m[a]=new E(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){m[a]=new E(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){m[a]=new E(a,5,!1,a.toLowerCase(),null,!1,!1)});var _=/[\-:]([a-z])/g;function w(a){return a[1].toUpperCase()}"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(a){var l=a.replace(_,w);m[l]=new E(l,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var l=a.replace(_,w);m[l]=new E(l,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var l=a.replace(_,w);m[l]=new E(l,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){m[a]=new E(a,1,!1,a.toLowerCase(),null,!1,!1)}),m.xlinkHref=new E("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){m[a]=new E(a,1,!1,a.toLowerCase(),null,!0,!0)});function x(a,l,f,y){var C=m.hasOwnProperty(l)?m[l]:null;(C!==null?C.type!==0:y||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(v(l,f,C,y)&&(f=null),y||C===null?p(l)&&(f===null?a.removeAttribute(l):a.setAttribute(l,""+f)):C.mustUseProperty?a[C.propertyName]=f===null?C.type===3?!1:"":f:(l=C.attributeName,y=C.attributeNamespace,f===null?a.removeAttribute(l):(C=C.type,f=C===3||C===4&&f===!0?"":""+f,y?a.setAttributeNS(y,l,f):a.setAttribute(l,f))))}var I=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,R=Symbol.for("react.element"),S=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),M=Symbol.for("react.provider"),L=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),ne=Symbol.for("react.offscreen"),V=Symbol.iterator;function te(a){return a===null||typeof a!="object"?null:(a=V&&a[V]||a["@@iterator"],typeof a=="function"?a:null)}var Q=Object.assign,z;function Z(a){if(z===void 0)try{throw Error()}catch(f){var l=f.stack.trim().match(/\n( *(at )?)/);z=l&&l[1]||""}return`
4482
4482
  `+z+a}var re=!1;function H(a,l){if(!a||re)return"";re=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(ce){var y=ce}Reflect.construct(a,[],l)}else{try{l.call()}catch(ce){y=ce}a.call(l.prototype)}else{try{throw Error()}catch(ce){y=ce}a()}}catch(ce){if(ce&&y&&typeof ce.stack=="string"){for(var C=ce.stack.split(`
4483
4483
  `),B=y.stack.split(`
4484
4484
  `),U=C.length-1,q=B.length-1;1<=U&&0<=q&&C[U]!==B[q];)q--;for(;1<=U&&0<=q;U--,q--)if(C[U]!==B[q]){if(U!==1||q!==1)do if(U--,q--,0>q||C[U]!==B[q]){var J=`
4485
- `+C[U].replace(" at new "," at ");return a.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",a.displayName)),J}while(1<=U&&0<=q);break}}}finally{re=!1,Error.prepareStackTrace=f}return(a=a?a.displayName||a.name:"")?Z(a):""}function fe(a){switch(a.tag){case 5:return Z(a.type);case 16:return Z("Lazy");case 13:return Z("Suspense");case 19:return Z("SuspenseList");case 0:case 2:case 15:return a=H(a.type,!1),a;case 11:return a=H(a.type.render,!1),a;case 1:return a=H(a.type,!0),a;default:return""}}function Ae(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case T:return"Fragment";case S:return"Portal";case b:return"Profiler";case D:return"StrictMode";case N:return"Suspense";case j:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case L:return(a.displayName||"Context")+".Consumer";case M:return(a._context.displayName||"Context")+".Provider";case P:var l=a.render;return a=a.displayName,a||(a=l.displayName||l.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case X:return l=a.displayName||null,l!==null?l:Ae(a.type)||"Memo";case K:l=a._payload,a=a._init;try{return Ae(a(l))}catch{}}return null}function ve(a){var l=a.type;switch(a.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=l.render,a=a.displayName||a.name||"",l.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ae(l);case 8:return l===D?"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(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function ye(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Oe(a){var l=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function it(a){var l=Oe(a)?"checked":"value",f=Object.getOwnPropertyDescriptor(a.constructor.prototype,l),y=""+a[l];if(!a.hasOwnProperty(l)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var C=f.get,B=f.set;return Object.defineProperty(a,l,{configurable:!0,get:function(){return C.call(this)},set:function(U){y=""+U,B.call(this,U)}}),Object.defineProperty(a,l,{enumerable:f.enumerable}),{getValue:function(){return y},setValue:function(U){y=""+U},stopTracking:function(){a._valueTracker=null,delete a[l]}}}}function ae(a){a._valueTracker||(a._valueTracker=it(a))}function rt(a){if(!a)return!1;var l=a._valueTracker;if(!l)return!0;var f=l.getValue(),y="";return a&&(y=Oe(a)?a.checked?"true":"false":a.value),a=y,a!==f?(l.setValue(a),!0):!1}function Pe(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function lt(a,l){var f=l.checked;return Q({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??a._wrapperState.initialChecked})}function Ye(a,l){var f=l.defaultValue==null?"":l.defaultValue,y=l.checked!=null?l.checked:l.defaultChecked;f=ye(l.value!=null?l.value:f),a._wrapperState={initialChecked:y,initialValue:f,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function ct(a,l){l=l.checked,l!=null&&x(a,"checked",l,!1)}function Y(a,l){ct(a,l);var f=ye(l.value),y=l.type;if(f!=null)y==="number"?(f===0&&a.value===""||a.value!=f)&&(a.value=""+f):a.value!==""+f&&(a.value=""+f);else if(y==="submit"||y==="reset"){a.removeAttribute("value");return}l.hasOwnProperty("value")?ee(a,l.type,f):l.hasOwnProperty("defaultValue")&&ee(a,l.type,ye(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(a.defaultChecked=!!l.defaultChecked)}function k(a,l,f){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var y=l.type;if(!(y!=="submit"&&y!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+a._wrapperState.initialValue,f||l===a.value||(a.value=l),a.defaultValue=l}f=a.name,f!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,f!==""&&(a.name=f)}function ee(a,l,f){(l!=="number"||Pe(a.ownerDocument)!==a)&&(f==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+f&&(a.defaultValue=""+f))}var ue=Array.isArray;function pe(a,l,f,y){if(a=a.options,l){l={};for(var C=0;C<f.length;C++)l["$"+f[C]]=!0;for(f=0;f<a.length;f++)C=l.hasOwnProperty("$"+a[f].value),a[f].selected!==C&&(a[f].selected=C),C&&y&&(a[f].defaultSelected=!0)}else{for(f=""+ye(f),l=null,C=0;C<a.length;C++){if(a[C].value===f){a[C].selected=!0,y&&(a[C].defaultSelected=!0);return}l!==null||a[C].disabled||(l=a[C])}l!==null&&(l.selected=!0)}}function ge(a,l){if(l.dangerouslySetInnerHTML!=null)throw Error(t(91));return Q({},l,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function Ue(a,l){var f=l.value;if(f==null){if(f=l.children,l=l.defaultValue,f!=null){if(l!=null)throw Error(t(92));if(ue(f)){if(1<f.length)throw Error(t(93));f=f[0]}l=f}l==null&&(l=""),f=l}a._wrapperState={initialValue:ye(f)}}function Ee(a,l){var f=ye(l.value),y=ye(l.defaultValue);f!=null&&(f=""+f,f!==a.value&&(a.value=f),l.defaultValue==null&&a.defaultValue!==f&&(a.defaultValue=f)),y!=null&&(a.defaultValue=""+y)}function Qe(a){var l=a.textContent;l===a._wrapperState.initialValue&&l!==""&&l!==null&&(a.value=l)}function He(a){switch(a){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 Ce(a,l){return a==null||a==="http://www.w3.org/1999/xhtml"?He(l):a==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var Se,Ze=function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,f,y,C){MSApp.execUnsafeLocalFunction(function(){return a(l,f,y,C)})}:a}(function(a,l){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=l;else{for(Se=Se||document.createElement("div"),Se.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=Se.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}});function Ne(a,l){if(l){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=l;return}}a.textContent=l}var Re={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},at=["Webkit","ms","Moz","O"];Object.keys(Re).forEach(function(a){at.forEach(function(l){l=l+a.charAt(0).toUpperCase()+a.substring(1),Re[l]=Re[a]})});function ft(a,l,f){return l==null||typeof l=="boolean"||l===""?"":f||typeof l!="number"||l===0||Re.hasOwnProperty(a)&&Re[a]?(""+l).trim():l+"px"}function yt(a,l){a=a.style;for(var f in l)if(l.hasOwnProperty(f)){var y=f.indexOf("--")===0,C=ft(f,l[f],y);f==="float"&&(f="cssFloat"),y?a.setProperty(f,C):a[f]=C}}var _t=Q({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 Et(a,l){if(l){if(_t[a]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(t(137,a));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(t(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(t(61))}if(l.style!=null&&typeof l.style!="object")throw Error(t(62))}}function G(a,l){if(a.indexOf("-")===-1)return typeof l.is=="string";switch(a){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 O=null;function me(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var _e=null,Fe=null,De=null;function pt(a){if(a=dh(a)){if(typeof _e!="function")throw Error(t(280));var l=a.stateNode;l&&(l=Of(l),_e(a.stateNode,a.type,l))}}function Dt(a){Fe?De?De.push(a):De=[a]:Fe=a}function Lt(){if(Fe){var a=Fe,l=De;if(De=Fe=null,pt(a),l)for(a=0;a<l.length;a++)pt(l[a])}}function St(a,l){return a(l)}function At(){}var ur=!1;function Vt(a,l,f){if(ur)return a(l,f);ur=!0;try{return St(a,l,f)}finally{ur=!1,(Fe!==null||De!==null)&&(At(),Lt())}}function mr(a,l){var f=a.stateNode;if(f===null)return null;var y=Of(f);if(y===null)return null;f=y[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(a=a.type,y=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!y;break e;default:a=!1}if(a)return null;if(f&&typeof f!="function")throw Error(t(231,l,typeof f));return f}var Tn=!1;if(c)try{var qt={};Object.defineProperty(qt,"passive",{get:function(){Tn=!0}}),window.addEventListener("test",qt,qt),window.removeEventListener("test",qt,qt)}catch{Tn=!1}function ui(a,l,f,y,C,B,U,q,J){var ce=Array.prototype.slice.call(arguments,3);try{l.apply(f,ce)}catch(we){this.onError(we)}}var Kn=!1,Ls=null,Ns=!1,sc=null,xf={onError:function(a){Kn=!0,Ls=a}};function Ym(a,l,f,y,C,B,U,q,J){Kn=!1,Ls=null,ui.apply(xf,arguments)}function qm(a,l,f,y,C,B,U,q,J){if(Ym.apply(this,arguments),Kn){if(Kn){var ce=Ls;Kn=!1,Ls=null}else throw Error(t(198));Ns||(Ns=!0,sc=ce)}}function Us(a){var l=a,f=a;if(a.alternate)for(;l.return;)l=l.return;else{a=l;do l=a,l.flags&4098&&(f=l.return),a=l.return;while(a)}return l.tag===3?f:null}function F(a){if(a.tag===13){var l=a.memoizedState;if(l===null&&(a=a.alternate,a!==null&&(l=a.memoizedState)),l!==null)return l.dehydrated}return null}function ie(a){if(Us(a)!==a)throw Error(t(188))}function he(a){var l=a.alternate;if(!l){if(l=Us(a),l===null)throw Error(t(188));return l!==a?null:a}for(var f=a,y=l;;){var C=f.return;if(C===null)break;var B=C.alternate;if(B===null){if(y=C.return,y!==null){f=y;continue}break}if(C.child===B.child){for(B=C.child;B;){if(B===f)return ie(C),a;if(B===y)return ie(C),l;B=B.sibling}throw Error(t(188))}if(f.return!==y.return)f=C,y=B;else{for(var U=!1,q=C.child;q;){if(q===f){U=!0,f=C,y=B;break}if(q===y){U=!0,y=C,f=B;break}q=q.sibling}if(!U){for(q=B.child;q;){if(q===f){U=!0,f=B,y=C;break}if(q===y){U=!0,y=B,f=C;break}q=q.sibling}if(!U)throw Error(t(189))}}if(f.alternate!==y)throw Error(t(190))}if(f.tag!==3)throw Error(t(188));return f.stateNode.current===f?a:l}function de(a){return a=he(a),a!==null?le(a):null}function le(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var l=le(a);if(l!==null)return l;a=a.sibling}return null}var Be=e.unstable_scheduleCallback,Xe=e.unstable_cancelCallback,et=e.unstable_shouldYield,nt=e.unstable_requestPaint,We=e.unstable_now,ut=e.unstable_getCurrentPriorityLevel,ot=e.unstable_ImmediatePriority,Rr=e.unstable_UserBlockingPriority,er=e.unstable_NormalPriority,Bn=e.unstable_LowPriority,hi=e.unstable_IdlePriority,jt=null,$e=null;function ju(a){if($e&&typeof $e.onCommitFiberRoot=="function")try{$e.onCommitFiberRoot(jt,a,void 0,(a.current.flags&128)===128)}catch{}}var pn=Math.clz32?Math.clz32:bo,Ps=Math.log,wf=Math.LN2;function bo(a){return a>>>=0,a===0?32:31-(Ps(a)/wf|0)|0}var wa=64,_r=4194304;function bn(a){switch(a&-a){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 a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Ia(a,l){var f=a.pendingLanes;if(f===0)return 0;var y=0,C=a.suspendedLanes,B=a.pingedLanes,U=f&268435455;if(U!==0){var q=U&~C;q!==0?y=bn(q):(B&=U,B!==0&&(y=bn(B)))}else U=f&~C,U!==0?y=bn(U):B!==0&&(y=bn(B));if(y===0)return 0;if(l!==0&&l!==y&&!(l&C)&&(C=y&-y,B=l&-l,C>=B||C===16&&(B&4194240)!==0))return l;if(y&4&&(y|=f&16),l=a.entangledLanes,l!==0)for(a=a.entanglements,l&=y;0<l;)f=31-pn(l),C=1<<f,y|=a[f],l&=~C;return y}function Rn(a,l){switch(a){case 1:case 2:case 4:return l+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 l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Wu(a,l){for(var f=a.suspendedLanes,y=a.pingedLanes,C=a.expirationTimes,B=a.pendingLanes;0<B;){var U=31-pn(B),q=1<<U,J=C[U];J===-1?(!(q&f)||q&y)&&(C[U]=Rn(q,l)):J<=l&&(a.expiredLanes|=q),B&=~q}}function Yu(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function qu(){var a=wa;return wa<<=1,!(wa&4194240)&&(wa=64),a}function Xm(a){for(var l=[],f=0;31>f;f++)l.push(a);return l}function Xu(a,l,f){a.pendingLanes|=l,l!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,l=31-pn(l),a[l]=f}function jk(a,l){var f=a.pendingLanes&~l;a.pendingLanes=l,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=l,a.mutableReadLanes&=l,a.entangledLanes&=l,l=a.entanglements;var y=a.eventTimes;for(a=a.expirationTimes;0<f;){var C=31-pn(f),B=1<<C;l[C]=0,y[C]=-1,a[C]=-1,f&=~B}}function Km(a,l){var f=a.entangledLanes|=l;for(a=a.entanglements;f;){var y=31-pn(f),C=1<<y;C&l|a[y]&l&&(a[y]|=l),f&=~C}}var Pt=0;function WI(a){return a&=-a,1<a?4<a?a&268435455?16:536870912:4:1}var YI,Jm,qI,XI,KI,Zm=!1,If=[],Ca=null,Ma=null,Sa=null,Ku=new Map,Ju=new Map,Ta=[],Wk="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 JI(a,l){switch(a){case"focusin":case"focusout":Ca=null;break;case"dragenter":case"dragleave":Ma=null;break;case"mouseover":case"mouseout":Sa=null;break;case"pointerover":case"pointerout":Ku.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ju.delete(l.pointerId)}}function Zu(a,l,f,y,C,B){return a===null||a.nativeEvent!==B?(a={blockedOn:l,domEventName:f,eventSystemFlags:y,nativeEvent:B,targetContainers:[C]},l!==null&&(l=dh(l),l!==null&&Jm(l)),a):(a.eventSystemFlags|=y,l=a.targetContainers,C!==null&&l.indexOf(C)===-1&&l.push(C),a)}function Yk(a,l,f,y,C){switch(l){case"focusin":return Ca=Zu(Ca,a,l,f,y,C),!0;case"dragenter":return Ma=Zu(Ma,a,l,f,y,C),!0;case"mouseover":return Sa=Zu(Sa,a,l,f,y,C),!0;case"pointerover":var B=C.pointerId;return Ku.set(B,Zu(Ku.get(B)||null,a,l,f,y,C)),!0;case"gotpointercapture":return B=C.pointerId,Ju.set(B,Zu(Ju.get(B)||null,a,l,f,y,C)),!0}return!1}function ZI(a){var l=Ro(a.target);if(l!==null){var f=Us(l);if(f!==null){if(l=f.tag,l===13){if(l=F(f),l!==null){a.blockedOn=l,KI(a.priority,function(){qI(f)});return}}else if(l===3&&f.stateNode.current.memoizedState.isDehydrated){a.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Cf(a){if(a.blockedOn!==null)return!1;for(var l=a.targetContainers;0<l.length;){var f=e0(a.domEventName,a.eventSystemFlags,l[0],a.nativeEvent);if(f===null){f=a.nativeEvent;var y=new f.constructor(f.type,f);O=y,f.target.dispatchEvent(y),O=null}else return l=dh(f),l!==null&&Jm(l),a.blockedOn=f,!1;l.shift()}return!0}function $I(a,l,f){Cf(a)&&f.delete(l)}function qk(){Zm=!1,Ca!==null&&Cf(Ca)&&(Ca=null),Ma!==null&&Cf(Ma)&&(Ma=null),Sa!==null&&Cf(Sa)&&(Sa=null),Ku.forEach($I),Ju.forEach($I)}function $u(a,l){a.blockedOn===l&&(a.blockedOn=null,Zm||(Zm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,qk)))}function eh(a){function l(C){return $u(C,a)}if(0<If.length){$u(If[0],a);for(var f=1;f<If.length;f++){var y=If[f];y.blockedOn===a&&(y.blockedOn=null)}}for(Ca!==null&&$u(Ca,a),Ma!==null&&$u(Ma,a),Sa!==null&&$u(Sa,a),Ku.forEach(l),Ju.forEach(l),f=0;f<Ta.length;f++)y=Ta[f],y.blockedOn===a&&(y.blockedOn=null);for(;0<Ta.length&&(f=Ta[0],f.blockedOn===null);)ZI(f),f.blockedOn===null&&Ta.shift()}var ac=I.ReactCurrentBatchConfig,Mf=!0;function Xk(a,l,f,y){var C=Pt,B=ac.transition;ac.transition=null;try{Pt=1,$m(a,l,f,y)}finally{Pt=C,ac.transition=B}}function Kk(a,l,f,y){var C=Pt,B=ac.transition;ac.transition=null;try{Pt=4,$m(a,l,f,y)}finally{Pt=C,ac.transition=B}}function $m(a,l,f,y){if(Mf){var C=e0(a,l,f,y);if(C===null)m0(a,l,y,Sf,f),JI(a,y);else if(Yk(C,a,l,f,y))y.stopPropagation();else if(JI(a,y),l&4&&-1<Wk.indexOf(a)){for(;C!==null;){var B=dh(C);if(B!==null&&YI(B),B=e0(a,l,f,y),B===null&&m0(a,l,y,Sf,f),B===C)break;C=B}C!==null&&y.stopPropagation()}else m0(a,l,y,null,f)}}var Sf=null;function e0(a,l,f,y){if(Sf=null,a=me(y),a=Ro(a),a!==null)if(l=Us(a),l===null)a=null;else if(f=l.tag,f===13){if(a=F(l),a!==null)return a;a=null}else if(f===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;a=null}else l!==a&&(a=null);return Sf=a,null}function eC(a){switch(a){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(ut()){case ot:return 1;case Rr:return 4;case er:case Bn:return 16;case hi:return 536870912;default:return 16}default:return 16}}var Ba=null,t0=null,Tf=null;function tC(){if(Tf)return Tf;var a,l=t0,f=l.length,y,C="value"in Ba?Ba.value:Ba.textContent,B=C.length;for(a=0;a<f&&l[a]===C[a];a++);var U=f-a;for(y=1;y<=U&&l[f-y]===C[B-y];y++);return Tf=C.slice(a,1<y?1-y:void 0)}function Bf(a){var l=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&l===13&&(a=13)):a=l,a===10&&(a=13),32<=a||a===13?a:0}function bf(){return!0}function rC(){return!1}function Jn(a){function l(f,y,C,B,U){this._reactName=f,this._targetInst=C,this.type=y,this.nativeEvent=B,this.target=U,this.currentTarget=null;for(var q in a)a.hasOwnProperty(q)&&(f=a[q],this[q]=f?f(B):B[q]);return this.isDefaultPrevented=(B.defaultPrevented!=null?B.defaultPrevented:B.returnValue===!1)?bf:rC,this.isPropagationStopped=rC,this}return Q(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=bf)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=bf)},persist:function(){},isPersistent:bf}),l}var oc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},r0=Jn(oc),th=Q({},oc,{view:0,detail:0}),Jk=Jn(th),n0,i0,rh,Rf=Q({},th,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:a0,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==rh&&(rh&&a.type==="mousemove"?(n0=a.screenX-rh.screenX,i0=a.screenY-rh.screenY):i0=n0=0,rh=a),n0)},movementY:function(a){return"movementY"in a?a.movementY:i0}}),nC=Jn(Rf),Zk=Q({},Rf,{dataTransfer:0}),$k=Jn(Zk),e7=Q({},th,{relatedTarget:0}),s0=Jn(e7),t7=Q({},oc,{animationName:0,elapsedTime:0,pseudoElement:0}),r7=Jn(t7),n7=Q({},oc,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),i7=Jn(n7),s7=Q({},oc,{data:0}),iC=Jn(s7),a7={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},o7={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"},l7={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function c7(a){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(a):(a=l7[a])?!!l[a]:!1}function a0(){return c7}var u7=Q({},th,{key:function(a){if(a.key){var l=a7[a.key]||a.key;if(l!=="Unidentified")return l}return a.type==="keypress"?(a=Bf(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?o7[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:a0,charCode:function(a){return a.type==="keypress"?Bf(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Bf(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),h7=Jn(u7),d7=Q({},Rf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sC=Jn(d7),f7=Q({},th,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:a0}),p7=Jn(f7),A7=Q({},oc,{propertyName:0,elapsedTime:0,pseudoElement:0}),g7=Jn(A7),m7=Q({},Rf,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),_7=Jn(m7),v7=[9,13,27,32],o0=c&&"CompositionEvent"in window,nh=null;c&&"documentMode"in document&&(nh=document.documentMode);var y7=c&&"TextEvent"in window&&!nh,aC=c&&(!o0||nh&&8<nh&&11>=nh),oC=String.fromCharCode(32),lC=!1;function cC(a,l){switch(a){case"keyup":return v7.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uC(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var lc=!1;function E7(a,l){switch(a){case"compositionend":return uC(l);case"keypress":return l.which!==32?null:(lC=!0,oC);case"textInput":return a=l.data,a===oC&&lC?null:a;default:return null}}function x7(a,l){if(lc)return a==="compositionend"||!o0&&cC(a,l)?(a=tC(),Tf=t0=Ba=null,lc=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return aC&&l.locale!=="ko"?null:l.data;default:return null}}var w7={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 hC(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l==="input"?!!w7[a.type]:l==="textarea"}function dC(a,l,f,y){Dt(y),l=Pf(l,"onChange"),0<l.length&&(f=new r0("onChange","change",null,f,y),a.push({event:f,listeners:l}))}var ih=null,sh=null;function I7(a){bC(a,0)}function Df(a){var l=fc(a);if(rt(l))return a}function C7(a,l){if(a==="change")return l}var fC=!1;if(c){var l0;if(c){var c0="oninput"in document;if(!c0){var pC=document.createElement("div");pC.setAttribute("oninput","return;"),c0=typeof pC.oninput=="function"}l0=c0}else l0=!1;fC=l0&&(!document.documentMode||9<document.documentMode)}function AC(){ih&&(ih.detachEvent("onpropertychange",gC),sh=ih=null)}function gC(a){if(a.propertyName==="value"&&Df(sh)){var l=[];dC(l,sh,a,me(a)),Vt(I7,l)}}function M7(a,l,f){a==="focusin"?(AC(),ih=l,sh=f,ih.attachEvent("onpropertychange",gC)):a==="focusout"&&AC()}function S7(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Df(sh)}function T7(a,l){if(a==="click")return Df(l)}function B7(a,l){if(a==="input"||a==="change")return Df(l)}function b7(a,l){return a===l&&(a!==0||1/a===1/l)||a!==a&&l!==l}var Ui=typeof Object.is=="function"?Object.is:b7;function ah(a,l){if(Ui(a,l))return!0;if(typeof a!="object"||a===null||typeof l!="object"||l===null)return!1;var f=Object.keys(a),y=Object.keys(l);if(f.length!==y.length)return!1;for(y=0;y<f.length;y++){var C=f[y];if(!h.call(l,C)||!Ui(a[C],l[C]))return!1}return!0}function mC(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function _C(a,l){var f=mC(a);a=0;for(var y;f;){if(f.nodeType===3){if(y=a+f.textContent.length,a<=l&&y>=l)return{node:f,offset:l-a};a=y}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=mC(f)}}function vC(a,l){return a&&l?a===l?!0:a&&a.nodeType===3?!1:l&&l.nodeType===3?vC(a,l.parentNode):"contains"in a?a.contains(l):a.compareDocumentPosition?!!(a.compareDocumentPosition(l)&16):!1:!1}function yC(){for(var a=window,l=Pe();l instanceof a.HTMLIFrameElement;){try{var f=typeof l.contentWindow.location.href=="string"}catch{f=!1}if(f)a=l.contentWindow;else break;l=Pe(a.document)}return l}function u0(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l&&(l==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||l==="textarea"||a.contentEditable==="true")}function R7(a){var l=yC(),f=a.focusedElem,y=a.selectionRange;if(l!==f&&f&&f.ownerDocument&&vC(f.ownerDocument.documentElement,f)){if(y!==null&&u0(f)){if(l=y.start,a=y.end,a===void 0&&(a=l),"selectionStart"in f)f.selectionStart=l,f.selectionEnd=Math.min(a,f.value.length);else if(a=(l=f.ownerDocument||document)&&l.defaultView||window,a.getSelection){a=a.getSelection();var C=f.textContent.length,B=Math.min(y.start,C);y=y.end===void 0?B:Math.min(y.end,C),!a.extend&&B>y&&(C=y,y=B,B=C),C=_C(f,B);var U=_C(f,y);C&&U&&(a.rangeCount!==1||a.anchorNode!==C.node||a.anchorOffset!==C.offset||a.focusNode!==U.node||a.focusOffset!==U.offset)&&(l=l.createRange(),l.setStart(C.node,C.offset),a.removeAllRanges(),B>y?(a.addRange(l),a.extend(U.node,U.offset)):(l.setEnd(U.node,U.offset),a.addRange(l)))}}for(l=[],a=f;a=a.parentNode;)a.nodeType===1&&l.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<l.length;f++)a=l[f],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var D7=c&&"documentMode"in document&&11>=document.documentMode,cc=null,h0=null,oh=null,d0=!1;function EC(a,l,f){var y=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;d0||cc==null||cc!==Pe(y)||(y=cc,"selectionStart"in y&&u0(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),oh&&ah(oh,y)||(oh=y,y=Pf(h0,"onSelect"),0<y.length&&(l=new r0("onSelect","select",null,l,f),a.push({event:l,listeners:y}),l.target=cc)))}function Lf(a,l){var f={};return f[a.toLowerCase()]=l.toLowerCase(),f["Webkit"+a]="webkit"+l,f["Moz"+a]="moz"+l,f}var uc={animationend:Lf("Animation","AnimationEnd"),animationiteration:Lf("Animation","AnimationIteration"),animationstart:Lf("Animation","AnimationStart"),transitionend:Lf("Transition","TransitionEnd")},f0={},xC={};c&&(xC=document.createElement("div").style,"AnimationEvent"in window||(delete uc.animationend.animation,delete uc.animationiteration.animation,delete uc.animationstart.animation),"TransitionEvent"in window||delete uc.transitionend.transition);function Nf(a){if(f0[a])return f0[a];if(!uc[a])return a;var l=uc[a],f;for(f in l)if(l.hasOwnProperty(f)&&f in xC)return f0[a]=l[f];return a}var wC=Nf("animationend"),IC=Nf("animationiteration"),CC=Nf("animationstart"),MC=Nf("transitionend"),SC=new Map,TC="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 ba(a,l){SC.set(a,l),s(l,[a])}for(var p0=0;p0<TC.length;p0++){var A0=TC[p0],L7=A0.toLowerCase(),N7=A0[0].toUpperCase()+A0.slice(1);ba(L7,"on"+N7)}ba(wC,"onAnimationEnd"),ba(IC,"onAnimationIteration"),ba(CC,"onAnimationStart"),ba("dblclick","onDoubleClick"),ba("focusin","onFocus"),ba("focusout","onBlur"),ba(MC,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var lh="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(" "),U7=new Set("cancel close invalid load scroll toggle".split(" ").concat(lh));function BC(a,l,f){var y=a.type||"unknown-event";a.currentTarget=f,qm(y,l,void 0,a),a.currentTarget=null}function bC(a,l){l=(l&4)!==0;for(var f=0;f<a.length;f++){var y=a[f],C=y.event;y=y.listeners;e:{var B=void 0;if(l)for(var U=y.length-1;0<=U;U--){var q=y[U],J=q.instance,ce=q.currentTarget;if(q=q.listener,J!==B&&C.isPropagationStopped())break e;BC(C,q,ce),B=J}else for(U=0;U<y.length;U++){if(q=y[U],J=q.instance,ce=q.currentTarget,q=q.listener,J!==B&&C.isPropagationStopped())break e;BC(C,q,ce),B=J}}}if(Ns)throw a=sc,Ns=!1,sc=null,a}function Xt(a,l){var f=l[w0];f===void 0&&(f=l[w0]=new Set);var y=a+"__bubble";f.has(y)||(RC(l,a,2,!1),f.add(y))}function g0(a,l,f){var y=0;l&&(y|=4),RC(f,a,y,l)}var Uf="_reactListening"+Math.random().toString(36).slice(2);function ch(a){if(!a[Uf]){a[Uf]=!0,n.forEach(function(f){f!=="selectionchange"&&(U7.has(f)||g0(f,!1,a),g0(f,!0,a))});var l=a.nodeType===9?a:a.ownerDocument;l===null||l[Uf]||(l[Uf]=!0,g0("selectionchange",!1,l))}}function RC(a,l,f,y){switch(eC(l)){case 1:var C=Xk;break;case 4:C=Kk;break;default:C=$m}f=C.bind(null,l,f,a),C=void 0,!Tn||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(C=!0),y?C!==void 0?a.addEventListener(l,f,{capture:!0,passive:C}):a.addEventListener(l,f,!0):C!==void 0?a.addEventListener(l,f,{passive:C}):a.addEventListener(l,f,!1)}function m0(a,l,f,y,C){var B=y;if(!(l&1)&&!(l&2)&&y!==null)e:for(;;){if(y===null)return;var U=y.tag;if(U===3||U===4){var q=y.stateNode.containerInfo;if(q===C||q.nodeType===8&&q.parentNode===C)break;if(U===4)for(U=y.return;U!==null;){var J=U.tag;if((J===3||J===4)&&(J=U.stateNode.containerInfo,J===C||J.nodeType===8&&J.parentNode===C))return;U=U.return}for(;q!==null;){if(U=Ro(q),U===null)return;if(J=U.tag,J===5||J===6){y=B=U;continue e}q=q.parentNode}}y=y.return}Vt(function(){var ce=B,we=me(f),Ie=[];e:{var xe=SC.get(a);if(xe!==void 0){var Le=r0,ze=a;switch(a){case"keypress":if(Bf(f)===0)break e;case"keydown":case"keyup":Le=h7;break;case"focusin":ze="focus",Le=s0;break;case"focusout":ze="blur",Le=s0;break;case"beforeblur":case"afterblur":Le=s0;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Le=nC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Le=$k;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Le=p7;break;case wC:case IC:case CC:Le=r7;break;case MC:Le=g7;break;case"scroll":Le=Jk;break;case"wheel":Le=_7;break;case"copy":case"cut":case"paste":Le=i7;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Le=sC}var Ve=(l&4)!==0,vr=!Ve&&a==="scroll",se=Ve?xe!==null?xe+"Capture":null:xe;Ve=[];for(var $=ce,oe;$!==null;){oe=$;var Me=oe.stateNode;if(oe.tag===5&&Me!==null&&(oe=Me,se!==null&&(Me=mr($,se),Me!=null&&Ve.push(uh($,Me,oe)))),vr)break;$=$.return}0<Ve.length&&(xe=new Le(xe,ze,null,f,we),Ie.push({event:xe,listeners:Ve}))}}if(!(l&7)){e:{if(xe=a==="mouseover"||a==="pointerover",Le=a==="mouseout"||a==="pointerout",xe&&f!==O&&(ze=f.relatedTarget||f.fromElement)&&(Ro(ze)||ze[ks]))break e;if((Le||xe)&&(xe=we.window===we?we:(xe=we.ownerDocument)?xe.defaultView||xe.parentWindow:window,Le?(ze=f.relatedTarget||f.toElement,Le=ce,ze=ze?Ro(ze):null,ze!==null&&(vr=Us(ze),ze!==vr||ze.tag!==5&&ze.tag!==6)&&(ze=null)):(Le=null,ze=ce),Le!==ze)){if(Ve=nC,Me="onMouseLeave",se="onMouseEnter",$="mouse",(a==="pointerout"||a==="pointerover")&&(Ve=sC,Me="onPointerLeave",se="onPointerEnter",$="pointer"),vr=Le==null?xe:fc(Le),oe=ze==null?xe:fc(ze),xe=new Ve(Me,$+"leave",Le,f,we),xe.target=vr,xe.relatedTarget=oe,Me=null,Ro(we)===ce&&(Ve=new Ve(se,$+"enter",ze,f,we),Ve.target=oe,Ve.relatedTarget=vr,Me=Ve),vr=Me,Le&&ze)t:{for(Ve=Le,se=ze,$=0,oe=Ve;oe;oe=hc(oe))$++;for(oe=0,Me=se;Me;Me=hc(Me))oe++;for(;0<$-oe;)Ve=hc(Ve),$--;for(;0<oe-$;)se=hc(se),oe--;for(;$--;){if(Ve===se||se!==null&&Ve===se.alternate)break t;Ve=hc(Ve),se=hc(se)}Ve=null}else Ve=null;Le!==null&&DC(Ie,xe,Le,Ve,!1),ze!==null&&vr!==null&&DC(Ie,vr,ze,Ve,!0)}}e:{if(xe=ce?fc(ce):window,Le=xe.nodeName&&xe.nodeName.toLowerCase(),Le==="select"||Le==="input"&&xe.type==="file")var je=C7;else if(hC(xe))if(fC)je=B7;else{je=S7;var Ke=M7}else(Le=xe.nodeName)&&Le.toLowerCase()==="input"&&(xe.type==="checkbox"||xe.type==="radio")&&(je=T7);if(je&&(je=je(a,ce))){dC(Ie,je,f,we);break e}Ke&&Ke(a,xe,ce),a==="focusout"&&(Ke=xe._wrapperState)&&Ke.controlled&&xe.type==="number"&&ee(xe,"number",xe.value)}switch(Ke=ce?fc(ce):window,a){case"focusin":(hC(Ke)||Ke.contentEditable==="true")&&(cc=Ke,h0=ce,oh=null);break;case"focusout":oh=h0=cc=null;break;case"mousedown":d0=!0;break;case"contextmenu":case"mouseup":case"dragend":d0=!1,EC(Ie,f,we);break;case"selectionchange":if(D7)break;case"keydown":case"keyup":EC(Ie,f,we)}var Je;if(o0)e:{switch(a){case"compositionstart":var st="onCompositionStart";break e;case"compositionend":st="onCompositionEnd";break e;case"compositionupdate":st="onCompositionUpdate";break e}st=void 0}else lc?cC(a,f)&&(st="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(st="onCompositionStart");st&&(aC&&f.locale!=="ko"&&(lc||st!=="onCompositionStart"?st==="onCompositionEnd"&&lc&&(Je=tC()):(Ba=we,t0="value"in Ba?Ba.value:Ba.textContent,lc=!0)),Ke=Pf(ce,st),0<Ke.length&&(st=new iC(st,a,null,f,we),Ie.push({event:st,listeners:Ke}),Je?st.data=Je:(Je=uC(f),Je!==null&&(st.data=Je)))),(Je=y7?E7(a,f):x7(a,f))&&(ce=Pf(ce,"onBeforeInput"),0<ce.length&&(we=new iC("onBeforeInput","beforeinput",null,f,we),Ie.push({event:we,listeners:ce}),we.data=Je))}bC(Ie,l)})}function uh(a,l,f){return{instance:a,listener:l,currentTarget:f}}function Pf(a,l){for(var f=l+"Capture",y=[];a!==null;){var C=a,B=C.stateNode;C.tag===5&&B!==null&&(C=B,B=mr(a,f),B!=null&&y.unshift(uh(a,B,C)),B=mr(a,l),B!=null&&y.push(uh(a,B,C))),a=a.return}return y}function hc(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function DC(a,l,f,y,C){for(var B=l._reactName,U=[];f!==null&&f!==y;){var q=f,J=q.alternate,ce=q.stateNode;if(J!==null&&J===y)break;q.tag===5&&ce!==null&&(q=ce,C?(J=mr(f,B),J!=null&&U.unshift(uh(f,J,q))):C||(J=mr(f,B),J!=null&&U.push(uh(f,J,q)))),f=f.return}U.length!==0&&a.push({event:l,listeners:U})}var P7=/\r\n?/g,k7=/\u0000|\uFFFD/g;function LC(a){return(typeof a=="string"?a:""+a).replace(P7,`
4486
- `).replace(k7,"")}function kf(a,l,f){if(l=LC(l),LC(a)!==l&&f)throw Error(t(425))}function Qf(){}var _0=null,v0=null;function y0(a,l){return a==="textarea"||a==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var E0=typeof setTimeout=="function"?setTimeout:void 0,Q7=typeof clearTimeout=="function"?clearTimeout:void 0,NC=typeof Promise=="function"?Promise:void 0,O7=typeof queueMicrotask=="function"?queueMicrotask:typeof NC<"u"?function(a){return NC.resolve(null).then(a).catch(F7)}:E0;function F7(a){setTimeout(function(){throw a})}function x0(a,l){var f=l,y=0;do{var C=f.nextSibling;if(a.removeChild(f),C&&C.nodeType===8)if(f=C.data,f==="/$"){if(y===0){a.removeChild(C),eh(l);return}y--}else f!=="$"&&f!=="$?"&&f!=="$!"||y++;f=C}while(f);eh(l)}function Ra(a){for(;a!=null;a=a.nextSibling){var l=a.nodeType;if(l===1||l===3)break;if(l===8){if(l=a.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return a}function UC(a){a=a.previousSibling;for(var l=0;a;){if(a.nodeType===8){var f=a.data;if(f==="$"||f==="$!"||f==="$?"){if(l===0)return a;l--}else f==="/$"&&l++}a=a.previousSibling}return null}var dc=Math.random().toString(36).slice(2),ns="__reactFiber$"+dc,hh="__reactProps$"+dc,ks="__reactContainer$"+dc,w0="__reactEvents$"+dc,z7="__reactListeners$"+dc,H7="__reactHandles$"+dc;function Ro(a){var l=a[ns];if(l)return l;for(var f=a.parentNode;f;){if(l=f[ks]||f[ns]){if(f=l.alternate,l.child!==null||f!==null&&f.child!==null)for(a=UC(a);a!==null;){if(f=a[ns])return f;a=UC(a)}return l}a=f,f=a.parentNode}return null}function dh(a){return a=a[ns]||a[ks],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function fc(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(t(33))}function Of(a){return a[hh]||null}var I0=[],pc=-1;function Da(a){return{current:a}}function Kt(a){0>pc||(a.current=I0[pc],I0[pc]=null,pc--)}function Wt(a,l){pc++,I0[pc]=a.current,a.current=l}var La={},tn=Da(La),Dn=Da(!1),Do=La;function Ac(a,l){var f=a.type.contextTypes;if(!f)return La;var y=a.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===l)return y.__reactInternalMemoizedMaskedChildContext;var C={},B;for(B in f)C[B]=l[B];return y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=l,a.__reactInternalMemoizedMaskedChildContext=C),C}function Ln(a){return a=a.childContextTypes,a!=null}function Ff(){Kt(Dn),Kt(tn)}function PC(a,l,f){if(tn.current!==La)throw Error(t(168));Wt(tn,l),Wt(Dn,f)}function kC(a,l,f){var y=a.stateNode;if(l=l.childContextTypes,typeof y.getChildContext!="function")return f;y=y.getChildContext();for(var C in y)if(!(C in l))throw Error(t(108,ve(a)||"Unknown",C));return Q({},f,y)}function zf(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||La,Do=tn.current,Wt(tn,a),Wt(Dn,Dn.current),!0}function QC(a,l,f){var y=a.stateNode;if(!y)throw Error(t(169));f?(a=kC(a,l,Do),y.__reactInternalMemoizedMergedChildContext=a,Kt(Dn),Kt(tn),Wt(tn,a)):Kt(Dn),Wt(Dn,f)}var Qs=null,Hf=!1,C0=!1;function OC(a){Qs===null?Qs=[a]:Qs.push(a)}function G7(a){Hf=!0,OC(a)}function Na(){if(!C0&&Qs!==null){C0=!0;var a=0,l=Pt;try{var f=Qs;for(Pt=1;a<f.length;a++){var y=f[a];do y=y(!0);while(y!==null)}Qs=null,Hf=!1}catch(C){throw Qs!==null&&(Qs=Qs.slice(a+1)),Be(ot,Na),C}finally{Pt=l,C0=!1}}return null}var gc=[],mc=0,Gf=null,Vf=0,di=[],fi=0,Lo=null,Os=1,Fs="";function No(a,l){gc[mc++]=Vf,gc[mc++]=Gf,Gf=a,Vf=l}function FC(a,l,f){di[fi++]=Os,di[fi++]=Fs,di[fi++]=Lo,Lo=a;var y=Os;a=Fs;var C=32-pn(y)-1;y&=~(1<<C),f+=1;var B=32-pn(l)+C;if(30<B){var U=C-C%5;B=(y&(1<<U)-1).toString(32),y>>=U,C-=U,Os=1<<32-pn(l)+C|f<<C|y,Fs=B+a}else Os=1<<B|f<<C|y,Fs=a}function M0(a){a.return!==null&&(No(a,1),FC(a,1,0))}function S0(a){for(;a===Gf;)Gf=gc[--mc],gc[mc]=null,Vf=gc[--mc],gc[mc]=null;for(;a===Lo;)Lo=di[--fi],di[fi]=null,Fs=di[--fi],di[fi]=null,Os=di[--fi],di[fi]=null}var Zn=null,$n=null,tr=!1,Pi=null;function zC(a,l){var f=mi(5,null,null,0);f.elementType="DELETED",f.stateNode=l,f.return=a,l=a.deletions,l===null?(a.deletions=[f],a.flags|=16):l.push(f)}function HC(a,l){switch(a.tag){case 5:var f=a.type;return l=l.nodeType!==1||f.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(a.stateNode=l,Zn=a,$n=Ra(l.firstChild),!0):!1;case 6:return l=a.pendingProps===""||l.nodeType!==3?null:l,l!==null?(a.stateNode=l,Zn=a,$n=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(f=Lo!==null?{id:Os,overflow:Fs}:null,a.memoizedState={dehydrated:l,treeContext:f,retryLane:1073741824},f=mi(18,null,null,0),f.stateNode=l,f.return=a,a.child=f,Zn=a,$n=null,!0):!1;default:return!1}}function T0(a){return(a.mode&1)!==0&&(a.flags&128)===0}function B0(a){if(tr){var l=$n;if(l){var f=l;if(!HC(a,l)){if(T0(a))throw Error(t(418));l=Ra(f.nextSibling);var y=Zn;l&&HC(a,l)?zC(y,f):(a.flags=a.flags&-4097|2,tr=!1,Zn=a)}}else{if(T0(a))throw Error(t(418));a.flags=a.flags&-4097|2,tr=!1,Zn=a}}}function GC(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;Zn=a}function jf(a){if(a!==Zn)return!1;if(!tr)return GC(a),tr=!0,!1;var l;if((l=a.tag!==3)&&!(l=a.tag!==5)&&(l=a.type,l=l!=="head"&&l!=="body"&&!y0(a.type,a.memoizedProps)),l&&(l=$n)){if(T0(a))throw VC(),Error(t(418));for(;l;)zC(a,l),l=Ra(l.nextSibling)}if(GC(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(t(317));e:{for(a=a.nextSibling,l=0;a;){if(a.nodeType===8){var f=a.data;if(f==="/$"){if(l===0){$n=Ra(a.nextSibling);break e}l--}else f!=="$"&&f!=="$!"&&f!=="$?"||l++}a=a.nextSibling}$n=null}}else $n=Zn?Ra(a.stateNode.nextSibling):null;return!0}function VC(){for(var a=$n;a;)a=Ra(a.nextSibling)}function _c(){$n=Zn=null,tr=!1}function b0(a){Pi===null?Pi=[a]:Pi.push(a)}var V7=I.ReactCurrentBatchConfig;function ki(a,l){if(a&&a.defaultProps){l=Q({},l),a=a.defaultProps;for(var f in a)l[f]===void 0&&(l[f]=a[f]);return l}return l}var Wf=Da(null),Yf=null,vc=null,R0=null;function D0(){R0=vc=Yf=null}function L0(a){var l=Wf.current;Kt(Wf),a._currentValue=l}function N0(a,l,f){for(;a!==null;){var y=a.alternate;if((a.childLanes&l)!==l?(a.childLanes|=l,y!==null&&(y.childLanes|=l)):y!==null&&(y.childLanes&l)!==l&&(y.childLanes|=l),a===f)break;a=a.return}}function yc(a,l){Yf=a,R0=vc=null,a=a.dependencies,a!==null&&a.firstContext!==null&&(a.lanes&l&&(Nn=!0),a.firstContext=null)}function pi(a){var l=a._currentValue;if(R0!==a)if(a={context:a,memoizedValue:l,next:null},vc===null){if(Yf===null)throw Error(t(308));vc=a,Yf.dependencies={lanes:0,firstContext:a}}else vc=vc.next=a;return l}var Uo=null;function U0(a){Uo===null?Uo=[a]:Uo.push(a)}function jC(a,l,f,y){var C=l.interleaved;return C===null?(f.next=f,U0(l)):(f.next=C.next,C.next=f),l.interleaved=f,zs(a,y)}function zs(a,l){a.lanes|=l;var f=a.alternate;for(f!==null&&(f.lanes|=l),f=a,a=a.return;a!==null;)a.childLanes|=l,f=a.alternate,f!==null&&(f.childLanes|=l),f=a,a=a.return;return f.tag===3?f.stateNode:null}var Ua=!1;function P0(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function WC(a,l){a=a.updateQueue,l.updateQueue===a&&(l.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function Hs(a,l){return{eventTime:a,lane:l,tag:0,payload:null,callback:null,next:null}}function Pa(a,l,f){var y=a.updateQueue;if(y===null)return null;if(y=y.shared,Mt&2){var C=y.pending;return C===null?l.next=l:(l.next=C.next,C.next=l),y.pending=l,zs(a,f)}return C=y.interleaved,C===null?(l.next=l,U0(y)):(l.next=C.next,C.next=l),y.interleaved=l,zs(a,f)}function qf(a,l,f){if(l=l.updateQueue,l!==null&&(l=l.shared,(f&4194240)!==0)){var y=l.lanes;y&=a.pendingLanes,f|=y,l.lanes=f,Km(a,f)}}function YC(a,l){var f=a.updateQueue,y=a.alternate;if(y!==null&&(y=y.updateQueue,f===y)){var C=null,B=null;if(f=f.firstBaseUpdate,f!==null){do{var U={eventTime:f.eventTime,lane:f.lane,tag:f.tag,payload:f.payload,callback:f.callback,next:null};B===null?C=B=U:B=B.next=U,f=f.next}while(f!==null);B===null?C=B=l:B=B.next=l}else C=B=l;f={baseState:y.baseState,firstBaseUpdate:C,lastBaseUpdate:B,shared:y.shared,effects:y.effects},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=l:a.next=l,f.lastBaseUpdate=l}function Xf(a,l,f,y){var C=a.updateQueue;Ua=!1;var B=C.firstBaseUpdate,U=C.lastBaseUpdate,q=C.shared.pending;if(q!==null){C.shared.pending=null;var J=q,ce=J.next;J.next=null,U===null?B=ce:U.next=ce,U=J;var we=a.alternate;we!==null&&(we=we.updateQueue,q=we.lastBaseUpdate,q!==U&&(q===null?we.firstBaseUpdate=ce:q.next=ce,we.lastBaseUpdate=J))}if(B!==null){var Ie=C.baseState;U=0,we=ce=J=null,q=B;do{var xe=q.lane,Le=q.eventTime;if((y&xe)===xe){we!==null&&(we=we.next={eventTime:Le,lane:0,tag:q.tag,payload:q.payload,callback:q.callback,next:null});e:{var ze=a,Ve=q;switch(xe=l,Le=f,Ve.tag){case 1:if(ze=Ve.payload,typeof ze=="function"){Ie=ze.call(Le,Ie,xe);break e}Ie=ze;break e;case 3:ze.flags=ze.flags&-65537|128;case 0:if(ze=Ve.payload,xe=typeof ze=="function"?ze.call(Le,Ie,xe):ze,xe==null)break e;Ie=Q({},Ie,xe);break e;case 2:Ua=!0}}q.callback!==null&&q.lane!==0&&(a.flags|=64,xe=C.effects,xe===null?C.effects=[q]:xe.push(q))}else Le={eventTime:Le,lane:xe,tag:q.tag,payload:q.payload,callback:q.callback,next:null},we===null?(ce=we=Le,J=Ie):we=we.next=Le,U|=xe;if(q=q.next,q===null){if(q=C.shared.pending,q===null)break;xe=q,q=xe.next,xe.next=null,C.lastBaseUpdate=xe,C.shared.pending=null}}while(1);if(we===null&&(J=Ie),C.baseState=J,C.firstBaseUpdate=ce,C.lastBaseUpdate=we,l=C.shared.interleaved,l!==null){C=l;do U|=C.lane,C=C.next;while(C!==l)}else B===null&&(C.shared.lanes=0);Qo|=U,a.lanes=U,a.memoizedState=Ie}}function qC(a,l,f){if(a=l.effects,l.effects=null,a!==null)for(l=0;l<a.length;l++){var y=a[l],C=y.callback;if(C!==null){if(y.callback=null,y=f,typeof C!="function")throw Error(t(191,C));C.call(y)}}}var XC=new r.Component().refs;function k0(a,l,f,y){l=a.memoizedState,f=f(y,l),f=f==null?l:Q({},l,f),a.memoizedState=f,a.lanes===0&&(a.updateQueue.baseState=f)}var Kf={isMounted:function(a){return(a=a._reactInternals)?Us(a)===a:!1},enqueueSetState:function(a,l,f){a=a._reactInternals;var y=gn(),C=Fa(a),B=Hs(y,C);B.payload=l,f!=null&&(B.callback=f),l=Pa(a,B,C),l!==null&&(Fi(l,a,C,y),qf(l,a,C))},enqueueReplaceState:function(a,l,f){a=a._reactInternals;var y=gn(),C=Fa(a),B=Hs(y,C);B.tag=1,B.payload=l,f!=null&&(B.callback=f),l=Pa(a,B,C),l!==null&&(Fi(l,a,C,y),qf(l,a,C))},enqueueForceUpdate:function(a,l){a=a._reactInternals;var f=gn(),y=Fa(a),C=Hs(f,y);C.tag=2,l!=null&&(C.callback=l),l=Pa(a,C,y),l!==null&&(Fi(l,a,y,f),qf(l,a,y))}};function KC(a,l,f,y,C,B,U){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(y,B,U):l.prototype&&l.prototype.isPureReactComponent?!ah(f,y)||!ah(C,B):!0}function JC(a,l,f){var y=!1,C=La,B=l.contextType;return typeof B=="object"&&B!==null?B=pi(B):(C=Ln(l)?Do:tn.current,y=l.contextTypes,B=(y=y!=null)?Ac(a,C):La),l=new l(f,B),a.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Kf,a.stateNode=l,l._reactInternals=a,y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=C,a.__reactInternalMemoizedMaskedChildContext=B),l}function ZC(a,l,f,y){a=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(f,y),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(f,y),l.state!==a&&Kf.enqueueReplaceState(l,l.state,null)}function Q0(a,l,f,y){var C=a.stateNode;C.props=f,C.state=a.memoizedState,C.refs=XC,P0(a);var B=l.contextType;typeof B=="object"&&B!==null?C.context=pi(B):(B=Ln(l)?Do:tn.current,C.context=Ac(a,B)),C.state=a.memoizedState,B=l.getDerivedStateFromProps,typeof B=="function"&&(k0(a,l,B,f),C.state=a.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(l=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),l!==C.state&&Kf.enqueueReplaceState(C,C.state,null),Xf(a,f,C,y),C.state=a.memoizedState),typeof C.componentDidMount=="function"&&(a.flags|=4194308)}function fh(a,l,f){if(a=f.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(f._owner){if(f=f._owner,f){if(f.tag!==1)throw Error(t(309));var y=f.stateNode}if(!y)throw Error(t(147,a));var C=y,B=""+a;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===B?l.ref:(l=function(U){var q=C.refs;q===XC&&(q=C.refs={}),U===null?delete q[B]:q[B]=U},l._stringRef=B,l)}if(typeof a!="string")throw Error(t(284));if(!f._owner)throw Error(t(290,a))}return a}function Jf(a,l){throw a=Object.prototype.toString.call(l),Error(t(31,a==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":a))}function $C(a){var l=a._init;return l(a._payload)}function e3(a){function l(se,$){if(a){var oe=se.deletions;oe===null?(se.deletions=[$],se.flags|=16):oe.push($)}}function f(se,$){if(!a)return null;for(;$!==null;)l(se,$),$=$.sibling;return null}function y(se,$){for(se=new Map;$!==null;)$.key!==null?se.set($.key,$):se.set($.index,$),$=$.sibling;return se}function C(se,$){return se=Ha(se,$),se.index=0,se.sibling=null,se}function B(se,$,oe){return se.index=oe,a?(oe=se.alternate,oe!==null?(oe=oe.index,oe<$?(se.flags|=2,$):oe):(se.flags|=2,$)):(se.flags|=1048576,$)}function U(se){return a&&se.alternate===null&&(se.flags|=2),se}function q(se,$,oe,Me){return $===null||$.tag!==6?($=E1(oe,se.mode,Me),$.return=se,$):($=C($,oe),$.return=se,$)}function J(se,$,oe,Me){var je=oe.type;return je===T?we(se,$,oe.props.children,Me,oe.key):$!==null&&($.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===K&&$C(je)===$.type)?(Me=C($,oe.props),Me.ref=fh(se,$,oe),Me.return=se,Me):(Me=gp(oe.type,oe.key,oe.props,null,se.mode,Me),Me.ref=fh(se,$,oe),Me.return=se,Me)}function ce(se,$,oe,Me){return $===null||$.tag!==4||$.stateNode.containerInfo!==oe.containerInfo||$.stateNode.implementation!==oe.implementation?($=x1(oe,se.mode,Me),$.return=se,$):($=C($,oe.children||[]),$.return=se,$)}function we(se,$,oe,Me,je){return $===null||$.tag!==7?($=Ho(oe,se.mode,Me,je),$.return=se,$):($=C($,oe),$.return=se,$)}function Ie(se,$,oe){if(typeof $=="string"&&$!==""||typeof $=="number")return $=E1(""+$,se.mode,oe),$.return=se,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case R:return oe=gp($.type,$.key,$.props,null,se.mode,oe),oe.ref=fh(se,null,$),oe.return=se,oe;case S:return $=x1($,se.mode,oe),$.return=se,$;case K:var Me=$._init;return Ie(se,Me($._payload),oe)}if(ue($)||te($))return $=Ho($,se.mode,oe,null),$.return=se,$;Jf(se,$)}return null}function xe(se,$,oe,Me){var je=$!==null?$.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number")return je!==null?null:q(se,$,""+oe,Me);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case R:return oe.key===je?J(se,$,oe,Me):null;case S:return oe.key===je?ce(se,$,oe,Me):null;case K:return je=oe._init,xe(se,$,je(oe._payload),Me)}if(ue(oe)||te(oe))return je!==null?null:we(se,$,oe,Me,null);Jf(se,oe)}return null}function Le(se,$,oe,Me,je){if(typeof Me=="string"&&Me!==""||typeof Me=="number")return se=se.get(oe)||null,q($,se,""+Me,je);if(typeof Me=="object"&&Me!==null){switch(Me.$$typeof){case R:return se=se.get(Me.key===null?oe:Me.key)||null,J($,se,Me,je);case S:return se=se.get(Me.key===null?oe:Me.key)||null,ce($,se,Me,je);case K:var Ke=Me._init;return Le(se,$,oe,Ke(Me._payload),je)}if(ue(Me)||te(Me))return se=se.get(oe)||null,we($,se,Me,je,null);Jf($,Me)}return null}function ze(se,$,oe,Me){for(var je=null,Ke=null,Je=$,st=$=0,Vr=null;Je!==null&&st<oe.length;st++){Je.index>st?(Vr=Je,Je=null):Vr=Je.sibling;var Tt=xe(se,Je,oe[st],Me);if(Tt===null){Je===null&&(Je=Vr);break}a&&Je&&Tt.alternate===null&&l(se,Je),$=B(Tt,$,st),Ke===null?je=Tt:Ke.sibling=Tt,Ke=Tt,Je=Vr}if(st===oe.length)return f(se,Je),tr&&No(se,st),je;if(Je===null){for(;st<oe.length;st++)Je=Ie(se,oe[st],Me),Je!==null&&($=B(Je,$,st),Ke===null?je=Je:Ke.sibling=Je,Ke=Je);return tr&&No(se,st),je}for(Je=y(se,Je);st<oe.length;st++)Vr=Le(Je,se,st,oe[st],Me),Vr!==null&&(a&&Vr.alternate!==null&&Je.delete(Vr.key===null?st:Vr.key),$=B(Vr,$,st),Ke===null?je=Vr:Ke.sibling=Vr,Ke=Vr);return a&&Je.forEach(function(Ga){return l(se,Ga)}),tr&&No(se,st),je}function Ve(se,$,oe,Me){var je=te(oe);if(typeof je!="function")throw Error(t(150));if(oe=je.call(oe),oe==null)throw Error(t(151));for(var Ke=je=null,Je=$,st=$=0,Vr=null,Tt=oe.next();Je!==null&&!Tt.done;st++,Tt=oe.next()){Je.index>st?(Vr=Je,Je=null):Vr=Je.sibling;var Ga=xe(se,Je,Tt.value,Me);if(Ga===null){Je===null&&(Je=Vr);break}a&&Je&&Ga.alternate===null&&l(se,Je),$=B(Ga,$,st),Ke===null?je=Ga:Ke.sibling=Ga,Ke=Ga,Je=Vr}if(Tt.done)return f(se,Je),tr&&No(se,st),je;if(Je===null){for(;!Tt.done;st++,Tt=oe.next())Tt=Ie(se,Tt.value,Me),Tt!==null&&($=B(Tt,$,st),Ke===null?je=Tt:Ke.sibling=Tt,Ke=Tt);return tr&&No(se,st),je}for(Je=y(se,Je);!Tt.done;st++,Tt=oe.next())Tt=Le(Je,se,st,Tt.value,Me),Tt!==null&&(a&&Tt.alternate!==null&&Je.delete(Tt.key===null?st:Tt.key),$=B(Tt,$,st),Ke===null?je=Tt:Ke.sibling=Tt,Ke=Tt);return a&&Je.forEach(function(wQ){return l(se,wQ)}),tr&&No(se,st),je}function vr(se,$,oe,Me){if(typeof oe=="object"&&oe!==null&&oe.type===T&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case R:e:{for(var je=oe.key,Ke=$;Ke!==null;){if(Ke.key===je){if(je=oe.type,je===T){if(Ke.tag===7){f(se,Ke.sibling),$=C(Ke,oe.props.children),$.return=se,se=$;break e}}else if(Ke.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===K&&$C(je)===Ke.type){f(se,Ke.sibling),$=C(Ke,oe.props),$.ref=fh(se,Ke,oe),$.return=se,se=$;break e}f(se,Ke);break}else l(se,Ke);Ke=Ke.sibling}oe.type===T?($=Ho(oe.props.children,se.mode,Me,oe.key),$.return=se,se=$):(Me=gp(oe.type,oe.key,oe.props,null,se.mode,Me),Me.ref=fh(se,$,oe),Me.return=se,se=Me)}return U(se);case S:e:{for(Ke=oe.key;$!==null;){if($.key===Ke)if($.tag===4&&$.stateNode.containerInfo===oe.containerInfo&&$.stateNode.implementation===oe.implementation){f(se,$.sibling),$=C($,oe.children||[]),$.return=se,se=$;break e}else{f(se,$);break}else l(se,$);$=$.sibling}$=x1(oe,se.mode,Me),$.return=se,se=$}return U(se);case K:return Ke=oe._init,vr(se,$,Ke(oe._payload),Me)}if(ue(oe))return ze(se,$,oe,Me);if(te(oe))return Ve(se,$,oe,Me);Jf(se,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"?(oe=""+oe,$!==null&&$.tag===6?(f(se,$.sibling),$=C($,oe),$.return=se,se=$):(f(se,$),$=E1(oe,se.mode,Me),$.return=se,se=$),U(se)):f(se,$)}return vr}var Ec=e3(!0),t3=e3(!1),ph={},is=Da(ph),Ah=Da(ph),gh=Da(ph);function Po(a){if(a===ph)throw Error(t(174));return a}function O0(a,l){switch(Wt(gh,l),Wt(Ah,a),Wt(is,ph),a=l.nodeType,a){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:Ce(null,"");break;default:a=a===8?l.parentNode:l,l=a.namespaceURI||null,a=a.tagName,l=Ce(l,a)}Kt(is),Wt(is,l)}function xc(){Kt(is),Kt(Ah),Kt(gh)}function r3(a){Po(gh.current);var l=Po(is.current),f=Ce(l,a.type);l!==f&&(Wt(Ah,a),Wt(is,f))}function F0(a){Ah.current===a&&(Kt(is),Kt(Ah))}var sr=Da(0);function Zf(a){for(var l=a;l!==null;){if(l.tag===13){var f=l.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||f.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if(l.flags&128)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var z0=[];function H0(){for(var a=0;a<z0.length;a++)z0[a]._workInProgressVersionPrimary=null;z0.length=0}var $f=I.ReactCurrentDispatcher,G0=I.ReactCurrentBatchConfig,ko=0,ar=null,Dr=null,Hr=null,ep=!1,mh=!1,_h=0,j7=0;function rn(){throw Error(t(321))}function V0(a,l){if(l===null)return!1;for(var f=0;f<l.length&&f<a.length;f++)if(!Ui(a[f],l[f]))return!1;return!0}function j0(a,l,f,y,C,B){if(ko=B,ar=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,$f.current=a===null||a.memoizedState===null?X7:K7,a=f(y,C),mh){B=0;do{if(mh=!1,_h=0,25<=B)throw Error(t(301));B+=1,Hr=Dr=null,l.updateQueue=null,$f.current=J7,a=f(y,C)}while(mh)}if($f.current=np,l=Dr!==null&&Dr.next!==null,ko=0,Hr=Dr=ar=null,ep=!1,l)throw Error(t(300));return a}function W0(){var a=_h!==0;return _h=0,a}function ss(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Hr===null?ar.memoizedState=Hr=a:Hr=Hr.next=a,Hr}function Ai(){if(Dr===null){var a=ar.alternate;a=a!==null?a.memoizedState:null}else a=Dr.next;var l=Hr===null?ar.memoizedState:Hr.next;if(l!==null)Hr=l,Dr=a;else{if(a===null)throw Error(t(310));Dr=a,a={memoizedState:Dr.memoizedState,baseState:Dr.baseState,baseQueue:Dr.baseQueue,queue:Dr.queue,next:null},Hr===null?ar.memoizedState=Hr=a:Hr=Hr.next=a}return Hr}function vh(a,l){return typeof l=="function"?l(a):l}function Y0(a){var l=Ai(),f=l.queue;if(f===null)throw Error(t(311));f.lastRenderedReducer=a;var y=Dr,C=y.baseQueue,B=f.pending;if(B!==null){if(C!==null){var U=C.next;C.next=B.next,B.next=U}y.baseQueue=C=B,f.pending=null}if(C!==null){B=C.next,y=y.baseState;var q=U=null,J=null,ce=B;do{var we=ce.lane;if((ko&we)===we)J!==null&&(J=J.next={lane:0,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),y=ce.hasEagerState?ce.eagerState:a(y,ce.action);else{var Ie={lane:we,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null};J===null?(q=J=Ie,U=y):J=J.next=Ie,ar.lanes|=we,Qo|=we}ce=ce.next}while(ce!==null&&ce!==B);J===null?U=y:J.next=q,Ui(y,l.memoizedState)||(Nn=!0),l.memoizedState=y,l.baseState=U,l.baseQueue=J,f.lastRenderedState=y}if(a=f.interleaved,a!==null){C=a;do B=C.lane,ar.lanes|=B,Qo|=B,C=C.next;while(C!==a)}else C===null&&(f.lanes=0);return[l.memoizedState,f.dispatch]}function q0(a){var l=Ai(),f=l.queue;if(f===null)throw Error(t(311));f.lastRenderedReducer=a;var y=f.dispatch,C=f.pending,B=l.memoizedState;if(C!==null){f.pending=null;var U=C=C.next;do B=a(B,U.action),U=U.next;while(U!==C);Ui(B,l.memoizedState)||(Nn=!0),l.memoizedState=B,l.baseQueue===null&&(l.baseState=B),f.lastRenderedState=B}return[B,y]}function n3(){}function i3(a,l){var f=ar,y=Ai(),C=l(),B=!Ui(y.memoizedState,C);if(B&&(y.memoizedState=C,Nn=!0),y=y.queue,X0(o3.bind(null,f,y,a),[a]),y.getSnapshot!==l||B||Hr!==null&&Hr.memoizedState.tag&1){if(f.flags|=2048,yh(9,a3.bind(null,f,y,C,l),void 0,null),Gr===null)throw Error(t(349));ko&30||s3(f,l,C)}return C}function s3(a,l,f){a.flags|=16384,a={getSnapshot:l,value:f},l=ar.updateQueue,l===null?(l={lastEffect:null,stores:null},ar.updateQueue=l,l.stores=[a]):(f=l.stores,f===null?l.stores=[a]:f.push(a))}function a3(a,l,f,y){l.value=f,l.getSnapshot=y,l3(l)&&c3(a)}function o3(a,l,f){return f(function(){l3(l)&&c3(a)})}function l3(a){var l=a.getSnapshot;a=a.value;try{var f=l();return!Ui(a,f)}catch{return!0}}function c3(a){var l=zs(a,1);l!==null&&Fi(l,a,1,-1)}function u3(a){var l=ss();return typeof a=="function"&&(a=a()),l.memoizedState=l.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:vh,lastRenderedState:a},l.queue=a,a=a.dispatch=q7.bind(null,ar,a),[l.memoizedState,a]}function yh(a,l,f,y){return a={tag:a,create:l,destroy:f,deps:y,next:null},l=ar.updateQueue,l===null?(l={lastEffect:null,stores:null},ar.updateQueue=l,l.lastEffect=a.next=a):(f=l.lastEffect,f===null?l.lastEffect=a.next=a:(y=f.next,f.next=a,a.next=y,l.lastEffect=a)),a}function h3(){return Ai().memoizedState}function tp(a,l,f,y){var C=ss();ar.flags|=a,C.memoizedState=yh(1|l,f,void 0,y===void 0?null:y)}function rp(a,l,f,y){var C=Ai();y=y===void 0?null:y;var B=void 0;if(Dr!==null){var U=Dr.memoizedState;if(B=U.destroy,y!==null&&V0(y,U.deps)){C.memoizedState=yh(l,f,B,y);return}}ar.flags|=a,C.memoizedState=yh(1|l,f,B,y)}function d3(a,l){return tp(8390656,8,a,l)}function X0(a,l){return rp(2048,8,a,l)}function f3(a,l){return rp(4,2,a,l)}function p3(a,l){return rp(4,4,a,l)}function A3(a,l){if(typeof l=="function")return a=a(),l(a),function(){l(null)};if(l!=null)return a=a(),l.current=a,function(){l.current=null}}function g3(a,l,f){return f=f!=null?f.concat([a]):null,rp(4,4,A3.bind(null,l,a),f)}function K0(){}function m3(a,l){var f=Ai();l=l===void 0?null:l;var y=f.memoizedState;return y!==null&&l!==null&&V0(l,y[1])?y[0]:(f.memoizedState=[a,l],a)}function _3(a,l){var f=Ai();l=l===void 0?null:l;var y=f.memoizedState;return y!==null&&l!==null&&V0(l,y[1])?y[0]:(a=a(),f.memoizedState=[a,l],a)}function v3(a,l,f){return ko&21?(Ui(f,l)||(f=qu(),ar.lanes|=f,Qo|=f,a.baseState=!0),l):(a.baseState&&(a.baseState=!1,Nn=!0),a.memoizedState=f)}function W7(a,l){var f=Pt;Pt=f!==0&&4>f?f:4,a(!0);var y=G0.transition;G0.transition={};try{a(!1),l()}finally{Pt=f,G0.transition=y}}function y3(){return Ai().memoizedState}function Y7(a,l,f){var y=Fa(a);if(f={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null},E3(a))x3(l,f);else if(f=jC(a,l,f,y),f!==null){var C=gn();Fi(f,a,y,C),w3(f,l,y)}}function q7(a,l,f){var y=Fa(a),C={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null};if(E3(a))x3(l,C);else{var B=a.alternate;if(a.lanes===0&&(B===null||B.lanes===0)&&(B=l.lastRenderedReducer,B!==null))try{var U=l.lastRenderedState,q=B(U,f);if(C.hasEagerState=!0,C.eagerState=q,Ui(q,U)){var J=l.interleaved;J===null?(C.next=C,U0(l)):(C.next=J.next,J.next=C),l.interleaved=C;return}}catch{}finally{}f=jC(a,l,C,y),f!==null&&(C=gn(),Fi(f,a,y,C),w3(f,l,y))}}function E3(a){var l=a.alternate;return a===ar||l!==null&&l===ar}function x3(a,l){mh=ep=!0;var f=a.pending;f===null?l.next=l:(l.next=f.next,f.next=l),a.pending=l}function w3(a,l,f){if(f&4194240){var y=l.lanes;y&=a.pendingLanes,f|=y,l.lanes=f,Km(a,f)}}var np={readContext:pi,useCallback:rn,useContext:rn,useEffect:rn,useImperativeHandle:rn,useInsertionEffect:rn,useLayoutEffect:rn,useMemo:rn,useReducer:rn,useRef:rn,useState:rn,useDebugValue:rn,useDeferredValue:rn,useTransition:rn,useMutableSource:rn,useSyncExternalStore:rn,useId:rn,unstable_isNewReconciler:!1},X7={readContext:pi,useCallback:function(a,l){return ss().memoizedState=[a,l===void 0?null:l],a},useContext:pi,useEffect:d3,useImperativeHandle:function(a,l,f){return f=f!=null?f.concat([a]):null,tp(4194308,4,A3.bind(null,l,a),f)},useLayoutEffect:function(a,l){return tp(4194308,4,a,l)},useInsertionEffect:function(a,l){return tp(4,2,a,l)},useMemo:function(a,l){var f=ss();return l=l===void 0?null:l,a=a(),f.memoizedState=[a,l],a},useReducer:function(a,l,f){var y=ss();return l=f!==void 0?f(l):l,y.memoizedState=y.baseState=l,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:l},y.queue=a,a=a.dispatch=Y7.bind(null,ar,a),[y.memoizedState,a]},useRef:function(a){var l=ss();return a={current:a},l.memoizedState=a},useState:u3,useDebugValue:K0,useDeferredValue:function(a){return ss().memoizedState=a},useTransition:function(){var a=u3(!1),l=a[0];return a=W7.bind(null,a[1]),ss().memoizedState=a,[l,a]},useMutableSource:function(){},useSyncExternalStore:function(a,l,f){var y=ar,C=ss();if(tr){if(f===void 0)throw Error(t(407));f=f()}else{if(f=l(),Gr===null)throw Error(t(349));ko&30||s3(y,l,f)}C.memoizedState=f;var B={value:f,getSnapshot:l};return C.queue=B,d3(o3.bind(null,y,B,a),[a]),y.flags|=2048,yh(9,a3.bind(null,y,B,f,l),void 0,null),f},useId:function(){var a=ss(),l=Gr.identifierPrefix;if(tr){var f=Fs,y=Os;f=(y&~(1<<32-pn(y)-1)).toString(32)+f,l=":"+l+"R"+f,f=_h++,0<f&&(l+="H"+f.toString(32)),l+=":"}else f=j7++,l=":"+l+"r"+f.toString(32)+":";return a.memoizedState=l},unstable_isNewReconciler:!1},K7={readContext:pi,useCallback:m3,useContext:pi,useEffect:X0,useImperativeHandle:g3,useInsertionEffect:f3,useLayoutEffect:p3,useMemo:_3,useReducer:Y0,useRef:h3,useState:function(){return Y0(vh)},useDebugValue:K0,useDeferredValue:function(a){var l=Ai();return v3(l,Dr.memoizedState,a)},useTransition:function(){var a=Y0(vh)[0],l=Ai().memoizedState;return[a,l]},useMutableSource:n3,useSyncExternalStore:i3,useId:y3,unstable_isNewReconciler:!1},J7={readContext:pi,useCallback:m3,useContext:pi,useEffect:X0,useImperativeHandle:g3,useInsertionEffect:f3,useLayoutEffect:p3,useMemo:_3,useReducer:q0,useRef:h3,useState:function(){return q0(vh)},useDebugValue:K0,useDeferredValue:function(a){var l=Ai();return Dr===null?l.memoizedState=a:v3(l,Dr.memoizedState,a)},useTransition:function(){var a=q0(vh)[0],l=Ai().memoizedState;return[a,l]},useMutableSource:n3,useSyncExternalStore:i3,useId:y3,unstable_isNewReconciler:!1};function wc(a,l){try{var f="",y=l;do f+=fe(y),y=y.return;while(y);var C=f}catch(B){C=`
4485
+ `+C[U].replace(" at new "," at ");return a.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",a.displayName)),J}while(1<=U&&0<=q);break}}}finally{re=!1,Error.prepareStackTrace=f}return(a=a?a.displayName||a.name:"")?Z(a):""}function fe(a){switch(a.tag){case 5:return Z(a.type);case 16:return Z("Lazy");case 13:return Z("Suspense");case 19:return Z("SuspenseList");case 0:case 2:case 15:return a=H(a.type,!1),a;case 11:return a=H(a.type.render,!1),a;case 1:return a=H(a.type,!0),a;default:return""}}function Ae(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case T:return"Fragment";case S:return"Portal";case b:return"Profiler";case D:return"StrictMode";case N:return"Suspense";case j:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case L:return(a.displayName||"Context")+".Consumer";case M:return(a._context.displayName||"Context")+".Provider";case P:var l=a.render;return a=a.displayName,a||(a=l.displayName||l.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case X:return l=a.displayName||null,l!==null?l:Ae(a.type)||"Memo";case K:l=a._payload,a=a._init;try{return Ae(a(l))}catch{}}return null}function ve(a){var l=a.type;switch(a.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=l.render,a=a.displayName||a.name||"",l.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ae(l);case 8:return l===D?"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(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function ye(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Oe(a){var l=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function it(a){var l=Oe(a)?"checked":"value",f=Object.getOwnPropertyDescriptor(a.constructor.prototype,l),y=""+a[l];if(!a.hasOwnProperty(l)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var C=f.get,B=f.set;return Object.defineProperty(a,l,{configurable:!0,get:function(){return C.call(this)},set:function(U){y=""+U,B.call(this,U)}}),Object.defineProperty(a,l,{enumerable:f.enumerable}),{getValue:function(){return y},setValue:function(U){y=""+U},stopTracking:function(){a._valueTracker=null,delete a[l]}}}}function ae(a){a._valueTracker||(a._valueTracker=it(a))}function rt(a){if(!a)return!1;var l=a._valueTracker;if(!l)return!0;var f=l.getValue(),y="";return a&&(y=Oe(a)?a.checked?"true":"false":a.value),a=y,a!==f?(l.setValue(a),!0):!1}function Pe(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function lt(a,l){var f=l.checked;return Q({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??a._wrapperState.initialChecked})}function Ye(a,l){var f=l.defaultValue==null?"":l.defaultValue,y=l.checked!=null?l.checked:l.defaultChecked;f=ye(l.value!=null?l.value:f),a._wrapperState={initialChecked:y,initialValue:f,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function ct(a,l){l=l.checked,l!=null&&x(a,"checked",l,!1)}function Y(a,l){ct(a,l);var f=ye(l.value),y=l.type;if(f!=null)y==="number"?(f===0&&a.value===""||a.value!=f)&&(a.value=""+f):a.value!==""+f&&(a.value=""+f);else if(y==="submit"||y==="reset"){a.removeAttribute("value");return}l.hasOwnProperty("value")?ee(a,l.type,f):l.hasOwnProperty("defaultValue")&&ee(a,l.type,ye(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(a.defaultChecked=!!l.defaultChecked)}function k(a,l,f){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var y=l.type;if(!(y!=="submit"&&y!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+a._wrapperState.initialValue,f||l===a.value||(a.value=l),a.defaultValue=l}f=a.name,f!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,f!==""&&(a.name=f)}function ee(a,l,f){(l!=="number"||Pe(a.ownerDocument)!==a)&&(f==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+f&&(a.defaultValue=""+f))}var ue=Array.isArray;function pe(a,l,f,y){if(a=a.options,l){l={};for(var C=0;C<f.length;C++)l["$"+f[C]]=!0;for(f=0;f<a.length;f++)C=l.hasOwnProperty("$"+a[f].value),a[f].selected!==C&&(a[f].selected=C),C&&y&&(a[f].defaultSelected=!0)}else{for(f=""+ye(f),l=null,C=0;C<a.length;C++){if(a[C].value===f){a[C].selected=!0,y&&(a[C].defaultSelected=!0);return}l!==null||a[C].disabled||(l=a[C])}l!==null&&(l.selected=!0)}}function ge(a,l){if(l.dangerouslySetInnerHTML!=null)throw Error(t(91));return Q({},l,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function Ue(a,l){var f=l.value;if(f==null){if(f=l.children,l=l.defaultValue,f!=null){if(l!=null)throw Error(t(92));if(ue(f)){if(1<f.length)throw Error(t(93));f=f[0]}l=f}l==null&&(l=""),f=l}a._wrapperState={initialValue:ye(f)}}function Ee(a,l){var f=ye(l.value),y=ye(l.defaultValue);f!=null&&(f=""+f,f!==a.value&&(a.value=f),l.defaultValue==null&&a.defaultValue!==f&&(a.defaultValue=f)),y!=null&&(a.defaultValue=""+y)}function Qe(a){var l=a.textContent;l===a._wrapperState.initialValue&&l!==""&&l!==null&&(a.value=l)}function He(a){switch(a){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 Ce(a,l){return a==null||a==="http://www.w3.org/1999/xhtml"?He(l):a==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var Se,Ze=function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,f,y,C){MSApp.execUnsafeLocalFunction(function(){return a(l,f,y,C)})}:a}(function(a,l){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=l;else{for(Se=Se||document.createElement("div"),Se.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=Se.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}});function Ne(a,l){if(l){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=l;return}}a.textContent=l}var Re={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},at=["Webkit","ms","Moz","O"];Object.keys(Re).forEach(function(a){at.forEach(function(l){l=l+a.charAt(0).toUpperCase()+a.substring(1),Re[l]=Re[a]})});function ft(a,l,f){return l==null||typeof l=="boolean"||l===""?"":f||typeof l!="number"||l===0||Re.hasOwnProperty(a)&&Re[a]?(""+l).trim():l+"px"}function yt(a,l){a=a.style;for(var f in l)if(l.hasOwnProperty(f)){var y=f.indexOf("--")===0,C=ft(f,l[f],y);f==="float"&&(f="cssFloat"),y?a.setProperty(f,C):a[f]=C}}var _t=Q({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 Et(a,l){if(l){if(_t[a]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(t(137,a));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(t(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(t(61))}if(l.style!=null&&typeof l.style!="object")throw Error(t(62))}}function G(a,l){if(a.indexOf("-")===-1)return typeof l.is=="string";switch(a){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 O=null;function me(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var _e=null,Fe=null,De=null;function pt(a){if(a=dh(a)){if(typeof _e!="function")throw Error(t(280));var l=a.stateNode;l&&(l=Of(l),_e(a.stateNode,a.type,l))}}function Dt(a){Fe?De?De.push(a):De=[a]:Fe=a}function Lt(){if(Fe){var a=Fe,l=De;if(De=Fe=null,pt(a),l)for(a=0;a<l.length;a++)pt(l[a])}}function St(a,l){return a(l)}function At(){}var ur=!1;function Vt(a,l,f){if(ur)return a(l,f);ur=!0;try{return St(a,l,f)}finally{ur=!1,(Fe!==null||De!==null)&&(At(),Lt())}}function mr(a,l){var f=a.stateNode;if(f===null)return null;var y=Of(f);if(y===null)return null;f=y[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(a=a.type,y=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!y;break e;default:a=!1}if(a)return null;if(f&&typeof f!="function")throw Error(t(231,l,typeof f));return f}var Bn=!1;if(c)try{var qt={};Object.defineProperty(qt,"passive",{get:function(){Bn=!0}}),window.addEventListener("test",qt,qt),window.removeEventListener("test",qt,qt)}catch{Bn=!1}function ui(a,l,f,y,C,B,U,q,J){var ce=Array.prototype.slice.call(arguments,3);try{l.apply(f,ce)}catch(we){this.onError(we)}}var Kn=!1,Ls=null,Ns=!1,sc=null,xf={onError:function(a){Kn=!0,Ls=a}};function Ym(a,l,f,y,C,B,U,q,J){Kn=!1,Ls=null,ui.apply(xf,arguments)}function qm(a,l,f,y,C,B,U,q,J){if(Ym.apply(this,arguments),Kn){if(Kn){var ce=Ls;Kn=!1,Ls=null}else throw Error(t(198));Ns||(Ns=!0,sc=ce)}}function Us(a){var l=a,f=a;if(a.alternate)for(;l.return;)l=l.return;else{a=l;do l=a,l.flags&4098&&(f=l.return),a=l.return;while(a)}return l.tag===3?f:null}function F(a){if(a.tag===13){var l=a.memoizedState;if(l===null&&(a=a.alternate,a!==null&&(l=a.memoizedState)),l!==null)return l.dehydrated}return null}function ie(a){if(Us(a)!==a)throw Error(t(188))}function he(a){var l=a.alternate;if(!l){if(l=Us(a),l===null)throw Error(t(188));return l!==a?null:a}for(var f=a,y=l;;){var C=f.return;if(C===null)break;var B=C.alternate;if(B===null){if(y=C.return,y!==null){f=y;continue}break}if(C.child===B.child){for(B=C.child;B;){if(B===f)return ie(C),a;if(B===y)return ie(C),l;B=B.sibling}throw Error(t(188))}if(f.return!==y.return)f=C,y=B;else{for(var U=!1,q=C.child;q;){if(q===f){U=!0,f=C,y=B;break}if(q===y){U=!0,y=C,f=B;break}q=q.sibling}if(!U){for(q=B.child;q;){if(q===f){U=!0,f=B,y=C;break}if(q===y){U=!0,y=B,f=C;break}q=q.sibling}if(!U)throw Error(t(189))}}if(f.alternate!==y)throw Error(t(190))}if(f.tag!==3)throw Error(t(188));return f.stateNode.current===f?a:l}function de(a){return a=he(a),a!==null?le(a):null}function le(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var l=le(a);if(l!==null)return l;a=a.sibling}return null}var Be=e.unstable_scheduleCallback,Xe=e.unstable_cancelCallback,et=e.unstable_shouldYield,nt=e.unstable_requestPaint,We=e.unstable_now,ut=e.unstable_getCurrentPriorityLevel,ot=e.unstable_ImmediatePriority,Rr=e.unstable_UserBlockingPriority,er=e.unstable_NormalPriority,bn=e.unstable_LowPriority,hi=e.unstable_IdlePriority,jt=null,$e=null;function ju(a){if($e&&typeof $e.onCommitFiberRoot=="function")try{$e.onCommitFiberRoot(jt,a,void 0,(a.current.flags&128)===128)}catch{}}var pn=Math.clz32?Math.clz32:bo,Ps=Math.log,wf=Math.LN2;function bo(a){return a>>>=0,a===0?32:31-(Ps(a)/wf|0)|0}var wa=64,_r=4194304;function Rn(a){switch(a&-a){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 a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Ia(a,l){var f=a.pendingLanes;if(f===0)return 0;var y=0,C=a.suspendedLanes,B=a.pingedLanes,U=f&268435455;if(U!==0){var q=U&~C;q!==0?y=Rn(q):(B&=U,B!==0&&(y=Rn(B)))}else U=f&~C,U!==0?y=Rn(U):B!==0&&(y=Rn(B));if(y===0)return 0;if(l!==0&&l!==y&&!(l&C)&&(C=y&-y,B=l&-l,C>=B||C===16&&(B&4194240)!==0))return l;if(y&4&&(y|=f&16),l=a.entangledLanes,l!==0)for(a=a.entanglements,l&=y;0<l;)f=31-pn(l),C=1<<f,y|=a[f],l&=~C;return y}function Dn(a,l){switch(a){case 1:case 2:case 4:return l+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 l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Wu(a,l){for(var f=a.suspendedLanes,y=a.pingedLanes,C=a.expirationTimes,B=a.pendingLanes;0<B;){var U=31-pn(B),q=1<<U,J=C[U];J===-1?(!(q&f)||q&y)&&(C[U]=Dn(q,l)):J<=l&&(a.expiredLanes|=q),B&=~q}}function Yu(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function qu(){var a=wa;return wa<<=1,!(wa&4194240)&&(wa=64),a}function Xm(a){for(var l=[],f=0;31>f;f++)l.push(a);return l}function Xu(a,l,f){a.pendingLanes|=l,l!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,l=31-pn(l),a[l]=f}function jk(a,l){var f=a.pendingLanes&~l;a.pendingLanes=l,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=l,a.mutableReadLanes&=l,a.entangledLanes&=l,l=a.entanglements;var y=a.eventTimes;for(a=a.expirationTimes;0<f;){var C=31-pn(f),B=1<<C;l[C]=0,y[C]=-1,a[C]=-1,f&=~B}}function Km(a,l){var f=a.entangledLanes|=l;for(a=a.entanglements;f;){var y=31-pn(f),C=1<<y;C&l|a[y]&l&&(a[y]|=l),f&=~C}}var Pt=0;function WI(a){return a&=-a,1<a?4<a?a&268435455?16:536870912:4:1}var YI,Jm,qI,XI,KI,Zm=!1,If=[],Ca=null,Ma=null,Sa=null,Ku=new Map,Ju=new Map,Ta=[],Wk="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 JI(a,l){switch(a){case"focusin":case"focusout":Ca=null;break;case"dragenter":case"dragleave":Ma=null;break;case"mouseover":case"mouseout":Sa=null;break;case"pointerover":case"pointerout":Ku.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ju.delete(l.pointerId)}}function Zu(a,l,f,y,C,B){return a===null||a.nativeEvent!==B?(a={blockedOn:l,domEventName:f,eventSystemFlags:y,nativeEvent:B,targetContainers:[C]},l!==null&&(l=dh(l),l!==null&&Jm(l)),a):(a.eventSystemFlags|=y,l=a.targetContainers,C!==null&&l.indexOf(C)===-1&&l.push(C),a)}function Yk(a,l,f,y,C){switch(l){case"focusin":return Ca=Zu(Ca,a,l,f,y,C),!0;case"dragenter":return Ma=Zu(Ma,a,l,f,y,C),!0;case"mouseover":return Sa=Zu(Sa,a,l,f,y,C),!0;case"pointerover":var B=C.pointerId;return Ku.set(B,Zu(Ku.get(B)||null,a,l,f,y,C)),!0;case"gotpointercapture":return B=C.pointerId,Ju.set(B,Zu(Ju.get(B)||null,a,l,f,y,C)),!0}return!1}function ZI(a){var l=Ro(a.target);if(l!==null){var f=Us(l);if(f!==null){if(l=f.tag,l===13){if(l=F(f),l!==null){a.blockedOn=l,KI(a.priority,function(){qI(f)});return}}else if(l===3&&f.stateNode.current.memoizedState.isDehydrated){a.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Cf(a){if(a.blockedOn!==null)return!1;for(var l=a.targetContainers;0<l.length;){var f=e0(a.domEventName,a.eventSystemFlags,l[0],a.nativeEvent);if(f===null){f=a.nativeEvent;var y=new f.constructor(f.type,f);O=y,f.target.dispatchEvent(y),O=null}else return l=dh(f),l!==null&&Jm(l),a.blockedOn=f,!1;l.shift()}return!0}function $I(a,l,f){Cf(a)&&f.delete(l)}function qk(){Zm=!1,Ca!==null&&Cf(Ca)&&(Ca=null),Ma!==null&&Cf(Ma)&&(Ma=null),Sa!==null&&Cf(Sa)&&(Sa=null),Ku.forEach($I),Ju.forEach($I)}function $u(a,l){a.blockedOn===l&&(a.blockedOn=null,Zm||(Zm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,qk)))}function eh(a){function l(C){return $u(C,a)}if(0<If.length){$u(If[0],a);for(var f=1;f<If.length;f++){var y=If[f];y.blockedOn===a&&(y.blockedOn=null)}}for(Ca!==null&&$u(Ca,a),Ma!==null&&$u(Ma,a),Sa!==null&&$u(Sa,a),Ku.forEach(l),Ju.forEach(l),f=0;f<Ta.length;f++)y=Ta[f],y.blockedOn===a&&(y.blockedOn=null);for(;0<Ta.length&&(f=Ta[0],f.blockedOn===null);)ZI(f),f.blockedOn===null&&Ta.shift()}var ac=I.ReactCurrentBatchConfig,Mf=!0;function Xk(a,l,f,y){var C=Pt,B=ac.transition;ac.transition=null;try{Pt=1,$m(a,l,f,y)}finally{Pt=C,ac.transition=B}}function Kk(a,l,f,y){var C=Pt,B=ac.transition;ac.transition=null;try{Pt=4,$m(a,l,f,y)}finally{Pt=C,ac.transition=B}}function $m(a,l,f,y){if(Mf){var C=e0(a,l,f,y);if(C===null)m0(a,l,y,Sf,f),JI(a,y);else if(Yk(C,a,l,f,y))y.stopPropagation();else if(JI(a,y),l&4&&-1<Wk.indexOf(a)){for(;C!==null;){var B=dh(C);if(B!==null&&YI(B),B=e0(a,l,f,y),B===null&&m0(a,l,y,Sf,f),B===C)break;C=B}C!==null&&y.stopPropagation()}else m0(a,l,y,null,f)}}var Sf=null;function e0(a,l,f,y){if(Sf=null,a=me(y),a=Ro(a),a!==null)if(l=Us(a),l===null)a=null;else if(f=l.tag,f===13){if(a=F(l),a!==null)return a;a=null}else if(f===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;a=null}else l!==a&&(a=null);return Sf=a,null}function eC(a){switch(a){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(ut()){case ot:return 1;case Rr:return 4;case er:case bn:return 16;case hi:return 536870912;default:return 16}default:return 16}}var Ba=null,t0=null,Tf=null;function tC(){if(Tf)return Tf;var a,l=t0,f=l.length,y,C="value"in Ba?Ba.value:Ba.textContent,B=C.length;for(a=0;a<f&&l[a]===C[a];a++);var U=f-a;for(y=1;y<=U&&l[f-y]===C[B-y];y++);return Tf=C.slice(a,1<y?1-y:void 0)}function Bf(a){var l=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&l===13&&(a=13)):a=l,a===10&&(a=13),32<=a||a===13?a:0}function bf(){return!0}function rC(){return!1}function Jn(a){function l(f,y,C,B,U){this._reactName=f,this._targetInst=C,this.type=y,this.nativeEvent=B,this.target=U,this.currentTarget=null;for(var q in a)a.hasOwnProperty(q)&&(f=a[q],this[q]=f?f(B):B[q]);return this.isDefaultPrevented=(B.defaultPrevented!=null?B.defaultPrevented:B.returnValue===!1)?bf:rC,this.isPropagationStopped=rC,this}return Q(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=bf)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=bf)},persist:function(){},isPersistent:bf}),l}var oc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},r0=Jn(oc),th=Q({},oc,{view:0,detail:0}),Jk=Jn(th),n0,i0,rh,Rf=Q({},th,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:a0,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==rh&&(rh&&a.type==="mousemove"?(n0=a.screenX-rh.screenX,i0=a.screenY-rh.screenY):i0=n0=0,rh=a),n0)},movementY:function(a){return"movementY"in a?a.movementY:i0}}),nC=Jn(Rf),Zk=Q({},Rf,{dataTransfer:0}),$k=Jn(Zk),e7=Q({},th,{relatedTarget:0}),s0=Jn(e7),t7=Q({},oc,{animationName:0,elapsedTime:0,pseudoElement:0}),r7=Jn(t7),n7=Q({},oc,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),i7=Jn(n7),s7=Q({},oc,{data:0}),iC=Jn(s7),a7={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},o7={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"},l7={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function c7(a){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(a):(a=l7[a])?!!l[a]:!1}function a0(){return c7}var u7=Q({},th,{key:function(a){if(a.key){var l=a7[a.key]||a.key;if(l!=="Unidentified")return l}return a.type==="keypress"?(a=Bf(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?o7[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:a0,charCode:function(a){return a.type==="keypress"?Bf(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Bf(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),h7=Jn(u7),d7=Q({},Rf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sC=Jn(d7),f7=Q({},th,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:a0}),p7=Jn(f7),A7=Q({},oc,{propertyName:0,elapsedTime:0,pseudoElement:0}),g7=Jn(A7),m7=Q({},Rf,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),_7=Jn(m7),v7=[9,13,27,32],o0=c&&"CompositionEvent"in window,nh=null;c&&"documentMode"in document&&(nh=document.documentMode);var y7=c&&"TextEvent"in window&&!nh,aC=c&&(!o0||nh&&8<nh&&11>=nh),oC=String.fromCharCode(32),lC=!1;function cC(a,l){switch(a){case"keyup":return v7.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uC(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var lc=!1;function E7(a,l){switch(a){case"compositionend":return uC(l);case"keypress":return l.which!==32?null:(lC=!0,oC);case"textInput":return a=l.data,a===oC&&lC?null:a;default:return null}}function x7(a,l){if(lc)return a==="compositionend"||!o0&&cC(a,l)?(a=tC(),Tf=t0=Ba=null,lc=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return aC&&l.locale!=="ko"?null:l.data;default:return null}}var w7={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 hC(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l==="input"?!!w7[a.type]:l==="textarea"}function dC(a,l,f,y){Dt(y),l=Pf(l,"onChange"),0<l.length&&(f=new r0("onChange","change",null,f,y),a.push({event:f,listeners:l}))}var ih=null,sh=null;function I7(a){bC(a,0)}function Df(a){var l=fc(a);if(rt(l))return a}function C7(a,l){if(a==="change")return l}var fC=!1;if(c){var l0;if(c){var c0="oninput"in document;if(!c0){var pC=document.createElement("div");pC.setAttribute("oninput","return;"),c0=typeof pC.oninput=="function"}l0=c0}else l0=!1;fC=l0&&(!document.documentMode||9<document.documentMode)}function AC(){ih&&(ih.detachEvent("onpropertychange",gC),sh=ih=null)}function gC(a){if(a.propertyName==="value"&&Df(sh)){var l=[];dC(l,sh,a,me(a)),Vt(I7,l)}}function M7(a,l,f){a==="focusin"?(AC(),ih=l,sh=f,ih.attachEvent("onpropertychange",gC)):a==="focusout"&&AC()}function S7(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Df(sh)}function T7(a,l){if(a==="click")return Df(l)}function B7(a,l){if(a==="input"||a==="change")return Df(l)}function b7(a,l){return a===l&&(a!==0||1/a===1/l)||a!==a&&l!==l}var Ui=typeof Object.is=="function"?Object.is:b7;function ah(a,l){if(Ui(a,l))return!0;if(typeof a!="object"||a===null||typeof l!="object"||l===null)return!1;var f=Object.keys(a),y=Object.keys(l);if(f.length!==y.length)return!1;for(y=0;y<f.length;y++){var C=f[y];if(!h.call(l,C)||!Ui(a[C],l[C]))return!1}return!0}function mC(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function _C(a,l){var f=mC(a);a=0;for(var y;f;){if(f.nodeType===3){if(y=a+f.textContent.length,a<=l&&y>=l)return{node:f,offset:l-a};a=y}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=mC(f)}}function vC(a,l){return a&&l?a===l?!0:a&&a.nodeType===3?!1:l&&l.nodeType===3?vC(a,l.parentNode):"contains"in a?a.contains(l):a.compareDocumentPosition?!!(a.compareDocumentPosition(l)&16):!1:!1}function yC(){for(var a=window,l=Pe();l instanceof a.HTMLIFrameElement;){try{var f=typeof l.contentWindow.location.href=="string"}catch{f=!1}if(f)a=l.contentWindow;else break;l=Pe(a.document)}return l}function u0(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l&&(l==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||l==="textarea"||a.contentEditable==="true")}function R7(a){var l=yC(),f=a.focusedElem,y=a.selectionRange;if(l!==f&&f&&f.ownerDocument&&vC(f.ownerDocument.documentElement,f)){if(y!==null&&u0(f)){if(l=y.start,a=y.end,a===void 0&&(a=l),"selectionStart"in f)f.selectionStart=l,f.selectionEnd=Math.min(a,f.value.length);else if(a=(l=f.ownerDocument||document)&&l.defaultView||window,a.getSelection){a=a.getSelection();var C=f.textContent.length,B=Math.min(y.start,C);y=y.end===void 0?B:Math.min(y.end,C),!a.extend&&B>y&&(C=y,y=B,B=C),C=_C(f,B);var U=_C(f,y);C&&U&&(a.rangeCount!==1||a.anchorNode!==C.node||a.anchorOffset!==C.offset||a.focusNode!==U.node||a.focusOffset!==U.offset)&&(l=l.createRange(),l.setStart(C.node,C.offset),a.removeAllRanges(),B>y?(a.addRange(l),a.extend(U.node,U.offset)):(l.setEnd(U.node,U.offset),a.addRange(l)))}}for(l=[],a=f;a=a.parentNode;)a.nodeType===1&&l.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<l.length;f++)a=l[f],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var D7=c&&"documentMode"in document&&11>=document.documentMode,cc=null,h0=null,oh=null,d0=!1;function EC(a,l,f){var y=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;d0||cc==null||cc!==Pe(y)||(y=cc,"selectionStart"in y&&u0(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),oh&&ah(oh,y)||(oh=y,y=Pf(h0,"onSelect"),0<y.length&&(l=new r0("onSelect","select",null,l,f),a.push({event:l,listeners:y}),l.target=cc)))}function Lf(a,l){var f={};return f[a.toLowerCase()]=l.toLowerCase(),f["Webkit"+a]="webkit"+l,f["Moz"+a]="moz"+l,f}var uc={animationend:Lf("Animation","AnimationEnd"),animationiteration:Lf("Animation","AnimationIteration"),animationstart:Lf("Animation","AnimationStart"),transitionend:Lf("Transition","TransitionEnd")},f0={},xC={};c&&(xC=document.createElement("div").style,"AnimationEvent"in window||(delete uc.animationend.animation,delete uc.animationiteration.animation,delete uc.animationstart.animation),"TransitionEvent"in window||delete uc.transitionend.transition);function Nf(a){if(f0[a])return f0[a];if(!uc[a])return a;var l=uc[a],f;for(f in l)if(l.hasOwnProperty(f)&&f in xC)return f0[a]=l[f];return a}var wC=Nf("animationend"),IC=Nf("animationiteration"),CC=Nf("animationstart"),MC=Nf("transitionend"),SC=new Map,TC="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 ba(a,l){SC.set(a,l),s(l,[a])}for(var p0=0;p0<TC.length;p0++){var A0=TC[p0],L7=A0.toLowerCase(),N7=A0[0].toUpperCase()+A0.slice(1);ba(L7,"on"+N7)}ba(wC,"onAnimationEnd"),ba(IC,"onAnimationIteration"),ba(CC,"onAnimationStart"),ba("dblclick","onDoubleClick"),ba("focusin","onFocus"),ba("focusout","onBlur"),ba(MC,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var lh="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(" "),U7=new Set("cancel close invalid load scroll toggle".split(" ").concat(lh));function BC(a,l,f){var y=a.type||"unknown-event";a.currentTarget=f,qm(y,l,void 0,a),a.currentTarget=null}function bC(a,l){l=(l&4)!==0;for(var f=0;f<a.length;f++){var y=a[f],C=y.event;y=y.listeners;e:{var B=void 0;if(l)for(var U=y.length-1;0<=U;U--){var q=y[U],J=q.instance,ce=q.currentTarget;if(q=q.listener,J!==B&&C.isPropagationStopped())break e;BC(C,q,ce),B=J}else for(U=0;U<y.length;U++){if(q=y[U],J=q.instance,ce=q.currentTarget,q=q.listener,J!==B&&C.isPropagationStopped())break e;BC(C,q,ce),B=J}}}if(Ns)throw a=sc,Ns=!1,sc=null,a}function Xt(a,l){var f=l[w0];f===void 0&&(f=l[w0]=new Set);var y=a+"__bubble";f.has(y)||(RC(l,a,2,!1),f.add(y))}function g0(a,l,f){var y=0;l&&(y|=4),RC(f,a,y,l)}var Uf="_reactListening"+Math.random().toString(36).slice(2);function ch(a){if(!a[Uf]){a[Uf]=!0,n.forEach(function(f){f!=="selectionchange"&&(U7.has(f)||g0(f,!1,a),g0(f,!0,a))});var l=a.nodeType===9?a:a.ownerDocument;l===null||l[Uf]||(l[Uf]=!0,g0("selectionchange",!1,l))}}function RC(a,l,f,y){switch(eC(l)){case 1:var C=Xk;break;case 4:C=Kk;break;default:C=$m}f=C.bind(null,l,f,a),C=void 0,!Bn||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(C=!0),y?C!==void 0?a.addEventListener(l,f,{capture:!0,passive:C}):a.addEventListener(l,f,!0):C!==void 0?a.addEventListener(l,f,{passive:C}):a.addEventListener(l,f,!1)}function m0(a,l,f,y,C){var B=y;if(!(l&1)&&!(l&2)&&y!==null)e:for(;;){if(y===null)return;var U=y.tag;if(U===3||U===4){var q=y.stateNode.containerInfo;if(q===C||q.nodeType===8&&q.parentNode===C)break;if(U===4)for(U=y.return;U!==null;){var J=U.tag;if((J===3||J===4)&&(J=U.stateNode.containerInfo,J===C||J.nodeType===8&&J.parentNode===C))return;U=U.return}for(;q!==null;){if(U=Ro(q),U===null)return;if(J=U.tag,J===5||J===6){y=B=U;continue e}q=q.parentNode}}y=y.return}Vt(function(){var ce=B,we=me(f),Ie=[];e:{var xe=SC.get(a);if(xe!==void 0){var Le=r0,ze=a;switch(a){case"keypress":if(Bf(f)===0)break e;case"keydown":case"keyup":Le=h7;break;case"focusin":ze="focus",Le=s0;break;case"focusout":ze="blur",Le=s0;break;case"beforeblur":case"afterblur":Le=s0;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Le=nC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Le=$k;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Le=p7;break;case wC:case IC:case CC:Le=r7;break;case MC:Le=g7;break;case"scroll":Le=Jk;break;case"wheel":Le=_7;break;case"copy":case"cut":case"paste":Le=i7;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Le=sC}var Ve=(l&4)!==0,vr=!Ve&&a==="scroll",se=Ve?xe!==null?xe+"Capture":null:xe;Ve=[];for(var $=ce,oe;$!==null;){oe=$;var Me=oe.stateNode;if(oe.tag===5&&Me!==null&&(oe=Me,se!==null&&(Me=mr($,se),Me!=null&&Ve.push(uh($,Me,oe)))),vr)break;$=$.return}0<Ve.length&&(xe=new Le(xe,ze,null,f,we),Ie.push({event:xe,listeners:Ve}))}}if(!(l&7)){e:{if(xe=a==="mouseover"||a==="pointerover",Le=a==="mouseout"||a==="pointerout",xe&&f!==O&&(ze=f.relatedTarget||f.fromElement)&&(Ro(ze)||ze[ks]))break e;if((Le||xe)&&(xe=we.window===we?we:(xe=we.ownerDocument)?xe.defaultView||xe.parentWindow:window,Le?(ze=f.relatedTarget||f.toElement,Le=ce,ze=ze?Ro(ze):null,ze!==null&&(vr=Us(ze),ze!==vr||ze.tag!==5&&ze.tag!==6)&&(ze=null)):(Le=null,ze=ce),Le!==ze)){if(Ve=nC,Me="onMouseLeave",se="onMouseEnter",$="mouse",(a==="pointerout"||a==="pointerover")&&(Ve=sC,Me="onPointerLeave",se="onPointerEnter",$="pointer"),vr=Le==null?xe:fc(Le),oe=ze==null?xe:fc(ze),xe=new Ve(Me,$+"leave",Le,f,we),xe.target=vr,xe.relatedTarget=oe,Me=null,Ro(we)===ce&&(Ve=new Ve(se,$+"enter",ze,f,we),Ve.target=oe,Ve.relatedTarget=vr,Me=Ve),vr=Me,Le&&ze)t:{for(Ve=Le,se=ze,$=0,oe=Ve;oe;oe=hc(oe))$++;for(oe=0,Me=se;Me;Me=hc(Me))oe++;for(;0<$-oe;)Ve=hc(Ve),$--;for(;0<oe-$;)se=hc(se),oe--;for(;$--;){if(Ve===se||se!==null&&Ve===se.alternate)break t;Ve=hc(Ve),se=hc(se)}Ve=null}else Ve=null;Le!==null&&DC(Ie,xe,Le,Ve,!1),ze!==null&&vr!==null&&DC(Ie,vr,ze,Ve,!0)}}e:{if(xe=ce?fc(ce):window,Le=xe.nodeName&&xe.nodeName.toLowerCase(),Le==="select"||Le==="input"&&xe.type==="file")var je=C7;else if(hC(xe))if(fC)je=B7;else{je=S7;var Ke=M7}else(Le=xe.nodeName)&&Le.toLowerCase()==="input"&&(xe.type==="checkbox"||xe.type==="radio")&&(je=T7);if(je&&(je=je(a,ce))){dC(Ie,je,f,we);break e}Ke&&Ke(a,xe,ce),a==="focusout"&&(Ke=xe._wrapperState)&&Ke.controlled&&xe.type==="number"&&ee(xe,"number",xe.value)}switch(Ke=ce?fc(ce):window,a){case"focusin":(hC(Ke)||Ke.contentEditable==="true")&&(cc=Ke,h0=ce,oh=null);break;case"focusout":oh=h0=cc=null;break;case"mousedown":d0=!0;break;case"contextmenu":case"mouseup":case"dragend":d0=!1,EC(Ie,f,we);break;case"selectionchange":if(D7)break;case"keydown":case"keyup":EC(Ie,f,we)}var Je;if(o0)e:{switch(a){case"compositionstart":var st="onCompositionStart";break e;case"compositionend":st="onCompositionEnd";break e;case"compositionupdate":st="onCompositionUpdate";break e}st=void 0}else lc?cC(a,f)&&(st="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(st="onCompositionStart");st&&(aC&&f.locale!=="ko"&&(lc||st!=="onCompositionStart"?st==="onCompositionEnd"&&lc&&(Je=tC()):(Ba=we,t0="value"in Ba?Ba.value:Ba.textContent,lc=!0)),Ke=Pf(ce,st),0<Ke.length&&(st=new iC(st,a,null,f,we),Ie.push({event:st,listeners:Ke}),Je?st.data=Je:(Je=uC(f),Je!==null&&(st.data=Je)))),(Je=y7?E7(a,f):x7(a,f))&&(ce=Pf(ce,"onBeforeInput"),0<ce.length&&(we=new iC("onBeforeInput","beforeinput",null,f,we),Ie.push({event:we,listeners:ce}),we.data=Je))}bC(Ie,l)})}function uh(a,l,f){return{instance:a,listener:l,currentTarget:f}}function Pf(a,l){for(var f=l+"Capture",y=[];a!==null;){var C=a,B=C.stateNode;C.tag===5&&B!==null&&(C=B,B=mr(a,f),B!=null&&y.unshift(uh(a,B,C)),B=mr(a,l),B!=null&&y.push(uh(a,B,C))),a=a.return}return y}function hc(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function DC(a,l,f,y,C){for(var B=l._reactName,U=[];f!==null&&f!==y;){var q=f,J=q.alternate,ce=q.stateNode;if(J!==null&&J===y)break;q.tag===5&&ce!==null&&(q=ce,C?(J=mr(f,B),J!=null&&U.unshift(uh(f,J,q))):C||(J=mr(f,B),J!=null&&U.push(uh(f,J,q)))),f=f.return}U.length!==0&&a.push({event:l,listeners:U})}var P7=/\r\n?/g,k7=/\u0000|\uFFFD/g;function LC(a){return(typeof a=="string"?a:""+a).replace(P7,`
4486
+ `).replace(k7,"")}function kf(a,l,f){if(l=LC(l),LC(a)!==l&&f)throw Error(t(425))}function Qf(){}var _0=null,v0=null;function y0(a,l){return a==="textarea"||a==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var E0=typeof setTimeout=="function"?setTimeout:void 0,Q7=typeof clearTimeout=="function"?clearTimeout:void 0,NC=typeof Promise=="function"?Promise:void 0,O7=typeof queueMicrotask=="function"?queueMicrotask:typeof NC<"u"?function(a){return NC.resolve(null).then(a).catch(F7)}:E0;function F7(a){setTimeout(function(){throw a})}function x0(a,l){var f=l,y=0;do{var C=f.nextSibling;if(a.removeChild(f),C&&C.nodeType===8)if(f=C.data,f==="/$"){if(y===0){a.removeChild(C),eh(l);return}y--}else f!=="$"&&f!=="$?"&&f!=="$!"||y++;f=C}while(f);eh(l)}function Ra(a){for(;a!=null;a=a.nextSibling){var l=a.nodeType;if(l===1||l===3)break;if(l===8){if(l=a.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return a}function UC(a){a=a.previousSibling;for(var l=0;a;){if(a.nodeType===8){var f=a.data;if(f==="$"||f==="$!"||f==="$?"){if(l===0)return a;l--}else f==="/$"&&l++}a=a.previousSibling}return null}var dc=Math.random().toString(36).slice(2),ns="__reactFiber$"+dc,hh="__reactProps$"+dc,ks="__reactContainer$"+dc,w0="__reactEvents$"+dc,z7="__reactListeners$"+dc,H7="__reactHandles$"+dc;function Ro(a){var l=a[ns];if(l)return l;for(var f=a.parentNode;f;){if(l=f[ks]||f[ns]){if(f=l.alternate,l.child!==null||f!==null&&f.child!==null)for(a=UC(a);a!==null;){if(f=a[ns])return f;a=UC(a)}return l}a=f,f=a.parentNode}return null}function dh(a){return a=a[ns]||a[ks],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function fc(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(t(33))}function Of(a){return a[hh]||null}var I0=[],pc=-1;function Da(a){return{current:a}}function Kt(a){0>pc||(a.current=I0[pc],I0[pc]=null,pc--)}function Wt(a,l){pc++,I0[pc]=a.current,a.current=l}var La={},tn=Da(La),Ln=Da(!1),Do=La;function Ac(a,l){var f=a.type.contextTypes;if(!f)return La;var y=a.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===l)return y.__reactInternalMemoizedMaskedChildContext;var C={},B;for(B in f)C[B]=l[B];return y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=l,a.__reactInternalMemoizedMaskedChildContext=C),C}function Nn(a){return a=a.childContextTypes,a!=null}function Ff(){Kt(Ln),Kt(tn)}function PC(a,l,f){if(tn.current!==La)throw Error(t(168));Wt(tn,l),Wt(Ln,f)}function kC(a,l,f){var y=a.stateNode;if(l=l.childContextTypes,typeof y.getChildContext!="function")return f;y=y.getChildContext();for(var C in y)if(!(C in l))throw Error(t(108,ve(a)||"Unknown",C));return Q({},f,y)}function zf(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||La,Do=tn.current,Wt(tn,a),Wt(Ln,Ln.current),!0}function QC(a,l,f){var y=a.stateNode;if(!y)throw Error(t(169));f?(a=kC(a,l,Do),y.__reactInternalMemoizedMergedChildContext=a,Kt(Ln),Kt(tn),Wt(tn,a)):Kt(Ln),Wt(Ln,f)}var Qs=null,Hf=!1,C0=!1;function OC(a){Qs===null?Qs=[a]:Qs.push(a)}function G7(a){Hf=!0,OC(a)}function Na(){if(!C0&&Qs!==null){C0=!0;var a=0,l=Pt;try{var f=Qs;for(Pt=1;a<f.length;a++){var y=f[a];do y=y(!0);while(y!==null)}Qs=null,Hf=!1}catch(C){throw Qs!==null&&(Qs=Qs.slice(a+1)),Be(ot,Na),C}finally{Pt=l,C0=!1}}return null}var gc=[],mc=0,Gf=null,Vf=0,di=[],fi=0,Lo=null,Os=1,Fs="";function No(a,l){gc[mc++]=Vf,gc[mc++]=Gf,Gf=a,Vf=l}function FC(a,l,f){di[fi++]=Os,di[fi++]=Fs,di[fi++]=Lo,Lo=a;var y=Os;a=Fs;var C=32-pn(y)-1;y&=~(1<<C),f+=1;var B=32-pn(l)+C;if(30<B){var U=C-C%5;B=(y&(1<<U)-1).toString(32),y>>=U,C-=U,Os=1<<32-pn(l)+C|f<<C|y,Fs=B+a}else Os=1<<B|f<<C|y,Fs=a}function M0(a){a.return!==null&&(No(a,1),FC(a,1,0))}function S0(a){for(;a===Gf;)Gf=gc[--mc],gc[mc]=null,Vf=gc[--mc],gc[mc]=null;for(;a===Lo;)Lo=di[--fi],di[fi]=null,Fs=di[--fi],di[fi]=null,Os=di[--fi],di[fi]=null}var Zn=null,$n=null,tr=!1,Pi=null;function zC(a,l){var f=mi(5,null,null,0);f.elementType="DELETED",f.stateNode=l,f.return=a,l=a.deletions,l===null?(a.deletions=[f],a.flags|=16):l.push(f)}function HC(a,l){switch(a.tag){case 5:var f=a.type;return l=l.nodeType!==1||f.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(a.stateNode=l,Zn=a,$n=Ra(l.firstChild),!0):!1;case 6:return l=a.pendingProps===""||l.nodeType!==3?null:l,l!==null?(a.stateNode=l,Zn=a,$n=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(f=Lo!==null?{id:Os,overflow:Fs}:null,a.memoizedState={dehydrated:l,treeContext:f,retryLane:1073741824},f=mi(18,null,null,0),f.stateNode=l,f.return=a,a.child=f,Zn=a,$n=null,!0):!1;default:return!1}}function T0(a){return(a.mode&1)!==0&&(a.flags&128)===0}function B0(a){if(tr){var l=$n;if(l){var f=l;if(!HC(a,l)){if(T0(a))throw Error(t(418));l=Ra(f.nextSibling);var y=Zn;l&&HC(a,l)?zC(y,f):(a.flags=a.flags&-4097|2,tr=!1,Zn=a)}}else{if(T0(a))throw Error(t(418));a.flags=a.flags&-4097|2,tr=!1,Zn=a}}}function GC(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;Zn=a}function jf(a){if(a!==Zn)return!1;if(!tr)return GC(a),tr=!0,!1;var l;if((l=a.tag!==3)&&!(l=a.tag!==5)&&(l=a.type,l=l!=="head"&&l!=="body"&&!y0(a.type,a.memoizedProps)),l&&(l=$n)){if(T0(a))throw VC(),Error(t(418));for(;l;)zC(a,l),l=Ra(l.nextSibling)}if(GC(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(t(317));e:{for(a=a.nextSibling,l=0;a;){if(a.nodeType===8){var f=a.data;if(f==="/$"){if(l===0){$n=Ra(a.nextSibling);break e}l--}else f!=="$"&&f!=="$!"&&f!=="$?"||l++}a=a.nextSibling}$n=null}}else $n=Zn?Ra(a.stateNode.nextSibling):null;return!0}function VC(){for(var a=$n;a;)a=Ra(a.nextSibling)}function _c(){$n=Zn=null,tr=!1}function b0(a){Pi===null?Pi=[a]:Pi.push(a)}var V7=I.ReactCurrentBatchConfig;function ki(a,l){if(a&&a.defaultProps){l=Q({},l),a=a.defaultProps;for(var f in a)l[f]===void 0&&(l[f]=a[f]);return l}return l}var Wf=Da(null),Yf=null,vc=null,R0=null;function D0(){R0=vc=Yf=null}function L0(a){var l=Wf.current;Kt(Wf),a._currentValue=l}function N0(a,l,f){for(;a!==null;){var y=a.alternate;if((a.childLanes&l)!==l?(a.childLanes|=l,y!==null&&(y.childLanes|=l)):y!==null&&(y.childLanes&l)!==l&&(y.childLanes|=l),a===f)break;a=a.return}}function yc(a,l){Yf=a,R0=vc=null,a=a.dependencies,a!==null&&a.firstContext!==null&&(a.lanes&l&&(Un=!0),a.firstContext=null)}function pi(a){var l=a._currentValue;if(R0!==a)if(a={context:a,memoizedValue:l,next:null},vc===null){if(Yf===null)throw Error(t(308));vc=a,Yf.dependencies={lanes:0,firstContext:a}}else vc=vc.next=a;return l}var Uo=null;function U0(a){Uo===null?Uo=[a]:Uo.push(a)}function jC(a,l,f,y){var C=l.interleaved;return C===null?(f.next=f,U0(l)):(f.next=C.next,C.next=f),l.interleaved=f,zs(a,y)}function zs(a,l){a.lanes|=l;var f=a.alternate;for(f!==null&&(f.lanes|=l),f=a,a=a.return;a!==null;)a.childLanes|=l,f=a.alternate,f!==null&&(f.childLanes|=l),f=a,a=a.return;return f.tag===3?f.stateNode:null}var Ua=!1;function P0(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function WC(a,l){a=a.updateQueue,l.updateQueue===a&&(l.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function Hs(a,l){return{eventTime:a,lane:l,tag:0,payload:null,callback:null,next:null}}function Pa(a,l,f){var y=a.updateQueue;if(y===null)return null;if(y=y.shared,Mt&2){var C=y.pending;return C===null?l.next=l:(l.next=C.next,C.next=l),y.pending=l,zs(a,f)}return C=y.interleaved,C===null?(l.next=l,U0(y)):(l.next=C.next,C.next=l),y.interleaved=l,zs(a,f)}function qf(a,l,f){if(l=l.updateQueue,l!==null&&(l=l.shared,(f&4194240)!==0)){var y=l.lanes;y&=a.pendingLanes,f|=y,l.lanes=f,Km(a,f)}}function YC(a,l){var f=a.updateQueue,y=a.alternate;if(y!==null&&(y=y.updateQueue,f===y)){var C=null,B=null;if(f=f.firstBaseUpdate,f!==null){do{var U={eventTime:f.eventTime,lane:f.lane,tag:f.tag,payload:f.payload,callback:f.callback,next:null};B===null?C=B=U:B=B.next=U,f=f.next}while(f!==null);B===null?C=B=l:B=B.next=l}else C=B=l;f={baseState:y.baseState,firstBaseUpdate:C,lastBaseUpdate:B,shared:y.shared,effects:y.effects},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=l:a.next=l,f.lastBaseUpdate=l}function Xf(a,l,f,y){var C=a.updateQueue;Ua=!1;var B=C.firstBaseUpdate,U=C.lastBaseUpdate,q=C.shared.pending;if(q!==null){C.shared.pending=null;var J=q,ce=J.next;J.next=null,U===null?B=ce:U.next=ce,U=J;var we=a.alternate;we!==null&&(we=we.updateQueue,q=we.lastBaseUpdate,q!==U&&(q===null?we.firstBaseUpdate=ce:q.next=ce,we.lastBaseUpdate=J))}if(B!==null){var Ie=C.baseState;U=0,we=ce=J=null,q=B;do{var xe=q.lane,Le=q.eventTime;if((y&xe)===xe){we!==null&&(we=we.next={eventTime:Le,lane:0,tag:q.tag,payload:q.payload,callback:q.callback,next:null});e:{var ze=a,Ve=q;switch(xe=l,Le=f,Ve.tag){case 1:if(ze=Ve.payload,typeof ze=="function"){Ie=ze.call(Le,Ie,xe);break e}Ie=ze;break e;case 3:ze.flags=ze.flags&-65537|128;case 0:if(ze=Ve.payload,xe=typeof ze=="function"?ze.call(Le,Ie,xe):ze,xe==null)break e;Ie=Q({},Ie,xe);break e;case 2:Ua=!0}}q.callback!==null&&q.lane!==0&&(a.flags|=64,xe=C.effects,xe===null?C.effects=[q]:xe.push(q))}else Le={eventTime:Le,lane:xe,tag:q.tag,payload:q.payload,callback:q.callback,next:null},we===null?(ce=we=Le,J=Ie):we=we.next=Le,U|=xe;if(q=q.next,q===null){if(q=C.shared.pending,q===null)break;xe=q,q=xe.next,xe.next=null,C.lastBaseUpdate=xe,C.shared.pending=null}}while(1);if(we===null&&(J=Ie),C.baseState=J,C.firstBaseUpdate=ce,C.lastBaseUpdate=we,l=C.shared.interleaved,l!==null){C=l;do U|=C.lane,C=C.next;while(C!==l)}else B===null&&(C.shared.lanes=0);Qo|=U,a.lanes=U,a.memoizedState=Ie}}function qC(a,l,f){if(a=l.effects,l.effects=null,a!==null)for(l=0;l<a.length;l++){var y=a[l],C=y.callback;if(C!==null){if(y.callback=null,y=f,typeof C!="function")throw Error(t(191,C));C.call(y)}}}var XC=new r.Component().refs;function k0(a,l,f,y){l=a.memoizedState,f=f(y,l),f=f==null?l:Q({},l,f),a.memoizedState=f,a.lanes===0&&(a.updateQueue.baseState=f)}var Kf={isMounted:function(a){return(a=a._reactInternals)?Us(a)===a:!1},enqueueSetState:function(a,l,f){a=a._reactInternals;var y=gn(),C=Fa(a),B=Hs(y,C);B.payload=l,f!=null&&(B.callback=f),l=Pa(a,B,C),l!==null&&(Fi(l,a,C,y),qf(l,a,C))},enqueueReplaceState:function(a,l,f){a=a._reactInternals;var y=gn(),C=Fa(a),B=Hs(y,C);B.tag=1,B.payload=l,f!=null&&(B.callback=f),l=Pa(a,B,C),l!==null&&(Fi(l,a,C,y),qf(l,a,C))},enqueueForceUpdate:function(a,l){a=a._reactInternals;var f=gn(),y=Fa(a),C=Hs(f,y);C.tag=2,l!=null&&(C.callback=l),l=Pa(a,C,y),l!==null&&(Fi(l,a,y,f),qf(l,a,y))}};function KC(a,l,f,y,C,B,U){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(y,B,U):l.prototype&&l.prototype.isPureReactComponent?!ah(f,y)||!ah(C,B):!0}function JC(a,l,f){var y=!1,C=La,B=l.contextType;return typeof B=="object"&&B!==null?B=pi(B):(C=Nn(l)?Do:tn.current,y=l.contextTypes,B=(y=y!=null)?Ac(a,C):La),l=new l(f,B),a.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Kf,a.stateNode=l,l._reactInternals=a,y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=C,a.__reactInternalMemoizedMaskedChildContext=B),l}function ZC(a,l,f,y){a=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(f,y),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(f,y),l.state!==a&&Kf.enqueueReplaceState(l,l.state,null)}function Q0(a,l,f,y){var C=a.stateNode;C.props=f,C.state=a.memoizedState,C.refs=XC,P0(a);var B=l.contextType;typeof B=="object"&&B!==null?C.context=pi(B):(B=Nn(l)?Do:tn.current,C.context=Ac(a,B)),C.state=a.memoizedState,B=l.getDerivedStateFromProps,typeof B=="function"&&(k0(a,l,B,f),C.state=a.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(l=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),l!==C.state&&Kf.enqueueReplaceState(C,C.state,null),Xf(a,f,C,y),C.state=a.memoizedState),typeof C.componentDidMount=="function"&&(a.flags|=4194308)}function fh(a,l,f){if(a=f.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(f._owner){if(f=f._owner,f){if(f.tag!==1)throw Error(t(309));var y=f.stateNode}if(!y)throw Error(t(147,a));var C=y,B=""+a;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===B?l.ref:(l=function(U){var q=C.refs;q===XC&&(q=C.refs={}),U===null?delete q[B]:q[B]=U},l._stringRef=B,l)}if(typeof a!="string")throw Error(t(284));if(!f._owner)throw Error(t(290,a))}return a}function Jf(a,l){throw a=Object.prototype.toString.call(l),Error(t(31,a==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":a))}function $C(a){var l=a._init;return l(a._payload)}function e3(a){function l(se,$){if(a){var oe=se.deletions;oe===null?(se.deletions=[$],se.flags|=16):oe.push($)}}function f(se,$){if(!a)return null;for(;$!==null;)l(se,$),$=$.sibling;return null}function y(se,$){for(se=new Map;$!==null;)$.key!==null?se.set($.key,$):se.set($.index,$),$=$.sibling;return se}function C(se,$){return se=Ha(se,$),se.index=0,se.sibling=null,se}function B(se,$,oe){return se.index=oe,a?(oe=se.alternate,oe!==null?(oe=oe.index,oe<$?(se.flags|=2,$):oe):(se.flags|=2,$)):(se.flags|=1048576,$)}function U(se){return a&&se.alternate===null&&(se.flags|=2),se}function q(se,$,oe,Me){return $===null||$.tag!==6?($=E1(oe,se.mode,Me),$.return=se,$):($=C($,oe),$.return=se,$)}function J(se,$,oe,Me){var je=oe.type;return je===T?we(se,$,oe.props.children,Me,oe.key):$!==null&&($.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===K&&$C(je)===$.type)?(Me=C($,oe.props),Me.ref=fh(se,$,oe),Me.return=se,Me):(Me=gp(oe.type,oe.key,oe.props,null,se.mode,Me),Me.ref=fh(se,$,oe),Me.return=se,Me)}function ce(se,$,oe,Me){return $===null||$.tag!==4||$.stateNode.containerInfo!==oe.containerInfo||$.stateNode.implementation!==oe.implementation?($=x1(oe,se.mode,Me),$.return=se,$):($=C($,oe.children||[]),$.return=se,$)}function we(se,$,oe,Me,je){return $===null||$.tag!==7?($=Ho(oe,se.mode,Me,je),$.return=se,$):($=C($,oe),$.return=se,$)}function Ie(se,$,oe){if(typeof $=="string"&&$!==""||typeof $=="number")return $=E1(""+$,se.mode,oe),$.return=se,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case R:return oe=gp($.type,$.key,$.props,null,se.mode,oe),oe.ref=fh(se,null,$),oe.return=se,oe;case S:return $=x1($,se.mode,oe),$.return=se,$;case K:var Me=$._init;return Ie(se,Me($._payload),oe)}if(ue($)||te($))return $=Ho($,se.mode,oe,null),$.return=se,$;Jf(se,$)}return null}function xe(se,$,oe,Me){var je=$!==null?$.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number")return je!==null?null:q(se,$,""+oe,Me);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case R:return oe.key===je?J(se,$,oe,Me):null;case S:return oe.key===je?ce(se,$,oe,Me):null;case K:return je=oe._init,xe(se,$,je(oe._payload),Me)}if(ue(oe)||te(oe))return je!==null?null:we(se,$,oe,Me,null);Jf(se,oe)}return null}function Le(se,$,oe,Me,je){if(typeof Me=="string"&&Me!==""||typeof Me=="number")return se=se.get(oe)||null,q($,se,""+Me,je);if(typeof Me=="object"&&Me!==null){switch(Me.$$typeof){case R:return se=se.get(Me.key===null?oe:Me.key)||null,J($,se,Me,je);case S:return se=se.get(Me.key===null?oe:Me.key)||null,ce($,se,Me,je);case K:var Ke=Me._init;return Le(se,$,oe,Ke(Me._payload),je)}if(ue(Me)||te(Me))return se=se.get(oe)||null,we($,se,Me,je,null);Jf($,Me)}return null}function ze(se,$,oe,Me){for(var je=null,Ke=null,Je=$,st=$=0,Vr=null;Je!==null&&st<oe.length;st++){Je.index>st?(Vr=Je,Je=null):Vr=Je.sibling;var Tt=xe(se,Je,oe[st],Me);if(Tt===null){Je===null&&(Je=Vr);break}a&&Je&&Tt.alternate===null&&l(se,Je),$=B(Tt,$,st),Ke===null?je=Tt:Ke.sibling=Tt,Ke=Tt,Je=Vr}if(st===oe.length)return f(se,Je),tr&&No(se,st),je;if(Je===null){for(;st<oe.length;st++)Je=Ie(se,oe[st],Me),Je!==null&&($=B(Je,$,st),Ke===null?je=Je:Ke.sibling=Je,Ke=Je);return tr&&No(se,st),je}for(Je=y(se,Je);st<oe.length;st++)Vr=Le(Je,se,st,oe[st],Me),Vr!==null&&(a&&Vr.alternate!==null&&Je.delete(Vr.key===null?st:Vr.key),$=B(Vr,$,st),Ke===null?je=Vr:Ke.sibling=Vr,Ke=Vr);return a&&Je.forEach(function(Ga){return l(se,Ga)}),tr&&No(se,st),je}function Ve(se,$,oe,Me){var je=te(oe);if(typeof je!="function")throw Error(t(150));if(oe=je.call(oe),oe==null)throw Error(t(151));for(var Ke=je=null,Je=$,st=$=0,Vr=null,Tt=oe.next();Je!==null&&!Tt.done;st++,Tt=oe.next()){Je.index>st?(Vr=Je,Je=null):Vr=Je.sibling;var Ga=xe(se,Je,Tt.value,Me);if(Ga===null){Je===null&&(Je=Vr);break}a&&Je&&Ga.alternate===null&&l(se,Je),$=B(Ga,$,st),Ke===null?je=Ga:Ke.sibling=Ga,Ke=Ga,Je=Vr}if(Tt.done)return f(se,Je),tr&&No(se,st),je;if(Je===null){for(;!Tt.done;st++,Tt=oe.next())Tt=Ie(se,Tt.value,Me),Tt!==null&&($=B(Tt,$,st),Ke===null?je=Tt:Ke.sibling=Tt,Ke=Tt);return tr&&No(se,st),je}for(Je=y(se,Je);!Tt.done;st++,Tt=oe.next())Tt=Le(Je,se,st,Tt.value,Me),Tt!==null&&(a&&Tt.alternate!==null&&Je.delete(Tt.key===null?st:Tt.key),$=B(Tt,$,st),Ke===null?je=Tt:Ke.sibling=Tt,Ke=Tt);return a&&Je.forEach(function(wQ){return l(se,wQ)}),tr&&No(se,st),je}function vr(se,$,oe,Me){if(typeof oe=="object"&&oe!==null&&oe.type===T&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case R:e:{for(var je=oe.key,Ke=$;Ke!==null;){if(Ke.key===je){if(je=oe.type,je===T){if(Ke.tag===7){f(se,Ke.sibling),$=C(Ke,oe.props.children),$.return=se,se=$;break e}}else if(Ke.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===K&&$C(je)===Ke.type){f(se,Ke.sibling),$=C(Ke,oe.props),$.ref=fh(se,Ke,oe),$.return=se,se=$;break e}f(se,Ke);break}else l(se,Ke);Ke=Ke.sibling}oe.type===T?($=Ho(oe.props.children,se.mode,Me,oe.key),$.return=se,se=$):(Me=gp(oe.type,oe.key,oe.props,null,se.mode,Me),Me.ref=fh(se,$,oe),Me.return=se,se=Me)}return U(se);case S:e:{for(Ke=oe.key;$!==null;){if($.key===Ke)if($.tag===4&&$.stateNode.containerInfo===oe.containerInfo&&$.stateNode.implementation===oe.implementation){f(se,$.sibling),$=C($,oe.children||[]),$.return=se,se=$;break e}else{f(se,$);break}else l(se,$);$=$.sibling}$=x1(oe,se.mode,Me),$.return=se,se=$}return U(se);case K:return Ke=oe._init,vr(se,$,Ke(oe._payload),Me)}if(ue(oe))return ze(se,$,oe,Me);if(te(oe))return Ve(se,$,oe,Me);Jf(se,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"?(oe=""+oe,$!==null&&$.tag===6?(f(se,$.sibling),$=C($,oe),$.return=se,se=$):(f(se,$),$=E1(oe,se.mode,Me),$.return=se,se=$),U(se)):f(se,$)}return vr}var Ec=e3(!0),t3=e3(!1),ph={},is=Da(ph),Ah=Da(ph),gh=Da(ph);function Po(a){if(a===ph)throw Error(t(174));return a}function O0(a,l){switch(Wt(gh,l),Wt(Ah,a),Wt(is,ph),a=l.nodeType,a){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:Ce(null,"");break;default:a=a===8?l.parentNode:l,l=a.namespaceURI||null,a=a.tagName,l=Ce(l,a)}Kt(is),Wt(is,l)}function xc(){Kt(is),Kt(Ah),Kt(gh)}function r3(a){Po(gh.current);var l=Po(is.current),f=Ce(l,a.type);l!==f&&(Wt(Ah,a),Wt(is,f))}function F0(a){Ah.current===a&&(Kt(is),Kt(Ah))}var sr=Da(0);function Zf(a){for(var l=a;l!==null;){if(l.tag===13){var f=l.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||f.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if(l.flags&128)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var z0=[];function H0(){for(var a=0;a<z0.length;a++)z0[a]._workInProgressVersionPrimary=null;z0.length=0}var $f=I.ReactCurrentDispatcher,G0=I.ReactCurrentBatchConfig,ko=0,ar=null,Dr=null,Hr=null,ep=!1,mh=!1,_h=0,j7=0;function rn(){throw Error(t(321))}function V0(a,l){if(l===null)return!1;for(var f=0;f<l.length&&f<a.length;f++)if(!Ui(a[f],l[f]))return!1;return!0}function j0(a,l,f,y,C,B){if(ko=B,ar=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,$f.current=a===null||a.memoizedState===null?X7:K7,a=f(y,C),mh){B=0;do{if(mh=!1,_h=0,25<=B)throw Error(t(301));B+=1,Hr=Dr=null,l.updateQueue=null,$f.current=J7,a=f(y,C)}while(mh)}if($f.current=np,l=Dr!==null&&Dr.next!==null,ko=0,Hr=Dr=ar=null,ep=!1,l)throw Error(t(300));return a}function W0(){var a=_h!==0;return _h=0,a}function ss(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Hr===null?ar.memoizedState=Hr=a:Hr=Hr.next=a,Hr}function Ai(){if(Dr===null){var a=ar.alternate;a=a!==null?a.memoizedState:null}else a=Dr.next;var l=Hr===null?ar.memoizedState:Hr.next;if(l!==null)Hr=l,Dr=a;else{if(a===null)throw Error(t(310));Dr=a,a={memoizedState:Dr.memoizedState,baseState:Dr.baseState,baseQueue:Dr.baseQueue,queue:Dr.queue,next:null},Hr===null?ar.memoizedState=Hr=a:Hr=Hr.next=a}return Hr}function vh(a,l){return typeof l=="function"?l(a):l}function Y0(a){var l=Ai(),f=l.queue;if(f===null)throw Error(t(311));f.lastRenderedReducer=a;var y=Dr,C=y.baseQueue,B=f.pending;if(B!==null){if(C!==null){var U=C.next;C.next=B.next,B.next=U}y.baseQueue=C=B,f.pending=null}if(C!==null){B=C.next,y=y.baseState;var q=U=null,J=null,ce=B;do{var we=ce.lane;if((ko&we)===we)J!==null&&(J=J.next={lane:0,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),y=ce.hasEagerState?ce.eagerState:a(y,ce.action);else{var Ie={lane:we,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null};J===null?(q=J=Ie,U=y):J=J.next=Ie,ar.lanes|=we,Qo|=we}ce=ce.next}while(ce!==null&&ce!==B);J===null?U=y:J.next=q,Ui(y,l.memoizedState)||(Un=!0),l.memoizedState=y,l.baseState=U,l.baseQueue=J,f.lastRenderedState=y}if(a=f.interleaved,a!==null){C=a;do B=C.lane,ar.lanes|=B,Qo|=B,C=C.next;while(C!==a)}else C===null&&(f.lanes=0);return[l.memoizedState,f.dispatch]}function q0(a){var l=Ai(),f=l.queue;if(f===null)throw Error(t(311));f.lastRenderedReducer=a;var y=f.dispatch,C=f.pending,B=l.memoizedState;if(C!==null){f.pending=null;var U=C=C.next;do B=a(B,U.action),U=U.next;while(U!==C);Ui(B,l.memoizedState)||(Un=!0),l.memoizedState=B,l.baseQueue===null&&(l.baseState=B),f.lastRenderedState=B}return[B,y]}function n3(){}function i3(a,l){var f=ar,y=Ai(),C=l(),B=!Ui(y.memoizedState,C);if(B&&(y.memoizedState=C,Un=!0),y=y.queue,X0(o3.bind(null,f,y,a),[a]),y.getSnapshot!==l||B||Hr!==null&&Hr.memoizedState.tag&1){if(f.flags|=2048,yh(9,a3.bind(null,f,y,C,l),void 0,null),Gr===null)throw Error(t(349));ko&30||s3(f,l,C)}return C}function s3(a,l,f){a.flags|=16384,a={getSnapshot:l,value:f},l=ar.updateQueue,l===null?(l={lastEffect:null,stores:null},ar.updateQueue=l,l.stores=[a]):(f=l.stores,f===null?l.stores=[a]:f.push(a))}function a3(a,l,f,y){l.value=f,l.getSnapshot=y,l3(l)&&c3(a)}function o3(a,l,f){return f(function(){l3(l)&&c3(a)})}function l3(a){var l=a.getSnapshot;a=a.value;try{var f=l();return!Ui(a,f)}catch{return!0}}function c3(a){var l=zs(a,1);l!==null&&Fi(l,a,1,-1)}function u3(a){var l=ss();return typeof a=="function"&&(a=a()),l.memoizedState=l.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:vh,lastRenderedState:a},l.queue=a,a=a.dispatch=q7.bind(null,ar,a),[l.memoizedState,a]}function yh(a,l,f,y){return a={tag:a,create:l,destroy:f,deps:y,next:null},l=ar.updateQueue,l===null?(l={lastEffect:null,stores:null},ar.updateQueue=l,l.lastEffect=a.next=a):(f=l.lastEffect,f===null?l.lastEffect=a.next=a:(y=f.next,f.next=a,a.next=y,l.lastEffect=a)),a}function h3(){return Ai().memoizedState}function tp(a,l,f,y){var C=ss();ar.flags|=a,C.memoizedState=yh(1|l,f,void 0,y===void 0?null:y)}function rp(a,l,f,y){var C=Ai();y=y===void 0?null:y;var B=void 0;if(Dr!==null){var U=Dr.memoizedState;if(B=U.destroy,y!==null&&V0(y,U.deps)){C.memoizedState=yh(l,f,B,y);return}}ar.flags|=a,C.memoizedState=yh(1|l,f,B,y)}function d3(a,l){return tp(8390656,8,a,l)}function X0(a,l){return rp(2048,8,a,l)}function f3(a,l){return rp(4,2,a,l)}function p3(a,l){return rp(4,4,a,l)}function A3(a,l){if(typeof l=="function")return a=a(),l(a),function(){l(null)};if(l!=null)return a=a(),l.current=a,function(){l.current=null}}function g3(a,l,f){return f=f!=null?f.concat([a]):null,rp(4,4,A3.bind(null,l,a),f)}function K0(){}function m3(a,l){var f=Ai();l=l===void 0?null:l;var y=f.memoizedState;return y!==null&&l!==null&&V0(l,y[1])?y[0]:(f.memoizedState=[a,l],a)}function _3(a,l){var f=Ai();l=l===void 0?null:l;var y=f.memoizedState;return y!==null&&l!==null&&V0(l,y[1])?y[0]:(a=a(),f.memoizedState=[a,l],a)}function v3(a,l,f){return ko&21?(Ui(f,l)||(f=qu(),ar.lanes|=f,Qo|=f,a.baseState=!0),l):(a.baseState&&(a.baseState=!1,Un=!0),a.memoizedState=f)}function W7(a,l){var f=Pt;Pt=f!==0&&4>f?f:4,a(!0);var y=G0.transition;G0.transition={};try{a(!1),l()}finally{Pt=f,G0.transition=y}}function y3(){return Ai().memoizedState}function Y7(a,l,f){var y=Fa(a);if(f={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null},E3(a))x3(l,f);else if(f=jC(a,l,f,y),f!==null){var C=gn();Fi(f,a,y,C),w3(f,l,y)}}function q7(a,l,f){var y=Fa(a),C={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null};if(E3(a))x3(l,C);else{var B=a.alternate;if(a.lanes===0&&(B===null||B.lanes===0)&&(B=l.lastRenderedReducer,B!==null))try{var U=l.lastRenderedState,q=B(U,f);if(C.hasEagerState=!0,C.eagerState=q,Ui(q,U)){var J=l.interleaved;J===null?(C.next=C,U0(l)):(C.next=J.next,J.next=C),l.interleaved=C;return}}catch{}finally{}f=jC(a,l,C,y),f!==null&&(C=gn(),Fi(f,a,y,C),w3(f,l,y))}}function E3(a){var l=a.alternate;return a===ar||l!==null&&l===ar}function x3(a,l){mh=ep=!0;var f=a.pending;f===null?l.next=l:(l.next=f.next,f.next=l),a.pending=l}function w3(a,l,f){if(f&4194240){var y=l.lanes;y&=a.pendingLanes,f|=y,l.lanes=f,Km(a,f)}}var np={readContext:pi,useCallback:rn,useContext:rn,useEffect:rn,useImperativeHandle:rn,useInsertionEffect:rn,useLayoutEffect:rn,useMemo:rn,useReducer:rn,useRef:rn,useState:rn,useDebugValue:rn,useDeferredValue:rn,useTransition:rn,useMutableSource:rn,useSyncExternalStore:rn,useId:rn,unstable_isNewReconciler:!1},X7={readContext:pi,useCallback:function(a,l){return ss().memoizedState=[a,l===void 0?null:l],a},useContext:pi,useEffect:d3,useImperativeHandle:function(a,l,f){return f=f!=null?f.concat([a]):null,tp(4194308,4,A3.bind(null,l,a),f)},useLayoutEffect:function(a,l){return tp(4194308,4,a,l)},useInsertionEffect:function(a,l){return tp(4,2,a,l)},useMemo:function(a,l){var f=ss();return l=l===void 0?null:l,a=a(),f.memoizedState=[a,l],a},useReducer:function(a,l,f){var y=ss();return l=f!==void 0?f(l):l,y.memoizedState=y.baseState=l,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:l},y.queue=a,a=a.dispatch=Y7.bind(null,ar,a),[y.memoizedState,a]},useRef:function(a){var l=ss();return a={current:a},l.memoizedState=a},useState:u3,useDebugValue:K0,useDeferredValue:function(a){return ss().memoizedState=a},useTransition:function(){var a=u3(!1),l=a[0];return a=W7.bind(null,a[1]),ss().memoizedState=a,[l,a]},useMutableSource:function(){},useSyncExternalStore:function(a,l,f){var y=ar,C=ss();if(tr){if(f===void 0)throw Error(t(407));f=f()}else{if(f=l(),Gr===null)throw Error(t(349));ko&30||s3(y,l,f)}C.memoizedState=f;var B={value:f,getSnapshot:l};return C.queue=B,d3(o3.bind(null,y,B,a),[a]),y.flags|=2048,yh(9,a3.bind(null,y,B,f,l),void 0,null),f},useId:function(){var a=ss(),l=Gr.identifierPrefix;if(tr){var f=Fs,y=Os;f=(y&~(1<<32-pn(y)-1)).toString(32)+f,l=":"+l+"R"+f,f=_h++,0<f&&(l+="H"+f.toString(32)),l+=":"}else f=j7++,l=":"+l+"r"+f.toString(32)+":";return a.memoizedState=l},unstable_isNewReconciler:!1},K7={readContext:pi,useCallback:m3,useContext:pi,useEffect:X0,useImperativeHandle:g3,useInsertionEffect:f3,useLayoutEffect:p3,useMemo:_3,useReducer:Y0,useRef:h3,useState:function(){return Y0(vh)},useDebugValue:K0,useDeferredValue:function(a){var l=Ai();return v3(l,Dr.memoizedState,a)},useTransition:function(){var a=Y0(vh)[0],l=Ai().memoizedState;return[a,l]},useMutableSource:n3,useSyncExternalStore:i3,useId:y3,unstable_isNewReconciler:!1},J7={readContext:pi,useCallback:m3,useContext:pi,useEffect:X0,useImperativeHandle:g3,useInsertionEffect:f3,useLayoutEffect:p3,useMemo:_3,useReducer:q0,useRef:h3,useState:function(){return q0(vh)},useDebugValue:K0,useDeferredValue:function(a){var l=Ai();return Dr===null?l.memoizedState=a:v3(l,Dr.memoizedState,a)},useTransition:function(){var a=q0(vh)[0],l=Ai().memoizedState;return[a,l]},useMutableSource:n3,useSyncExternalStore:i3,useId:y3,unstable_isNewReconciler:!1};function wc(a,l){try{var f="",y=l;do f+=fe(y),y=y.return;while(y);var C=f}catch(B){C=`
4487
4487
  Error generating stack: `+B.message+`
4488
- `+B.stack}return{value:a,source:l,stack:C,digest:null}}function J0(a,l,f){return{value:a,source:null,stack:f??null,digest:l??null}}function Z0(a,l){try{console.error(l.value)}catch(f){setTimeout(function(){throw f})}}var Z7=typeof WeakMap=="function"?WeakMap:Map;function I3(a,l,f){f=Hs(-1,f),f.tag=3,f.payload={element:null};var y=l.value;return f.callback=function(){up||(up=!0,f1=y),Z0(a,l)},f}function C3(a,l,f){f=Hs(-1,f),f.tag=3;var y=a.type.getDerivedStateFromError;if(typeof y=="function"){var C=l.value;f.payload=function(){return y(C)},f.callback=function(){Z0(a,l)}}var B=a.stateNode;return B!==null&&typeof B.componentDidCatch=="function"&&(f.callback=function(){Z0(a,l),typeof y!="function"&&(Qa===null?Qa=new Set([this]):Qa.add(this));var U=l.stack;this.componentDidCatch(l.value,{componentStack:U!==null?U:""})}),f}function M3(a,l,f){var y=a.pingCache;if(y===null){y=a.pingCache=new Z7;var C=new Set;y.set(l,C)}else C=y.get(l),C===void 0&&(C=new Set,y.set(l,C));C.has(f)||(C.add(f),a=dQ.bind(null,a,l,f),l.then(a,a))}function S3(a){do{var l;if((l=a.tag===13)&&(l=a.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return a;a=a.return}while(a!==null);return null}function T3(a,l,f,y,C){return a.mode&1?(a.flags|=65536,a.lanes=C,a):(a===l?a.flags|=65536:(a.flags|=128,f.flags|=131072,f.flags&=-52805,f.tag===1&&(f.alternate===null?f.tag=17:(l=Hs(-1,1),l.tag=2,Pa(f,l,1))),f.lanes|=1),a)}var $7=I.ReactCurrentOwner,Nn=!1;function An(a,l,f,y){l.child=a===null?t3(l,null,f,y):Ec(l,a.child,f,y)}function B3(a,l,f,y,C){f=f.render;var B=l.ref;return yc(l,C),y=j0(a,l,f,y,B,C),f=W0(),a!==null&&!Nn?(l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~C,Gs(a,l,C)):(tr&&f&&M0(l),l.flags|=1,An(a,l,y,C),l.child)}function b3(a,l,f,y,C){if(a===null){var B=f.type;return typeof B=="function"&&!y1(B)&&B.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(l.tag=15,l.type=B,R3(a,l,B,y,C)):(a=gp(f.type,null,y,l,l.mode,C),a.ref=l.ref,a.return=l,l.child=a)}if(B=a.child,!(a.lanes&C)){var U=B.memoizedProps;if(f=f.compare,f=f!==null?f:ah,f(U,y)&&a.ref===l.ref)return Gs(a,l,C)}return l.flags|=1,a=Ha(B,y),a.ref=l.ref,a.return=l,l.child=a}function R3(a,l,f,y,C){if(a!==null){var B=a.memoizedProps;if(ah(B,y)&&a.ref===l.ref)if(Nn=!1,l.pendingProps=y=B,(a.lanes&C)!==0)a.flags&131072&&(Nn=!0);else return l.lanes=a.lanes,Gs(a,l,C)}return $0(a,l,f,y,C)}function D3(a,l,f){var y=l.pendingProps,C=y.children,B=a!==null?a.memoizedState:null;if(y.mode==="hidden")if(!(l.mode&1))l.memoizedState={baseLanes:0,cachePool:null,transitions:null},Wt(Cc,ei),ei|=f;else{if(!(f&1073741824))return a=B!==null?B.baseLanes|f:f,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:a,cachePool:null,transitions:null},l.updateQueue=null,Wt(Cc,ei),ei|=a,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=B!==null?B.baseLanes:f,Wt(Cc,ei),ei|=y}else B!==null?(y=B.baseLanes|f,l.memoizedState=null):y=f,Wt(Cc,ei),ei|=y;return An(a,l,C,f),l.child}function L3(a,l){var f=l.ref;(a===null&&f!==null||a!==null&&a.ref!==f)&&(l.flags|=512,l.flags|=2097152)}function $0(a,l,f,y,C){var B=Ln(f)?Do:tn.current;return B=Ac(l,B),yc(l,C),f=j0(a,l,f,y,B,C),y=W0(),a!==null&&!Nn?(l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~C,Gs(a,l,C)):(tr&&y&&M0(l),l.flags|=1,An(a,l,f,C),l.child)}function N3(a,l,f,y,C){if(Ln(f)){var B=!0;zf(l)}else B=!1;if(yc(l,C),l.stateNode===null)sp(a,l),JC(l,f,y),Q0(l,f,y,C),y=!0;else if(a===null){var U=l.stateNode,q=l.memoizedProps;U.props=q;var J=U.context,ce=f.contextType;typeof ce=="object"&&ce!==null?ce=pi(ce):(ce=Ln(f)?Do:tn.current,ce=Ac(l,ce));var we=f.getDerivedStateFromProps,Ie=typeof we=="function"||typeof U.getSnapshotBeforeUpdate=="function";Ie||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(q!==y||J!==ce)&&ZC(l,U,y,ce),Ua=!1;var xe=l.memoizedState;U.state=xe,Xf(l,y,U,C),J=l.memoizedState,q!==y||xe!==J||Dn.current||Ua?(typeof we=="function"&&(k0(l,f,we,y),J=l.memoizedState),(q=Ua||KC(l,f,q,y,xe,J,ce))?(Ie||typeof U.UNSAFE_componentWillMount!="function"&&typeof U.componentWillMount!="function"||(typeof U.componentWillMount=="function"&&U.componentWillMount(),typeof U.UNSAFE_componentWillMount=="function"&&U.UNSAFE_componentWillMount()),typeof U.componentDidMount=="function"&&(l.flags|=4194308)):(typeof U.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=y,l.memoizedState=J),U.props=y,U.state=J,U.context=ce,y=q):(typeof U.componentDidMount=="function"&&(l.flags|=4194308),y=!1)}else{U=l.stateNode,WC(a,l),q=l.memoizedProps,ce=l.type===l.elementType?q:ki(l.type,q),U.props=ce,Ie=l.pendingProps,xe=U.context,J=f.contextType,typeof J=="object"&&J!==null?J=pi(J):(J=Ln(f)?Do:tn.current,J=Ac(l,J));var Le=f.getDerivedStateFromProps;(we=typeof Le=="function"||typeof U.getSnapshotBeforeUpdate=="function")||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(q!==Ie||xe!==J)&&ZC(l,U,y,J),Ua=!1,xe=l.memoizedState,U.state=xe,Xf(l,y,U,C);var ze=l.memoizedState;q!==Ie||xe!==ze||Dn.current||Ua?(typeof Le=="function"&&(k0(l,f,Le,y),ze=l.memoizedState),(ce=Ua||KC(l,f,ce,y,xe,ze,J)||!1)?(we||typeof U.UNSAFE_componentWillUpdate!="function"&&typeof U.componentWillUpdate!="function"||(typeof U.componentWillUpdate=="function"&&U.componentWillUpdate(y,ze,J),typeof U.UNSAFE_componentWillUpdate=="function"&&U.UNSAFE_componentWillUpdate(y,ze,J)),typeof U.componentDidUpdate=="function"&&(l.flags|=4),typeof U.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof U.componentDidUpdate!="function"||q===a.memoizedProps&&xe===a.memoizedState||(l.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||q===a.memoizedProps&&xe===a.memoizedState||(l.flags|=1024),l.memoizedProps=y,l.memoizedState=ze),U.props=y,U.state=ze,U.context=J,y=ce):(typeof U.componentDidUpdate!="function"||q===a.memoizedProps&&xe===a.memoizedState||(l.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||q===a.memoizedProps&&xe===a.memoizedState||(l.flags|=1024),y=!1)}return e1(a,l,f,y,B,C)}function e1(a,l,f,y,C,B){L3(a,l);var U=(l.flags&128)!==0;if(!y&&!U)return C&&QC(l,f,!1),Gs(a,l,B);y=l.stateNode,$7.current=l;var q=U&&typeof f.getDerivedStateFromError!="function"?null:y.render();return l.flags|=1,a!==null&&U?(l.child=Ec(l,a.child,null,B),l.child=Ec(l,null,q,B)):An(a,l,q,B),l.memoizedState=y.state,C&&QC(l,f,!0),l.child}function U3(a){var l=a.stateNode;l.pendingContext?PC(a,l.pendingContext,l.pendingContext!==l.context):l.context&&PC(a,l.context,!1),O0(a,l.containerInfo)}function P3(a,l,f,y,C){return _c(),b0(C),l.flags|=256,An(a,l,f,y),l.child}var t1={dehydrated:null,treeContext:null,retryLane:0};function r1(a){return{baseLanes:a,cachePool:null,transitions:null}}function k3(a,l,f){var y=l.pendingProps,C=sr.current,B=!1,U=(l.flags&128)!==0,q;if((q=U)||(q=a!==null&&a.memoizedState===null?!1:(C&2)!==0),q?(B=!0,l.flags&=-129):(a===null||a.memoizedState!==null)&&(C|=1),Wt(sr,C&1),a===null)return B0(l),a=l.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?(l.mode&1?a.data==="$!"?l.lanes=8:l.lanes=1073741824:l.lanes=1,null):(U=y.children,a=y.fallback,B?(y=l.mode,B=l.child,U={mode:"hidden",children:U},!(y&1)&&B!==null?(B.childLanes=0,B.pendingProps=U):B=mp(U,y,0,null),a=Ho(a,y,f,null),B.return=l,a.return=l,B.sibling=a,l.child=B,l.child.memoizedState=r1(f),l.memoizedState=t1,a):n1(l,U));if(C=a.memoizedState,C!==null&&(q=C.dehydrated,q!==null))return eQ(a,l,U,y,q,C,f);if(B){B=y.fallback,U=l.mode,C=a.child,q=C.sibling;var J={mode:"hidden",children:y.children};return!(U&1)&&l.child!==C?(y=l.child,y.childLanes=0,y.pendingProps=J,l.deletions=null):(y=Ha(C,J),y.subtreeFlags=C.subtreeFlags&14680064),q!==null?B=Ha(q,B):(B=Ho(B,U,f,null),B.flags|=2),B.return=l,y.return=l,y.sibling=B,l.child=y,y=B,B=l.child,U=a.child.memoizedState,U=U===null?r1(f):{baseLanes:U.baseLanes|f,cachePool:null,transitions:U.transitions},B.memoizedState=U,B.childLanes=a.childLanes&~f,l.memoizedState=t1,y}return B=a.child,a=B.sibling,y=Ha(B,{mode:"visible",children:y.children}),!(l.mode&1)&&(y.lanes=f),y.return=l,y.sibling=null,a!==null&&(f=l.deletions,f===null?(l.deletions=[a],l.flags|=16):f.push(a)),l.child=y,l.memoizedState=null,y}function n1(a,l){return l=mp({mode:"visible",children:l},a.mode,0,null),l.return=a,a.child=l}function ip(a,l,f,y){return y!==null&&b0(y),Ec(l,a.child,null,f),a=n1(l,l.pendingProps.children),a.flags|=2,l.memoizedState=null,a}function eQ(a,l,f,y,C,B,U){if(f)return l.flags&256?(l.flags&=-257,y=J0(Error(t(422))),ip(a,l,U,y)):l.memoizedState!==null?(l.child=a.child,l.flags|=128,null):(B=y.fallback,C=l.mode,y=mp({mode:"visible",children:y.children},C,0,null),B=Ho(B,C,U,null),B.flags|=2,y.return=l,B.return=l,y.sibling=B,l.child=y,l.mode&1&&Ec(l,a.child,null,U),l.child.memoizedState=r1(U),l.memoizedState=t1,B);if(!(l.mode&1))return ip(a,l,U,null);if(C.data==="$!"){if(y=C.nextSibling&&C.nextSibling.dataset,y)var q=y.dgst;return y=q,B=Error(t(419)),y=J0(B,y,void 0),ip(a,l,U,y)}if(q=(U&a.childLanes)!==0,Nn||q){if(y=Gr,y!==null){switch(U&-U){case 4:C=2;break;case 16:C=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:C=32;break;case 536870912:C=268435456;break;default:C=0}C=C&(y.suspendedLanes|U)?0:C,C!==0&&C!==B.retryLane&&(B.retryLane=C,zs(a,C),Fi(y,a,C,-1))}return v1(),y=J0(Error(t(421))),ip(a,l,U,y)}return C.data==="$?"?(l.flags|=128,l.child=a.child,l=fQ.bind(null,a),C._reactRetry=l,null):(a=B.treeContext,$n=Ra(C.nextSibling),Zn=l,tr=!0,Pi=null,a!==null&&(di[fi++]=Os,di[fi++]=Fs,di[fi++]=Lo,Os=a.id,Fs=a.overflow,Lo=l),l=n1(l,y.children),l.flags|=4096,l)}function Q3(a,l,f){a.lanes|=l;var y=a.alternate;y!==null&&(y.lanes|=l),N0(a.return,l,f)}function i1(a,l,f,y,C){var B=a.memoizedState;B===null?a.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:y,tail:f,tailMode:C}:(B.isBackwards=l,B.rendering=null,B.renderingStartTime=0,B.last=y,B.tail=f,B.tailMode=C)}function O3(a,l,f){var y=l.pendingProps,C=y.revealOrder,B=y.tail;if(An(a,l,y.children,f),y=sr.current,y&2)y=y&1|2,l.flags|=128;else{if(a!==null&&a.flags&128)e:for(a=l.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Q3(a,f,l);else if(a.tag===19)Q3(a,f,l);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===l)break e;for(;a.sibling===null;){if(a.return===null||a.return===l)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}y&=1}if(Wt(sr,y),!(l.mode&1))l.memoizedState=null;else switch(C){case"forwards":for(f=l.child,C=null;f!==null;)a=f.alternate,a!==null&&Zf(a)===null&&(C=f),f=f.sibling;f=C,f===null?(C=l.child,l.child=null):(C=f.sibling,f.sibling=null),i1(l,!1,C,f,B);break;case"backwards":for(f=null,C=l.child,l.child=null;C!==null;){if(a=C.alternate,a!==null&&Zf(a)===null){l.child=C;break}a=C.sibling,C.sibling=f,f=C,C=a}i1(l,!0,f,null,B);break;case"together":i1(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function sp(a,l){!(l.mode&1)&&a!==null&&(a.alternate=null,l.alternate=null,l.flags|=2)}function Gs(a,l,f){if(a!==null&&(l.dependencies=a.dependencies),Qo|=l.lanes,!(f&l.childLanes))return null;if(a!==null&&l.child!==a.child)throw Error(t(153));if(l.child!==null){for(a=l.child,f=Ha(a,a.pendingProps),l.child=f,f.return=l;a.sibling!==null;)a=a.sibling,f=f.sibling=Ha(a,a.pendingProps),f.return=l;f.sibling=null}return l.child}function tQ(a,l,f){switch(l.tag){case 3:U3(l),_c();break;case 5:r3(l);break;case 1:Ln(l.type)&&zf(l);break;case 4:O0(l,l.stateNode.containerInfo);break;case 10:var y=l.type._context,C=l.memoizedProps.value;Wt(Wf,y._currentValue),y._currentValue=C;break;case 13:if(y=l.memoizedState,y!==null)return y.dehydrated!==null?(Wt(sr,sr.current&1),l.flags|=128,null):f&l.child.childLanes?k3(a,l,f):(Wt(sr,sr.current&1),a=Gs(a,l,f),a!==null?a.sibling:null);Wt(sr,sr.current&1);break;case 19:if(y=(f&l.childLanes)!==0,a.flags&128){if(y)return O3(a,l,f);l.flags|=128}if(C=l.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),Wt(sr,sr.current),y)break;return null;case 22:case 23:return l.lanes=0,D3(a,l,f)}return Gs(a,l,f)}var F3,s1,z3,H3;F3=function(a,l){for(var f=l.child;f!==null;){if(f.tag===5||f.tag===6)a.appendChild(f.stateNode);else if(f.tag!==4&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===l)break;for(;f.sibling===null;){if(f.return===null||f.return===l)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},s1=function(){},z3=function(a,l,f,y){var C=a.memoizedProps;if(C!==y){a=l.stateNode,Po(is.current);var B=null;switch(f){case"input":C=lt(a,C),y=lt(a,y),B=[];break;case"select":C=Q({},C,{value:void 0}),y=Q({},y,{value:void 0}),B=[];break;case"textarea":C=ge(a,C),y=ge(a,y),B=[];break;default:typeof C.onClick!="function"&&typeof y.onClick=="function"&&(a.onclick=Qf)}Et(f,y);var U;f=null;for(ce in C)if(!y.hasOwnProperty(ce)&&C.hasOwnProperty(ce)&&C[ce]!=null)if(ce==="style"){var q=C[ce];for(U in q)q.hasOwnProperty(U)&&(f||(f={}),f[U]="")}else ce!=="dangerouslySetInnerHTML"&&ce!=="children"&&ce!=="suppressContentEditableWarning"&&ce!=="suppressHydrationWarning"&&ce!=="autoFocus"&&(i.hasOwnProperty(ce)?B||(B=[]):(B=B||[]).push(ce,null));for(ce in y){var J=y[ce];if(q=C!=null?C[ce]:void 0,y.hasOwnProperty(ce)&&J!==q&&(J!=null||q!=null))if(ce==="style")if(q){for(U in q)!q.hasOwnProperty(U)||J&&J.hasOwnProperty(U)||(f||(f={}),f[U]="");for(U in J)J.hasOwnProperty(U)&&q[U]!==J[U]&&(f||(f={}),f[U]=J[U])}else f||(B||(B=[]),B.push(ce,f)),f=J;else ce==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,q=q?q.__html:void 0,J!=null&&q!==J&&(B=B||[]).push(ce,J)):ce==="children"?typeof J!="string"&&typeof J!="number"||(B=B||[]).push(ce,""+J):ce!=="suppressContentEditableWarning"&&ce!=="suppressHydrationWarning"&&(i.hasOwnProperty(ce)?(J!=null&&ce==="onScroll"&&Xt("scroll",a),B||q===J||(B=[])):(B=B||[]).push(ce,J))}f&&(B=B||[]).push("style",f);var ce=B;(l.updateQueue=ce)&&(l.flags|=4)}},H3=function(a,l,f,y){f!==y&&(l.flags|=4)};function Eh(a,l){if(!tr)switch(a.tailMode){case"hidden":l=a.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.sibling;f===null?a.tail=null:f.sibling=null;break;case"collapsed":f=a.tail;for(var y=null;f!==null;)f.alternate!==null&&(y=f),f=f.sibling;y===null?l||a.tail===null?a.tail=null:a.tail.sibling=null:y.sibling=null}}function nn(a){var l=a.alternate!==null&&a.alternate.child===a.child,f=0,y=0;if(l)for(var C=a.child;C!==null;)f|=C.lanes|C.childLanes,y|=C.subtreeFlags&14680064,y|=C.flags&14680064,C.return=a,C=C.sibling;else for(C=a.child;C!==null;)f|=C.lanes|C.childLanes,y|=C.subtreeFlags,y|=C.flags,C.return=a,C=C.sibling;return a.subtreeFlags|=y,a.childLanes=f,l}function rQ(a,l,f){var y=l.pendingProps;switch(S0(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nn(l),null;case 1:return Ln(l.type)&&Ff(),nn(l),null;case 3:return y=l.stateNode,xc(),Kt(Dn),Kt(tn),H0(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(a===null||a.child===null)&&(jf(l)?l.flags|=4:a===null||a.memoizedState.isDehydrated&&!(l.flags&256)||(l.flags|=1024,Pi!==null&&(g1(Pi),Pi=null))),s1(a,l),nn(l),null;case 5:F0(l);var C=Po(gh.current);if(f=l.type,a!==null&&l.stateNode!=null)z3(a,l,f,y,C),a.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!y){if(l.stateNode===null)throw Error(t(166));return nn(l),null}if(a=Po(is.current),jf(l)){y=l.stateNode,f=l.type;var B=l.memoizedProps;switch(y[ns]=l,y[hh]=B,a=(l.mode&1)!==0,f){case"dialog":Xt("cancel",y),Xt("close",y);break;case"iframe":case"object":case"embed":Xt("load",y);break;case"video":case"audio":for(C=0;C<lh.length;C++)Xt(lh[C],y);break;case"source":Xt("error",y);break;case"img":case"image":case"link":Xt("error",y),Xt("load",y);break;case"details":Xt("toggle",y);break;case"input":Ye(y,B),Xt("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!B.multiple},Xt("invalid",y);break;case"textarea":Ue(y,B),Xt("invalid",y)}Et(f,B),C=null;for(var U in B)if(B.hasOwnProperty(U)){var q=B[U];U==="children"?typeof q=="string"?y.textContent!==q&&(B.suppressHydrationWarning!==!0&&kf(y.textContent,q,a),C=["children",q]):typeof q=="number"&&y.textContent!==""+q&&(B.suppressHydrationWarning!==!0&&kf(y.textContent,q,a),C=["children",""+q]):i.hasOwnProperty(U)&&q!=null&&U==="onScroll"&&Xt("scroll",y)}switch(f){case"input":ae(y),k(y,B,!0);break;case"textarea":ae(y),Qe(y);break;case"select":case"option":break;default:typeof B.onClick=="function"&&(y.onclick=Qf)}y=C,l.updateQueue=y,y!==null&&(l.flags|=4)}else{U=C.nodeType===9?C:C.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=He(f)),a==="http://www.w3.org/1999/xhtml"?f==="script"?(a=U.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof y.is=="string"?a=U.createElement(f,{is:y.is}):(a=U.createElement(f),f==="select"&&(U=a,y.multiple?U.multiple=!0:y.size&&(U.size=y.size))):a=U.createElementNS(a,f),a[ns]=l,a[hh]=y,F3(a,l,!1,!1),l.stateNode=a;e:{switch(U=G(f,y),f){case"dialog":Xt("cancel",a),Xt("close",a),C=y;break;case"iframe":case"object":case"embed":Xt("load",a),C=y;break;case"video":case"audio":for(C=0;C<lh.length;C++)Xt(lh[C],a);C=y;break;case"source":Xt("error",a),C=y;break;case"img":case"image":case"link":Xt("error",a),Xt("load",a),C=y;break;case"details":Xt("toggle",a),C=y;break;case"input":Ye(a,y),C=lt(a,y),Xt("invalid",a);break;case"option":C=y;break;case"select":a._wrapperState={wasMultiple:!!y.multiple},C=Q({},y,{value:void 0}),Xt("invalid",a);break;case"textarea":Ue(a,y),C=ge(a,y),Xt("invalid",a);break;default:C=y}Et(f,C),q=C;for(B in q)if(q.hasOwnProperty(B)){var J=q[B];B==="style"?yt(a,J):B==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,J!=null&&Ze(a,J)):B==="children"?typeof J=="string"?(f!=="textarea"||J!=="")&&Ne(a,J):typeof J=="number"&&Ne(a,""+J):B!=="suppressContentEditableWarning"&&B!=="suppressHydrationWarning"&&B!=="autoFocus"&&(i.hasOwnProperty(B)?J!=null&&B==="onScroll"&&Xt("scroll",a):J!=null&&x(a,B,J,U))}switch(f){case"input":ae(a),k(a,y,!1);break;case"textarea":ae(a),Qe(a);break;case"option":y.value!=null&&a.setAttribute("value",""+ye(y.value));break;case"select":a.multiple=!!y.multiple,B=y.value,B!=null?pe(a,!!y.multiple,B,!1):y.defaultValue!=null&&pe(a,!!y.multiple,y.defaultValue,!0);break;default:typeof C.onClick=="function"&&(a.onclick=Qf)}switch(f){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return nn(l),null;case 6:if(a&&l.stateNode!=null)H3(a,l,a.memoizedProps,y);else{if(typeof y!="string"&&l.stateNode===null)throw Error(t(166));if(f=Po(gh.current),Po(is.current),jf(l)){if(y=l.stateNode,f=l.memoizedProps,y[ns]=l,(B=y.nodeValue!==f)&&(a=Zn,a!==null))switch(a.tag){case 3:kf(y.nodeValue,f,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&kf(y.nodeValue,f,(a.mode&1)!==0)}B&&(l.flags|=4)}else y=(f.nodeType===9?f:f.ownerDocument).createTextNode(y),y[ns]=l,l.stateNode=y}return nn(l),null;case 13:if(Kt(sr),y=l.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(tr&&$n!==null&&l.mode&1&&!(l.flags&128))VC(),_c(),l.flags|=98560,B=!1;else if(B=jf(l),y!==null&&y.dehydrated!==null){if(a===null){if(!B)throw Error(t(318));if(B=l.memoizedState,B=B!==null?B.dehydrated:null,!B)throw Error(t(317));B[ns]=l}else _c(),!(l.flags&128)&&(l.memoizedState=null),l.flags|=4;nn(l),B=!1}else Pi!==null&&(g1(Pi),Pi=null),B=!0;if(!B)return l.flags&65536?l:null}return l.flags&128?(l.lanes=f,l):(y=y!==null,y!==(a!==null&&a.memoizedState!==null)&&y&&(l.child.flags|=8192,l.mode&1&&(a===null||sr.current&1?Lr===0&&(Lr=3):v1())),l.updateQueue!==null&&(l.flags|=4),nn(l),null);case 4:return xc(),s1(a,l),a===null&&ch(l.stateNode.containerInfo),nn(l),null;case 10:return L0(l.type._context),nn(l),null;case 17:return Ln(l.type)&&Ff(),nn(l),null;case 19:if(Kt(sr),B=l.memoizedState,B===null)return nn(l),null;if(y=(l.flags&128)!==0,U=B.rendering,U===null)if(y)Eh(B,!1);else{if(Lr!==0||a!==null&&a.flags&128)for(a=l.child;a!==null;){if(U=Zf(a),U!==null){for(l.flags|=128,Eh(B,!1),y=U.updateQueue,y!==null&&(l.updateQueue=y,l.flags|=4),l.subtreeFlags=0,y=f,f=l.child;f!==null;)B=f,a=y,B.flags&=14680066,U=B.alternate,U===null?(B.childLanes=0,B.lanes=a,B.child=null,B.subtreeFlags=0,B.memoizedProps=null,B.memoizedState=null,B.updateQueue=null,B.dependencies=null,B.stateNode=null):(B.childLanes=U.childLanes,B.lanes=U.lanes,B.child=U.child,B.subtreeFlags=0,B.deletions=null,B.memoizedProps=U.memoizedProps,B.memoizedState=U.memoizedState,B.updateQueue=U.updateQueue,B.type=U.type,a=U.dependencies,B.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),f=f.sibling;return Wt(sr,sr.current&1|2),l.child}a=a.sibling}B.tail!==null&&We()>Mc&&(l.flags|=128,y=!0,Eh(B,!1),l.lanes=4194304)}else{if(!y)if(a=Zf(U),a!==null){if(l.flags|=128,y=!0,f=a.updateQueue,f!==null&&(l.updateQueue=f,l.flags|=4),Eh(B,!0),B.tail===null&&B.tailMode==="hidden"&&!U.alternate&&!tr)return nn(l),null}else 2*We()-B.renderingStartTime>Mc&&f!==1073741824&&(l.flags|=128,y=!0,Eh(B,!1),l.lanes=4194304);B.isBackwards?(U.sibling=l.child,l.child=U):(f=B.last,f!==null?f.sibling=U:l.child=U,B.last=U)}return B.tail!==null?(l=B.tail,B.rendering=l,B.tail=l.sibling,B.renderingStartTime=We(),l.sibling=null,f=sr.current,Wt(sr,y?f&1|2:f&1),l):(nn(l),null);case 22:case 23:return _1(),y=l.memoizedState!==null,a!==null&&a.memoizedState!==null!==y&&(l.flags|=8192),y&&l.mode&1?ei&1073741824&&(nn(l),l.subtreeFlags&6&&(l.flags|=8192)):nn(l),null;case 24:return null;case 25:return null}throw Error(t(156,l.tag))}function nQ(a,l){switch(S0(l),l.tag){case 1:return Ln(l.type)&&Ff(),a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 3:return xc(),Kt(Dn),Kt(tn),H0(),a=l.flags,a&65536&&!(a&128)?(l.flags=a&-65537|128,l):null;case 5:return F0(l),null;case 13:if(Kt(sr),a=l.memoizedState,a!==null&&a.dehydrated!==null){if(l.alternate===null)throw Error(t(340));_c()}return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 19:return Kt(sr),null;case 4:return xc(),null;case 10:return L0(l.type._context),null;case 22:case 23:return _1(),null;case 24:return null;default:return null}}var ap=!1,sn=!1,iQ=typeof WeakSet=="function"?WeakSet:Set,ke=null;function Ic(a,l){var f=a.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(y){hr(a,l,y)}else f.current=null}function a1(a,l,f){try{f()}catch(y){hr(a,l,y)}}var G3=!1;function sQ(a,l){if(_0=Mf,a=yC(),u0(a)){if("selectionStart"in a)var f={start:a.selectionStart,end:a.selectionEnd};else e:{f=(f=a.ownerDocument)&&f.defaultView||window;var y=f.getSelection&&f.getSelection();if(y&&y.rangeCount!==0){f=y.anchorNode;var C=y.anchorOffset,B=y.focusNode;y=y.focusOffset;try{f.nodeType,B.nodeType}catch{f=null;break e}var U=0,q=-1,J=-1,ce=0,we=0,Ie=a,xe=null;t:for(;;){for(var Le;Ie!==f||C!==0&&Ie.nodeType!==3||(q=U+C),Ie!==B||y!==0&&Ie.nodeType!==3||(J=U+y),Ie.nodeType===3&&(U+=Ie.nodeValue.length),(Le=Ie.firstChild)!==null;)xe=Ie,Ie=Le;for(;;){if(Ie===a)break t;if(xe===f&&++ce===C&&(q=U),xe===B&&++we===y&&(J=U),(Le=Ie.nextSibling)!==null)break;Ie=xe,xe=Ie.parentNode}Ie=Le}f=q===-1||J===-1?null:{start:q,end:J}}else f=null}f=f||{start:0,end:0}}else f=null;for(v0={focusedElem:a,selectionRange:f},Mf=!1,ke=l;ke!==null;)if(l=ke,a=l.child,(l.subtreeFlags&1028)!==0&&a!==null)a.return=l,ke=a;else for(;ke!==null;){l=ke;try{var ze=l.alternate;if(l.flags&1024)switch(l.tag){case 0:case 11:case 15:break;case 1:if(ze!==null){var Ve=ze.memoizedProps,vr=ze.memoizedState,se=l.stateNode,$=se.getSnapshotBeforeUpdate(l.elementType===l.type?Ve:ki(l.type,Ve),vr);se.__reactInternalSnapshotBeforeUpdate=$}break;case 3:var oe=l.stateNode.containerInfo;oe.nodeType===1?oe.textContent="":oe.nodeType===9&&oe.documentElement&&oe.removeChild(oe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(Me){hr(l,l.return,Me)}if(a=l.sibling,a!==null){a.return=l.return,ke=a;break}ke=l.return}return ze=G3,G3=!1,ze}function xh(a,l,f){var y=l.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var C=y=y.next;do{if((C.tag&a)===a){var B=C.destroy;C.destroy=void 0,B!==void 0&&a1(l,f,B)}C=C.next}while(C!==y)}}function op(a,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var f=l=l.next;do{if((f.tag&a)===a){var y=f.create;f.destroy=y()}f=f.next}while(f!==l)}}function o1(a){var l=a.ref;if(l!==null){var f=a.stateNode;switch(a.tag){case 5:a=f;break;default:a=f}typeof l=="function"?l(a):l.current=a}}function V3(a){var l=a.alternate;l!==null&&(a.alternate=null,V3(l)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(l=a.stateNode,l!==null&&(delete l[ns],delete l[hh],delete l[w0],delete l[z7],delete l[H7])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function j3(a){return a.tag===5||a.tag===3||a.tag===4}function W3(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||j3(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function l1(a,l,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,l?f.nodeType===8?f.parentNode.insertBefore(a,l):f.insertBefore(a,l):(f.nodeType===8?(l=f.parentNode,l.insertBefore(a,f)):(l=f,l.appendChild(a)),f=f._reactRootContainer,f!=null||l.onclick!==null||(l.onclick=Qf));else if(y!==4&&(a=a.child,a!==null))for(l1(a,l,f),a=a.sibling;a!==null;)l1(a,l,f),a=a.sibling}function c1(a,l,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,l?f.insertBefore(a,l):f.appendChild(a);else if(y!==4&&(a=a.child,a!==null))for(c1(a,l,f),a=a.sibling;a!==null;)c1(a,l,f),a=a.sibling}var Yr=null,Qi=!1;function ka(a,l,f){for(f=f.child;f!==null;)Y3(a,l,f),f=f.sibling}function Y3(a,l,f){if($e&&typeof $e.onCommitFiberUnmount=="function")try{$e.onCommitFiberUnmount(jt,f)}catch{}switch(f.tag){case 5:sn||Ic(f,l);case 6:var y=Yr,C=Qi;Yr=null,ka(a,l,f),Yr=y,Qi=C,Yr!==null&&(Qi?(a=Yr,f=f.stateNode,a.nodeType===8?a.parentNode.removeChild(f):a.removeChild(f)):Yr.removeChild(f.stateNode));break;case 18:Yr!==null&&(Qi?(a=Yr,f=f.stateNode,a.nodeType===8?x0(a.parentNode,f):a.nodeType===1&&x0(a,f),eh(a)):x0(Yr,f.stateNode));break;case 4:y=Yr,C=Qi,Yr=f.stateNode.containerInfo,Qi=!0,ka(a,l,f),Yr=y,Qi=C;break;case 0:case 11:case 14:case 15:if(!sn&&(y=f.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){C=y=y.next;do{var B=C,U=B.destroy;B=B.tag,U!==void 0&&(B&2||B&4)&&a1(f,l,U),C=C.next}while(C!==y)}ka(a,l,f);break;case 1:if(!sn&&(Ic(f,l),y=f.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=f.memoizedProps,y.state=f.memoizedState,y.componentWillUnmount()}catch(q){hr(f,l,q)}ka(a,l,f);break;case 21:ka(a,l,f);break;case 22:f.mode&1?(sn=(y=sn)||f.memoizedState!==null,ka(a,l,f),sn=y):ka(a,l,f);break;default:ka(a,l,f)}}function q3(a){var l=a.updateQueue;if(l!==null){a.updateQueue=null;var f=a.stateNode;f===null&&(f=a.stateNode=new iQ),l.forEach(function(y){var C=pQ.bind(null,a,y);f.has(y)||(f.add(y),y.then(C,C))})}}function Oi(a,l){var f=l.deletions;if(f!==null)for(var y=0;y<f.length;y++){var C=f[y];try{var B=a,U=l,q=U;e:for(;q!==null;){switch(q.tag){case 5:Yr=q.stateNode,Qi=!1;break e;case 3:Yr=q.stateNode.containerInfo,Qi=!0;break e;case 4:Yr=q.stateNode.containerInfo,Qi=!0;break e}q=q.return}if(Yr===null)throw Error(t(160));Y3(B,U,C),Yr=null,Qi=!1;var J=C.alternate;J!==null&&(J.return=null),C.return=null}catch(ce){hr(C,l,ce)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)X3(l,a),l=l.sibling}function X3(a,l){var f=a.alternate,y=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(Oi(l,a),as(a),y&4){try{xh(3,a,a.return),op(3,a)}catch(Ve){hr(a,a.return,Ve)}try{xh(5,a,a.return)}catch(Ve){hr(a,a.return,Ve)}}break;case 1:Oi(l,a),as(a),y&512&&f!==null&&Ic(f,f.return);break;case 5:if(Oi(l,a),as(a),y&512&&f!==null&&Ic(f,f.return),a.flags&32){var C=a.stateNode;try{Ne(C,"")}catch(Ve){hr(a,a.return,Ve)}}if(y&4&&(C=a.stateNode,C!=null)){var B=a.memoizedProps,U=f!==null?f.memoizedProps:B,q=a.type,J=a.updateQueue;if(a.updateQueue=null,J!==null)try{q==="input"&&B.type==="radio"&&B.name!=null&&ct(C,B),G(q,U);var ce=G(q,B);for(U=0;U<J.length;U+=2){var we=J[U],Ie=J[U+1];we==="style"?yt(C,Ie):we==="dangerouslySetInnerHTML"?Ze(C,Ie):we==="children"?Ne(C,Ie):x(C,we,Ie,ce)}switch(q){case"input":Y(C,B);break;case"textarea":Ee(C,B);break;case"select":var xe=C._wrapperState.wasMultiple;C._wrapperState.wasMultiple=!!B.multiple;var Le=B.value;Le!=null?pe(C,!!B.multiple,Le,!1):xe!==!!B.multiple&&(B.defaultValue!=null?pe(C,!!B.multiple,B.defaultValue,!0):pe(C,!!B.multiple,B.multiple?[]:"",!1))}C[hh]=B}catch(Ve){hr(a,a.return,Ve)}}break;case 6:if(Oi(l,a),as(a),y&4){if(a.stateNode===null)throw Error(t(162));C=a.stateNode,B=a.memoizedProps;try{C.nodeValue=B}catch(Ve){hr(a,a.return,Ve)}}break;case 3:if(Oi(l,a),as(a),y&4&&f!==null&&f.memoizedState.isDehydrated)try{eh(l.containerInfo)}catch(Ve){hr(a,a.return,Ve)}break;case 4:Oi(l,a),as(a);break;case 13:Oi(l,a),as(a),C=a.child,C.flags&8192&&(B=C.memoizedState!==null,C.stateNode.isHidden=B,!B||C.alternate!==null&&C.alternate.memoizedState!==null||(d1=We())),y&4&&q3(a);break;case 22:if(we=f!==null&&f.memoizedState!==null,a.mode&1?(sn=(ce=sn)||we,Oi(l,a),sn=ce):Oi(l,a),as(a),y&8192){if(ce=a.memoizedState!==null,(a.stateNode.isHidden=ce)&&!we&&a.mode&1)for(ke=a,we=a.child;we!==null;){for(Ie=ke=we;ke!==null;){switch(xe=ke,Le=xe.child,xe.tag){case 0:case 11:case 14:case 15:xh(4,xe,xe.return);break;case 1:Ic(xe,xe.return);var ze=xe.stateNode;if(typeof ze.componentWillUnmount=="function"){y=xe,f=xe.return;try{l=y,ze.props=l.memoizedProps,ze.state=l.memoizedState,ze.componentWillUnmount()}catch(Ve){hr(y,f,Ve)}}break;case 5:Ic(xe,xe.return);break;case 22:if(xe.memoizedState!==null){Z3(Ie);continue}}Le!==null?(Le.return=xe,ke=Le):Z3(Ie)}we=we.sibling}e:for(we=null,Ie=a;;){if(Ie.tag===5){if(we===null){we=Ie;try{C=Ie.stateNode,ce?(B=C.style,typeof B.setProperty=="function"?B.setProperty("display","none","important"):B.display="none"):(q=Ie.stateNode,J=Ie.memoizedProps.style,U=J!=null&&J.hasOwnProperty("display")?J.display:null,q.style.display=ft("display",U))}catch(Ve){hr(a,a.return,Ve)}}}else if(Ie.tag===6){if(we===null)try{Ie.stateNode.nodeValue=ce?"":Ie.memoizedProps}catch(Ve){hr(a,a.return,Ve)}}else if((Ie.tag!==22&&Ie.tag!==23||Ie.memoizedState===null||Ie===a)&&Ie.child!==null){Ie.child.return=Ie,Ie=Ie.child;continue}if(Ie===a)break e;for(;Ie.sibling===null;){if(Ie.return===null||Ie.return===a)break e;we===Ie&&(we=null),Ie=Ie.return}we===Ie&&(we=null),Ie.sibling.return=Ie.return,Ie=Ie.sibling}}break;case 19:Oi(l,a),as(a),y&4&&q3(a);break;case 21:break;default:Oi(l,a),as(a)}}function as(a){var l=a.flags;if(l&2){try{e:{for(var f=a.return;f!==null;){if(j3(f)){var y=f;break e}f=f.return}throw Error(t(160))}switch(y.tag){case 5:var C=y.stateNode;y.flags&32&&(Ne(C,""),y.flags&=-33);var B=W3(a);c1(a,B,C);break;case 3:case 4:var U=y.stateNode.containerInfo,q=W3(a);l1(a,q,U);break;default:throw Error(t(161))}}catch(J){hr(a,a.return,J)}a.flags&=-3}l&4096&&(a.flags&=-4097)}function aQ(a,l,f){ke=a,K3(a)}function K3(a,l,f){for(var y=(a.mode&1)!==0;ke!==null;){var C=ke,B=C.child;if(C.tag===22&&y){var U=C.memoizedState!==null||ap;if(!U){var q=C.alternate,J=q!==null&&q.memoizedState!==null||sn;q=ap;var ce=sn;if(ap=U,(sn=J)&&!ce)for(ke=C;ke!==null;)U=ke,J=U.child,U.tag===22&&U.memoizedState!==null?$3(C):J!==null?(J.return=U,ke=J):$3(C);for(;B!==null;)ke=B,K3(B),B=B.sibling;ke=C,ap=q,sn=ce}J3(a)}else C.subtreeFlags&8772&&B!==null?(B.return=C,ke=B):J3(a)}}function J3(a){for(;ke!==null;){var l=ke;if(l.flags&8772){var f=l.alternate;try{if(l.flags&8772)switch(l.tag){case 0:case 11:case 15:sn||op(5,l);break;case 1:var y=l.stateNode;if(l.flags&4&&!sn)if(f===null)y.componentDidMount();else{var C=l.elementType===l.type?f.memoizedProps:ki(l.type,f.memoizedProps);y.componentDidUpdate(C,f.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var B=l.updateQueue;B!==null&&qC(l,B,y);break;case 3:var U=l.updateQueue;if(U!==null){if(f=null,l.child!==null)switch(l.child.tag){case 5:f=l.child.stateNode;break;case 1:f=l.child.stateNode}qC(l,U,f)}break;case 5:var q=l.stateNode;if(f===null&&l.flags&4){f=q;var J=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":J.autoFocus&&f.focus();break;case"img":J.src&&(f.src=J.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var ce=l.alternate;if(ce!==null){var we=ce.memoizedState;if(we!==null){var Ie=we.dehydrated;Ie!==null&&eh(Ie)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}sn||l.flags&512&&o1(l)}catch(xe){hr(l,l.return,xe)}}if(l===a){ke=null;break}if(f=l.sibling,f!==null){f.return=l.return,ke=f;break}ke=l.return}}function Z3(a){for(;ke!==null;){var l=ke;if(l===a){ke=null;break}var f=l.sibling;if(f!==null){f.return=l.return,ke=f;break}ke=l.return}}function $3(a){for(;ke!==null;){var l=ke;try{switch(l.tag){case 0:case 11:case 15:var f=l.return;try{op(4,l)}catch(J){hr(l,f,J)}break;case 1:var y=l.stateNode;if(typeof y.componentDidMount=="function"){var C=l.return;try{y.componentDidMount()}catch(J){hr(l,C,J)}}var B=l.return;try{o1(l)}catch(J){hr(l,B,J)}break;case 5:var U=l.return;try{o1(l)}catch(J){hr(l,U,J)}}}catch(J){hr(l,l.return,J)}if(l===a){ke=null;break}var q=l.sibling;if(q!==null){q.return=l.return,ke=q;break}ke=l.return}}var oQ=Math.ceil,lp=I.ReactCurrentDispatcher,u1=I.ReactCurrentOwner,gi=I.ReactCurrentBatchConfig,Mt=0,Gr=null,Ir=null,qr=0,ei=0,Cc=Da(0),Lr=0,wh=null,Qo=0,cp=0,h1=0,Ih=null,Un=null,d1=0,Mc=1/0,Vs=null,up=!1,f1=null,Qa=null,hp=!1,Oa=null,dp=0,Ch=0,p1=null,fp=-1,pp=0;function gn(){return Mt&6?We():fp!==-1?fp:fp=We()}function Fa(a){return a.mode&1?Mt&2&&qr!==0?qr&-qr:V7.transition!==null?(pp===0&&(pp=qu()),pp):(a=Pt,a!==0||(a=window.event,a=a===void 0?16:eC(a.type)),a):1}function Fi(a,l,f,y){if(50<Ch)throw Ch=0,p1=null,Error(t(185));Xu(a,f,y),(!(Mt&2)||a!==Gr)&&(a===Gr&&(!(Mt&2)&&(cp|=f),Lr===4&&za(a,qr)),Pn(a,y),f===1&&Mt===0&&!(l.mode&1)&&(Mc=We()+500,Hf&&Na()))}function Pn(a,l){var f=a.callbackNode;Wu(a,l);var y=Ia(a,a===Gr?qr:0);if(y===0)f!==null&&Xe(f),a.callbackNode=null,a.callbackPriority=0;else if(l=y&-y,a.callbackPriority!==l){if(f!=null&&Xe(f),l===1)a.tag===0?G7(tM.bind(null,a)):OC(tM.bind(null,a)),O7(function(){!(Mt&6)&&Na()}),f=null;else{switch(WI(y)){case 1:f=ot;break;case 4:f=Rr;break;case 16:f=er;break;case 536870912:f=hi;break;default:f=er}f=cM(f,eM.bind(null,a))}a.callbackPriority=l,a.callbackNode=f}}function eM(a,l){if(fp=-1,pp=0,Mt&6)throw Error(t(327));var f=a.callbackNode;if(Sc()&&a.callbackNode!==f)return null;var y=Ia(a,a===Gr?qr:0);if(y===0)return null;if(y&30||y&a.expiredLanes||l)l=Ap(a,y);else{l=y;var C=Mt;Mt|=2;var B=nM();(Gr!==a||qr!==l)&&(Vs=null,Mc=We()+500,Fo(a,l));do try{uQ();break}catch(q){rM(a,q)}while(1);D0(),lp.current=B,Mt=C,Ir!==null?l=0:(Gr=null,qr=0,l=Lr)}if(l!==0){if(l===2&&(C=Yu(a),C!==0&&(y=C,l=A1(a,C))),l===1)throw f=wh,Fo(a,0),za(a,y),Pn(a,We()),f;if(l===6)za(a,y);else{if(C=a.current.alternate,!(y&30)&&!lQ(C)&&(l=Ap(a,y),l===2&&(B=Yu(a),B!==0&&(y=B,l=A1(a,B))),l===1))throw f=wh,Fo(a,0),za(a,y),Pn(a,We()),f;switch(a.finishedWork=C,a.finishedLanes=y,l){case 0:case 1:throw Error(t(345));case 2:zo(a,Un,Vs);break;case 3:if(za(a,y),(y&130023424)===y&&(l=d1+500-We(),10<l)){if(Ia(a,0)!==0)break;if(C=a.suspendedLanes,(C&y)!==y){gn(),a.pingedLanes|=a.suspendedLanes&C;break}a.timeoutHandle=E0(zo.bind(null,a,Un,Vs),l);break}zo(a,Un,Vs);break;case 4:if(za(a,y),(y&4194240)===y)break;for(l=a.eventTimes,C=-1;0<y;){var U=31-pn(y);B=1<<U,U=l[U],U>C&&(C=U),y&=~B}if(y=C,y=We()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*oQ(y/1960))-y,10<y){a.timeoutHandle=E0(zo.bind(null,a,Un,Vs),y);break}zo(a,Un,Vs);break;case 5:zo(a,Un,Vs);break;default:throw Error(t(329))}}}return Pn(a,We()),a.callbackNode===f?eM.bind(null,a):null}function A1(a,l){var f=Ih;return a.current.memoizedState.isDehydrated&&(Fo(a,l).flags|=256),a=Ap(a,l),a!==2&&(l=Un,Un=f,l!==null&&g1(l)),a}function g1(a){Un===null?Un=a:Un.push.apply(Un,a)}function lQ(a){for(var l=a;;){if(l.flags&16384){var f=l.updateQueue;if(f!==null&&(f=f.stores,f!==null))for(var y=0;y<f.length;y++){var C=f[y],B=C.getSnapshot;C=C.value;try{if(!Ui(B(),C))return!1}catch{return!1}}}if(f=l.child,l.subtreeFlags&16384&&f!==null)f.return=l,l=f;else{if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function za(a,l){for(l&=~h1,l&=~cp,a.suspendedLanes|=l,a.pingedLanes&=~l,a=a.expirationTimes;0<l;){var f=31-pn(l),y=1<<f;a[f]=-1,l&=~y}}function tM(a){if(Mt&6)throw Error(t(327));Sc();var l=Ia(a,0);if(!(l&1))return Pn(a,We()),null;var f=Ap(a,l);if(a.tag!==0&&f===2){var y=Yu(a);y!==0&&(l=y,f=A1(a,y))}if(f===1)throw f=wh,Fo(a,0),za(a,l),Pn(a,We()),f;if(f===6)throw Error(t(345));return a.finishedWork=a.current.alternate,a.finishedLanes=l,zo(a,Un,Vs),Pn(a,We()),null}function m1(a,l){var f=Mt;Mt|=1;try{return a(l)}finally{Mt=f,Mt===0&&(Mc=We()+500,Hf&&Na())}}function Oo(a){Oa!==null&&Oa.tag===0&&!(Mt&6)&&Sc();var l=Mt;Mt|=1;var f=gi.transition,y=Pt;try{if(gi.transition=null,Pt=1,a)return a()}finally{Pt=y,gi.transition=f,Mt=l,!(Mt&6)&&Na()}}function _1(){ei=Cc.current,Kt(Cc)}function Fo(a,l){a.finishedWork=null,a.finishedLanes=0;var f=a.timeoutHandle;if(f!==-1&&(a.timeoutHandle=-1,Q7(f)),Ir!==null)for(f=Ir.return;f!==null;){var y=f;switch(S0(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&Ff();break;case 3:xc(),Kt(Dn),Kt(tn),H0();break;case 5:F0(y);break;case 4:xc();break;case 13:Kt(sr);break;case 19:Kt(sr);break;case 10:L0(y.type._context);break;case 22:case 23:_1()}f=f.return}if(Gr=a,Ir=a=Ha(a.current,null),qr=ei=l,Lr=0,wh=null,h1=cp=Qo=0,Un=Ih=null,Uo!==null){for(l=0;l<Uo.length;l++)if(f=Uo[l],y=f.interleaved,y!==null){f.interleaved=null;var C=y.next,B=f.pending;if(B!==null){var U=B.next;B.next=C,y.next=U}f.pending=y}Uo=null}return a}function rM(a,l){do{var f=Ir;try{if(D0(),$f.current=np,ep){for(var y=ar.memoizedState;y!==null;){var C=y.queue;C!==null&&(C.pending=null),y=y.next}ep=!1}if(ko=0,Hr=Dr=ar=null,mh=!1,_h=0,u1.current=null,f===null||f.return===null){Lr=1,wh=l,Ir=null;break}e:{var B=a,U=f.return,q=f,J=l;if(l=qr,q.flags|=32768,J!==null&&typeof J=="object"&&typeof J.then=="function"){var ce=J,we=q,Ie=we.tag;if(!(we.mode&1)&&(Ie===0||Ie===11||Ie===15)){var xe=we.alternate;xe?(we.updateQueue=xe.updateQueue,we.memoizedState=xe.memoizedState,we.lanes=xe.lanes):(we.updateQueue=null,we.memoizedState=null)}var Le=S3(U);if(Le!==null){Le.flags&=-257,T3(Le,U,q,B,l),Le.mode&1&&M3(B,ce,l),l=Le,J=ce;var ze=l.updateQueue;if(ze===null){var Ve=new Set;Ve.add(J),l.updateQueue=Ve}else ze.add(J);break e}else{if(!(l&1)){M3(B,ce,l),v1();break e}J=Error(t(426))}}else if(tr&&q.mode&1){var vr=S3(U);if(vr!==null){!(vr.flags&65536)&&(vr.flags|=256),T3(vr,U,q,B,l),b0(wc(J,q));break e}}B=J=wc(J,q),Lr!==4&&(Lr=2),Ih===null?Ih=[B]:Ih.push(B),B=U;do{switch(B.tag){case 3:B.flags|=65536,l&=-l,B.lanes|=l;var se=I3(B,J,l);YC(B,se);break e;case 1:q=J;var $=B.type,oe=B.stateNode;if(!(B.flags&128)&&(typeof $.getDerivedStateFromError=="function"||oe!==null&&typeof oe.componentDidCatch=="function"&&(Qa===null||!Qa.has(oe)))){B.flags|=65536,l&=-l,B.lanes|=l;var Me=C3(B,q,l);YC(B,Me);break e}}B=B.return}while(B!==null)}sM(f)}catch(je){l=je,Ir===f&&f!==null&&(Ir=f=f.return);continue}break}while(1)}function nM(){var a=lp.current;return lp.current=np,a===null?np:a}function v1(){(Lr===0||Lr===3||Lr===2)&&(Lr=4),Gr===null||!(Qo&268435455)&&!(cp&268435455)||za(Gr,qr)}function Ap(a,l){var f=Mt;Mt|=2;var y=nM();(Gr!==a||qr!==l)&&(Vs=null,Fo(a,l));do try{cQ();break}catch(C){rM(a,C)}while(1);if(D0(),Mt=f,lp.current=y,Ir!==null)throw Error(t(261));return Gr=null,qr=0,Lr}function cQ(){for(;Ir!==null;)iM(Ir)}function uQ(){for(;Ir!==null&&!et();)iM(Ir)}function iM(a){var l=lM(a.alternate,a,ei);a.memoizedProps=a.pendingProps,l===null?sM(a):Ir=l,u1.current=null}function sM(a){var l=a;do{var f=l.alternate;if(a=l.return,l.flags&32768){if(f=nQ(f,l),f!==null){f.flags&=32767,Ir=f;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Lr=6,Ir=null;return}}else if(f=rQ(f,l,ei),f!==null){Ir=f;return}if(l=l.sibling,l!==null){Ir=l;return}Ir=l=a}while(l!==null);Lr===0&&(Lr=5)}function zo(a,l,f){var y=Pt,C=gi.transition;try{gi.transition=null,Pt=1,hQ(a,l,f,y)}finally{gi.transition=C,Pt=y}return null}function hQ(a,l,f,y){do Sc();while(Oa!==null);if(Mt&6)throw Error(t(327));f=a.finishedWork;var C=a.finishedLanes;if(f===null)return null;if(a.finishedWork=null,a.finishedLanes=0,f===a.current)throw Error(t(177));a.callbackNode=null,a.callbackPriority=0;var B=f.lanes|f.childLanes;if(jk(a,B),a===Gr&&(Ir=Gr=null,qr=0),!(f.subtreeFlags&2064)&&!(f.flags&2064)||hp||(hp=!0,cM(er,function(){return Sc(),null})),B=(f.flags&15990)!==0,f.subtreeFlags&15990||B){B=gi.transition,gi.transition=null;var U=Pt;Pt=1;var q=Mt;Mt|=4,u1.current=null,sQ(a,f),X3(f,a),R7(v0),Mf=!!_0,v0=_0=null,a.current=f,aQ(f),nt(),Mt=q,Pt=U,gi.transition=B}else a.current=f;if(hp&&(hp=!1,Oa=a,dp=C),B=a.pendingLanes,B===0&&(Qa=null),ju(f.stateNode),Pn(a,We()),l!==null)for(y=a.onRecoverableError,f=0;f<l.length;f++)C=l[f],y(C.value,{componentStack:C.stack,digest:C.digest});if(up)throw up=!1,a=f1,f1=null,a;return dp&1&&a.tag!==0&&Sc(),B=a.pendingLanes,B&1?a===p1?Ch++:(Ch=0,p1=a):Ch=0,Na(),null}function Sc(){if(Oa!==null){var a=WI(dp),l=gi.transition,f=Pt;try{if(gi.transition=null,Pt=16>a?16:a,Oa===null)var y=!1;else{if(a=Oa,Oa=null,dp=0,Mt&6)throw Error(t(331));var C=Mt;for(Mt|=4,ke=a.current;ke!==null;){var B=ke,U=B.child;if(ke.flags&16){var q=B.deletions;if(q!==null){for(var J=0;J<q.length;J++){var ce=q[J];for(ke=ce;ke!==null;){var we=ke;switch(we.tag){case 0:case 11:case 15:xh(8,we,B)}var Ie=we.child;if(Ie!==null)Ie.return=we,ke=Ie;else for(;ke!==null;){we=ke;var xe=we.sibling,Le=we.return;if(V3(we),we===ce){ke=null;break}if(xe!==null){xe.return=Le,ke=xe;break}ke=Le}}}var ze=B.alternate;if(ze!==null){var Ve=ze.child;if(Ve!==null){ze.child=null;do{var vr=Ve.sibling;Ve.sibling=null,Ve=vr}while(Ve!==null)}}ke=B}}if(B.subtreeFlags&2064&&U!==null)U.return=B,ke=U;else e:for(;ke!==null;){if(B=ke,B.flags&2048)switch(B.tag){case 0:case 11:case 15:xh(9,B,B.return)}var se=B.sibling;if(se!==null){se.return=B.return,ke=se;break e}ke=B.return}}var $=a.current;for(ke=$;ke!==null;){U=ke;var oe=U.child;if(U.subtreeFlags&2064&&oe!==null)oe.return=U,ke=oe;else e:for(U=$;ke!==null;){if(q=ke,q.flags&2048)try{switch(q.tag){case 0:case 11:case 15:op(9,q)}}catch(je){hr(q,q.return,je)}if(q===U){ke=null;break e}var Me=q.sibling;if(Me!==null){Me.return=q.return,ke=Me;break e}ke=q.return}}if(Mt=C,Na(),$e&&typeof $e.onPostCommitFiberRoot=="function")try{$e.onPostCommitFiberRoot(jt,a)}catch{}y=!0}return y}finally{Pt=f,gi.transition=l}}return!1}function aM(a,l,f){l=wc(f,l),l=I3(a,l,1),a=Pa(a,l,1),l=gn(),a!==null&&(Xu(a,1,l),Pn(a,l))}function hr(a,l,f){if(a.tag===3)aM(a,a,f);else for(;l!==null;){if(l.tag===3){aM(l,a,f);break}else if(l.tag===1){var y=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Qa===null||!Qa.has(y))){a=wc(f,a),a=C3(l,a,1),l=Pa(l,a,1),a=gn(),l!==null&&(Xu(l,1,a),Pn(l,a));break}}l=l.return}}function dQ(a,l,f){var y=a.pingCache;y!==null&&y.delete(l),l=gn(),a.pingedLanes|=a.suspendedLanes&f,Gr===a&&(qr&f)===f&&(Lr===4||Lr===3&&(qr&130023424)===qr&&500>We()-d1?Fo(a,0):h1|=f),Pn(a,l)}function oM(a,l){l===0&&(a.mode&1?(l=_r,_r<<=1,!(_r&130023424)&&(_r=4194304)):l=1);var f=gn();a=zs(a,l),a!==null&&(Xu(a,l,f),Pn(a,f))}function fQ(a){var l=a.memoizedState,f=0;l!==null&&(f=l.retryLane),oM(a,f)}function pQ(a,l){var f=0;switch(a.tag){case 13:var y=a.stateNode,C=a.memoizedState;C!==null&&(f=C.retryLane);break;case 19:y=a.stateNode;break;default:throw Error(t(314))}y!==null&&y.delete(l),oM(a,f)}var lM;lM=function(a,l,f){if(a!==null)if(a.memoizedProps!==l.pendingProps||Dn.current)Nn=!0;else{if(!(a.lanes&f)&&!(l.flags&128))return Nn=!1,tQ(a,l,f);Nn=!!(a.flags&131072)}else Nn=!1,tr&&l.flags&1048576&&FC(l,Vf,l.index);switch(l.lanes=0,l.tag){case 2:var y=l.type;sp(a,l),a=l.pendingProps;var C=Ac(l,tn.current);yc(l,f),C=j0(null,l,y,a,C,f);var B=W0();return l.flags|=1,typeof C=="object"&&C!==null&&typeof C.render=="function"&&C.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,Ln(y)?(B=!0,zf(l)):B=!1,l.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,P0(l),C.updater=Kf,l.stateNode=C,C._reactInternals=l,Q0(l,y,a,f),l=e1(null,l,y,!0,B,f)):(l.tag=0,tr&&B&&M0(l),An(null,l,C,f),l=l.child),l;case 16:y=l.elementType;e:{switch(sp(a,l),a=l.pendingProps,C=y._init,y=C(y._payload),l.type=y,C=l.tag=gQ(y),a=ki(y,a),C){case 0:l=$0(null,l,y,a,f);break e;case 1:l=N3(null,l,y,a,f);break e;case 11:l=B3(null,l,y,a,f);break e;case 14:l=b3(null,l,y,ki(y.type,a),f);break e}throw Error(t(306,y,""))}return l;case 0:return y=l.type,C=l.pendingProps,C=l.elementType===y?C:ki(y,C),$0(a,l,y,C,f);case 1:return y=l.type,C=l.pendingProps,C=l.elementType===y?C:ki(y,C),N3(a,l,y,C,f);case 3:e:{if(U3(l),a===null)throw Error(t(387));y=l.pendingProps,B=l.memoizedState,C=B.element,WC(a,l),Xf(l,y,null,f);var U=l.memoizedState;if(y=U.element,B.isDehydrated)if(B={element:y,isDehydrated:!1,cache:U.cache,pendingSuspenseBoundaries:U.pendingSuspenseBoundaries,transitions:U.transitions},l.updateQueue.baseState=B,l.memoizedState=B,l.flags&256){C=wc(Error(t(423)),l),l=P3(a,l,y,f,C);break e}else if(y!==C){C=wc(Error(t(424)),l),l=P3(a,l,y,f,C);break e}else for($n=Ra(l.stateNode.containerInfo.firstChild),Zn=l,tr=!0,Pi=null,f=t3(l,null,y,f),l.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(_c(),y===C){l=Gs(a,l,f);break e}An(a,l,y,f)}l=l.child}return l;case 5:return r3(l),a===null&&B0(l),y=l.type,C=l.pendingProps,B=a!==null?a.memoizedProps:null,U=C.children,y0(y,C)?U=null:B!==null&&y0(y,B)&&(l.flags|=32),L3(a,l),An(a,l,U,f),l.child;case 6:return a===null&&B0(l),null;case 13:return k3(a,l,f);case 4:return O0(l,l.stateNode.containerInfo),y=l.pendingProps,a===null?l.child=Ec(l,null,y,f):An(a,l,y,f),l.child;case 11:return y=l.type,C=l.pendingProps,C=l.elementType===y?C:ki(y,C),B3(a,l,y,C,f);case 7:return An(a,l,l.pendingProps,f),l.child;case 8:return An(a,l,l.pendingProps.children,f),l.child;case 12:return An(a,l,l.pendingProps.children,f),l.child;case 10:e:{if(y=l.type._context,C=l.pendingProps,B=l.memoizedProps,U=C.value,Wt(Wf,y._currentValue),y._currentValue=U,B!==null)if(Ui(B.value,U)){if(B.children===C.children&&!Dn.current){l=Gs(a,l,f);break e}}else for(B=l.child,B!==null&&(B.return=l);B!==null;){var q=B.dependencies;if(q!==null){U=B.child;for(var J=q.firstContext;J!==null;){if(J.context===y){if(B.tag===1){J=Hs(-1,f&-f),J.tag=2;var ce=B.updateQueue;if(ce!==null){ce=ce.shared;var we=ce.pending;we===null?J.next=J:(J.next=we.next,we.next=J),ce.pending=J}}B.lanes|=f,J=B.alternate,J!==null&&(J.lanes|=f),N0(B.return,f,l),q.lanes|=f;break}J=J.next}}else if(B.tag===10)U=B.type===l.type?null:B.child;else if(B.tag===18){if(U=B.return,U===null)throw Error(t(341));U.lanes|=f,q=U.alternate,q!==null&&(q.lanes|=f),N0(U,f,l),U=B.sibling}else U=B.child;if(U!==null)U.return=B;else for(U=B;U!==null;){if(U===l){U=null;break}if(B=U.sibling,B!==null){B.return=U.return,U=B;break}U=U.return}B=U}An(a,l,C.children,f),l=l.child}return l;case 9:return C=l.type,y=l.pendingProps.children,yc(l,f),C=pi(C),y=y(C),l.flags|=1,An(a,l,y,f),l.child;case 14:return y=l.type,C=ki(y,l.pendingProps),C=ki(y.type,C),b3(a,l,y,C,f);case 15:return R3(a,l,l.type,l.pendingProps,f);case 17:return y=l.type,C=l.pendingProps,C=l.elementType===y?C:ki(y,C),sp(a,l),l.tag=1,Ln(y)?(a=!0,zf(l)):a=!1,yc(l,f),JC(l,y,C),Q0(l,y,C,f),e1(null,l,y,!0,a,f);case 19:return O3(a,l,f);case 22:return D3(a,l,f)}throw Error(t(156,l.tag))};function cM(a,l){return Be(a,l)}function AQ(a,l,f,y){this.tag=a,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mi(a,l,f,y){return new AQ(a,l,f,y)}function y1(a){return a=a.prototype,!(!a||!a.isReactComponent)}function gQ(a){if(typeof a=="function")return y1(a)?1:0;if(a!=null){if(a=a.$$typeof,a===P)return 11;if(a===X)return 14}return 2}function Ha(a,l){var f=a.alternate;return f===null?(f=mi(a.tag,l,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=l,f.type=a.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=a.flags&14680064,f.childLanes=a.childLanes,f.lanes=a.lanes,f.child=a.child,f.memoizedProps=a.memoizedProps,f.memoizedState=a.memoizedState,f.updateQueue=a.updateQueue,l=a.dependencies,f.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f}function gp(a,l,f,y,C,B){var U=2;if(y=a,typeof a=="function")y1(a)&&(U=1);else if(typeof a=="string")U=5;else e:switch(a){case T:return Ho(f.children,C,B,l);case D:U=8,C|=8;break;case b:return a=mi(12,f,l,C|2),a.elementType=b,a.lanes=B,a;case N:return a=mi(13,f,l,C),a.elementType=N,a.lanes=B,a;case j:return a=mi(19,f,l,C),a.elementType=j,a.lanes=B,a;case ne:return mp(f,C,B,l);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case M:U=10;break e;case L:U=9;break e;case P:U=11;break e;case X:U=14;break e;case K:U=16,y=null;break e}throw Error(t(130,a==null?a:typeof a,""))}return l=mi(U,f,l,C),l.elementType=a,l.type=y,l.lanes=B,l}function Ho(a,l,f,y){return a=mi(7,a,y,l),a.lanes=f,a}function mp(a,l,f,y){return a=mi(22,a,y,l),a.elementType=ne,a.lanes=f,a.stateNode={isHidden:!1},a}function E1(a,l,f){return a=mi(6,a,null,l),a.lanes=f,a}function x1(a,l,f){return l=mi(4,a.children!==null?a.children:[],a.key,l),l.lanes=f,l.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},l}function mQ(a,l,f,y,C){this.tag=l,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Xm(0),this.expirationTimes=Xm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xm(0),this.identifierPrefix=y,this.onRecoverableError=C,this.mutableSourceEagerHydrationData=null}function w1(a,l,f,y,C,B,U,q,J){return a=new mQ(a,l,f,q,J),l===1?(l=1,B===!0&&(l|=8)):l=0,B=mi(3,null,null,l),a.current=B,B.stateNode=a,B.memoizedState={element:y,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},P0(B),a}function _Q(a,l,f){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:S,key:y==null?null:""+y,children:a,containerInfo:l,implementation:f}}function uM(a){if(!a)return La;a=a._reactInternals;e:{if(Us(a)!==a||a.tag!==1)throw Error(t(170));var l=a;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(Ln(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(t(171))}if(a.tag===1){var f=a.type;if(Ln(f))return kC(a,f,l)}return l}function hM(a,l,f,y,C,B,U,q,J){return a=w1(f,y,!0,a,C,B,U,q,J),a.context=uM(null),f=a.current,y=gn(),C=Fa(f),B=Hs(y,C),B.callback=l??null,Pa(f,B,C),a.current.lanes=C,Xu(a,C,y),Pn(a,y),a}function _p(a,l,f,y){var C=l.current,B=gn(),U=Fa(C);return f=uM(f),l.context===null?l.context=f:l.pendingContext=f,l=Hs(B,U),l.payload={element:a},y=y===void 0?null:y,y!==null&&(l.callback=y),a=Pa(C,l,U),a!==null&&(Fi(a,C,U,B),qf(a,C,U)),U}function vp(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function dM(a,l){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<l?f:l}}function I1(a,l){dM(a,l),(a=a.alternate)&&dM(a,l)}function vQ(){return null}var fM=typeof reportError=="function"?reportError:function(a){console.error(a)};function C1(a){this._internalRoot=a}yp.prototype.render=C1.prototype.render=function(a){var l=this._internalRoot;if(l===null)throw Error(t(409));_p(a,l,null,null)},yp.prototype.unmount=C1.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var l=a.containerInfo;Oo(function(){_p(null,a,null,null)}),l[ks]=null}};function yp(a){this._internalRoot=a}yp.prototype.unstable_scheduleHydration=function(a){if(a){var l=XI();a={blockedOn:null,target:a,priority:l};for(var f=0;f<Ta.length&&l!==0&&l<Ta[f].priority;f++);Ta.splice(f,0,a),f===0&&ZI(a)}};function M1(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function Ep(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function pM(){}function yQ(a,l,f,y,C){if(C){if(typeof y=="function"){var B=y;y=function(){var ce=vp(U);B.call(ce)}}var U=hM(l,y,a,0,null,!1,!1,"",pM);return a._reactRootContainer=U,a[ks]=U.current,ch(a.nodeType===8?a.parentNode:a),Oo(),U}for(;C=a.lastChild;)a.removeChild(C);if(typeof y=="function"){var q=y;y=function(){var ce=vp(J);q.call(ce)}}var J=w1(a,0,!1,null,null,!1,!1,"",pM);return a._reactRootContainer=J,a[ks]=J.current,ch(a.nodeType===8?a.parentNode:a),Oo(function(){_p(l,J,f,y)}),J}function xp(a,l,f,y,C){var B=f._reactRootContainer;if(B){var U=B;if(typeof C=="function"){var q=C;C=function(){var J=vp(U);q.call(J)}}_p(l,U,a,C)}else U=yQ(f,l,a,C,y);return vp(U)}YI=function(a){switch(a.tag){case 3:var l=a.stateNode;if(l.current.memoizedState.isDehydrated){var f=bn(l.pendingLanes);f!==0&&(Km(l,f|1),Pn(l,We()),!(Mt&6)&&(Mc=We()+500,Na()))}break;case 13:Oo(function(){var y=zs(a,1);if(y!==null){var C=gn();Fi(y,a,1,C)}}),I1(a,1)}},Jm=function(a){if(a.tag===13){var l=zs(a,134217728);if(l!==null){var f=gn();Fi(l,a,134217728,f)}I1(a,134217728)}},qI=function(a){if(a.tag===13){var l=Fa(a),f=zs(a,l);if(f!==null){var y=gn();Fi(f,a,l,y)}I1(a,l)}},XI=function(){return Pt},KI=function(a,l){var f=Pt;try{return Pt=a,l()}finally{Pt=f}},_e=function(a,l,f){switch(l){case"input":if(Y(a,f),l=f.name,f.type==="radio"&&l!=null){for(f=a;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<f.length;l++){var y=f[l];if(y!==a&&y.form===a.form){var C=Of(y);if(!C)throw Error(t(90));rt(y),Y(y,C)}}}break;case"textarea":Ee(a,f);break;case"select":l=f.value,l!=null&&pe(a,!!f.multiple,l,!1)}},St=m1,At=Oo;var EQ={usingClientEntryPoint:!1,Events:[dh,fc,Of,Dt,Lt,m1]},Mh={findFiberByHostInstance:Ro,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},xQ={bundleType:Mh.bundleType,version:Mh.version,rendererPackageName:Mh.rendererPackageName,rendererConfig:Mh.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:I.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=de(a),a===null?null:a.stateNode},findFiberByHostInstance:Mh.findFiberByHostInstance||vQ,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var wp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wp.isDisabled&&wp.supportsFiber)try{jt=wp.inject(xQ),$e=wp}catch{}}return Sn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=EQ,Sn.createPortal=function(a,l){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!M1(l))throw Error(t(200));return _Q(a,l,null,f)},Sn.createRoot=function(a,l){if(!M1(a))throw Error(t(299));var f=!1,y="",C=fM;return l!=null&&(l.unstable_strictMode===!0&&(f=!0),l.identifierPrefix!==void 0&&(y=l.identifierPrefix),l.onRecoverableError!==void 0&&(C=l.onRecoverableError)),l=w1(a,1,!1,null,null,f,!1,y,C),a[ks]=l.current,ch(a.nodeType===8?a.parentNode:a),new C1(l)},Sn.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var l=a._reactInternals;if(l===void 0)throw typeof a.render=="function"?Error(t(188)):(a=Object.keys(a).join(","),Error(t(268,a)));return a=de(l),a=a===null?null:a.stateNode,a},Sn.flushSync=function(a){return Oo(a)},Sn.hydrate=function(a,l,f){if(!Ep(l))throw Error(t(200));return xp(null,a,l,!0,f)},Sn.hydrateRoot=function(a,l,f){if(!M1(a))throw Error(t(405));var y=f!=null&&f.hydratedSources||null,C=!1,B="",U=fM;if(f!=null&&(f.unstable_strictMode===!0&&(C=!0),f.identifierPrefix!==void 0&&(B=f.identifierPrefix),f.onRecoverableError!==void 0&&(U=f.onRecoverableError)),l=hM(l,null,a,1,f??null,C,!1,B,U),a[ks]=l.current,ch(a),y)for(a=0;a<y.length;a++)f=y[a],C=f._getVersion,C=C(f._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[f,C]:l.mutableSourceEagerHydrationData.push(f,C);return new yp(l)},Sn.render=function(a,l,f){if(!Ep(l))throw Error(t(200));return xp(null,a,l,!1,f)},Sn.unmountComponentAtNode=function(a){if(!Ep(a))throw Error(t(40));return a._reactRootContainer?(Oo(function(){xp(null,null,a,!1,function(){a._reactRootContainer=null,a[ks]=null})}),!0):!1},Sn.unstable_batchedUpdates=m1,Sn.unstable_renderSubtreeIntoContainer=function(a,l,f,y){if(!Ep(f))throw Error(t(200));if(a==null||a._reactInternals===void 0)throw Error(t(38));return xp(a,l,f,!1,y)},Sn.version="18.2.0-next-9e3b772b8-20220608",Sn}function RI(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(RI)}catch(r){console.error(r)}}RI(),SI.exports=Mk();var Sk=SI.exports,DI=Sk;Hm.createRoot=DI.createRoot,Hm.hydrateRoot=DI.hydrateRoot;class Tk{constructor({apiService:e,events:t}){Bt(this,"targetElement");Bt(this,"apiService");Bt(this,"events");Bt(this,"htmlTarget");this.apiService=e,this.events=t}mount(e,t){if(!this.targetElement){const n=t.customId??"dita-3dconfig-element",i=document.getElementById(n);if(!i)throw new Error(`Element not found with id => '${n}' `);this.htmlTarget=i,this.htmlTarget.style.height="100%",this.htmlTarget.style.width="100%",this.targetElement=Hm.createRoot(document.getElementById(n))}this.targetElement.render(Sh.createElement(wk,{apiService:this.apiService,events:this.events,sku:e,viewerOnly:t.viewerOnly}))}unmount(){this.targetElement&&(this.targetElement.unmount(),this.targetElement=void 0,this.htmlTarget&&(this.htmlTarget.style.height="0px",this.htmlTarget.style.width="auto"))}}var jm={exports:{}},ic=typeof Reflect=="object"?Reflect:null,LI=ic&&typeof ic.apply=="function"?ic.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},yf;ic&&typeof ic.ownKeys=="function"?yf=ic.ownKeys:Object.getOwnPropertySymbols?yf=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:yf=function(e){return Object.getOwnPropertyNames(e)};function Bk(r){console&&console.warn&&console.warn(r)}var NI=Number.isNaN||function(e){return e!==e};function Ot(){Ot.init.call(this)}jm.exports=Ot,jm.exports.once=Lk,Ot.EventEmitter=Ot,Ot.prototype._events=void 0,Ot.prototype._eventsCount=0,Ot.prototype._maxListeners=void 0;var UI=10;function Ef(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(Ot,"defaultMaxListeners",{enumerable:!0,get:function(){return UI},set:function(r){if(typeof r!="number"||r<0||NI(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");UI=r}}),Ot.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Ot.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||NI(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function PI(r){return r._maxListeners===void 0?Ot.defaultMaxListeners:r._maxListeners}Ot.prototype.getMaxListeners=function(){return PI(this)},Ot.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e==="error",s=this._events;if(s!==void 0)i=i&&s.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var c=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw c.context=o,c}var h=s[e];if(h===void 0)return!1;if(typeof h=="function")LI(h,this,t);else for(var u=h.length,d=zI(h,u),n=0;n<u;++n)LI(d[n],this,t);return!0};function kI(r,e,t,n){var i,s,o;if(Ef(t),s=r._events,s===void 0?(s=r._events=Object.create(null),r._eventsCount=0):(s.newListener!==void 0&&(r.emit("newListener",e,t.listener?t.listener:t),s=r._events),o=s[e]),o===void 0)o=s[e]=t,++r._eventsCount;else if(typeof o=="function"?o=s[e]=n?[t,o]:[o,t]:n?o.unshift(t):o.push(t),i=PI(r),i>0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=r,c.type=e,c.count=o.length,Bk(c)}return r}Ot.prototype.addListener=function(e,t){return kI(this,e,t,!1)},Ot.prototype.on=Ot.prototype.addListener,Ot.prototype.prependListener=function(e,t){return kI(this,e,t,!0)};function bk(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function QI(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},i=bk.bind(n);return i.listener=t,n.wrapFn=i,i}Ot.prototype.once=function(e,t){return Ef(t),this.on(e,QI(this,e,t)),this},Ot.prototype.prependOnceListener=function(e,t){return Ef(t),this.prependListener(e,QI(this,e,t)),this},Ot.prototype.removeListener=function(e,t){var n,i,s,o,c;if(Ef(t),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){c=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():Rk(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,c||t)}return this},Ot.prototype.off=Ot.prototype.removeListener,Ot.prototype.removeAllListeners=function(e){var t,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i<s.length;++i)o=s[i],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this};function OI(r,e,t){var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?Dk(i):zI(i,i.length)}Ot.prototype.listeners=function(e){return OI(this,e,!0)},Ot.prototype.rawListeners=function(e){return OI(this,e,!1)},Ot.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):FI.call(r,e)},Ot.prototype.listenerCount=FI;function FI(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}Ot.prototype.eventNames=function(){return this._eventsCount>0?yf(this._events):[]};function zI(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n];return t}function Rk(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()}function Dk(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}function Lk(r,e){return new Promise(function(t,n){function i(o){r.removeListener(e,s),n(o)}function s(){typeof r.removeListener=="function"&&r.removeListener("error",i),t([].slice.call(arguments))}HI(r,e,s,{once:!0}),e!=="error"&&Nk(r,i,{once:!0})})}function Nk(r,e,t){typeof r.on=="function"&&HI(r,"error",e,t)}function HI(r,e,t,n){if(typeof r.on=="function")n.once?r.once(e,t):r.on(e,t);else if(typeof r.addEventListener=="function")r.addEventListener(e,function i(s){n.once&&r.removeEventListener(e,i),t(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r)}var Uk=jm.exports;const Vu=class Vu extends Uk.EventEmitter{emitEvent(e,t){Object.keys(Vu.EVENTS).includes(e)&&this.emit(Vu.EVENTS[e],t)}};Bt(Vu,"EVENTS",{onAddToCart:"add-to-cart"});let Wm=Vu;const Pk={getCartUrl:((VI=window.Shopify)==null?void 0:VI.routes.root)+"cart.js",addToCartUrl:((jI=window.Shopify)==null?void 0:jI.routes.root)+"cart/add.js"},GI=Object.freeze(Pk);class kk{constructor(e){Bt(this,"config");this.config=e}RequestOptions(e,t){return{method:e,headers:{Accept:"application/json","Content-Type":"application/json"},...e==="POST"&&{body:JSON.stringify(t)}}}async Get(){return(await fetch(this.config.getCartUrl,this.RequestOptions("GET"))).json()}async Post(e){return(await fetch(this.config.addToCartUrl,this.RequestOptions("POST",e||{}))).json()}}const{log:Qk,error:Ok}=console,Fk=(...r)=>{Ok("❌ Sprie Error:",...r)},zk="&ui_animations=0&ui_infos=0&ui_stop=0&ui_inspector=0&ui_watermark_link=0&ui_watermark=0&ui_ar=0&ui_help=0&ui_settings=0&ui_vr=0&ui_fullscreen=0&ui_annotations=0&ui_start=0&",Hk={HOST:ls.host,STORE_PREFIX:ls.storePrefix},Gk={addToCartUrl:GI.addToCartUrl,getCartUrl:GI.getCartUrl};class Vk{constructor(){Bt(this,"sdkService");Bt(this,"apiService");Bt(this,"uiService");Bt(this,"events");this.events=new Wm,this.apiService=new mM(new Va(Hk),new kk(Gk)),this.uiService=new Tk({apiService:this.apiService,events:this.events});const e={apiService:this.apiService,config:ls,log:Qk,logErr:Fk,metaData:{appVersion:AM,previewUrlPrams:zk,targetClassName:"sprie-embed-element"}};this.sdkService=new _M(e),this.sdkService.Init()}load(e,t){this.uiService.unmount(),this.uiService.mount(e,{viewerOnly:!1,customId:t})}loadViewerOnly(e,t){this.uiService.unmount(),this.uiService.mount(e,{viewerOnly:!0,customId:t})}unload(){this.uiService.unmount()}}window.ditaConfigurator=new Vk})();
4488
+ `+B.stack}return{value:a,source:l,stack:C,digest:null}}function J0(a,l,f){return{value:a,source:null,stack:f??null,digest:l??null}}function Z0(a,l){try{console.error(l.value)}catch(f){setTimeout(function(){throw f})}}var Z7=typeof WeakMap=="function"?WeakMap:Map;function I3(a,l,f){f=Hs(-1,f),f.tag=3,f.payload={element:null};var y=l.value;return f.callback=function(){up||(up=!0,f1=y),Z0(a,l)},f}function C3(a,l,f){f=Hs(-1,f),f.tag=3;var y=a.type.getDerivedStateFromError;if(typeof y=="function"){var C=l.value;f.payload=function(){return y(C)},f.callback=function(){Z0(a,l)}}var B=a.stateNode;return B!==null&&typeof B.componentDidCatch=="function"&&(f.callback=function(){Z0(a,l),typeof y!="function"&&(Qa===null?Qa=new Set([this]):Qa.add(this));var U=l.stack;this.componentDidCatch(l.value,{componentStack:U!==null?U:""})}),f}function M3(a,l,f){var y=a.pingCache;if(y===null){y=a.pingCache=new Z7;var C=new Set;y.set(l,C)}else C=y.get(l),C===void 0&&(C=new Set,y.set(l,C));C.has(f)||(C.add(f),a=dQ.bind(null,a,l,f),l.then(a,a))}function S3(a){do{var l;if((l=a.tag===13)&&(l=a.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return a;a=a.return}while(a!==null);return null}function T3(a,l,f,y,C){return a.mode&1?(a.flags|=65536,a.lanes=C,a):(a===l?a.flags|=65536:(a.flags|=128,f.flags|=131072,f.flags&=-52805,f.tag===1&&(f.alternate===null?f.tag=17:(l=Hs(-1,1),l.tag=2,Pa(f,l,1))),f.lanes|=1),a)}var $7=I.ReactCurrentOwner,Un=!1;function An(a,l,f,y){l.child=a===null?t3(l,null,f,y):Ec(l,a.child,f,y)}function B3(a,l,f,y,C){f=f.render;var B=l.ref;return yc(l,C),y=j0(a,l,f,y,B,C),f=W0(),a!==null&&!Un?(l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~C,Gs(a,l,C)):(tr&&f&&M0(l),l.flags|=1,An(a,l,y,C),l.child)}function b3(a,l,f,y,C){if(a===null){var B=f.type;return typeof B=="function"&&!y1(B)&&B.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(l.tag=15,l.type=B,R3(a,l,B,y,C)):(a=gp(f.type,null,y,l,l.mode,C),a.ref=l.ref,a.return=l,l.child=a)}if(B=a.child,!(a.lanes&C)){var U=B.memoizedProps;if(f=f.compare,f=f!==null?f:ah,f(U,y)&&a.ref===l.ref)return Gs(a,l,C)}return l.flags|=1,a=Ha(B,y),a.ref=l.ref,a.return=l,l.child=a}function R3(a,l,f,y,C){if(a!==null){var B=a.memoizedProps;if(ah(B,y)&&a.ref===l.ref)if(Un=!1,l.pendingProps=y=B,(a.lanes&C)!==0)a.flags&131072&&(Un=!0);else return l.lanes=a.lanes,Gs(a,l,C)}return $0(a,l,f,y,C)}function D3(a,l,f){var y=l.pendingProps,C=y.children,B=a!==null?a.memoizedState:null;if(y.mode==="hidden")if(!(l.mode&1))l.memoizedState={baseLanes:0,cachePool:null,transitions:null},Wt(Cc,ei),ei|=f;else{if(!(f&1073741824))return a=B!==null?B.baseLanes|f:f,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:a,cachePool:null,transitions:null},l.updateQueue=null,Wt(Cc,ei),ei|=a,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=B!==null?B.baseLanes:f,Wt(Cc,ei),ei|=y}else B!==null?(y=B.baseLanes|f,l.memoizedState=null):y=f,Wt(Cc,ei),ei|=y;return An(a,l,C,f),l.child}function L3(a,l){var f=l.ref;(a===null&&f!==null||a!==null&&a.ref!==f)&&(l.flags|=512,l.flags|=2097152)}function $0(a,l,f,y,C){var B=Nn(f)?Do:tn.current;return B=Ac(l,B),yc(l,C),f=j0(a,l,f,y,B,C),y=W0(),a!==null&&!Un?(l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~C,Gs(a,l,C)):(tr&&y&&M0(l),l.flags|=1,An(a,l,f,C),l.child)}function N3(a,l,f,y,C){if(Nn(f)){var B=!0;zf(l)}else B=!1;if(yc(l,C),l.stateNode===null)sp(a,l),JC(l,f,y),Q0(l,f,y,C),y=!0;else if(a===null){var U=l.stateNode,q=l.memoizedProps;U.props=q;var J=U.context,ce=f.contextType;typeof ce=="object"&&ce!==null?ce=pi(ce):(ce=Nn(f)?Do:tn.current,ce=Ac(l,ce));var we=f.getDerivedStateFromProps,Ie=typeof we=="function"||typeof U.getSnapshotBeforeUpdate=="function";Ie||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(q!==y||J!==ce)&&ZC(l,U,y,ce),Ua=!1;var xe=l.memoizedState;U.state=xe,Xf(l,y,U,C),J=l.memoizedState,q!==y||xe!==J||Ln.current||Ua?(typeof we=="function"&&(k0(l,f,we,y),J=l.memoizedState),(q=Ua||KC(l,f,q,y,xe,J,ce))?(Ie||typeof U.UNSAFE_componentWillMount!="function"&&typeof U.componentWillMount!="function"||(typeof U.componentWillMount=="function"&&U.componentWillMount(),typeof U.UNSAFE_componentWillMount=="function"&&U.UNSAFE_componentWillMount()),typeof U.componentDidMount=="function"&&(l.flags|=4194308)):(typeof U.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=y,l.memoizedState=J),U.props=y,U.state=J,U.context=ce,y=q):(typeof U.componentDidMount=="function"&&(l.flags|=4194308),y=!1)}else{U=l.stateNode,WC(a,l),q=l.memoizedProps,ce=l.type===l.elementType?q:ki(l.type,q),U.props=ce,Ie=l.pendingProps,xe=U.context,J=f.contextType,typeof J=="object"&&J!==null?J=pi(J):(J=Nn(f)?Do:tn.current,J=Ac(l,J));var Le=f.getDerivedStateFromProps;(we=typeof Le=="function"||typeof U.getSnapshotBeforeUpdate=="function")||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(q!==Ie||xe!==J)&&ZC(l,U,y,J),Ua=!1,xe=l.memoizedState,U.state=xe,Xf(l,y,U,C);var ze=l.memoizedState;q!==Ie||xe!==ze||Ln.current||Ua?(typeof Le=="function"&&(k0(l,f,Le,y),ze=l.memoizedState),(ce=Ua||KC(l,f,ce,y,xe,ze,J)||!1)?(we||typeof U.UNSAFE_componentWillUpdate!="function"&&typeof U.componentWillUpdate!="function"||(typeof U.componentWillUpdate=="function"&&U.componentWillUpdate(y,ze,J),typeof U.UNSAFE_componentWillUpdate=="function"&&U.UNSAFE_componentWillUpdate(y,ze,J)),typeof U.componentDidUpdate=="function"&&(l.flags|=4),typeof U.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof U.componentDidUpdate!="function"||q===a.memoizedProps&&xe===a.memoizedState||(l.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||q===a.memoizedProps&&xe===a.memoizedState||(l.flags|=1024),l.memoizedProps=y,l.memoizedState=ze),U.props=y,U.state=ze,U.context=J,y=ce):(typeof U.componentDidUpdate!="function"||q===a.memoizedProps&&xe===a.memoizedState||(l.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||q===a.memoizedProps&&xe===a.memoizedState||(l.flags|=1024),y=!1)}return e1(a,l,f,y,B,C)}function e1(a,l,f,y,C,B){L3(a,l);var U=(l.flags&128)!==0;if(!y&&!U)return C&&QC(l,f,!1),Gs(a,l,B);y=l.stateNode,$7.current=l;var q=U&&typeof f.getDerivedStateFromError!="function"?null:y.render();return l.flags|=1,a!==null&&U?(l.child=Ec(l,a.child,null,B),l.child=Ec(l,null,q,B)):An(a,l,q,B),l.memoizedState=y.state,C&&QC(l,f,!0),l.child}function U3(a){var l=a.stateNode;l.pendingContext?PC(a,l.pendingContext,l.pendingContext!==l.context):l.context&&PC(a,l.context,!1),O0(a,l.containerInfo)}function P3(a,l,f,y,C){return _c(),b0(C),l.flags|=256,An(a,l,f,y),l.child}var t1={dehydrated:null,treeContext:null,retryLane:0};function r1(a){return{baseLanes:a,cachePool:null,transitions:null}}function k3(a,l,f){var y=l.pendingProps,C=sr.current,B=!1,U=(l.flags&128)!==0,q;if((q=U)||(q=a!==null&&a.memoizedState===null?!1:(C&2)!==0),q?(B=!0,l.flags&=-129):(a===null||a.memoizedState!==null)&&(C|=1),Wt(sr,C&1),a===null)return B0(l),a=l.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?(l.mode&1?a.data==="$!"?l.lanes=8:l.lanes=1073741824:l.lanes=1,null):(U=y.children,a=y.fallback,B?(y=l.mode,B=l.child,U={mode:"hidden",children:U},!(y&1)&&B!==null?(B.childLanes=0,B.pendingProps=U):B=mp(U,y,0,null),a=Ho(a,y,f,null),B.return=l,a.return=l,B.sibling=a,l.child=B,l.child.memoizedState=r1(f),l.memoizedState=t1,a):n1(l,U));if(C=a.memoizedState,C!==null&&(q=C.dehydrated,q!==null))return eQ(a,l,U,y,q,C,f);if(B){B=y.fallback,U=l.mode,C=a.child,q=C.sibling;var J={mode:"hidden",children:y.children};return!(U&1)&&l.child!==C?(y=l.child,y.childLanes=0,y.pendingProps=J,l.deletions=null):(y=Ha(C,J),y.subtreeFlags=C.subtreeFlags&14680064),q!==null?B=Ha(q,B):(B=Ho(B,U,f,null),B.flags|=2),B.return=l,y.return=l,y.sibling=B,l.child=y,y=B,B=l.child,U=a.child.memoizedState,U=U===null?r1(f):{baseLanes:U.baseLanes|f,cachePool:null,transitions:U.transitions},B.memoizedState=U,B.childLanes=a.childLanes&~f,l.memoizedState=t1,y}return B=a.child,a=B.sibling,y=Ha(B,{mode:"visible",children:y.children}),!(l.mode&1)&&(y.lanes=f),y.return=l,y.sibling=null,a!==null&&(f=l.deletions,f===null?(l.deletions=[a],l.flags|=16):f.push(a)),l.child=y,l.memoizedState=null,y}function n1(a,l){return l=mp({mode:"visible",children:l},a.mode,0,null),l.return=a,a.child=l}function ip(a,l,f,y){return y!==null&&b0(y),Ec(l,a.child,null,f),a=n1(l,l.pendingProps.children),a.flags|=2,l.memoizedState=null,a}function eQ(a,l,f,y,C,B,U){if(f)return l.flags&256?(l.flags&=-257,y=J0(Error(t(422))),ip(a,l,U,y)):l.memoizedState!==null?(l.child=a.child,l.flags|=128,null):(B=y.fallback,C=l.mode,y=mp({mode:"visible",children:y.children},C,0,null),B=Ho(B,C,U,null),B.flags|=2,y.return=l,B.return=l,y.sibling=B,l.child=y,l.mode&1&&Ec(l,a.child,null,U),l.child.memoizedState=r1(U),l.memoizedState=t1,B);if(!(l.mode&1))return ip(a,l,U,null);if(C.data==="$!"){if(y=C.nextSibling&&C.nextSibling.dataset,y)var q=y.dgst;return y=q,B=Error(t(419)),y=J0(B,y,void 0),ip(a,l,U,y)}if(q=(U&a.childLanes)!==0,Un||q){if(y=Gr,y!==null){switch(U&-U){case 4:C=2;break;case 16:C=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:C=32;break;case 536870912:C=268435456;break;default:C=0}C=C&(y.suspendedLanes|U)?0:C,C!==0&&C!==B.retryLane&&(B.retryLane=C,zs(a,C),Fi(y,a,C,-1))}return v1(),y=J0(Error(t(421))),ip(a,l,U,y)}return C.data==="$?"?(l.flags|=128,l.child=a.child,l=fQ.bind(null,a),C._reactRetry=l,null):(a=B.treeContext,$n=Ra(C.nextSibling),Zn=l,tr=!0,Pi=null,a!==null&&(di[fi++]=Os,di[fi++]=Fs,di[fi++]=Lo,Os=a.id,Fs=a.overflow,Lo=l),l=n1(l,y.children),l.flags|=4096,l)}function Q3(a,l,f){a.lanes|=l;var y=a.alternate;y!==null&&(y.lanes|=l),N0(a.return,l,f)}function i1(a,l,f,y,C){var B=a.memoizedState;B===null?a.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:y,tail:f,tailMode:C}:(B.isBackwards=l,B.rendering=null,B.renderingStartTime=0,B.last=y,B.tail=f,B.tailMode=C)}function O3(a,l,f){var y=l.pendingProps,C=y.revealOrder,B=y.tail;if(An(a,l,y.children,f),y=sr.current,y&2)y=y&1|2,l.flags|=128;else{if(a!==null&&a.flags&128)e:for(a=l.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Q3(a,f,l);else if(a.tag===19)Q3(a,f,l);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===l)break e;for(;a.sibling===null;){if(a.return===null||a.return===l)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}y&=1}if(Wt(sr,y),!(l.mode&1))l.memoizedState=null;else switch(C){case"forwards":for(f=l.child,C=null;f!==null;)a=f.alternate,a!==null&&Zf(a)===null&&(C=f),f=f.sibling;f=C,f===null?(C=l.child,l.child=null):(C=f.sibling,f.sibling=null),i1(l,!1,C,f,B);break;case"backwards":for(f=null,C=l.child,l.child=null;C!==null;){if(a=C.alternate,a!==null&&Zf(a)===null){l.child=C;break}a=C.sibling,C.sibling=f,f=C,C=a}i1(l,!0,f,null,B);break;case"together":i1(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function sp(a,l){!(l.mode&1)&&a!==null&&(a.alternate=null,l.alternate=null,l.flags|=2)}function Gs(a,l,f){if(a!==null&&(l.dependencies=a.dependencies),Qo|=l.lanes,!(f&l.childLanes))return null;if(a!==null&&l.child!==a.child)throw Error(t(153));if(l.child!==null){for(a=l.child,f=Ha(a,a.pendingProps),l.child=f,f.return=l;a.sibling!==null;)a=a.sibling,f=f.sibling=Ha(a,a.pendingProps),f.return=l;f.sibling=null}return l.child}function tQ(a,l,f){switch(l.tag){case 3:U3(l),_c();break;case 5:r3(l);break;case 1:Nn(l.type)&&zf(l);break;case 4:O0(l,l.stateNode.containerInfo);break;case 10:var y=l.type._context,C=l.memoizedProps.value;Wt(Wf,y._currentValue),y._currentValue=C;break;case 13:if(y=l.memoizedState,y!==null)return y.dehydrated!==null?(Wt(sr,sr.current&1),l.flags|=128,null):f&l.child.childLanes?k3(a,l,f):(Wt(sr,sr.current&1),a=Gs(a,l,f),a!==null?a.sibling:null);Wt(sr,sr.current&1);break;case 19:if(y=(f&l.childLanes)!==0,a.flags&128){if(y)return O3(a,l,f);l.flags|=128}if(C=l.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),Wt(sr,sr.current),y)break;return null;case 22:case 23:return l.lanes=0,D3(a,l,f)}return Gs(a,l,f)}var F3,s1,z3,H3;F3=function(a,l){for(var f=l.child;f!==null;){if(f.tag===5||f.tag===6)a.appendChild(f.stateNode);else if(f.tag!==4&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===l)break;for(;f.sibling===null;){if(f.return===null||f.return===l)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},s1=function(){},z3=function(a,l,f,y){var C=a.memoizedProps;if(C!==y){a=l.stateNode,Po(is.current);var B=null;switch(f){case"input":C=lt(a,C),y=lt(a,y),B=[];break;case"select":C=Q({},C,{value:void 0}),y=Q({},y,{value:void 0}),B=[];break;case"textarea":C=ge(a,C),y=ge(a,y),B=[];break;default:typeof C.onClick!="function"&&typeof y.onClick=="function"&&(a.onclick=Qf)}Et(f,y);var U;f=null;for(ce in C)if(!y.hasOwnProperty(ce)&&C.hasOwnProperty(ce)&&C[ce]!=null)if(ce==="style"){var q=C[ce];for(U in q)q.hasOwnProperty(U)&&(f||(f={}),f[U]="")}else ce!=="dangerouslySetInnerHTML"&&ce!=="children"&&ce!=="suppressContentEditableWarning"&&ce!=="suppressHydrationWarning"&&ce!=="autoFocus"&&(i.hasOwnProperty(ce)?B||(B=[]):(B=B||[]).push(ce,null));for(ce in y){var J=y[ce];if(q=C!=null?C[ce]:void 0,y.hasOwnProperty(ce)&&J!==q&&(J!=null||q!=null))if(ce==="style")if(q){for(U in q)!q.hasOwnProperty(U)||J&&J.hasOwnProperty(U)||(f||(f={}),f[U]="");for(U in J)J.hasOwnProperty(U)&&q[U]!==J[U]&&(f||(f={}),f[U]=J[U])}else f||(B||(B=[]),B.push(ce,f)),f=J;else ce==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,q=q?q.__html:void 0,J!=null&&q!==J&&(B=B||[]).push(ce,J)):ce==="children"?typeof J!="string"&&typeof J!="number"||(B=B||[]).push(ce,""+J):ce!=="suppressContentEditableWarning"&&ce!=="suppressHydrationWarning"&&(i.hasOwnProperty(ce)?(J!=null&&ce==="onScroll"&&Xt("scroll",a),B||q===J||(B=[])):(B=B||[]).push(ce,J))}f&&(B=B||[]).push("style",f);var ce=B;(l.updateQueue=ce)&&(l.flags|=4)}},H3=function(a,l,f,y){f!==y&&(l.flags|=4)};function Eh(a,l){if(!tr)switch(a.tailMode){case"hidden":l=a.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.sibling;f===null?a.tail=null:f.sibling=null;break;case"collapsed":f=a.tail;for(var y=null;f!==null;)f.alternate!==null&&(y=f),f=f.sibling;y===null?l||a.tail===null?a.tail=null:a.tail.sibling=null:y.sibling=null}}function nn(a){var l=a.alternate!==null&&a.alternate.child===a.child,f=0,y=0;if(l)for(var C=a.child;C!==null;)f|=C.lanes|C.childLanes,y|=C.subtreeFlags&14680064,y|=C.flags&14680064,C.return=a,C=C.sibling;else for(C=a.child;C!==null;)f|=C.lanes|C.childLanes,y|=C.subtreeFlags,y|=C.flags,C.return=a,C=C.sibling;return a.subtreeFlags|=y,a.childLanes=f,l}function rQ(a,l,f){var y=l.pendingProps;switch(S0(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nn(l),null;case 1:return Nn(l.type)&&Ff(),nn(l),null;case 3:return y=l.stateNode,xc(),Kt(Ln),Kt(tn),H0(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(a===null||a.child===null)&&(jf(l)?l.flags|=4:a===null||a.memoizedState.isDehydrated&&!(l.flags&256)||(l.flags|=1024,Pi!==null&&(g1(Pi),Pi=null))),s1(a,l),nn(l),null;case 5:F0(l);var C=Po(gh.current);if(f=l.type,a!==null&&l.stateNode!=null)z3(a,l,f,y,C),a.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!y){if(l.stateNode===null)throw Error(t(166));return nn(l),null}if(a=Po(is.current),jf(l)){y=l.stateNode,f=l.type;var B=l.memoizedProps;switch(y[ns]=l,y[hh]=B,a=(l.mode&1)!==0,f){case"dialog":Xt("cancel",y),Xt("close",y);break;case"iframe":case"object":case"embed":Xt("load",y);break;case"video":case"audio":for(C=0;C<lh.length;C++)Xt(lh[C],y);break;case"source":Xt("error",y);break;case"img":case"image":case"link":Xt("error",y),Xt("load",y);break;case"details":Xt("toggle",y);break;case"input":Ye(y,B),Xt("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!B.multiple},Xt("invalid",y);break;case"textarea":Ue(y,B),Xt("invalid",y)}Et(f,B),C=null;for(var U in B)if(B.hasOwnProperty(U)){var q=B[U];U==="children"?typeof q=="string"?y.textContent!==q&&(B.suppressHydrationWarning!==!0&&kf(y.textContent,q,a),C=["children",q]):typeof q=="number"&&y.textContent!==""+q&&(B.suppressHydrationWarning!==!0&&kf(y.textContent,q,a),C=["children",""+q]):i.hasOwnProperty(U)&&q!=null&&U==="onScroll"&&Xt("scroll",y)}switch(f){case"input":ae(y),k(y,B,!0);break;case"textarea":ae(y),Qe(y);break;case"select":case"option":break;default:typeof B.onClick=="function"&&(y.onclick=Qf)}y=C,l.updateQueue=y,y!==null&&(l.flags|=4)}else{U=C.nodeType===9?C:C.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=He(f)),a==="http://www.w3.org/1999/xhtml"?f==="script"?(a=U.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof y.is=="string"?a=U.createElement(f,{is:y.is}):(a=U.createElement(f),f==="select"&&(U=a,y.multiple?U.multiple=!0:y.size&&(U.size=y.size))):a=U.createElementNS(a,f),a[ns]=l,a[hh]=y,F3(a,l,!1,!1),l.stateNode=a;e:{switch(U=G(f,y),f){case"dialog":Xt("cancel",a),Xt("close",a),C=y;break;case"iframe":case"object":case"embed":Xt("load",a),C=y;break;case"video":case"audio":for(C=0;C<lh.length;C++)Xt(lh[C],a);C=y;break;case"source":Xt("error",a),C=y;break;case"img":case"image":case"link":Xt("error",a),Xt("load",a),C=y;break;case"details":Xt("toggle",a),C=y;break;case"input":Ye(a,y),C=lt(a,y),Xt("invalid",a);break;case"option":C=y;break;case"select":a._wrapperState={wasMultiple:!!y.multiple},C=Q({},y,{value:void 0}),Xt("invalid",a);break;case"textarea":Ue(a,y),C=ge(a,y),Xt("invalid",a);break;default:C=y}Et(f,C),q=C;for(B in q)if(q.hasOwnProperty(B)){var J=q[B];B==="style"?yt(a,J):B==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,J!=null&&Ze(a,J)):B==="children"?typeof J=="string"?(f!=="textarea"||J!=="")&&Ne(a,J):typeof J=="number"&&Ne(a,""+J):B!=="suppressContentEditableWarning"&&B!=="suppressHydrationWarning"&&B!=="autoFocus"&&(i.hasOwnProperty(B)?J!=null&&B==="onScroll"&&Xt("scroll",a):J!=null&&x(a,B,J,U))}switch(f){case"input":ae(a),k(a,y,!1);break;case"textarea":ae(a),Qe(a);break;case"option":y.value!=null&&a.setAttribute("value",""+ye(y.value));break;case"select":a.multiple=!!y.multiple,B=y.value,B!=null?pe(a,!!y.multiple,B,!1):y.defaultValue!=null&&pe(a,!!y.multiple,y.defaultValue,!0);break;default:typeof C.onClick=="function"&&(a.onclick=Qf)}switch(f){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return nn(l),null;case 6:if(a&&l.stateNode!=null)H3(a,l,a.memoizedProps,y);else{if(typeof y!="string"&&l.stateNode===null)throw Error(t(166));if(f=Po(gh.current),Po(is.current),jf(l)){if(y=l.stateNode,f=l.memoizedProps,y[ns]=l,(B=y.nodeValue!==f)&&(a=Zn,a!==null))switch(a.tag){case 3:kf(y.nodeValue,f,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&kf(y.nodeValue,f,(a.mode&1)!==0)}B&&(l.flags|=4)}else y=(f.nodeType===9?f:f.ownerDocument).createTextNode(y),y[ns]=l,l.stateNode=y}return nn(l),null;case 13:if(Kt(sr),y=l.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(tr&&$n!==null&&l.mode&1&&!(l.flags&128))VC(),_c(),l.flags|=98560,B=!1;else if(B=jf(l),y!==null&&y.dehydrated!==null){if(a===null){if(!B)throw Error(t(318));if(B=l.memoizedState,B=B!==null?B.dehydrated:null,!B)throw Error(t(317));B[ns]=l}else _c(),!(l.flags&128)&&(l.memoizedState=null),l.flags|=4;nn(l),B=!1}else Pi!==null&&(g1(Pi),Pi=null),B=!0;if(!B)return l.flags&65536?l:null}return l.flags&128?(l.lanes=f,l):(y=y!==null,y!==(a!==null&&a.memoizedState!==null)&&y&&(l.child.flags|=8192,l.mode&1&&(a===null||sr.current&1?Lr===0&&(Lr=3):v1())),l.updateQueue!==null&&(l.flags|=4),nn(l),null);case 4:return xc(),s1(a,l),a===null&&ch(l.stateNode.containerInfo),nn(l),null;case 10:return L0(l.type._context),nn(l),null;case 17:return Nn(l.type)&&Ff(),nn(l),null;case 19:if(Kt(sr),B=l.memoizedState,B===null)return nn(l),null;if(y=(l.flags&128)!==0,U=B.rendering,U===null)if(y)Eh(B,!1);else{if(Lr!==0||a!==null&&a.flags&128)for(a=l.child;a!==null;){if(U=Zf(a),U!==null){for(l.flags|=128,Eh(B,!1),y=U.updateQueue,y!==null&&(l.updateQueue=y,l.flags|=4),l.subtreeFlags=0,y=f,f=l.child;f!==null;)B=f,a=y,B.flags&=14680066,U=B.alternate,U===null?(B.childLanes=0,B.lanes=a,B.child=null,B.subtreeFlags=0,B.memoizedProps=null,B.memoizedState=null,B.updateQueue=null,B.dependencies=null,B.stateNode=null):(B.childLanes=U.childLanes,B.lanes=U.lanes,B.child=U.child,B.subtreeFlags=0,B.deletions=null,B.memoizedProps=U.memoizedProps,B.memoizedState=U.memoizedState,B.updateQueue=U.updateQueue,B.type=U.type,a=U.dependencies,B.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),f=f.sibling;return Wt(sr,sr.current&1|2),l.child}a=a.sibling}B.tail!==null&&We()>Mc&&(l.flags|=128,y=!0,Eh(B,!1),l.lanes=4194304)}else{if(!y)if(a=Zf(U),a!==null){if(l.flags|=128,y=!0,f=a.updateQueue,f!==null&&(l.updateQueue=f,l.flags|=4),Eh(B,!0),B.tail===null&&B.tailMode==="hidden"&&!U.alternate&&!tr)return nn(l),null}else 2*We()-B.renderingStartTime>Mc&&f!==1073741824&&(l.flags|=128,y=!0,Eh(B,!1),l.lanes=4194304);B.isBackwards?(U.sibling=l.child,l.child=U):(f=B.last,f!==null?f.sibling=U:l.child=U,B.last=U)}return B.tail!==null?(l=B.tail,B.rendering=l,B.tail=l.sibling,B.renderingStartTime=We(),l.sibling=null,f=sr.current,Wt(sr,y?f&1|2:f&1),l):(nn(l),null);case 22:case 23:return _1(),y=l.memoizedState!==null,a!==null&&a.memoizedState!==null!==y&&(l.flags|=8192),y&&l.mode&1?ei&1073741824&&(nn(l),l.subtreeFlags&6&&(l.flags|=8192)):nn(l),null;case 24:return null;case 25:return null}throw Error(t(156,l.tag))}function nQ(a,l){switch(S0(l),l.tag){case 1:return Nn(l.type)&&Ff(),a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 3:return xc(),Kt(Ln),Kt(tn),H0(),a=l.flags,a&65536&&!(a&128)?(l.flags=a&-65537|128,l):null;case 5:return F0(l),null;case 13:if(Kt(sr),a=l.memoizedState,a!==null&&a.dehydrated!==null){if(l.alternate===null)throw Error(t(340));_c()}return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 19:return Kt(sr),null;case 4:return xc(),null;case 10:return L0(l.type._context),null;case 22:case 23:return _1(),null;case 24:return null;default:return null}}var ap=!1,sn=!1,iQ=typeof WeakSet=="function"?WeakSet:Set,ke=null;function Ic(a,l){var f=a.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(y){hr(a,l,y)}else f.current=null}function a1(a,l,f){try{f()}catch(y){hr(a,l,y)}}var G3=!1;function sQ(a,l){if(_0=Mf,a=yC(),u0(a)){if("selectionStart"in a)var f={start:a.selectionStart,end:a.selectionEnd};else e:{f=(f=a.ownerDocument)&&f.defaultView||window;var y=f.getSelection&&f.getSelection();if(y&&y.rangeCount!==0){f=y.anchorNode;var C=y.anchorOffset,B=y.focusNode;y=y.focusOffset;try{f.nodeType,B.nodeType}catch{f=null;break e}var U=0,q=-1,J=-1,ce=0,we=0,Ie=a,xe=null;t:for(;;){for(var Le;Ie!==f||C!==0&&Ie.nodeType!==3||(q=U+C),Ie!==B||y!==0&&Ie.nodeType!==3||(J=U+y),Ie.nodeType===3&&(U+=Ie.nodeValue.length),(Le=Ie.firstChild)!==null;)xe=Ie,Ie=Le;for(;;){if(Ie===a)break t;if(xe===f&&++ce===C&&(q=U),xe===B&&++we===y&&(J=U),(Le=Ie.nextSibling)!==null)break;Ie=xe,xe=Ie.parentNode}Ie=Le}f=q===-1||J===-1?null:{start:q,end:J}}else f=null}f=f||{start:0,end:0}}else f=null;for(v0={focusedElem:a,selectionRange:f},Mf=!1,ke=l;ke!==null;)if(l=ke,a=l.child,(l.subtreeFlags&1028)!==0&&a!==null)a.return=l,ke=a;else for(;ke!==null;){l=ke;try{var ze=l.alternate;if(l.flags&1024)switch(l.tag){case 0:case 11:case 15:break;case 1:if(ze!==null){var Ve=ze.memoizedProps,vr=ze.memoizedState,se=l.stateNode,$=se.getSnapshotBeforeUpdate(l.elementType===l.type?Ve:ki(l.type,Ve),vr);se.__reactInternalSnapshotBeforeUpdate=$}break;case 3:var oe=l.stateNode.containerInfo;oe.nodeType===1?oe.textContent="":oe.nodeType===9&&oe.documentElement&&oe.removeChild(oe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(Me){hr(l,l.return,Me)}if(a=l.sibling,a!==null){a.return=l.return,ke=a;break}ke=l.return}return ze=G3,G3=!1,ze}function xh(a,l,f){var y=l.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var C=y=y.next;do{if((C.tag&a)===a){var B=C.destroy;C.destroy=void 0,B!==void 0&&a1(l,f,B)}C=C.next}while(C!==y)}}function op(a,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var f=l=l.next;do{if((f.tag&a)===a){var y=f.create;f.destroy=y()}f=f.next}while(f!==l)}}function o1(a){var l=a.ref;if(l!==null){var f=a.stateNode;switch(a.tag){case 5:a=f;break;default:a=f}typeof l=="function"?l(a):l.current=a}}function V3(a){var l=a.alternate;l!==null&&(a.alternate=null,V3(l)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(l=a.stateNode,l!==null&&(delete l[ns],delete l[hh],delete l[w0],delete l[z7],delete l[H7])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function j3(a){return a.tag===5||a.tag===3||a.tag===4}function W3(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||j3(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function l1(a,l,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,l?f.nodeType===8?f.parentNode.insertBefore(a,l):f.insertBefore(a,l):(f.nodeType===8?(l=f.parentNode,l.insertBefore(a,f)):(l=f,l.appendChild(a)),f=f._reactRootContainer,f!=null||l.onclick!==null||(l.onclick=Qf));else if(y!==4&&(a=a.child,a!==null))for(l1(a,l,f),a=a.sibling;a!==null;)l1(a,l,f),a=a.sibling}function c1(a,l,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,l?f.insertBefore(a,l):f.appendChild(a);else if(y!==4&&(a=a.child,a!==null))for(c1(a,l,f),a=a.sibling;a!==null;)c1(a,l,f),a=a.sibling}var Yr=null,Qi=!1;function ka(a,l,f){for(f=f.child;f!==null;)Y3(a,l,f),f=f.sibling}function Y3(a,l,f){if($e&&typeof $e.onCommitFiberUnmount=="function")try{$e.onCommitFiberUnmount(jt,f)}catch{}switch(f.tag){case 5:sn||Ic(f,l);case 6:var y=Yr,C=Qi;Yr=null,ka(a,l,f),Yr=y,Qi=C,Yr!==null&&(Qi?(a=Yr,f=f.stateNode,a.nodeType===8?a.parentNode.removeChild(f):a.removeChild(f)):Yr.removeChild(f.stateNode));break;case 18:Yr!==null&&(Qi?(a=Yr,f=f.stateNode,a.nodeType===8?x0(a.parentNode,f):a.nodeType===1&&x0(a,f),eh(a)):x0(Yr,f.stateNode));break;case 4:y=Yr,C=Qi,Yr=f.stateNode.containerInfo,Qi=!0,ka(a,l,f),Yr=y,Qi=C;break;case 0:case 11:case 14:case 15:if(!sn&&(y=f.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){C=y=y.next;do{var B=C,U=B.destroy;B=B.tag,U!==void 0&&(B&2||B&4)&&a1(f,l,U),C=C.next}while(C!==y)}ka(a,l,f);break;case 1:if(!sn&&(Ic(f,l),y=f.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=f.memoizedProps,y.state=f.memoizedState,y.componentWillUnmount()}catch(q){hr(f,l,q)}ka(a,l,f);break;case 21:ka(a,l,f);break;case 22:f.mode&1?(sn=(y=sn)||f.memoizedState!==null,ka(a,l,f),sn=y):ka(a,l,f);break;default:ka(a,l,f)}}function q3(a){var l=a.updateQueue;if(l!==null){a.updateQueue=null;var f=a.stateNode;f===null&&(f=a.stateNode=new iQ),l.forEach(function(y){var C=pQ.bind(null,a,y);f.has(y)||(f.add(y),y.then(C,C))})}}function Oi(a,l){var f=l.deletions;if(f!==null)for(var y=0;y<f.length;y++){var C=f[y];try{var B=a,U=l,q=U;e:for(;q!==null;){switch(q.tag){case 5:Yr=q.stateNode,Qi=!1;break e;case 3:Yr=q.stateNode.containerInfo,Qi=!0;break e;case 4:Yr=q.stateNode.containerInfo,Qi=!0;break e}q=q.return}if(Yr===null)throw Error(t(160));Y3(B,U,C),Yr=null,Qi=!1;var J=C.alternate;J!==null&&(J.return=null),C.return=null}catch(ce){hr(C,l,ce)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)X3(l,a),l=l.sibling}function X3(a,l){var f=a.alternate,y=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(Oi(l,a),as(a),y&4){try{xh(3,a,a.return),op(3,a)}catch(Ve){hr(a,a.return,Ve)}try{xh(5,a,a.return)}catch(Ve){hr(a,a.return,Ve)}}break;case 1:Oi(l,a),as(a),y&512&&f!==null&&Ic(f,f.return);break;case 5:if(Oi(l,a),as(a),y&512&&f!==null&&Ic(f,f.return),a.flags&32){var C=a.stateNode;try{Ne(C,"")}catch(Ve){hr(a,a.return,Ve)}}if(y&4&&(C=a.stateNode,C!=null)){var B=a.memoizedProps,U=f!==null?f.memoizedProps:B,q=a.type,J=a.updateQueue;if(a.updateQueue=null,J!==null)try{q==="input"&&B.type==="radio"&&B.name!=null&&ct(C,B),G(q,U);var ce=G(q,B);for(U=0;U<J.length;U+=2){var we=J[U],Ie=J[U+1];we==="style"?yt(C,Ie):we==="dangerouslySetInnerHTML"?Ze(C,Ie):we==="children"?Ne(C,Ie):x(C,we,Ie,ce)}switch(q){case"input":Y(C,B);break;case"textarea":Ee(C,B);break;case"select":var xe=C._wrapperState.wasMultiple;C._wrapperState.wasMultiple=!!B.multiple;var Le=B.value;Le!=null?pe(C,!!B.multiple,Le,!1):xe!==!!B.multiple&&(B.defaultValue!=null?pe(C,!!B.multiple,B.defaultValue,!0):pe(C,!!B.multiple,B.multiple?[]:"",!1))}C[hh]=B}catch(Ve){hr(a,a.return,Ve)}}break;case 6:if(Oi(l,a),as(a),y&4){if(a.stateNode===null)throw Error(t(162));C=a.stateNode,B=a.memoizedProps;try{C.nodeValue=B}catch(Ve){hr(a,a.return,Ve)}}break;case 3:if(Oi(l,a),as(a),y&4&&f!==null&&f.memoizedState.isDehydrated)try{eh(l.containerInfo)}catch(Ve){hr(a,a.return,Ve)}break;case 4:Oi(l,a),as(a);break;case 13:Oi(l,a),as(a),C=a.child,C.flags&8192&&(B=C.memoizedState!==null,C.stateNode.isHidden=B,!B||C.alternate!==null&&C.alternate.memoizedState!==null||(d1=We())),y&4&&q3(a);break;case 22:if(we=f!==null&&f.memoizedState!==null,a.mode&1?(sn=(ce=sn)||we,Oi(l,a),sn=ce):Oi(l,a),as(a),y&8192){if(ce=a.memoizedState!==null,(a.stateNode.isHidden=ce)&&!we&&a.mode&1)for(ke=a,we=a.child;we!==null;){for(Ie=ke=we;ke!==null;){switch(xe=ke,Le=xe.child,xe.tag){case 0:case 11:case 14:case 15:xh(4,xe,xe.return);break;case 1:Ic(xe,xe.return);var ze=xe.stateNode;if(typeof ze.componentWillUnmount=="function"){y=xe,f=xe.return;try{l=y,ze.props=l.memoizedProps,ze.state=l.memoizedState,ze.componentWillUnmount()}catch(Ve){hr(y,f,Ve)}}break;case 5:Ic(xe,xe.return);break;case 22:if(xe.memoizedState!==null){Z3(Ie);continue}}Le!==null?(Le.return=xe,ke=Le):Z3(Ie)}we=we.sibling}e:for(we=null,Ie=a;;){if(Ie.tag===5){if(we===null){we=Ie;try{C=Ie.stateNode,ce?(B=C.style,typeof B.setProperty=="function"?B.setProperty("display","none","important"):B.display="none"):(q=Ie.stateNode,J=Ie.memoizedProps.style,U=J!=null&&J.hasOwnProperty("display")?J.display:null,q.style.display=ft("display",U))}catch(Ve){hr(a,a.return,Ve)}}}else if(Ie.tag===6){if(we===null)try{Ie.stateNode.nodeValue=ce?"":Ie.memoizedProps}catch(Ve){hr(a,a.return,Ve)}}else if((Ie.tag!==22&&Ie.tag!==23||Ie.memoizedState===null||Ie===a)&&Ie.child!==null){Ie.child.return=Ie,Ie=Ie.child;continue}if(Ie===a)break e;for(;Ie.sibling===null;){if(Ie.return===null||Ie.return===a)break e;we===Ie&&(we=null),Ie=Ie.return}we===Ie&&(we=null),Ie.sibling.return=Ie.return,Ie=Ie.sibling}}break;case 19:Oi(l,a),as(a),y&4&&q3(a);break;case 21:break;default:Oi(l,a),as(a)}}function as(a){var l=a.flags;if(l&2){try{e:{for(var f=a.return;f!==null;){if(j3(f)){var y=f;break e}f=f.return}throw Error(t(160))}switch(y.tag){case 5:var C=y.stateNode;y.flags&32&&(Ne(C,""),y.flags&=-33);var B=W3(a);c1(a,B,C);break;case 3:case 4:var U=y.stateNode.containerInfo,q=W3(a);l1(a,q,U);break;default:throw Error(t(161))}}catch(J){hr(a,a.return,J)}a.flags&=-3}l&4096&&(a.flags&=-4097)}function aQ(a,l,f){ke=a,K3(a)}function K3(a,l,f){for(var y=(a.mode&1)!==0;ke!==null;){var C=ke,B=C.child;if(C.tag===22&&y){var U=C.memoizedState!==null||ap;if(!U){var q=C.alternate,J=q!==null&&q.memoizedState!==null||sn;q=ap;var ce=sn;if(ap=U,(sn=J)&&!ce)for(ke=C;ke!==null;)U=ke,J=U.child,U.tag===22&&U.memoizedState!==null?$3(C):J!==null?(J.return=U,ke=J):$3(C);for(;B!==null;)ke=B,K3(B),B=B.sibling;ke=C,ap=q,sn=ce}J3(a)}else C.subtreeFlags&8772&&B!==null?(B.return=C,ke=B):J3(a)}}function J3(a){for(;ke!==null;){var l=ke;if(l.flags&8772){var f=l.alternate;try{if(l.flags&8772)switch(l.tag){case 0:case 11:case 15:sn||op(5,l);break;case 1:var y=l.stateNode;if(l.flags&4&&!sn)if(f===null)y.componentDidMount();else{var C=l.elementType===l.type?f.memoizedProps:ki(l.type,f.memoizedProps);y.componentDidUpdate(C,f.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var B=l.updateQueue;B!==null&&qC(l,B,y);break;case 3:var U=l.updateQueue;if(U!==null){if(f=null,l.child!==null)switch(l.child.tag){case 5:f=l.child.stateNode;break;case 1:f=l.child.stateNode}qC(l,U,f)}break;case 5:var q=l.stateNode;if(f===null&&l.flags&4){f=q;var J=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":J.autoFocus&&f.focus();break;case"img":J.src&&(f.src=J.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var ce=l.alternate;if(ce!==null){var we=ce.memoizedState;if(we!==null){var Ie=we.dehydrated;Ie!==null&&eh(Ie)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}sn||l.flags&512&&o1(l)}catch(xe){hr(l,l.return,xe)}}if(l===a){ke=null;break}if(f=l.sibling,f!==null){f.return=l.return,ke=f;break}ke=l.return}}function Z3(a){for(;ke!==null;){var l=ke;if(l===a){ke=null;break}var f=l.sibling;if(f!==null){f.return=l.return,ke=f;break}ke=l.return}}function $3(a){for(;ke!==null;){var l=ke;try{switch(l.tag){case 0:case 11:case 15:var f=l.return;try{op(4,l)}catch(J){hr(l,f,J)}break;case 1:var y=l.stateNode;if(typeof y.componentDidMount=="function"){var C=l.return;try{y.componentDidMount()}catch(J){hr(l,C,J)}}var B=l.return;try{o1(l)}catch(J){hr(l,B,J)}break;case 5:var U=l.return;try{o1(l)}catch(J){hr(l,U,J)}}}catch(J){hr(l,l.return,J)}if(l===a){ke=null;break}var q=l.sibling;if(q!==null){q.return=l.return,ke=q;break}ke=l.return}}var oQ=Math.ceil,lp=I.ReactCurrentDispatcher,u1=I.ReactCurrentOwner,gi=I.ReactCurrentBatchConfig,Mt=0,Gr=null,Ir=null,qr=0,ei=0,Cc=Da(0),Lr=0,wh=null,Qo=0,cp=0,h1=0,Ih=null,Pn=null,d1=0,Mc=1/0,Vs=null,up=!1,f1=null,Qa=null,hp=!1,Oa=null,dp=0,Ch=0,p1=null,fp=-1,pp=0;function gn(){return Mt&6?We():fp!==-1?fp:fp=We()}function Fa(a){return a.mode&1?Mt&2&&qr!==0?qr&-qr:V7.transition!==null?(pp===0&&(pp=qu()),pp):(a=Pt,a!==0||(a=window.event,a=a===void 0?16:eC(a.type)),a):1}function Fi(a,l,f,y){if(50<Ch)throw Ch=0,p1=null,Error(t(185));Xu(a,f,y),(!(Mt&2)||a!==Gr)&&(a===Gr&&(!(Mt&2)&&(cp|=f),Lr===4&&za(a,qr)),kn(a,y),f===1&&Mt===0&&!(l.mode&1)&&(Mc=We()+500,Hf&&Na()))}function kn(a,l){var f=a.callbackNode;Wu(a,l);var y=Ia(a,a===Gr?qr:0);if(y===0)f!==null&&Xe(f),a.callbackNode=null,a.callbackPriority=0;else if(l=y&-y,a.callbackPriority!==l){if(f!=null&&Xe(f),l===1)a.tag===0?G7(tM.bind(null,a)):OC(tM.bind(null,a)),O7(function(){!(Mt&6)&&Na()}),f=null;else{switch(WI(y)){case 1:f=ot;break;case 4:f=Rr;break;case 16:f=er;break;case 536870912:f=hi;break;default:f=er}f=cM(f,eM.bind(null,a))}a.callbackPriority=l,a.callbackNode=f}}function eM(a,l){if(fp=-1,pp=0,Mt&6)throw Error(t(327));var f=a.callbackNode;if(Sc()&&a.callbackNode!==f)return null;var y=Ia(a,a===Gr?qr:0);if(y===0)return null;if(y&30||y&a.expiredLanes||l)l=Ap(a,y);else{l=y;var C=Mt;Mt|=2;var B=nM();(Gr!==a||qr!==l)&&(Vs=null,Mc=We()+500,Fo(a,l));do try{uQ();break}catch(q){rM(a,q)}while(1);D0(),lp.current=B,Mt=C,Ir!==null?l=0:(Gr=null,qr=0,l=Lr)}if(l!==0){if(l===2&&(C=Yu(a),C!==0&&(y=C,l=A1(a,C))),l===1)throw f=wh,Fo(a,0),za(a,y),kn(a,We()),f;if(l===6)za(a,y);else{if(C=a.current.alternate,!(y&30)&&!lQ(C)&&(l=Ap(a,y),l===2&&(B=Yu(a),B!==0&&(y=B,l=A1(a,B))),l===1))throw f=wh,Fo(a,0),za(a,y),kn(a,We()),f;switch(a.finishedWork=C,a.finishedLanes=y,l){case 0:case 1:throw Error(t(345));case 2:zo(a,Pn,Vs);break;case 3:if(za(a,y),(y&130023424)===y&&(l=d1+500-We(),10<l)){if(Ia(a,0)!==0)break;if(C=a.suspendedLanes,(C&y)!==y){gn(),a.pingedLanes|=a.suspendedLanes&C;break}a.timeoutHandle=E0(zo.bind(null,a,Pn,Vs),l);break}zo(a,Pn,Vs);break;case 4:if(za(a,y),(y&4194240)===y)break;for(l=a.eventTimes,C=-1;0<y;){var U=31-pn(y);B=1<<U,U=l[U],U>C&&(C=U),y&=~B}if(y=C,y=We()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*oQ(y/1960))-y,10<y){a.timeoutHandle=E0(zo.bind(null,a,Pn,Vs),y);break}zo(a,Pn,Vs);break;case 5:zo(a,Pn,Vs);break;default:throw Error(t(329))}}}return kn(a,We()),a.callbackNode===f?eM.bind(null,a):null}function A1(a,l){var f=Ih;return a.current.memoizedState.isDehydrated&&(Fo(a,l).flags|=256),a=Ap(a,l),a!==2&&(l=Pn,Pn=f,l!==null&&g1(l)),a}function g1(a){Pn===null?Pn=a:Pn.push.apply(Pn,a)}function lQ(a){for(var l=a;;){if(l.flags&16384){var f=l.updateQueue;if(f!==null&&(f=f.stores,f!==null))for(var y=0;y<f.length;y++){var C=f[y],B=C.getSnapshot;C=C.value;try{if(!Ui(B(),C))return!1}catch{return!1}}}if(f=l.child,l.subtreeFlags&16384&&f!==null)f.return=l,l=f;else{if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function za(a,l){for(l&=~h1,l&=~cp,a.suspendedLanes|=l,a.pingedLanes&=~l,a=a.expirationTimes;0<l;){var f=31-pn(l),y=1<<f;a[f]=-1,l&=~y}}function tM(a){if(Mt&6)throw Error(t(327));Sc();var l=Ia(a,0);if(!(l&1))return kn(a,We()),null;var f=Ap(a,l);if(a.tag!==0&&f===2){var y=Yu(a);y!==0&&(l=y,f=A1(a,y))}if(f===1)throw f=wh,Fo(a,0),za(a,l),kn(a,We()),f;if(f===6)throw Error(t(345));return a.finishedWork=a.current.alternate,a.finishedLanes=l,zo(a,Pn,Vs),kn(a,We()),null}function m1(a,l){var f=Mt;Mt|=1;try{return a(l)}finally{Mt=f,Mt===0&&(Mc=We()+500,Hf&&Na())}}function Oo(a){Oa!==null&&Oa.tag===0&&!(Mt&6)&&Sc();var l=Mt;Mt|=1;var f=gi.transition,y=Pt;try{if(gi.transition=null,Pt=1,a)return a()}finally{Pt=y,gi.transition=f,Mt=l,!(Mt&6)&&Na()}}function _1(){ei=Cc.current,Kt(Cc)}function Fo(a,l){a.finishedWork=null,a.finishedLanes=0;var f=a.timeoutHandle;if(f!==-1&&(a.timeoutHandle=-1,Q7(f)),Ir!==null)for(f=Ir.return;f!==null;){var y=f;switch(S0(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&Ff();break;case 3:xc(),Kt(Ln),Kt(tn),H0();break;case 5:F0(y);break;case 4:xc();break;case 13:Kt(sr);break;case 19:Kt(sr);break;case 10:L0(y.type._context);break;case 22:case 23:_1()}f=f.return}if(Gr=a,Ir=a=Ha(a.current,null),qr=ei=l,Lr=0,wh=null,h1=cp=Qo=0,Pn=Ih=null,Uo!==null){for(l=0;l<Uo.length;l++)if(f=Uo[l],y=f.interleaved,y!==null){f.interleaved=null;var C=y.next,B=f.pending;if(B!==null){var U=B.next;B.next=C,y.next=U}f.pending=y}Uo=null}return a}function rM(a,l){do{var f=Ir;try{if(D0(),$f.current=np,ep){for(var y=ar.memoizedState;y!==null;){var C=y.queue;C!==null&&(C.pending=null),y=y.next}ep=!1}if(ko=0,Hr=Dr=ar=null,mh=!1,_h=0,u1.current=null,f===null||f.return===null){Lr=1,wh=l,Ir=null;break}e:{var B=a,U=f.return,q=f,J=l;if(l=qr,q.flags|=32768,J!==null&&typeof J=="object"&&typeof J.then=="function"){var ce=J,we=q,Ie=we.tag;if(!(we.mode&1)&&(Ie===0||Ie===11||Ie===15)){var xe=we.alternate;xe?(we.updateQueue=xe.updateQueue,we.memoizedState=xe.memoizedState,we.lanes=xe.lanes):(we.updateQueue=null,we.memoizedState=null)}var Le=S3(U);if(Le!==null){Le.flags&=-257,T3(Le,U,q,B,l),Le.mode&1&&M3(B,ce,l),l=Le,J=ce;var ze=l.updateQueue;if(ze===null){var Ve=new Set;Ve.add(J),l.updateQueue=Ve}else ze.add(J);break e}else{if(!(l&1)){M3(B,ce,l),v1();break e}J=Error(t(426))}}else if(tr&&q.mode&1){var vr=S3(U);if(vr!==null){!(vr.flags&65536)&&(vr.flags|=256),T3(vr,U,q,B,l),b0(wc(J,q));break e}}B=J=wc(J,q),Lr!==4&&(Lr=2),Ih===null?Ih=[B]:Ih.push(B),B=U;do{switch(B.tag){case 3:B.flags|=65536,l&=-l,B.lanes|=l;var se=I3(B,J,l);YC(B,se);break e;case 1:q=J;var $=B.type,oe=B.stateNode;if(!(B.flags&128)&&(typeof $.getDerivedStateFromError=="function"||oe!==null&&typeof oe.componentDidCatch=="function"&&(Qa===null||!Qa.has(oe)))){B.flags|=65536,l&=-l,B.lanes|=l;var Me=C3(B,q,l);YC(B,Me);break e}}B=B.return}while(B!==null)}sM(f)}catch(je){l=je,Ir===f&&f!==null&&(Ir=f=f.return);continue}break}while(1)}function nM(){var a=lp.current;return lp.current=np,a===null?np:a}function v1(){(Lr===0||Lr===3||Lr===2)&&(Lr=4),Gr===null||!(Qo&268435455)&&!(cp&268435455)||za(Gr,qr)}function Ap(a,l){var f=Mt;Mt|=2;var y=nM();(Gr!==a||qr!==l)&&(Vs=null,Fo(a,l));do try{cQ();break}catch(C){rM(a,C)}while(1);if(D0(),Mt=f,lp.current=y,Ir!==null)throw Error(t(261));return Gr=null,qr=0,Lr}function cQ(){for(;Ir!==null;)iM(Ir)}function uQ(){for(;Ir!==null&&!et();)iM(Ir)}function iM(a){var l=lM(a.alternate,a,ei);a.memoizedProps=a.pendingProps,l===null?sM(a):Ir=l,u1.current=null}function sM(a){var l=a;do{var f=l.alternate;if(a=l.return,l.flags&32768){if(f=nQ(f,l),f!==null){f.flags&=32767,Ir=f;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Lr=6,Ir=null;return}}else if(f=rQ(f,l,ei),f!==null){Ir=f;return}if(l=l.sibling,l!==null){Ir=l;return}Ir=l=a}while(l!==null);Lr===0&&(Lr=5)}function zo(a,l,f){var y=Pt,C=gi.transition;try{gi.transition=null,Pt=1,hQ(a,l,f,y)}finally{gi.transition=C,Pt=y}return null}function hQ(a,l,f,y){do Sc();while(Oa!==null);if(Mt&6)throw Error(t(327));f=a.finishedWork;var C=a.finishedLanes;if(f===null)return null;if(a.finishedWork=null,a.finishedLanes=0,f===a.current)throw Error(t(177));a.callbackNode=null,a.callbackPriority=0;var B=f.lanes|f.childLanes;if(jk(a,B),a===Gr&&(Ir=Gr=null,qr=0),!(f.subtreeFlags&2064)&&!(f.flags&2064)||hp||(hp=!0,cM(er,function(){return Sc(),null})),B=(f.flags&15990)!==0,f.subtreeFlags&15990||B){B=gi.transition,gi.transition=null;var U=Pt;Pt=1;var q=Mt;Mt|=4,u1.current=null,sQ(a,f),X3(f,a),R7(v0),Mf=!!_0,v0=_0=null,a.current=f,aQ(f),nt(),Mt=q,Pt=U,gi.transition=B}else a.current=f;if(hp&&(hp=!1,Oa=a,dp=C),B=a.pendingLanes,B===0&&(Qa=null),ju(f.stateNode),kn(a,We()),l!==null)for(y=a.onRecoverableError,f=0;f<l.length;f++)C=l[f],y(C.value,{componentStack:C.stack,digest:C.digest});if(up)throw up=!1,a=f1,f1=null,a;return dp&1&&a.tag!==0&&Sc(),B=a.pendingLanes,B&1?a===p1?Ch++:(Ch=0,p1=a):Ch=0,Na(),null}function Sc(){if(Oa!==null){var a=WI(dp),l=gi.transition,f=Pt;try{if(gi.transition=null,Pt=16>a?16:a,Oa===null)var y=!1;else{if(a=Oa,Oa=null,dp=0,Mt&6)throw Error(t(331));var C=Mt;for(Mt|=4,ke=a.current;ke!==null;){var B=ke,U=B.child;if(ke.flags&16){var q=B.deletions;if(q!==null){for(var J=0;J<q.length;J++){var ce=q[J];for(ke=ce;ke!==null;){var we=ke;switch(we.tag){case 0:case 11:case 15:xh(8,we,B)}var Ie=we.child;if(Ie!==null)Ie.return=we,ke=Ie;else for(;ke!==null;){we=ke;var xe=we.sibling,Le=we.return;if(V3(we),we===ce){ke=null;break}if(xe!==null){xe.return=Le,ke=xe;break}ke=Le}}}var ze=B.alternate;if(ze!==null){var Ve=ze.child;if(Ve!==null){ze.child=null;do{var vr=Ve.sibling;Ve.sibling=null,Ve=vr}while(Ve!==null)}}ke=B}}if(B.subtreeFlags&2064&&U!==null)U.return=B,ke=U;else e:for(;ke!==null;){if(B=ke,B.flags&2048)switch(B.tag){case 0:case 11:case 15:xh(9,B,B.return)}var se=B.sibling;if(se!==null){se.return=B.return,ke=se;break e}ke=B.return}}var $=a.current;for(ke=$;ke!==null;){U=ke;var oe=U.child;if(U.subtreeFlags&2064&&oe!==null)oe.return=U,ke=oe;else e:for(U=$;ke!==null;){if(q=ke,q.flags&2048)try{switch(q.tag){case 0:case 11:case 15:op(9,q)}}catch(je){hr(q,q.return,je)}if(q===U){ke=null;break e}var Me=q.sibling;if(Me!==null){Me.return=q.return,ke=Me;break e}ke=q.return}}if(Mt=C,Na(),$e&&typeof $e.onPostCommitFiberRoot=="function")try{$e.onPostCommitFiberRoot(jt,a)}catch{}y=!0}return y}finally{Pt=f,gi.transition=l}}return!1}function aM(a,l,f){l=wc(f,l),l=I3(a,l,1),a=Pa(a,l,1),l=gn(),a!==null&&(Xu(a,1,l),kn(a,l))}function hr(a,l,f){if(a.tag===3)aM(a,a,f);else for(;l!==null;){if(l.tag===3){aM(l,a,f);break}else if(l.tag===1){var y=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Qa===null||!Qa.has(y))){a=wc(f,a),a=C3(l,a,1),l=Pa(l,a,1),a=gn(),l!==null&&(Xu(l,1,a),kn(l,a));break}}l=l.return}}function dQ(a,l,f){var y=a.pingCache;y!==null&&y.delete(l),l=gn(),a.pingedLanes|=a.suspendedLanes&f,Gr===a&&(qr&f)===f&&(Lr===4||Lr===3&&(qr&130023424)===qr&&500>We()-d1?Fo(a,0):h1|=f),kn(a,l)}function oM(a,l){l===0&&(a.mode&1?(l=_r,_r<<=1,!(_r&130023424)&&(_r=4194304)):l=1);var f=gn();a=zs(a,l),a!==null&&(Xu(a,l,f),kn(a,f))}function fQ(a){var l=a.memoizedState,f=0;l!==null&&(f=l.retryLane),oM(a,f)}function pQ(a,l){var f=0;switch(a.tag){case 13:var y=a.stateNode,C=a.memoizedState;C!==null&&(f=C.retryLane);break;case 19:y=a.stateNode;break;default:throw Error(t(314))}y!==null&&y.delete(l),oM(a,f)}var lM;lM=function(a,l,f){if(a!==null)if(a.memoizedProps!==l.pendingProps||Ln.current)Un=!0;else{if(!(a.lanes&f)&&!(l.flags&128))return Un=!1,tQ(a,l,f);Un=!!(a.flags&131072)}else Un=!1,tr&&l.flags&1048576&&FC(l,Vf,l.index);switch(l.lanes=0,l.tag){case 2:var y=l.type;sp(a,l),a=l.pendingProps;var C=Ac(l,tn.current);yc(l,f),C=j0(null,l,y,a,C,f);var B=W0();return l.flags|=1,typeof C=="object"&&C!==null&&typeof C.render=="function"&&C.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,Nn(y)?(B=!0,zf(l)):B=!1,l.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,P0(l),C.updater=Kf,l.stateNode=C,C._reactInternals=l,Q0(l,y,a,f),l=e1(null,l,y,!0,B,f)):(l.tag=0,tr&&B&&M0(l),An(null,l,C,f),l=l.child),l;case 16:y=l.elementType;e:{switch(sp(a,l),a=l.pendingProps,C=y._init,y=C(y._payload),l.type=y,C=l.tag=gQ(y),a=ki(y,a),C){case 0:l=$0(null,l,y,a,f);break e;case 1:l=N3(null,l,y,a,f);break e;case 11:l=B3(null,l,y,a,f);break e;case 14:l=b3(null,l,y,ki(y.type,a),f);break e}throw Error(t(306,y,""))}return l;case 0:return y=l.type,C=l.pendingProps,C=l.elementType===y?C:ki(y,C),$0(a,l,y,C,f);case 1:return y=l.type,C=l.pendingProps,C=l.elementType===y?C:ki(y,C),N3(a,l,y,C,f);case 3:e:{if(U3(l),a===null)throw Error(t(387));y=l.pendingProps,B=l.memoizedState,C=B.element,WC(a,l),Xf(l,y,null,f);var U=l.memoizedState;if(y=U.element,B.isDehydrated)if(B={element:y,isDehydrated:!1,cache:U.cache,pendingSuspenseBoundaries:U.pendingSuspenseBoundaries,transitions:U.transitions},l.updateQueue.baseState=B,l.memoizedState=B,l.flags&256){C=wc(Error(t(423)),l),l=P3(a,l,y,f,C);break e}else if(y!==C){C=wc(Error(t(424)),l),l=P3(a,l,y,f,C);break e}else for($n=Ra(l.stateNode.containerInfo.firstChild),Zn=l,tr=!0,Pi=null,f=t3(l,null,y,f),l.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(_c(),y===C){l=Gs(a,l,f);break e}An(a,l,y,f)}l=l.child}return l;case 5:return r3(l),a===null&&B0(l),y=l.type,C=l.pendingProps,B=a!==null?a.memoizedProps:null,U=C.children,y0(y,C)?U=null:B!==null&&y0(y,B)&&(l.flags|=32),L3(a,l),An(a,l,U,f),l.child;case 6:return a===null&&B0(l),null;case 13:return k3(a,l,f);case 4:return O0(l,l.stateNode.containerInfo),y=l.pendingProps,a===null?l.child=Ec(l,null,y,f):An(a,l,y,f),l.child;case 11:return y=l.type,C=l.pendingProps,C=l.elementType===y?C:ki(y,C),B3(a,l,y,C,f);case 7:return An(a,l,l.pendingProps,f),l.child;case 8:return An(a,l,l.pendingProps.children,f),l.child;case 12:return An(a,l,l.pendingProps.children,f),l.child;case 10:e:{if(y=l.type._context,C=l.pendingProps,B=l.memoizedProps,U=C.value,Wt(Wf,y._currentValue),y._currentValue=U,B!==null)if(Ui(B.value,U)){if(B.children===C.children&&!Ln.current){l=Gs(a,l,f);break e}}else for(B=l.child,B!==null&&(B.return=l);B!==null;){var q=B.dependencies;if(q!==null){U=B.child;for(var J=q.firstContext;J!==null;){if(J.context===y){if(B.tag===1){J=Hs(-1,f&-f),J.tag=2;var ce=B.updateQueue;if(ce!==null){ce=ce.shared;var we=ce.pending;we===null?J.next=J:(J.next=we.next,we.next=J),ce.pending=J}}B.lanes|=f,J=B.alternate,J!==null&&(J.lanes|=f),N0(B.return,f,l),q.lanes|=f;break}J=J.next}}else if(B.tag===10)U=B.type===l.type?null:B.child;else if(B.tag===18){if(U=B.return,U===null)throw Error(t(341));U.lanes|=f,q=U.alternate,q!==null&&(q.lanes|=f),N0(U,f,l),U=B.sibling}else U=B.child;if(U!==null)U.return=B;else for(U=B;U!==null;){if(U===l){U=null;break}if(B=U.sibling,B!==null){B.return=U.return,U=B;break}U=U.return}B=U}An(a,l,C.children,f),l=l.child}return l;case 9:return C=l.type,y=l.pendingProps.children,yc(l,f),C=pi(C),y=y(C),l.flags|=1,An(a,l,y,f),l.child;case 14:return y=l.type,C=ki(y,l.pendingProps),C=ki(y.type,C),b3(a,l,y,C,f);case 15:return R3(a,l,l.type,l.pendingProps,f);case 17:return y=l.type,C=l.pendingProps,C=l.elementType===y?C:ki(y,C),sp(a,l),l.tag=1,Nn(y)?(a=!0,zf(l)):a=!1,yc(l,f),JC(l,y,C),Q0(l,y,C,f),e1(null,l,y,!0,a,f);case 19:return O3(a,l,f);case 22:return D3(a,l,f)}throw Error(t(156,l.tag))};function cM(a,l){return Be(a,l)}function AQ(a,l,f,y){this.tag=a,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mi(a,l,f,y){return new AQ(a,l,f,y)}function y1(a){return a=a.prototype,!(!a||!a.isReactComponent)}function gQ(a){if(typeof a=="function")return y1(a)?1:0;if(a!=null){if(a=a.$$typeof,a===P)return 11;if(a===X)return 14}return 2}function Ha(a,l){var f=a.alternate;return f===null?(f=mi(a.tag,l,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=l,f.type=a.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=a.flags&14680064,f.childLanes=a.childLanes,f.lanes=a.lanes,f.child=a.child,f.memoizedProps=a.memoizedProps,f.memoizedState=a.memoizedState,f.updateQueue=a.updateQueue,l=a.dependencies,f.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f}function gp(a,l,f,y,C,B){var U=2;if(y=a,typeof a=="function")y1(a)&&(U=1);else if(typeof a=="string")U=5;else e:switch(a){case T:return Ho(f.children,C,B,l);case D:U=8,C|=8;break;case b:return a=mi(12,f,l,C|2),a.elementType=b,a.lanes=B,a;case N:return a=mi(13,f,l,C),a.elementType=N,a.lanes=B,a;case j:return a=mi(19,f,l,C),a.elementType=j,a.lanes=B,a;case ne:return mp(f,C,B,l);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case M:U=10;break e;case L:U=9;break e;case P:U=11;break e;case X:U=14;break e;case K:U=16,y=null;break e}throw Error(t(130,a==null?a:typeof a,""))}return l=mi(U,f,l,C),l.elementType=a,l.type=y,l.lanes=B,l}function Ho(a,l,f,y){return a=mi(7,a,y,l),a.lanes=f,a}function mp(a,l,f,y){return a=mi(22,a,y,l),a.elementType=ne,a.lanes=f,a.stateNode={isHidden:!1},a}function E1(a,l,f){return a=mi(6,a,null,l),a.lanes=f,a}function x1(a,l,f){return l=mi(4,a.children!==null?a.children:[],a.key,l),l.lanes=f,l.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},l}function mQ(a,l,f,y,C){this.tag=l,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Xm(0),this.expirationTimes=Xm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xm(0),this.identifierPrefix=y,this.onRecoverableError=C,this.mutableSourceEagerHydrationData=null}function w1(a,l,f,y,C,B,U,q,J){return a=new mQ(a,l,f,q,J),l===1?(l=1,B===!0&&(l|=8)):l=0,B=mi(3,null,null,l),a.current=B,B.stateNode=a,B.memoizedState={element:y,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},P0(B),a}function _Q(a,l,f){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:S,key:y==null?null:""+y,children:a,containerInfo:l,implementation:f}}function uM(a){if(!a)return La;a=a._reactInternals;e:{if(Us(a)!==a||a.tag!==1)throw Error(t(170));var l=a;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(Nn(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(t(171))}if(a.tag===1){var f=a.type;if(Nn(f))return kC(a,f,l)}return l}function hM(a,l,f,y,C,B,U,q,J){return a=w1(f,y,!0,a,C,B,U,q,J),a.context=uM(null),f=a.current,y=gn(),C=Fa(f),B=Hs(y,C),B.callback=l??null,Pa(f,B,C),a.current.lanes=C,Xu(a,C,y),kn(a,y),a}function _p(a,l,f,y){var C=l.current,B=gn(),U=Fa(C);return f=uM(f),l.context===null?l.context=f:l.pendingContext=f,l=Hs(B,U),l.payload={element:a},y=y===void 0?null:y,y!==null&&(l.callback=y),a=Pa(C,l,U),a!==null&&(Fi(a,C,U,B),qf(a,C,U)),U}function vp(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function dM(a,l){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<l?f:l}}function I1(a,l){dM(a,l),(a=a.alternate)&&dM(a,l)}function vQ(){return null}var fM=typeof reportError=="function"?reportError:function(a){console.error(a)};function C1(a){this._internalRoot=a}yp.prototype.render=C1.prototype.render=function(a){var l=this._internalRoot;if(l===null)throw Error(t(409));_p(a,l,null,null)},yp.prototype.unmount=C1.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var l=a.containerInfo;Oo(function(){_p(null,a,null,null)}),l[ks]=null}};function yp(a){this._internalRoot=a}yp.prototype.unstable_scheduleHydration=function(a){if(a){var l=XI();a={blockedOn:null,target:a,priority:l};for(var f=0;f<Ta.length&&l!==0&&l<Ta[f].priority;f++);Ta.splice(f,0,a),f===0&&ZI(a)}};function M1(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function Ep(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function pM(){}function yQ(a,l,f,y,C){if(C){if(typeof y=="function"){var B=y;y=function(){var ce=vp(U);B.call(ce)}}var U=hM(l,y,a,0,null,!1,!1,"",pM);return a._reactRootContainer=U,a[ks]=U.current,ch(a.nodeType===8?a.parentNode:a),Oo(),U}for(;C=a.lastChild;)a.removeChild(C);if(typeof y=="function"){var q=y;y=function(){var ce=vp(J);q.call(ce)}}var J=w1(a,0,!1,null,null,!1,!1,"",pM);return a._reactRootContainer=J,a[ks]=J.current,ch(a.nodeType===8?a.parentNode:a),Oo(function(){_p(l,J,f,y)}),J}function xp(a,l,f,y,C){var B=f._reactRootContainer;if(B){var U=B;if(typeof C=="function"){var q=C;C=function(){var J=vp(U);q.call(J)}}_p(l,U,a,C)}else U=yQ(f,l,a,C,y);return vp(U)}YI=function(a){switch(a.tag){case 3:var l=a.stateNode;if(l.current.memoizedState.isDehydrated){var f=Rn(l.pendingLanes);f!==0&&(Km(l,f|1),kn(l,We()),!(Mt&6)&&(Mc=We()+500,Na()))}break;case 13:Oo(function(){var y=zs(a,1);if(y!==null){var C=gn();Fi(y,a,1,C)}}),I1(a,1)}},Jm=function(a){if(a.tag===13){var l=zs(a,134217728);if(l!==null){var f=gn();Fi(l,a,134217728,f)}I1(a,134217728)}},qI=function(a){if(a.tag===13){var l=Fa(a),f=zs(a,l);if(f!==null){var y=gn();Fi(f,a,l,y)}I1(a,l)}},XI=function(){return Pt},KI=function(a,l){var f=Pt;try{return Pt=a,l()}finally{Pt=f}},_e=function(a,l,f){switch(l){case"input":if(Y(a,f),l=f.name,f.type==="radio"&&l!=null){for(f=a;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<f.length;l++){var y=f[l];if(y!==a&&y.form===a.form){var C=Of(y);if(!C)throw Error(t(90));rt(y),Y(y,C)}}}break;case"textarea":Ee(a,f);break;case"select":l=f.value,l!=null&&pe(a,!!f.multiple,l,!1)}},St=m1,At=Oo;var EQ={usingClientEntryPoint:!1,Events:[dh,fc,Of,Dt,Lt,m1]},Mh={findFiberByHostInstance:Ro,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},xQ={bundleType:Mh.bundleType,version:Mh.version,rendererPackageName:Mh.rendererPackageName,rendererConfig:Mh.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:I.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=de(a),a===null?null:a.stateNode},findFiberByHostInstance:Mh.findFiberByHostInstance||vQ,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var wp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wp.isDisabled&&wp.supportsFiber)try{jt=wp.inject(xQ),$e=wp}catch{}}return Tn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=EQ,Tn.createPortal=function(a,l){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!M1(l))throw Error(t(200));return _Q(a,l,null,f)},Tn.createRoot=function(a,l){if(!M1(a))throw Error(t(299));var f=!1,y="",C=fM;return l!=null&&(l.unstable_strictMode===!0&&(f=!0),l.identifierPrefix!==void 0&&(y=l.identifierPrefix),l.onRecoverableError!==void 0&&(C=l.onRecoverableError)),l=w1(a,1,!1,null,null,f,!1,y,C),a[ks]=l.current,ch(a.nodeType===8?a.parentNode:a),new C1(l)},Tn.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var l=a._reactInternals;if(l===void 0)throw typeof a.render=="function"?Error(t(188)):(a=Object.keys(a).join(","),Error(t(268,a)));return a=de(l),a=a===null?null:a.stateNode,a},Tn.flushSync=function(a){return Oo(a)},Tn.hydrate=function(a,l,f){if(!Ep(l))throw Error(t(200));return xp(null,a,l,!0,f)},Tn.hydrateRoot=function(a,l,f){if(!M1(a))throw Error(t(405));var y=f!=null&&f.hydratedSources||null,C=!1,B="",U=fM;if(f!=null&&(f.unstable_strictMode===!0&&(C=!0),f.identifierPrefix!==void 0&&(B=f.identifierPrefix),f.onRecoverableError!==void 0&&(U=f.onRecoverableError)),l=hM(l,null,a,1,f??null,C,!1,B,U),a[ks]=l.current,ch(a),y)for(a=0;a<y.length;a++)f=y[a],C=f._getVersion,C=C(f._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[f,C]:l.mutableSourceEagerHydrationData.push(f,C);return new yp(l)},Tn.render=function(a,l,f){if(!Ep(l))throw Error(t(200));return xp(null,a,l,!1,f)},Tn.unmountComponentAtNode=function(a){if(!Ep(a))throw Error(t(40));return a._reactRootContainer?(Oo(function(){xp(null,null,a,!1,function(){a._reactRootContainer=null,a[ks]=null})}),!0):!1},Tn.unstable_batchedUpdates=m1,Tn.unstable_renderSubtreeIntoContainer=function(a,l,f,y){if(!Ep(f))throw Error(t(200));if(a==null||a._reactInternals===void 0)throw Error(t(38));return xp(a,l,f,!1,y)},Tn.version="18.2.0-next-9e3b772b8-20220608",Tn}function RI(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(RI)}catch(r){console.error(r)}}RI(),SI.exports=Mk();var Sk=SI.exports,DI=Sk;Hm.createRoot=DI.createRoot,Hm.hydrateRoot=DI.hydrateRoot;class Tk{constructor({apiService:e,events:t}){Bt(this,"targetElement");Bt(this,"apiService");Bt(this,"events");Bt(this,"htmlTarget");this.apiService=e,this.events=t}mount(e,t){if(!this.targetElement){const n=t.customId??"dita-3dconfig-element",i=document.getElementById(n);if(!i)throw new Error(`Element not found with id => '${n}' `);this.htmlTarget=i,this.htmlTarget.style.height="100%",this.htmlTarget.style.width="100%",this.targetElement=Hm.createRoot(document.getElementById(n))}this.targetElement.render(Sh.createElement(wk,{apiService:this.apiService,events:this.events,sku:e,viewerOnly:t.viewerOnly}))}unmount(){this.targetElement&&(this.targetElement.unmount(),this.targetElement=void 0,this.htmlTarget&&(this.htmlTarget.style.height="0px",this.htmlTarget.style.width="auto"))}}var jm={exports:{}},ic=typeof Reflect=="object"?Reflect:null,LI=ic&&typeof ic.apply=="function"?ic.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},yf;ic&&typeof ic.ownKeys=="function"?yf=ic.ownKeys:Object.getOwnPropertySymbols?yf=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:yf=function(e){return Object.getOwnPropertyNames(e)};function Bk(r){console&&console.warn&&console.warn(r)}var NI=Number.isNaN||function(e){return e!==e};function Ot(){Ot.init.call(this)}jm.exports=Ot,jm.exports.once=Lk,Ot.EventEmitter=Ot,Ot.prototype._events=void 0,Ot.prototype._eventsCount=0,Ot.prototype._maxListeners=void 0;var UI=10;function Ef(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(Ot,"defaultMaxListeners",{enumerable:!0,get:function(){return UI},set:function(r){if(typeof r!="number"||r<0||NI(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");UI=r}}),Ot.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Ot.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||NI(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function PI(r){return r._maxListeners===void 0?Ot.defaultMaxListeners:r._maxListeners}Ot.prototype.getMaxListeners=function(){return PI(this)},Ot.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e==="error",s=this._events;if(s!==void 0)i=i&&s.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var c=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw c.context=o,c}var h=s[e];if(h===void 0)return!1;if(typeof h=="function")LI(h,this,t);else for(var u=h.length,d=zI(h,u),n=0;n<u;++n)LI(d[n],this,t);return!0};function kI(r,e,t,n){var i,s,o;if(Ef(t),s=r._events,s===void 0?(s=r._events=Object.create(null),r._eventsCount=0):(s.newListener!==void 0&&(r.emit("newListener",e,t.listener?t.listener:t),s=r._events),o=s[e]),o===void 0)o=s[e]=t,++r._eventsCount;else if(typeof o=="function"?o=s[e]=n?[t,o]:[o,t]:n?o.unshift(t):o.push(t),i=PI(r),i>0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=r,c.type=e,c.count=o.length,Bk(c)}return r}Ot.prototype.addListener=function(e,t){return kI(this,e,t,!1)},Ot.prototype.on=Ot.prototype.addListener,Ot.prototype.prependListener=function(e,t){return kI(this,e,t,!0)};function bk(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function QI(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},i=bk.bind(n);return i.listener=t,n.wrapFn=i,i}Ot.prototype.once=function(e,t){return Ef(t),this.on(e,QI(this,e,t)),this},Ot.prototype.prependOnceListener=function(e,t){return Ef(t),this.prependListener(e,QI(this,e,t)),this},Ot.prototype.removeListener=function(e,t){var n,i,s,o,c;if(Ef(t),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){c=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():Rk(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,c||t)}return this},Ot.prototype.off=Ot.prototype.removeListener,Ot.prototype.removeAllListeners=function(e){var t,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i<s.length;++i)o=s[i],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this};function OI(r,e,t){var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?Dk(i):zI(i,i.length)}Ot.prototype.listeners=function(e){return OI(this,e,!0)},Ot.prototype.rawListeners=function(e){return OI(this,e,!1)},Ot.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):FI.call(r,e)},Ot.prototype.listenerCount=FI;function FI(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}Ot.prototype.eventNames=function(){return this._eventsCount>0?yf(this._events):[]};function zI(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n];return t}function Rk(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()}function Dk(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}function Lk(r,e){return new Promise(function(t,n){function i(o){r.removeListener(e,s),n(o)}function s(){typeof r.removeListener=="function"&&r.removeListener("error",i),t([].slice.call(arguments))}HI(r,e,s,{once:!0}),e!=="error"&&Nk(r,i,{once:!0})})}function Nk(r,e,t){typeof r.on=="function"&&HI(r,"error",e,t)}function HI(r,e,t,n){if(typeof r.on=="function")n.once?r.once(e,t):r.on(e,t);else if(typeof r.addEventListener=="function")r.addEventListener(e,function i(s){n.once&&r.removeEventListener(e,i),t(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r)}var Uk=jm.exports;const Vu=class Vu extends Uk.EventEmitter{emitEvent(e,t){Object.keys(Vu.EVENTS).includes(e)&&this.emit(Vu.EVENTS[e],t)}};Bt(Vu,"EVENTS",{onAddToCart:"add-to-cart"});let Wm=Vu;const Pk={getCartUrl:((VI=window.Shopify)==null?void 0:VI.routes.root)+"cart.js",addToCartUrl:((jI=window.Shopify)==null?void 0:jI.routes.root)+"cart/add.js"},GI=Object.freeze(Pk);class kk{constructor(e){Bt(this,"config");this.config=e}RequestOptions(e,t){return{method:e,headers:{Accept:"application/json","Content-Type":"application/json"},...e==="POST"&&{body:JSON.stringify(t)}}}async Get(){return(await fetch(this.config.getCartUrl,this.RequestOptions("GET"))).json()}async Post(e){return(await fetch(this.config.addToCartUrl,this.RequestOptions("POST",e||{}))).json()}}const{log:Qk,error:Ok}=console,Fk=(...r)=>{Ok("❌ Sprie Error:",...r)},zk="&ui_animations=0&ui_infos=0&ui_stop=0&ui_inspector=0&ui_watermark_link=0&ui_watermark=0&ui_ar=0&ui_help=0&ui_settings=0&ui_vr=0&ui_fullscreen=0&ui_annotations=0&ui_start=0&",Hk={HOST:ls.host,STORE_PREFIX:ls.storePrefix},Gk={addToCartUrl:GI.addToCartUrl,getCartUrl:GI.getCartUrl};class Vk{constructor(){Bt(this,"sdkService");Bt(this,"apiService");Bt(this,"uiService");Bt(this,"events");this.events=new Wm,this.apiService=new mM(new Va(Hk),new kk(Gk)),this.uiService=new Tk({apiService:this.apiService,events:this.events});const e={apiService:this.apiService,config:ls,log:Qk,logErr:Fk,metaData:{appVersion:AM,previewUrlPrams:zk,targetClassName:"sprie-embed-element"}};this.sdkService=new _M(e),this.sdkService.Init()}load(e,t){this.uiService.unmount(),this.uiService.mount(e,{viewerOnly:!1,customId:t})}loadViewerOnly(e,t){this.uiService.unmount(),this.uiService.mount(e,{viewerOnly:!0,customId:t})}unload(){this.uiService.unmount()}}window.ditaConfigurator=new Vk})();