(function(Zt,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue"),require("@abi-software/map-utilities"),require("@abi-software/svg-sprite")):typeof define=="function"&&define.amd?define(["exports","vue","@abi-software/map-utilities","@abi-software/svg-sprite"],a):(Zt=typeof globalThis<"u"?globalThis:Zt||self,a(Zt.ScaffoldVuer={},Zt.Vue,Zt["@abi-software/map-utilities"],Zt["@abi-software/svg-sprite"]))})(this,function(Zt,a,Ja,ep){"use strict";const di=(n,e,{checkForDefaultPrevented:t=!0}={})=>r=>{const s=n==null?void 0:n(r);if(t===!1||!s)return e==null?void 0:e(r)};var rw=Object.defineProperty,sw=Object.defineProperties,ow=Object.getOwnPropertyDescriptors,tp=Object.getOwnPropertySymbols,aw=Object.prototype.hasOwnProperty,lw=Object.prototype.propertyIsEnumerable,np=(n,e,t)=>e in n?rw(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,cw=(n,e)=>{for(var t in e||(e={}))aw.call(e,t)&&np(n,t,e[t]);if(tp)for(var t of tp(e))lw.call(e,t)&&np(n,t,e[t]);return n},uw=(n,e)=>sw(n,ow(e));function ip(n,e){var t;const i=a.shallowRef();return a.watchEffect(()=>{i.value=n()},uw(cw({},e),{flush:(t=void 0)!=null?t:"sync"})),a.readonly(i)}var rp;const Ft=typeof window<"u",dw=n=>typeof n=="string",sp=()=>{},au=Ft&&((rp=window==null?void 0:window.navigator)==null?void 0:rp.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function op(n){return typeof n=="function"?n():a.unref(n)}function hw(n){return n}function qa(n){return a.getCurrentScope()?(a.onScopeDispose(n),!0):!1}function fw(n,e=!0){a.getCurrentInstance()?a.onMounted(n):e?n():a.nextTick(n)}function hi(n){var e;const t=op(n);return(e=t==null?void 0:t.$el)!=null?e:t}const Io=Ft?window:void 0,pw=Ft?window.document:void 0;function Gt(...n){let e,t,i,r;if(dw(n[0])||Array.isArray(n[0])?([t,i,r]=n,e=Io):[e,t,i,r]=n,!e)return sp;Array.isArray(t)||(t=[t]),Array.isArray(i)||(i=[i]);const s=[],o=()=>{s.forEach(f=>f()),s.length=0},l=(f,h,m,y)=>(f.addEventListener(h,m,y),()=>f.removeEventListener(h,m,y)),u=a.watch(()=>[hi(e),op(r)],([f,h])=>{o(),f&&s.push(...t.flatMap(m=>i.map(y=>l(f,m,y,h))))},{immediate:!0,flush:"post"}),c=()=>{u(),o()};return qa(c),c}let ap=!1;function mw(n,e,t={}){const{window:i=Io,ignore:r=[],capture:s=!0,detectIframe:o=!1}=t;if(!i)return;au&&!ap&&(ap=!0,Array.from(i.document.body.children).forEach(m=>m.addEventListener("click",sp)));let l=!0;const u=m=>r.some(y=>{if(typeof y=="string")return Array.from(i.document.querySelectorAll(y)).some(p=>p===m.target||m.composedPath().includes(p));{const p=hi(y);return p&&(m.target===p||m.composedPath().includes(p))}}),f=[Gt(i,"click",m=>{const y=hi(n);if(!(!y||y===m.target||m.composedPath().includes(y))){if(m.detail===0&&(l=!u(m)),!l){l=!0;return}e(m)}},{passive:!0,capture:s}),Gt(i,"pointerdown",m=>{const y=hi(n);y&&(l=!m.composedPath().includes(y)&&!u(m))},{passive:!0}),o&&Gt(i,"blur",m=>{var y;const p=hi(n);((y=i.document.activeElement)==null?void 0:y.tagName)==="IFRAME"&&!(p!=null&&p.contains(i.document.activeElement))&&e(m)})].filter(Boolean);return()=>f.forEach(m=>m())}function lp(n,e=!1){const t=a.ref(),i=()=>t.value=!!n();return i(),fw(i,e),t}const cp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},up="__vueuse_ssr_handlers__";cp[up]=cp[up]||{};function gw({document:n=pw}={}){if(!n)return a.ref("visible");const e=a.ref(n.visibilityState);return Gt(n,"visibilitychange",()=>{e.value=n.visibilityState}),e}var dp=Object.getOwnPropertySymbols,yw=Object.prototype.hasOwnProperty,vw=Object.prototype.propertyIsEnumerable,bw=(n,e)=>{var t={};for(var i in n)yw.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&dp)for(var i of dp(n))e.indexOf(i)<0&&vw.call(n,i)&&(t[i]=n[i]);return t};function Tn(n,e,t={}){const i=t,{window:r=Io}=i,s=bw(i,["window"]);let o;const l=lp(()=>r&&"ResizeObserver"in r),u=()=>{o&&(o.disconnect(),o=void 0)},c=a.watch(()=>hi(n),h=>{u(),l.value&&r&&h&&(o=new ResizeObserver(e),o.observe(h,s))},{immediate:!0,flush:"post"}),f=()=>{u(),c()};return qa(f),{isSupported:l,stop:f}}var hp=Object.getOwnPropertySymbols,xw=Object.prototype.hasOwnProperty,ww=Object.prototype.propertyIsEnumerable,Mw=(n,e)=>{var t={};for(var i in n)xw.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&hp)for(var i of hp(n))e.indexOf(i)<0&&ww.call(n,i)&&(t[i]=n[i]);return t};function Sw(n,e,t={}){const i=t,{window:r=Io}=i,s=Mw(i,["window"]);let o;const l=lp(()=>r&&"MutationObserver"in r),u=()=>{o&&(o.disconnect(),o=void 0)},c=a.watch(()=>hi(n),h=>{u(),l.value&&r&&h&&(o=new MutationObserver(e),o.observe(h,s))},{immediate:!0}),f=()=>{u(),c()};return qa(f),{isSupported:l,stop:f}}var fp;(function(n){n.UP="UP",n.RIGHT="RIGHT",n.DOWN="DOWN",n.LEFT="LEFT",n.NONE="NONE"})(fp||(fp={}));var _w=Object.defineProperty,pp=Object.getOwnPropertySymbols,Tw=Object.prototype.hasOwnProperty,Ew=Object.prototype.propertyIsEnumerable,mp=(n,e,t)=>e in n?_w(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Cw=(n,e)=>{for(var t in e||(e={}))Tw.call(e,t)&&mp(n,t,e[t]);if(pp)for(var t of pp(e))Ew.call(e,t)&&mp(n,t,e[t]);return n};Cw({linear:hw},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});function Aw({window:n=Io}={}){if(!n)return a.ref(!1);const e=a.ref(n.document.hasFocus());return Gt(n,"blur",()=>{e.value=!1}),Gt(n,"focus",()=>{e.value=!0}),e}const Lw=()=>Ft&&/firefox/i.test(window.navigator.userAgent);/** * @vue/shared v3.5.11 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const Oo=()=>{},Rw=Object.prototype.hasOwnProperty,gp=(n,e)=>Rw.call(n,e),dn=Array.isArray,en=n=>typeof n=="function",on=n=>typeof n=="string",an=n=>n!==null&&typeof n=="object",Pw=Object.prototype.toString,Iw=n=>Pw.call(n),lu=n=>Iw(n).slice(8,-1),cu=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},Ow=/-(\w)/g,Nw=cu(n=>n.replace(Ow,(e,t)=>t?t.toUpperCase():"")),Dw=/\B([A-Z])/g,Bw=cu(n=>n.replace(Dw,"-$1").toLowerCase()),Fw=cu(n=>n.charAt(0).toUpperCase()+n.slice(1));var yp=typeof global=="object"&&global&&global.Object===Object&&global,Vw=typeof self=="object"&&self&&self.Object===Object&&self,Zn=yp||Vw||Function("return this")(),Xn=Zn.Symbol,vp=Object.prototype,kw=vp.hasOwnProperty,zw=vp.toString,No=Xn?Xn.toStringTag:void 0;function Uw(n){var e=kw.call(n,No),t=n[No];try{n[No]=void 0;var i=!0}catch{}var r=zw.call(n);return i&&(e?n[No]=t:delete n[No]),r}var Gw=Object.prototype,Hw=Gw.toString;function Ww(n){return Hw.call(n)}var jw="[object Null]",$w="[object Undefined]",bp=Xn?Xn.toStringTag:void 0;function fs(n){return n==null?n===void 0?$w:jw:bp&&bp in Object(n)?Uw(n):Ww(n)}function ps(n){return n!=null&&typeof n=="object"}var Zw="[object Symbol]";function Ka(n){return typeof n=="symbol"||ps(n)&&fs(n)==Zw}function Xw(n,e){for(var t=-1,i=n==null?0:n.length,r=Array(i);++t0){if(++e>=w1)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function T1(n){return function(){return n}}var Qa=function(){try{var n=Er(Object,"defineProperty");return n({},"",{}),n}catch{}}(),E1=Qa?function(n,e){return Qa(n,"toString",{configurable:!0,enumerable:!1,value:T1(e),writable:!0})}:Tp,C1=_1(E1);function A1(n,e,t,i){n.length;for(var r=t+1;r--;)if(e(n[r],r,n))return r;return-1}var L1=9007199254740991,R1=/^(?:0|[1-9]\d*)$/;function hu(n,e){var t=typeof n;return e=e??L1,!!e&&(t=="number"||t!="symbol"&&R1.test(n))&&n>-1&&n%1==0&&n-1&&n%1==0&&n<=B1}function F1(n){return n!=null&&pu(n.length)&&!Ep(n)}var V1=Object.prototype;function k1(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||V1;return n===t}function z1(n,e){for(var t=-1,i=Array(n);++t-1}function ZM(n,e){var t=this.__data__,i=el(t,n);return i<0?(++this.size,t.push([n,e])):t[i][1]=e,this}function fi(n){var e=-1,t=n==null?0:n.length;for(this.clear();++el))return!1;var c=s.get(n),f=s.get(e);if(c&&f)return c==e&&f==n;var h=-1,m=!0,y=t&BS?new il:void 0;for(s.set(n,e),s.set(e,n);++h=e||w<0||h&&T>=s}function v(){var S=Tu();if(b(S))return g(S);l=setTimeout(v,d(S))}function g(S){return l=void 0,m&&i?y(S):(i=r=void 0,o)}function M(){l!==void 0&&clearTimeout(l),c=0,i=u=r=l=void 0}function _(){return l===void 0?o:g(Tu())}function E(){var S=Tu(),w=b(S);if(i=arguments,r=this,u=S,w){if(l===void 0)return p(u);if(h)return clearTimeout(l),l=setTimeout(v,e),y(u)}return l===void 0&&(l=setTimeout(v,e)),o}return E.cancel=M,E.flush=_,E}function S_(n,e,t){var i=n==null?0:n.length;if(!i)return-1;var r=i-1;return A1(n,b_(e),r)}function ol(n){for(var e=-1,t=n==null?0:n.length,i={};++en===void 0,Au=n=>typeof n=="boolean",rt=n=>typeof n=="number",Ar=n=>typeof Element>"u"?!1:n instanceof Element,L_=n=>on(n)?!Number.isNaN(Number(n)):!1,R_=(n="")=>n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),Hi=n=>Fw(n),im=n=>Object.keys(n);class rm extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function ms(n,e){throw new rm(`[${n}] ${e}`)}function Ct(n,e){if(process.env.NODE_ENV!=="production"){const t=on(n)?new rm(`[${n}] ${e}`):n;console.warn(t)}}const P_="utils/dom/style",sm=(n="")=>n.split(" ").filter(e=>!!e.trim()),om=(n,e)=>{!n||!e.trim()||n.classList.add(...sm(e))},al=(n,e)=>{!n||!e.trim()||n.classList.remove(...sm(e))},ko=(n,e)=>{var t;if(!Ft||!n||!e)return"";let i=Nw(e);i==="float"&&(i="cssFloat");try{const r=n.style[i];if(r)return r;const s=(t=document.defaultView)==null?void 0:t.getComputedStyle(n,"");return s?s[i]:""}catch{return n.style[i]}};function ll(n,e="px"){if(!n)return"";if(rt(n)||L_(n))return`${n}${e}`;if(on(n))return n;Ct(P_,"binding value must be a string or number")}function I_(n,e){if(!Ft)return;if(!e){n.scrollTop=0;return}const t=[];let i=e.offsetParent;for(;i!==null&&n!==i&&n.contains(i);)t.push(i),i=i.offsetParent;const r=e.offsetTop+t.reduce((u,c)=>u+c.offsetTop,0),s=r+e.offsetHeight,o=n.scrollTop,l=o+n.clientHeight;rl&&(n.scrollTop=s-n.clientHeight)}/*! Element Plus Icons Vue v2.3.1 */var O_=a.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"})]))}}),Lu=O_,N_=a.defineComponent({name:"ArrowLeft",__name:"arrow-left",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"})]))}}),Wi=N_,D_=a.defineComponent({name:"ArrowRight",__name:"arrow-right",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"})]))}}),ji=D_,B_=a.defineComponent({name:"ArrowUp",__name:"arrow-up",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"})]))}}),F_=B_,V_=a.defineComponent({name:"CircleCheck",__name:"circle-check",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),a.createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"})]))}}),k_=V_,z_=a.defineComponent({name:"CircleClose",__name:"circle-close",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),a.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),Ru=z_,U_=a.defineComponent({name:"Close",__name:"close",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),Pu=U_,G_=a.defineComponent({name:"Delete",__name:"delete",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}}),cl=G_,H_=a.defineComponent({name:"Hide",__name:"hide",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"}),a.createElementVNode("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"})]))}}),W_=H_,j_=a.defineComponent({name:"Loading",__name:"loading",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})]))}}),am=j_,$_=a.defineComponent({name:"Minus",__name:"minus",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64"})]))}}),Z_=$_,X_=a.defineComponent({name:"Plus",__name:"plus",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),ul=X_,Y_=a.defineComponent({name:"View",__name:"view",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),J_=Y_,q_=a.defineComponent({name:"WarningFilled",__name:"warning-filled",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))}}),lm=q_;const cm="__epPropKey",Fe=n=>n,K_=n=>an(n)&&!!n[cm],dl=(n,e)=>{if(!an(n)||K_(n))return n;const{values:t,required:i,default:r,type:s,validator:o}=n,u={type:s,required:!!i,validator:t||o?c=>{let f=!1,h=[];if(t&&(h=Array.from(t),gp(n,"default")&&h.push(r),f||(f=h.includes(c))),o&&(f||(f=o(c))),!f&&h.length>0){const m=[...new Set(h)].map(y=>JSON.stringify(y)).join(", ");a.warn(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${m}], got value ${JSON.stringify(c)}.`)}return f}:void 0,[cm]:!0};return gp(n,"default")&&(u.default=r),u},Ke=n=>ol(Object.entries(n).map(([e,t])=>[e,dl(t,e)])),$i=Fe([String,Object,Function]),um={validating:am,success:k_,error:Ru},Ht=(n,e)=>{if(n.install=t=>{for(const i of[n,...Object.values(e??{})])t.component(i.name,i)},e)for(const[t,i]of Object.entries(e))n[t]=i;return n},Q_=(n,e)=>(n.install=t=>{t.directive(e,n)},n),vi=n=>(n.install=Oo,n),Jn={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},gt="update:modelValue",Zi="change",Lr="input",dm=["","default","small","large"],hl=n=>{const e=dn(n)?n:[n],t=[];return e.forEach(i=>{var r;dn(i)?t.push(...hl(i)):a.isVNode(i)&&dn(i.children)?t.push(...hl(i.children)):(t.push(i),a.isVNode(i)&&((r=i.component)!=null&&r.subTree)&&t.push(...hl(i.component.subTree)))}),t},eT=n=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(n),bi=n=>n,tT=["class","style"],nT=/^on[A-Z]/,iT=(n={})=>{const{excludeListeners:e=!1,excludeKeys:t}=n,i=a.computed(()=>((t==null?void 0:t.value)||[]).concat(tT)),r=a.getCurrentInstance();return r?a.computed(()=>{var s;return ol(Object.entries((s=r.proxy)==null?void 0:s.$attrs).filter(([o])=>!i.value.includes(o)&&!(e&&nT.test(o))))}):(Ct("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),a.computed(()=>({})))},rT=({from:n,replacement:e,scope:t,version:i,ref:r,type:s="API"},o)=>{a.watch(()=>a.unref(o),l=>{l&&Ct(t,`[${s}] ${n} is about to be deprecated in version ${i}, please use ${e} instead. For more detail, please visit: ${r} `)},{immediate:!0})};var sT={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const oT=n=>(e,t)=>aT(e,t,a.unref(n)),aT=(n,e,t)=>mi(t,n,n).replace(/\{(\w+)\}/g,(i,r)=>{var s;return`${(s=e==null?void 0:e[r])!=null?s:`{${r}}`}`}),lT=n=>{const e=a.computed(()=>a.unref(n).name),t=a.isRef(n)?n:a.ref(n);return{lang:e,locale:t,t:oT(n)}},hm=Symbol("localeContextKey"),fl=n=>{const e=n||a.inject(hm,a.ref());return lT(a.computed(()=>e.value||sT))},pl="el",cT="is-",Rr=(n,e,t,i,r)=>{let s=`${n}-${e}`;return t&&(s+=`-${t}`),i&&(s+=`__${i}`),r&&(s+=`--${r}`),s},fm=Symbol("namespaceContextKey"),Iu=n=>{const e=n||(a.getCurrentInstance()?a.inject(fm,a.ref(pl)):a.ref(pl));return a.computed(()=>a.unref(e)||pl)},Ue=(n,e)=>{const t=Iu(e);return{namespace:t,b:(d="")=>Rr(t.value,n,d,"",""),e:d=>d?Rr(t.value,n,"",d,""):"",m:d=>d?Rr(t.value,n,"","",d):"",be:(d,b)=>d&&b?Rr(t.value,n,d,b,""):"",em:(d,b)=>d&&b?Rr(t.value,n,"",d,b):"",bm:(d,b)=>d&&b?Rr(t.value,n,d,"",b):"",bem:(d,b,v)=>d&&b&&v?Rr(t.value,n,d,b,v):"",is:(d,...b)=>{const v=b.length>=1?b[0]:!0;return d&&v?`${cT}${d}`:""},cssVar:d=>{const b={};for(const v in d)d[v]&&(b[`--${t.value}-${v}`]=d[v]);return b},cssVarName:d=>`--${t.value}-${d}`,cssVarBlock:d=>{const b={};for(const v in d)d[v]&&(b[`--${t.value}-${n}-${v}`]=d[v]);return b},cssVarBlockName:d=>`--${t.value}-${n}-${d}`}},uT=dl({type:Fe(Boolean),default:null}),dT=dl({type:Fe(Function)}),hT=n=>{const e=`update:${n}`,t=`onUpdate:${n}`,i=[e],r={[n]:uT,[t]:dT};return{useModelToggle:({indicator:o,toggleReason:l,shouldHideWhenRouteChanges:u,shouldProceed:c,onShow:f,onHide:h})=>{const m=a.getCurrentInstance(),{emit:y}=m,p=m.props,d=a.computed(()=>en(p[t])),b=a.computed(()=>p[n]===null),v=w=>{o.value!==!0&&(o.value=!0,l&&(l.value=w),en(f)&&f(w))},g=w=>{o.value!==!1&&(o.value=!1,l&&(l.value=w),en(h)&&h(w))},M=w=>{if(p.disabled===!0||en(c)&&!c())return;const T=d.value&&Ft;T&&y(e,!0),(b.value||!T)&&v(w)},_=w=>{if(p.disabled===!0||!Ft)return;const T=d.value&&Ft;T&&y(e,!1),(b.value||!T)&&g(w)},E=w=>{Au(w)&&(p.disabled&&w?d.value&&y(e,!1):o.value!==w&&(w?v():g()))},S=()=>{o.value?_():M()};return a.watch(()=>p[n],E),u&&m.appContext.config.globalProperties.$route!==void 0&&a.watch(()=>({...m.proxy.$route}),()=>{u.value&&o.value&&_()}),a.onMounted(()=>{E(p[n])}),{hide:_,show:M,toggle:S,hasUpdateHandler:d}},useModelToggleProps:r,useModelToggleEmits:i}},pm=n=>{const e=a.getCurrentInstance();return a.computed(()=>{var t,i;return(i=(t=e==null?void 0:e.proxy)==null?void 0:t.$props)==null?void 0:i[n]})};var hn="top",En="bottom",Cn="right",fn="left",Ou="auto",zo=[hn,En,Cn,fn],gs="start",Uo="end",fT="clippingParents",mm="viewport",Go="popper",pT="reference",gm=zo.reduce(function(n,e){return n.concat([e+"-"+gs,e+"-"+Uo])},[]),ys=[].concat(zo,[Ou]).reduce(function(n,e){return n.concat([e,e+"-"+gs,e+"-"+Uo])},[]),mT="beforeRead",gT="read",yT="afterRead",vT="beforeMain",bT="main",xT="afterMain",wT="beforeWrite",MT="write",ST="afterWrite",_T=[mT,gT,yT,vT,bT,xT,wT,MT,ST];function qn(n){return n?(n.nodeName||"").toLowerCase():null}function Nn(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function vs(n){var e=Nn(n).Element;return n instanceof e||n instanceof Element}function An(n){var e=Nn(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function Nu(n){if(typeof ShadowRoot>"u")return!1;var e=Nn(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function TT(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},r=e.attributes[t]||{},s=e.elements[t];!An(s)||!qn(s)||(Object.assign(s.style,i),Object.keys(r).forEach(function(o){var l=r[o];l===!1?s.removeAttribute(o):s.setAttribute(o,l===!0?"":l)}))})}function ET(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var r=e.elements[i],s=e.attributes[i]||{},o=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),l=o.reduce(function(u,c){return u[c]="",u},{});!An(r)||!qn(r)||(Object.assign(r.style,l),Object.keys(s).forEach(function(u){r.removeAttribute(u)}))})}}var ym={name:"applyStyles",enabled:!0,phase:"write",fn:TT,effect:ET,requires:["computeStyles"]};function Kn(n){return n.split("-")[0]}var Pr=Math.max,ml=Math.min,bs=Math.round;function xs(n,e){e===void 0&&(e=!1);var t=n.getBoundingClientRect(),i=1,r=1;if(An(n)&&e){var s=n.offsetHeight,o=n.offsetWidth;o>0&&(i=bs(t.width)/o||1),s>0&&(r=bs(t.height)/s||1)}return{width:t.width/i,height:t.height/r,top:t.top/r,right:t.right/i,bottom:t.bottom/r,left:t.left/i,x:t.left/i,y:t.top/r}}function Du(n){var e=xs(n),t=n.offsetWidth,i=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:i}}function vm(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&Nu(t)){var i=e;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function xi(n){return Nn(n).getComputedStyle(n)}function CT(n){return["table","td","th"].indexOf(qn(n))>=0}function Xi(n){return((vs(n)?n.ownerDocument:n.document)||window.document).documentElement}function gl(n){return qn(n)==="html"?n:n.assignedSlot||n.parentNode||(Nu(n)?n.host:null)||Xi(n)}function bm(n){return!An(n)||xi(n).position==="fixed"?null:n.offsetParent}function AT(n){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,t=navigator.userAgent.indexOf("Trident")!==-1;if(t&&An(n)){var i=xi(n);if(i.position==="fixed")return null}var r=gl(n);for(Nu(r)&&(r=r.host);An(r)&&["html","body"].indexOf(qn(r))<0;){var s=xi(r);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return r;r=r.parentNode}return null}function Ho(n){for(var e=Nn(n),t=bm(n);t&&CT(t)&&xi(t).position==="static";)t=bm(t);return t&&(qn(t)==="html"||qn(t)==="body"&&xi(t).position==="static")?e:t||AT(n)||e}function Bu(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Wo(n,e,t){return Pr(n,ml(e,t))}function LT(n,e,t){var i=Wo(n,e,t);return i>t?t:i}function xm(){return{top:0,right:0,bottom:0,left:0}}function wm(n){return Object.assign({},xm(),n)}function Mm(n,e){return e.reduce(function(t,i){return t[i]=n,t},{})}var RT=function(n,e){return n=typeof n=="function"?n(Object.assign({},e.rects,{placement:e.placement})):n,wm(typeof n!="number"?n:Mm(n,zo))};function PT(n){var e,t=n.state,i=n.name,r=n.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,l=Kn(t.placement),u=Bu(l),c=[fn,Cn].indexOf(l)>=0,f=c?"height":"width";if(!(!s||!o)){var h=RT(r.padding,t),m=Du(s),y=u==="y"?hn:fn,p=u==="y"?En:Cn,d=t.rects.reference[f]+t.rects.reference[u]-o[u]-t.rects.popper[f],b=o[u]-t.rects.reference[u],v=Ho(s),g=v?u==="y"?v.clientHeight||0:v.clientWidth||0:0,M=d/2-b/2,_=h[y],E=g-m[f]-h[p],S=g/2-m[f]/2+M,w=Wo(_,S,E),T=u;t.modifiersData[i]=(e={},e[T]=w,e.centerOffset=w-S,e)}}function IT(n){var e=n.state,t=n.options,i=t.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||!vm(e.elements.popper,r)||(e.elements.arrow=r))}var OT={name:"arrow",enabled:!0,phase:"main",fn:PT,effect:IT,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ws(n){return n.split("-")[1]}var NT={top:"auto",right:"auto",bottom:"auto",left:"auto"};function DT(n){var e=n.x,t=n.y,i=window,r=i.devicePixelRatio||1;return{x:bs(e*r)/r||0,y:bs(t*r)/r||0}}function Sm(n){var e,t=n.popper,i=n.popperRect,r=n.placement,s=n.variation,o=n.offsets,l=n.position,u=n.gpuAcceleration,c=n.adaptive,f=n.roundOffsets,h=n.isFixed,m=o.x,y=m===void 0?0:m,p=o.y,d=p===void 0?0:p,b=typeof f=="function"?f({x:y,y:d}):{x:y,y:d};y=b.x,d=b.y;var v=o.hasOwnProperty("x"),g=o.hasOwnProperty("y"),M=fn,_=hn,E=window;if(c){var S=Ho(t),w="clientHeight",T="clientWidth";if(S===Nn(t)&&(S=Xi(t),xi(S).position!=="static"&&l==="absolute"&&(w="scrollHeight",T="scrollWidth")),S=S,r===hn||(r===fn||r===Cn)&&s===Uo){_=En;var C=h&&S===E&&E.visualViewport?E.visualViewport.height:S[w];d-=C-i.height,d*=u?1:-1}if(r===fn||(r===hn||r===En)&&s===Uo){M=Cn;var R=h&&S===E&&E.visualViewport?E.visualViewport.width:S[T];y-=R-i.width,y*=u?1:-1}}var P=Object.assign({position:l},c&&NT),L=f===!0?DT({x:y,y:d}):{x:y,y:d};if(y=L.x,d=L.y,u){var A;return Object.assign({},P,(A={},A[_]=g?"0":"",A[M]=v?"0":"",A.transform=(E.devicePixelRatio||1)<=1?"translate("+y+"px, "+d+"px)":"translate3d("+y+"px, "+d+"px, 0)",A))}return Object.assign({},P,(e={},e[_]=g?d+"px":"",e[M]=v?y+"px":"",e.transform="",e))}function BT(n){var e=n.state,t=n.options,i=t.gpuAcceleration,r=i===void 0?!0:i,s=t.adaptive,o=s===void 0?!0:s,l=t.roundOffsets,u=l===void 0?!0:l,c={placement:Kn(e.placement),variation:ws(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Sm(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Sm(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var _m={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:BT,data:{}},yl={passive:!0};function FT(n){var e=n.state,t=n.instance,i=n.options,r=i.scroll,s=r===void 0?!0:r,o=i.resize,l=o===void 0?!0:o,u=Nn(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(f){f.addEventListener("scroll",t.update,yl)}),l&&u.addEventListener("resize",t.update,yl),function(){s&&c.forEach(function(f){f.removeEventListener("scroll",t.update,yl)}),l&&u.removeEventListener("resize",t.update,yl)}}var Tm={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:FT,data:{}},VT={left:"right",right:"left",bottom:"top",top:"bottom"};function vl(n){return n.replace(/left|right|bottom|top/g,function(e){return VT[e]})}var kT={start:"end",end:"start"};function Em(n){return n.replace(/start|end/g,function(e){return kT[e]})}function Fu(n){var e=Nn(n),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function Vu(n){return xs(Xi(n)).left+Fu(n).scrollLeft}function zT(n){var e=Nn(n),t=Xi(n),i=e.visualViewport,r=t.clientWidth,s=t.clientHeight,o=0,l=0;return i&&(r=i.width,s=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=i.offsetLeft,l=i.offsetTop)),{width:r,height:s,x:o+Vu(n),y:l}}function UT(n){var e,t=Xi(n),i=Fu(n),r=(e=n.ownerDocument)==null?void 0:e.body,s=Pr(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=Pr(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),l=-i.scrollLeft+Vu(n),u=-i.scrollTop;return xi(r||t).direction==="rtl"&&(l+=Pr(t.clientWidth,r?r.clientWidth:0)-s),{width:s,height:o,x:l,y:u}}function ku(n){var e=xi(n),t=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+i)}function Cm(n){return["html","body","#document"].indexOf(qn(n))>=0?n.ownerDocument.body:An(n)&&ku(n)?n:Cm(gl(n))}function jo(n,e){var t;e===void 0&&(e=[]);var i=Cm(n),r=i===((t=n.ownerDocument)==null?void 0:t.body),s=Nn(i),o=r?[s].concat(s.visualViewport||[],ku(i)?i:[]):i,l=e.concat(o);return r?l:l.concat(jo(gl(o)))}function zu(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function GT(n){var e=xs(n);return e.top=e.top+n.clientTop,e.left=e.left+n.clientLeft,e.bottom=e.top+n.clientHeight,e.right=e.left+n.clientWidth,e.width=n.clientWidth,e.height=n.clientHeight,e.x=e.left,e.y=e.top,e}function Am(n,e){return e===mm?zu(zT(n)):vs(e)?GT(e):zu(UT(Xi(n)))}function HT(n){var e=jo(gl(n)),t=["absolute","fixed"].indexOf(xi(n).position)>=0,i=t&&An(n)?Ho(n):n;return vs(i)?e.filter(function(r){return vs(r)&&vm(r,i)&&qn(r)!=="body"}):[]}function WT(n,e,t){var i=e==="clippingParents"?HT(n):[].concat(e),r=[].concat(i,[t]),s=r[0],o=r.reduce(function(l,u){var c=Am(n,u);return l.top=Pr(c.top,l.top),l.right=ml(c.right,l.right),l.bottom=ml(c.bottom,l.bottom),l.left=Pr(c.left,l.left),l},Am(n,s));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function Lm(n){var e=n.reference,t=n.element,i=n.placement,r=i?Kn(i):null,s=i?ws(i):null,o=e.x+e.width/2-t.width/2,l=e.y+e.height/2-t.height/2,u;switch(r){case hn:u={x:o,y:e.y-t.height};break;case En:u={x:o,y:e.y+e.height};break;case Cn:u={x:e.x+e.width,y:l};break;case fn:u={x:e.x-t.width,y:l};break;default:u={x:e.x,y:e.y}}var c=r?Bu(r):null;if(c!=null){var f=c==="y"?"height":"width";switch(s){case gs:u[c]=u[c]-(e[f]/2-t[f]/2);break;case Uo:u[c]=u[c]+(e[f]/2-t[f]/2);break}}return u}function $o(n,e){e===void 0&&(e={});var t=e,i=t.placement,r=i===void 0?n.placement:i,s=t.boundary,o=s===void 0?fT:s,l=t.rootBoundary,u=l===void 0?mm:l,c=t.elementContext,f=c===void 0?Go:c,h=t.altBoundary,m=h===void 0?!1:h,y=t.padding,p=y===void 0?0:y,d=wm(typeof p!="number"?p:Mm(p,zo)),b=f===Go?pT:Go,v=n.rects.popper,g=n.elements[m?b:f],M=WT(vs(g)?g:g.contextElement||Xi(n.elements.popper),o,u),_=xs(n.elements.reference),E=Lm({reference:_,element:v,strategy:"absolute",placement:r}),S=zu(Object.assign({},v,E)),w=f===Go?S:_,T={top:M.top-w.top+d.top,bottom:w.bottom-M.bottom+d.bottom,left:M.left-w.left+d.left,right:w.right-M.right+d.right},C=n.modifiersData.offset;if(f===Go&&C){var R=C[r];Object.keys(T).forEach(function(P){var L=[Cn,En].indexOf(P)>=0?1:-1,A=[hn,En].indexOf(P)>=0?"y":"x";T[P]+=R[A]*L})}return T}function jT(n,e){e===void 0&&(e={});var t=e,i=t.placement,r=t.boundary,s=t.rootBoundary,o=t.padding,l=t.flipVariations,u=t.allowedAutoPlacements,c=u===void 0?ys:u,f=ws(i),h=f?l?gm:gm.filter(function(p){return ws(p)===f}):zo,m=h.filter(function(p){return c.indexOf(p)>=0});m.length===0&&(m=h);var y=m.reduce(function(p,d){return p[d]=$o(n,{placement:d,boundary:r,rootBoundary:s,padding:o})[Kn(d)],p},{});return Object.keys(y).sort(function(p,d){return y[p]-y[d]})}function $T(n){if(Kn(n)===Ou)return[];var e=vl(n);return[Em(n),e,Em(e)]}function ZT(n){var e=n.state,t=n.options,i=n.name;if(!e.modifiersData[i]._skip){for(var r=t.mainAxis,s=r===void 0?!0:r,o=t.altAxis,l=o===void 0?!0:o,u=t.fallbackPlacements,c=t.padding,f=t.boundary,h=t.rootBoundary,m=t.altBoundary,y=t.flipVariations,p=y===void 0?!0:y,d=t.allowedAutoPlacements,b=e.options.placement,v=Kn(b),g=v===b,M=u||(g||!p?[vl(b)]:$T(b)),_=[b].concat(M).reduce(function(ie,j){return ie.concat(Kn(j)===Ou?jT(e,{placement:j,boundary:f,rootBoundary:h,padding:c,flipVariations:p,allowedAutoPlacements:d}):j)},[]),E=e.rects.reference,S=e.rects.popper,w=new Map,T=!0,C=_[0],R=0;R<_.length;R++){var P=_[R],L=Kn(P),A=ws(P)===gs,I=[hn,En].indexOf(L)>=0,O=I?"width":"height",x=$o(e,{placement:P,boundary:f,rootBoundary:h,altBoundary:m,padding:c}),N=I?A?Cn:fn:A?En:hn;E[O]>S[O]&&(N=vl(N));var B=vl(N),D=[];if(s&&D.push(x[L]<=0),l&&D.push(x[N]<=0,x[B]<=0),D.every(function(ie){return ie})){C=P,T=!1;break}w.set(P,D)}if(T)for(var V=p?3:1,z=function(ie){var j=_.find(function(H){var W=w.get(H);if(W)return W.slice(0,ie).every(function(q){return q})});if(j)return C=j,"break"},G=V;G>0;G--){var K=z(G);if(K==="break")break}e.placement!==C&&(e.modifiersData[i]._skip=!0,e.placement=C,e.reset=!0)}}var XT={name:"flip",enabled:!0,phase:"main",fn:ZT,requiresIfExists:["offset"],data:{_skip:!1}};function Rm(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function Pm(n){return[hn,Cn,En,fn].some(function(e){return n[e]>=0})}function YT(n){var e=n.state,t=n.name,i=e.rects.reference,r=e.rects.popper,s=e.modifiersData.preventOverflow,o=$o(e,{elementContext:"reference"}),l=$o(e,{altBoundary:!0}),u=Rm(o,i),c=Rm(l,r,s),f=Pm(u),h=Pm(c);e.modifiersData[t]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:f,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":h})}var JT={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:YT};function qT(n,e,t){var i=Kn(n),r=[fn,hn].indexOf(i)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,o=s[0],l=s[1];return o=o||0,l=(l||0)*r,[fn,Cn].indexOf(i)>=0?{x:l,y:o}:{x:o,y:l}}function KT(n){var e=n.state,t=n.options,i=n.name,r=t.offset,s=r===void 0?[0,0]:r,o=ys.reduce(function(f,h){return f[h]=qT(h,e.rects,s),f},{}),l=o[e.placement],u=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=o}var QT={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:KT};function eE(n){var e=n.state,t=n.name;e.modifiersData[t]=Lm({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var Im={name:"popperOffsets",enabled:!0,phase:"read",fn:eE,data:{}};function tE(n){return n==="x"?"y":"x"}function nE(n){var e=n.state,t=n.options,i=n.name,r=t.mainAxis,s=r===void 0?!0:r,o=t.altAxis,l=o===void 0?!1:o,u=t.boundary,c=t.rootBoundary,f=t.altBoundary,h=t.padding,m=t.tether,y=m===void 0?!0:m,p=t.tetherOffset,d=p===void 0?0:p,b=$o(e,{boundary:u,rootBoundary:c,padding:h,altBoundary:f}),v=Kn(e.placement),g=ws(e.placement),M=!g,_=Bu(v),E=tE(_),S=e.modifiersData.popperOffsets,w=e.rects.reference,T=e.rects.popper,C=typeof d=="function"?d(Object.assign({},e.rects,{placement:e.placement})):d,R=typeof C=="number"?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,L={x:0,y:0};if(S){if(s){var A,I=_==="y"?hn:fn,O=_==="y"?En:Cn,x=_==="y"?"height":"width",N=S[_],B=N+b[I],D=N-b[O],V=y?-T[x]/2:0,z=g===gs?w[x]:T[x],G=g===gs?-T[x]:-w[x],K=e.elements.arrow,ie=y&&K?Du(K):{width:0,height:0},j=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:xm(),H=j[I],W=j[O],q=Wo(0,w[x],ie[x]),Q=M?w[x]/2-V-q-H-R.mainAxis:z-q-H-R.mainAxis,ee=M?-w[x]/2+V+q+W+R.mainAxis:G+q+W+R.mainAxis,ne=e.elements.arrow&&Ho(e.elements.arrow),Y=ne?_==="y"?ne.clientTop||0:ne.clientLeft||0:0,te=(A=P==null?void 0:P[_])!=null?A:0,F=N+Q-te-Y,$=N+ee-te,J=Wo(y?ml(B,F):B,N,y?Pr(D,$):D);S[_]=J,L[_]=J-N}if(l){var k,U=_==="x"?hn:fn,oe=_==="x"?En:Cn,le=S[E],ae=E==="y"?"height":"width",fe=le+b[U],ge=le-b[oe],we=[hn,fn].indexOf(v)!==-1,ue=(k=P==null?void 0:P[E])!=null?k:0,ye=we?fe:le-w[ae]-T[ae]-ue+R.altAxis,se=we?le+w[ae]+T[ae]-ue-R.altAxis:ge,be=y&&we?LT(ye,le,se):Wo(y?ye:fe,le,y?se:ge);S[E]=be,L[E]=be-le}e.modifiersData[i]=L}}var iE={name:"preventOverflow",enabled:!0,phase:"main",fn:nE,requiresIfExists:["offset"]};function rE(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function sE(n){return n===Nn(n)||!An(n)?Fu(n):rE(n)}function oE(n){var e=n.getBoundingClientRect(),t=bs(e.width)/n.offsetWidth||1,i=bs(e.height)/n.offsetHeight||1;return t!==1||i!==1}function aE(n,e,t){t===void 0&&(t=!1);var i=An(e),r=An(e)&&oE(e),s=Xi(e),o=xs(n,r),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(i||!i&&!t)&&((qn(e)!=="body"||ku(s))&&(l=sE(e)),An(e)?(u=xs(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):s&&(u.x=Vu(s))),{x:o.left+l.scrollLeft-u.x,y:o.top+l.scrollTop-u.y,width:o.width,height:o.height}}function lE(n){var e=new Map,t=new Set,i=[];n.forEach(function(s){e.set(s.name,s)});function r(s){t.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(l){if(!t.has(l)){var u=e.get(l);u&&r(u)}}),i.push(s)}return n.forEach(function(s){t.has(s.name)||r(s)}),i}function cE(n){var e=lE(n);return _T.reduce(function(t,i){return t.concat(e.filter(function(r){return r.phase===i}))},[])}function uE(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function dE(n){var e=n.reduce(function(t,i){var r=t[i.name];return t[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var Om={placement:"bottom",modifiers:[],strategy:"absolute"};function Nm(){for(var n=arguments.length,e=new Array(n),t=0;t{const i={name:"updateState",enabled:!0,phase:"write",fn:({state:u})=>{const c=gE(u);Object.assign(o.value,c)},requires:["computeStyles"]},r=a.computed(()=>{const{onFirstUpdate:u,placement:c,strategy:f,modifiers:h}=a.unref(t);return{onFirstUpdate:u,placement:c||"bottom",strategy:f||"absolute",modifiers:[...h||[],i,{name:"applyStyles",enabled:!1}]}}),s=a.shallowRef(),o=a.ref({styles:{popper:{position:a.unref(r).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),l=()=>{s.value&&(s.value.destroy(),s.value=void 0)};return a.watch(r,u=>{const c=a.unref(s);c&&c.setOptions(u)},{deep:!0}),a.watch([n,e],([u,c])=>{l(),!(!u||!c)&&(s.value=pE(u,c,a.unref(r)))}),a.onBeforeUnmount(()=>{l()}),{state:a.computed(()=>{var u;return{...((u=a.unref(s))==null?void 0:u.state)||{}}}),styles:a.computed(()=>a.unref(o).styles),attributes:a.computed(()=>a.unref(o).attributes),update:()=>{var u;return(u=a.unref(s))==null?void 0:u.update()},forceUpdate:()=>{var u;return(u=a.unref(s))==null?void 0:u.forceUpdate()},instanceRef:a.computed(()=>a.unref(s))}};function gE(n){const e=Object.keys(n.elements),t=ol(e.map(r=>[r,n.styles[r]||{}])),i=ol(e.map(r=>[r,n.attributes[r]]));return{styles:t,attributes:i}}function Dm(){let n;const e=(i,r)=>{t(),n=window.setTimeout(i,r)},t=()=>window.clearTimeout(n);return qa(()=>t()),{registerTimeout:e,cancelTimeout:t}}const Gu={prefix:Math.floor(Math.random()*1e4),current:0},yE=Symbol("elIdInjection"),Hu=()=>a.getCurrentInstance()?a.inject(yE,Gu):Gu,bl=n=>{const e=Hu();!Ft&&e===Gu&&Ct("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed usage: app.provide(ID_INJECTION_KEY, { prefix: number, current: number, })`);const t=Iu();return a.computed(()=>a.unref(n)||`${t.value}-id-${e.prefix}-${e.current++}`)};let Ms=[];const Bm=n=>{const e=n;e.key===Jn.esc&&Ms.forEach(t=>t(e))},vE=n=>{a.onMounted(()=>{Ms.length===0&&document.addEventListener("keydown",Bm),Ft&&Ms.push(n)}),a.onBeforeUnmount(()=>{Ms=Ms.filter(e=>e!==n),Ms.length===0&&Ft&&document.removeEventListener("keydown",Bm)})};let Fm;const Vm=()=>{const n=Iu(),e=Hu(),t=a.computed(()=>`${n.value}-popper-container-${e.prefix}`),i=a.computed(()=>`#${t.value}`);return{id:t,selector:i}},bE=n=>{const e=document.createElement("div");return e.id=n,document.body.appendChild(e),e},xE=()=>{const{id:n,selector:e}=Vm();return a.onBeforeMount(()=>{Ft&&(process.env.NODE_ENV==="test"||!Fm||!document.body.querySelector(e.value))&&(Fm=bE(n.value))}),{id:n,selector:e}},wE=Ke({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),ME=({showAfter:n,hideAfter:e,autoClose:t,open:i,close:r})=>{const{registerTimeout:s}=Dm(),{registerTimeout:o,cancelTimeout:l}=Dm();return{onOpen:f=>{s(()=>{i(f);const h=a.unref(t);rt(h)&&h>0&&o(()=>{r(f)},h)},a.unref(n))},onClose:f=>{l(),s(()=>{r(f)},a.unref(e))}}},km=Symbol("elForwardRef"),SE=n=>{const e=t=>{n.value=t};a.provide(km,{setForwardRef:e})},_E=n=>({mounted(e){n(e)},updated(e){n(e)},unmounted(){n(null)}}),zm={current:0},Um=a.ref(0),Gm=2e3,Hm=Symbol("elZIndexContextKey"),Wm=Symbol("zIndexContextKey"),jm=n=>{const e=a.getCurrentInstance()?a.inject(Hm,zm):zm,t=n||(a.getCurrentInstance()?a.inject(Wm,void 0):void 0),i=a.computed(()=>{const o=a.unref(t);return rt(o)?o:Gm}),r=a.computed(()=>i.value+Um.value),s=()=>(e.current++,Um.value=e.current,r.value);return!Ft&&!a.inject(Hm)&&Ct("ZIndexInjection",`Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:i,currentZIndex:r,nextZIndex:s}};function TE(n){let e;function t(){if(n.value==null)return;const{selectionStart:r,selectionEnd:s,value:o}=n.value;if(r==null||s==null)return;const l=o.slice(0,Math.max(0,r)),u=o.slice(Math.max(0,s));e={selectionStart:r,selectionEnd:s,value:o,beforeTxt:l,afterTxt:u}}function i(){if(n.value==null||e==null)return;const{value:r}=n.value,{beforeTxt:s,afterTxt:o,selectionStart:l}=e;if(s==null||o==null||l==null)return;let u=r.length;if(r.endsWith(o))u=r.length-o.length;else if(r.startsWith(s))u=s.length;else{const c=s[l-1],f=r.indexOf(c,l-1);f!==-1&&(u=f+1)}n.value.setSelectionRange(u,u)}return[t,i]}const EE=(n,e,t)=>hl(n.subTree).filter(s=>{var o;return a.isVNode(s)&&((o=s.type)==null?void 0:o.name)===e&&!!s.component}).map(s=>s.component.uid).map(s=>t[s]).filter(s=>!!s),CE=(n,e)=>{const t={},i=a.shallowRef([]);return{children:i,addChild:o=>{t[o.uid]=o,i.value=EE(n,e,t)},removeChild:o=>{delete t[o],i.value=i.value.filter(l=>l.uid!==o)}}},Ss=dl({type:String,values:dm,required:!1}),$m=Symbol("size"),AE=()=>{const n=a.inject($m,{});return a.computed(()=>a.unref(n.size)||"")};function Zm(n,{beforeFocus:e,afterFocus:t,beforeBlur:i,afterBlur:r}={}){const s=a.getCurrentInstance(),{emit:o}=s,l=a.shallowRef(),u=a.ref(!1),c=m=>{en(e)&&e(m)||u.value||(u.value=!0,o("focus",m),t==null||t())},f=m=>{var y;en(i)&&i(m)||m.relatedTarget&&((y=l.value)!=null&&y.contains(m.relatedTarget))||(u.value=!1,o("blur",m),r==null||r())},h=()=>{var m,y;(m=l.value)!=null&&m.contains(document.activeElement)&&l.value!==document.activeElement||(y=n.value)==null||y.focus()};return a.watch(l,m=>{m&&m.setAttribute("tabindex","-1")}),Gt(l,"focus",c,!0),Gt(l,"blur",f,!0),Gt(l,"click",h,!0),process.env.NODE_ENV==="test"&&a.onMounted(()=>{const m=Ar(n.value)?n.value:document.querySelector("input,textarea");m&&(Gt(m,"focus",c,!0),Gt(m,"blur",f,!0))}),{isFocused:u,wrapperRef:l,handleFocus:c,handleBlur:f}}function Xm({afterComposition:n,emit:e}){const t=a.ref(!1),i=l=>{e==null||e("compositionstart",l),t.value=!0},r=l=>{var u;e==null||e("compositionupdate",l);const c=(u=l.target)==null?void 0:u.value,f=c[c.length-1]||"";t.value=!eT(f)},s=l=>{e==null||e("compositionend",l),t.value&&(t.value=!1,a.nextTick(()=>n(l)))};return{isComposing:t,handleComposition:l=>{l.type==="compositionend"?s(l):r(l)},handleCompositionStart:i,handleCompositionUpdate:r,handleCompositionEnd:s}}const Ym=Symbol("emptyValuesContextKey"),LE="use-empty-values",RE=["",void 0,null],PE=void 0,IE=Ke({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:n=>en(n)?!n():!n}}),OE=(n,e)=>{const t=a.getCurrentInstance()?a.inject(Ym,a.ref({})):a.ref({}),i=a.computed(()=>n.emptyValues||t.value.emptyValues||RE),r=a.computed(()=>en(n.valueOnClear)?n.valueOnClear():n.valueOnClear!==void 0?n.valueOnClear:en(t.value.valueOnClear)?t.value.valueOnClear():t.value.valueOnClear!==void 0?t.value.valueOnClear:PE),s=o=>i.value.includes(o);return i.value.includes(r.value)||Ct(LE,"value-on-clear should be a value of empty-values"),{emptyValues:i,valueOnClear:r,isEmptyValue:s}},NE=Ke({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),Ir=n=>A_(NE,n),Jm=Symbol(),xl=a.ref();function Wu(n,e=void 0){const t=a.getCurrentInstance()?a.inject(Jm,xl):xl;return n?a.computed(()=>{var i,r;return(r=(i=t.value)==null?void 0:i[n])!=null?r:e}):t}function DE(n,e){const t=Wu(),i=Ue(n,a.computed(()=>{var l;return((l=t.value)==null?void 0:l.namespace)||pl})),r=fl(a.computed(()=>{var l;return(l=t.value)==null?void 0:l.locale})),s=jm(a.computed(()=>{var l;return((l=t.value)==null?void 0:l.zIndex)||Gm})),o=a.computed(()=>{var l;return a.unref(e)||((l=t.value)==null?void 0:l.size)||""});return BE(a.computed(()=>a.unref(t)||{})),{ns:i,locale:r,zIndex:s,size:o}}const BE=(n,e,t=!1)=>{var i;const r=!!a.getCurrentInstance(),s=r?Wu():void 0,o=(i=void 0)!=null?i:r?a.provide:void 0;if(!o){Ct("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const l=a.computed(()=>{const u=a.unref(n);return s!=null&&s.value?FE(s.value,u):u});return o(Jm,l),o(hm,a.computed(()=>l.value.locale)),o(fm,a.computed(()=>l.value.namespace)),o(Wm,a.computed(()=>l.value.zIndex)),o($m,{size:a.computed(()=>l.value.size||"")}),o(Ym,a.computed(()=>({emptyValues:l.value.emptyValues,valueOnClear:l.value.valueOnClear}))),(t||!xl.value)&&(xl.value=l.value),l},FE=(n,e)=>{const t=[...new Set([...im(n),...im(e)])],i={};for(const r of t)i[r]=e[r]!==void 0?e[r]:n[r];return i};var je=(n,e)=>{const t=n.__vccOpts||n;for(const[i,r]of e)t[i]=r;return t};const VE=Ke({size:{type:Fe([Number,String])},color:{type:String}}),kE=a.defineComponent({name:"ElIcon",inheritAttrs:!1}),zE=a.defineComponent({...kE,props:VE,setup(n){const e=n,t=Ue("icon"),i=a.computed(()=>{const{size:r,color:s}=e;return!r&&!s?{}:{fontSize:On(r)?void 0:ll(r),"--color":s}});return(r,s)=>(a.openBlock(),a.createElementBlock("i",a.mergeProps({class:a.unref(t).b(),style:a.unref(i)},r.$attrs),[a.renderSlot(r.$slots,"default")],16))}});var UE=je(zE,[["__file","icon.vue"]]);const yt=Ht(UE),ju=Symbol("formContextKey"),wl=Symbol("formItemContextKey"),_s=(n,e={})=>{const t=a.ref(void 0),i=e.prop?t:pm("size"),r=e.global?t:AE(),s=e.form?{size:void 0}:a.inject(ju,void 0),o=e.formItem?{size:void 0}:a.inject(wl,void 0);return a.computed(()=>i.value||a.unref(n)||(o==null?void 0:o.size)||(s==null?void 0:s.size)||r.value||"")},Ml=n=>{const e=pm("disabled"),t=a.inject(ju,void 0);return a.computed(()=>e.value||a.unref(n)||(t==null?void 0:t.disabled)||!1)},Zo=()=>{const n=a.inject(ju,void 0),e=a.inject(wl,void 0);return{form:n,formItem:e}},$u=(n,{formItemContext:e,disableIdGeneration:t,disableIdManagement:i})=>{t||(t=a.ref(!1)),i||(i=a.ref(!1));const r=a.ref();let s;const o=a.computed(()=>{var l;return!!(!(n.label||n.ariaLabel)&&e&&e.inputIds&&((l=e.inputIds)==null?void 0:l.length)<=1)});return a.onMounted(()=>{s=a.watch([a.toRef(n,"id"),t],([l,u])=>{const c=l??(u?void 0:bl().value);c!==r.value&&(e!=null&&e.removeInputId&&(r.value&&e.removeInputId(r.value),!(i!=null&&i.value)&&!u&&c&&e.addInputId(c)),r.value=c)},{immediate:!0})}),a.onUnmounted(()=>{s&&s(),e!=null&&e.removeInputId&&r.value&&e.removeInputId(r.value)}),{isLabeledByFormItem:o,inputId:r}};let Dn;const GE=` height:0 !important; visibility:hidden !important; ${Lw()?"":"overflow:hidden !important;"} position:absolute !important; z-index:-1000 !important; top:0 !important; right:0 !important; `,HE=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function WE(n){const e=window.getComputedStyle(n),t=e.getPropertyValue("box-sizing"),i=Number.parseFloat(e.getPropertyValue("padding-bottom"))+Number.parseFloat(e.getPropertyValue("padding-top")),r=Number.parseFloat(e.getPropertyValue("border-bottom-width"))+Number.parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:HE.map(o=>`${o}:${e.getPropertyValue(o)}`).join(";"),paddingSize:i,borderSize:r,boxSizing:t}}function qm(n,e=1,t){var i;Dn||(Dn=document.createElement("textarea"),document.body.appendChild(Dn));const{paddingSize:r,borderSize:s,boxSizing:o,contextStyle:l}=WE(n);Dn.setAttribute("style",`${l};${GE}`),Dn.value=n.value||n.placeholder||"";let u=Dn.scrollHeight;const c={};o==="border-box"?u=u+s:o==="content-box"&&(u=u-r),Dn.value="";const f=Dn.scrollHeight-r;if(rt(e)){let h=f*e;o==="border-box"&&(h=h+r+s),u=Math.max(h,u),c.minHeight=`${h}px`}if(rt(t)){let h=f*t;o==="border-box"&&(h=h+r+s),u=Math.min(h,u)}return c.height=`${u}px`,(i=Dn.parentNode)==null||i.removeChild(Dn),Dn=void 0,c}const jE=Ke({id:{type:String,default:void 0},size:Ss,disabled:Boolean,modelValue:{type:Fe([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:Fe([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:$i},prefixIcon:{type:$i},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:Fe([Object,Array,String]),default:()=>bi({})},autofocus:Boolean,rows:{type:Number,default:2},...Ir(["ariaLabel"])}),$E={[gt]:n=>on(n),input:n=>on(n),change:n=>on(n),focus:n=>n instanceof FocusEvent,blur:n=>n instanceof FocusEvent,clear:()=>!0,mouseleave:n=>n instanceof MouseEvent,mouseenter:n=>n instanceof MouseEvent,keydown:n=>n instanceof Event,compositionstart:n=>n instanceof CompositionEvent,compositionupdate:n=>n instanceof CompositionEvent,compositionend:n=>n instanceof CompositionEvent},ZE=a.defineComponent({name:"ElInput",inheritAttrs:!1}),XE=a.defineComponent({...ZE,props:jE,emits:$E,setup(n,{expose:e,emit:t}){const i=n,r=a.useAttrs(),s=a.useSlots(),o=a.computed(()=>{const ue={};return i.containerRole==="combobox"&&(ue["aria-haspopup"]=r["aria-haspopup"],ue["aria-owns"]=r["aria-owns"],ue["aria-expanded"]=r["aria-expanded"]),ue}),l=a.computed(()=>[i.type==="textarea"?b.b():d.b(),d.m(y.value),d.is("disabled",p.value),d.is("exceed",K.value),{[d.b("group")]:s.prepend||s.append,[d.m("prefix")]:s.prefix||i.prefixIcon,[d.m("suffix")]:s.suffix||i.suffixIcon||i.clearable||i.showPassword,[d.bm("suffix","password-clear")]:D.value&&V.value,[d.b("hidden")]:i.type==="hidden"},r.class]),u=a.computed(()=>[d.e("wrapper"),d.is("focus",C.value)]),c=iT({excludeKeys:a.computed(()=>Object.keys(o.value))}),{form:f,formItem:h}=Zo(),{inputId:m}=$u(i,{formItemContext:h}),y=_s(),p=Ml(),d=Ue("input"),b=Ue("textarea"),v=a.shallowRef(),g=a.shallowRef(),M=a.ref(!1),_=a.ref(!1),E=a.ref(),S=a.shallowRef(i.inputStyle),w=a.computed(()=>v.value||g.value),{wrapperRef:T,isFocused:C,handleFocus:R,handleBlur:P}=Zm(w,{beforeFocus(){return p.value},afterBlur(){var ue;i.validateEvent&&((ue=h==null?void 0:h.validate)==null||ue.call(h,"blur").catch(ye=>Ct(ye)))}}),L=a.computed(()=>{var ue;return(ue=f==null?void 0:f.statusIcon)!=null?ue:!1}),A=a.computed(()=>(h==null?void 0:h.validateState)||""),I=a.computed(()=>A.value&&um[A.value]),O=a.computed(()=>_.value?J_:W_),x=a.computed(()=>[r.style]),N=a.computed(()=>[i.inputStyle,S.value,{resize:i.resize}]),B=a.computed(()=>yi(i.modelValue)?"":String(i.modelValue)),D=a.computed(()=>i.clearable&&!p.value&&!i.readonly&&!!B.value&&(C.value||M.value)),V=a.computed(()=>i.showPassword&&!p.value&&!i.readonly&&!!B.value&&(!!B.value||C.value)),z=a.computed(()=>i.showWordLimit&&!!i.maxlength&&(i.type==="text"||i.type==="textarea")&&!p.value&&!i.readonly&&!i.showPassword),G=a.computed(()=>B.value.length),K=a.computed(()=>!!z.value&&G.value>Number(i.maxlength)),ie=a.computed(()=>!!s.suffix||!!i.suffixIcon||D.value||i.showPassword||z.value||!!A.value&&L.value),[j,H]=TE(v);Tn(g,ue=>{if(Q(),!z.value||i.resize!=="both")return;const ye=ue[0],{width:se}=ye.contentRect;E.value={right:`calc(100% - ${se+15+6}px)`}});const W=()=>{const{type:ue,autosize:ye}=i;if(!(!Ft||ue!=="textarea"||!g.value))if(ye){const se=an(ye)?ye.minRows:void 0,be=an(ye)?ye.maxRows:void 0,he=qm(g.value,se,be);S.value={overflowY:"hidden",...he},a.nextTick(()=>{g.value.offsetHeight,S.value=he})}else S.value={minHeight:qm(g.value).minHeight}},Q=(ue=>{let ye=!1;return()=>{var se;if(ye||!i.autosize)return;((se=g.value)==null?void 0:se.offsetParent)===null||(ue(),ye=!0)}})(W),ee=()=>{const ue=w.value,ye=i.formatter?i.formatter(B.value):B.value;!ue||ue.value===ye||(ue.value=ye)},ne=async ue=>{j();let{value:ye}=ue.target;if(i.formatter&&(ye=i.parser?i.parser(ye):ye),!te.value){if(ye===B.value){ee();return}t(gt,ye),t("input",ye),await a.nextTick(),ee(),H()}},Y=ue=>{t("change",ue.target.value)},{isComposing:te,handleCompositionStart:F,handleCompositionUpdate:$,handleCompositionEnd:J}=Xm({emit:t,afterComposition:ne}),k=()=>{_.value=!_.value,U()},U=async()=>{var ue;await a.nextTick(),(ue=w.value)==null||ue.focus()},oe=()=>{var ue;return(ue=w.value)==null?void 0:ue.blur()},le=ue=>{M.value=!1,t("mouseleave",ue)},ae=ue=>{M.value=!0,t("mouseenter",ue)},fe=ue=>{t("keydown",ue)},ge=()=>{var ue;(ue=w.value)==null||ue.select()},we=()=>{t(gt,""),t("change",""),t("clear"),t("input","")};return a.watch(()=>i.modelValue,()=>{var ue;a.nextTick(()=>W()),i.validateEvent&&((ue=h==null?void 0:h.validate)==null||ue.call(h,"change").catch(ye=>Ct(ye)))}),a.watch(B,()=>ee()),a.watch(()=>i.type,async()=>{await a.nextTick(),ee(),W()}),a.onMounted(()=>{!i.formatter&&i.parser&&Ct("ElInput","If you set the parser, you also need to set the formatter."),ee(),a.nextTick(W)}),e({input:v,textarea:g,ref:w,textareaStyle:N,autosize:a.toRef(i,"autosize"),isComposing:te,focus:U,blur:oe,select:ge,clear:we,resizeTextarea:W}),(ue,ye)=>(a.openBlock(),a.createElementBlock("div",a.mergeProps(a.unref(o),{class:[a.unref(l),{[a.unref(d).bm("group","append")]:ue.$slots.append,[a.unref(d).bm("group","prepend")]:ue.$slots.prepend}],style:a.unref(x),role:ue.containerRole,onMouseenter:ae,onMouseleave:le}),[a.createCommentVNode(" input "),ue.type!=="textarea"?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createCommentVNode(" prepend slot "),ue.$slots.prepend?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(a.unref(d).be("group","prepend"))},[a.renderSlot(ue.$slots,"prepend")],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("div",{ref_key:"wrapperRef",ref:T,class:a.normalizeClass(a.unref(u))},[a.createCommentVNode(" prefix slot "),ue.$slots.prefix||ue.prefixIcon?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(d).e("prefix"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(d).e("prefix-inner"))},[a.renderSlot(ue.$slots,"prefix"),ue.prefixIcon?(a.openBlock(),a.createBlock(a.unref(yt),{key:0,class:a.normalizeClass(a.unref(d).e("icon"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(ue.prefixIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("input",a.mergeProps({id:a.unref(m),ref_key:"input",ref:v,class:a.unref(d).e("inner")},a.unref(c),{minlength:ue.minlength,maxlength:ue.maxlength,type:ue.showPassword?_.value?"text":"password":ue.type,disabled:a.unref(p),readonly:ue.readonly,autocomplete:ue.autocomplete,tabindex:ue.tabindex,"aria-label":ue.ariaLabel,placeholder:ue.placeholder,style:ue.inputStyle,form:ue.form,autofocus:ue.autofocus,onCompositionstart:a.unref(F),onCompositionupdate:a.unref($),onCompositionend:a.unref(J),onInput:ne,onChange:Y,onKeydown:fe}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),a.createCommentVNode(" suffix slot "),a.unref(ie)?(a.openBlock(),a.createElementBlock("span",{key:1,class:a.normalizeClass(a.unref(d).e("suffix"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(d).e("suffix-inner"))},[!a.unref(D)||!a.unref(V)||!a.unref(z)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.renderSlot(ue.$slots,"suffix"),ue.suffixIcon?(a.openBlock(),a.createBlock(a.unref(yt),{key:0,class:a.normalizeClass(a.unref(d).e("icon"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(ue.suffixIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],64)):a.createCommentVNode("v-if",!0),a.unref(D)?(a.openBlock(),a.createBlock(a.unref(yt),{key:1,class:a.normalizeClass([a.unref(d).e("icon"),a.unref(d).e("clear")]),onMousedown:a.withModifiers(a.unref(Oo),["prevent"]),onClick:we},{default:a.withCtx(()=>[a.createVNode(a.unref(Ru))]),_:1},8,["class","onMousedown"])):a.createCommentVNode("v-if",!0),a.unref(V)?(a.openBlock(),a.createBlock(a.unref(yt),{key:2,class:a.normalizeClass([a.unref(d).e("icon"),a.unref(d).e("password")]),onClick:k},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(a.unref(O))))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0),a.unref(z)?(a.openBlock(),a.createElementBlock("span",{key:3,class:a.normalizeClass(a.unref(d).e("count"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(d).e("count-inner"))},a.toDisplayString(a.unref(G))+" / "+a.toDisplayString(ue.maxlength),3)],2)):a.createCommentVNode("v-if",!0),a.unref(A)&&a.unref(I)&&a.unref(L)?(a.openBlock(),a.createBlock(a.unref(yt),{key:4,class:a.normalizeClass([a.unref(d).e("icon"),a.unref(d).e("validateIcon"),a.unref(d).is("loading",a.unref(A)==="validating")])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(a.unref(I))))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],2)):a.createCommentVNode("v-if",!0)],2),a.createCommentVNode(" append slot "),ue.$slots.append?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(a.unref(d).be("group","append"))},[a.renderSlot(ue.$slots,"append")],2)):a.createCommentVNode("v-if",!0)],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createCommentVNode(" textarea "),a.createElementVNode("textarea",a.mergeProps({id:a.unref(m),ref_key:"textarea",ref:g,class:[a.unref(b).e("inner"),a.unref(d).is("focus",a.unref(C))]},a.unref(c),{minlength:ue.minlength,maxlength:ue.maxlength,tabindex:ue.tabindex,disabled:a.unref(p),readonly:ue.readonly,autocomplete:ue.autocomplete,style:a.unref(N),"aria-label":ue.ariaLabel,placeholder:ue.placeholder,form:ue.form,autofocus:ue.autofocus,rows:ue.rows,onCompositionstart:a.unref(F),onCompositionupdate:a.unref($),onCompositionend:a.unref(J),onInput:ne,onFocus:a.unref(R),onBlur:a.unref(P),onChange:Y,onKeydown:fe}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),a.unref(z)?(a.openBlock(),a.createElementBlock("span",{key:0,style:a.normalizeStyle(E.value),class:a.normalizeClass(a.unref(d).e("count"))},a.toDisplayString(a.unref(G))+" / "+a.toDisplayString(ue.maxlength),7)):a.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var YE=je(XE,[["__file","input.vue"]]);const JE=Ht(YE),Ts=4,qE={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},KE=({move:n,size:e,bar:t})=>({[t.size]:e,transform:`translate${t.axis}(${n}%)`}),Zu=Symbol("scrollbarContextKey"),QE=Ke({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),eC="Thumb";var Km=je(a.defineComponent({__name:"thumb",props:QE,setup(n){const e=n,t=a.inject(Zu),i=Ue("scrollbar");t||ms(eC,"can not inject scrollbar context");const r=a.ref(),s=a.ref(),o=a.ref({}),l=a.ref(!1);let u=!1,c=!1,f=Ft?document.onselectstart:null;const h=a.computed(()=>qE[e.vertical?"vertical":"horizontal"]),m=a.computed(()=>KE({size:e.size,move:e.move,bar:h.value})),y=a.computed(()=>r.value[h.value.offset]**2/t.wrapElement[h.value.scrollSize]/e.ratio/s.value[h.value.offset]),p=S=>{var w;if(S.stopPropagation(),S.ctrlKey||[1,2].includes(S.button))return;(w=window.getSelection())==null||w.removeAllRanges(),b(S);const T=S.currentTarget;T&&(o.value[h.value.axis]=T[h.value.offset]-(S[h.value.client]-T.getBoundingClientRect()[h.value.direction]))},d=S=>{if(!s.value||!r.value||!t.wrapElement)return;const w=Math.abs(S.target.getBoundingClientRect()[h.value.direction]-S[h.value.client]),T=s.value[h.value.offset]/2,C=(w-T)*100*y.value/r.value[h.value.offset];t.wrapElement[h.value.scroll]=C*t.wrapElement[h.value.scrollSize]/100},b=S=>{S.stopImmediatePropagation(),u=!0,document.addEventListener("mousemove",v),document.addEventListener("mouseup",g),f=document.onselectstart,document.onselectstart=()=>!1},v=S=>{if(!r.value||!s.value||u===!1)return;const w=o.value[h.value.axis];if(!w)return;const T=(r.value.getBoundingClientRect()[h.value.direction]-S[h.value.client])*-1,C=s.value[h.value.offset]-w,R=(T-C)*100*y.value/r.value[h.value.offset];t.wrapElement[h.value.scroll]=R*t.wrapElement[h.value.scrollSize]/100},g=()=>{u=!1,o.value[h.value.axis]=0,document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",g),E(),c&&(l.value=!1)},M=()=>{c=!1,l.value=!!e.size},_=()=>{c=!0,l.value=u};a.onBeforeUnmount(()=>{E(),document.removeEventListener("mouseup",g)});const E=()=>{document.onselectstart!==f&&(document.onselectstart=f)};return Gt(a.toRef(t,"scrollbarElement"),"mousemove",M),Gt(a.toRef(t,"scrollbarElement"),"mouseleave",_),(S,w)=>(a.openBlock(),a.createBlock(a.Transition,{name:a.unref(i).b("fade"),persisted:""},{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{ref_key:"instance",ref:r,class:a.normalizeClass([a.unref(i).e("bar"),a.unref(i).is(a.unref(h).key)]),onMousedown:d},[a.createElementVNode("div",{ref_key:"thumb",ref:s,class:a.normalizeClass(a.unref(i).e("thumb")),style:a.normalizeStyle(a.unref(m)),onMousedown:p},null,38)],34),[[a.vShow,S.always||l.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const tC=Ke({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var nC=je(a.defineComponent({__name:"bar",props:tC,setup(n,{expose:e}){const t=n,i=a.inject(Zu),r=a.ref(0),s=a.ref(0),o=a.ref(""),l=a.ref(""),u=a.ref(1),c=a.ref(1);return e({handleScroll:m=>{if(m){const y=m.offsetHeight-Ts,p=m.offsetWidth-Ts;s.value=m.scrollTop*100/y*u.value,r.value=m.scrollLeft*100/p*c.value}},update:()=>{const m=i==null?void 0:i.wrapElement;if(!m)return;const y=m.offsetHeight-Ts,p=m.offsetWidth-Ts,d=y**2/m.scrollHeight,b=p**2/m.scrollWidth,v=Math.max(d,t.minSize),g=Math.max(b,t.minSize);u.value=d/(y-d)/(v/(y-v)),c.value=b/(p-b)/(g/(p-g)),l.value=v+Ts(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createVNode(Km,{move:r.value,ratio:c.value,size:o.value,always:m.always},null,8,["move","ratio","size","always"]),a.createVNode(Km,{move:s.value,ratio:u.value,size:l.value,vertical:"",always:m.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const iC=Ke({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:Fe([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...Ir(["ariaLabel","ariaOrientation"])}),rC={scroll:({scrollTop:n,scrollLeft:e})=>[n,e].every(rt)},Xu="ElScrollbar",sC=a.defineComponent({name:Xu}),oC=a.defineComponent({...sC,props:iC,emits:rC,setup(n,{expose:e,emit:t}){const i=n,r=Ue("scrollbar");let s,o,l=0,u=0;const c=a.ref(),f=a.ref(),h=a.ref(),m=a.ref(),y=a.computed(()=>{const E={};return i.height&&(E.height=ll(i.height)),i.maxHeight&&(E.maxHeight=ll(i.maxHeight)),[i.wrapStyle,E]}),p=a.computed(()=>[i.wrapClass,r.e("wrap"),{[r.em("wrap","hidden-default")]:!i.native}]),d=a.computed(()=>[r.e("view"),i.viewClass]),b=()=>{var E;f.value&&((E=m.value)==null||E.handleScroll(f.value),l=f.value.scrollTop,u=f.value.scrollLeft,t("scroll",{scrollTop:f.value.scrollTop,scrollLeft:f.value.scrollLeft}))};function v(E,S){an(E)?f.value.scrollTo(E):rt(E)&&rt(S)&&f.value.scrollTo(E,S)}const g=E=>{if(!rt(E)){Ct(Xu,"value must be a number");return}f.value.scrollTop=E},M=E=>{if(!rt(E)){Ct(Xu,"value must be a number");return}f.value.scrollLeft=E},_=()=>{var E;(E=m.value)==null||E.update()};return a.watch(()=>i.noresize,E=>{E?(s==null||s(),o==null||o()):({stop:s}=Tn(h,_),o=Gt("resize",_))},{immediate:!0}),a.watch(()=>[i.maxHeight,i.height],()=>{i.native||a.nextTick(()=>{var E;_(),f.value&&((E=m.value)==null||E.handleScroll(f.value))})}),a.provide(Zu,a.reactive({scrollbarElement:c,wrapElement:f})),a.onActivated(()=>{f.value&&(f.value.scrollTop=l,f.value.scrollLeft=u)}),a.onMounted(()=>{i.native||a.nextTick(()=>{_()})}),a.onUpdated(()=>_()),e({wrapRef:f,update:_,scrollTo:v,setScrollTop:g,setScrollLeft:M,handleScroll:b}),(E,S)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"scrollbarRef",ref:c,class:a.normalizeClass(a.unref(r).b())},[a.createElementVNode("div",{ref_key:"wrapRef",ref:f,class:a.normalizeClass(a.unref(p)),style:a.normalizeStyle(a.unref(y)),tabindex:E.tabindex,onScroll:b},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(E.tag),{id:E.id,ref_key:"resizeRef",ref:h,class:a.normalizeClass(a.unref(d)),style:a.normalizeStyle(E.viewStyle),role:E.role,"aria-label":E.ariaLabel,"aria-orientation":E.ariaOrientation},{default:a.withCtx(()=>[a.renderSlot(E.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),E.native?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(nC,{key:0,ref_key:"barRef",ref:m,always:E.always,"min-size":E.minSize},null,8,["always","min-size"]))],2))}});var aC=je(oC,[["__file","scrollbar.vue"]]);const lC=Ht(aC),Yu=Symbol("popper"),Qm=Symbol("popperContent"),eg=Ke({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),cC=a.defineComponent({name:"ElPopper",inheritAttrs:!1}),uC=a.defineComponent({...cC,props:eg,setup(n,{expose:e}){const t=n,i=a.ref(),r=a.ref(),s=a.ref(),o=a.ref(),l=a.computed(()=>t.role),u={triggerRef:i,popperInstanceRef:r,contentRef:s,referenceRef:o,role:l};return e(u),a.provide(Yu,u),(c,f)=>a.renderSlot(c.$slots,"default")}});var dC=je(uC,[["__file","popper.vue"]]);const tg=Ke({arrowOffset:{type:Number,default:5}}),hC=a.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),fC=a.defineComponent({...hC,props:tg,setup(n,{expose:e}){const t=n,i=Ue("popper"),{arrowOffset:r,arrowRef:s,arrowStyle:o}=a.inject(Qm,void 0);return a.watch(()=>t.arrowOffset,l=>{r.value=l}),a.onBeforeUnmount(()=>{s.value=void 0}),e({arrowRef:s}),(l,u)=>(a.openBlock(),a.createElementBlock("span",{ref_key:"arrowRef",ref:s,class:a.normalizeClass(a.unref(i).e("arrow")),style:a.normalizeStyle(a.unref(o)),"data-popper-arrow":""},null,6))}});var pC=je(fC,[["__file","arrow.vue"]]);const Ju="ElOnlyChild",mC=a.defineComponent({name:Ju,setup(n,{slots:e,attrs:t}){var i;const r=a.inject(km),s=_E((i=r==null?void 0:r.setForwardRef)!=null?i:Oo);return()=>{var o;const l=(o=e.default)==null?void 0:o.call(e,t);if(!l)return null;if(l.length>1)return Ct(Ju,"requires exact only one valid child."),null;const u=ng(l);return u?a.withDirectives(a.cloneVNode(u,t),[[s]]):(Ct(Ju,"no valid child node found"),null)}}});function ng(n){if(!n)return null;const e=n;for(const t of e){if(an(t))switch(t.type){case a.Comment:continue;case a.Text:case"svg":return ig(t);case a.Fragment:return ng(t.children);default:return t}return ig(t)}return null}function ig(n){const e=Ue("only-child");return a.createVNode("span",{class:e.e("content")},[n])}const rg=Ke({virtualRef:{type:Fe(Object)},virtualTriggering:Boolean,onMouseenter:{type:Fe(Function)},onMouseleave:{type:Fe(Function)},onClick:{type:Fe(Function)},onKeydown:{type:Fe(Function)},onFocus:{type:Fe(Function)},onBlur:{type:Fe(Function)},onContextmenu:{type:Fe(Function)},id:String,open:Boolean}),gC=a.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),yC=a.defineComponent({...gC,props:rg,setup(n,{expose:e}){const t=n,{role:i,triggerRef:r}=a.inject(Yu,void 0);SE(r);const s=a.computed(()=>l.value?t.id:void 0),o=a.computed(()=>{if(i&&i.value==="tooltip")return t.open&&t.id?t.id:void 0}),l=a.computed(()=>{if(i&&i.value!=="tooltip")return i.value}),u=a.computed(()=>l.value?`${t.open}`:void 0);let c;const f=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return a.onMounted(()=>{a.watch(()=>t.virtualRef,h=>{h&&(r.value=hi(h))},{immediate:!0}),a.watch(r,(h,m)=>{c==null||c(),c=void 0,Ar(h)&&(f.forEach(y=>{var p;const d=t[y];d&&(h.addEventListener(y.slice(2).toLowerCase(),d),(p=m==null?void 0:m.removeEventListener)==null||p.call(m,y.slice(2).toLowerCase(),d))}),c=a.watch([s,o,l,u],y=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((p,d)=>{yi(y[d])?h.removeAttribute(p):h.setAttribute(p,y[d])})},{immediate:!0})),Ar(m)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(y=>m.removeAttribute(y))},{immediate:!0})}),a.onBeforeUnmount(()=>{if(c==null||c(),c=void 0,r.value&&Ar(r.value)){const h=r.value;f.forEach(m=>{const y=t[m];y&&h.removeEventListener(m.slice(2).toLowerCase(),y)}),r.value=void 0}}),e({triggerRef:r}),(h,m)=>h.virtualTriggering?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(a.unref(mC),a.mergeProps({key:0},h.$attrs,{"aria-controls":a.unref(s),"aria-describedby":a.unref(o),"aria-expanded":a.unref(u),"aria-haspopup":a.unref(l)}),{default:a.withCtx(()=>[a.renderSlot(h.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var vC=je(yC,[["__file","trigger.vue"]]);const qu="focus-trap.focus-after-trapped",Ku="focus-trap.focus-after-released",bC="focus-trap.focusout-prevented",sg={cancelable:!0,bubbles:!1},xC={cancelable:!0,bubbles:!1},og="focusAfterTrapped",ag="focusAfterReleased",wC=Symbol("elFocusTrap"),Qu=a.ref(),Sl=a.ref(0),ed=a.ref(0);let _l=0;const lg=n=>{const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0||i===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e},cg=(n,e)=>{for(const t of n)if(!MC(t,e))return t},MC=(n,e)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(e&&n===e)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1},SC=n=>{const e=lg(n),t=cg(e,n),i=cg(e.reverse(),n);return[t,i]},_C=n=>n instanceof HTMLInputElement&&"select"in n,Yi=(n,e)=>{if(n&&n.focus){const t=document.activeElement;n.focus({preventScroll:!0}),ed.value=window.performance.now(),n!==t&&_C(n)&&e&&n.select()}};function ug(n,e){const t=[...n],i=n.indexOf(e);return i!==-1&&t.splice(i,1),t}const TC=()=>{let n=[];return{push:i=>{const r=n[0];r&&i!==r&&r.pause(),n=ug(n,i),n.unshift(i)},remove:i=>{var r,s;n=ug(n,i),(s=(r=n[0])==null?void 0:r.resume)==null||s.call(r)}}},EC=(n,e=!1)=>{const t=document.activeElement;for(const i of n)if(Yi(i,e),document.activeElement!==t)return},dg=TC(),CC=()=>Sl.value>ed.value,Tl=()=>{Qu.value="pointer",Sl.value=window.performance.now()},hg=()=>{Qu.value="keyboard",Sl.value=window.performance.now()},AC=()=>(a.onMounted(()=>{_l===0&&(document.addEventListener("mousedown",Tl),document.addEventListener("touchstart",Tl),document.addEventListener("keydown",hg)),_l++}),a.onBeforeUnmount(()=>{_l--,_l<=0&&(document.removeEventListener("mousedown",Tl),document.removeEventListener("touchstart",Tl),document.removeEventListener("keydown",hg))}),{focusReason:Qu,lastUserFocusTimestamp:Sl,lastAutomatedFocusTimestamp:ed}),El=n=>new CustomEvent(bC,{...xC,detail:n}),LC=a.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[og,ag,"focusin","focusout","focusout-prevented","release-requested"],setup(n,{emit:e}){const t=a.ref();let i,r;const{focusReason:s}=AC();vE(p=>{n.trapped&&!o.paused&&e("release-requested",p)});const o={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=p=>{if(!n.loop&&!n.trapped||o.paused)return;const{key:d,altKey:b,ctrlKey:v,metaKey:g,currentTarget:M,shiftKey:_}=p,{loop:E}=n,S=d===Jn.tab&&!b&&!v&&!g,w=document.activeElement;if(S&&w){const T=M,[C,R]=SC(T);if(C&&R){if(!_&&w===R){const L=El({focusReason:s.value});e("focusout-prevented",L),L.defaultPrevented||(p.preventDefault(),E&&Yi(C,!0))}else if(_&&[C,T].includes(w)){const L=El({focusReason:s.value});e("focusout-prevented",L),L.defaultPrevented||(p.preventDefault(),E&&Yi(R,!0))}}else if(w===T){const L=El({focusReason:s.value});e("focusout-prevented",L),L.defaultPrevented||p.preventDefault()}}};a.provide(wC,{focusTrapRef:t,onKeydown:l}),a.watch(()=>n.focusTrapEl,p=>{p&&(t.value=p)},{immediate:!0}),a.watch([t],([p],[d])=>{p&&(p.addEventListener("keydown",l),p.addEventListener("focusin",f),p.addEventListener("focusout",h)),d&&(d.removeEventListener("keydown",l),d.removeEventListener("focusin",f),d.removeEventListener("focusout",h))});const u=p=>{e(og,p)},c=p=>e(ag,p),f=p=>{const d=a.unref(t);if(!d)return;const b=p.target,v=p.relatedTarget,g=b&&d.contains(b);n.trapped||v&&d.contains(v)||(i=v),g&&e("focusin",p),!o.paused&&n.trapped&&(g?r=b:Yi(r,!0))},h=p=>{const d=a.unref(t);if(!(o.paused||!d))if(n.trapped){const b=p.relatedTarget;!yi(b)&&!d.contains(b)&&setTimeout(()=>{if(!o.paused&&n.trapped){const v=El({focusReason:s.value});e("focusout-prevented",v),v.defaultPrevented||Yi(r,!0)}},0)}else{const b=p.target;b&&d.contains(b)||e("focusout",p)}};async function m(){await a.nextTick();const p=a.unref(t);if(p){dg.push(o);const d=p.contains(document.activeElement)?i:document.activeElement;if(i=d,!p.contains(d)){const v=new Event(qu,sg);p.addEventListener(qu,u),p.dispatchEvent(v),v.defaultPrevented||a.nextTick(()=>{let g=n.focusStartEl;on(g)||(Yi(g),document.activeElement!==g&&(g="first")),g==="first"&&EC(lg(p),!0),(document.activeElement===d||g==="container")&&Yi(p)})}}}function y(){const p=a.unref(t);if(p){p.removeEventListener(qu,u);const d=new CustomEvent(Ku,{...sg,detail:{focusReason:s.value}});p.addEventListener(Ku,c),p.dispatchEvent(d),!d.defaultPrevented&&(s.value=="keyboard"||!CC()||p.contains(document.activeElement))&&Yi(i??document.body),p.removeEventListener(Ku,c),dg.remove(o)}}return a.onMounted(()=>{n.trapped&&m(),a.watch(()=>n.trapped,p=>{p?m():y()})}),a.onBeforeUnmount(()=>{n.trapped&&y(),t.value&&(t.value.removeEventListener("keydown",l),t.value.removeEventListener("focusin",f),t.value.removeEventListener("focusout",h),t.value=void 0)}),{onKeydown:l}}});function RC(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default",{handleKeydown:n.onKeydown})}var PC=je(LC,[["render",RC],["__file","focus-trap.vue"]]);const IC=["fixed","absolute"],OC=Ke({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:Fe(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:ys,default:"bottom"},popperOptions:{type:Fe(Object),default:()=>({})},strategy:{type:String,values:IC,default:"absolute"}}),fg=Ke({...OC,id:String,style:{type:Fe([String,Array,Object])},className:{type:Fe([String,Array,Object])},effect:{type:Fe(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:Fe([String,Array,Object])},popperStyle:{type:Fe([String,Array,Object])},referenceEl:{type:Fe(Object)},triggerTargetEl:{type:Fe(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...Ir(["ariaLabel"])}),NC={mouseenter:n=>n instanceof MouseEvent,mouseleave:n=>n instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},DC=(n,e=[])=>{const{placement:t,strategy:i,popperOptions:r}=n,s={placement:t,strategy:i,...r,modifiers:[...FC(n),...e]};return VC(s,r==null?void 0:r.modifiers),s},BC=n=>{if(Ft)return hi(n)};function FC(n){const{offset:e,gpuAcceleration:t,fallbackPlacements:i}=n;return[{name:"offset",options:{offset:[0,e??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:i}},{name:"computeStyles",options:{gpuAcceleration:t}}]}function VC(n,e){e&&(n.modifiers=[...n.modifiers,...e??[]])}const kC=0,zC=n=>{const{popperInstanceRef:e,contentRef:t,triggerRef:i,role:r}=a.inject(Yu,void 0),s=a.ref(),o=a.ref(),l=a.computed(()=>({name:"eventListeners",enabled:!!n.visible})),u=a.computed(()=>{var v;const g=a.unref(s),M=(v=a.unref(o))!=null?v:kC;return{name:"arrow",enabled:!__(g),options:{element:g,padding:M}}}),c=a.computed(()=>({onFirstUpdate:()=>{p()},...DC(n,[a.unref(u),a.unref(l)])})),f=a.computed(()=>BC(n.referenceEl)||a.unref(i)),{attributes:h,state:m,styles:y,update:p,forceUpdate:d,instanceRef:b}=mE(f,t,c);return a.watch(b,v=>e.value=v),a.onMounted(()=>{a.watch(()=>{var v;return(v=a.unref(f))==null?void 0:v.getBoundingClientRect()},()=>{p()})}),{attributes:h,arrowRef:s,contentRef:t,instanceRef:b,state:m,styles:y,role:r,forceUpdate:d,update:p}},UC=(n,{attributes:e,styles:t,role:i})=>{const{nextZIndex:r}=jm(),s=Ue("popper"),o=a.computed(()=>a.unref(e).popper),l=a.ref(rt(n.zIndex)?n.zIndex:r()),u=a.computed(()=>[s.b(),s.is("pure",n.pure),s.is(n.effect),n.popperClass]),c=a.computed(()=>[{zIndex:a.unref(l)},a.unref(t).popper,n.popperStyle||{}]),f=a.computed(()=>i.value==="dialog"?"false":void 0),h=a.computed(()=>a.unref(t).arrow||{});return{ariaModal:f,arrowStyle:h,contentAttrs:o,contentClass:u,contentStyle:c,contentZIndex:l,updateZIndex:()=>{l.value=rt(n.zIndex)?n.zIndex:r()}}},GC=(n,e)=>{const t=a.ref(!1),i=a.ref();return{focusStartRef:i,trapped:t,onFocusAfterReleased:c=>{var f;((f=c.detail)==null?void 0:f.focusReason)!=="pointer"&&(i.value="first",e("blur"))},onFocusAfterTrapped:()=>{e("focus")},onFocusInTrap:c=>{n.visible&&!t.value&&(c.target&&(i.value=c.target),t.value=!0)},onFocusoutPrevented:c=>{n.trapping||(c.detail.focusReason==="pointer"&&c.preventDefault(),t.value=!1)},onReleaseRequested:()=>{t.value=!1,e("close")}}},HC=a.defineComponent({name:"ElPopperContent"}),WC=a.defineComponent({...HC,props:fg,emits:NC,setup(n,{expose:e,emit:t}){const i=n,{focusStartRef:r,trapped:s,onFocusAfterReleased:o,onFocusAfterTrapped:l,onFocusInTrap:u,onFocusoutPrevented:c,onReleaseRequested:f}=GC(i,t),{attributes:h,arrowRef:m,contentRef:y,styles:p,instanceRef:d,role:b,update:v}=zC(i),{ariaModal:g,arrowStyle:M,contentAttrs:_,contentClass:E,contentStyle:S,updateZIndex:w}=UC(i,{styles:p,attributes:h,role:b}),T=a.inject(wl,void 0),C=a.ref();a.provide(Qm,{arrowStyle:M,arrowRef:m,arrowOffset:C}),T&&a.provide(wl,{...T,addInputId:Oo,removeInputId:Oo});let R;const P=(A=!0)=>{v(),A&&w()},L=()=>{P(!1),i.visible&&i.focusOnShow?s.value=!0:i.visible===!1&&(s.value=!1)};return a.onMounted(()=>{a.watch(()=>i.triggerTargetEl,(A,I)=>{R==null||R(),R=void 0;const O=a.unref(A||y.value),x=a.unref(I||y.value);Ar(O)&&(R=a.watch([b,()=>i.ariaLabel,g,()=>i.id],N=>{["role","aria-label","aria-modal","id"].forEach((B,D)=>{yi(N[D])?O.removeAttribute(B):O.setAttribute(B,N[D])})},{immediate:!0})),x!==O&&Ar(x)&&["role","aria-label","aria-modal","id"].forEach(N=>{x.removeAttribute(N)})},{immediate:!0}),a.watch(()=>i.visible,L,{immediate:!0})}),a.onBeforeUnmount(()=>{R==null||R(),R=void 0}),e({popperContentRef:y,popperInstanceRef:d,updatePopper:P,contentStyle:S}),(A,I)=>(a.openBlock(),a.createElementBlock("div",a.mergeProps({ref_key:"contentRef",ref:y},a.unref(_),{style:a.unref(S),class:a.unref(E),tabindex:"-1",onMouseenter:O=>A.$emit("mouseenter",O),onMouseleave:O=>A.$emit("mouseleave",O)}),[a.createVNode(a.unref(PC),{trapped:a.unref(s),"trap-on-focus-in":!0,"focus-trap-el":a.unref(y),"focus-start-el":a.unref(r),onFocusAfterTrapped:a.unref(l),onFocusAfterReleased:a.unref(o),onFocusin:a.unref(u),onFocusoutPrevented:a.unref(c),onReleaseRequested:a.unref(f)},{default:a.withCtx(()=>[a.renderSlot(A.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var jC=je(WC,[["__file","content.vue"]]);const $C=Ht(dC),td=Symbol("elTooltip"),gn=Ke({...wE,...fg,appendTo:{type:Fe([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:Fe(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...Ir(["ariaLabel"])}),Xo=Ke({...rg,disabled:Boolean,trigger:{type:Fe([String,Array]),default:"hover"},triggerKeys:{type:Fe(Array),default:()=>[Jn.enter,Jn.space]}}),{useModelToggleProps:ZC,useModelToggleEmits:XC,useModelToggle:YC}=hT("visible"),JC=Ke({...eg,...ZC,...gn,...Xo,...tg,showArrow:{type:Boolean,default:!0}}),qC=[...XC,"before-show","before-hide","show","hide","open","close"],KC=(n,e)=>dn(n)?n.includes(e):n===e,Es=(n,e,t)=>i=>{KC(a.unref(n),e)&&t(i)},QC=a.defineComponent({name:"ElTooltipTrigger"}),eA=a.defineComponent({...QC,props:Xo,setup(n,{expose:e}){const t=n,i=Ue("tooltip"),{controlled:r,id:s,open:o,onOpen:l,onClose:u,onToggle:c}=a.inject(td,void 0),f=a.ref(null),h=()=>{if(a.unref(r)||t.disabled)return!0},m=a.toRef(t,"trigger"),y=di(h,Es(m,"hover",l)),p=di(h,Es(m,"hover",u)),d=di(h,Es(m,"click",_=>{_.button===0&&c(_)})),b=di(h,Es(m,"focus",l)),v=di(h,Es(m,"focus",u)),g=di(h,Es(m,"contextmenu",_=>{_.preventDefault(),c(_)})),M=di(h,_=>{const{code:E}=_;t.triggerKeys.includes(E)&&(_.preventDefault(),c(_))});return e({triggerRef:f}),(_,E)=>(a.openBlock(),a.createBlock(a.unref(vC),{id:a.unref(s),"virtual-ref":_.virtualRef,open:a.unref(o),"virtual-triggering":_.virtualTriggering,class:a.normalizeClass(a.unref(i).e("trigger")),onBlur:a.unref(v),onClick:a.unref(d),onContextmenu:a.unref(g),onFocus:a.unref(b),onMouseenter:a.unref(y),onMouseleave:a.unref(p),onKeydown:a.unref(M)},{default:a.withCtx(()=>[a.renderSlot(_.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var tA=je(eA,[["__file","trigger.vue"]]);const nA=Ke({to:{type:Fe([String,Object]),required:!0},disabled:Boolean});var iA=je(a.defineComponent({__name:"teleport",props:nA,setup(n){return(e,t)=>e.disabled?a.renderSlot(e.$slots,"default",{key:0}):(a.openBlock(),a.createBlock(a.Teleport,{key:1,to:e.to},[a.renderSlot(e.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const rA=Ht(iA),sA=a.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),oA=a.defineComponent({...sA,props:gn,setup(n,{expose:e}){const t=n,{selector:i}=Vm(),r=Ue("tooltip"),s=a.ref(null);let o;const{controlled:l,id:u,open:c,trigger:f,onClose:h,onOpen:m,onShow:y,onHide:p,onBeforeShow:d,onBeforeHide:b}=a.inject(td,void 0),v=a.computed(()=>t.transition||`${r.namespace.value}-fade-in-linear`),g=a.computed(()=>process.env.NODE_ENV==="test"?!0:t.persistent);a.onBeforeUnmount(()=>{o==null||o()});const M=a.computed(()=>a.unref(g)?!0:a.unref(c)),_=a.computed(()=>t.disabled?!1:a.unref(c)),E=a.computed(()=>t.appendTo||i.value),S=a.computed(()=>{var x;return(x=t.style)!=null?x:{}}),w=a.ref(!0),T=()=>{p(),w.value=!0},C=()=>{if(a.unref(l))return!0},R=di(C,()=>{t.enterable&&a.unref(f)==="hover"&&m()}),P=di(C,()=>{a.unref(f)==="hover"&&h()}),L=()=>{var x,N;(N=(x=s.value)==null?void 0:x.updatePopper)==null||N.call(x),d==null||d()},A=()=>{b==null||b()},I=()=>{y(),o=mw(a.computed(()=>{var x;return(x=s.value)==null?void 0:x.popperContentRef}),()=>{if(a.unref(l))return;a.unref(f)!=="hover"&&h()})},O=()=>{t.virtualTriggering||h()};return a.watch(()=>a.unref(c),x=>{x?w.value=!1:o==null||o()},{flush:"post"}),a.watch(()=>t.content,()=>{var x,N;(N=(x=s.value)==null?void 0:x.updatePopper)==null||N.call(x)}),e({contentRef:s}),(x,N)=>(a.openBlock(),a.createBlock(a.unref(rA),{disabled:!x.teleported,to:a.unref(E)},{default:a.withCtx(()=>[a.createVNode(a.Transition,{name:a.unref(v),onAfterLeave:T,onBeforeEnter:L,onAfterEnter:I,onBeforeLeave:A},{default:a.withCtx(()=>[a.unref(M)?a.withDirectives((a.openBlock(),a.createBlock(a.unref(jC),a.mergeProps({key:0,id:a.unref(u),ref_key:"contentRef",ref:s},x.$attrs,{"aria-label":x.ariaLabel,"aria-hidden":w.value,"boundaries-padding":x.boundariesPadding,"fallback-placements":x.fallbackPlacements,"gpu-acceleration":x.gpuAcceleration,offset:x.offset,placement:x.placement,"popper-options":x.popperOptions,strategy:x.strategy,effect:x.effect,enterable:x.enterable,pure:x.pure,"popper-class":x.popperClass,"popper-style":[x.popperStyle,a.unref(S)],"reference-el":x.referenceEl,"trigger-target-el":x.triggerTargetEl,visible:a.unref(_),"z-index":x.zIndex,onMouseenter:a.unref(R),onMouseleave:a.unref(P),onBlur:O,onClose:a.unref(h)}),{default:a.withCtx(()=>[a.renderSlot(x.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[a.vShow,a.unref(_)]]):a.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var aA=je(oA,[["__file","content.vue"]]);const lA=a.defineComponent({name:"ElTooltip"}),cA=a.defineComponent({...lA,props:JC,emits:qC,setup(n,{expose:e,emit:t}){const i=n;xE();const r=bl(),s=a.ref(),o=a.ref(),l=()=>{var v;const g=a.unref(s);g&&((v=g.popperInstanceRef)==null||v.update())},u=a.ref(!1),c=a.ref(),{show:f,hide:h,hasUpdateHandler:m}=YC({indicator:u,toggleReason:c}),{onOpen:y,onClose:p}=ME({showAfter:a.toRef(i,"showAfter"),hideAfter:a.toRef(i,"hideAfter"),autoClose:a.toRef(i,"autoClose"),open:f,close:h}),d=a.computed(()=>Au(i.visible)&&!m.value);a.provide(td,{controlled:d,id:r,open:a.readonly(u),trigger:a.toRef(i,"trigger"),onOpen:v=>{y(v)},onClose:v=>{p(v)},onToggle:v=>{a.unref(u)?p(v):y(v)},onShow:()=>{t("show",c.value)},onHide:()=>{t("hide",c.value)},onBeforeShow:()=>{t("before-show",c.value)},onBeforeHide:()=>{t("before-hide",c.value)},updatePopper:l}),a.watch(()=>i.disabled,v=>{v&&u.value&&(u.value=!1)});const b=v=>{var g,M;const _=(M=(g=o.value)==null?void 0:g.contentRef)==null?void 0:M.popperContentRef,E=(v==null?void 0:v.relatedTarget)||document.activeElement;return _&&_.contains(E)};return a.onDeactivated(()=>u.value&&h()),e({popperRef:s,contentRef:o,isFocusInsideContent:b,updatePopper:l,onOpen:y,onClose:p,hide:h}),(v,g)=>(a.openBlock(),a.createBlock(a.unref($C),{ref_key:"popperRef",ref:s,role:v.role},{default:a.withCtx(()=>[a.createVNode(tA,{disabled:v.disabled,trigger:v.trigger,"trigger-keys":v.triggerKeys,"virtual-ref":v.virtualRef,"virtual-triggering":v.virtualTriggering},{default:a.withCtx(()=>[v.$slots.default?a.renderSlot(v.$slots,"default",{key:0}):a.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),a.createVNode(aA,{ref_key:"contentRef",ref:o,"aria-label":v.ariaLabel,"boundaries-padding":v.boundariesPadding,content:v.content,disabled:v.disabled,effect:v.effect,enterable:v.enterable,"fallback-placements":v.fallbackPlacements,"hide-after":v.hideAfter,"gpu-acceleration":v.gpuAcceleration,offset:v.offset,persistent:v.persistent,"popper-class":v.popperClass,"popper-style":v.popperStyle,placement:v.placement,"popper-options":v.popperOptions,pure:v.pure,"raw-content":v.rawContent,"reference-el":v.referenceEl,"trigger-target-el":v.triggerTargetEl,"show-after":v.showAfter,strategy:v.strategy,teleported:v.teleported,transition:v.transition,"virtual-triggering":v.virtualTriggering,"z-index":v.zIndex,"append-to":v.appendTo},{default:a.withCtx(()=>[a.renderSlot(v.$slots,"content",{},()=>[v.rawContent?(a.openBlock(),a.createElementBlock("span",{key:0,innerHTML:v.content},null,8,["innerHTML"])):(a.openBlock(),a.createElementBlock("span",{key:1},a.toDisplayString(v.content),1))]),v.showArrow?(a.openBlock(),a.createBlock(a.unref(pC),{key:0,"arrow-offset":v.arrowOffset},null,8,["arrow-offset"])):a.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var uA=je(cA,[["__file","tooltip.vue"]]);const nd=Ht(uA),pg=Symbol("buttonGroupContextKey"),dA=(n,e)=>{rT({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},a.computed(()=>n.type==="text"));const t=a.inject(pg,void 0),i=Wu("button"),{form:r}=Zo(),s=_s(a.computed(()=>t==null?void 0:t.size)),o=Ml(),l=a.ref(),u=a.useSlots(),c=a.computed(()=>n.type||(t==null?void 0:t.type)||""),f=a.computed(()=>{var p,d,b;return(b=(d=n.autoInsertSpace)!=null?d:(p=i.value)==null?void 0:p.autoInsertSpace)!=null?b:!1}),h=a.computed(()=>n.tag==="button"?{ariaDisabled:o.value||n.loading,disabled:o.value||n.loading,autofocus:n.autofocus,type:n.nativeType}:{}),m=a.computed(()=>{var p;const d=(p=u.default)==null?void 0:p.call(u);if(f.value&&(d==null?void 0:d.length)===1){const b=d[0];if((b==null?void 0:b.type)===a.Text){const v=b.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(v.trim())}}return!1});return{_disabled:o,_size:s,_type:c,_ref:l,_props:h,shouldAddSpace:m,handleClick:p=>{if(o.value||n.loading){p.stopPropagation();return}n.nativeType==="reset"&&(r==null||r.resetFields()),e("click",p)}}},id=Ke({size:Ss,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:$i},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:$i,default:()=>am},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:Fe([String,Object]),default:"button"}}),hA={click:n=>n instanceof MouseEvent};function Xt(n,e){fA(n)&&(n="100%");var t=pA(n);return n=e===360?n:Math.min(e,Math.max(0,parseFloat(n))),t&&(n=parseInt(String(n*e),10)/100),Math.abs(n-e)<1e-6?1:(e===360?n=(n<0?n%e+e:n%e)/parseFloat(String(e)):n=n%e/parseFloat(String(e)),n)}function Cl(n){return Math.min(1,Math.max(0,n))}function fA(n){return typeof n=="string"&&n.indexOf(".")!==-1&&parseFloat(n)===1}function pA(n){return typeof n=="string"&&n.indexOf("%")!==-1}function mg(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function Al(n){return n<=1?"".concat(Number(n)*100,"%"):n}function Or(n){return n.length===1?"0"+n:String(n)}function mA(n,e,t){return{r:Xt(n,255)*255,g:Xt(e,255)*255,b:Xt(t,255)*255}}function gg(n,e,t){n=Xt(n,255),e=Xt(e,255),t=Xt(t,255);var i=Math.max(n,e,t),r=Math.min(n,e,t),s=0,o=0,l=(i+r)/2;if(i===r)o=0,s=0;else{var u=i-r;switch(o=l>.5?u/(2-i-r):u/(i+r),i){case n:s=(e-t)/u+(e1&&(t-=1),t<1/6?n+(e-n)*(6*t):t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function gA(n,e,t){var i,r,s;if(n=Xt(n,360),e=Xt(e,100),t=Xt(t,100),e===0)r=t,s=t,i=t;else{var o=t<.5?t*(1+e):t+e-t*e,l=2*t-o;i=rd(l,o,n+1/3),r=rd(l,o,n),s=rd(l,o,n-1/3)}return{r:i*255,g:r*255,b:s*255}}function yg(n,e,t){n=Xt(n,255),e=Xt(e,255),t=Xt(t,255);var i=Math.max(n,e,t),r=Math.min(n,e,t),s=0,o=i,l=i-r,u=i===0?0:l/i;if(i===r)s=0;else{switch(i){case n:s=(e-t)/l+(e>16,g:(n&65280)>>8,b:n&255}}var sd={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function wA(n){var e={r:0,g:0,b:0},t=1,i=null,r=null,s=null,o=!1,l=!1;return typeof n=="string"&&(n=_A(n)),typeof n=="object"&&(wi(n.r)&&wi(n.g)&&wi(n.b)?(e=mA(n.r,n.g,n.b),o=!0,l=String(n.r).substr(-1)==="%"?"prgb":"rgb"):wi(n.h)&&wi(n.s)&&wi(n.v)?(i=Al(n.s),r=Al(n.v),e=yA(n.h,i,r),o=!0,l="hsv"):wi(n.h)&&wi(n.s)&&wi(n.l)&&(i=Al(n.s),s=Al(n.l),e=gA(n.h,i,s),o=!0,l="hsl"),Object.prototype.hasOwnProperty.call(n,"a")&&(t=n.a)),t=mg(t),{ok:o,format:n.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var MA="[-\\+]?\\d+%?",SA="[-\\+]?\\d*\\.\\d+%?",Ji="(?:".concat(SA,")|(?:").concat(MA,")"),od="[\\s|\\(]+(".concat(Ji,")[,|\\s]+(").concat(Ji,")[,|\\s]+(").concat(Ji,")\\s*\\)?"),ad="[\\s|\\(]+(".concat(Ji,")[,|\\s]+(").concat(Ji,")[,|\\s]+(").concat(Ji,")[,|\\s]+(").concat(Ji,")\\s*\\)?"),Bn={CSS_UNIT:new RegExp(Ji),rgb:new RegExp("rgb"+od),rgba:new RegExp("rgba"+ad),hsl:new RegExp("hsl"+od),hsla:new RegExp("hsla"+ad),hsv:new RegExp("hsv"+od),hsva:new RegExp("hsva"+ad),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function _A(n){if(n=n.trim().toLowerCase(),n.length===0)return!1;var e=!1;if(sd[n])n=sd[n],e=!0;else if(n==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=Bn.rgb.exec(n);return t?{r:t[1],g:t[2],b:t[3]}:(t=Bn.rgba.exec(n),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Bn.hsl.exec(n),t?{h:t[1],s:t[2],l:t[3]}:(t=Bn.hsla.exec(n),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Bn.hsv.exec(n),t?{h:t[1],s:t[2],v:t[3]}:(t=Bn.hsva.exec(n),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Bn.hex8.exec(n),t?{r:yn(t[1]),g:yn(t[2]),b:yn(t[3]),a:bg(t[4]),format:e?"name":"hex8"}:(t=Bn.hex6.exec(n),t?{r:yn(t[1]),g:yn(t[2]),b:yn(t[3]),format:e?"name":"hex"}:(t=Bn.hex4.exec(n),t?{r:yn(t[1]+t[1]),g:yn(t[2]+t[2]),b:yn(t[3]+t[3]),a:bg(t[4]+t[4]),format:e?"name":"hex8"}:(t=Bn.hex3.exec(n),t?{r:yn(t[1]+t[1]),g:yn(t[2]+t[2]),b:yn(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function wi(n){return!!Bn.CSS_UNIT.exec(String(n))}var TA=function(){function n(e,t){e===void 0&&(e=""),t===void 0&&(t={});var i;if(e instanceof n)return e;typeof e=="number"&&(e=xA(e)),this.originalInput=e;var r=wA(e);this.originalInput=e,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(i=t.format)!==null&&i!==void 0?i:r.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return n.prototype.isDark=function(){return this.getBrightness()<128},n.prototype.isLight=function(){return!this.isDark()},n.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},n.prototype.getLuminance=function(){var e=this.toRgb(),t,i,r,s=e.r/255,o=e.g/255,l=e.b/255;return s<=.03928?t=s/12.92:t=Math.pow((s+.055)/1.055,2.4),o<=.03928?i=o/12.92:i=Math.pow((o+.055)/1.055,2.4),l<=.03928?r=l/12.92:r=Math.pow((l+.055)/1.055,2.4),.2126*t+.7152*i+.0722*r},n.prototype.getAlpha=function(){return this.a},n.prototype.setAlpha=function(e){return this.a=mg(e),this.roundA=Math.round(100*this.a)/100,this},n.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},n.prototype.toHsv=function(){var e=yg(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},n.prototype.toHsvString=function(){var e=yg(this.r,this.g,this.b),t=Math.round(e.h*360),i=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?"hsv(".concat(t,", ").concat(i,"%, ").concat(r,"%)"):"hsva(".concat(t,", ").concat(i,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHsl=function(){var e=gg(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},n.prototype.toHslString=function(){var e=gg(this.r,this.g,this.b),t=Math.round(e.h*360),i=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?"hsl(".concat(t,", ").concat(i,"%, ").concat(r,"%)"):"hsla(".concat(t,", ").concat(i,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHex=function(e){return e===void 0&&(e=!1),vg(this.r,this.g,this.b,e)},n.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},n.prototype.toHex8=function(e){return e===void 0&&(e=!1),vA(this.r,this.g,this.b,this.a,e)},n.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},n.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},n.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},n.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),i=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(t,", ").concat(i,")"):"rgba(".concat(e,", ").concat(t,", ").concat(i,", ").concat(this.roundA,")")},n.prototype.toPercentageRgb=function(){var e=function(t){return"".concat(Math.round(Xt(t,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},n.prototype.toPercentageRgbString=function(){var e=function(t){return Math.round(Xt(t,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},n.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+vg(this.r,this.g,this.b,!1),t=0,i=Object.entries(sd);t=0,s=!t&&r&&(e.startsWith("hex")||e==="name");return s?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(i=this.toRgbString()),e==="prgb"&&(i=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(i=this.toHexString()),e==="hex3"&&(i=this.toHexString(!0)),e==="hex4"&&(i=this.toHex8String(!0)),e==="hex8"&&(i=this.toHex8String()),e==="name"&&(i=this.toName()),e==="hsl"&&(i=this.toHslString()),e==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},n.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},n.prototype.clone=function(){return new n(this.toString())},n.prototype.lighten=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l+=e/100,t.l=Cl(t.l),new n(t)},n.prototype.brighten=function(e){e===void 0&&(e=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new n(t)},n.prototype.darken=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l-=e/100,t.l=Cl(t.l),new n(t)},n.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},n.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},n.prototype.desaturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s-=e/100,t.s=Cl(t.s),new n(t)},n.prototype.saturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s+=e/100,t.s=Cl(t.s),new n(t)},n.prototype.greyscale=function(){return this.desaturate(100)},n.prototype.spin=function(e){var t=this.toHsl(),i=(t.h+e)%360;return t.h=i<0?360+i:i,new n(t)},n.prototype.mix=function(e,t){t===void 0&&(t=50);var i=this.toRgb(),r=new n(e).toRgb(),s=t/100,o={r:(r.r-i.r)*s+i.r,g:(r.g-i.g)*s+i.g,b:(r.b-i.b)*s+i.b,a:(r.a-i.a)*s+i.a};return new n(o)},n.prototype.analogous=function(e,t){e===void 0&&(e=6),t===void 0&&(t=30);var i=this.toHsl(),r=360/t,s=[this];for(i.h=(i.h-(r*e>>1)+720)%360;--e;)i.h=(i.h+r)%360,s.push(new n(i));return s},n.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new n(e)},n.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var t=this.toHsv(),i=t.h,r=t.s,s=t.v,o=[],l=1/e;e--;)o.push(new n({h:i,s:r,v:s})),s=(s+l)%1;return o},n.prototype.splitcomplement=function(){var e=this.toHsl(),t=e.h;return[this,new n({h:(t+72)%360,s:e.s,l:e.l}),new n({h:(t+216)%360,s:e.s,l:e.l})]},n.prototype.onBackground=function(e){var t=this.toRgb(),i=new n(e).toRgb(),r=t.a+i.a*(1-t.a);return new n({r:(t.r*t.a+i.r*i.a*(1-t.a))/r,g:(t.g*t.a+i.g*i.a*(1-t.a))/r,b:(t.b*t.a+i.b*i.a*(1-t.a))/r,a:r})},n.prototype.triad=function(){return this.polyad(3)},n.prototype.tetrad=function(){return this.polyad(4)},n.prototype.polyad=function(e){for(var t=this.toHsl(),i=t.h,r=[this],s=360/e,o=1;o{let i={},r=n.color;if(r){const s=r.match(/var\((.*?)\)/);s&&(r=window.getComputedStyle(window.document.documentElement).getPropertyValue(s[1]));const o=new TA(r),l=n.dark?o.tint(20).toString():qi(o,20);if(n.plain)i=t.cssVarBlock({"bg-color":n.dark?qi(o,90):o.tint(90).toString(),"text-color":r,"border-color":n.dark?qi(o,50):o.tint(50).toString(),"hover-text-color":`var(${t.cssVarName("color-white")})`,"hover-bg-color":r,"hover-border-color":r,"active-bg-color":l,"active-text-color":`var(${t.cssVarName("color-white")})`,"active-border-color":l}),e.value&&(i[t.cssVarBlockName("disabled-bg-color")]=n.dark?qi(o,90):o.tint(90).toString(),i[t.cssVarBlockName("disabled-text-color")]=n.dark?qi(o,50):o.tint(50).toString(),i[t.cssVarBlockName("disabled-border-color")]=n.dark?qi(o,80):o.tint(80).toString());else{const u=n.dark?qi(o,30):o.tint(30).toString(),c=o.isDark()?`var(${t.cssVarName("color-white")})`:`var(${t.cssVarName("color-black")})`;if(i=t.cssVarBlock({"bg-color":r,"text-color":c,"border-color":r,"hover-bg-color":u,"hover-text-color":c,"hover-border-color":u,"active-bg-color":l,"active-border-color":l}),e.value){const f=n.dark?qi(o,50):o.tint(50).toString();i[t.cssVarBlockName("disabled-bg-color")]=f,i[t.cssVarBlockName("disabled-text-color")]=n.dark?"rgba(255, 255, 255, 0.5)":`var(${t.cssVarName("color-white")})`,i[t.cssVarBlockName("disabled-border-color")]=f}}}return i})}const CA=a.defineComponent({name:"ElButton"}),AA=a.defineComponent({...CA,props:id,emits:hA,setup(n,{expose:e,emit:t}){const i=n,r=EA(i),s=Ue("button"),{_ref:o,_size:l,_type:u,_disabled:c,_props:f,shouldAddSpace:h,handleClick:m}=dA(i,t),y=a.computed(()=>[s.b(),s.m(u.value),s.m(l.value),s.is("disabled",c.value),s.is("loading",i.loading),s.is("plain",i.plain),s.is("round",i.round),s.is("circle",i.circle),s.is("text",i.text),s.is("link",i.link),s.is("has-bg",i.bg)]);return e({ref:o,size:l,type:u,disabled:c,shouldAddSpace:h}),(p,d)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(p.tag),a.mergeProps({ref_key:"_ref",ref:o},a.unref(f),{class:a.unref(y),style:a.unref(r),onClick:a.unref(m)}),{default:a.withCtx(()=>[p.loading?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[p.$slots.loading?a.renderSlot(p.$slots,"loading",{key:0}):(a.openBlock(),a.createBlock(a.unref(yt),{key:1,class:a.normalizeClass(a.unref(s).is("loading"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(p.loadingIcon)))]),_:1},8,["class"]))],64)):p.icon||p.$slots.icon?(a.openBlock(),a.createBlock(a.unref(yt),{key:1},{default:a.withCtx(()=>[p.icon?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(p.icon),{key:0})):a.renderSlot(p.$slots,"icon",{key:1})]),_:3})):a.createCommentVNode("v-if",!0),p.$slots.default?(a.openBlock(),a.createElementBlock("span",{key:2,class:a.normalizeClass({[a.unref(s).em("text","expand")]:a.unref(h)})},[a.renderSlot(p.$slots,"default")],2)):a.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var LA=je(AA,[["__file","button.vue"]]);const RA={size:id.size,type:id.type},PA=a.defineComponent({name:"ElButtonGroup"}),IA=a.defineComponent({...PA,props:RA,setup(n){const e=n;a.provide(pg,a.reactive({size:a.toRef(e,"size"),type:a.toRef(e,"type")}));const t=Ue("button");return(i,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(t).b("group"))},[a.renderSlot(i.$slots,"default")],2))}});var xg=je(IA,[["__file","button-group.vue"]]);const Cs=Ht(LA,{ButtonGroup:xg});vi(xg);var Ki=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function OA(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Ll(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?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(n).forEach(function(i){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}),t}const Qi=new Map;if(Ft){let n;document.addEventListener("mousedown",e=>n=e),document.addEventListener("mouseup",e=>{if(n){for(const t of Qi.values())for(const{documentHandler:i}of t)i(e,n);n=void 0}})}function wg(n,e){let t=[];return Array.isArray(e.arg)?t=e.arg:Ar(e.arg)&&t.push(e.arg),function(i,r){const s=e.instance.popperRef,o=i.target,l=r==null?void 0:r.target,u=!e||!e.instance,c=!o||!l,f=n.contains(o)||n.contains(l),h=n===o,m=t.length&&t.some(p=>p==null?void 0:p.contains(o))||t.length&&t.includes(l),y=s&&(s.contains(o)||s.contains(l));u||c||f||h||m||y||e.value(i,r)}}const NA={beforeMount(n,e){Qi.has(n)||Qi.set(n,[]),Qi.get(n).push({documentHandler:wg(n,e),bindingFn:e.value})},updated(n,e){Qi.has(n)||Qi.set(n,[]);const t=Qi.get(n),i=t.findIndex(s=>s.bindingFn===e.oldValue),r={documentHandler:wg(n,e),bindingFn:e.value};i>=0?t.splice(i,1,r):t.push(r)},unmounted(n){Qi.delete(n)}},DA=100,BA=600,Mg={beforeMount(n,e){const t=e.value,{interval:i=DA,delay:r=BA}=en(t)?{}:t;let s,o;const l=()=>en(t)?t():t.handler(),u=()=>{o&&(clearTimeout(o),o=void 0),s&&(clearInterval(s),s=void 0)};n.addEventListener("mousedown",c=>{c.button===0&&(u(),l(),document.addEventListener("mouseup",()=>u(),{once:!0}),o=setTimeout(()=>{s=setInterval(()=>{l()},i)},r))})}},ld=Ke({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:dm},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),FA={close:n=>n instanceof MouseEvent,click:n=>n instanceof MouseEvent},VA=a.defineComponent({name:"ElTag"}),kA=a.defineComponent({...VA,props:ld,emits:FA,setup(n,{emit:e}){const t=n,i=_s(),r=Ue("tag"),s=a.computed(()=>{const{type:c,hit:f,effect:h,closable:m,round:y}=t;return[r.b(),r.is("closable",m),r.m(c||"primary"),r.m(i.value),r.m(h),r.is("hit",f),r.is("round",y)]}),o=c=>{e("close",c)},l=c=>{e("click",c)},u=c=>{c.component.subTree.component.bum=null};return(c,f)=>c.disableTransitions?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle({backgroundColor:c.color}),onClick:l},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(r).e("content"))},[a.renderSlot(c.$slots,"default")],2),c.closable?(a.openBlock(),a.createBlock(a.unref(yt),{key:0,class:a.normalizeClass(a.unref(r).e("close")),onClick:a.withModifiers(o,["stop"])},{default:a.withCtx(()=>[a.createVNode(a.unref(Pu))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0)],6)):(a.openBlock(),a.createBlock(a.Transition,{key:1,name:`${a.unref(r).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:u},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle({backgroundColor:c.color}),onClick:l},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(r).e("content"))},[a.renderSlot(c.$slots,"default")],2),c.closable?(a.openBlock(),a.createBlock(a.unref(yt),{key:0,class:a.normalizeClass(a.unref(r).e("close")),onClick:a.withModifiers(o,["stop"])},{default:a.withCtx(()=>[a.createVNode(a.unref(Pu))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var zA=je(kA,[["__file","tag.vue"]]);const UA=Ht(zA),Sg=Symbol("rowContextKey"),GA=Ke({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:["start","center","end","space-around","space-between","space-evenly"],default:"start"},align:{type:String,values:["top","middle","bottom"]}}),HA=a.defineComponent({name:"ElRow"}),WA=a.defineComponent({...HA,props:GA,setup(n){const e=n,t=Ue("row"),i=a.computed(()=>e.gutter);a.provide(Sg,{gutter:i});const r=a.computed(()=>{const o={};return e.gutter&&(o.marginRight=o.marginLeft=`-${e.gutter/2}px`),o}),s=a.computed(()=>[t.b(),t.is(`justify-${e.justify}`,e.justify!=="start"),t.is(`align-${e.align}`,!!e.align)]);return(o,l)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.tag),{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle(a.unref(r))},{default:a.withCtx(()=>[a.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});var jA=je(WA,[["__file","row.vue"]]);const Qn=Ht(jA),$A=Ke({tag:{type:String,default:"div"},span:{type:Number,default:24},offset:{type:Number,default:0},pull:{type:Number,default:0},push:{type:Number,default:0},xs:{type:Fe([Number,Object]),default:()=>bi({})},sm:{type:Fe([Number,Object]),default:()=>bi({})},md:{type:Fe([Number,Object]),default:()=>bi({})},lg:{type:Fe([Number,Object]),default:()=>bi({})},xl:{type:Fe([Number,Object]),default:()=>bi({})}}),ZA=a.defineComponent({name:"ElCol"}),XA=a.defineComponent({...ZA,props:$A,setup(n){const e=n,{gutter:t}=a.inject(Sg,{gutter:a.computed(()=>0)}),i=Ue("col"),r=a.computed(()=>{const o={};return t.value&&(o.paddingLeft=o.paddingRight=`${t.value/2}px`),o}),s=a.computed(()=>{const o=[];return["span","offset","pull","push"].forEach(c=>{const f=e[c];rt(f)&&(c==="span"?o.push(i.b(`${e[c]}`)):f>0&&o.push(i.b(`${c}-${e[c]}`)))}),["xs","sm","md","lg","xl"].forEach(c=>{rt(e[c])?o.push(i.b(`${c}-${e[c]}`)):an(e[c])&&Object.entries(e[c]).forEach(([f,h])=>{o.push(f!=="span"?i.b(`${c}-${f}-${h}`):i.b(`${c}-${h}`))})}),t.value&&o.push(i.is("guttered")),[i.b(),o]});return(o,l)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.tag),{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle(a.unref(r))},{default:a.withCtx(()=>[a.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});var YA=je(XA,[["__file","col.vue"]]);const Fn=Ht(YA),_g=n=>rt(n)||on(n)||dn(n),JA=Ke({accordion:Boolean,modelValue:{type:Fe([Array,String,Number]),default:()=>bi([])}}),qA={[gt]:_g,[Zi]:_g},Tg=Symbol("collapseContextKey"),KA=(n,e)=>{const t=a.ref(Yn(n.modelValue)),i=s=>{t.value=s;const o=n.accordion?t.value[0]:t.value;e(gt,o),e(Zi,o)},r=s=>{if(n.accordion)i([t.value[0]===s?"":s]);else{const o=[...t.value],l=o.indexOf(s);l>-1?o.splice(l,1):o.push(s),i(o)}};return a.watch(()=>n.modelValue,()=>t.value=Yn(n.modelValue),{deep:!0}),a.provide(Tg,{activeNames:t,handleItemClick:r}),{activeNames:t,setActiveNames:i}},QA=()=>{const n=Ue("collapse");return{rootKls:a.computed(()=>n.b())}},e2=a.defineComponent({name:"ElCollapse"}),t2=a.defineComponent({...e2,props:JA,emits:qA,setup(n,{expose:e,emit:t}){const i=n,{activeNames:r,setActiveNames:s}=KA(i,t),{rootKls:o}=QA();return e({activeNames:r,setActiveNames:s}),(l,u)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(o))},[a.renderSlot(l.$slots,"default")],2))}});var n2=je(t2,[["__file","collapse.vue"]]);const i2=a.defineComponent({name:"ElCollapseTransition"}),r2=a.defineComponent({...i2,setup(n){const e=Ue("collapse-transition"),t=r=>{r.style.maxHeight="",r.style.overflow=r.dataset.oldOverflow,r.style.paddingTop=r.dataset.oldPaddingTop,r.style.paddingBottom=r.dataset.oldPaddingBottom},i={beforeEnter(r){r.dataset||(r.dataset={}),r.dataset.oldPaddingTop=r.style.paddingTop,r.dataset.oldPaddingBottom=r.style.paddingBottom,r.style.height&&(r.dataset.elExistsHeight=r.style.height),r.style.maxHeight=0,r.style.paddingTop=0,r.style.paddingBottom=0},enter(r){requestAnimationFrame(()=>{r.dataset.oldOverflow=r.style.overflow,r.dataset.elExistsHeight?r.style.maxHeight=r.dataset.elExistsHeight:r.scrollHeight!==0?r.style.maxHeight=`${r.scrollHeight}px`:r.style.maxHeight=0,r.style.paddingTop=r.dataset.oldPaddingTop,r.style.paddingBottom=r.dataset.oldPaddingBottom,r.style.overflow="hidden"})},afterEnter(r){r.style.maxHeight="",r.style.overflow=r.dataset.oldOverflow},enterCancelled(r){t(r)},beforeLeave(r){r.dataset||(r.dataset={}),r.dataset.oldPaddingTop=r.style.paddingTop,r.dataset.oldPaddingBottom=r.style.paddingBottom,r.dataset.oldOverflow=r.style.overflow,r.style.maxHeight=`${r.scrollHeight}px`,r.style.overflow="hidden"},leave(r){r.scrollHeight!==0&&(r.style.maxHeight=0,r.style.paddingTop=0,r.style.paddingBottom=0)},afterLeave(r){t(r)},leaveCancelled(r){t(r)}};return(r,s)=>(a.openBlock(),a.createBlock(a.Transition,a.mergeProps({name:a.unref(e).b()},a.toHandlers(i)),{default:a.withCtx(()=>[a.renderSlot(r.$slots,"default")]),_:3},16,["name"]))}});var s2=je(r2,[["__file","collapse-transition.vue"]]);const o2=Ht(s2),a2=Ke({title:{type:String,default:""},name:{type:Fe([String,Number]),default:void 0},icon:{type:$i,default:ji},disabled:Boolean}),l2=n=>{const e=a.inject(Tg),{namespace:t}=Ue("collapse"),i=a.ref(!1),r=a.ref(!1),s=Hu(),o=a.computed(()=>s.current++),l=a.computed(()=>{var m;return(m=n.name)!=null?m:`${t.value}-id-${s.prefix}-${a.unref(o)}`}),u=a.computed(()=>e==null?void 0:e.activeNames.value.includes(a.unref(l)));return{focusing:i,id:o,isActive:u,handleFocus:()=>{setTimeout(()=>{r.value?r.value=!1:i.value=!0},50)},handleHeaderClick:()=>{n.disabled||(e==null||e.handleItemClick(a.unref(l)),i.value=!1,r.value=!0)},handleEnterClick:()=>{e==null||e.handleItemClick(a.unref(l))}}},c2=(n,{focusing:e,isActive:t,id:i})=>{const r=Ue("collapse"),s=a.computed(()=>[r.b("item"),r.is("active",a.unref(t)),r.is("disabled",n.disabled)]),o=a.computed(()=>[r.be("item","header"),r.is("active",a.unref(t)),{focusing:a.unref(e)&&!n.disabled}]),l=a.computed(()=>[r.be("item","arrow"),r.is("active",a.unref(t))]),u=a.computed(()=>r.be("item","wrap")),c=a.computed(()=>r.be("item","content")),f=a.computed(()=>r.b(`content-${a.unref(i)}`)),h=a.computed(()=>r.b(`head-${a.unref(i)}`));return{arrowKls:l,headKls:o,rootKls:s,itemWrapperKls:u,itemContentKls:c,scopedContentId:f,scopedHeadId:h}},u2=a.defineComponent({name:"ElCollapseItem"}),d2=a.defineComponent({...u2,props:a2,setup(n,{expose:e}){const t=n,{focusing:i,id:r,isActive:s,handleFocus:o,handleHeaderClick:l,handleEnterClick:u}=l2(t),{arrowKls:c,headKls:f,rootKls:h,itemWrapperKls:m,itemContentKls:y,scopedContentId:p,scopedHeadId:d}=c2(t,{focusing:i,isActive:s,id:r});return e({isActive:s}),(b,v)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(h))},[a.createElementVNode("button",{id:a.unref(d),class:a.normalizeClass(a.unref(f)),"aria-expanded":a.unref(s),"aria-controls":a.unref(p),"aria-describedby":a.unref(p),tabindex:b.disabled?-1:0,type:"button",onClick:a.unref(l),onKeydown:a.withKeys(a.withModifiers(a.unref(u),["stop","prevent"]),["space","enter"]),onFocus:a.unref(o),onBlur:g=>i.value=!1},[a.renderSlot(b.$slots,"title",{},()=>[a.createTextVNode(a.toDisplayString(b.title),1)]),a.renderSlot(b.$slots,"icon",{isActive:a.unref(s)},()=>[a.createVNode(a.unref(yt),{class:a.normalizeClass(a.unref(c))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(b.icon)))]),_:1},8,["class"])])],42,["id","aria-expanded","aria-controls","aria-describedby","tabindex","onClick","onKeydown","onFocus","onBlur"]),a.createVNode(a.unref(o2),null,{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{id:a.unref(p),role:"region",class:a.normalizeClass(a.unref(m)),"aria-hidden":!a.unref(s),"aria-labelledby":a.unref(d)},[a.createElementVNode("div",{class:a.normalizeClass(a.unref(y))},[a.renderSlot(b.$slots,"default")],2)],10,["id","aria-hidden","aria-labelledby"]),[[a.vShow,a.unref(s)]])]),_:3})],2))}});var Eg=je(d2,[["__file","collapse-item.vue"]]);const Cg=Ht(n2,{CollapseItem:Eg}),Ag=vi(Eg),h2=a.defineComponent({name:"ElContainer"}),f2=a.defineComponent({...h2,props:{direction:{type:String}},setup(n){const e=n,t=a.useSlots(),i=Ue("container"),r=a.computed(()=>e.direction==="vertical"?!0:e.direction==="horizontal"?!1:t&&t.default?t.default().some(o=>{const l=o.type.name;return l==="ElHeader"||l==="ElFooter"}):!1);return(s,o)=>(a.openBlock(),a.createElementBlock("section",{class:a.normalizeClass([a.unref(i).b(),a.unref(i).is("vertical",a.unref(r))])},[a.renderSlot(s.$slots,"default")],2))}});var p2=je(f2,[["__file","container.vue"]]);const m2=a.defineComponent({name:"ElAside"}),g2=a.defineComponent({...m2,props:{width:{type:String,default:null}},setup(n){const e=n,t=Ue("aside"),i=a.computed(()=>e.width?t.cssVarBlock({width:e.width}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("aside",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var Lg=je(g2,[["__file","aside.vue"]]);const y2=a.defineComponent({name:"ElFooter"}),v2=a.defineComponent({...y2,props:{height:{type:String,default:null}},setup(n){const e=n,t=Ue("footer"),i=a.computed(()=>e.height?t.cssVarBlock({height:e.height}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("footer",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var Rg=je(v2,[["__file","footer.vue"]]);const b2=a.defineComponent({name:"ElHeader"}),x2=a.defineComponent({...b2,props:{height:{type:String,default:null}},setup(n){const e=n,t=Ue("header"),i=a.computed(()=>e.height?t.cssVarBlock({height:e.height}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("header",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var Pg=je(x2,[["__file","header.vue"]]);const w2=a.defineComponent({name:"ElMain"}),M2=a.defineComponent({...w2,setup(n){const e=Ue("main");return(t,i)=>(a.openBlock(),a.createElementBlock("main",{class:a.normalizeClass(a.unref(e).b())},[a.renderSlot(t.$slots,"default")],2))}});var Ig=je(M2,[["__file","main.vue"]]);const ei=Ht(p2,{Aside:Lg,Footer:Rg,Header:Pg,Main:Ig});vi(Lg);const Og=vi(Rg),S2=vi(Pg),Mi=vi(Ig),_2=a.defineComponent({inheritAttrs:!1});function T2(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default")}var E2=je(_2,[["render",T2],["__file","collection.vue"]]);const C2=a.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function A2(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default")}var L2=je(C2,[["render",A2],["__file","collection-item.vue"]]);const R2="data-el-collection-item",P2=n=>{const e=`El${n}Collection`,t=`${e}Item`,i=Symbol(e),r=Symbol(t),s={...E2,name:e,setup(){const l=a.ref(null),u=new Map,c=()=>{const f=a.unref(l);if(!f)return[];const h=Array.from(f.querySelectorAll(`[${R2}]`));return[...u.values()].sort((y,p)=>h.indexOf(y.ref)-h.indexOf(p.ref))};a.provide(i,{itemMap:u,getItems:c,collectionRef:l})}},o={...L2,name:t,setup(l,{attrs:u}){const c=a.ref(null),f=a.inject(i,void 0);a.provide(r,{collectionItemRef:c}),a.onMounted(()=>{const h=a.unref(c);h&&f.itemMap.set(h,{ref:h,...u})}),a.onBeforeUnmount(()=>{const h=a.unref(c);f.itemMap.delete(h)})}};return{COLLECTION_INJECTION_KEY:i,COLLECTION_ITEM_INJECTION_KEY:r,ElCollection:s,ElCollectionItem:o}},cd=Ke({trigger:Xo.trigger,effect:{...gn.effect,default:"light"},type:{type:Fe(String)},placement:{type:Fe(String),default:"bottom"},popperOptions:{type:Fe(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:Fe([Number,String]),default:0},maxHeight:{type:Fe([Number,String]),default:""},popperClass:{type:String,default:""},disabled:Boolean,role:{type:String,default:"menu"},buttonProps:{type:Fe(Object)},teleported:gn.teleported});Ke({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:$i}}),Ke({onKeydown:{type:Fe(Function)}}),P2("Dropdown");const I2=Ke({id:{type:String,default:void 0},step:{type:Number,default:1},stepStrictly:Boolean,max:{type:Number,default:Number.POSITIVE_INFINITY},min:{type:Number,default:Number.NEGATIVE_INFINITY},modelValue:Number,readonly:Boolean,disabled:Boolean,size:Ss,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:"",values:["","right"]},valueOnClear:{type:[String,Number,null],validator:n=>n===null||rt(n)||["min","max"].includes(n),default:null},name:String,placeholder:String,precision:{type:Number,validator:n=>n>=0&&n===Number.parseInt(`${n}`,10)},validateEvent:{type:Boolean,default:!0},...Ir(["ariaLabel"])}),O2={[Zi]:(n,e)=>e!==n,blur:n=>n instanceof FocusEvent,focus:n=>n instanceof FocusEvent,[Lr]:n=>rt(n)||yi(n),[gt]:n=>rt(n)||yi(n)},N2=a.defineComponent({name:"ElInputNumber"}),D2=a.defineComponent({...N2,props:I2,emits:O2,setup(n,{expose:e,emit:t}){const i=n,{t:r}=fl(),s=Ue("input-number"),o=a.ref(),l=a.reactive({currentValue:i.modelValue,userInput:null}),{formItem:u}=Zo(),c=a.computed(()=>rt(i.modelValue)&&i.modelValue<=i.min),f=a.computed(()=>rt(i.modelValue)&&i.modelValue>=i.max),h=a.computed(()=>{const O=v(i.step);return On(i.precision)?Math.max(v(i.modelValue),O):(O>i.precision&&Ct("InputNumber","precision should not be less than the decimal places of step"),i.precision)}),m=a.computed(()=>i.controls&&i.controlsPosition==="right"),y=_s(),p=Ml(),d=a.computed(()=>{if(l.userInput!==null)return l.userInput;let O=l.currentValue;if(yi(O))return"";if(rt(O)){if(Number.isNaN(O))return"";On(i.precision)||(O=O.toFixed(i.precision))}return O}),b=(O,x)=>{if(On(x)&&(x=h.value),x===0)return Math.round(O);let N=String(O);const B=N.indexOf(".");if(B===-1||!N.replace(".","").split("")[B+x])return O;const z=N.length;return N.charAt(z-1)==="5"&&(N=`${N.slice(0,Math.max(0,z-1))}6`),Number.parseFloat(Number(N).toFixed(x))},v=O=>{if(yi(O))return 0;const x=O.toString(),N=x.indexOf(".");let B=0;return N!==-1&&(B=x.length-N-1),B},g=(O,x=1)=>rt(O)?b(O+i.step*x):l.currentValue,M=()=>{if(i.readonly||p.value||f.value)return;const O=Number(d.value)||0,x=g(O);S(x),t(Lr,l.currentValue),A()},_=()=>{if(i.readonly||p.value||c.value)return;const O=Number(d.value)||0,x=g(O,-1);S(x),t(Lr,l.currentValue),A()},E=(O,x)=>{const{max:N,min:B,step:D,precision:V,stepStrictly:z,valueOnClear:G}=i;NN||KN?N:B,x&&t(gt,K)),K},S=(O,x=!0)=>{var N;const B=l.currentValue,D=E(O);if(!x){t(gt,D);return}B===D&&O||(l.userInput=null,t(gt,D),B!==D&&t(Zi,D,B),i.validateEvent&&((N=u==null?void 0:u.validate)==null||N.call(u,"change").catch(V=>Ct(V))),l.currentValue=D)},w=O=>{l.userInput=O;const x=O===""?null:Number(O);t(Lr,x),S(x,!1)},T=O=>{const x=O!==""?Number(O):"";(rt(x)&&!Number.isNaN(x)||O==="")&&S(x),A(),l.userInput=null},C=()=>{var O,x;(x=(O=o.value)==null?void 0:O.focus)==null||x.call(O)},R=()=>{var O,x;(x=(O=o.value)==null?void 0:O.blur)==null||x.call(O)},P=O=>{t("focus",O)},L=O=>{var x;l.userInput=null,t("blur",O),i.validateEvent&&((x=u==null?void 0:u.validate)==null||x.call(u,"blur").catch(N=>Ct(N)))},A=()=>{l.currentValue!==i.modelValue&&(l.currentValue=i.modelValue)},I=O=>{document.activeElement===O.target&&O.preventDefault()};return a.watch(()=>i.modelValue,(O,x)=>{const N=E(O,!0);l.userInput===null&&N!==x&&(l.currentValue=N)},{immediate:!0}),a.onMounted(()=>{var O;const{min:x,max:N,modelValue:B}=i,D=(O=o.value)==null?void 0:O.input;if(D.setAttribute("role","spinbutton"),Number.isFinite(N)?D.setAttribute("aria-valuemax",String(N)):D.removeAttribute("aria-valuemax"),Number.isFinite(x)?D.setAttribute("aria-valuemin",String(x)):D.removeAttribute("aria-valuemin"),D.setAttribute("aria-valuenow",l.currentValue||l.currentValue===0?String(l.currentValue):""),D.setAttribute("aria-disabled",String(p.value)),!rt(B)&&B!=null){let V=Number(B);Number.isNaN(V)&&(V=null),t(gt,V)}D.addEventListener("wheel",I,{passive:!1})}),a.onUpdated(()=>{var O,x;const N=(O=o.value)==null?void 0:O.input;N==null||N.setAttribute("aria-valuenow",`${(x=l.currentValue)!=null?x:""}`)}),e({focus:C,blur:R}),(O,x)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([a.unref(s).b(),a.unref(s).m(a.unref(y)),a.unref(s).is("disabled",a.unref(p)),a.unref(s).is("without-controls",!O.controls),a.unref(s).is("controls-right",a.unref(m))]),onDragstart:a.withModifiers(()=>{},["prevent"])},[O.controls?a.withDirectives((a.openBlock(),a.createElementBlock("span",{key:0,role:"button","aria-label":a.unref(r)("el.inputNumber.decrease"),class:a.normalizeClass([a.unref(s).e("decrease"),a.unref(s).is("disabled",a.unref(c))]),onKeydown:a.withKeys(_,["enter"])},[a.renderSlot(O.$slots,"decrease-icon",{},()=>[a.createVNode(a.unref(yt),null,{default:a.withCtx(()=>[a.unref(m)?(a.openBlock(),a.createBlock(a.unref(Lu),{key:0})):(a.openBlock(),a.createBlock(a.unref(Z_),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[a.unref(Mg),_]]):a.createCommentVNode("v-if",!0),O.controls?a.withDirectives((a.openBlock(),a.createElementBlock("span",{key:1,role:"button","aria-label":a.unref(r)("el.inputNumber.increase"),class:a.normalizeClass([a.unref(s).e("increase"),a.unref(s).is("disabled",a.unref(f))]),onKeydown:a.withKeys(M,["enter"])},[a.renderSlot(O.$slots,"increase-icon",{},()=>[a.createVNode(a.unref(yt),null,{default:a.withCtx(()=>[a.unref(m)?(a.openBlock(),a.createBlock(a.unref(F_),{key:0})):(a.openBlock(),a.createBlock(a.unref(ul),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[a.unref(Mg),M]]):a.createCommentVNode("v-if",!0),a.createVNode(a.unref(JE),{id:O.id,ref_key:"input",ref:o,type:"number",step:O.step,"model-value":a.unref(d),placeholder:O.placeholder,readonly:O.readonly,disabled:a.unref(p),size:a.unref(y),max:O.max,min:O.min,name:O.name,"aria-label":O.ariaLabel,"validate-event":!1,onKeydown:[a.withKeys(a.withModifiers(M,["prevent"]),["up"]),a.withKeys(a.withModifiers(_,["prevent"]),["down"])],onBlur:L,onFocus:P,onInput:w,onChange:T},a.createSlots({_:2},[O.$slots.prefix?{name:"prefix",fn:a.withCtx(()=>[a.renderSlot(O.$slots,"prefix")])}:void 0,O.$slots.suffix?{name:"suffix",fn:a.withCtx(()=>[a.renderSlot(O.$slots,"suffix")])}:void 0]),1032,["id","step","model-value","placeholder","readonly","disabled","size","max","min","name","aria-label","onKeydown"])],42,["onDragstart"]))}});var B2=je(D2,[["__file","input-number.vue"]]);const Si=Ht(B2),Ng=Symbol("ElSelectGroup"),Rl=Symbol("ElSelect");function F2(n,e){const t=a.inject(Rl),i=a.inject(Ng,{disabled:!1}),r=a.computed(()=>f(Yn(t.props.modelValue),n.value)),s=a.computed(()=>{var y;if(t.props.multiple){const p=Yn((y=t.props.modelValue)!=null?y:[]);return!r.value&&p.length>=t.props.multipleLimit&&t.props.multipleLimit>0}else return!1}),o=a.computed(()=>n.label||(an(n.value)?"":n.value)),l=a.computed(()=>n.value||n.label||""),u=a.computed(()=>n.disabled||e.groupDisabled||s.value),c=a.getCurrentInstance(),f=(y=[],p)=>{if(an(n.value)){const d=t.props.valueKey;return y&&y.some(b=>a.toRaw(mi(b,d))===mi(p,d))}else return y&&y.includes(p)},h=()=>{!n.disabled&&!i.disabled&&(t.states.hoveringIndex=t.optionsArray.indexOf(c.proxy))},m=y=>{const p=new RegExp(R_(y),"i");e.visible=p.test(o.value)||n.created};return a.watch(()=>o.value,()=>{!n.created&&!t.props.remote&&t.setSelected()}),a.watch(()=>n.value,(y,p)=>{const{remote:d,valueKey:b}=t.props;if(y!==p&&(t.onOptionDestroy(p,c.proxy),t.onOptionCreate(c.proxy)),!n.created&&!d){if(b&&an(y)&&an(p)&&y[b]===p[b])return;t.setSelected()}}),a.watch(()=>i.disabled,()=>{e.groupDisabled=i.disabled},{immediate:!0}),{select:t,currentLabel:o,currentValue:l,itemSelected:r,isDisabled:u,hoverItem:h,updateOption:m}}const V2=a.defineComponent({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(n){const e=Ue("select"),t=bl(),i=a.computed(()=>[e.be("dropdown","item"),e.is("disabled",a.unref(l)),e.is("selected",a.unref(o)),e.is("hovering",a.unref(m))]),r=a.reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:s,itemSelected:o,isDisabled:l,select:u,hoverItem:c,updateOption:f}=F2(n,r),{visible:h,hover:m}=a.toRefs(r),y=a.getCurrentInstance().proxy;u.onOptionCreate(y),a.onBeforeUnmount(()=>{const d=y.value,{selected:b}=u.states,g=(u.props.multiple?b:[b]).some(M=>M.value===y.value);a.nextTick(()=>{u.states.cachedOptions.get(d)===y&&!g&&u.states.cachedOptions.delete(d)}),u.onOptionDestroy(d,y)});function p(){l.value||u.handleOptionSelect(y)}return{ns:e,id:t,containerKls:i,currentLabel:s,itemSelected:o,isDisabled:l,select:u,hoverItem:c,updateOption:f,visible:h,hover:m,selectOptionClick:p,states:r}}});function k2(n,e,t,i,r,s){return a.withDirectives((a.openBlock(),a.createElementBlock("li",{id:n.id,class:a.normalizeClass(n.containerKls),role:"option","aria-disabled":n.isDisabled||void 0,"aria-selected":n.itemSelected,onMouseenter:n.hoverItem,onClick:a.withModifiers(n.selectOptionClick,["stop"])},[a.renderSlot(n.$slots,"default",{},()=>[a.createElementVNode("span",null,a.toDisplayString(n.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMouseenter","onClick"])),[[a.vShow,n.visible]])}var ud=je(V2,[["render",k2],["__file","option.vue"]]);const z2=a.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const n=a.inject(Rl),e=Ue("select"),t=a.computed(()=>n.props.popperClass),i=a.computed(()=>n.props.multiple),r=a.computed(()=>n.props.fitInputWidth),s=a.ref("");function o(){var l;s.value=`${(l=n.selectRef)==null?void 0:l.offsetWidth}px`}return a.onMounted(()=>{o(),Tn(n.selectRef,o)}),{ns:e,minWidth:s,popperClass:t,isMultiple:i,isFitInputWidth:r}}});function U2(n,e,t,i,r,s){return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([n.ns.b("dropdown"),n.ns.is("multiple",n.isMultiple),n.popperClass]),style:a.normalizeStyle({[n.isFitInputWidth?"width":"minWidth"]:n.minWidth})},[n.$slots.header?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(n.ns.be("dropdown","header"))},[a.renderSlot(n.$slots,"header")],2)):a.createCommentVNode("v-if",!0),a.renderSlot(n.$slots,"default"),n.$slots.footer?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(n.ns.be("dropdown","footer"))},[a.renderSlot(n.$slots,"footer")],2)):a.createCommentVNode("v-if",!0)],6)}var G2=je(z2,[["render",U2],["__file","select-dropdown.vue"]]);const H2=11,W2=(n,e)=>{const{t}=fl(),i=bl(),r=Ue("select"),s=Ue("input"),o=a.reactive({inputValue:"",options:new Map,cachedOptions:new Map,disabledOptions:new Map,optionValues:[],selected:[],selectionWidth:0,calculatorWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1}),l=a.ref(null),u=a.ref(null),c=a.ref(null),f=a.ref(null),h=a.ref(null),m=a.ref(null),y=a.ref(null),p=a.ref(null),d=a.ref(null),b=a.ref(null),v=a.ref(null),g=a.ref(null),{isComposing:M,handleCompositionStart:_,handleCompositionUpdate:E,handleCompositionEnd:S}=Xm({afterComposition:ce=>se(ce)}),{wrapperRef:w,isFocused:T}=Zm(h,{beforeFocus(){return x.value},afterFocus(){n.automaticDropdown&&!C.value&&(C.value=!0,o.menuVisibleOnFocus=!0)},beforeBlur(ce){var xe,_e;return((xe=c.value)==null?void 0:xe.isFocusInsideContent(ce))||((_e=f.value)==null?void 0:_e.isFocusInsideContent(ce))},afterBlur(){C.value=!1,o.menuVisibleOnFocus=!1}}),C=a.ref(!1),R=a.ref(),{form:P,formItem:L}=Zo(),{inputId:A}=$u(n,{formItemContext:L}),{valueOnClear:I,isEmptyValue:O}=OE(n),x=a.computed(()=>n.disabled||(P==null?void 0:P.disabled)),N=a.computed(()=>dn(n.modelValue)?n.modelValue.length>0:!O(n.modelValue)),B=a.computed(()=>n.clearable&&!x.value&&o.inputHovering&&N.value),D=a.computed(()=>n.remote&&n.filterable&&!n.remoteShowSuffix?"":n.suffixIcon),V=a.computed(()=>r.is("reverse",D.value&&C.value)),z=a.computed(()=>(L==null?void 0:L.validateState)||""),G=a.computed(()=>um[z.value]),K=a.computed(()=>n.remote?300:0),ie=a.computed(()=>n.loading?n.loadingText||t("el.select.loading"):n.remote&&!o.inputValue&&o.options.size===0?!1:n.filterable&&o.inputValue&&o.options.size>0&&j.value===0?n.noMatchText||t("el.select.noMatch"):o.options.size===0?n.noDataText||t("el.select.noData"):null),j=a.computed(()=>H.value.filter(ce=>ce.visible).length),H=a.computed(()=>{const ce=Array.from(o.options.values()),xe=[];return o.optionValues.forEach(_e=>{const Ie=ce.findIndex(Be=>Be.value===_e);Ie>-1&&xe.push(ce[Ie])}),xe.length>=ce.length?xe:ce}),W=a.computed(()=>Array.from(o.cachedOptions.values())),q=a.computed(()=>{const ce=H.value.filter(xe=>!xe.created).some(xe=>xe.currentLabel===o.inputValue);return n.filterable&&n.allowCreate&&o.inputValue!==""&&!ce}),Q=()=>{n.filterable&&en(n.filterMethod)||n.filterable&&n.remote&&en(n.remoteMethod)||H.value.forEach(ce=>{var xe;(xe=ce.updateOption)==null||xe.call(ce,o.inputValue)})},ee=_s(),ne=a.computed(()=>["small"].includes(ee.value)?"small":"default"),Y=a.computed({get(){return C.value&&ie.value!==!1},set(ce){C.value=ce}}),te=a.computed(()=>{if(n.multiple&&!On(n.modelValue))return Yn(n.modelValue).length===0&&!o.inputValue;const ce=dn(n.modelValue)?n.modelValue[0]:n.modelValue;return n.filterable||On(ce)?!o.inputValue:!0}),F=a.computed(()=>{var ce;const xe=(ce=n.placeholder)!=null?ce:t("el.select.placeholder");return n.multiple||!N.value?xe:o.selectedLabel}),$=a.computed(()=>au?null:"mouseenter");a.watch(()=>n.modelValue,(ce,xe)=>{n.multiple&&n.filterable&&!n.reserveKeyword&&(o.inputValue="",J("")),U(),!Cu(ce,xe)&&n.validateEvent&&(L==null||L.validate("change").catch(_e=>Ct(_e)))},{flush:"post",deep:!0}),a.watch(()=>C.value,ce=>{ce?J(o.inputValue):(o.inputValue="",o.previousQuery=null,o.isBeforeHide=!0),e("visible-change",ce)}),a.watch(()=>o.options.entries(),()=>{var ce;if(!Ft)return;const xe=((ce=l.value)==null?void 0:ce.querySelectorAll("input"))||[];(!n.filterable&&!n.defaultFirstOption&&!On(n.modelValue)||!Array.from(xe).includes(document.activeElement))&&U(),n.defaultFirstOption&&(n.filterable||n.remote)&&j.value&&k()},{flush:"post"}),a.watch(()=>o.hoveringIndex,ce=>{rt(ce)&&ce>-1?R.value=H.value[ce]||{}:R.value={},H.value.forEach(xe=>{xe.hover=R.value===xe})}),a.watchEffect(()=>{o.isBeforeHide||Q()});const J=ce=>{o.previousQuery===ce||M.value||(o.previousQuery=ce,n.filterable&&en(n.filterMethod)?n.filterMethod(ce):n.filterable&&n.remote&&en(n.remoteMethod)&&n.remoteMethod(ce),n.defaultFirstOption&&(n.filterable||n.remote)&&j.value?a.nextTick(k):a.nextTick(le))},k=()=>{const ce=H.value.filter(Ie=>Ie.visible&&!Ie.disabled&&!Ie.states.groupDisabled),xe=ce.find(Ie=>Ie.created),_e=ce[0];o.hoveringIndex=ot(H.value,xe||_e)},U=()=>{if(n.multiple)o.selectedLabel="";else{const xe=dn(n.modelValue)?n.modelValue[0]:n.modelValue,_e=oe(xe);o.selectedLabel=_e.currentLabel,o.selected=[_e];return}const ce=[];On(n.modelValue)||Yn(n.modelValue).forEach(xe=>{ce.push(oe(xe))}),o.selected=ce},oe=ce=>{let xe;const _e=lu(ce).toLowerCase()==="object",Ie=lu(ce).toLowerCase()==="null",Be=lu(ce).toLowerCase()==="undefined";for(let qe=o.cachedOptions.size-1;qe>=0;qe--){const Bt=W.value[qe];if(_e?mi(Bt.value,n.valueKey)===mi(ce,n.valueKey):Bt.value===ce){xe={value:ce,currentLabel:Bt.currentLabel,get isDisabled(){return Bt.isDisabled}};break}}if(xe)return xe;const ze=_e?ce.label:!Ie&&!Be?ce:"";return{value:ce,currentLabel:ze}},le=()=>{o.hoveringIndex=H.value.findIndex(ce=>o.selected.some(xe=>it(xe)===it(ce)))},ae=()=>{o.selectionWidth=u.value.getBoundingClientRect().width},fe=()=>{o.calculatorWidth=m.value.getBoundingClientRect().width},ge=()=>{o.collapseItemWidth=v.value.getBoundingClientRect().width},we=()=>{var ce,xe;(xe=(ce=c.value)==null?void 0:ce.updatePopper)==null||xe.call(ce)},ue=()=>{var ce,xe;(xe=(ce=f.value)==null?void 0:ce.updatePopper)==null||xe.call(ce)},ye=()=>{o.inputValue.length>0&&!C.value&&(C.value=!0),J(o.inputValue)},se=ce=>{if(o.inputValue=ce.target.value,n.remote)be();else return ye()},be=Eu(()=>{ye()},K.value),he=ce=>{Cu(n.modelValue,ce)||e(Zi,ce)},me=ce=>S_(ce,xe=>!o.disabledOptions.has(xe)),Te=ce=>{if(n.multiple&&ce.code!==Jn.delete&&ce.target.value.length<=0){const xe=Yn(n.modelValue).slice(),_e=me(xe);if(_e<0)return;const Ie=xe[_e];xe.splice(_e,1),e(gt,xe),he(xe),e("remove-tag",Ie)}},He=(ce,xe)=>{const _e=o.selected.indexOf(xe);if(_e>-1&&!x.value){const Ie=Yn(n.modelValue).slice();Ie.splice(_e,1),e(gt,Ie),he(Ie),e("remove-tag",xe.value)}ce.stopPropagation(),Tt()},tt=ce=>{ce.stopPropagation();const xe=n.multiple?[]:I.value;if(n.multiple)for(const _e of o.selected)_e.isDisabled&&xe.push(_e.value);e(gt,xe),he(xe),o.hoveringIndex=-1,C.value=!1,e("clear"),Tt()},Re=ce=>{var xe;if(n.multiple){const _e=Yn((xe=n.modelValue)!=null?xe:[]).slice(),Ie=ot(_e,ce.value);Ie>-1?_e.splice(Ie,1):(n.multipleLimit<=0||_e.length{Pe(ce)})},ot=(ce=[],xe)=>{if(!an(xe))return ce.indexOf(xe);const _e=n.valueKey;let Ie=-1;return ce.some((Be,ze)=>a.toRaw(mi(Be,_e))===mi(xe,_e)?(Ie=ze,!0):!1),Ie},Pe=ce=>{var xe,_e,Ie,Be,ze;const ke=dn(ce)?ce[0]:ce;let qe=null;if(ke!=null&&ke.value){const Bt=H.value.filter($t=>$t.value===ke.value);Bt.length>0&&(qe=Bt[0].$el)}if(c.value&&qe){const Bt=(Be=(Ie=(_e=(xe=c.value)==null?void 0:xe.popperRef)==null?void 0:_e.contentRef)==null?void 0:Ie.querySelector)==null?void 0:Be.call(Ie,`.${r.be("dropdown","wrap")}`);Bt&&I_(Bt,qe)}(ze=g.value)==null||ze.handleScroll()},Je=ce=>{o.options.set(ce.value,ce),o.cachedOptions.set(ce.value,ce),ce.disabled&&o.disabledOptions.set(ce.value,ce)},We=(ce,xe)=>{o.options.get(ce)===xe&&o.options.delete(ce)},at=a.computed(()=>{var ce,xe;return(xe=(ce=c.value)==null?void 0:ce.popperRef)==null?void 0:xe.contentRef}),et=()=>{o.isBeforeHide=!1,a.nextTick(()=>Pe(o.selected))},Tt=()=>{var ce;(ce=h.value)==null||ce.focus()},xt=()=>{var ce;(ce=h.value)==null||ce.blur()},re=ce=>{tt(ce)},Me=()=>{C.value=!1,T.value&&xt()},Ce=()=>{o.inputValue.length>0?o.inputValue="":C.value=!1},Ne=()=>{x.value||(au&&(o.inputHovering=!0),o.menuVisibleOnFocus?o.menuVisibleOnFocus=!1:C.value=!C.value)},Xe=()=>{C.value?H.value[o.hoveringIndex]&&Re(H.value[o.hoveringIndex]):Ne()},it=ce=>an(ce.value)?mi(ce.value,n.valueKey):ce.value,ct=a.computed(()=>H.value.filter(ce=>ce.visible).every(ce=>ce.disabled)),pt=a.computed(()=>n.multiple?n.collapseTags?o.selected.slice(0,n.maxCollapseTags):o.selected:[]),Et=a.computed(()=>n.multiple?n.collapseTags?o.selected.slice(n.maxCollapseTags):[]:[]),Z=ce=>{if(!C.value){C.value=!0;return}if(!(o.options.size===0||o.filteredOptionsCount===0||M.value)&&!ct.value){ce==="next"?(o.hoveringIndex++,o.hoveringIndex===o.options.size&&(o.hoveringIndex=0)):ce==="prev"&&(o.hoveringIndex--,o.hoveringIndex<0&&(o.hoveringIndex=o.options.size-1));const xe=H.value[o.hoveringIndex];(xe.disabled===!0||xe.states.groupDisabled===!0||!xe.visible)&&Z(ce),a.nextTick(()=>Pe(R.value))}},pe=()=>{if(!u.value)return 0;const ce=window.getComputedStyle(u.value);return Number.parseFloat(ce.gap||"6px")},de=a.computed(()=>{const ce=pe();return{maxWidth:`${v.value&&n.maxCollapseTags===1?o.selectionWidth-o.collapseItemWidth-ce:o.selectionWidth}px`}}),ve=a.computed(()=>({maxWidth:`${o.selectionWidth}px`})),Ee=a.computed(()=>({width:`${Math.max(o.calculatorWidth,H2)}px`}));return Tn(u,ae),Tn(m,fe),Tn(d,we),Tn(w,we),Tn(b,ue),Tn(v,ge),a.onMounted(()=>{U()}),{inputId:A,contentId:i,nsSelect:r,nsInput:s,states:o,isFocused:T,expanded:C,optionsArray:H,hoverOption:R,selectSize:ee,filteredOptionsCount:j,resetCalculatorWidth:fe,updateTooltip:we,updateTagTooltip:ue,debouncedOnInputChange:be,onInput:se,deletePrevTag:Te,deleteTag:He,deleteSelected:tt,handleOptionSelect:Re,scrollToOption:Pe,hasModelValue:N,shouldShowPlaceholder:te,currentPlaceholder:F,mouseEnterEventName:$,showClose:B,iconComponent:D,iconReverse:V,validateState:z,validateIcon:G,showNewOption:q,updateOptions:Q,collapseTagSize:ne,setSelected:U,selectDisabled:x,emptyText:ie,handleCompositionStart:_,handleCompositionUpdate:E,handleCompositionEnd:S,onOptionCreate:Je,onOptionDestroy:We,handleMenuEnter:et,focus:Tt,blur:xt,handleClearClick:re,handleClickOutside:Me,handleEsc:Ce,toggleMenu:Ne,selectOption:Xe,getValueKey:it,navigateOptions:Z,dropdownMenuVisible:Y,showTagList:pt,collapseTagList:Et,tagStyle:de,collapseTagStyle:ve,inputStyle:Ee,popperRef:at,inputRef:h,tooltipRef:c,tagTooltipRef:f,calculatorRef:m,prefixRef:y,suffixRef:p,selectRef:l,wrapperRef:w,selectionRef:u,scrollbarRef:g,menuRef:d,tagMenuRef:b,collapseItemRef:v}};var j2=a.defineComponent({name:"ElOptions",setup(n,{slots:e}){const t=a.inject(Rl);let i=[];return()=>{var r,s;const o=(r=e.default)==null?void 0:r.call(e),l=[];function u(c){dn(c)&&c.forEach(f=>{var h,m,y,p;const d=(h=(f==null?void 0:f.type)||{})==null?void 0:h.name;d==="ElOptionGroup"?u(!on(f.children)&&!dn(f.children)&&en((m=f.children)==null?void 0:m.default)?(y=f.children)==null?void 0:y.default():f.children):d==="ElOption"?l.push((p=f.props)==null?void 0:p.value):dn(f.children)&&u(f.children)})}return o.length&&u((s=o[0])==null?void 0:s.children),Cu(l,i)||(i=l,t&&(t.states.optionValues=l)),o}}});const $2=Ke({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:Ss,effect:{type:Fe(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:Fe(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:gn.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:$i,default:Ru},fitInputWidth:Boolean,suffixIcon:{type:$i,default:Lu},tagType:{...ld.type,default:"info"},tagEffect:{...ld.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:Fe(String),values:ys,default:"bottom-start"},fallbackPlacements:{type:Fe(Array),default:["bottom-start","top-start","right","left"]},appendTo:String,...IE,...Ir(["ariaLabel"])}),Dg="ElSelect",Z2=a.defineComponent({name:Dg,componentName:Dg,components:{ElSelectMenu:G2,ElOption:ud,ElOptions:j2,ElTag:UA,ElScrollbar:lC,ElTooltip:nd,ElIcon:yt},directives:{ClickOutside:NA},props:$2,emits:[gt,Zi,"remove-tag","clear","visible-change","focus","blur"],setup(n,{emit:e}){const t=a.computed(()=>{const{modelValue:s,multiple:o}=n,l=o?[]:void 0;return dn(s)?o?s:l:o?l:s}),i=a.reactive({...a.toRefs(n),modelValue:t}),r=W2(i,e);return a.provide(Rl,a.reactive({props:i,states:r.states,optionsArray:r.optionsArray,handleOptionSelect:r.handleOptionSelect,onOptionCreate:r.onOptionCreate,onOptionDestroy:r.onOptionDestroy,selectRef:r.selectRef,setSelected:r.setSelected})),{...r,modelValue:t}}});function X2(n,e,t,i,r,s){const o=a.resolveComponent("el-tag"),l=a.resolveComponent("el-tooltip"),u=a.resolveComponent("el-icon"),c=a.resolveComponent("el-option"),f=a.resolveComponent("el-options"),h=a.resolveComponent("el-scrollbar"),m=a.resolveComponent("el-select-menu"),y=a.resolveDirective("click-outside");return a.withDirectives((a.openBlock(),a.createElementBlock("div",{ref:"selectRef",class:a.normalizeClass([n.nsSelect.b(),n.nsSelect.m(n.selectSize)]),[a.toHandlerKey(n.mouseEnterEventName)]:p=>n.states.inputHovering=!0,onMouseleave:p=>n.states.inputHovering=!1},[a.createVNode(l,{ref:"tooltipRef",visible:n.dropdownMenuVisible,placement:n.placement,teleported:n.teleported,"popper-class":[n.nsSelect.e("popper"),n.popperClass],"popper-options":n.popperOptions,"fallback-placements":n.fallbackPlacements,effect:n.effect,pure:"",trigger:"click",transition:`${n.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:n.persistent,"append-to":n.appendTo,onBeforeShow:n.handleMenuEnter,onHide:p=>n.states.isBeforeHide=!1},{default:a.withCtx(()=>{var p;return[a.createElementVNode("div",{ref:"wrapperRef",class:a.normalizeClass([n.nsSelect.e("wrapper"),n.nsSelect.is("focused",n.isFocused),n.nsSelect.is("hovering",n.states.inputHovering),n.nsSelect.is("filterable",n.filterable),n.nsSelect.is("disabled",n.selectDisabled)]),onClick:a.withModifiers(n.toggleMenu,["prevent"])},[n.$slots.prefix?(a.openBlock(),a.createElementBlock("div",{key:0,ref:"prefixRef",class:a.normalizeClass(n.nsSelect.e("prefix"))},[a.renderSlot(n.$slots,"prefix")],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("div",{ref:"selectionRef",class:a.normalizeClass([n.nsSelect.e("selection"),n.nsSelect.is("near",n.multiple&&!n.$slots.prefix&&!!n.states.selected.length)])},[n.multiple?a.renderSlot(n.$slots,"tag",{key:0},()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.showTagList,d=>(a.openBlock(),a.createElementBlock("div",{key:n.getValueKey(d),class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{closable:!n.selectDisabled&&!d.isDisabled,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",style:a.normalizeStyle(n.tagStyle),onClose:b=>n.deleteTag(b,d)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))},[a.renderSlot(n.$slots,"label",{label:d.currentLabel,value:d.value},()=>[a.createTextVNode(a.toDisplayString(d.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),n.collapseTags&&n.states.selected.length>n.maxCollapseTags?(a.openBlock(),a.createBlock(l,{key:0,ref:"tagTooltipRef",disabled:n.dropdownMenuVisible||!n.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:n.effect,placement:"bottom",teleported:n.teleported},{default:a.withCtx(()=>[a.createElementVNode("div",{ref:"collapseItemRef",class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{closable:!1,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",style:a.normalizeStyle(n.collapseTagStyle)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))}," + "+a.toDisplayString(n.states.selected.length-n.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:a.withCtx(()=>[a.createElementVNode("div",{ref:"tagMenuRef",class:a.normalizeClass(n.nsSelect.e("selection"))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.collapseTagList,d=>(a.openBlock(),a.createElementBlock("div",{key:n.getValueKey(d),class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{class:"in-tooltip",closable:!n.selectDisabled&&!d.isDisabled,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",onClose:b=>n.deleteTag(b,d)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))},[a.renderSlot(n.$slots,"label",{label:d.currentLabel,value:d.value},()=>[a.createTextVNode(a.toDisplayString(d.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","teleported"])):a.createCommentVNode("v-if",!0)]):a.createCommentVNode("v-if",!0),n.selectDisabled?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass([n.nsSelect.e("selected-item"),n.nsSelect.e("input-wrapper"),n.nsSelect.is("hidden",!n.filterable)])},[a.withDirectives(a.createElementVNode("input",{id:n.inputId,ref:"inputRef","onUpdate:modelValue":d=>n.states.inputValue=d,type:"text",name:n.name,class:a.normalizeClass([n.nsSelect.e("input"),n.nsSelect.is(n.selectSize)]),disabled:n.selectDisabled,autocomplete:n.autocomplete,style:a.normalizeStyle(n.inputStyle),role:"combobox",readonly:!n.filterable,spellcheck:"false","aria-activedescendant":((p=n.hoverOption)==null?void 0:p.id)||"","aria-controls":n.contentId,"aria-expanded":n.dropdownMenuVisible,"aria-label":n.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[a.withKeys(a.withModifiers(d=>n.navigateOptions("next"),["stop","prevent"]),["down"]),a.withKeys(a.withModifiers(d=>n.navigateOptions("prev"),["stop","prevent"]),["up"]),a.withKeys(a.withModifiers(n.handleEsc,["stop","prevent"]),["esc"]),a.withKeys(a.withModifiers(n.selectOption,["stop","prevent"]),["enter"]),a.withKeys(a.withModifiers(n.deletePrevTag,["stop"]),["delete"])],onCompositionstart:n.handleCompositionStart,onCompositionupdate:n.handleCompositionUpdate,onCompositionend:n.handleCompositionEnd,onInput:n.onInput,onClick:a.withModifiers(n.toggleMenu,["stop"])},null,46,["id","onUpdate:modelValue","name","disabled","autocomplete","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label","onKeydown","onCompositionstart","onCompositionupdate","onCompositionend","onInput","onClick"]),[[a.vModelText,n.states.inputValue]]),n.filterable?(a.openBlock(),a.createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:a.normalizeClass(n.nsSelect.e("input-calculator")),textContent:a.toDisplayString(n.states.inputValue)},null,10,["textContent"])):a.createCommentVNode("v-if",!0)],2)),n.shouldShowPlaceholder?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass([n.nsSelect.e("selected-item"),n.nsSelect.e("placeholder"),n.nsSelect.is("transparent",!n.hasModelValue||n.expanded&&!n.states.inputValue)])},[n.hasModelValue?a.renderSlot(n.$slots,"label",{key:0,label:n.currentPlaceholder,value:n.modelValue},()=>[a.createElementVNode("span",null,a.toDisplayString(n.currentPlaceholder),1)]):(a.openBlock(),a.createElementBlock("span",{key:1},a.toDisplayString(n.currentPlaceholder),1))],2)):a.createCommentVNode("v-if",!0)],2),a.createElementVNode("div",{ref:"suffixRef",class:a.normalizeClass(n.nsSelect.e("suffix"))},[n.iconComponent&&!n.showClose?(a.openBlock(),a.createBlock(u,{key:0,class:a.normalizeClass([n.nsSelect.e("caret"),n.nsSelect.e("icon"),n.iconReverse])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.iconComponent)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0),n.showClose&&n.clearIcon?(a.openBlock(),a.createBlock(u,{key:1,class:a.normalizeClass([n.nsSelect.e("caret"),n.nsSelect.e("icon"),n.nsSelect.e("clear")]),onClick:n.handleClearClick},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.clearIcon)))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0),n.validateState&&n.validateIcon?(a.openBlock(),a.createBlock(u,{key:2,class:a.normalizeClass([n.nsInput.e("icon"),n.nsInput.e("validateIcon")])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.validateIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],10,["onClick"])]}),content:a.withCtx(()=>[a.createVNode(m,{ref:"menuRef"},{default:a.withCtx(()=>[n.$slots.header?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(n.nsSelect.be("dropdown","header")),onClick:a.withModifiers(()=>{},["stop"])},[a.renderSlot(n.$slots,"header")],10,["onClick"])):a.createCommentVNode("v-if",!0),a.withDirectives(a.createVNode(h,{id:n.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":n.nsSelect.be("dropdown","wrap"),"view-class":n.nsSelect.be("dropdown","list"),class:a.normalizeClass([n.nsSelect.is("empty",n.filteredOptionsCount===0)]),role:"listbox","aria-label":n.ariaLabel,"aria-orientation":"vertical"},{default:a.withCtx(()=>[n.showNewOption?(a.openBlock(),a.createBlock(c,{key:0,value:n.states.inputValue,created:!0},null,8,["value"])):a.createCommentVNode("v-if",!0),a.createVNode(f,null,{default:a.withCtx(()=>[a.renderSlot(n.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[a.vShow,n.states.options.size>0&&!n.loading]]),n.$slots.loading&&n.loading?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(n.nsSelect.be("dropdown","loading"))},[a.renderSlot(n.$slots,"loading")],2)):n.loading||n.filteredOptionsCount===0?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass(n.nsSelect.be("dropdown","empty"))},[a.renderSlot(n.$slots,"empty",{},()=>[a.createElementVNode("span",null,a.toDisplayString(n.emptyText),1)])],2)):a.createCommentVNode("v-if",!0),n.$slots.footer?(a.openBlock(),a.createElementBlock("div",{key:3,class:a.normalizeClass(n.nsSelect.be("dropdown","footer")),onClick:a.withModifiers(()=>{},["stop"])},[a.renderSlot(n.$slots,"footer")],10,["onClick"])):a.createCommentVNode("v-if",!0)]),_:3},512)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","fallback-placements","effect","transition","persistent","append-to","onBeforeShow","onHide"])],16,["onMouseleave"])),[[y,n.handleClickOutside,n.popperRef]])}var Y2=je(Z2,[["render",X2],["__file","select.vue"]]);const J2=a.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(n){const e=Ue("select"),t=a.ref(null),i=a.getCurrentInstance(),r=a.ref([]);a.provide(Ng,a.reactive({...a.toRefs(n)}));const s=a.computed(()=>r.value.some(c=>c.visible===!0)),o=c=>{var f,h;return((f=c.type)==null?void 0:f.name)==="ElOption"&&!!((h=c.component)!=null&&h.proxy)},l=c=>{const f=Yn(c),h=[];return f.forEach(m=>{var y,p;o(m)?h.push(m.component.proxy):(y=m.children)!=null&&y.length?h.push(...l(m.children)):(p=m.component)!=null&&p.subTree&&h.push(...l(m.component.subTree))}),h},u=()=>{r.value=l(i.subTree)};return a.onMounted(()=>{u()}),Sw(t,u,{attributes:!0,subtree:!0,childList:!0}),{groupRef:t,visible:s,ns:e}}});function q2(n,e,t,i,r,s){return a.withDirectives((a.openBlock(),a.createElementBlock("ul",{ref:"groupRef",class:a.normalizeClass(n.ns.be("group","wrap"))},[a.createElementVNode("li",{class:a.normalizeClass(n.ns.be("group","title"))},a.toDisplayString(n.label),3),a.createElementVNode("li",null,[a.createElementVNode("ul",{class:a.normalizeClass(n.ns.b("group"))},[a.renderSlot(n.$slots,"default")],2)])],2)),[[a.vShow,n.visible]])}var Bg=je(J2,[["render",q2],["__file","option-group.vue"]]);const As=Ht(Y2,{Option:ud,OptionGroup:Bg}),Ls=vi(ud);vi(Bg);const K2=Ke({trigger:Xo.trigger,placement:cd.placement,disabled:Xo.disabled,visible:gn.visible,transition:gn.transition,popperOptions:cd.popperOptions,tabindex:cd.tabindex,content:gn.content,popperStyle:gn.popperStyle,popperClass:gn.popperClass,enterable:{...gn.enterable,default:!0},effect:{...gn.effect,default:"light"},teleported:gn.teleported,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),Q2={"update:visible":n=>Au(n),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},eL="onUpdate:visible",tL=a.defineComponent({name:"ElPopover"}),nL=a.defineComponent({...tL,props:K2,emits:Q2,setup(n,{expose:e,emit:t}){const i=n,r=a.computed(()=>i[eL]),s=Ue("popover"),o=a.ref(),l=a.computed(()=>{var b;return(b=a.unref(o))==null?void 0:b.popperRef}),u=a.computed(()=>[{width:ll(i.width)},i.popperStyle]),c=a.computed(()=>[s.b(),i.popperClass,{[s.m("plain")]:!!i.content}]),f=a.computed(()=>i.transition===`${s.namespace.value}-fade-in-linear`),h=()=>{var b;(b=o.value)==null||b.hide()},m=()=>{t("before-enter")},y=()=>{t("before-leave")},p=()=>{t("after-enter")},d=()=>{t("update:visible",!1),t("after-leave")};return e({popperRef:l,hide:h}),(b,v)=>(a.openBlock(),a.createBlock(a.unref(nd),a.mergeProps({ref_key:"tooltipRef",ref:o},b.$attrs,{trigger:b.trigger,placement:b.placement,disabled:b.disabled,visible:b.visible,transition:b.transition,"popper-options":b.popperOptions,tabindex:b.tabindex,content:b.content,offset:b.offset,"show-after":b.showAfter,"hide-after":b.hideAfter,"auto-close":b.autoClose,"show-arrow":b.showArrow,"aria-label":b.title,effect:b.effect,enterable:b.enterable,"popper-class":a.unref(c),"popper-style":a.unref(u),teleported:b.teleported,persistent:b.persistent,"gpu-acceleration":a.unref(f),"onUpdate:visible":a.unref(r),onBeforeShow:m,onBeforeHide:y,onShow:p,onHide:d}),{content:a.withCtx(()=>[b.title?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(a.unref(s).e("title")),role:"title"},a.toDisplayString(b.title),3)):a.createCommentVNode("v-if",!0),a.renderSlot(b.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(b.content),1)])]),default:a.withCtx(()=>[b.$slots.reference?a.renderSlot(b.$slots,"reference",{key:0}):a.createCommentVNode("v-if",!0)]),_:3},16,["trigger","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","persistent","gpu-acceleration","onUpdate:visible"]))}});var iL=je(nL,[["__file","popover.vue"]]);const Fg=(n,e)=>{const t=e.arg||e.value,i=t==null?void 0:t.popperRef;i&&(i.triggerRef=n)};var rL={mounted(n,e){Fg(n,e)},updated(n,e){Fg(n,e)}};const sL=Q_(rL,"popover"),Pl=Ht(iL,{directive:sL}),Vg=Symbol("sliderContextKey"),oL=Ke({modelValue:{type:Fe([Number,Array]),default:0},id:{type:String,default:void 0},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},showInput:Boolean,showInputControls:{type:Boolean,default:!0},size:Ss,inputSize:Ss,showStops:Boolean,showTooltip:{type:Boolean,default:!0},formatTooltip:{type:Fe(Function),default:void 0},disabled:Boolean,range:Boolean,vertical:Boolean,height:String,debounce:{type:Number,default:300},rangeStartLabel:{type:String,default:void 0},rangeEndLabel:{type:String,default:void 0},formatValueText:{type:Fe(Function),default:void 0},tooltipClass:{type:String,default:void 0},placement:{type:String,values:ys,default:"top"},marks:{type:Fe(Object)},validateEvent:{type:Boolean,default:!0},...Ir(["ariaLabel"])}),dd=n=>rt(n)||dn(n)&&n.every(rt),aL={[gt]:dd,[Lr]:dd,[Zi]:dd},lL=(n,e,t)=>{const i=a.ref();return a.onMounted(async()=>{n.range?(Array.isArray(n.modelValue)?(e.firstValue=Math.max(n.min,n.modelValue[0]),e.secondValue=Math.min(n.max,n.modelValue[1])):(e.firstValue=n.min,e.secondValue=n.max),e.oldValue=[e.firstValue,e.secondValue]):(typeof n.modelValue!="number"||Number.isNaN(n.modelValue)?e.firstValue=n.min:e.firstValue=Math.min(n.max,Math.max(n.min,n.modelValue)),e.oldValue=e.firstValue),Gt(window,"resize",t),await a.nextTick(),t()}),{sliderWrapper:i}},cL=n=>a.computed(()=>n.marks?Object.keys(n.marks).map(Number.parseFloat).sort((t,i)=>t-i).filter(t=>t<=n.max&&t>=n.min).map(t=>({point:t,position:(t-n.min)*100/(n.max-n.min),mark:n.marks[t]})):[]),uL=(n,e,t)=>{const{form:i,formItem:r}=Zo(),s=a.shallowRef(),o=a.ref(),l=a.ref(),u={firstButton:o,secondButton:l},c=a.computed(()=>n.disabled||(i==null?void 0:i.disabled)||!1),f=a.computed(()=>Math.min(e.firstValue,e.secondValue)),h=a.computed(()=>Math.max(e.firstValue,e.secondValue)),m=a.computed(()=>n.range?`${100*(h.value-f.value)/(n.max-n.min)}%`:`${100*(e.firstValue-n.min)/(n.max-n.min)}%`),y=a.computed(()=>n.range?`${100*(f.value-n.min)/(n.max-n.min)}%`:"0%"),p=a.computed(()=>n.vertical?{height:n.height}:{}),d=a.computed(()=>n.vertical?{height:m.value,bottom:y.value}:{width:m.value,left:y.value}),b=()=>{s.value&&(e.sliderSize=s.value[`client${n.vertical?"Height":"Width"}`])},v=L=>{const A=n.min+L*(n.max-n.min)/100;if(!n.range)return o;let I;return Math.abs(f.value-A)e.secondValue?"firstButton":"secondButton",u[I]},g=L=>{const A=v(L);return A.value.setPosition(L),A},M=L=>{e.firstValue=L??n.min,E(n.range?[f.value,h.value]:L??n.min)},_=L=>{e.secondValue=L,n.range&&E([f.value,h.value])},E=L=>{t(gt,L),t(Lr,L)},S=async()=>{await a.nextTick(),t(Zi,n.range?[f.value,h.value]:n.modelValue)},w=L=>{var A,I,O,x,N,B;if(c.value||e.dragging)return;b();let D=0;if(n.vertical){const V=(O=(I=(A=L.touches)==null?void 0:A.item(0))==null?void 0:I.clientY)!=null?O:L.clientY;D=(s.value.getBoundingClientRect().bottom-V)/e.sliderSize*100}else{const V=(B=(N=(x=L.touches)==null?void 0:x.item(0))==null?void 0:N.clientX)!=null?B:L.clientX,z=s.value.getBoundingClientRect().left;D=(V-z)/e.sliderSize*100}if(!(D<0||D>100))return g(D)};return{elFormItem:r,slider:s,firstButton:o,secondButton:l,sliderDisabled:c,minValue:f,maxValue:h,runwayStyle:p,barStyle:d,resetSize:b,setPosition:g,emitChange:S,onSliderWrapperPrevent:L=>{var A,I;((A=u.firstButton.value)!=null&&A.dragging||(I=u.secondButton.value)!=null&&I.dragging)&&L.preventDefault()},onSliderClick:L=>{w(L)&&S()},onSliderDown:async L=>{const A=w(L);A&&(await a.nextTick(),A.value.onButtonDown(L))},onSliderMarkerDown:L=>{c.value||e.dragging||g(L)},setFirstValue:M,setSecondValue:_}},{left:dL,down:hL,right:fL,up:pL,home:mL,end:gL,pageUp:yL,pageDown:vL}=Jn,bL=(n,e,t)=>{const i=a.ref(),r=a.ref(!1),s=a.computed(()=>e.value instanceof Function),o=a.computed(()=>s.value&&e.value(n.modelValue)||n.modelValue),l=Eu(()=>{t.value&&(r.value=!0)},50),u=Eu(()=>{t.value&&(r.value=!1)},50);return{tooltip:i,tooltipVisible:r,formatValue:o,displayTooltip:l,hideTooltip:u}},xL=(n,e,t)=>{const{disabled:i,min:r,max:s,step:o,showTooltip:l,precision:u,sliderSize:c,formatTooltip:f,emitChange:h,resetSize:m,updateDragging:y}=a.inject(Vg),{tooltip:p,tooltipVisible:d,formatValue:b,displayTooltip:v,hideTooltip:g}=bL(n,f,l),M=a.ref(),_=a.computed(()=>`${(n.modelValue-r.value)/(s.value-r.value)*100}%`),E=a.computed(()=>n.vertical?{bottom:_.value}:{left:_.value}),S=()=>{e.hovering=!0,v()},w=()=>{e.hovering=!1,e.dragging||g()},T=G=>{i.value||(G.preventDefault(),B(G),window.addEventListener("mousemove",D),window.addEventListener("touchmove",D),window.addEventListener("mouseup",V),window.addEventListener("touchend",V),window.addEventListener("contextmenu",V),M.value.focus())},C=G=>{i.value||(e.newPosition=Number.parseFloat(_.value)+G/(s.value-r.value)*100,z(e.newPosition),h())},R=()=>{C(-o.value)},P=()=>{C(o.value)},L=()=>{C(-o.value*4)},A=()=>{C(o.value*4)},I=()=>{i.value||(z(0),h())},O=()=>{i.value||(z(100),h())},x=G=>{let K=!0;[dL,hL].includes(G.key)?R():[fL,pL].includes(G.key)?P():G.key===mL?I():G.key===gL?O():G.key===vL?L():G.key===yL?A():K=!1,K&&G.preventDefault()},N=G=>{let K,ie;return G.type.startsWith("touch")?(ie=G.touches[0].clientY,K=G.touches[0].clientX):(ie=G.clientY,K=G.clientX),{clientX:K,clientY:ie}},B=G=>{e.dragging=!0,e.isClick=!0;const{clientX:K,clientY:ie}=N(G);n.vertical?e.startY=ie:e.startX=K,e.startPosition=Number.parseFloat(_.value),e.newPosition=e.startPosition},D=G=>{if(e.dragging){e.isClick=!1,v(),m();let K;const{clientX:ie,clientY:j}=N(G);n.vertical?(e.currentY=j,K=(e.startY-e.currentY)/c.value*100):(e.currentX=ie,K=(e.currentX-e.startX)/c.value*100),e.newPosition=e.startPosition+K,z(e.newPosition)}},V=()=>{e.dragging&&(setTimeout(()=>{e.dragging=!1,e.hovering||g(),e.isClick||z(e.newPosition),h()},0),window.removeEventListener("mousemove",D),window.removeEventListener("touchmove",D),window.removeEventListener("mouseup",V),window.removeEventListener("touchend",V),window.removeEventListener("contextmenu",V))},z=async G=>{if(G===null||Number.isNaN(+G))return;G<0?G=0:G>100&&(G=100);const K=100/((s.value-r.value)/o.value);let j=Math.round(G/K)*K*(s.value-r.value)*.01+r.value;j=Number.parseFloat(j.toFixed(u.value)),j!==n.modelValue&&t(gt,j),!e.dragging&&n.modelValue!==e.oldValue&&(e.oldValue=n.modelValue),await a.nextTick(),e.dragging&&v(),p.value.updatePopper()};return a.watch(()=>e.dragging,G=>{y(G)}),Gt(M,"touchstart",T,{passive:!1}),{disabled:i,button:M,tooltip:p,tooltipVisible:d,showTooltip:l,wrapperStyle:E,formatValue:b,handleMouseEnter:S,handleMouseLeave:w,onButtonDown:T,onKeyDown:x,setPosition:z}},wL=(n,e,t,i)=>({stops:a.computed(()=>{if(!n.showStops||n.min>n.max)return[];if(n.step===0)return Ct("ElSlider","step should not be 0."),[];const o=(n.max-n.min)/n.step,l=100*n.step/(n.max-n.min),u=Array.from({length:o-1}).map((c,f)=>(f+1)*l);return n.range?u.filter(c=>c<100*(t.value-n.min)/(n.max-n.min)||c>100*(i.value-n.min)/(n.max-n.min)):u.filter(c=>c>100*(e.firstValue-n.min)/(n.max-n.min))}),getStopStyle:o=>n.vertical?{bottom:`${o}%`}:{left:`${o}%`}}),ML=(n,e,t,i,r,s)=>{const o=c=>{r(gt,c),r(Lr,c)},l=()=>n.range?![t.value,i.value].every((c,f)=>c===e.oldValue[f]):n.modelValue!==e.oldValue,u=()=>{var c,f;n.min>n.max&&ms("Slider","min should not be greater than max.");const h=n.modelValue;n.range&&Array.isArray(h)?h[1]n.max?o([n.max,n.max]):h[0]n.max?o([h[0],n.max]):(e.firstValue=h[0],e.secondValue=h[1],l()&&(n.validateEvent&&((c=s==null?void 0:s.validate)==null||c.call(s,"change").catch(m=>Ct(m))),e.oldValue=h.slice())):!n.range&&typeof h=="number"&&!Number.isNaN(h)&&(hn.max?o(n.max):(e.firstValue=h,l()&&(n.validateEvent&&((f=s==null?void 0:s.validate)==null||f.call(s,"change").catch(m=>Ct(m))),e.oldValue=h)))};u(),a.watch(()=>e.dragging,c=>{c||u()}),a.watch(()=>n.modelValue,(c,f)=>{e.dragging||Array.isArray(c)&&Array.isArray(f)&&c.every((h,m)=>h===f[m])&&e.firstValue===c[0]&&e.secondValue===c[1]||u()},{deep:!0}),a.watch(()=>[n.min,n.max],()=>{u()})},SL=Ke({modelValue:{type:Number,default:0},vertical:Boolean,tooltipClass:String,placement:{type:String,values:ys,default:"top"}}),_L={[gt]:n=>rt(n)},TL=a.defineComponent({name:"ElSliderButton"}),EL=a.defineComponent({...TL,props:SL,emits:_L,setup(n,{expose:e,emit:t}){const i=n,r=Ue("slider"),s=a.reactive({hovering:!1,dragging:!1,isClick:!1,startX:0,currentX:0,startY:0,currentY:0,startPosition:0,newPosition:0,oldValue:i.modelValue}),{disabled:o,button:l,tooltip:u,showTooltip:c,tooltipVisible:f,wrapperStyle:h,formatValue:m,handleMouseEnter:y,handleMouseLeave:p,onButtonDown:d,onKeyDown:b,setPosition:v}=xL(i,s,t),{hovering:g,dragging:M}=a.toRefs(s);return e({onButtonDown:d,onKeyDown:b,setPosition:v,hovering:g,dragging:M}),(_,E)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"button",ref:l,class:a.normalizeClass([a.unref(r).e("button-wrapper"),{hover:a.unref(g),dragging:a.unref(M)}]),style:a.normalizeStyle(a.unref(h)),tabindex:a.unref(o)?-1:0,onMouseenter:a.unref(y),onMouseleave:a.unref(p),onMousedown:a.unref(d),onFocus:a.unref(y),onBlur:a.unref(p),onKeydown:a.unref(b)},[a.createVNode(a.unref(nd),{ref_key:"tooltip",ref:u,visible:a.unref(f),placement:_.placement,"fallback-placements":["top","bottom","right","left"],"stop-popper-mouse-event":!1,"popper-class":_.tooltipClass,disabled:!a.unref(c),persistent:""},{content:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(m)),1)]),default:a.withCtx(()=>[a.createElementVNode("div",{class:a.normalizeClass([a.unref(r).e("button"),{hover:a.unref(g),dragging:a.unref(M)}])},null,2)]),_:1},8,["visible","placement","popper-class","disabled"])],46,["tabindex","onMouseenter","onMouseleave","onMousedown","onFocus","onBlur","onKeydown"]))}});var kg=je(EL,[["__file","button.vue"]]);const CL=Ke({mark:{type:Fe([String,Object]),default:void 0}});var AL=a.defineComponent({name:"ElSliderMarker",props:CL,setup(n){const e=Ue("slider"),t=a.computed(()=>on(n.mark)?n.mark:n.mark.label),i=a.computed(()=>on(n.mark)?void 0:n.mark.style);return()=>a.h("div",{class:e.e("marks-text"),style:i.value},t.value)}});const LL=a.defineComponent({name:"ElSlider"}),RL=a.defineComponent({...LL,props:oL,emits:aL,setup(n,{expose:e,emit:t}){const i=n,r=Ue("slider"),{t:s}=fl(),o=a.reactive({firstValue:0,secondValue:0,oldValue:0,dragging:!1,sliderSize:1}),{elFormItem:l,slider:u,firstButton:c,secondButton:f,sliderDisabled:h,minValue:m,maxValue:y,runwayStyle:p,barStyle:d,resetSize:b,emitChange:v,onSliderWrapperPrevent:g,onSliderClick:M,onSliderDown:_,onSliderMarkerDown:E,setFirstValue:S,setSecondValue:w}=uL(i,o,t),{stops:T,getStopStyle:C}=wL(i,o,m,y),{inputId:R,isLabeledByFormItem:P}=$u(i,{formItemContext:l}),L=_s(),A=a.computed(()=>i.inputSize||L.value),I=a.computed(()=>i.ariaLabel||s("el.slider.defaultLabel",{min:i.min,max:i.max})),O=a.computed(()=>i.range?i.rangeStartLabel||s("el.slider.defaultRangeStartLabel"):I.value),x=a.computed(()=>i.formatValueText?i.formatValueText(K.value):`${K.value}`),N=a.computed(()=>i.rangeEndLabel||s("el.slider.defaultRangeEndLabel")),B=a.computed(()=>i.formatValueText?i.formatValueText(ie.value):`${ie.value}`),D=a.computed(()=>[r.b(),r.m(L.value),r.is("vertical",i.vertical),{[r.m("with-input")]:i.showInput}]),V=cL(i);ML(i,o,m,y,t,l);const z=a.computed(()=>{const W=[i.min,i.max,i.step].map(q=>{const Q=`${q}`.split(".")[1];return Q?Q.length:0});return Math.max.apply(null,W)}),{sliderWrapper:G}=lL(i,o,b),{firstValue:K,secondValue:ie,sliderSize:j}=a.toRefs(o),H=W=>{o.dragging=W};return Gt(G,"touchstart",g,{passive:!1}),Gt(G,"touchmove",g,{passive:!1}),a.provide(Vg,{...a.toRefs(i),sliderSize:j,disabled:h,precision:z,emitChange:v,resetSize:b,updateDragging:H}),e({onSliderClick:M}),(W,q)=>{var Q,ee;return a.openBlock(),a.createElementBlock("div",{id:W.range?a.unref(R):void 0,ref_key:"sliderWrapper",ref:G,class:a.normalizeClass(a.unref(D)),role:W.range?"group":void 0,"aria-label":W.range&&!a.unref(P)?a.unref(I):void 0,"aria-labelledby":W.range&&a.unref(P)?(Q=a.unref(l))==null?void 0:Q.labelId:void 0},[a.createElementVNode("div",{ref_key:"slider",ref:u,class:a.normalizeClass([a.unref(r).e("runway"),{"show-input":W.showInput&&!W.range},a.unref(r).is("disabled",a.unref(h))]),style:a.normalizeStyle(a.unref(p)),onMousedown:a.unref(_),onTouchstartPassive:a.unref(_)},[a.createElementVNode("div",{class:a.normalizeClass(a.unref(r).e("bar")),style:a.normalizeStyle(a.unref(d))},null,6),a.createVNode(kg,{id:W.range?void 0:a.unref(R),ref_key:"firstButton",ref:c,"model-value":a.unref(K),vertical:W.vertical,"tooltip-class":W.tooltipClass,placement:W.placement,role:"slider","aria-label":W.range||!a.unref(P)?a.unref(O):void 0,"aria-labelledby":!W.range&&a.unref(P)?(ee=a.unref(l))==null?void 0:ee.labelId:void 0,"aria-valuemin":W.min,"aria-valuemax":W.range?a.unref(ie):W.max,"aria-valuenow":a.unref(K),"aria-valuetext":a.unref(x),"aria-orientation":W.vertical?"vertical":"horizontal","aria-disabled":a.unref(h),"onUpdate:modelValue":a.unref(S)},null,8,["id","model-value","vertical","tooltip-class","placement","aria-label","aria-labelledby","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"]),W.range?(a.openBlock(),a.createBlock(kg,{key:0,ref_key:"secondButton",ref:f,"model-value":a.unref(ie),vertical:W.vertical,"tooltip-class":W.tooltipClass,placement:W.placement,role:"slider","aria-label":a.unref(N),"aria-valuemin":a.unref(K),"aria-valuemax":W.max,"aria-valuenow":a.unref(ie),"aria-valuetext":a.unref(B),"aria-orientation":W.vertical?"vertical":"horizontal","aria-disabled":a.unref(h),"onUpdate:modelValue":a.unref(w)},null,8,["model-value","vertical","tooltip-class","placement","aria-label","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"])):a.createCommentVNode("v-if",!0),W.showStops?(a.openBlock(),a.createElementBlock("div",{key:1},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(T),(ne,Y)=>(a.openBlock(),a.createElementBlock("div",{key:Y,class:a.normalizeClass(a.unref(r).e("stop")),style:a.normalizeStyle(a.unref(C)(ne))},null,6))),128))])):a.createCommentVNode("v-if",!0),a.unref(V).length>0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[a.createElementVNode("div",null,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(V),(ne,Y)=>(a.openBlock(),a.createElementBlock("div",{key:Y,style:a.normalizeStyle(a.unref(C)(ne.position)),class:a.normalizeClass([a.unref(r).e("stop"),a.unref(r).e("marks-stop")])},null,6))),128))]),a.createElementVNode("div",{class:a.normalizeClass(a.unref(r).e("marks"))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(V),(ne,Y)=>(a.openBlock(),a.createBlock(a.unref(AL),{key:Y,mark:ne.mark,style:a.normalizeStyle(a.unref(C)(ne.position)),onMousedown:a.withModifiers(te=>a.unref(E)(ne.position),["stop"])},null,8,["mark","style","onMousedown"]))),128))],2)],64)):a.createCommentVNode("v-if",!0)],46,["onMousedown","onTouchstartPassive"]),W.showInput&&!W.range?(a.openBlock(),a.createBlock(a.unref(Si),{key:0,ref:"input","model-value":a.unref(K),class:a.normalizeClass(a.unref(r).e("input")),step:W.step,disabled:a.unref(h),controls:W.showInputControls,min:W.min,max:W.max,precision:a.unref(z),debounce:W.debounce,size:a.unref(A),"onUpdate:modelValue":a.unref(S),onChange:a.unref(v)},null,8,["model-value","class","step","disabled","controls","min","max","precision","debounce","size","onUpdate:modelValue","onChange"])):a.createCommentVNode("v-if",!0)],10,["id","role","aria-label","aria-labelledby"])}}});var PL=je(RL,[["__file","slider.vue"]]);const Ln=Ht(PL),Il=Symbol("tabsRootContextKey"),IL=Ke({tabs:{type:Fe(Array),default:()=>bi([])}}),zg="ElTabBar",OL=a.defineComponent({name:zg}),NL=a.defineComponent({...OL,props:IL,setup(n,{expose:e}){const t=n,i=a.getCurrentInstance(),r=a.inject(Il);r||ms(zg,"");const s=Ue("tabs"),o=a.ref(),l=a.ref(),u=()=>{let y=0,p=0;const d=["top","bottom"].includes(r.props.tabPosition)?"width":"height",b=d==="width"?"x":"y",v=b==="x"?"left":"top";return t.tabs.every(g=>{var M,_;const E=(_=(M=i.parent)==null?void 0:M.refs)==null?void 0:_[`tab-${g.uid}`];if(!E)return!1;if(!g.active)return!0;y=E[`offset${Hi(v)}`],p=E[`client${Hi(d)}`];const S=window.getComputedStyle(E);return d==="width"&&(p-=Number.parseFloat(S.paddingLeft)+Number.parseFloat(S.paddingRight),y+=Number.parseFloat(S.paddingLeft)),!1}),{[d]:`${p}px`,transform:`translate${Hi(b)}(${y}px)`}},c=()=>l.value=u(),f=[],h=()=>{var y;f.forEach(d=>d.stop()),f.length=0;const p=(y=i.parent)==null?void 0:y.refs;if(p){for(const d in p)if(d.startsWith("tab-")){const b=p[d];b&&f.push(Tn(b,c))}}};a.watch(()=>t.tabs,async()=>{await a.nextTick(),c(),h()},{immediate:!0});const m=Tn(o,()=>c());return a.onBeforeUnmount(()=>{f.forEach(y=>y.stop()),f.length=0,m.stop()}),e({ref:o,update:c}),(y,p)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"barRef",ref:o,class:a.normalizeClass([a.unref(s).e("active-bar"),a.unref(s).is(a.unref(r).props.tabPosition)]),style:a.normalizeStyle(l.value)},null,6))}});var DL=je(NL,[["__file","tab-bar.vue"]]);const BL=Ke({panes:{type:Fe(Array),default:()=>bi([])},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),FL={tabClick:(n,e,t)=>t instanceof Event,tabRemove:(n,e)=>e instanceof Event},Ug="ElTabNav",VL=a.defineComponent({name:Ug,props:BL,emits:FL,setup(n,{expose:e,emit:t}){const i=a.inject(Il);i||ms(Ug,"");const r=Ue("tabs"),s=gw(),o=Aw(),l=a.ref(),u=a.ref(),c=a.ref(),f=a.ref(),h=a.ref(!1),m=a.ref(0),y=a.ref(!1),p=a.ref(!0),d=a.computed(()=>["top","bottom"].includes(i.props.tabPosition)?"width":"height"),b=a.computed(()=>({transform:`translate${d.value==="width"?"X":"Y"}(-${m.value}px)`})),v=()=>{if(!l.value)return;const T=l.value[`offset${Hi(d.value)}`],C=m.value;if(!C)return;const R=C>T?C-T:0;m.value=R},g=()=>{if(!l.value||!u.value)return;const T=u.value[`offset${Hi(d.value)}`],C=l.value[`offset${Hi(d.value)}`],R=m.value;if(T-R<=C)return;const P=T-R>C*2?R+C:T-C;m.value=P},M=async()=>{const T=u.value;if(!h.value||!c.value||!l.value||!T)return;await a.nextTick();const C=c.value.querySelector(".is-active");if(!C)return;const R=l.value,P=["top","bottom"].includes(i.props.tabPosition),L=C.getBoundingClientRect(),A=R.getBoundingClientRect(),I=P?T.offsetWidth-A.width:T.offsetHeight-A.height,O=m.value;let x=O;P?(L.leftA.right&&(x=O+L.right-A.right)):(L.topA.bottom&&(x=O+(L.bottom-A.bottom))),x=Math.max(x,0),m.value=Math.min(x,I)},_=()=>{var T;if(!u.value||!l.value)return;n.stretch&&((T=f.value)==null||T.update());const C=u.value[`offset${Hi(d.value)}`],R=l.value[`offset${Hi(d.value)}`],P=m.value;R0&&(m.value=0))},E=T=>{const C=T.code,{up:R,down:P,left:L,right:A}=Jn;if(![R,P,L,A].includes(C))return;const I=Array.from(T.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")),O=I.indexOf(T.target);let x;C===L||C===R?O===0?x=I.length-1:x=O-1:O{p.value&&(y.value=!0)},w=()=>y.value=!1;return a.watch(s,T=>{T==="hidden"?p.value=!1:T==="visible"&&setTimeout(()=>p.value=!0,50)}),a.watch(o,T=>{T?setTimeout(()=>p.value=!0,50):p.value=!1}),Tn(c,_),a.onMounted(()=>setTimeout(()=>M(),0)),a.onUpdated(()=>_()),e({scrollToActiveTab:M,removeFocus:w}),()=>{const T=h.value?[a.createVNode("span",{class:[r.e("nav-prev"),r.is("disabled",!h.value.prev)],onClick:v},[a.createVNode(yt,null,{default:()=>[a.createVNode(Wi,null,null)]})]),a.createVNode("span",{class:[r.e("nav-next"),r.is("disabled",!h.value.next)],onClick:g},[a.createVNode(yt,null,{default:()=>[a.createVNode(ji,null,null)]})])]:null,C=n.panes.map((R,P)=>{var L,A,I,O;const x=R.uid,N=R.props.disabled,B=(A=(L=R.props.name)!=null?L:R.index)!=null?A:`${P}`,D=!N&&(R.isClosable||n.editable);R.index=`${P}`;const V=D?a.createVNode(yt,{class:"is-icon-close",onClick:K=>t("tabRemove",R,K)},{default:()=>[a.createVNode(Pu,null,null)]}):null,z=((O=(I=R.slots).label)==null?void 0:O.call(I))||R.props.label,G=!N&&R.active?0:-1;return a.createVNode("div",{ref:`tab-${x}`,class:[r.e("item"),r.is(i.props.tabPosition),r.is("active",R.active),r.is("disabled",N),r.is("closable",D),r.is("focus",y.value)],id:`tab-${B}`,key:`tab-${x}`,"aria-controls":`pane-${B}`,role:"tab","aria-selected":R.active,tabindex:G,onFocus:()=>S(),onBlur:()=>w(),onClick:K=>{w(),t("tabClick",R,B,K)},onKeydown:K=>{D&&(K.code===Jn.delete||K.code===Jn.backspace)&&t("tabRemove",R,K)}},[z,V])});return a.createVNode("div",{ref:c,class:[r.e("nav-wrap"),r.is("scrollable",!!h.value),r.is(i.props.tabPosition)]},[T,a.createVNode("div",{class:r.e("nav-scroll"),ref:l},[a.createVNode("div",{class:[r.e("nav"),r.is(i.props.tabPosition),r.is("stretch",n.stretch&&["top","bottom"].includes(i.props.tabPosition))],ref:u,style:b.value,role:"tablist",onKeydown:E},[n.type?null:a.createVNode(DL,{ref:f,tabs:[...n.panes]},null),C])])])}}}),kL=Ke({type:{type:String,values:["card","border-card",""],default:""},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:Fe(Function),default:()=>!0},stretch:Boolean}),hd=n=>on(n)||rt(n),zL={[gt]:n=>hd(n),tabClick:(n,e)=>e instanceof Event,tabChange:n=>hd(n),edit:(n,e)=>["remove","add"].includes(e),tabRemove:n=>hd(n),tabAdd:()=>!0},UL=a.defineComponent({name:"ElTabs",props:kL,emits:zL,setup(n,{emit:e,slots:t,expose:i}){var r;const s=Ue("tabs"),o=a.computed(()=>["left","right"].includes(n.tabPosition)),{children:l,addChild:u,removeChild:c}=CE(a.getCurrentInstance(),"ElTabPane"),f=a.ref(),h=a.ref((r=n.modelValue)!=null?r:"0"),m=async(v,g=!1)=>{var M,_,E;if(!(h.value===v||On(v)))try{await((M=n.beforeLeave)==null?void 0:M.call(n,v,h.value))!==!1&&(h.value=v,g&&(e(gt,v),e("tabChange",v)),(E=(_=f.value)==null?void 0:_.removeFocus)==null||E.call(_))}catch{}},y=(v,g,M)=>{v.props.disabled||(m(g,!0),e("tabClick",v,M))},p=(v,g)=>{v.props.disabled||On(v.props.name)||(g.stopPropagation(),e("edit",v.props.name,"remove"),e("tabRemove",v.props.name))},d=()=>{e("edit",void 0,"add"),e("tabAdd")};a.watch(()=>n.modelValue,v=>m(v)),a.watch(h,async()=>{var v;await a.nextTick(),(v=f.value)==null||v.scrollToActiveTab()}),a.provide(Il,{props:n,currentName:h,registerPane:v=>{l.value.push(v)},sortPane:u,unregisterPane:c}),i({currentName:h});const b=({render:v})=>v();return()=>{const v=t["add-icon"],g=n.editable||n.addable?a.createVNode("div",{class:[s.e("new-tab"),o.value&&s.e("new-tab-vertical")],tabindex:"0",onClick:d,onKeydown:E=>{E.code===Jn.enter&&d()}},[v?a.renderSlot(t,"add-icon"):a.createVNode(yt,{class:s.is("icon-plus")},{default:()=>[a.createVNode(ul,null,null)]})]):null,M=a.createVNode("div",{class:[s.e("header"),o.value&&s.e("header-vertical"),s.is(n.tabPosition)]},[a.createVNode(b,{render:()=>{const E=l.value.some(S=>S.slots.label);return a.createVNode(VL,{ref:f,currentName:h.value,editable:n.editable,type:n.type,panes:l.value,stretch:n.stretch,onTabClick:y,onTabRemove:p},{$stable:!E})}},null),g]),_=a.createVNode("div",{class:s.e("content")},[a.renderSlot(t,"default")]);return a.createVNode("div",{class:[s.b(),s.m(n.tabPosition),{[s.m("card")]:n.type==="card",[s.m("border-card")]:n.type==="border-card"}]},[_,M])}}}),GL=Ke({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),Gg="ElTabPane",HL=a.defineComponent({name:Gg}),WL=a.defineComponent({...HL,props:GL,setup(n){const e=n,t=a.getCurrentInstance(),i=a.useSlots(),r=a.inject(Il);r||ms(Gg,"usage: ");const s=Ue("tab-pane"),o=a.ref(),l=a.computed(()=>e.closable||r.props.closable),u=ip(()=>{var y;return r.currentName.value===((y=e.name)!=null?y:o.value)}),c=a.ref(u.value),f=a.computed(()=>{var y;return(y=e.name)!=null?y:o.value}),h=ip(()=>!e.lazy||c.value||u.value);a.watch(u,y=>{y&&(c.value=!0)});const m=a.reactive({uid:t.uid,slots:i,props:e,paneName:f,active:u,index:o,isClosable:l});return r.registerPane(m),a.onMounted(()=>{r.sortPane(m)}),a.onUnmounted(()=>{r.unregisterPane(m.uid)}),(y,p)=>a.unref(h)?a.withDirectives((a.openBlock(),a.createElementBlock("div",{key:0,id:`pane-${a.unref(f)}`,class:a.normalizeClass(a.unref(s).b()),role:"tabpanel","aria-hidden":!a.unref(u),"aria-labelledby":`tab-${a.unref(f)}`},[a.renderSlot(y.$slots,"default")],10,["id","aria-hidden","aria-labelledby"])),[[a.vShow,a.unref(u)]]):a.createCommentVNode("v-if",!0)}});var Hg=je(WL,[["__file","tab-pane.vue"]]);const Wg=Ht(UL,{TabPane:Hg}),jg=vi(Hg);function jL(n){let e;const t=a.ref(!1),i=a.reactive({...n,originalPosition:"",originalOverflow:"",visible:!1});function r(m){i.text=m}function s(){const m=i.parent,y=h.ns;if(!m.vLoadingAddClassList){let p=m.getAttribute("loading-number");p=Number.parseInt(p)-1,p?m.setAttribute("loading-number",p.toString()):(al(m,y.bm("parent","relative")),m.removeAttribute("loading-number")),al(m,y.bm("parent","hidden"))}o(),f.unmount()}function o(){var m,y;(y=(m=h.$el)==null?void 0:m.parentNode)==null||y.removeChild(h.$el)}function l(){var m;n.beforeClose&&!n.beforeClose()||(t.value=!0,clearTimeout(e),e=setTimeout(u,400),i.visible=!1,(m=n.closed)==null||m.call(n))}function u(){if(!t.value)return;const m=i.parent;t.value=!1,m.vLoadingAddClassList=void 0,s()}const c=a.defineComponent({name:"ElLoading",setup(m,{expose:y}){const{ns:p,zIndex:d}=DE("loading");return y({ns:p,zIndex:d}),()=>{const b=i.spinner||i.svg,v=a.h("svg",{class:"circular",viewBox:i.svgViewBox?i.svgViewBox:"0 0 50 50",...b?{innerHTML:b}:{}},[a.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),g=i.text?a.h("p",{class:p.b("text")},[i.text]):void 0;return a.h(a.Transition,{name:p.b("fade"),onAfterLeave:u},{default:a.withCtx(()=>[a.withDirectives(a.createVNode("div",{style:{backgroundColor:i.background||""},class:[p.b("mask"),i.customClass,i.fullscreen?"is-fullscreen":""]},[a.h("div",{class:p.b("spinner")},[v,g])]),[[a.vShow,i.visible]])])})}}}),f=a.createApp(c),h=f.mount(document.createElement("div"));return{...a.toRefs(i),setText:r,removeElLoadingChild:o,close:l,handleAfterLeave:u,vm:h,get $el(){return h.$el}}}let Ol;const fd=function(n={}){if(!Ft)return;const e=$L(n);if(e.fullscreen&&Ol)return Ol;const t=jL({...e,closed:()=>{var r;(r=e.closed)==null||r.call(e),e.fullscreen&&(Ol=void 0)}});ZL(e,e.parent,t),$g(e,e.parent,t),e.parent.vLoadingAddClassList=()=>$g(e,e.parent,t);let i=e.parent.getAttribute("loading-number");return i?i=`${Number.parseInt(i)+1}`:i="1",e.parent.setAttribute("loading-number",i),e.parent.appendChild(t.$el),a.nextTick(()=>t.visible.value=e.visible),e.fullscreen&&(Ol=t),t},$L=n=>{var e,t,i,r;let s;return on(n.target)?s=(e=document.querySelector(n.target))!=null?e:document.body:s=n.target||document.body,{parent:s===document.body||n.body?document.body:s,background:n.background||"",svg:n.svg||"",svgViewBox:n.svgViewBox||"",spinner:n.spinner||!1,text:n.text||"",fullscreen:s===document.body&&((t=n.fullscreen)!=null?t:!0),lock:(i=n.lock)!=null?i:!1,customClass:n.customClass||"",visible:(r=n.visible)!=null?r:!0,beforeClose:n.beforeClose,closed:n.closed,target:s}},ZL=async(n,e,t)=>{const{nextZIndex:i}=t.vm.zIndex||t.vm._.exposed.zIndex,r={};if(n.fullscreen)t.originalPosition.value=ko(document.body,"position"),t.originalOverflow.value=ko(document.body,"overflow"),r.zIndex=i();else if(n.parent===document.body){t.originalPosition.value=ko(document.body,"position"),await a.nextTick();for(const s of["top","left"]){const o=s==="top"?"scrollTop":"scrollLeft";r[s]=`${n.target.getBoundingClientRect()[s]+document.body[o]+document.documentElement[o]-Number.parseInt(ko(document.body,`margin-${s}`),10)}px`}for(const s of["height","width"])r[s]=`${n.target.getBoundingClientRect()[s]}px`}else t.originalPosition.value=ko(e,"position");for(const[s,o]of Object.entries(r))t.$el.style[s]=o},$g=(n,e,t)=>{const i=t.vm.ns||t.vm._.exposed.ns;["absolute","fixed","sticky"].includes(t.originalPosition.value)?al(e,i.bm("parent","relative")):om(e,i.bm("parent","relative")),n.fullscreen&&n.lock?om(e,i.bm("parent","hidden")):al(e,i.bm("parent","hidden"))},Nl=Symbol("ElLoading"),Zg=(n,e)=>{var t,i,r,s;const o=e.instance,l=m=>an(e.value)?e.value[m]:void 0,u=m=>{const y=on(m)&&(o==null?void 0:o[m])||m;return y&&a.ref(y)},c=m=>u(l(m)||n.getAttribute(`element-loading-${Bw(m)}`)),f=(t=l("fullscreen"))!=null?t:e.modifiers.fullscreen,h={text:c("text"),svg:c("svg"),svgViewBox:c("svgViewBox"),spinner:c("spinner"),background:c("background"),customClass:c("customClass"),fullscreen:f,target:(i=l("target"))!=null?i:f?void 0:n,body:(r=l("body"))!=null?r:e.modifiers.body,lock:(s=l("lock"))!=null?s:e.modifiers.lock};n[Nl]={options:h,instance:fd(h)}},XL=(n,e)=>{for(const t of Object.keys(e))a.isRef(e[t])&&(e[t].value=n[t])},pd={mounted(n,e){e.value&&Zg(n,e)},updated(n,e){const t=n[Nl];e.oldValue!==e.value&&(e.value&&!e.oldValue?Zg(n,e):e.value&&e.oldValue?an(e.value)&&XL(e.value,t.options):t==null||t.instance.close())},unmounted(n){var e;(e=n[Nl])==null||e.instance.close(),n[Nl]=null}},YL={install(n){n.directive("loading",pd),n.config.globalProperties.$loading=fd},directive:pd,service:fd};var Xg={exports:{}},Yg={},Jg;function JL(){return Jg||(Jg=1,function(n){var e=function(){try{return!!Symbol.iterator}catch{return!1}},t=e(),i=function(c){var f={next:function(){var h=c.shift();return{done:h===void 0,value:h}}};return t&&(f[Symbol.iterator]=function(){return f}),f},r=function(c){return encodeURIComponent(c).replace(/%20/g,"+")},s=function(c){return decodeURIComponent(String(c).replace(/\+/g," "))},o=function(){var c=function(h){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var m=typeof h;if(m!=="undefined")if(m==="string")h!==""&&this._fromString(h);else if(h instanceof c){var y=this;h.forEach(function(v,g){y.append(g,v)})}else if(h!==null&&m==="object")if(Object.prototype.toString.call(h)==="[object Array]")for(var p=0;py[0]?1:0}),c._entries&&(c._entries={});for(var h=0;h1?s(y[1]):"")}})}(typeof Ki<"u"?Ki:typeof window<"u"?window:typeof self<"u"?self:Ki),function(n){var e=function(){try{var r=new n.URL("b","http://a");return r.pathname="c d",r.href==="http://a/c%20d"&&r.searchParams}catch{return!1}},t=function(){var r=n.URL,s=function(u,c){typeof u!="string"&&(u=String(u)),c&&typeof c!="string"&&(c=String(c));var f=document,h;if(c&&(n.location===void 0||c!==n.location.href)){c=c.toLowerCase(),f=document.implementation.createHTMLDocument(""),h=f.createElement("base"),h.href=c,f.head.appendChild(h);try{if(h.href.indexOf(c)!==0)throw new Error(h.href)}catch(M){throw new Error("URL unable to set base "+c+" due to "+M)}}var m=f.createElement("a");m.href=u,h&&(f.body.appendChild(m),m.href=m.href);var y=f.createElement("input");if(y.type="url",y.value=u,m.protocol===":"||!/:/.test(m.href)||!y.checkValidity()&&!c)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:m});var p=new n.URLSearchParams(this.search),d=!0,b=!0,v=this;["append","delete","set"].forEach(function(M){var _=p[M];p[M]=function(){_.apply(p,arguments),d&&(b=!1,v.search=p.toString(),b=!0)}}),Object.defineProperty(this,"searchParams",{value:p,enumerable:!0});var g=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==g&&(g=this.search,b&&(d=!1,this.searchParams._fromString(this.search),d=!0))}})},o=s.prototype,l=function(u){Object.defineProperty(o,u,{get:function(){return this._anchorElement[u]},set:function(c){this._anchorElement[u]=c},enumerable:!0})};["hash","host","hostname","port","protocol"].forEach(function(u){l(u)}),Object.defineProperty(o,"search",{get:function(){return this._anchorElement.search},set:function(u){this._anchorElement.search=u,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(o,{toString:{get:function(){var u=this;return function(){return u.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(u){this._anchorElement.href=u,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(u){this._anchorElement.pathname=u},enumerable:!0},origin:{get:function(){var u={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],c=this._anchorElement.port!=u&&this._anchorElement.port!=="";return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(c?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(u){},enumerable:!0},username:{get:function(){return""},set:function(u){},enumerable:!0}}),s.createObjectURL=function(u){return r.createObjectURL.apply(r,arguments)},s.revokeObjectURL=function(u){return r.revokeObjectURL.apply(r,arguments)},n.URL=s};if(e()||t(),n.location!==void 0&&!("origin"in n.location)){var i=function(){return n.location.protocol+"//"+n.location.hostname+(n.location.port?":"+n.location.port:"")};try{Object.defineProperty(n.location,"origin",{get:i,enumerable:!0})}catch{setInterval(function(){n.location.origin=i()},100)}}}(typeof Ki<"u"?Ki:typeof window<"u"?window:typeof self<"u"?self:Ki)),Yg}/** * @license * Copyright 2010-2021 Three.js Authors * SPDX-License-Identifier: MIT */const md="130",qL={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},KL={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},qg=0,gd=1,Kg=2,QL=3,eR=0,yd=1,Qg=2,Rs=3,er=0,At=1,tr=2,vd=1,tR=2,_i=0,Ps=1,bd=2,xd=3,wd=4,e0=5,Nr=100,t0=101,n0=102,Md=103,Sd=104,i0=200,r0=201,s0=202,o0=203,_d=204,Td=205,a0=206,l0=207,c0=208,u0=209,d0=210,h0=0,f0=1,p0=2,Dl=3,m0=4,g0=5,y0=6,v0=7,Yo=0,b0=1,x0=2,nr=0,w0=1,M0=2,S0=3,_0=4,T0=5,Bl=300,Jo=301,qo=302,Fl=303,Vl=304,Is=306,Ko=307,ir=1e3,Wt=1001,Os=1002,Lt=1003,Qo=1004,nR=1004,ea=1005,iR=1005,wt=1006,kl=1007,rR=1007,Ti=1008,sR=1008,Dr=1009,E0=1010,C0=1011,ta=1012,A0=1013,na=1014,Ei=1015,Br=1016,L0=1017,R0=1018,P0=1019,Ns=1020,I0=1021,Ci=1022,vn=1023,O0=1024,N0=1025,D0=vn,Fr=1026,Ds=1027,B0=1028,F0=1029,V0=1030,k0=1031,z0=1032,U0=1033,Ed=33776,Cd=33777,Ad=33778,Ld=33779,Rd=35840,Pd=35841,Id=35842,Od=35843,G0=36196,Nd=37492,Dd=37496,H0=37808,W0=37809,j0=37810,$0=37811,Z0=37812,X0=37813,Y0=37814,J0=37815,q0=37816,K0=37817,Q0=37818,ey=37819,ty=37820,ny=37821,iy=36492,ry=37840,sy=37841,oy=37842,ay=37843,ly=37844,cy=37845,uy=37846,dy=37847,hy=37848,fy=37849,py=37850,my=37851,gy=37852,yy=37853,vy=2200,by=2201,xy=2202,Bs=2300,Vr=2301,zl=2302,kr=2400,zr=2401,ia=2402,Ul=2500,Bd=2501,wy=0,My=1,Fd=2,ln=3e3,Ur=3001,Gl=3007,Hl=3002,Sy=3003,Vd=3004,kd=3005,zd=3006,_y=3200,Ty=3201,rr=0,Ey=1,oR=0,Wl=7680,aR=7681,lR=7682,cR=7683,uR=34055,dR=34056,hR=5386,fR=512,pR=513,mR=514,gR=515,yR=516,vR=517,bR=518,Cy=519,Fs=35044,Vs=35048,xR=35040,wR=35045,MR=35049,SR=35041,_R=35046,TR=35050,ER=35042,CR="100",Ud="300 es";class sr{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const r=this._listeners[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const i=this._listeners[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s>8&255]+Yt[n>>16&255]+Yt[n>>24&255]+"-"+Yt[e&255]+Yt[e>>8&255]+"-"+Yt[e>>16&15|64]+Yt[e>>24&255]+"-"+Yt[t&63|128]+Yt[t>>8&255]+"-"+Yt[t>>16&255]+Yt[t>>24&255]+Yt[i&255]+Yt[i>>8&255]+Yt[i>>16&255]+Yt[i>>24&255]).toUpperCase()}function Jt(n,e,t){return Math.max(e,Math.min(t,n))}function Gd(n,e){return(n%e+e)%e}function AR(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function LR(n,e,t){return n!==e?(t-n)/(e-n):0}function sa(n,e,t){return(1-t)*n+t*e}function RR(n,e,t,i){return sa(n,e,1-Math.exp(-t*i))}function PR(n,e=1){return e-Math.abs(Gd(n,e*2)-e)}function IR(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function OR(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function NR(n,e){return n+Math.floor(Math.random()*(e-n+1))}function DR(n,e){return n+Math.random()*(e-n)}function BR(n){return n*(.5-Math.random())}function FR(n){return n!==void 0&&(jl=n%2147483647),jl=jl*16807%2147483647,(jl-1)/2147483646}function VR(n){return n*Gr}function kR(n){return n*ra}function Hd(n){return(n&n-1)===0&&n!==0}function Ay(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function Ly(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function zR(n,e,t,i,r){const s=Math.cos,o=Math.sin,l=s(t/2),u=o(t/2),c=s((e+i)/2),f=o((e+i)/2),h=s((e-i)/2),m=o((e-i)/2),y=s((i-e)/2),p=o((i-e)/2);switch(r){case"XYX":n.set(l*f,u*h,u*m,l*c);break;case"YZY":n.set(u*m,l*f,u*h,l*c);break;case"ZXZ":n.set(u*h,u*m,l*f,l*c);break;case"XZX":n.set(l*f,u*p,u*y,l*c);break;case"YXY":n.set(u*y,l*f,u*p,l*c);break;case"ZYZ":n.set(u*p,u*y,l*f,l*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}var Wd=Object.freeze({__proto__:null,DEG2RAD:Gr,RAD2DEG:ra,generateUUID:bn,clamp:Jt,euclideanModulo:Gd,mapLinear:AR,inverseLerp:LR,lerp:sa,damp:RR,pingpong:PR,smoothstep:IR,smootherstep:OR,randInt:NR,randFloat:DR,randFloatSpread:BR,seededRandom:FR,degToRad:VR,radToDeg:kR,isPowerOfTwo:Hd,ceilPowerOfTwo:Ay,floorPowerOfTwo:Ly,setQuaternionFromProperEuler:zR});class Se{constructor(e=0,t=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,t){return t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(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,t){return t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(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,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[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 i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,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,i){return i!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}Se.prototype.isVector2=!0;class kt{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,i,r,s,o,l,u,c){const f=this.elements;return f[0]=e,f[1]=r,f[2]=l,f[3]=t,f[4]=s,f[5]=u,f[6]=i,f[7]=o,f[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){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 i=e.elements,r=t.elements,s=this.elements,o=i[0],l=i[3],u=i[6],c=i[1],f=i[4],h=i[7],m=i[2],y=i[5],p=i[8],d=r[0],b=r[3],v=r[6],g=r[1],M=r[4],_=r[7],E=r[2],S=r[5],w=r[8];return s[0]=o*d+l*g+u*E,s[3]=o*b+l*M+u*S,s[6]=o*v+l*_+u*w,s[1]=c*d+f*g+h*E,s[4]=c*b+f*M+h*S,s[7]=c*v+f*_+h*w,s[2]=m*d+y*g+p*E,s[5]=m*b+y*M+p*S,s[8]=m*v+y*_+p*w,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],i=e[1],r=e[2],s=e[3],o=e[4],l=e[5],u=e[6],c=e[7],f=e[8];return t*o*f-t*l*c-i*s*f+i*l*u+r*s*c-r*o*u}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],l=e[5],u=e[6],c=e[7],f=e[8],h=f*o-l*c,m=l*u-f*s,y=c*s-o*u,p=t*h+i*m+r*y;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const d=1/p;return e[0]=h*d,e[1]=(r*c-f*i)*d,e[2]=(l*i-r*o)*d,e[3]=m*d,e[4]=(f*t-r*u)*d,e[5]=(r*s-l*t)*d,e[6]=y*d,e[7]=(i*u-c*t)*d,e[8]=(o*t-i*s)*d,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,i,r,s,o,l){const u=Math.cos(s),c=Math.sin(s);return this.set(i*u,i*c,-i*(u*o+c*l)+o+e,-r*c,r*u,-r*(-c*o+u*l)+l+t,0,0,1),this}scale(e,t){const i=this.elements;return i[0]*=e,i[3]*=e,i[6]*=e,i[1]*=t,i[4]*=t,i[7]*=t,this}rotate(e){const t=Math.cos(e),i=Math.sin(e),r=this.elements,s=r[0],o=r[3],l=r[6],u=r[1],c=r[4],f=r[7];return r[0]=t*s+i*u,r[3]=t*o+i*c,r[6]=t*l+i*f,r[1]=-i*s+t*u,r[4]=-i*o+t*c,r[7]=-i*l+t*f,this}translate(e,t){const i=this.elements;return i[0]+=e*i[2],i[3]+=e*i[5],i[6]+=e*i[8],i[1]+=t*i[2],i[4]+=t*i[5],i[7]+=t*i[8],this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}kt.prototype.isMatrix3=!0;let ks;class Hr{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{ks===void 0&&(ks=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),ks.width=e.width,ks.height=e.height;const i=ks.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=ks}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")}}let UR=0;class Rt extends sr{constructor(e=Rt.DEFAULT_IMAGE,t=Rt.DEFAULT_MAPPING,i=Wt,r=Wt,s=wt,o=Ti,l=vn,u=Dr,c=1,f=ln){super(),Object.defineProperty(this,"id",{value:UR++}),this.uuid=bn(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=l,this.internalFormat=null,this.type=u,this.offset=new Se(0,0),this.repeat=new Se(1,1),this.center=new Se(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new kt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=f,this.version=0,this.onUpdate=null}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(this.image!==void 0){const r=this.image;if(r.uuid===void 0&&(r.uuid=bn()),!t&&e.images[r.uuid]===void 0){let s;if(Array.isArray(r)){s=[];for(let o=0,l=r.length;o1)switch(this.wrapS){case ir:e.x=e.x-Math.floor(e.x);break;case Wt:e.x=e.x<0?0:1;break;case Os: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 ir:e.y=e.y-Math.floor(e.y);break;case Wt:e.y=e.y<0?0:1;break;case Os: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++}}Rt.DEFAULT_IMAGE=void 0,Rt.DEFAULT_MAPPING=Bl,Rt.prototype.isTexture=!0;function jd(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?Hr.getDataURL(n):n.data?{data:Array.prototype.slice.call(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}class st{constructor(e=0,t=0,i=0,r=1){this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,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,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(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,t){return t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(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,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*i+o[11]*r+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,i,r,s;const u=e.elements,c=u[0],f=u[4],h=u[8],m=u[1],y=u[5],p=u[9],d=u[2],b=u[6],v=u[10];if(Math.abs(f-m)<.01&&Math.abs(h-d)<.01&&Math.abs(p-b)<.01){if(Math.abs(f+m)<.1&&Math.abs(h+d)<.1&&Math.abs(p+b)<.1&&Math.abs(c+y+v-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const M=(c+1)/2,_=(y+1)/2,E=(v+1)/2,S=(f+m)/4,w=(h+d)/4,T=(p+b)/4;return M>_&&M>E?M<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(M),r=S/i,s=w/i):_>E?_<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(_),i=S/r,s=T/r):E<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(E),i=w/s,r=T/s),this.set(i,r,s,t),this}let g=Math.sqrt((b-p)*(b-p)+(h-d)*(h-d)+(m-f)*(m-f));return Math.abs(g)<.001&&(g=1),this.x=(b-p)/g,this.y=(h-d)/g,this.z=(m-f)/g,this.w=Math.acos((c+y+v-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 i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,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,i){return i!==void 0&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),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}}st.prototype.isVector4=!0;class Vn extends sr{constructor(e,t,i={}){super(),this.width=e,this.height=t,this.depth=1,this.scissor=new st(0,0,e,t),this.scissorTest=!1,this.viewport=new st(0,0,e,t),this.texture=new Rt(void 0,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.image={width:e,height:t,depth:1},this.texture.generateMipmaps=i.generateMipmaps!==void 0?i.generateMipmaps:!1,this.texture.minFilter=i.minFilter!==void 0?i.minFilter:wt,this.depthBuffer=i.depthBuffer!==void 0?i.depthBuffer:!0,this.stencilBuffer=i.stencilBuffer!==void 0?i.stencilBuffer:!1,this.depthTexture=i.depthTexture!==void 0?i.depthTexture:null}setTexture(e){e.image={width:this.width,height:this.height,depth:this.depth},this.texture=e}setSize(e,t,i=1){(this.width!==e||this.height!==t||this.depth!==i)&&(this.width=e,this.height=t,this.depth=i,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.image={...this.texture.image},this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}Vn.prototype.isWebGLRenderTarget=!0;class Ry extends Vn{constructor(e,t,i){super(e,t);const r=this.texture;this.texture=[];for(let s=0;s=0?1:-1,M=1-v*v;if(M>Number.EPSILON){const E=Math.sqrt(M),S=Math.atan2(E,v*g);b=Math.sin(b*S)/E,l=Math.sin(l*S)/E}const _=l*g;if(u=u*b+m*_,c=c*b+y*_,f=f*b+p*_,h=h*b+d*_,b===1-l){const E=1/Math.sqrt(u*u+c*c+f*f+h*h);u*=E,c*=E,f*=E,h*=E}}e[t]=u,e[t+1]=c,e[t+2]=f,e[t+3]=h}static multiplyQuaternionsFlat(e,t,i,r,s,o){const l=i[r],u=i[r+1],c=i[r+2],f=i[r+3],h=s[o],m=s[o+1],y=s[o+2],p=s[o+3];return e[t]=l*p+f*h+u*y-c*m,e[t+1]=u*p+f*m+c*h-l*y,e[t+2]=c*p+f*y+l*m-u*h,e[t+3]=f*p-l*h-u*m-c*y,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,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){if(!(e&&e.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const i=e._x,r=e._y,s=e._z,o=e._order,l=Math.cos,u=Math.sin,c=l(i/2),f=l(r/2),h=l(s/2),m=u(i/2),y=u(r/2),p=u(s/2);switch(o){case"XYZ":this._x=m*f*h+c*y*p,this._y=c*y*h-m*f*p,this._z=c*f*p+m*y*h,this._w=c*f*h-m*y*p;break;case"YXZ":this._x=m*f*h+c*y*p,this._y=c*y*h-m*f*p,this._z=c*f*p-m*y*h,this._w=c*f*h+m*y*p;break;case"ZXY":this._x=m*f*h-c*y*p,this._y=c*y*h+m*f*p,this._z=c*f*p+m*y*h,this._w=c*f*h-m*y*p;break;case"ZYX":this._x=m*f*h-c*y*p,this._y=c*y*h+m*f*p,this._z=c*f*p-m*y*h,this._w=c*f*h+m*y*p;break;case"YZX":this._x=m*f*h+c*y*p,this._y=c*y*h+m*f*p,this._z=c*f*p-m*y*h,this._w=c*f*h-m*y*p;break;case"XZY":this._x=m*f*h-c*y*p,this._y=c*y*h-m*f*p,this._z=c*f*p+m*y*h,this._w=c*f*h+m*y*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],o=t[1],l=t[5],u=t[9],c=t[2],f=t[6],h=t[10],m=i+l+h;if(m>0){const y=.5/Math.sqrt(m+1);this._w=.25/y,this._x=(f-u)*y,this._y=(s-c)*y,this._z=(o-r)*y}else if(i>l&&i>h){const y=2*Math.sqrt(1+i-l-h);this._w=(f-u)/y,this._x=.25*y,this._y=(r+o)/y,this._z=(s+c)/y}else if(l>h){const y=2*Math.sqrt(1+l-i-h);this._w=(s-c)/y,this._x=(r+o)/y,this._y=.25*y,this._z=(u+f)/y}else{const y=2*Math.sqrt(1+h-i-l);this._w=(o-r)/y,this._x=(s+c)/y,this._y=(u+f)/y,this._z=.25*y}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Jt(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);return this.slerp(e,r),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,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,r=e._y,s=e._z,o=e._w,l=t._x,u=t._y,c=t._z,f=t._w;return this._x=i*f+o*l+r*c-s*u,this._y=r*f+o*u+s*l-i*c,this._z=s*f+o*c+i*u-r*l,this._w=o*f-i*l-r*u-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,r=this._y,s=this._z,o=this._w;let l=o*e._w+i*e._x+r*e._y+s*e._z;if(l<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,l=-l):this.copy(e),l>=1)return this._w=o,this._x=i,this._y=r,this._z=s,this;const u=1-l*l;if(u<=Number.EPSILON){const y=1-t;return this._w=y*o+t*this._w,this._x=y*i+t*this._x,this._y=y*r+t*this._y,this._z=y*s+t*this._z,this.normalize(),this._onChangeCallback(),this}const c=Math.sqrt(u),f=Math.atan2(c,l),h=Math.sin((1-t)*f)/c,m=Math.sin(t*f)/c;return this._w=o*h+this._w*m,this._x=i*h+this._x*m,this._y=r*h+this._y*m,this._z=s*h+this._z*m,this._onChangeCallback(),this}slerpQuaternions(e,t,i){this.copy(e).slerp(t,i)}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}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}qt.prototype.isQuaternion=!0;class X{constructor(e=0,t=0,i=0){this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(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,t){return t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(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,t){return t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(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 e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Py.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Py.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,l=e.z,u=e.w,c=u*t+o*r-l*i,f=u*i+l*t-s*r,h=u*r+s*i-o*t,m=-s*t-o*i-l*r;return this.x=c*u+m*-s+f*-l-h*-o,this.y=f*u+m*-o+h*-s-c*-l,this.z=h*u+m*-l+c*-o-f*-s,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,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[10]*r,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 i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,o=t.x,l=t.y,u=t.z;return this.x=r*u-s*l,this.y=s*o-i*u,this.z=i*l-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Zd.copy(this).projectOnVector(e),this.sub(Zd)}reflect(e){return this.sub(Zd.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 i=this.dot(e)/t;return Math.acos(Jt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){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(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}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,i){return i!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),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}}X.prototype.isVector3=!0;const Zd=new X,Py=new qt;class pn{constructor(e=new X(1/0,1/0,1/0),t=new X(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,i=1/0,r=1/0,s=-1/0,o=-1/0,l=-1/0;for(let u=0,c=e.length;us&&(s=f),h>o&&(o=h),m>l&&(l=m)}return this.min.set(t,i,r),this.max.set(s,o,l),this}setFromBufferAttribute(e){let t=1/0,i=1/0,r=1/0,s=-1/0,o=-1/0,l=-1/0;for(let u=0,c=e.count;us&&(s=f),h>o&&(o=h),m>l&&(l=m)}return this.min.set(t,i,r),this.max.set(s,o,l),this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;tthis.max.x||e.ythis.max.y||e.zthis.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.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,oa),oa.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(aa),$l.subVectors(this.max,aa),zs.subVectors(e.a,aa),Us.subVectors(e.b,aa),Gs.subVectors(e.c,aa),or.subVectors(Us,zs),ar.subVectors(Gs,Us),Wr.subVectors(zs,Gs);let t=[0,-or.z,or.y,0,-ar.z,ar.y,0,-Wr.z,Wr.y,or.z,0,-or.x,ar.z,0,-ar.x,Wr.z,0,-Wr.x,-or.y,or.x,0,-ar.y,ar.x,0,-Wr.y,Wr.x,0];return!Yd(t,zs,Us,Gs,$l)||(t=[1,0,0,0,1,0,0,0,1],!Yd(t,zs,Us,Gs,$l))?!1:(Zl.crossVectors(or,ar),t=[Zl.x,Zl.y,Zl.z],Yd(t,zs,Us,Gs,$l))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return oa.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(oa).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:(Ai[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ai[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ai[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ai[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ai[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ai[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ai[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ai[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ai),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)}}pn.prototype.isBox3=!0;const Ai=[new X,new X,new X,new X,new X,new X,new X,new X],oa=new X,Xd=new pn,zs=new X,Us=new X,Gs=new X,or=new X,ar=new X,Wr=new X,aa=new X,$l=new X,Zl=new X,jr=new X;function Yd(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){jr.fromArray(n,s);const l=r.x*Math.abs(jr.x)+r.y*Math.abs(jr.y)+r.z*Math.abs(jr.z),u=e.dot(jr),c=t.dot(jr),f=i.dot(jr);if(Math.max(-Math.max(u,c,f),Math.min(u,c,f))>l)return!1}return!0}const GR=new pn,Iy=new X,Jd=new X,qd=new X;class Li{constructor(e=new X,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):GR.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;sthis.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){qd.subVectors(e,this.center);const t=qd.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.add(qd.multiplyScalar(r/i)),this.radius+=r}return this}union(e){return Jd.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(Iy.copy(e.center).add(Jd)),this.expandByPoint(Iy.copy(e.center).sub(Jd)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Ri=new X,Kd=new X,Xl=new X,lr=new X,Qd=new X,Yl=new X,eh=new X;class cr{constructor(e=new X,t=new X(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Ri)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(i).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Ri.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ri.copy(this.direction).multiplyScalar(t).add(this.origin),Ri.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){Kd.copy(e).add(t).multiplyScalar(.5),Xl.copy(t).sub(e).normalize(),lr.copy(this.origin).sub(Kd);const s=e.distanceTo(t)*.5,o=-this.direction.dot(Xl),l=lr.dot(this.direction),u=-lr.dot(Xl),c=lr.lengthSq(),f=Math.abs(1-o*o);let h,m,y,p;if(f>0)if(h=o*u-l,m=o*l-u,p=s*f,h>=0)if(m>=-p)if(m<=p){const d=1/f;h*=d,m*=d,y=h*(h+o*m+2*l)+m*(o*h+m+2*u)+c}else m=s,h=Math.max(0,-(o*m+l)),y=-h*h+m*(m+2*u)+c;else m=-s,h=Math.max(0,-(o*m+l)),y=-h*h+m*(m+2*u)+c;else m<=-p?(h=Math.max(0,-(-o*s+l)),m=h>0?-s:Math.min(Math.max(-s,-u),s),y=-h*h+m*(m+2*u)+c):m<=p?(h=0,m=Math.min(Math.max(-s,-u),s),y=m*(m+2*u)+c):(h=Math.max(0,-(o*s+l)),m=h>0?s:Math.min(Math.max(-s,-u),s),y=-h*h+m*(m+2*u)+c);else m=o>0?-s:s,h=Math.max(0,-(o*m+l)),y=-h*h+m*(m+2*u)+c;return i&&i.copy(this.direction).multiplyScalar(h).add(this.origin),r&&r.copy(Xl).multiplyScalar(m).add(Kd),y}intersectSphere(e,t){Ri.subVectors(e.center,this.origin);const i=Ri.dot(this.direction),r=Ri.dot(Ri)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),l=i-o,u=i+o;return l<0&&u<0?null:l<0?this.at(u,t):this.at(l,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 i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,o,l,u;const c=1/this.direction.x,f=1/this.direction.y,h=1/this.direction.z,m=this.origin;return c>=0?(i=(e.min.x-m.x)*c,r=(e.max.x-m.x)*c):(i=(e.max.x-m.x)*c,r=(e.min.x-m.x)*c),f>=0?(s=(e.min.y-m.y)*f,o=(e.max.y-m.y)*f):(s=(e.max.y-m.y)*f,o=(e.min.y-m.y)*f),i>o||s>r||((s>i||i!==i)&&(i=s),(o=0?(l=(e.min.z-m.z)*h,u=(e.max.z-m.z)*h):(l=(e.max.z-m.z)*h,u=(e.min.z-m.z)*h),i>u||l>r)||((l>i||i!==i)&&(i=l),(u=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,Ri)!==null}intersectTriangle(e,t,i,r,s){Qd.subVectors(t,e),Yl.subVectors(i,e),eh.crossVectors(Qd,Yl);let o=this.direction.dot(eh),l;if(o>0){if(r)return null;l=1}else if(o<0)l=-1,o=-o;else return null;lr.subVectors(this.origin,e);const u=l*this.direction.dot(Yl.crossVectors(lr,Yl));if(u<0)return null;const c=l*this.direction.dot(Qd.cross(lr));if(c<0||u+c>o)return null;const f=-l*lr.dot(eh);return f<0?null:this.at(f/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 De{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,i,r,s,o,l,u,c,f,h,m,y,p,d,b){const v=this.elements;return v[0]=e,v[4]=t,v[8]=i,v[12]=r,v[1]=s,v[5]=o,v[9]=l,v[13]=u,v[2]=c,v[6]=f,v[10]=h,v[14]=m,v[3]=y,v[7]=p,v[11]=d,v[15]=b,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 De().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[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,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,r=1/Hs.setFromMatrixColumn(e,0).length(),s=1/Hs.setFromMatrixColumn(e,1).length(),o=1/Hs.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const t=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),l=Math.sin(i),u=Math.cos(r),c=Math.sin(r),f=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){const m=o*f,y=o*h,p=l*f,d=l*h;t[0]=u*f,t[4]=-u*h,t[8]=c,t[1]=y+p*c,t[5]=m-d*c,t[9]=-l*u,t[2]=d-m*c,t[6]=p+y*c,t[10]=o*u}else if(e.order==="YXZ"){const m=u*f,y=u*h,p=c*f,d=c*h;t[0]=m+d*l,t[4]=p*l-y,t[8]=o*c,t[1]=o*h,t[5]=o*f,t[9]=-l,t[2]=y*l-p,t[6]=d+m*l,t[10]=o*u}else if(e.order==="ZXY"){const m=u*f,y=u*h,p=c*f,d=c*h;t[0]=m-d*l,t[4]=-o*h,t[8]=p+y*l,t[1]=y+p*l,t[5]=o*f,t[9]=d-m*l,t[2]=-o*c,t[6]=l,t[10]=o*u}else if(e.order==="ZYX"){const m=o*f,y=o*h,p=l*f,d=l*h;t[0]=u*f,t[4]=p*c-y,t[8]=m*c+d,t[1]=u*h,t[5]=d*c+m,t[9]=y*c-p,t[2]=-c,t[6]=l*u,t[10]=o*u}else if(e.order==="YZX"){const m=o*u,y=o*c,p=l*u,d=l*c;t[0]=u*f,t[4]=d-m*h,t[8]=p*h+y,t[1]=h,t[5]=o*f,t[9]=-l*f,t[2]=-c*f,t[6]=y*h+p,t[10]=m-d*h}else if(e.order==="XZY"){const m=o*u,y=o*c,p=l*u,d=l*c;t[0]=u*f,t[4]=-h,t[8]=c*f,t[1]=m*h+d,t[5]=o*f,t[9]=y*h-p,t[2]=p*h-y,t[6]=l*f,t[10]=d*h+m}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(HR,e,WR)}lookAt(e,t,i){const r=this.elements;return xn.subVectors(e,t),xn.lengthSq()===0&&(xn.z=1),xn.normalize(),ur.crossVectors(i,xn),ur.lengthSq()===0&&(Math.abs(i.z)===1?xn.x+=1e-4:xn.z+=1e-4,xn.normalize(),ur.crossVectors(i,xn)),ur.normalize(),Jl.crossVectors(xn,ur),r[0]=ur.x,r[4]=Jl.x,r[8]=xn.x,r[1]=ur.y,r[5]=Jl.y,r[9]=xn.y,r[2]=ur.z,r[6]=Jl.z,r[10]=xn.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],l=i[4],u=i[8],c=i[12],f=i[1],h=i[5],m=i[9],y=i[13],p=i[2],d=i[6],b=i[10],v=i[14],g=i[3],M=i[7],_=i[11],E=i[15],S=r[0],w=r[4],T=r[8],C=r[12],R=r[1],P=r[5],L=r[9],A=r[13],I=r[2],O=r[6],x=r[10],N=r[14],B=r[3],D=r[7],V=r[11],z=r[15];return s[0]=o*S+l*R+u*I+c*B,s[4]=o*w+l*P+u*O+c*D,s[8]=o*T+l*L+u*x+c*V,s[12]=o*C+l*A+u*N+c*z,s[1]=f*S+h*R+m*I+y*B,s[5]=f*w+h*P+m*O+y*D,s[9]=f*T+h*L+m*x+y*V,s[13]=f*C+h*A+m*N+y*z,s[2]=p*S+d*R+b*I+v*B,s[6]=p*w+d*P+b*O+v*D,s[10]=p*T+d*L+b*x+v*V,s[14]=p*C+d*A+b*N+v*z,s[3]=g*S+M*R+_*I+E*B,s[7]=g*w+M*P+_*O+E*D,s[11]=g*T+M*L+_*x+E*V,s[15]=g*C+M*A+_*N+E*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],i=e[4],r=e[8],s=e[12],o=e[1],l=e[5],u=e[9],c=e[13],f=e[2],h=e[6],m=e[10],y=e[14],p=e[3],d=e[7],b=e[11],v=e[15];return p*(+s*u*h-r*c*h-s*l*m+i*c*m+r*l*y-i*u*y)+d*(+t*u*y-t*c*m+s*o*m-r*o*y+r*c*f-s*u*f)+b*(+t*c*h-t*l*y-s*o*h+i*o*y+s*l*f-i*c*f)+v*(-r*l*f-t*u*h+t*l*m+r*o*h-i*o*m+i*u*f)}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,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],l=e[5],u=e[6],c=e[7],f=e[8],h=e[9],m=e[10],y=e[11],p=e[12],d=e[13],b=e[14],v=e[15],g=h*b*c-d*m*c+d*u*y-l*b*y-h*u*v+l*m*v,M=p*m*c-f*b*c-p*u*y+o*b*y+f*u*v-o*m*v,_=f*d*c-p*h*c+p*l*y-o*d*y-f*l*v+o*h*v,E=p*h*u-f*d*u-p*l*m+o*d*m+f*l*b-o*h*b,S=t*g+i*M+r*_+s*E;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/S;return e[0]=g*w,e[1]=(d*m*s-h*b*s-d*r*y+i*b*y+h*r*v-i*m*v)*w,e[2]=(l*b*s-d*u*s+d*r*c-i*b*c-l*r*v+i*u*v)*w,e[3]=(h*u*s-l*m*s-h*r*c+i*m*c+l*r*y-i*u*y)*w,e[4]=M*w,e[5]=(f*b*s-p*m*s+p*r*y-t*b*y-f*r*v+t*m*v)*w,e[6]=(p*u*s-o*b*s-p*r*c+t*b*c+o*r*v-t*u*v)*w,e[7]=(o*m*s-f*u*s+f*r*c-t*m*c-o*r*y+t*u*y)*w,e[8]=_*w,e[9]=(p*h*s-f*d*s-p*i*y+t*d*y+f*i*v-t*h*v)*w,e[10]=(o*d*s-p*l*s+p*i*c-t*d*c-o*i*v+t*l*v)*w,e[11]=(f*l*s-o*h*s-f*i*c+t*h*c+o*i*y-t*l*y)*w,e[12]=E*w,e[13]=(f*d*r-p*h*r+p*i*m-t*d*m-f*i*b+t*h*b)*w,e[14]=(p*l*r-o*d*r-p*i*u+t*d*u+o*i*b-t*l*b)*w,e[15]=(o*h*r-f*l*r+f*i*u-t*h*u-o*i*m+t*l*m)*w,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,o=e.x,l=e.y,u=e.z,c=s*o,f=s*l;return this.set(c*o+i,c*l-r*u,c*u+r*l,0,c*l+r*u,f*l+i,f*u-r*o,0,c*u-r*l,f*u+r*o,s*u*u+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,o=t._y,l=t._z,u=t._w,c=s+s,f=o+o,h=l+l,m=s*c,y=s*f,p=s*h,d=o*f,b=o*h,v=l*h,g=u*c,M=u*f,_=u*h,E=i.x,S=i.y,w=i.z;return r[0]=(1-(d+v))*E,r[1]=(y+_)*E,r[2]=(p-M)*E,r[3]=0,r[4]=(y-_)*S,r[5]=(1-(m+v))*S,r[6]=(b+g)*S,r[7]=0,r[8]=(p+M)*w,r[9]=(b-g)*w,r[10]=(1-(m+d))*w,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;let s=Hs.set(r[0],r[1],r[2]).length();const o=Hs.set(r[4],r[5],r[6]).length(),l=Hs.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],kn.copy(this);const c=1/s,f=1/o,h=1/l;return kn.elements[0]*=c,kn.elements[1]*=c,kn.elements[2]*=c,kn.elements[4]*=f,kn.elements[5]*=f,kn.elements[6]*=f,kn.elements[8]*=h,kn.elements[9]*=h,kn.elements[10]*=h,t.setFromRotationMatrix(kn),i.x=s,i.y=o,i.z=l,this}makePerspective(e,t,i,r,s,o){o===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const l=this.elements,u=2*s/(t-e),c=2*s/(i-r),f=(t+e)/(t-e),h=(i+r)/(i-r),m=-(o+s)/(o-s),y=-2*o*s/(o-s);return l[0]=u,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=c,l[9]=h,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=y,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,r,s,o){const l=this.elements,u=1/(t-e),c=1/(i-r),f=1/(o-s),h=(t+e)*u,m=(i+r)*c,y=(o+s)*f;return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-h,l[1]=0,l[5]=2*c,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=-2*f,l[14]=-y,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}De.prototype.isMatrix4=!0;const Hs=new X,kn=new De,HR=new X(0,0,0),WR=new X(1,1,1),ur=new X,Jl=new X,xn=new X,Oy=new De,Ny=new qt;class $r{constructor(e=0,t=0,i=0,r=$r.DefaultOrder){this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,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,i=!0){const r=e.elements,s=r[0],o=r[4],l=r[8],u=r[1],c=r[5],f=r[9],h=r[2],m=r[6],y=r[10];switch(t){case"XYZ":this._y=Math.asin(Jt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-f,y),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(m,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Jt(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(l,y),this._z=Math.atan2(u,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(Jt(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-h,y),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(u,s));break;case"ZYX":this._y=Math.asin(-Jt(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(m,y),this._z=Math.atan2(u,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Jt(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-f,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(l,y));break;case"XZY":this._z=Math.asin(-Jt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(m,c),this._y=Math.atan2(l,s)):(this._x=Math.atan2(-f,y),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return Oy.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Oy,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Ny.setFromEuler(this),this.setFromQuaternion(Ny,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}toVector3(e){return e?e.set(this._x,this._y,this._z):new X(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}$r.prototype.isEuler=!0,$r.DefaultOrder="XYZ",$r.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class th{constructor(){this.mask=1}set(e){this.mask=1<1){for(let t=0;t1){for(let i=0;i0){r.children=[];for(let l=0;l0){r.animations=[];for(let l=0;l0&&(i.geometries=l),u.length>0&&(i.materials=u),c.length>0&&(i.textures=c),f.length>0&&(i.images=f),h.length>0&&(i.shapes=h),m.length>0&&(i.skeletons=m),y.length>0&&(i.animations=y)}return i.object=r,i;function o(l){const u=[];for(const c in l){const f=l[c];delete f.metadata,u.push(f)}return u}}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.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.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){zn.subVectors(r,t),Ii.subVectors(i,t),nh.subVectors(e,t);const o=zn.dot(zn),l=zn.dot(Ii),u=zn.dot(nh),c=Ii.dot(Ii),f=Ii.dot(nh),h=o*c-l*l;if(h===0)return s.set(-2,-1,-1);const m=1/h,y=(c*u-l*f)*m,p=(o*f-l*u)*m;return s.set(1-y-p,p,y)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,Oi),Oi.x>=0&&Oi.y>=0&&Oi.x+Oi.y<=1}static getUV(e,t,i,r,s,o,l,u){return this.getBarycoord(e,t,i,r,Oi),u.set(0,0),u.addScaledVector(s,Oi.x),u.addScaledVector(o,Oi.y),u.addScaledVector(l,Oi.z),u}static isFrontFacing(e,t,i,r){return zn.subVectors(i,t),Ii.subVectors(e,t),zn.cross(Ii).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),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 zn.subVectors(this.c,this.b),Ii.subVectors(this.a,this.b),zn.cross(Ii).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Pt.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Pt.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,r,s){return Pt.getUV(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return Pt.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Pt.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let o,l;js.subVectors(r,i),$s.subVectors(s,i),ih.subVectors(e,i);const u=js.dot(ih),c=$s.dot(ih);if(u<=0&&c<=0)return t.copy(i);rh.subVectors(e,r);const f=js.dot(rh),h=$s.dot(rh);if(f>=0&&h<=f)return t.copy(r);const m=u*h-f*c;if(m<=0&&u>=0&&f<=0)return o=u/(u-f),t.copy(i).addScaledVector(js,o);sh.subVectors(e,s);const y=js.dot(sh),p=$s.dot(sh);if(p>=0&&y<=p)return t.copy(s);const d=y*c-u*p;if(d<=0&&c>=0&&p<=0)return l=c/(c-p),t.copy(i).addScaledVector($s,l);const b=f*p-y*h;if(b<=0&&h-f>=0&&y-p>=0)return zy.subVectors(s,r),l=(h-f)/(h-f+(y-p)),t.copy(r).addScaledVector(zy,l);const v=1/(b+d+m);return o=d*v,l=m*v,t.copy(i).addScaledVector(js,o).addScaledVector($s,l)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let YR=0;class Vt extends sr{constructor(){super(),Object.defineProperty(this,"id",{value:YR++}),this.uuid=bn(),this.name="",this.type="Material",this.fog=!0,this.blending=Ps,this.side=er,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=_d,this.blendDst=Td,this.blendEquation=Nr,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Dl,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Cy,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Wl,this.stencilZFail=Wl,this.stencilZPass=Wl,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}onBuild(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=i===vd;continue}const r=this[t];if(r===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(i.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Ps&&(i.blending=this.blending),this.side!==er&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(i.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.morphTargets===!0&&(i.morphTargets=!0),this.morphNormals===!0&&(i.morphNormals=!0),this.flatShading===!0&&(i.flatShading=this.flatShading),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(i.userData=this.userData);function r(s){const o=[];for(const l in s){const u=s[l];delete u.metadata,o.push(u)}return o}if(t){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.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++}}Vt.prototype.isMaterial=!0;const Uy={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},Un={h:0,s:0,l:0},Kl={h:0,s:0,l:0};function oh(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}function ah(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function lh(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}class Ae{constructor(e,t,i){return t===void 0&&i===void 0?this.set(e):this.setRGB(e,t,i)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}setRGB(e,t,i){return this.r=e,this.g=t,this.b=i,this}setHSL(e,t,i){if(e=Gd(e,1),t=Jt(t,0,1),i=Jt(i,0,1),t===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+t):i+t-i*t,s=2*i-r;this.r=oh(s,r,e+1/3),this.g=oh(s,r,e),this.b=oh(s,r,e-1/3)}return this}setStyle(e){function t(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let r;const s=i[1],o=i[2];switch(s){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[4]),this;if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[4]),this;break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){const l=parseFloat(r[1])/360,u=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100;return t(r[4]),this.setHSL(l,u,c)}break}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=i[1],s=r.length;if(s===3)return this.r=parseInt(r.charAt(0)+r.charAt(0),16)/255,this.g=parseInt(r.charAt(1)+r.charAt(1),16)/255,this.b=parseInt(r.charAt(2)+r.charAt(2),16)/255,this;if(s===6)return this.r=parseInt(r.charAt(0)+r.charAt(1),16)/255,this.g=parseInt(r.charAt(2)+r.charAt(3),16)/255,this.b=parseInt(r.charAt(4)+r.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){const t=Uy[e.toLowerCase()];return t!==void 0?this.setHex(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}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){const i=t>0?1/t:1;return this.r=Math.pow(e.r,i),this.g=Math.pow(e.g,i),this.b=Math.pow(e.b,i),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=ah(e.r),this.g=ah(e.g),this.b=ah(e.b),this}copyLinearToSRGB(e){return this.r=lh(e.r),this.g=lh(e.g),this.b=lh(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return this.r*255<<16^this.g*255<<8^this.b*255<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){const t=this.r,i=this.g,r=this.b,s=Math.max(t,i,r),o=Math.min(t,i,r);let l,u;const c=(o+s)/2;if(o===s)l=0,u=0;else{const f=s-o;switch(u=c<=.5?f/(s+o):f/(2-s-o),s){case t:l=(i-r)/f+(ie&&(e=n[t]);return e}const JR={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Zs(n,e){return new JR[n](e)}let qR=0;const Rn=new De,ch=new $e,Xs=new X,wn=new pn,ca=new pn,jt=new X;class Ve extends sr{constructor(){super(),Object.defineProperty(this,"id",{value:qR++}),this.uuid=bn(),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(Yy(e)>65535?tc:ec)(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,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const s=new kt().getNormalMatrix(e);i.applyNormalMatrix(s),i.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Rn.makeRotationFromQuaternion(e),this.applyMatrix4(Rn),this}rotateX(e){return Rn.makeRotationX(e),this.applyMatrix4(Rn),this}rotateY(e){return Rn.makeRotationY(e),this.applyMatrix4(Rn),this}rotateZ(e){return Rn.makeRotationZ(e),this.applyMatrix4(Rn),this}translate(e,t,i){return Rn.makeTranslation(e,t,i),this.applyMatrix4(Rn),this}scale(e,t,i){return Rn.makeScale(e,t,i),this.applyMatrix4(Rn),this}lookAt(e){return ch.lookAt(e),ch.updateMatrix(),this.applyMatrix4(ch.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Xs).negate(),this.translate(Xs.x,Xs.y,Xs.z),this}setFromPoints(e){const t=[];for(let i=0,r=e.length;i0&&(e.userData=this.userData),this.parameters!==void 0){const u=this.parameters;for(const c in u)u[c]!==void 0&&(e[c]=u[c]);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 i=this.attributes;for(const u in i){const c=i[u];e.data.attributes[u]=c.toJSON(e.data)}const r={};let s=!1;for(const u in this.morphAttributes){const c=this.morphAttributes[u],f=[];for(let h=0,m=c.length;h0&&(r[u]=f,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const l=this.boundingSphere;return l!==null&&(e.data.boundingSphere={center:l.center.toArray(),radius:l.radius}),e}clone(){return new Ve().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 i=e.index;i!==null&&this.setIndex(i.clone(t));const r=e.attributes;for(const c in r){const f=r[c];this.setAttribute(c,f.clone(t))}const s=e.morphAttributes;for(const c in s){const f=[],h=s[c];for(let m=0,y=h.length;m0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){const i=this.geometry,r=this.material,s=this.matrixWorld;if(r===void 0||(i.boundingSphere===null&&i.computeBoundingSphere(),uh.copy(i.boundingSphere),uh.applyMatrix4(s),e.ray.intersectsSphere(uh)===!1)||(Jy.copy(s).invert(),Ys.copy(e.ray).applyMatrix4(Jy),i.boundingBox!==null&&Ys.intersectsBox(i.boundingBox)===!1))return;let o;if(i.isBufferGeometry){const l=i.index,u=i.attributes.position,c=i.morphAttributes.position,f=i.morphTargetsRelative,h=i.attributes.uv,m=i.attributes.uv2,y=i.groups,p=i.drawRange;if(l!==null)if(Array.isArray(r))for(let d=0,b=y.length;dt.far?null:{distance:c,point:lc.clone(),object:n}}function cc(n,e,t,i,r,s,o,l,u,c,f,h){dr.fromBufferAttribute(r,c),hr.fromBufferAttribute(r,f),fr.fromBufferAttribute(r,h);const m=n.morphTargetInfluences;if(e.morphTargets&&s&&m){nc.set(0,0,0),ic.set(0,0,0),rc.set(0,0,0);for(let p=0,d=s.length;p0?1:-1,f.push(D.x,D.y,D.z),h.push(G/w),h.push(1-V/T),N+=1}}for(let V=0;V0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}Di.prototype.isShaderMaterial=!0;class ua extends $e{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new De,this.projectionMatrix=new De,this.projectionMatrixInverse=new De}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}ua.prototype.isCamera=!0;class zt extends ua{constructor(e=50,t=1,i=.1,r=2e3){super(),this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=ra*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Gr*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return ra*2*Math.atan(Math.tan(Gr*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,i,r,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Gr*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,s=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const u=o.fullWidth,c=o.fullHeight;s+=o.offsetX*r/u,t-=o.offsetY*i/c,r*=o.width/u,i*=o.height/c}const l=this.filmOffset;l!==0&&(s+=e*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-i,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}zt.prototype.isPerspectiveCamera=!0;const qs=90,Ks=1;class uc extends $e{constructor(e,t,i){if(super(),this.type="CubeCamera",i.isWebGLCubeRenderTarget!==!0){console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");return}this.renderTarget=i;const r=new zt(qs,Ks,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new X(1,0,0)),this.add(r);const s=new zt(qs,Ks,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new X(-1,0,0)),this.add(s);const o=new zt(qs,Ks,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new X(0,1,0)),this.add(o);const l=new zt(qs,Ks,e,t);l.layers=this.layers,l.up.set(0,0,-1),l.lookAt(new X(0,-1,0)),this.add(l);const u=new zt(qs,Ks,e,t);u.layers=this.layers,u.up.set(0,-1,0),u.lookAt(new X(0,0,1)),this.add(u);const c=new zt(qs,Ks,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new X(0,0,-1)),this.add(c)}update(e,t){this.parent===null&&this.updateMatrixWorld();const i=this.renderTarget,[r,s,o,l,u,c]=this.children,f=e.xr.enabled,h=e.getRenderTarget();e.xr.enabled=!1;const m=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0),e.render(t,r),e.setRenderTarget(i,1),e.render(t,s),e.setRenderTarget(i,2),e.render(t,o),e.setRenderTarget(i,3),e.render(t,l),e.setRenderTarget(i,4),e.render(t,u),i.texture.generateMipmaps=m,e.setRenderTarget(i,5),e.render(t,c),e.setRenderTarget(h),e.xr.enabled=f}}class Qs extends Rt{constructor(e,t,i,r,s,o,l,u,c,f){e=e!==void 0?e:[],t=t!==void 0?t:Jo,l=l!==void 0?l:Ci,super(e,t,i,r,s,o,l,u,c,f),this._needsFlipEnvMap=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}Qs.prototype.isCubeTexture=!0;class dc extends Vn{constructor(e,t,i){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=i),super(e,e,t),t=t||{},this.texture=new Qs(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:wt,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=vn,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; vec3 transformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); } void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include } `,fragmentShader:` uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { vec3 direction = normalize( vWorldDirection ); vec2 sampleUV = equirectUv( direction ); gl_FragColor = texture2D( tEquirect, sampleUV ); } `},r=new Ni(5,5,5),s=new Di({name:"CubemapFromEquirect",uniforms:Js(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:At,blending:_i});s.uniforms.tEquirect.value=t;const o=new It(r,s),l=t.minFilter;return t.minFilter===Ti&&(t.minFilter=wt),new uc(1,10,this).update(e,o),t.minFilter=l,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,r){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,r);e.setRenderTarget(s)}}dc.prototype.isWebGLCubeRenderTarget=!0;const mh=new X,tP=new X,nP=new kt;class ti{constructor(e=new X(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,r){return this.normal.set(e,t,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const r=mh.subVectors(i,t).cross(tP.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,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(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){const i=e.delta(mh),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:t.copy(i).multiplyScalar(s).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||nP.getNormalMatrix(e),r=this.coplanarPoint(mh).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.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)}}ti.prototype.isPlane=!0;const eo=new Li,hc=new X;class da{constructor(e=new ti,t=new ti,i=new ti,r=new ti,s=new ti,o=new ti){this.planes=[e,t,i,r,s,o]}set(e,t,i,r,s,o){const l=this.planes;return l[0].copy(e),l[1].copy(t),l[2].copy(i),l[3].copy(r),l[4].copy(s),l[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e){const t=this.planes,i=e.elements,r=i[0],s=i[1],o=i[2],l=i[3],u=i[4],c=i[5],f=i[6],h=i[7],m=i[8],y=i[9],p=i[10],d=i[11],b=i[12],v=i[13],g=i[14],M=i[15];return t[0].setComponents(l-r,h-u,d-m,M-b).normalize(),t[1].setComponents(l+r,h+u,d+m,M+b).normalize(),t[2].setComponents(l+s,h+c,d+y,M+v).normalize(),t[3].setComponents(l-s,h-c,d-y,M-v).normalize(),t[4].setComponents(l-o,h-f,d-p,M-g).normalize(),t[5].setComponents(l+o,h+f,d+p,M+g).normalize(),this}intersectsObject(e){const t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),eo.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(eo)}intersectsSprite(e){return eo.center.set(0,0,0),eo.radius=.7071067811865476,eo.applyMatrix4(e.matrixWorld),this.intersectsSphere(eo)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)0?e.max.x:e.min.x,hc.y=r.normal.y>0?e.max.y:e.min.y,hc.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(hc)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function Ky(){let n=null,e=!1,t=null,i=null;function r(s,o){t(s,o),i=n.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(r),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function iP(n,e){const t=e.isWebGL2,i=new WeakMap;function r(c,f){const h=c.array,m=c.usage,y=n.createBuffer();n.bindBuffer(f,y),n.bufferData(f,h,m),c.onUploadCallback();let p=5126;return h instanceof Float32Array?p=5126:h instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):h instanceof Uint16Array?c.isFloat16BufferAttribute?t?p=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):p=5123:h instanceof Int16Array?p=5122:h instanceof Uint32Array?p=5125:h instanceof Int32Array?p=5124:h instanceof Int8Array?p=5120:(h instanceof Uint8Array||h instanceof Uint8ClampedArray)&&(p=5121),{buffer:y,type:p,bytesPerElement:h.BYTES_PER_ELEMENT,version:c.version}}function s(c,f,h){const m=f.array,y=f.updateRange;n.bindBuffer(h,c),y.count===-1?n.bufferSubData(h,0,m):(t?n.bufferSubData(h,y.offset*m.BYTES_PER_ELEMENT,m,y.offset,y.count):n.bufferSubData(h,y.offset*m.BYTES_PER_ELEMENT,m.subarray(y.offset,y.offset+y.count)),y.count=-1)}function o(c){return c.isInterleavedBufferAttribute&&(c=c.data),i.get(c)}function l(c){c.isInterleavedBufferAttribute&&(c=c.data);const f=i.get(c);f&&(n.deleteBuffer(f.buffer),i.delete(c))}function u(c,f){if(c.isGLBufferAttribute){const m=i.get(c);(!m||m.version 0.0 ) { distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); } return distanceFalloff; #else if( cutoffDistance > 0.0 && decayExponent > 0.0 ) { return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent ); } return 1.0; #endif } vec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) { return RECIPROCAL_PI * diffuseColor; } vec3 F_Schlick( const in vec3 specularColor, const in float dotVH ) { float fresnel = exp2( ( -5.55473 * dotVH - 6.98316 ) * dotVH ); return ( 1.0 - specularColor ) * fresnel + specularColor; } vec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) { float fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV ); vec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0; return Fr * fresnel + F0; } float G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) { float a2 = pow2( alpha ); float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); return 1.0 / ( gl * gv ); } float G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { float a2 = pow2( alpha ); float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); return 0.5 / max( gv + gl, EPSILON ); } float D_GGX( const in float alpha, const in float dotNH ) { float a2 = pow2( alpha ); float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; return RECIPROCAL_PI * a2 / pow2( denom ); } vec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) { float alpha = pow2( roughness ); vec3 halfDir = normalize( incidentLight.direction + viewDir ); float dotNL = saturate( dot( normal, incidentLight.direction ) ); float dotNV = saturate( dot( normal, viewDir ) ); float dotNH = saturate( dot( normal, halfDir ) ); float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); vec3 F = F_Schlick( specularColor, dotLH ); float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV ); float D = D_GGX( alpha, dotNH ); return F * ( G * D ); } vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { const float LUT_SIZE = 64.0; const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; const float LUT_BIAS = 0.5 / LUT_SIZE; float dotNV = saturate( dot( N, V ) ); vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); uv = uv * LUT_SCALE + LUT_BIAS; return uv; } float LTC_ClippedSphereFormFactor( const in vec3 f ) { float l = length( f ); return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); } vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { float x = dot( v1, v2 ); float y = abs( x ); float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; float b = 3.4175940 + ( 4.1616724 + y ) * y; float v = a / b; float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; return cross( v1, v2 ) * theta_sintheta; } vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; vec3 lightNormal = cross( v1, v2 ); if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); vec3 T1, T2; T1 = normalize( V - N * dot( V, N ) ); T2 = - cross( N, T1 ); mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); vec3 coords[ 4 ]; coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); coords[ 0 ] = normalize( coords[ 0 ] ); coords[ 1 ] = normalize( coords[ 1 ] ); coords[ 2 ] = normalize( coords[ 2 ] ); coords[ 3 ] = normalize( coords[ 3 ] ); vec3 vectorFormFactor = vec3( 0.0 ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); return vec3( result ); } vec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) { float dotNV = saturate( dot( normal, viewDir ) ); vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); return specularColor * brdf.x + brdf.y; } void BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); vec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness ); vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); vec3 FssEss = F * brdf.x + brdf.y; float Ess = brdf.x + brdf.y; float Ems = 1.0 - Ess; vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); singleScatter += FssEss; multiScatter += Fms * Ems; } float G_BlinnPhong_Implicit( ) { return 0.25; } float D_BlinnPhong( const in float shininess, const in float dotNH ) { return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); } vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) { vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir ); float dotNH = saturate( dot( geometry.normal, halfDir ) ); float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); vec3 F = F_Schlick( specularColor, dotLH ); float G = G_BlinnPhong_Implicit( ); float D = D_BlinnPhong( shininess, dotNH ); return F * ( G * D ); } float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) { return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 ); } float BlinnExponentToGGXRoughness( const in float blinnExponent ) { return sqrt( 2.0 / ( blinnExponent + 2.0 ) ); } #if defined( USE_SHEEN ) float D_Charlie(float roughness, float NoH) { float invAlpha = 1.0 / roughness; float cos2h = NoH * NoH; float sin2h = max(1.0 - cos2h, 0.0078125); return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI); } float V_Neubelt(float NoV, float NoL) { return saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV))); } vec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) { vec3 N = geometry.normal; vec3 V = geometry.viewDir; vec3 H = normalize( V + L ); float dotNH = saturate( dot( N, H ) ); return specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) ); } #endif`,hP=`#ifdef USE_BUMPMAP uniform sampler2D bumpMap; uniform float bumpScale; vec2 dHdxy_fwd() { vec2 dSTdx = dFdx( vUv ); vec2 dSTdy = dFdy( vUv ); float Hll = bumpScale * texture2D( bumpMap, vUv ).x; float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll; float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll; return vec2( dBx, dBy ); } vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) ); vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) ); vec3 vN = surf_norm; vec3 R1 = cross( vSigmaY, vN ); vec3 R2 = cross( vN, vSigmaX ); float fDet = dot( vSigmaX, R1 ) * faceDirection; vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); return normalize( abs( fDet ) * surf_norm - vGrad ); } #endif`,fP=`#if NUM_CLIPPING_PLANES > 0 vec4 plane; #pragma unroll_loop_start for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; } #pragma unroll_loop_end #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES bool clipped = true; #pragma unroll_loop_start for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; } #pragma unroll_loop_end if ( clipped ) discard; #endif #endif`,pP=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif`,mP=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; #endif`,gP=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; #endif`,yP=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; #endif`,vP=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; #endif`,bP=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) varying vec3 vColor; #endif`,xP=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) vColor = vec3( 1.0 ); #endif #ifdef USE_COLOR vColor *= color; #endif #ifdef USE_INSTANCING_COLOR vColor.xyz *= instanceColor.xyz; #endif`,wP=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 #define RECIPROCAL_PI2 0.15915494309189535 #define EPSILON 1e-6 #ifndef saturate #define saturate(a) clamp( a, 0.0, 1.0 ) #endif #define whiteComplement(a) ( 1.0 - saturate( a ) ) float pow2( const in float x ) { return x*x; } float pow3( const in float x ) { return x*x*x; } float pow4( const in float x ) { float x2 = x*x; return x2*x2; } float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); } highp float rand( const in vec2 uv ) { const highp float a = 12.9898, b = 78.233, c = 43758.5453; highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); return fract(sin(sn) * c); } #ifdef HIGH_PRECISION float precisionSafeLength( vec3 v ) { return length( v ); } #else float max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); } float precisionSafeLength( vec3 v ) { float maxComponent = max3( abs( v ) ); return length( v / maxComponent ) * maxComponent; } #endif struct IncidentLight { vec3 color; vec3 direction; bool visible; }; struct ReflectedLight { vec3 directDiffuse; vec3 directSpecular; vec3 indirectDiffuse; vec3 indirectSpecular; }; struct GeometricContext { vec3 position; vec3 normal; vec3 viewDir; #ifdef CLEARCOAT vec3 clearcoatNormal; #endif }; vec3 transformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); } vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); } vec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { float distance = dot( planeNormal, point - pointOnPlane ); return - distance * planeNormal + point; } float sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { return sign( dot( point - pointOnPlane, planeNormal ) ); } vec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) { return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine; } mat3 transposeMat3( const in mat3 m ) { mat3 tmp; tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); return tmp; } float linearToRelativeLuminance( const in vec3 color ) { vec3 weights = vec3( 0.2126, 0.7152, 0.0722 ); return dot( weights, color.rgb ); } bool isPerspectiveMatrix( mat4 m ) { return m[ 2 ][ 3 ] == - 1.0; } vec2 equirectUv( in vec3 dir ) { float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; return vec2( u, v ); }`,MP=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_maxMipLevel 8.0 #define cubeUV_minMipLevel 4.0 #define cubeUV_maxTileSize 256.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { vec3 absDirection = abs( direction ); float face = - 1.0; if ( absDirection.x > absDirection.z ) { if ( absDirection.x > absDirection.y ) face = direction.x > 0.0 ? 0.0 : 3.0; else face = direction.y > 0.0 ? 1.0 : 4.0; } else { if ( absDirection.z > absDirection.y ) face = direction.z > 0.0 ? 2.0 : 5.0; else face = direction.y > 0.0 ? 1.0 : 4.0; } return face; } vec2 getUV( vec3 direction, float face ) { vec2 uv; if ( face == 0.0 ) { uv = vec2( direction.z, direction.y ) / abs( direction.x ); } else if ( face == 1.0 ) { uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); } else if ( face == 2.0 ) { uv = vec2( - direction.x, direction.y ) / abs( direction.z ); } else if ( face == 3.0 ) { uv = vec2( - direction.z, direction.y ) / abs( direction.x ); } else if ( face == 4.0 ) { uv = vec2( - direction.x, direction.z ) / abs( direction.y ); } else { uv = vec2( direction.x, direction.y ) / abs( direction.z ); } return 0.5 * ( uv + 1.0 ); } vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { float face = getFace( direction ); float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); mipInt = max( mipInt, cubeUV_minMipLevel ); float faceSize = exp2( mipInt ); float texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize ); vec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ); vec2 f = fract( uv ); uv += 0.5 - f; if ( face > 2.0 ) { uv.y += faceSize; face -= 3.0; } uv.x += face * faceSize; if ( mipInt < cubeUV_maxMipLevel ) { uv.y += 2.0 * cubeUV_maxTileSize; } uv.y += filterInt * 2.0 * cubeUV_minTileSize; uv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize ); uv *= texelSize; vec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; uv.x += texelSize; vec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; uv.y += texelSize; vec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; uv.x -= texelSize; vec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; vec3 tm = mix( tl, tr, f.x ); vec3 bm = mix( bl, br, f.x ); return mix( tm, bm, f.y ); } #define r0 1.0 #define v0 0.339 #define m0 - 2.0 #define r1 0.8 #define v1 0.276 #define m1 - 1.0 #define r4 0.4 #define v4 0.046 #define m4 2.0 #define r5 0.305 #define v5 0.016 #define m5 3.0 #define r6 0.21 #define v6 0.0038 #define m6 4.0 float roughnessToMip( float roughness ) { float mip = 0.0; if ( roughness >= r1 ) { mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0; } else if ( roughness >= r4 ) { mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1; } else if ( roughness >= r5 ) { mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4; } else if ( roughness >= r6 ) { mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5; } else { mip = - 2.0 * log2( 1.16 * roughness ); } return mip; } vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { float mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel ); float mipF = fract( mip ); float mipInt = floor( mip ); vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); if ( mipF == 0.0 ) { return vec4( color0, 1.0 ); } else { vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); return vec4( mix( color0, color1, mipF ), 1.0 ); } } #endif`,SP=`vec3 transformedNormal = objectNormal; #ifdef USE_INSTANCING mat3 m = mat3( instanceMatrix ); transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); transformedNormal = m * transformedNormal; #endif transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedNormal = - transformedNormal; #endif #ifdef USE_TANGENT vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif #endif`,_P=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; #endif`,TP=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); #endif`,EP=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vUv ); emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb; totalEmissiveRadiance *= emissiveColor.rgb; #endif`,CP=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; #endif`,AP="gl_FragColor = linearToOutputTexel( gl_FragColor );",LP=` vec4 LinearToLinear( in vec4 value ) { return value; } vec4 GammaToLinear( in vec4 value, in float gammaFactor ) { return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a ); } vec4 LinearToGamma( in vec4 value, in float gammaFactor ) { return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a ); } vec4 sRGBToLinear( in vec4 value ) { return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); } vec4 LinearTosRGB( in vec4 value ) { return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); } vec4 RGBEToLinear( in vec4 value ) { return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 ); } vec4 LinearToRGBE( in vec4 value ) { float maxComponent = max( max( value.r, value.g ), value.b ); float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 ); return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 ); } vec4 RGBMToLinear( in vec4 value, in float maxRange ) { return vec4( value.rgb * value.a * maxRange, 1.0 ); } vec4 LinearToRGBM( in vec4 value, in float maxRange ) { float maxRGB = max( value.r, max( value.g, value.b ) ); float M = clamp( maxRGB / maxRange, 0.0, 1.0 ); M = ceil( M * 255.0 ) / 255.0; return vec4( value.rgb / ( M * maxRange ), M ); } vec4 RGBDToLinear( in vec4 value, in float maxRange ) { return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 ); } vec4 LinearToRGBD( in vec4 value, in float maxRange ) { float maxRGB = max( value.r, max( value.g, value.b ) ); float D = max( maxRange / maxRGB, 1.0 ); D = clamp( floor( D ) / 255.0, 0.0, 1.0 ); return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D ); } const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 ); vec4 LinearToLogLuv( in vec4 value ) { vec3 Xp_Y_XYZp = cLogLuvM * value.rgb; Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) ); vec4 vResult; vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z; float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0; vResult.w = fract( Le ); vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0; return vResult; } const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 ); vec4 LogLuvToLinear( in vec4 value ) { float Le = value.z * 255.0 + value.w; vec3 Xp_Y_XYZp; Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 ); Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y; Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z; vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb; return vec4( max( vRGB, 0.0 ), 1.0 ); }`,RP=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); } else { cameraToFrag = normalize( vWorldPosition - cameraPosition ); } vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); #ifdef ENVMAP_MODE_REFLECTION vec3 reflectVec = reflect( cameraToFrag, worldNormal ); #else vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); #endif #else vec3 reflectVec = vReflect; #endif #ifdef ENVMAP_TYPE_CUBE vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); #elif defined( ENVMAP_TYPE_CUBE_UV ) vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 ); #else vec4 envColor = vec4( 0.0 ); #endif #ifndef ENVMAP_TYPE_CUBE_UV envColor = envMapTexelToLinear( envColor ); #endif #ifdef ENVMAP_BLENDING_MULTIPLY outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); #elif defined( ENVMAP_BLENDING_MIX ) outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif #endif`,PP=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; uniform int maxMipLevel; #ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #else uniform sampler2D envMap; #endif #endif`,IP=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) #define ENV_WORLDPOS #endif #ifdef ENV_WORLDPOS varying vec3 vWorldPosition; uniform float refractionRatio; #else varying vec3 vReflect; #endif #endif`,OP=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG ) #define ENV_WORLDPOS #endif #ifdef ENV_WORLDPOS varying vec3 vWorldPosition; #else varying vec3 vReflect; uniform float refractionRatio; #endif #endif`,NP=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else vec3 cameraToVertex; if ( isOrthographic ) { cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); } else { cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); } vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); #ifdef ENVMAP_MODE_REFLECTION vReflect = reflect( cameraToVertex, worldNormal ); #else vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif #endif`,DP=`#ifdef USE_FOG fogDepth = - mvPosition.z; #endif`,BP=`#ifdef USE_FOG varying float fogDepth; #endif`,FP=`#ifdef USE_FOG #ifdef FOG_EXP2 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth ); #else float fogFactor = smoothstep( fogNear, fogFar, fogDepth ); #endif gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); #endif`,VP=`#ifdef USE_FOG uniform vec3 fogColor; varying float fogDepth; #ifdef FOG_EXP2 uniform float fogDensity; #else uniform float fogNear; uniform float fogFar; #endif #endif`,kP=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { float dotNL = dot( normal, lightDirection ); vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); #ifdef USE_GRADIENTMAP return texture2D( gradientMap, coord ).rgb; #else return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 ); #endif }`,zP=`#ifdef USE_LIGHTMAP vec4 lightMapTexel= texture2D( lightMap, vUv2 ); reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; #endif`,UP=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; #endif`,GP=`vec3 diffuse = vec3( 1.0 ); GeometricContext geometry; geometry.position = mvPosition.xyz; geometry.normal = normalize( transformedNormal ); geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); GeometricContext backGeometry; backGeometry.position = geometry.position; backGeometry.normal = -geometry.normal; backGeometry.viewDir = geometry.viewDir; vLightFront = vec3( 0.0 ); vIndirectFront = vec3( 0.0 ); #ifdef DOUBLE_SIDED vLightBack = vec3( 0.0 ); vIndirectBack = vec3( 0.0 ); #endif IncidentLight directLight; float dotNL; vec3 directLightColor_Diffuse; vIndirectFront += getAmbientLightIrradiance( ambientLightColor ); vIndirectFront += getLightProbeIrradiance( lightProbe, geometry ); #ifdef DOUBLE_SIDED vIndirectBack += getAmbientLightIrradiance( ambientLightColor ); vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry ); #endif #if NUM_POINT_LIGHTS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); dotNL = dot( geometry.normal, directLight.direction ); directLightColor_Diffuse = PI * directLight.color; vLightFront += saturate( dotNL ) * directLightColor_Diffuse; #ifdef DOUBLE_SIDED vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; #endif } #pragma unroll_loop_end #endif #if NUM_SPOT_LIGHTS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); dotNL = dot( geometry.normal, directLight.direction ); directLightColor_Diffuse = PI * directLight.color; vLightFront += saturate( dotNL ) * directLightColor_Diffuse; #ifdef DOUBLE_SIDED vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; #endif } #pragma unroll_loop_end #endif #if NUM_DIR_LIGHTS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); dotNL = dot( geometry.normal, directLight.direction ); directLightColor_Diffuse = PI * directLight.color; vLightFront += saturate( dotNL ) * directLightColor_Diffuse; #ifdef DOUBLE_SIDED vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; #endif } #pragma unroll_loop_end #endif #if NUM_HEMI_LIGHTS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); #ifdef DOUBLE_SIDED vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); #endif } #pragma unroll_loop_end #endif`,HP=`uniform bool receiveShadow; uniform vec3 ambientLightColor; uniform vec3 lightProbe[ 9 ]; vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { float x = normal.x, y = normal.y, z = normal.z; vec3 result = shCoefficients[ 0 ] * 0.886227; result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); return result; } vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) { vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); return irradiance; } vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { vec3 irradiance = ambientLightColor; #ifndef PHYSICALLY_CORRECT_LIGHTS irradiance *= PI; #endif return irradiance; } #if NUM_DIR_LIGHTS > 0 struct DirectionalLight { vec3 direction; vec3 color; }; uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) { directLight.color = directionalLight.color; directLight.direction = directionalLight.direction; directLight.visible = true; } #endif #if NUM_POINT_LIGHTS > 0 struct PointLight { vec3 position; vec3 color; float distance; float decay; }; uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) { vec3 lVector = pointLight.position - geometry.position; directLight.direction = normalize( lVector ); float lightDistance = length( lVector ); directLight.color = pointLight.color; directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay ); directLight.visible = ( directLight.color != vec3( 0.0 ) ); } #endif #if NUM_SPOT_LIGHTS > 0 struct SpotLight { vec3 position; vec3 direction; vec3 color; float distance; float decay; float coneCos; float penumbraCos; }; uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) { vec3 lVector = spotLight.position - geometry.position; directLight.direction = normalize( lVector ); float lightDistance = length( lVector ); float angleCos = dot( directLight.direction, spotLight.direction ); if ( angleCos > spotLight.coneCos ) { float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos ); directLight.color = spotLight.color; directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay ); directLight.visible = true; } else { directLight.color = vec3( 0.0 ); directLight.visible = false; } } #endif #if NUM_RECT_AREA_LIGHTS > 0 struct RectAreaLight { vec3 color; vec3 position; vec3 halfWidth; vec3 halfHeight; }; uniform sampler2D ltc_1; uniform sampler2D ltc_2; uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; #endif #if NUM_HEMI_LIGHTS > 0 struct HemisphereLight { vec3 direction; vec3 skyColor; vec3 groundColor; }; uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) { float dotNL = dot( geometry.normal, hemiLight.direction ); float hemiDiffuseWeight = 0.5 * dotNL + 0.5; vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); #ifndef PHYSICALLY_CORRECT_LIGHTS irradiance *= PI; #endif return irradiance; } #endif`,WP=`#if defined( USE_ENVMAP ) #ifdef ENVMAP_MODE_REFRACTION uniform float refractionRatio; #endif vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) { vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); #ifdef ENVMAP_TYPE_CUBE vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz ); #ifdef TEXTURE_LOD_EXT vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) ); #else vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) ); #endif envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; #elif defined( ENVMAP_TYPE_CUBE_UV ) vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); #else vec4 envMapColor = vec4( 0.0 ); #endif return PI * envMapColor.rgb * envMapIntensity; } float getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) { float maxMIPLevelScalar = float( maxMIPLevel ); float sigma = PI * roughness * roughness / ( 1.0 + roughness ); float desiredMIPLevel = maxMIPLevelScalar + log2( sigma ); return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar ); } vec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) { #ifdef ENVMAP_MODE_REFLECTION vec3 reflectVec = reflect( -viewDir, normal ); reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); #else vec3 reflectVec = refract( -viewDir, normal, refractionRatio ); #endif reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); float specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel ); #ifdef ENVMAP_TYPE_CUBE vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz ); #ifdef TEXTURE_LOD_EXT vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel ); #else vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel ); #endif envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; #elif defined( ENVMAP_TYPE_CUBE_UV ) vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); #endif return envMapColor.rgb * envMapIntensity; } #endif`,jP=`ToonMaterial material; material.diffuseColor = diffuseColor.rgb;`,$P=`varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif struct ToonMaterial { vec3 diffuseColor; }; void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; #ifndef PHYSICALLY_CORRECT_LIGHTS irradiance *= PI; #endif reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); } void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Toon #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon #define Material_LightProbeLOD( material ) (0)`,ZP=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; material.specularStrength = specularStrength;`,XP=`varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; float specularShininess; float specularStrength; }; void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); vec3 irradiance = dotNL * directLight.color; #ifndef PHYSICALLY_CORRECT_LIGHTS irradiance *= PI; #endif reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; } void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_BlinnPhong #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong #define Material_LightProbeLOD( material ) (0)`,YP=`PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); material.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness; material.specularRoughness = min( material.specularRoughness, 1.0 ); #ifdef REFLECTIVITY material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor ); #else material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor ); #endif #ifdef CLEARCOAT material.clearcoat = clearcoat; material.clearcoatRoughness = clearcoatRoughness; #ifdef USE_CLEARCOATMAP material.clearcoat *= texture2D( clearcoatMap, vUv ).x; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y; #endif material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); material.clearcoatRoughness += geometryRoughness; material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); #endif #ifdef USE_SHEEN material.sheenColor = sheen; #endif`,JP=`struct PhysicalMaterial { vec3 diffuseColor; float specularRoughness; vec3 specularColor; #ifdef CLEARCOAT float clearcoat; float clearcoatRoughness; #endif #ifdef USE_SHEEN vec3 sheenColor; #endif }; #define MAXIMUM_SPECULAR_COEFFICIENT 0.16 #define DEFAULT_SPECULAR_COEFFICIENT 0.04 float clearcoatDHRApprox( const in float roughness, const in float dotNL ) { return DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) ); } #if NUM_RECT_AREA_LIGHTS > 0 void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { vec3 normal = geometry.normal; vec3 viewDir = geometry.viewDir; vec3 position = geometry.position; vec3 lightPos = rectAreaLight.position; vec3 halfWidth = rectAreaLight.halfWidth; vec3 halfHeight = rectAreaLight.halfHeight; vec3 lightColor = rectAreaLight.color; float roughness = material.specularRoughness; vec3 rectCoords[ 4 ]; rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; vec2 uv = LTC_Uv( normal, viewDir, roughness ); vec4 t1 = texture2D( ltc_1, uv ); vec4 t2 = texture2D( ltc_2, uv ); mat3 mInv = mat3( vec3( t1.x, 0, t1.y ), vec3( 0, 1, 0 ), vec3( t1.z, 0, t1.w ) ); vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); } #endif void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); vec3 irradiance = dotNL * directLight.color; #ifndef PHYSICALLY_CORRECT_LIGHTS irradiance *= PI; #endif #ifdef CLEARCOAT float ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); vec3 ccIrradiance = ccDotNL * directLight.color; #ifndef PHYSICALLY_CORRECT_LIGHTS ccIrradiance *= PI; #endif float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); reflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness ); #else float clearcoatDHR = 0.0; #endif #ifdef USE_SHEEN reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen( material.specularRoughness, directLight.direction, geometry, material.sheenColor ); #else reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness); #endif reflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); } void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); } void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { #ifdef CLEARCOAT float ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); reflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness ); float ccDotNL = ccDotNV; float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); #else float clearcoatDHR = 0.0; #endif float clearcoatInv = 1.0 - clearcoatDHR; vec3 singleScattering = vec3( 0.0 ); vec3 multiScattering = vec3( 0.0 ); vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; BRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering ); vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) ); reflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering; reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; } #define RE_Direct RE_Direct_Physical #define RE_Direct_RectArea RE_Direct_RectArea_Physical #define RE_IndirectDiffuse RE_IndirectDiffuse_Physical #define RE_IndirectSpecular RE_IndirectSpecular_Physical float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); }`,qP=` GeometricContext geometry; geometry.position = - vViewPosition; geometry.normal = normal; geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); #ifdef CLEARCOAT geometry.clearcoatNormal = clearcoatNormal; #endif IncidentLight directLight; #if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) PointLight pointLight; #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 PointLightShadow pointLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { pointLight = pointLights[ i ]; getPointDirectLightIrradiance( pointLight, geometry, directLight ); #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) pointLightShadow = pointLightShadows[ i ]; directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; #endif RE_Direct( directLight, geometry, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) SpotLight spotLight; #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 SpotLightShadow spotLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { spotLight = spotLights[ i ]; getSpotDirectLightIrradiance( spotLight, geometry, directLight ); #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) spotLightShadow = spotLightShadows[ i ]; directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; #endif RE_Direct( directLight, geometry, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) DirectionalLight directionalLight; #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 DirectionalLightShadow directionalLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { directionalLight = directionalLights[ i ]; getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight ); #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) directionalLightShadow = directionalLightShadows[ i ]; directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; #endif RE_Direct( directLight, geometry, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) RectAreaLight rectAreaLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { rectAreaLight = rectAreaLights[ i ]; RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); } #pragma unroll_loop_end #endif #if defined( RE_IndirectDiffuse ) vec3 iblIrradiance = vec3( 0.0 ); vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); irradiance += getLightProbeIrradiance( lightProbe, geometry ); #if ( NUM_HEMI_LIGHTS > 0 ) #pragma unroll_loop_start for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); } #pragma unroll_loop_end #endif #endif #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); #endif`,KP=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel= texture2D( lightMap, vUv2 ); vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; #ifndef PHYSICALLY_CORRECT_LIGHTS lightMapIrradiance *= PI; #endif irradiance += lightMapIrradiance; #endif #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) iblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel ); #endif #endif #if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) radiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel ); #ifdef CLEARCOAT clearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel ); #endif #endif`,QP=`#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); #endif`,eI=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; #endif`,tI=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; #endif`,nI=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT varying float vFragDepth; varying float vIsPerspective; #else uniform float logDepthBufFC; #endif #endif`,iI=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); #else if ( isPerspectiveMatrix( projectionMatrix ) ) { gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; gl_Position.z *= gl_Position.w; } #endif #endif`,rI=`#ifdef USE_MAP vec4 texelColor = texture2D( map, vUv ); texelColor = mapTexelToLinear( texelColor ); diffuseColor *= texelColor; #endif`,sI=`#ifdef USE_MAP uniform sampler2D map; #endif`,oI=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; #endif #ifdef USE_MAP vec4 mapTexel = texture2D( map, uv ); diffuseColor *= mapTexelToLinear( mapTexel ); #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; #endif`,aI=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) uniform mat3 uvTransform; #endif #ifdef USE_MAP uniform sampler2D map; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; #endif`,lI=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vUv ); metalnessFactor *= texelMetalness.b; #endif`,cI=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; #endif`,uI=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; #endif`,dI=`#ifdef USE_MORPHTARGETS uniform float morphTargetBaseInfluence; #ifndef USE_MORPHNORMALS uniform float morphTargetInfluences[ 8 ]; #else uniform float morphTargetInfluences[ 4 ]; #endif #endif`,hI=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; transformed += morphTarget0 * morphTargetInfluences[ 0 ]; transformed += morphTarget1 * morphTargetInfluences[ 1 ]; transformed += morphTarget2 * morphTargetInfluences[ 2 ]; transformed += morphTarget3 * morphTargetInfluences[ 3 ]; #ifndef USE_MORPHNORMALS transformed += morphTarget4 * morphTargetInfluences[ 4 ]; transformed += morphTarget5 * morphTargetInfluences[ 5 ]; transformed += morphTarget6 * morphTargetInfluences[ 6 ]; transformed += morphTarget7 * morphTargetInfluences[ 7 ]; #endif #endif`,fI=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); vec3 normal = normalize( cross( fdx, fdy ) ); #else vec3 normal = normalize( vNormal ); #ifdef DOUBLE_SIDED normal = normal * faceDirection; #endif #ifdef USE_TANGENT vec3 tangent = normalize( vTangent ); vec3 bitangent = normalize( vBitangent ); #ifdef DOUBLE_SIDED tangent = tangent * faceDirection; bitangent = bitangent * faceDirection; #endif #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) mat3 vTBN = mat3( tangent, bitangent, normal ); #endif #endif #endif vec3 geometryNormal = normal;`,pI=`#ifdef OBJECTSPACE_NORMALMAP normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; #endif #ifdef DOUBLE_SIDED normal = normal * faceDirection; #endif normal = normalize( normalMatrix * normal ); #elif defined( TANGENTSPACE_NORMALMAP ) vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; mapN.xy *= normalScale; #ifdef USE_TANGENT normal = normalize( vTBN * mapN ); #else normal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection ); #endif #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection ); #endif`,mI=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif #ifdef OBJECTSPACE_NORMALMAP uniform mat3 normalMatrix; #endif #if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) ) vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) ); vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) ); vec2 st0 = dFdx( vUv.st ); vec2 st1 = dFdy( vUv.st ); vec3 N = surf_norm; vec3 q1perp = cross( q1, N ); vec3 q0perp = cross( N, q0 ); vec3 T = q1perp * st0.x + q0perp * st1.x; vec3 B = q1perp * st0.y + q0perp * st1.y; float det = max( dot( T, T ), dot( B, B ) ); float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); } #endif`,gI=`#ifdef CLEARCOAT vec3 clearcoatNormal = geometryNormal; #endif`,yI=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; #ifdef USE_TANGENT clearcoatNormal = normalize( vTBN * clearcoatMapN ); #else clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); #endif #endif`,vI=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP uniform sampler2D clearcoatNormalMap; uniform vec2 clearcoatNormalScale; #endif`,bI=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { return 2.0 * rgb.xyz - 1.0; } const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); const float ShiftRight8 = 1. / 256.; vec4 packDepthToRGBA( const in float v ) { vec4 r = vec4( fract( v * PackFactors ), v ); r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; } float unpackRGBAToDepth( const in vec4 v ) { return dot( v, UnpackFactors ); } vec4 pack2HalfToRGBA( vec2 v ) { vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 )); return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w); } vec2 unpackRGBATo2Half( vec4 v ) { return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); } float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { return ( viewZ + near ) / ( near - far ); } float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { return linearClipZ * ( near - far ) - near; } float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { return (( near + viewZ ) * far ) / (( far - near ) * viewZ ); } float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * invClipZ - far ); }`,xI=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; #endif`,wI=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_INSTANCING mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; gl_Position = projectionMatrix * mvPosition;`,MI=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); #endif`,SI=`#ifdef DITHERING vec3 dithering( vec3 color ) { float grid_position = rand( gl_FragCoord.xy ); vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); return color + dither_shift_RGB; } #endif`,_I=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vUv ); roughnessFactor *= texelRoughness.g; #endif`,TI=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; #endif`,EI=`#ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; struct DirectionalLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; struct SpotLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; #endif #if NUM_POINT_LIGHT_SHADOWS > 0 uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; struct PointLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; float shadowCameraNear; float shadowCameraFar; }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); } vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { return unpackRGBATo2Half( texture2D( shadow, uv ) ); } float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ float occlusion = 1.0; vec2 distribution = texture2DDistribution( shadow, uv ); float hard_shadow = step( compare , distribution.x ); if (hard_shadow != 1.0 ) { float distance = compare - distribution.x ; float variance = max( 0.00000, distribution.y * distribution.y ); float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); } return occlusion; } float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { float shadow = 1.0; shadowCoord.xyz /= shadowCoord.w; shadowCoord.z += shadowBias; bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 ); bool inFrustum = all( inFrustumVec ); bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 ); bool frustumTest = all( frustumTestVec ); if ( frustumTest ) { #if defined( SHADOWMAP_TYPE_PCF ) vec2 texelSize = vec2( 1.0 ) / shadowMapSize; float dx0 = - texelSize.x * shadowRadius; float dy0 = - texelSize.y * shadowRadius; float dx1 = + texelSize.x * shadowRadius; float dy1 = + texelSize.y * shadowRadius; float dx2 = dx0 / 2.0; float dy2 = dy0 / 2.0; float dx3 = dx1 / 2.0; float dy3 = dy1 / 2.0; shadow = ( texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) ) * ( 1.0 / 17.0 ); #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) vec2 texelSize = vec2( 1.0 ) / shadowMapSize; float dx = texelSize.x; float dy = texelSize.y; vec2 uv = shadowCoord.xy; vec2 f = fract( uv * shadowMapSize + 0.5 ); uv -= f * texelSize; shadow = ( texture2DCompare( shadowMap, uv, shadowCoord.z ) + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), f.x ) + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), f.x ) + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), f.y ) + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), f.y ) + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), f.x ), mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), f.x ), f.y ) ) * ( 1.0 / 9.0 ); #elif defined( SHADOWMAP_TYPE_VSM ) shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); #else shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); #endif } return shadow; } vec2 cubeToUV( vec3 v, float texelSizeY ) { vec3 absV = abs( v ); float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); absV *= scaleToCube; v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); vec2 planar = v.xy; float almostATexel = 1.5 * texelSizeY; float almostOne = 1.0 - almostATexel; if ( absV.z >= almostOne ) { if ( v.z > 0.0 ) planar.x = 4.0 - v.x; } else if ( absV.x >= almostOne ) { float signX = sign( v.x ); planar.x = v.z * signX + 2.0 * signX; } else if ( absV.y >= almostOne ) { float signY = sign( v.y ); planar.x = v.x + 2.0 * signY + 2.0; planar.y = v.z * signY - 2.0; } return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); } float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); vec3 lightToPosition = shadowCoord.xyz; float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; vec3 bd3D = normalize( lightToPosition ); #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; return ( texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) ) * ( 1.0 / 9.0 ); #else return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); #endif } #endif`,CI=`#ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; struct DirectionalLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ]; varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; struct SpotLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; #endif #if NUM_POINT_LIGHT_SHADOWS > 0 uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; struct PointLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; float shadowCameraNear; float shadowCameraFar; }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif #endif`,AI=`#ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; #endif #if NUM_DIR_LIGHT_SHADOWS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 ); vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif #if NUM_POINT_LIGHT_SHADOWS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif #endif`,LI=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 DirectionalLightShadow directionalLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { directionalLight = directionalLightShadows[ i ]; shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; } #pragma unroll_loop_end #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 SpotLightShadow spotLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { spotLight = spotLightShadows[ i ]; shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; } #pragma unroll_loop_end #endif #if NUM_POINT_LIGHT_SHADOWS > 0 PointLightShadow pointLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { pointLight = pointLightShadows[ i ]; shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; } #pragma unroll_loop_end #endif #endif return shadow; }`,RI=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); #endif`,PI=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; #ifdef BONE_TEXTURE uniform highp sampler2D boneTexture; uniform int boneTextureSize; mat4 getBoneMatrix( const in float i ) { float j = i * 4.0; float x = mod( j, float( boneTextureSize ) ); float y = floor( j / float( boneTextureSize ) ); float dx = 1.0 / float( boneTextureSize ); float dy = 1.0 / float( boneTextureSize ); y = dy * ( y + 0.5 ); vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); mat4 bone = mat4( v1, v2, v3, v4 ); return bone; } #else uniform mat4 boneMatrices[ MAX_BONES ]; mat4 getBoneMatrix( const in float i ) { mat4 bone = boneMatrices[ int(i) ]; return bone; } #endif #endif`,II=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; skinned += boneMatY * skinVertex * skinWeight.y; skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; #endif`,OI=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; skinMatrix += skinWeight.z * boneMatZ; skinMatrix += skinWeight.w * boneMatW; skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif #endif`,NI=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; #endif`,DI=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; #endif`,BI=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); #endif`,FI=`#ifndef saturate #define saturate(a) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; vec3 LinearToneMapping( vec3 color ) { return toneMappingExposure * color; } vec3 ReinhardToneMapping( vec3 color ) { color *= toneMappingExposure; return saturate( color / ( vec3( 1.0 ) + color ) ); } vec3 OptimizedCineonToneMapping( vec3 color ) { color *= toneMappingExposure; color = max( vec3( 0.0 ), color - 0.004 ); return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); } vec3 RRTAndODTFit( vec3 v ) { vec3 a = v * ( v + 0.0245786 ) - 0.000090537; vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; return a / b; } vec3 ACESFilmicToneMapping( vec3 color ) { const mat3 ACESInputMat = mat3( vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), vec3( 0.04823, 0.01566, 0.83777 ) ); const mat3 ACESOutputMat = mat3( vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), vec3( -0.07367, -0.00605, 1.07602 ) ); color *= toneMappingExposure / 0.6; color = ACESInputMat * color; color = RRTAndODTFit( color ); color = ACESOutputMat * color; return saturate( color ); } vec3 CustomToneMapping( vec3 color ) { return color; }`,VI=`#ifdef USE_TRANSMISSION float transmissionFactor = transmission; float thicknessFactor = thickness; #ifdef USE_TRANSMISSIONMAP transmissionFactor *= texture2D( transmissionMap, vUv ).r; #endif #ifdef USE_THICKNESSNMAP thicknessFactor *= texture2D( thicknessMap, vUv ).g; #endif vec3 pos = vWorldPosition.xyz / vWorldPosition.w; vec3 v = normalize( cameraPosition - pos ); float ior = ( 1.0 + 0.4 * reflectivity ) / ( 1.0 - 0.4 * reflectivity ); vec3 transmission = transmissionFactor * getIBLVolumeRefraction( normal, v, roughnessFactor, material.diffuseColor, totalSpecular, pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor, attenuationColor, attenuationDistance ); totalDiffuse = mix( totalDiffuse, transmission, transmissionFactor ); #endif`,kI=`#ifdef USE_TRANSMISSION #ifdef USE_TRANSMISSIONMAP uniform sampler2D transmissionMap; #endif #ifdef USE_THICKNESSMAP uniform sampler2D thicknessMap; #endif uniform vec2 transmissionSamplerSize; uniform sampler2D transmissionSamplerMap; uniform mat4 modelMatrix; uniform mat4 projectionMatrix; varying vec4 vWorldPosition; vec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix) { vec3 refractionVector = refract(-v, normalize(n), 1.0 / ior); vec3 modelScale; modelScale.x = length(vec3(modelMatrix[0].xyz)); modelScale.y = length(vec3(modelMatrix[1].xyz)); modelScale.z = length(vec3(modelMatrix[2].xyz)); return normalize(refractionVector) * thickness * modelScale; } float applyIorToRoughness(float roughness, float ior) { return roughness * clamp(ior * 2.0 - 2.0, 0.0, 1.0); } vec3 getTransmissionSample(vec2 fragCoord, float roughness, float ior) { float framebufferLod = log2(transmissionSamplerSize.x) * applyIorToRoughness(roughness, ior); return texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod).rgb; } vec3 applyVolumeAttenuation(vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance) { if (attenuationDistance == 0.0) { return radiance; } else { vec3 attenuationCoefficient = -log(attenuationColor) / attenuationDistance; vec3 transmittance = exp(-attenuationCoefficient * transmissionDistance); return transmittance * radiance; } } vec3 getIBLVolumeRefraction(vec3 n, vec3 v, float perceptualRoughness, vec3 baseColor, vec3 specularColor, vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, vec3 attenuationColor, float attenuationDistance) { vec3 transmissionRay = getVolumeTransmissionRay(n, v, thickness, ior, modelMatrix); vec3 refractedRayExit = position + transmissionRay; vec4 ndcPos = projMatrix * viewMatrix * vec4(refractedRayExit, 1.0); vec2 refractionCoords = ndcPos.xy / ndcPos.w; refractionCoords += 1.0; refractionCoords /= 2.0; vec3 transmittedLight = getTransmissionSample(refractionCoords, perceptualRoughness, ior); vec3 attenuatedColor = applyVolumeAttenuation(transmittedLight, length(transmissionRay), attenuationColor, attenuationDistance); return (1.0 - specularColor) * attenuatedColor * baseColor; } #endif`,zI=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) varying vec2 vUv; #endif`,UI=`#ifdef USE_UV #ifdef UVS_VERTEX_ONLY vec2 vUv; #else varying vec2 vUv; #endif uniform mat3 uvTransform; #endif`,GI=`#ifdef USE_UV vUv = ( uvTransform * vec3( uv, 1 ) ).xy; #endif`,HI=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) varying vec2 vUv2; #endif`,WI=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) attribute vec2 uv2; varying vec2 vUv2; uniform mat3 uv2Transform; #endif`,jI=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; #endif`,$I=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) vec4 worldPosition = vec4( transformed, 1.0 ); #ifdef USE_INSTANCING worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; #endif`,ZI=`uniform sampler2D t2D; varying vec2 vUv; void main() { vec4 texColor = texture2D( t2D, vUv ); gl_FragColor = mapTexelToLinear( texColor ); #include #include }`,XI=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); }`,YI=`#include uniform float opacity; varying vec3 vWorldDirection; #include void main() { vec3 vReflect = vWorldDirection; #include gl_FragColor = envColor; gl_FragColor.a *= opacity; #include #include }`,JI=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; }`,qI=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include #include #include #include #include #include #include varying vec2 vHighPrecisionZW; void main() { #include vec4 diffuseColor = vec4( 1.0 ); #if DEPTH_PACKING == 3200 diffuseColor.a = opacity; #endif #include #include #include #include float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; #if DEPTH_PACKING == 3200 gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); #elif DEPTH_PACKING == 3201 gl_FragColor = packDepthToRGBA( fragCoordZ ); #endif }`,KI=`#include #include #include #include #include #include #include varying vec2 vHighPrecisionZW; void main() { #include #include #ifdef USE_DISPLACEMENTMAP #include #include #include #endif #include #include #include #include #include #include #include vHighPrecisionZW = gl_Position.zw; }`,QI=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; varying vec3 vWorldPosition; #include #include #include #include #include #include void main () { #include vec4 diffuseColor = vec4( 1.0 ); #include #include #include float dist = length( vWorldPosition - referencePosition ); dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); }`,eO=`#define DISTANCE varying vec3 vWorldPosition; #include #include #include #include #include #include void main() { #include #include #ifdef USE_DISPLACEMENTMAP #include #include #include #endif #include #include #include #include #include #include #include vWorldPosition = worldPosition.xyz; }`,tO=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { vec3 direction = normalize( vWorldDirection ); vec2 sampleUV = equirectUv( direction ); vec4 texColor = texture2D( tEquirect, sampleUV ); gl_FragColor = mapTexelToLinear( texColor ); #include #include }`,nO=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include }`,iO=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; varying float vLineDistance; #include #include #include #include #include void main() { #include if ( mod( vLineDistance, totalSize ) > dashSize ) { discard; } vec3 outgoingLight = vec3( 0.0 ); vec4 diffuseColor = vec4( diffuse, opacity ); #include #include outgoingLight = diffuseColor.rgb; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include }`,rO=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include #include #include #include #include #include void main() { vLineDistance = scale * lineDistance; #include #include #include #include #include #include #include }`,sO=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include #include #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); #ifdef USE_LIGHTMAP vec4 lightMapTexel= texture2D( lightMap, vUv2 ); reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; #else reflectedLight.indirectDiffuse += vec3( 1.0 ); #endif #include reflectedLight.indirectDiffuse *= diffuseColor.rgb; vec3 outgoingLight = reflectedLight.indirectDiffuse; #include gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include #include }`,oO=`#include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #ifdef USE_ENVMAP #include #include #include #include #endif #include #include #include #include #include #include #include #include #include }`,aO=`uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; varying vec3 vLightFront; varying vec3 vIndirectFront; #ifdef DOUBLE_SIDED varying vec3 vLightBack; varying vec3 vIndirectBack; #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include vec4 diffuseColor = vec4( diffuse, opacity ); ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #ifdef DOUBLE_SIDED reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack; #else reflectedLight.indirectDiffuse += vIndirectFront; #endif #include reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ); #ifdef DOUBLE_SIDED reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack; #else reflectedLight.directDiffuse = vLightFront; #endif reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask(); #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; #include gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include #include }`,lO=`#define LAMBERT varying vec3 vLightFront; varying vec3 vIndirectFront; #ifdef DOUBLE_SIDED varying vec3 vLightBack; varying vec3 vIndirectBack; #endif #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include }`,cO=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include #include #include #include #include #include #include #include #include #include #include void main() { #include vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include #include #include #include vec3 viewDir = normalize( vViewPosition ); vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); vec3 y = cross( viewDir, x ); vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; #ifdef USE_MATCAP vec4 matcapColor = texture2D( matcap, uv ); matcapColor = matcapTexelToLinear( matcapColor ); #else vec4 matcapColor = vec4( 1.0 ); #endif vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include #include }`,uO=`#define MATCAP varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #endif #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; }`,dO=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include vec4 diffuseColor = vec4( diffuse, opacity ); ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include #include }`,hO=`#define TOON varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #endif #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include }`,fO=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; uniform float shininess; uniform float opacity; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include vec4 diffuseColor = vec4( diffuse, opacity ); ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; #include gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include #include }`,pO=`#define PHONG varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #endif #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include #include }`,mO=`#define STANDARD #ifdef PHYSICAL #define REFLECTIVITY #define CLEARCOAT #endif uniform vec3 diffuse; uniform vec3 emissive; uniform float roughness; uniform float metalness; uniform float opacity; #ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform vec3 attenuationColor; uniform float attenuationDistance; #endif #ifdef REFLECTIVITY uniform float reflectivity; #endif #ifdef CLEARCOAT uniform float clearcoat; uniform float clearcoatRoughness; #endif #ifdef USE_SHEEN uniform vec3 sheen; #endif varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include vec4 diffuseColor = vec4( diffuse, opacity ); ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; #include vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include #include }`,gO=`#define STANDARD varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif #ifdef USE_TRANSMISSION varying vec4 vWorldPosition; #endif #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif #endif #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include #ifdef USE_TRANSMISSION vWorldPosition = worldPosition; #endif }`,yO=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) varying vec3 vViewPosition; #endif #ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif #include #include #include #include #include #include void main() { #include #include #include #include gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); }`,vO=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) varying vec3 vViewPosition; #endif #ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif #endif #include #include #include #include #include #include #include #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) vViewPosition = - mvPosition.xyz; #endif }`,bO=`uniform vec3 diffuse; uniform float opacity; #include #include #include #include #include #include void main() { #include vec3 outgoingLight = vec3( 0.0 ); vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include outgoingLight = diffuseColor.rgb; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include }`,xO=`uniform float size; uniform float scale; #include #include #include #include #include #include void main() { #include #include #include #include gl_PointSize = size; #ifdef USE_SIZEATTENUATION bool isPerspective = isPerspectiveMatrix( projectionMatrix ); if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); #endif #include #include #include #include }`,wO=`uniform vec3 color; uniform float opacity; #include #include #include #include #include #include #include void main() { gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); #include #include #include }`,MO=`#include #include #include void main() { #include #include #include #include #include #include #include #include #include #include }`,SO=`uniform vec3 diffuse; uniform float opacity; #include #include #include #include #include #include #include void main() { #include vec3 outgoingLight = vec3( 0.0 ); vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include outgoingLight = diffuseColor.rgb; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include }`,_O=`uniform float rotation; uniform vec2 center; #include #include #include #include #include void main() { #include vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); vec2 scale; scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); #ifndef USE_SIZEATTENUATION bool isPerspective = isPerspectiveMatrix( projectionMatrix ); if ( isPerspective ) scale *= - mvPosition.z; #endif vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; vec2 rotatedPosition; rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; mvPosition.xy += rotatedPosition; gl_Position = projectionMatrix * mvPosition; #include #include #include }`;const Ye={alphamap_fragment:rP,alphamap_pars_fragment:sP,alphatest_fragment:oP,aomap_fragment:aP,aomap_pars_fragment:lP,begin_vertex:cP,beginnormal_vertex:uP,bsdfs:dP,bumpmap_pars_fragment:hP,clipping_planes_fragment:fP,clipping_planes_pars_fragment:pP,clipping_planes_pars_vertex:mP,clipping_planes_vertex:gP,color_fragment:yP,color_pars_fragment:vP,color_pars_vertex:bP,color_vertex:xP,common:wP,cube_uv_reflection_fragment:MP,defaultnormal_vertex:SP,displacementmap_pars_vertex:_P,displacementmap_vertex:TP,emissivemap_fragment:EP,emissivemap_pars_fragment:CP,encodings_fragment:AP,encodings_pars_fragment:LP,envmap_fragment:RP,envmap_common_pars_fragment:PP,envmap_pars_fragment:IP,envmap_pars_vertex:OP,envmap_physical_pars_fragment:WP,envmap_vertex:NP,fog_vertex:DP,fog_pars_vertex:BP,fog_fragment:FP,fog_pars_fragment:VP,gradientmap_pars_fragment:kP,lightmap_fragment:zP,lightmap_pars_fragment:UP,lights_lambert_vertex:GP,lights_pars_begin:HP,lights_toon_fragment:jP,lights_toon_pars_fragment:$P,lights_phong_fragment:ZP,lights_phong_pars_fragment:XP,lights_physical_fragment:YP,lights_physical_pars_fragment:JP,lights_fragment_begin:qP,lights_fragment_maps:KP,lights_fragment_end:QP,logdepthbuf_fragment:eI,logdepthbuf_pars_fragment:tI,logdepthbuf_pars_vertex:nI,logdepthbuf_vertex:iI,map_fragment:rI,map_pars_fragment:sI,map_particle_fragment:oI,map_particle_pars_fragment:aI,metalnessmap_fragment:lI,metalnessmap_pars_fragment:cI,morphnormal_vertex:uI,morphtarget_pars_vertex:dI,morphtarget_vertex:hI,normal_fragment_begin:fI,normal_fragment_maps:pI,normalmap_pars_fragment:mI,clearcoat_normal_fragment_begin:gI,clearcoat_normal_fragment_maps:yI,clearcoat_pars_fragment:vI,packing:bI,premultiplied_alpha_fragment:xI,project_vertex:wI,dithering_fragment:MI,dithering_pars_fragment:SI,roughnessmap_fragment:_I,roughnessmap_pars_fragment:TI,shadowmap_pars_fragment:EI,shadowmap_pars_vertex:CI,shadowmap_vertex:AI,shadowmask_pars_fragment:LI,skinbase_vertex:RI,skinning_pars_vertex:PI,skinning_vertex:II,skinnormal_vertex:OI,specularmap_fragment:NI,specularmap_pars_fragment:DI,tonemapping_fragment:BI,tonemapping_pars_fragment:FI,transmission_fragment:VI,transmission_pars_fragment:kI,uv_pars_fragment:zI,uv_pars_vertex:UI,uv_vertex:GI,uv2_pars_fragment:HI,uv2_pars_vertex:WI,uv2_vertex:jI,worldpos_vertex:$I,background_frag:ZI,background_vert:XI,cube_frag:YI,cube_vert:JI,depth_frag:qI,depth_vert:KI,distanceRGBA_frag:QI,distanceRGBA_vert:eO,equirect_frag:tO,equirect_vert:nO,linedashed_frag:iO,linedashed_vert:rO,meshbasic_frag:sO,meshbasic_vert:oO,meshlambert_frag:aO,meshlambert_vert:lO,meshmatcap_frag:cO,meshmatcap_vert:uO,meshtoon_frag:dO,meshtoon_vert:hO,meshphong_frag:fO,meshphong_vert:pO,meshphysical_frag:mO,meshphysical_vert:gO,normal_frag:yO,normal_vert:vO,points_frag:bO,points_vert:xO,shadow_frag:wO,shadow_vert:MO,sprite_frag:SO,sprite_vert:_O},Le={common:{diffuse:{value:new Ae(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new kt},uv2Transform:{value:new kt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Se(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ae(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ae(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new kt}},sprite:{diffuse:{value:new Ae(16777215)},opacity:{value:1},center:{value:new Se(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new kt}}},Gn={basic:{uniforms:tn([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.fog]),vertexShader:Ye.meshbasic_vert,fragmentShader:Ye.meshbasic_frag},lambert:{uniforms:tn([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.fog,Le.lights,{emissive:{value:new Ae(0)}}]),vertexShader:Ye.meshlambert_vert,fragmentShader:Ye.meshlambert_frag},phong:{uniforms:tn([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,Le.lights,{emissive:{value:new Ae(0)},specular:{value:new Ae(1118481)},shininess:{value:30}}]),vertexShader:Ye.meshphong_vert,fragmentShader:Ye.meshphong_frag},standard:{uniforms:tn([Le.common,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.roughnessmap,Le.metalnessmap,Le.fog,Le.lights,{emissive:{value:new Ae(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Ye.meshphysical_vert,fragmentShader:Ye.meshphysical_frag},toon:{uniforms:tn([Le.common,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.gradientmap,Le.fog,Le.lights,{emissive:{value:new Ae(0)}}]),vertexShader:Ye.meshtoon_vert,fragmentShader:Ye.meshtoon_frag},matcap:{uniforms:tn([Le.common,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,{matcap:{value:null}}]),vertexShader:Ye.meshmatcap_vert,fragmentShader:Ye.meshmatcap_frag},points:{uniforms:tn([Le.points,Le.fog]),vertexShader:Ye.points_vert,fragmentShader:Ye.points_frag},dashed:{uniforms:tn([Le.common,Le.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ye.linedashed_vert,fragmentShader:Ye.linedashed_frag},depth:{uniforms:tn([Le.common,Le.displacementmap]),vertexShader:Ye.depth_vert,fragmentShader:Ye.depth_frag},normal:{uniforms:tn([Le.common,Le.bumpmap,Le.normalmap,Le.displacementmap,{opacity:{value:1}}]),vertexShader:Ye.normal_vert,fragmentShader:Ye.normal_frag},sprite:{uniforms:tn([Le.sprite,Le.fog]),vertexShader:Ye.sprite_vert,fragmentShader:Ye.sprite_frag},background:{uniforms:{uvTransform:{value:new kt},t2D:{value:null}},vertexShader:Ye.background_vert,fragmentShader:Ye.background_frag},cube:{uniforms:tn([Le.envmap,{opacity:{value:1}}]),vertexShader:Ye.cube_vert,fragmentShader:Ye.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ye.equirect_vert,fragmentShader:Ye.equirect_frag},distanceRGBA:{uniforms:tn([Le.common,Le.displacementmap,{referencePosition:{value:new X},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ye.distanceRGBA_vert,fragmentShader:Ye.distanceRGBA_frag},shadow:{uniforms:tn([Le.lights,Le.fog,{color:{value:new Ae(0)},opacity:{value:1}}]),vertexShader:Ye.shadow_vert,fragmentShader:Ye.shadow_frag}};Gn.physical={uniforms:tn([Gn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Se(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new Ae(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Se},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Ae(0)}}]),vertexShader:Ye.meshphysical_vert,fragmentShader:Ye.meshphysical_frag};function TO(n,e,t,i,r){const s=new Ae(0);let o=0,l,u,c=null,f=0,h=null;function m(p,d){let b=!1,v=d.isScene===!0?d.background:null;v&&v.isTexture&&(v=e.get(v));const g=n.xr,M=g.getSession&&g.getSession();M&&M.environmentBlendMode==="additive"&&(v=null),v===null?y(s,o):v&&v.isColor&&(y(v,1),b=!0),(n.autoClear||b)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),v&&(v.isCubeTexture||v.mapping===Is)?(u===void 0&&(u=new It(new Ni(1,1,1),new Di({name:"BackgroundCubeMaterial",uniforms:Js(Gn.cube.uniforms),vertexShader:Gn.cube.vertexShader,fragmentShader:Gn.cube.fragmentShader,side:At,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(_,E,S){this.matrixWorld.copyPosition(S.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),u.material.uniforms.envMap.value=v,u.material.uniforms.flipEnvMap.value=v.isCubeTexture&&v._needsFlipEnvMap?-1:1,(c!==v||f!==v.version||h!==n.toneMapping)&&(u.material.needsUpdate=!0,c=v,f=v.version,h=n.toneMapping),p.unshift(u,u.geometry,u.material,0,0,null)):v&&v.isTexture&&(l===void 0&&(l=new It(new Zr(2,2),new Di({name:"BackgroundMaterial",uniforms:Js(Gn.background.uniforms),vertexShader:Gn.background.vertexShader,fragmentShader:Gn.background.fragmentShader,side:er,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=v,v.matrixAutoUpdate===!0&&v.updateMatrix(),l.material.uniforms.uvTransform.value.copy(v.matrix),(c!==v||f!==v.version||h!==n.toneMapping)&&(l.material.needsUpdate=!0,c=v,f=v.version,h=n.toneMapping),p.unshift(l,l.geometry,l.material,0,0,null))}function y(p,d){t.buffers.color.setClear(p.r,p.g,p.b,d,r)}return{getClearColor:function(){return s},setClearColor:function(p,d=1){s.set(p),o=d,y(s,o)},getClearAlpha:function(){return o},setClearAlpha:function(p){o=p,y(s,o)},render:m}}function EO(n,e,t,i){const r=n.getParameter(34921),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||s!==null,l={},u=d(null);let c=u;function f(A,I,O,x,N){let B=!1;if(o){const D=p(x,O,I);c!==D&&(c=D,m(c.object)),B=b(x,N),B&&v(x,N)}else{const D=I.wireframe===!0;(c.geometry!==x.id||c.program!==O.id||c.wireframe!==D)&&(c.geometry=x.id,c.program=O.id,c.wireframe=D,B=!0)}A.isInstancedMesh===!0&&(B=!0),N!==null&&t.update(N,34963),B&&(w(A,I,O,x),N!==null&&n.bindBuffer(34963,t.get(N).buffer))}function h(){return i.isWebGL2?n.createVertexArray():s.createVertexArrayOES()}function m(A){return i.isWebGL2?n.bindVertexArray(A):s.bindVertexArrayOES(A)}function y(A){return i.isWebGL2?n.deleteVertexArray(A):s.deleteVertexArrayOES(A)}function p(A,I,O){const x=O.wireframe===!0;let N=l[A.id];N===void 0&&(N={},l[A.id]=N);let B=N[I.id];B===void 0&&(B={},N[I.id]=B);let D=B[x];return D===void 0&&(D=d(h()),B[x]=D),D}function d(A){const I=[],O=[],x=[];for(let N=0;N=0){const G=N[V];if(G!==void 0){const K=G.normalized,ie=G.itemSize,j=t.get(G);if(j===void 0)continue;const H=j.buffer,W=j.type,q=j.bytesPerElement;if(G.isInterleavedBufferAttribute){const Q=G.data,ee=Q.stride,ne=G.offset;Q&&Q.isInstancedInterleavedBuffer?(_(z,Q.meshPerAttribute),x._maxInstanceCount===void 0&&(x._maxInstanceCount=Q.meshPerAttribute*Q.count)):M(z),n.bindBuffer(34962,H),S(z,ie,W,K,ee*q,ne*q)}else G.isInstancedBufferAttribute?(_(z,G.meshPerAttribute),x._maxInstanceCount===void 0&&(x._maxInstanceCount=G.meshPerAttribute*G.count)):M(z),n.bindBuffer(34962,H),S(z,ie,W,K,0,0)}else if(V==="instanceMatrix"){const K=t.get(A.instanceMatrix);if(K===void 0)continue;const ie=K.buffer,j=K.type;_(z+0,1),_(z+1,1),_(z+2,1),_(z+3,1),n.bindBuffer(34962,ie),n.vertexAttribPointer(z+0,4,j,!1,64,0),n.vertexAttribPointer(z+1,4,j,!1,64,16),n.vertexAttribPointer(z+2,4,j,!1,64,32),n.vertexAttribPointer(z+3,4,j,!1,64,48)}else if(V==="instanceColor"){const K=t.get(A.instanceColor);if(K===void 0)continue;const ie=K.buffer,j=K.type;_(z,1),n.bindBuffer(34962,ie),n.vertexAttribPointer(z,3,j,!1,12,0)}else if(D!==void 0){const K=D[V];if(K!==void 0)switch(K.length){case 2:n.vertexAttrib2fv(z,K);break;case 3:n.vertexAttrib3fv(z,K);break;case 4:n.vertexAttrib4fv(z,K);break;default:n.vertexAttrib1fv(z,K)}}}}E()}function T(){P();for(const A in l){const I=l[A];for(const O in I){const x=I[O];for(const N in x)y(x[N].object),delete x[N];delete I[O]}delete l[A]}}function C(A){if(l[A.id]===void 0)return;const I=l[A.id];for(const O in I){const x=I[O];for(const N in x)y(x[N].object),delete x[N];delete I[O]}delete l[A.id]}function R(A){for(const I in l){const O=l[I];if(O[A.id]===void 0)continue;const x=O[A.id];for(const N in x)y(x[N].object),delete x[N];delete O[A.id]}}function P(){L(),c!==u&&(c=u,m(c.object))}function L(){u.geometry=null,u.program=null,u.wireframe=!1}return{setup:f,reset:P,resetDefaultState:L,dispose:T,releaseStatesOfGeometry:C,releaseStatesOfProgram:R,initAttributes:g,enableAttribute:M,disableUnusedAttributes:E}}function CO(n,e,t,i){const r=i.isWebGL2;let s;function o(c){s=c}function l(c,f){n.drawArrays(s,c,f),t.update(f,s,1)}function u(c,f,h){if(h===0)return;let m,y;if(r)m=n,y="drawArraysInstanced";else if(m=e.get("ANGLE_instanced_arrays"),y="drawArraysInstancedANGLE",m===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}m[y](s,c,f,h),t.update(f,s,h)}this.setMode=o,this.render=l,this.renderInstances=u}function AO(n,e,t){let i;function r(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const w=e.get("EXT_texture_filter_anisotropic");i=n.getParameter(w.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function s(w){if(w==="highp"){if(n.getShaderPrecisionFormat(35633,36338).precision>0&&n.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";w="mediump"}return w==="mediump"&&n.getShaderPrecisionFormat(35633,36337).precision>0&&n.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&n instanceof WebGL2ComputeRenderingContext;let l=t.precision!==void 0?t.precision:"highp";const u=s(l);u!==l&&(console.warn("THREE.WebGLRenderer:",l,"not supported, using",u,"instead."),l=u);const c=o||e.has("WEBGL_draw_buffers"),f=t.logarithmicDepthBuffer===!0,h=n.getParameter(34930),m=n.getParameter(35660),y=n.getParameter(3379),p=n.getParameter(34076),d=n.getParameter(34921),b=n.getParameter(36347),v=n.getParameter(36348),g=n.getParameter(36349),M=m>0,_=o||e.has("OES_texture_float"),E=M&&_,S=o?n.getParameter(36183):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:r,getMaxPrecision:s,precision:l,logarithmicDepthBuffer:f,maxTextures:h,maxVertexTextures:m,maxTextureSize:y,maxCubemapSize:p,maxAttributes:d,maxVertexUniforms:b,maxVaryings:v,maxFragmentUniforms:g,vertexTextures:M,floatFragmentTextures:_,floatVertexTextures:E,maxSamples:S}}function LO(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new ti,l=new kt,u={value:null,needsUpdate:!1};this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(h,m,y){const p=h.length!==0||m||i!==0||r;return r=m,t=f(h,y,0),i=h.length,p},this.beginShadows=function(){s=!0,f(null)},this.endShadows=function(){s=!1,c()},this.setState=function(h,m,y){const p=h.clippingPlanes,d=h.clipIntersection,b=h.clipShadows,v=n.get(h);if(!r||p===null||p.length===0||s&&!b)s?f(null):c();else{const g=s?0:i,M=g*4;let _=v.clippingState||null;u.value=_,_=f(p,m,M,y);for(let E=0;E!==M;++E)_[E]=t[E];v.clippingState=_,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=g}};function c(){u.value!==t&&(u.value=t,u.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function f(h,m,y,p){const d=h!==null?h.length:0;let b=null;if(d!==0){if(b=u.value,p!==!0||b===null){const v=y+d*4,g=m.matrixWorldInverse;l.getNormalMatrix(g),(b===null||b.length0){const c=n.getRenderTarget(),f=new dc(u.height/2);return f.fromEquirectangularTexture(n,o),e.set(o,f),n.setRenderTarget(c),o.addEventListener("dispose",r),t(f.texture,o.mapping)}else return null}}return o}function r(o){const l=o.target;l.removeEventListener("dispose",r);const u=e.get(l);u!==void 0&&(e.delete(l),u.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}function PO(n){const e={};function t(i){if(e[i]!==void 0)return e[i];let r;switch(i){case"WEBGL_depth_texture":r=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=n.getExtension(i)}return e[i]=r,r}return{has:function(i){return t(i)!==null},init:function(i){i.isWebGL2?t("EXT_color_buffer_float"):(t("WEBGL_depth_texture"),t("OES_texture_float"),t("OES_texture_half_float"),t("OES_texture_half_float_linear"),t("OES_standard_derivatives"),t("OES_element_index_uint"),t("OES_vertex_array_object"),t("ANGLE_instanced_arrays")),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float")},get:function(i){const r=t(i);return r===null&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),r}}}function IO(n,e,t,i){const r={},s=new WeakMap;function o(h){const m=h.target;m.index!==null&&e.remove(m.index);for(const p in m.attributes)e.remove(m.attributes[p]);m.removeEventListener("dispose",o),delete r[m.id];const y=s.get(m);y&&(e.remove(y),s.delete(m)),i.releaseStatesOfGeometry(m),m.isInstancedBufferGeometry===!0&&delete m._maxInstanceCount,t.memory.geometries--}function l(h,m){return r[m.id]===!0||(m.addEventListener("dispose",o),r[m.id]=!0,t.memory.geometries++),m}function u(h){const m=h.attributes;for(const p in m)e.update(m[p],34962);const y=h.morphAttributes;for(const p in y){const d=y[p];for(let b=0,v=d.length;b65535?tc:ec)(m,1);b.version=d;const v=s.get(h);v&&e.remove(v),s.set(h,b)}function f(h){const m=s.get(h);if(m){const y=h.index;y!==null&&m.version0)return n;const r=e*t;let s=tv[r];if(s===void 0&&(s=new Float32Array(r),tv[r]=s),e!==0){i.toArray(s,0);for(let o=1,l=0;o!==e;++o)l+=t,n[o].toArray(s,l)}return s}function cn(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t0)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(fa).join(` `)}function I3(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` `)}function O3(n,e){const t={},i=n.getProgramParameter(e,35721);for(let r=0;r/gm;function bh(n){return n.replace(N3,D3)}function D3(n,e){const t=Ye[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return bh(t)}const B3=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,F3=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function mv(n){return n.replace(F3,gv).replace(B3,V3)}function V3(n,e,t,i){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),gv(n,e,t,i)}function gv(n,e,t,i){let r="";for(let s=parseInt(e);s0?n.gammaFactor:1,y=t.isWebGL2?"":P3(t),p=I3(s),d=r.createProgram();let b,v,g=t.glslVersion?"#version "+t.glslVersion+` `:"";t.isRawShaderMaterial?(b=[p].filter(fa).join(` `),b.length>0&&(b+=` `),v=[y,p].filter(fa).join(` `),v.length>0&&(v+=` `)):(b=[yv(t),"#define SHADER_NAME "+t.shaderName,p,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+m,"#define MAX_BONES "+t.maxBones,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+f:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.useVertexTexture?"#define BONE_TEXTURE":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+u:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` `].filter(fa).join(` `),v=[y,yv(t),"#define SHADER_NAME "+t.shaderName,p,t.alphaTest?"#define ALPHATEST "+t.alphaTest+(t.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+m,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+f:"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.sheen?"#define USE_SHEEN":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+u:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==nr?"#define TONE_MAPPING":"",t.toneMapping!==nr?Ye.tonemapping_pars_fragment:"",t.toneMapping!==nr?R3("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",Ye.encodings_pars_fragment,t.map?ha("mapTexelToLinear",t.mapEncoding):"",t.matcap?ha("matcapTexelToLinear",t.matcapEncoding):"",t.envMap?ha("envMapTexelToLinear",t.envMapEncoding):"",t.emissiveMap?ha("emissiveMapTexelToLinear",t.emissiveMapEncoding):"",t.lightMap?ha("lightMapTexelToLinear",t.lightMapEncoding):"",L3("linearToOutputTexel",t.outputEncoding),t.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` `].filter(fa).join(` `)),o=bh(o),o=fv(o,t),o=pv(o,t),l=bh(l),l=fv(l,t),l=pv(l,t),o=mv(o),l=mv(l),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(g=`#version 300 es `,b=["#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` `+b,v=["#define varying in",t.glslVersion===Ud?"":"out highp vec4 pc_fragColor;",t.glslVersion===Ud?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` `)+` `+v);const M=g+b+o,_=g+v+l,E=uv(r,35633,M),S=uv(r,35632,_);if(r.attachShader(d,E),r.attachShader(d,S),t.index0AttributeName!==void 0?r.bindAttribLocation(d,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(d,0,"position"),r.linkProgram(d),n.debug.checkShaderErrors){const C=r.getProgramInfoLog(d).trim(),R=r.getShaderInfoLog(E).trim(),P=r.getShaderInfoLog(S).trim();let L=!0,A=!0;if(r.getProgramParameter(d,35714)===!1){L=!1;const I=hv(r,E,"vertex"),O=hv(r,S,"fragment");console.error("THREE.WebGLProgram: shader error: ",r.getError(),"35715",r.getProgramParameter(d,35715),"gl.getProgramInfoLog",C,I,O)}else C!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",C):(R===""||P==="")&&(A=!1);A&&(this.diagnostics={runnable:L,programLog:C,vertexShader:{log:R,prefix:b},fragmentShader:{log:P,prefix:v}})}r.deleteShader(E),r.deleteShader(S);let w;this.getUniforms=function(){return w===void 0&&(w=new pr(r,d)),w};let T;return this.getAttributes=function(){return T===void 0&&(T=O3(r,d)),T},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(d),this.program=void 0},this.name=t.shaderName,this.id=C3++,this.cacheKey=e,this.usedTimes=1,this.program=d,this.vertexShader=E,this.fragmentShader=S,this}function W3(n,e,t,i,r,s){const o=[],l=i.isWebGL2,u=i.logarithmicDepthBuffer,c=i.floatVertexTextures,f=i.maxVertexUniforms,h=i.vertexTextures;let m=i.precision;const y={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},p=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","transmission","transmissionMap","thicknessMap"];function d(S){const T=S.skeleton.bones;if(c)return 1024;{const R=Math.floor((f-20)/4),P=Math.min(R,T.length);return P0,maxBones:O,useVertexTexture:c,morphTargets:S.morphTargets,morphNormals:S.morphNormals,numDirLights:w.directional.length,numPointLights:w.point.length,numSpotLights:w.spot.length,numRectAreaLights:w.rectArea.length,numHemiLights:w.hemi.length,numDirLightShadows:w.directionalShadowMap.length,numPointLightShadows:w.pointShadowMap.length,numSpotLightShadows:w.spotShadowMap.length,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:S.dithering,shadowMapEnabled:n.shadowMap.enabled&&T.length>0,shadowMapType:n.shadowMap.type,toneMapping:S.toneMapped?n.toneMapping:nr,physicallyCorrectLights:n.physicallyCorrectLights,premultipliedAlpha:S.premultipliedAlpha,alphaTest:S.alphaTest,doubleSided:S.side===tr,flipSided:S.side===At,depthPacking:S.depthPacking!==void 0?S.depthPacking:!1,index0AttributeName:S.index0AttributeName,extensionDerivatives:S.extensions&&S.extensions.derivatives,extensionFragDepth:S.extensions&&S.extensions.fragDepth,extensionDrawBuffers:S.extensions&&S.extensions.drawBuffers,extensionShaderTextureLOD:S.extensions&&S.extensions.shaderTextureLOD,rendererExtensionFragDepth:l||t.has("EXT_frag_depth"),rendererExtensionDrawBuffers:l||t.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:l||t.has("EXT_shader_texture_lod"),customProgramCacheKey:S.customProgramCacheKey()}}function g(S){const w=[];if(S.shaderID?w.push(S.shaderID):(w.push(S.fragmentShader),w.push(S.vertexShader)),S.defines!==void 0)for(const T in S.defines)w.push(T),w.push(S.defines[T]);if(S.isRawShaderMaterial===!1){for(let T=0;T0?r.push(M):d.transparent===!0?s.push(M):i.push(M)}function f(y,p,d,b,v,g){const M=u(y,p,d,b,v,g);d.transmission>0?r.unshift(M):d.transparent===!0?s.unshift(M):i.unshift(M)}function h(y,p){i.length>1&&i.sort(y||$3),r.length>1&&r.sort(p||vv),s.length>1&&s.sort(p||vv)}function m(){for(let y=t,p=e.length;y=e.get(r).length?(o=new bv(n),e.get(r).push(o)):o=e.get(r)[s],o}function i(){e=new WeakMap}return{get:t,dispose:i}}function X3(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new X,color:new Ae};break;case"SpotLight":t={position:new X,direction:new X,color:new Ae,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new X,color:new Ae,distance:0,decay:0};break;case"HemisphereLight":t={direction:new X,skyColor:new Ae,groundColor:new Ae};break;case"RectAreaLight":t={color:new Ae,position:new X,halfWidth:new X,halfHeight:new X};break}return n[e.id]=t,t}}}function Y3(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Se};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Se};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Se,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let J3=0;function q3(n,e){return(e.castShadow?1:0)-(n.castShadow?1:0)}function K3(n,e){const t=new X3,i=Y3(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let f=0;f<9;f++)r.probe.push(new X);const s=new X,o=new De,l=new De;function u(f){let h=0,m=0,y=0;for(let w=0;w<9;w++)r.probe[w].set(0,0,0);let p=0,d=0,b=0,v=0,g=0,M=0,_=0,E=0;f.sort(q3);for(let w=0,T=f.length;w0&&(e.isWebGL2||n.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=Le.LTC_FLOAT_1,r.rectAreaLTC2=Le.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(r.rectAreaLTC1=Le.LTC_HALF_1,r.rectAreaLTC2=Le.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=h,r.ambient[1]=m,r.ambient[2]=y;const S=r.hash;(S.directionalLength!==p||S.pointLength!==d||S.spotLength!==b||S.rectAreaLength!==v||S.hemiLength!==g||S.numDirectionalShadows!==M||S.numPointShadows!==_||S.numSpotShadows!==E)&&(r.directional.length=p,r.spot.length=b,r.rectArea.length=v,r.point.length=d,r.hemi.length=g,r.directionalShadow.length=M,r.directionalShadowMap.length=M,r.pointShadow.length=_,r.pointShadowMap.length=_,r.spotShadow.length=E,r.spotShadowMap.length=E,r.directionalShadowMatrix.length=M,r.pointShadowMatrix.length=_,r.spotShadowMatrix.length=E,S.directionalLength=p,S.pointLength=d,S.spotLength=b,S.rectAreaLength=v,S.hemiLength=g,S.numDirectionalShadows=M,S.numPointShadows=_,S.numSpotShadows=E,r.version=J3++)}function c(f,h){let m=0,y=0,p=0,d=0,b=0;const v=h.matrixWorldInverse;for(let g=0,M=f.length;g=t.get(s).length?(l=new xv(n,e),t.get(s).push(l)):l=t.get(s)[o],l}function r(){t=new WeakMap}return{get:i,dispose:r}}class fc extends Vt{constructor(e){super(),this.type="MeshDepthMaterial",this.depthPacking=_y,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}fc.prototype.isMeshDepthMaterial=!0;class pc extends Vt{constructor(e){super(),this.type="MeshDistanceMaterial",this.referencePosition=new X,this.nearDistance=1,this.farDistance=1e3,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}pc.prototype.isMeshDistanceMaterial=!0;var eN=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include void main() { float mean = 0.0; float squared_mean = 0.0; float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) ); for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) { #ifdef HORIZONTAL_PASS vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) ); mean += distribution.x; squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; #else float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) ); mean += depth; squared_mean += depth * depth; #endif } mean = mean * HALF_SAMPLE_RATE; squared_mean = squared_mean * HALF_SAMPLE_RATE; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); }`,tN=`void main() { gl_Position = vec4( position, 1.0 ); }`;function wv(n,e,t){let i=new da;const r=new Se,s=new Se,o=new st,l=[],u=[],c={},f=t.maxTextureSize,h={0:At,1:er,2:tr},m=new Di({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new Se},radius:{value:4}},vertexShader:tN,fragmentShader:eN}),y=m.clone();y.defines.HORIZONTAL_PASS=1;const p=new Ve;p.setAttribute("position",new Ge(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const d=new It(p,m),b=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=yd,this.render=function(S,w,T){if(b.enabled===!1||b.autoUpdate===!1&&b.needsUpdate===!1||S.length===0)return;const C=n.getRenderTarget(),R=n.getActiveCubeFace(),P=n.getActiveMipmapLevel(),L=n.state;L.setBlending(_i),L.buffers.color.setClear(1,1,1,1),L.buffers.depth.setTest(!0),L.setScissorTest(!1);for(let A=0,I=S.length;Af||r.y>f)&&(r.x>f&&(s.x=Math.floor(f/N.x),r.x=s.x*N.x,x.mapSize.x=s.x),r.y>f&&(s.y=Math.floor(f/N.y),r.y=s.y*N.y,x.mapSize.y=s.y)),x.map===null&&!x.isPointLightShadow&&this.type===Rs){const D={minFilter:wt,magFilter:wt,format:vn};x.map=new Vn(r.x,r.y,D),x.map.texture.name=O.name+".shadowMap",x.mapPass=new Vn(r.x,r.y,D),x.camera.updateProjectionMatrix()}if(x.map===null){const D={minFilter:Lt,magFilter:Lt,format:vn};x.map=new Vn(r.x,r.y,D),x.map.texture.name=O.name+".shadowMap",x.camera.updateProjectionMatrix()}n.setRenderTarget(x.map),n.clear();const B=x.getViewportCount();for(let D=0;D0),A=I(x)}else A=O;if(n.localClippingEnabled&&T.clipShadows===!0&&T.clippingPlanes.length!==0){const x=A.uuid,N=T.uuid;let B=c[x];B===void 0&&(B={},c[x]=B);let D=B[N];D===void 0&&(D=A.clone(),B[N]=D),A=D}return A.visible=T.visible,A.wireframe=T.wireframe,L===Rs?A.side=T.shadowSide!==null?T.shadowSide:T.side:A.side=T.shadowSide!==null?T.shadowSide:h[T.side],A.clipShadows=T.clipShadows,A.clippingPlanes=T.clippingPlanes,A.clipIntersection=T.clipIntersection,A.wireframeLinewidth=T.wireframeLinewidth,A.linewidth=T.linewidth,C.isPointLight===!0&&A.isMeshDistanceMaterial===!0&&(A.referencePosition.setFromMatrixPosition(C.matrixWorld),A.nearDistance=R,A.farDistance=P),A}function E(S,w,T,C,R){if(S.visible===!1)return;if(S.layers.test(w.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&R===Rs)&&(!S.frustumCulled||i.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(T.matrixWorldInverse,S.matrixWorld);const A=e.update(S),I=S.material;if(Array.isArray(I)){const O=A.groups;for(let x=0,N=O.length;x=1):O.indexOf("OpenGL ES")!==-1&&(I=parseFloat(/^OpenGL ES (\d)/.exec(O)[1]),A=I>=2);let x=null,N={};const B=n.getParameter(3088),D=n.getParameter(2978),V=new st().fromArray(B),z=new st().fromArray(D);function G(se,be,he){const me=new Uint8Array(4),Te=n.createTexture();n.bindTexture(se,Te),n.texParameteri(se,10241,9728),n.texParameteri(se,10240,9728);for(let He=0;Hele||k.height>le)&&(ae=le/Math.max(k.width,k.height)),ae<1||U===!0)if(typeof HTMLImageElement<"u"&&k instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&k instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&k instanceof ImageBitmap){const fe=U?Ly:Math.floor,ge=fe(ae*k.width),we=fe(ae*k.height);y===void 0&&(y=d(ge,we));const ue=oe?d(ge,we):y;return ue.width=ge,ue.height=we,ue.getContext("2d").drawImage(k,0,0,ge,we),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+k.width+"x"+k.height+") to ("+ge+"x"+we+")."),ue}else return"data"in k&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+k.width+"x"+k.height+")."),k;return k}function v(k){return Hd(k.width)&&Hd(k.height)}function g(k){return l?!1:k.wrapS!==Wt||k.wrapT!==Wt||k.minFilter!==Lt&&k.minFilter!==wt}function M(k,U){return k.generateMipmaps&&U&&k.minFilter!==Lt&&k.minFilter!==wt}function _(k,U,oe,le,ae=1){n.generateMipmap(k);const fe=i.get(U);fe.__maxMipLevel=Math.log2(Math.max(oe,le,ae))}function E(k,U,oe){if(l===!1)return U;if(k!==null){if(n[k]!==void 0)return n[k];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+k+"'")}let le=U;return U===6403&&(oe===5126&&(le=33326),oe===5131&&(le=33325),oe===5121&&(le=33321)),U===6407&&(oe===5126&&(le=34837),oe===5131&&(le=34843),oe===5121&&(le=32849)),U===6408&&(oe===5126&&(le=34836),oe===5131&&(le=34842),oe===5121&&(le=32856)),(le===33325||le===33326||le===34842||le===34836)&&e.get("EXT_color_buffer_float"),le}function S(k){return k===Lt||k===Qo||k===ea?9728:9729}function w(k){const U=k.target;U.removeEventListener("dispose",w),C(U),U.isVideoTexture&&m.delete(U),o.memory.textures--}function T(k){const U=k.target;U.removeEventListener("dispose",T),R(U)}function C(k){const U=i.get(k);U.__webglInit!==void 0&&(n.deleteTexture(U.__webglTexture),i.remove(k))}function R(k){const U=k.texture,oe=i.get(k),le=i.get(U);if(k){if(le.__webglTexture!==void 0&&(n.deleteTexture(le.__webglTexture),o.memory.textures--),k.depthTexture&&k.depthTexture.dispose(),k.isWebGLCubeRenderTarget)for(let ae=0;ae<6;ae++)n.deleteFramebuffer(oe.__webglFramebuffer[ae]),oe.__webglDepthbuffer&&n.deleteRenderbuffer(oe.__webglDepthbuffer[ae]);else n.deleteFramebuffer(oe.__webglFramebuffer),oe.__webglDepthbuffer&&n.deleteRenderbuffer(oe.__webglDepthbuffer),oe.__webglMultisampledFramebuffer&&n.deleteFramebuffer(oe.__webglMultisampledFramebuffer),oe.__webglColorRenderbuffer&&n.deleteRenderbuffer(oe.__webglColorRenderbuffer),oe.__webglDepthRenderbuffer&&n.deleteRenderbuffer(oe.__webglDepthRenderbuffer);if(k.isWebGLMultipleRenderTargets)for(let ae=0,fe=U.length;ae=u&&console.warn("THREE.WebGLTextures: Trying to use "+k+" texture units while this GPU supports only "+u),P+=1,k}function I(k,U){const oe=i.get(k);if(k.isVideoTexture&&Y(k),k.version>0&&oe.__version!==k.version){const le=k.image;if(le===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(le.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{G(oe,k,U);return}}t.activeTexture(33984+U),t.bindTexture(3553,oe.__webglTexture)}function O(k,U){const oe=i.get(k);if(k.version>0&&oe.__version!==k.version){G(oe,k,U);return}t.activeTexture(33984+U),t.bindTexture(35866,oe.__webglTexture)}function x(k,U){const oe=i.get(k);if(k.version>0&&oe.__version!==k.version){G(oe,k,U);return}t.activeTexture(33984+U),t.bindTexture(32879,oe.__webglTexture)}function N(k,U){const oe=i.get(k);if(k.version>0&&oe.__version!==k.version){K(oe,k,U);return}t.activeTexture(33984+U),t.bindTexture(34067,oe.__webglTexture)}const B={[ir]:10497,[Wt]:33071,[Os]:33648},D={[Lt]:9728,[Qo]:9984,[ea]:9986,[wt]:9729,[kl]:9985,[Ti]:9987};function V(k,U,oe){if(oe?(n.texParameteri(k,10242,B[U.wrapS]),n.texParameteri(k,10243,B[U.wrapT]),(k===32879||k===35866)&&n.texParameteri(k,32882,B[U.wrapR]),n.texParameteri(k,10240,D[U.magFilter]),n.texParameteri(k,10241,D[U.minFilter])):(n.texParameteri(k,10242,33071),n.texParameteri(k,10243,33071),(k===32879||k===35866)&&n.texParameteri(k,32882,33071),(U.wrapS!==Wt||U.wrapT!==Wt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(k,10240,S(U.magFilter)),n.texParameteri(k,10241,S(U.minFilter)),U.minFilter!==Lt&&U.minFilter!==wt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const le=e.get("EXT_texture_filter_anisotropic");if(U.type===Ei&&e.has("OES_texture_float_linear")===!1||l===!1&&U.type===Br&&e.has("OES_texture_half_float_linear")===!1)return;(U.anisotropy>1||i.get(U).__currentAnisotropy)&&(n.texParameterf(k,le.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(U.anisotropy,r.getMaxAnisotropy())),i.get(U).__currentAnisotropy=U.anisotropy)}}function z(k,U){k.__webglInit===void 0&&(k.__webglInit=!0,U.addEventListener("dispose",w),k.__webglTexture=n.createTexture(),o.memory.textures++)}function G(k,U,oe){let le=3553;U.isDataTexture2DArray&&(le=35866),U.isDataTexture3D&&(le=32879),z(k,U),t.activeTexture(33984+oe),t.bindTexture(le,k.__webglTexture),n.pixelStorei(37440,U.flipY),n.pixelStorei(37441,U.premultiplyAlpha),n.pixelStorei(3317,U.unpackAlignment),n.pixelStorei(37443,0);const ae=g(U)&&v(U.image)===!1,fe=b(U.image,ae,!1,f),ge=v(fe)||l,we=s.convert(U.format);let ue=s.convert(U.type),ye=E(U.internalFormat,we,ue);V(le,U,ge);let se;const be=U.mipmaps;if(U.isDepthTexture)ye=6402,l?U.type===Ei?ye=36012:U.type===na?ye=33190:U.type===Ns?ye=35056:ye=33189:U.type===Ei&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),U.format===Fr&&ye===6402&&U.type!==ta&&U.type!==na&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),U.type=ta,ue=s.convert(U.type)),U.format===Ds&&ye===6402&&(ye=34041,U.type!==Ns&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),U.type=Ns,ue=s.convert(U.type))),t.texImage2D(3553,0,ye,fe.width,fe.height,0,we,ue,null);else if(U.isDataTexture)if(be.length>0&&ge){for(let he=0,me=be.length;he0&&ge){for(let he=0,me=be.length;hey+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&m<=y-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else u!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(u.matrix.fromArray(s.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),s.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(s.linearVelocity)):u.hasLinearVelocity=!1,s.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(s.angularVelocity)):u.hasAngularVelocity=!1));return l!==null&&(l.visible=r!==null),u!==null&&(u.visible=s!==null),c!==null&&(c.visible=o!==null),this}}class sN extends sr{constructor(e,t){super();const i=this,r=e.state;let s=null,o=1,l=null,u="local-floor",c=null,f=null,h=null,m=null;const y=[],p=new Map,d=new zt;d.layers.enable(1),d.viewport=new st;const b=new zt;b.layers.enable(2),b.viewport=new st;const v=[d,b],g=new xh;g.layers.enable(1),g.layers.enable(2);let M=null,_=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(O){let x=y[O];return x===void 0&&(x=new wh,y[O]=x),x.getTargetRaySpace()},this.getControllerGrip=function(O){let x=y[O];return x===void 0&&(x=new wh,y[O]=x),x.getGripSpace()},this.getHand=function(O){let x=y[O];return x===void 0&&(x=new wh,y[O]=x),x.getHandSpace()};function E(O){const x=p.get(O.inputSource);x&&x.dispatchEvent({type:O.type,data:O.inputSource})}function S(){p.forEach(function(O,x){O.disconnect(x)}),p.clear(),M=null,_=null,r.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),I.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(O){o=O,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(O){u=O,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l},this.getSession=function(){return s},this.setSession=async function(O){if(s=O,s!==null){s.addEventListener("select",E),s.addEventListener("selectstart",E),s.addEventListener("selectend",E),s.addEventListener("squeeze",E),s.addEventListener("squeezestart",E),s.addEventListener("squeezeend",E),s.addEventListener("end",S),s.addEventListener("inputsourceschange",w);const x=t.getContextAttributes();if(x.xrCompatible!==!0&&await t.makeXRCompatible(),s.renderState.layers===void 0){const N={antialias:x.antialias,alpha:x.alpha,depth:x.depth,stencil:x.stencil,framebufferScaleFactor:o},B=new XRWebGLLayer(s,t,N);s.updateRenderState({baseLayer:B})}else{let N=0;x.depth&&(N=x.stencil?34041:6402);const B={colorFormat:x.alpha?6408:6407,depthFormat:N,scaleFactor:o};f=new XRWebGLBinding(s,t),m=f.createProjectionLayer(B),h=t.createFramebuffer(),s.updateRenderState({layers:[m]})}l=await s.requestReferenceSpace(u),I.setContext(s),I.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};function w(O){const x=s.inputSources;for(let N=0;N0&&(v.transmissionSamplerMap.value=M.texture,v.transmissionSamplerSize.value.set(M.width,M.height)),v.thickness.value=g.thickness,g.thicknessMap&&(v.thicknessMap.value=g.thicknessMap),v.attenuationDistance.value=g.attenuationDistance,v.attenuationColor.value.copy(g.attenuationColor)}function y(v,g){g.matcap&&(v.matcap.value=g.matcap),g.bumpMap&&(v.bumpMap.value=g.bumpMap,v.bumpScale.value=g.bumpScale,g.side===At&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,v.normalScale.value.copy(g.normalScale),g.side===At&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias)}function p(v,g){g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias)}function d(v,g){g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias),v.referencePosition.value.copy(g.referencePosition),v.nearDistance.value=g.nearDistance,v.farDistance.value=g.farDistance}function b(v,g){g.bumpMap&&(v.bumpMap.value=g.bumpMap,v.bumpScale.value=g.bumpScale,g.side===At&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,v.normalScale.value.copy(g.normalScale),g.side===At&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function aN(){const n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return n.style.display="block",n}function lt(n={}){const e=n.canvas!==void 0?n.canvas:aN(),t=n.context!==void 0?n.context:null,i=n.alpha!==void 0?n.alpha:!1,r=n.depth!==void 0?n.depth:!0,s=n.stencil!==void 0?n.stencil:!0,o=n.antialias!==void 0?n.antialias:!1,l=n.premultipliedAlpha!==void 0?n.premultipliedAlpha:!0,u=n.preserveDrawingBuffer!==void 0?n.preserveDrawingBuffer:!1,c=n.powerPreference!==void 0?n.powerPreference:"default",f=n.failIfMajorPerformanceCaveat!==void 0?n.failIfMajorPerformanceCaveat:!1;let h=null,m=null;const y=[],p=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=ln,this.physicallyCorrectLights=!1,this.toneMapping=nr,this.toneMappingExposure=1;const d=this;let b=!1,v=0,g=0,M=null,_=-1,E=null;const S=new st,w=new st;let T=null,C=e.width,R=e.height,P=1,L=null,A=null;const I=new st(0,0,C,R),O=new st(0,0,C,R);let x=!1;const N=[],B=new da;let D=!1,V=!1,z=null;const G=new De,K=new X,ie={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function j(){return M===null?P:1}let H=t;function W(Z,pe){for(let de=0;de0&&Ce(ve,Z,pe),Ee.length>0&&Me(ve,Ee,Z,pe),ce.length>0&&Ce(ce,Z,pe),M!==null&&(te.updateMultisampleRenderTarget(M),te.updateRenderTargetMipmap(M)),Z.isScene===!0&&Z.onAfterRender(d,Z,pe),ee.buffers.depth.setTest(!0),ee.buffers.depth.setMask(!0),ee.buffers.color.setMask(!0),ee.setPolygonOffset(!1),he.resetDefaultState(),_=-1,E=null,p.pop(),p.length>0?m=p[p.length-1]:m=null,y.pop(),y.length>0?h=y[y.length-1]:h=null};function re(Z,pe,de,ve){if(Z.visible===!1)return;if(Z.layers.test(pe.layers)){if(Z.isGroup)de=Z.renderOrder;else if(Z.isLOD)Z.autoUpdate===!0&&Z.update(pe);else if(Z.isLight)m.pushLight(Z),Z.castShadow&&m.pushShadow(Z);else if(Z.isSprite){if(!Z.frustumCulled||B.intersectsSprite(Z)){ve&&K.setFromMatrixPosition(Z.matrixWorld).applyMatrix4(G);const xe=k.update(Z),_e=Z.material;_e.visible&&h.push(Z,xe,_e,de,K.z,null)}}else if(Z.isImmediateRenderObject)ve&&K.setFromMatrixPosition(Z.matrixWorld).applyMatrix4(G),h.push(Z,null,Z.material,de,K.z,null);else if((Z.isMesh||Z.isLine||Z.isPoints)&&(Z.isSkinnedMesh&&Z.skeleton.frame!==ne.render.frame&&(Z.skeleton.update(),Z.skeleton.frame=ne.render.frame),!Z.frustumCulled||B.intersectsObject(Z))){ve&&K.setFromMatrixPosition(Z.matrixWorld).applyMatrix4(G);const xe=k.update(Z),_e=Z.material;if(Array.isArray(_e)){const Ie=xe.groups;for(let Be=0,ze=Ie.length;Be=0&&pe<=Z.width-ve&&de>=0&&de<=Z.height-Ee&&H.readPixels(pe,de,ve,Ee,be.convert(Be),be.convert(ze),ce):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const Ie=M!==null?Y.get(M).__webglFramebuffer:null;ee.bindFramebuffer(36160,Ie)}}},this.copyFramebufferToTexture=function(Z,pe,de=0){const ve=Math.pow(2,-de),Ee=Math.floor(pe.image.width*ve),ce=Math.floor(pe.image.height*ve);let xe=be.convert(pe.format);Q.isWebGL2&&(xe===6407&&(xe=32849),xe===6408&&(xe=32856)),te.setTexture2D(pe,0),H.copyTexImage2D(3553,de,xe,Z.x,Z.y,Ee,ce,0),ee.unbindTexture()},this.copyTextureToTexture=function(Z,pe,de,ve=0){const Ee=pe.image.width,ce=pe.image.height,xe=be.convert(de.format),_e=be.convert(de.type);te.setTexture2D(de,0),H.pixelStorei(37440,de.flipY),H.pixelStorei(37441,de.premultiplyAlpha),H.pixelStorei(3317,de.unpackAlignment),pe.isDataTexture?H.texSubImage2D(3553,ve,Z.x,Z.y,Ee,ce,xe,_e,pe.image.data):pe.isCompressedTexture?H.compressedTexSubImage2D(3553,ve,Z.x,Z.y,pe.mipmaps[0].width,pe.mipmaps[0].height,xe,pe.mipmaps[0].data):H.texSubImage2D(3553,ve,Z.x,Z.y,xe,_e,pe.image),ve===0&&de.generateMipmaps&&H.generateMipmap(3553),ee.unbindTexture()},this.copyTextureToTexture3D=function(Z,pe,de,ve,Ee=0){if(d.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const ce=Z.max.x-Z.min.x+1,xe=Z.max.y-Z.min.y+1,_e=Z.max.z-Z.min.z+1,Ie=be.convert(ve.format),Be=be.convert(ve.type);let ze;if(ve.isDataTexture3D)te.setTexture3D(ve,0),ze=32879;else if(ve.isDataTexture2DArray)te.setTexture2DArray(ve,0),ze=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}H.pixelStorei(37440,ve.flipY),H.pixelStorei(37441,ve.premultiplyAlpha),H.pixelStorei(3317,ve.unpackAlignment);const ke=H.getParameter(3314),qe=H.getParameter(32878),Bt=H.getParameter(3316),$t=H.getParameter(3315),ds=H.getParameter(32877),mt=de.isCompressedTexture?de.mipmaps[0]:de.image;H.pixelStorei(3314,mt.width),H.pixelStorei(32878,mt.height),H.pixelStorei(3316,Z.min.x),H.pixelStorei(3315,Z.min.y),H.pixelStorei(32877,Z.min.z),de.isDataTexture||de.isDataTexture3D?H.texSubImage3D(ze,Ee,pe.x,pe.y,pe.z,ce,xe,_e,Ie,Be,mt.data):de.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),H.compressedTexSubImage3D(ze,Ee,pe.x,pe.y,pe.z,ce,xe,_e,Ie,mt.data)):H.texSubImage3D(ze,Ee,pe.x,pe.y,pe.z,ce,xe,_e,Ie,Be,mt),H.pixelStorei(3314,ke),H.pixelStorei(32878,qe),H.pixelStorei(3316,Bt),H.pixelStorei(3315,$t),H.pixelStorei(32877,ds),Ee===0&&ve.generateMipmaps&&H.generateMipmap(ze),ee.unbindTexture()},this.initTexture=function(Z){te.setTexture2D(Z,0),ee.unbindTexture()},this.resetState=function(){v=0,g=0,M=null,ee.reset(),he.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class Sv extends lt{}Sv.prototype.isWebGL1Renderer=!0;class pa{constructor(e,t=25e-5){this.name="",this.color=new Ae(e),this.density=t}clone(){return new pa(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}pa.prototype.isFogExp2=!0;class ma{constructor(e,t=1,i=1e3){this.name="",this.color=new Ae(e),this.near=t,this.far=i}clone(){return new ma(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}ma.prototype.isFog=!0;class mc extends $e{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,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()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}}mc.prototype.isScene=!0;class mr{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Fs,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=bn()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;re.far||t.push({distance:u,point:ya.clone(),uv:Pt.getUV(ya,gc,ba,yc,Tv,Mh,Ev,new Se),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}xa.prototype.isSprite=!0;function vc(n,e,t,i,r,s){so.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(va.x=s*so.x-r*so.y,va.y=r*so.x+s*so.y):va.copy(so),n.copy(e),n.x+=va.x,n.y+=va.y,n.applyMatrix4(_v)}const bc=new X,Cv=new X;class Av extends $e{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,r=t.length;i0){let i,r;for(i=1,r=t.length;i0){bc.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(bc);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){bc.setFromMatrixPosition(e.matrixWorld),Cv.setFromMatrixPosition(this.matrixWorld);const i=bc.distanceTo(Cv)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(this._currentLevel=r-1;ru)continue;m.applyMatrix4(this.matrixWorld);const T=e.ray.origin.distanceTo(m);Te.far||t.push({distance:T,point:h.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}else{const v=Math.max(0,o.start),g=Math.min(b.count,o.start+o.count);for(let M=v,_=g-1;M<_;M+=y){if(c.fromBufferAttribute(b,M),f.fromBufferAttribute(b,M+1),_h.distanceSqToSegment(c,f,m,h)>u)continue;m.applyMatrix4(this.matrixWorld);const S=e.ray.origin.distanceTo(m);Se.far||t.push({distance:S,point:h.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}}else i.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}ii.prototype.isLine=!0;const kv=new X,zv=new X;class un extends ii{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,i=[];for(let r=0,s=t.count;r0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}oo.prototype.isPoints=!0;function Gv(n,e,t,i,r,s,o){const l=Th.distanceSqToPoint(n);if(lr.far)return;s.push({distance:c,distanceToRay:Math.sqrt(l),point:u,index:e,face:null,object:o})}}class Hv extends Rt{constructor(e,t,i,r,s,o,l,u,c){super(e,t,i,r,s,o,l,u,c),this.format=l!==void 0?l:Ci,this.minFilter=o!==void 0?o:wt,this.magFilter=s!==void 0?s:wt,this.generateMipmaps=!1;const f=this;function h(){f.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}Hv.prototype.isVideoTexture=!0;class Eh extends Rt{constructor(e,t,i,r,s,o,l,u,c,f,h,m){super(null,o,l,u,c,f,r,s,h,m),this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}Eh.prototype.isCompressedTexture=!0;class Wv extends Rt{constructor(e,t,i,r,s,o,l,u,c){super(e,t,i,r,s,o,l,u,c),this.needsUpdate=!0}}Wv.prototype.isCanvasTexture=!0;class jv extends Rt{constructor(e,t,i,r,s,o,l,u,c,f){if(f=f!==void 0?f:Fr,f!==Fr&&f!==Ds)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&f===Fr&&(i=ta),i===void 0&&f===Ds&&(i=Ns),super(null,r,s,o,l,u,f,i,c),this.image={width:e,height:t},this.magFilter=l!==void 0?l:Lt,this.minFilter=u!==void 0?u:Lt,this.flipY=!1,this.generateMipmaps=!1}}jv.prototype.isDepthTexture=!0;class ao extends Ve{constructor(e=1,t=8,i=0,r=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:r},t=Math.max(3,t);const s=[],o=[],l=[],u=[],c=new X,f=new Se;o.push(0,0,0),l.push(0,0,1),u.push(.5,.5);for(let h=0,m=3;h<=t;h++,m+=3){const y=i+h/t*r;c.x=e*Math.cos(y),c.y=e*Math.sin(y),o.push(c.x,c.y,c.z),l.push(0,0,1),f.x=(o[m]/e+1)/2,f.y=(o[m+1]/e+1)/2,u.push(f.x,f.y)}for(let h=1;h<=t;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new Oe(o,3)),this.setAttribute("normal",new Oe(l,3)),this.setAttribute("uv",new Oe(u,2))}static fromJSON(e){return new ao(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class yr extends Ve{constructor(e=1,t=1,i=1,r=8,s=1,o=!1,l=0,u=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:s,openEnded:o,thetaStart:l,thetaLength:u};const c=this;r=Math.floor(r),s=Math.floor(s);const f=[],h=[],m=[],y=[];let p=0;const d=[],b=i/2;let v=0;g(),o===!1&&(e>0&&M(!0),t>0&&M(!1)),this.setIndex(f),this.setAttribute("position",new Oe(h,3)),this.setAttribute("normal",new Oe(m,3)),this.setAttribute("uv",new Oe(y,2));function g(){const _=new X,E=new X;let S=0;const w=(t-e)/i;for(let T=0;T<=s;T++){const C=[],R=T/s,P=R*(t-e)+e;for(let L=0;L<=r;L++){const A=L/r,I=A*u+l,O=Math.sin(I),x=Math.cos(I);E.x=P*O,E.y=-R*i+b,E.z=P*x,h.push(E.x,E.y,E.z),_.set(O,w,x).normalize(),m.push(_.x,_.y,_.z),y.push(A,1-R),C.push(p++)}d.push(C)}for(let T=0;T.9&&w<.1&&(M<.2&&(o[g+0]+=1),_<.2&&(o[g+2]+=1),E<.2&&(o[g+4]+=1))}}function m(g){s.push(g.x,g.y,g.z)}function y(g,M){const _=g*3;M.x=e[_+0],M.y=e[_+1],M.z=e[_+2]}function p(){const g=new X,M=new X,_=new X,E=new X,S=new Se,w=new Se,T=new Se;for(let C=0,R=0;C0)u=r-1;else{u=r;break}if(r=u,i[r]===o)return r/(s-1);const f=i[r],m=i[r+1]-f,y=(o-f)/m;return(r+y)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),l=this.getPoint(s),u=t||(o.isVector2?new Se:new X);return u.copy(l).sub(o).normalize(),u}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new X,r=[],s=[],o=[],l=new X,u=new De;for(let y=0;y<=e;y++){const p=y/e;r[y]=this.getTangentAt(p,new X),r[y].normalize()}s[0]=new X,o[0]=new X;let c=Number.MAX_VALUE;const f=Math.abs(r[0].x),h=Math.abs(r[0].y),m=Math.abs(r[0].z);f<=c&&(c=f,i.set(1,0,0)),h<=c&&(c=h,i.set(0,1,0)),m<=c&&i.set(0,0,1),l.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],l),o[0].crossVectors(r[0],s[0]);for(let y=1;y<=e;y++){if(s[y]=s[y-1].clone(),o[y]=o[y-1].clone(),l.crossVectors(r[y-1],r[y]),l.length()>Number.EPSILON){l.normalize();const p=Math.acos(Jt(r[y-1].dot(r[y]),-1,1));s[y].applyMatrix4(u.makeRotationAxis(l,p))}o[y].crossVectors(r[y],s[y])}if(t===!0){let y=Math.acos(Jt(s[0].dot(s[e]),-1,1));y/=e,r[0].dot(l.crossVectors(s[0],s[e]))>0&&(y=-y);for(let p=1;p<=e;p++)s[p].applyMatrix4(u.makeRotationAxis(r[p],y*p)),o[p].crossVectors(r[p],s[p])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Ta extends Mn{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,l=!1,u=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=l,this.aRotation=u}getPoint(e,t){const i=t||new Se,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)r;)s-=r;s0?0:(Math.floor(Math.abs(l)/s)+1)*s:u===0&&l===s-1&&(l=s-2,u=1);let c,f;this.closed||l>0?c=r[(l-1)%s]:(Ac.subVectors(r[0],r[1]).add(r[0]),c=Ac);const h=r[l%s],m=r[(l+1)%s];if(this.closed||l+2r.length-2?r.length-1:o+1],h=r[o>r.length-3?r.length-1:o+2];return i.set($v(l,u.x,c.x,f.x,h.x),$v(l,u.y,c.y,f.y,h.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t80*t){l=c=n[0],u=f=n[1];for(let p=t;pc&&(c=h),m>f&&(f=m);y=Math.max(c-l,f-u),y=y!==0?1/y:0}return La(s,o,t,l,u,y),o}};function Xv(n,e,t,i,r){let s,o;if(r===ON(n,e,t,i)>0)for(s=e;s=e;s-=i)o=qv(s,n[s],n[s+1],o);return o&&Ic(o,o.next)&&(Pa(o),o=o.next),o}function vr(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Ic(t,t.next)||vt(t.prev,t,t.next)===0)){if(Pa(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function La(n,e,t,i,r,s,o){if(!n)return;!o&&s&&CN(n,i,r,s);let l=n,u,c;for(;n.prev!==n.next;){if(u=n.prev,c=n.next,s?bN(n,i,r,s):vN(n)){e.push(u.i/t),e.push(n.i/t),e.push(c.i/t),Pa(n),n=c.next,l=c.next;continue}if(n=c,n===l){o?o===1?(n=xN(vr(n),e,t),La(n,e,t,i,r,s,2)):o===2&&wN(n,e,t,i,r,s):La(vr(n),e,t,i,r,s,1);break}}}function vN(n){const e=n.prev,t=n,i=n.next;if(vt(e,t,i)>=0)return!1;let r=n.next.next;for(;r!==n.prev;){if(uo(e.x,e.y,t.x,t.y,i.x,i.y,r.x,r.y)&&vt(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function bN(n,e,t,i){const r=n.prev,s=n,o=n.next;if(vt(r,s,o)>=0)return!1;const l=r.xs.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,f=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,h=Vh(l,u,e,t,i),m=Vh(c,f,e,t,i);let y=n.prevZ,p=n.nextZ;for(;y&&y.z>=h&&p&&p.z<=m;){if(y!==n.prev&&y!==n.next&&uo(r.x,r.y,s.x,s.y,o.x,o.y,y.x,y.y)&&vt(y.prev,y,y.next)>=0||(y=y.prevZ,p!==n.prev&&p!==n.next&&uo(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&vt(p.prev,p,p.next)>=0))return!1;p=p.nextZ}for(;y&&y.z>=h;){if(y!==n.prev&&y!==n.next&&uo(r.x,r.y,s.x,s.y,o.x,o.y,y.x,y.y)&&vt(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;p&&p.z<=m;){if(p!==n.prev&&p!==n.next&&uo(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&vt(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function xN(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!Ic(r,s)&&Yv(r,i,i.next,s)&&Ra(r,s)&&Ra(s,r)&&(e.push(r.i/t),e.push(i.i/t),e.push(s.i/t),Pa(i),Pa(i.next),i=n=s),i=i.next}while(i!==n);return vr(i)}function wN(n,e,t,i,r,s){let o=n;do{let l=o.next.next;for(;l!==o.prev;){if(o.i!==l.i&&RN(o,l)){let u=Jv(o,l);o=vr(o,o.next),u=vr(u,u.next),La(o,e,t,i,r,s),La(u,e,t,i,r,s);return}l=l.next}o=o.next}while(o!==n)}function MN(n,e,t,i){const r=[];let s,o,l,u,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){const m=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(m<=i&&m>s){if(s=m,m===i){if(r===t.y)return t;if(r===t.next.y)return t.next}o=t.x=t.x&&t.x>=u&&i!==t.x&&uo(ro.x||t.x===o.x&&EN(o,t)))&&(o=t,f=h)),t=t.next;while(t!==l);return o}function EN(n,e){return vt(n.prev,n,e.prev)<0&&vt(e.next,n,n.next)<0}function CN(n,e,t,i){let r=n;do r.z===null&&(r.z=Vh(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,AN(r)}function AN(n){let e,t,i,r,s,o,l,u,c=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,l=0,e=0;e0||u>0&&i;)l!==0&&(u===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,l--):(r=i,i=i.nextZ,u--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,c*=2}while(o>1);return n}function Vh(n,e,t,i,r){return n=32767*(n-t)*r,e=32767*(e-i)*r,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function LN(n){let e=n,t=n;do(e.x=0&&(n-o)*(i-l)-(t-o)*(e-l)>=0&&(t-o)*(s-l)-(r-o)*(i-l)>=0}function RN(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!PN(n,e)&&(Ra(n,e)&&Ra(e,n)&&IN(n,e)&&(vt(n.prev,n,e.prev)||vt(n,e.prev,e))||Ic(n,e)&&vt(n.prev,n,n.next)>0&&vt(e.prev,e,e.next)>0)}function vt(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Ic(n,e){return n.x===e.x&&n.y===e.y}function Yv(n,e,t,i){const r=Nc(vt(n,e,t)),s=Nc(vt(n,e,i)),o=Nc(vt(t,i,n)),l=Nc(vt(t,i,e));return!!(r!==s&&o!==l||r===0&&Oc(n,t,e)||s===0&&Oc(n,i,e)||o===0&&Oc(t,n,i)||l===0&&Oc(t,e,i))}function Oc(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function Nc(n){return n>0?1:n<0?-1:0}function PN(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&Yv(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function Ra(n,e){return vt(n.prev,n,n.next)<0?vt(n,e,n.next)>=0&&vt(n,n.prev,e)>=0:vt(n,e,n.prev)<0||vt(n,n.next,e)<0}function IN(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function Jv(n,e){const t=new kh(n.i,n.x,n.y),i=new kh(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function qv(n,e,t,i){const r=new kh(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Pa(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function kh(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ON(n,e,t,i){let r=0;for(let s=e,o=t-i;s2&&n[e-1].equals(n[0])&&n.pop()}function Qv(n,e){for(let t=0;tNumber.EPSILON){const we=Math.sqrt(fe),ue=Math.sqrt(le*le+ae*ae),ye=te.x-oe/we,se=te.y+U/we,be=F.x-ae/ue,he=F.y+le/ue,me=((be-ye)*ae-(he-se)*le)/(U*ae-oe*le);$=ye+U*me-Y.x,J=se+oe*me-Y.y;const Te=$*$+J*J;if(Te<=2)return new Se($,J);k=Math.sqrt(Te/2)}else{let we=!1;U>Number.EPSILON?le>Number.EPSILON&&(we=!0):U<-Number.EPSILON?le<-Number.EPSILON&&(we=!0):Math.sign(oe)===Math.sign(ae)&&(we=!0),we?($=-oe,J=U,k=Math.sqrt(fe)):($=U,J=oe,k=Math.sqrt(fe/2))}return new Se($/k,J/k)}const D=[];for(let Y=0,te=I.length,F=te-1,$=Y+1;Y=0;Y--){const te=Y/b,F=y*Math.cos(te*Math.PI/2),$=p*Math.sin(te*Math.PI/2)+d;for(let J=0,k=I.length;J=0;){const $=F;let J=F-1;J<0&&(J=Y.length-1);for(let k=0,U=f+b*2;k=0?(e(g-u,b,h),m.subVectors(f,h)):(e(g+u,b,h),m.subVectors(h,f)),b-u>=0?(e(g,b-u,h),y.subVectors(f,h)):(e(g,b+u,h),y.subVectors(h,f)),c.crossVectors(m,y).normalize(),o.push(c.x,c.y,c.z),l.push(g,b)}}for(let d=0;d0)&&y.push(M,_,S),(v!==i-1||u=i)){h.push(c.times[y]);for(let d=0;ds.tracks[u].times[0]&&(l=s.tracks[u].times[0]);for(let u=0;u=l.times[p]){const v=p*h+f,g=v+h-f;d=ft.arraySlice(l.values,v,g)}else{const v=l.createInterpolant(),g=f,M=h-f;v.evaluate(s),d=ft.arraySlice(v.resultBuffer,g,M)}u==="quaternion"&&new qt().fromArray(d).normalize().conjugate().toArray(d);const b=c.times.length;for(let v=0;v=s)){const l=t[1];e=s)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const l=this.getValueSize();this.times=ft.arraySlice(i,s,o),this.values=ft.arraySlice(this.values,s*l,o*l)}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 i=this.times,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let l=0;l!==s;l++){const u=i[l];if(typeof u=="number"&&isNaN(u)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,l,u),e=!1;break}if(o!==null&&o>u){console.error("THREE.KeyframeTrack: Out of order keys.",this,l,u,o),e=!1;break}o=u}if(r!==void 0&&ft.isTypedArray(r))for(let l=0,u=r.length;l!==u;++l){const c=r[l];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,l,c),e=!1;break}}return e}optimize(){const e=ft.arraySlice(this.times),t=ft.arraySlice(this.values),i=this.getValueSize(),r=this.getInterpolation()===zl,s=e.length-1;let o=1;for(let l=1;l0){e[o]=e[s];for(let l=s*i,u=o*i,c=0;c!==i;++c)t[u+c]=t[l+c];++o}return o!==e.length?(this.times=ft.arraySlice(e,0,o),this.values=ft.arraySlice(t,0,o*i)):(this.times=e,this.values=t),this}clone(){const e=ft.arraySlice(this.times,0),t=ft.arraySlice(this.values,0),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Wn.prototype.TimeBufferType=Float32Array,Wn.prototype.ValueBufferType=Float32Array,Wn.prototype.DefaultInterpolation=Vr;class Qr extends Wn{}Qr.prototype.ValueTypeName="bool",Qr.prototype.ValueBufferType=Array,Qr.prototype.DefaultInterpolation=Bs,Qr.prototype.InterpolantFactoryMethodLinear=void 0,Qr.prototype.InterpolantFactoryMethodSmooth=void 0;class Yh extends Wn{}Yh.prototype.ValueTypeName="color";class xo extends Wn{}xo.prototype.ValueTypeName="number";class ib extends oi{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=(i-t)/(r-t);let c=e*l;for(let f=c+l;c!==f;c+=4)qt.slerpFlat(s,0,o,c-l,o,c,u);return s}}class es extends Wn{InterpolantFactoryMethodLinear(e){return new ib(this.times,this.values,this.getValueSize(),e)}}es.prototype.ValueTypeName="quaternion",es.prototype.DefaultInterpolation=Vr,es.prototype.InterpolantFactoryMethodSmooth=void 0;class ts extends Wn{}ts.prototype.ValueTypeName="string",ts.prototype.ValueBufferType=Array,ts.prototype.DefaultInterpolation=Bs,ts.prototype.InterpolantFactoryMethodLinear=void 0,ts.prototype.InterpolantFactoryMethodSmooth=void 0;class wo extends Wn{}wo.prototype.ValueTypeName="vector";class Mo{constructor(e,t=-1,i,r=Ul){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=bn(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,l=i.length;o!==l;++o)t.push(kN(i[o]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=i.length;s!==o;++s)t.push(Wn.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let l=0;l1){const h=f[1];let m=r[h];m||(r[h]=m=[]),m.push(c)}}const o=[];for(const l in r)o.push(this.CreateFromMorphTargetSequence(l,r[l],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(h,m,y,p,d){if(y.length!==0){const b=[],v=[];ft.flattenJSON(y,b,v,p),b.length!==0&&d.push(new h(m,b,v))}},r=[],s=e.name||"default",o=e.fps||30,l=e.blendMode;let u=e.length||-1;const c=e.hierarchy||[];for(let h=0;h0||e.search(/^data\:image\/jpeg/)===0;s.format=u?Ci:vn,s.needsUpdate=!0,t!==void 0&&t(s)},i,r),s}}class ab extends Mn{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Aa(t,e))}getPoint(e){const t=e*this.getLength(),i=this.getCurveLengths();let r=0;for(;r=t){const s=i[r]-t,o=this.curves[r],l=o.getLength(),u=l===0?0:1-s/l;return o.getPointAt(u)}r++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,r=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){const h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);const f=c.getPoint(1);return this.currentPoint.copy(f),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class br extends Na{constructor(e){super(e),this.uuid=bn(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let i=0,r=this.holes.length;i0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(r.uniforms[s]={},o.type){case"t":r.uniforms[s].value=i(o.value);break;case"c":r.uniforms[s].value=new Ae().setHex(o.value);break;case"v2":r.uniforms[s].value=new Se().fromArray(o.value);break;case"v3":r.uniforms[s].value=new X().fromArray(o.value);break;case"v4":r.uniforms[s].value=new st().fromArray(o.value);break;case"m3":r.uniforms[s].value=new kt().fromArray(o.value);break;case"m4":r.uniforms[s].value=new De().fromArray(o.value);break;default:r.uniforms[s].value=o.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(r.flatShading=e.shading===1),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new Se().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new Se().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),r}setTextures(e){return this.textures=e,this}}class Fi{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i0){const u=new Jh(t);s=new Oa(u),s.setCrossOrigin(this.crossOrigin);for(let c=0,f=e.length;c0){r=new Oa(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,l=e.length;o"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,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=ns.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const l={};l.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",l.headers=this.requestHeader,fetch(e,l).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(u){ns.add(e,u),t&&t(u),s.manager.itemEnd(e)}).catch(function(u){r&&r(u),s.manager.itemError(e),s.manager.itemEnd(e)}),s.manager.itemStart(e)}}af.prototype.isImageBitmapLoader=!0;class bb{constructor(){this.type="ShapePath",this.color=new Ae,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Na,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,s,o){return this.currentPath.bezierCurveTo(e,t,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function i(g){const M=[];for(let _=0,E=g.length;_Number.EPSILON){if(P<0&&(T=M[w],R=-R,C=M[S],P=-P),g.yC.y)continue;if(g.y===T.y){if(g.x===T.x)return!0}else{const L=P*(g.x-T.x)-R*(g.y-T.y);if(L===0)return!0;if(L<0)continue;E=!E}}else{if(g.y!==T.y)continue;if(C.x<=g.x&&g.x<=T.x||T.x<=g.x&&g.x<=C.x)return!0}}return E}const s=si.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return i(o);let l,u,c;const f=[];if(o.length===1)return u=o[0],c=new br,c.curves=u.curves,f.push(c),f;let h=!s(o[0].getPoints());h=e?!h:h;const m=[],y=[];let p=[],d=0,b;y[d]=void 0,p[d]=[];for(let g=0,M=o.length;g1){let g=!1;const M=[];for(let _=0,E=y.length;_0&&(g||(p=m))}let v;for(let g=0,M=y.length;g"u"?Date:performance).now()}const is=new X,Cb=new qt,XN=new X,rs=new X;class YN extends $e{constructor(){super(),this.type="AudioListener",this.context=cf.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Tb}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(is,Cb,XN),rs.set(0,0,-1).applyQuaternion(Cb),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(is.x,r),t.positionY.linearRampToValueAtTime(is.y,r),t.positionZ.linearRampToValueAtTime(is.z,r),t.forwardX.linearRampToValueAtTime(rs.x,r),t.forwardY.linearRampToValueAtTime(rs.y,r),t.forwardZ.linearRampToValueAtTime(rs.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(is.x,is.y,is.z),t.setOrientation(rs.x,rs.y,rs.z,i.x,i.y,i.z)}}class uf extends $e{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let u=t,c=t+t;u!==c;++u)if(i[u]!==i[u+t]){l.setValue(i,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let s=i,o=r;s!==o;++s)t[s]=t[r+s%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let o=0;o!==s;++o)e[t+o]=e[i+o]}_slerp(e,t,i,r){qt.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;qt.multiplyQuaternionsFlat(e,o,e,t,e,i),qt.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,s){const o=1-r;for(let l=0;l!==s;++l){const u=t+l;e[u]=e[u]*o+e[i+l]*r}}_lerpAdditive(e,t,i,r,s){for(let o=0;o!==s;++o){const l=t+o;e[l]=e[l]+e[i+o]*r}}}const df="\\[\\]\\.:\\/",KN=new RegExp("["+df+"]","g"),hf="[^"+df+"]",QN="[^"+df.replace("\\.","")+"]",eD=/((?:WC+[\/:])*)/.source.replace("WC",hf),tD=/(WCOD+)?/.source.replace("WCOD",QN),nD=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",hf),iD=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",hf),rD=new RegExp("^"+eD+tD+nD+iD+"$"),sD=["material","materials","bones"];class oD{constructor(e,t,i){const r=i||Qe.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class Qe{constructor(e,t,i){this.path=t,this.parsedPath=i||Qe.parseTrackName(t),this.node=Qe.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new Qe.Composite(e,t,i):new Qe(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(KN,"")}static parseTrackName(e){const t=rD.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=i.nodeName.substring(r+1);sD.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(!t||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(s){for(let o=0;o=s){const h=s++,m=e[h];t[m.uuid]=f,e[f]=m,t[c]=h,e[h]=u;for(let y=0,p=r;y!==p;++y){const d=i[y],b=d[h],v=d[f];d[f]=b,d[h]=v}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_,o=e.length;for(let l=0,u=arguments.length;l!==u;++l){const c=arguments[l],f=c.uuid,h=t[f];if(h!==void 0)if(delete t[f],h0&&(t[y.uuid]=h),e[h]=y,e.pop();for(let p=0,d=r;p!==d;++p){const b=i[p];b[h]=b[m],b.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const i=this._bindingsIndicesByPath;let r=i[e];const s=this._bindings;if(r!==void 0)return s[r];const o=this._paths,l=this._parsedPaths,u=this._objects,c=u.length,f=this.nCachedObjects_,h=new Array(c);r=s.length,i[e]=r,o.push(e),l.push(t),s.push(h);for(let m=f,y=u.length;m!==y;++m){const p=u[m];h[m]=new Qe(p,e,t)}return h}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,s=this._parsedPaths,o=this._bindings,l=o.length-1,u=o[l],c=e[l];t[c]=i,o[i]=u,o.pop(),s[i]=s[l],s.pop(),r[i]=r[l],r.pop()}}}Pb.prototype.isAnimationObjectGroup=!0;class aD{constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;const s=t.tracks,o=s.length,l=new Array(o),u={endingStart:kr,endingEnd:kr};for(let c=0;c!==o;++c){const f=s[c].createInterpolant(null);l[c]=f,f.settings=u}this._interpolantSettings=u,this._interpolants=l,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=by,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const r=this._clip.duration,s=e._clip.duration,o=s/r,l=r/s;e.warp(1,o,t),this.warp(l,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const r=this._mixer,s=r.time,o=this.timeScale;let l=this._timeScaleInterpolant;l===null&&(l=r._lendControlInterpolant(),this._timeScaleInterpolant=l);const u=l.parameterPositions,c=l.sampleValues;return u[0]=s,u[1]=s+i,c[0]=e/o,c[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const u=(e-s)*i;if(u<0||i===0)return;this._startTime=null,t=i*u}t*=this._updateTimeScale(e);const o=this._updateTime(t),l=this._updateWeight(e);if(l>0){const u=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Bd:for(let f=0,h=u.length;f!==h;++f)u[f].evaluate(o),c[f].accumulateAdditive(l);break;case Ul:default:for(let f=0,h=u.length;f!==h;++f)u[f].evaluate(o),c[f].accumulate(r,l)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let r=this.time+e,s=this._loopCount;const o=i===xy;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===vy){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),r>=t||r<0){const l=Math.floor(r/t);r-=t*l,s+=Math.abs(l);const u=this.repetitions-s;if(u<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(u===1){const c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:l})}}else this.time=r;if(o&&(s&1)===1)return t-r}return r}_setEndings(e,t,i){const r=this._interpolantSettings;i?(r.endingStart=zr,r.endingEnd=zr):(e?r.endingStart=this.zeroSlopeAtStart?zr:kr:r.endingStart=ia,t?r.endingEnd=this.zeroSlopeAtEnd?zr:kr:r.endingEnd=ia)}_scheduleFading(e,t,i){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const l=o.parameterPositions,u=o.sampleValues;return l[0]=s,u[0]=t,l[1]=s+e,u[1]=i,this}}class Ib extends sr{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,r=e._clip.tracks,s=r.length,o=e._propertyBindings,l=e._interpolants,u=i.uuid,c=this._bindingsByRootAndName;let f=c[u];f===void 0&&(f={},c[u]=f);for(let h=0;h!==s;++h){const m=r[h],y=m.name;let p=f[y];if(p!==void 0)o[h]=p;else{if(p=o[h],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,u,y));continue}const d=t&&t._propertyBindings[h].binding.parsedPath;p=new Rb(Qe.create(i,y,d),m.ValueTypeName,m.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,u,y),o[h]=p}l[h].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,r=e._clip.uuid,s=this._actionsByClip[r];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,r,i)}const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,r=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==i;++c)t[c]._update(r,e,s,o);const l=this._bindings,u=this._nActiveBindings;for(let c=0;c!==u;++c)l[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Bb.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}_o.prototype.isBox2=!0;const Fb=new X,Gc=new X;class Vb{constructor(e=new X,t=new X){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){Fb.subVectors(e,this.start),Gc.subVectors(this.end,this.start);const i=Gc.dot(Gc);let s=Gc.dot(Fb)/i;return t&&(s=Jt(s,0,1)),s}closestPointToPoint(e,t,i){const r=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(r).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)}}class kb extends $e{constructor(e){super(),this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}}kb.prototype.isImmediateRenderObject=!0;const zb=new X;class dD extends $e{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;const i=new Ve,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,l=1,u=32;o.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Yb.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Yb,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}}class Jb extends un{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new Ve;r.setAttribute("position",new Oe(t,3)),r.setAttribute("color",new Oe(i,3));const s=new Ut({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new Ae,s=this.geometry.attributes.color.array;return r.set(e),r.toArray(s,0),r.toArray(s,3),r.set(t),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}const qb=new Float32Array(1),wD=new Int32Array(qb.buffer);class MD{static toHalfFloat(e){qb[0]=e;const t=wD[0];let i=t>>16&32768,r=t>>12&2047;const s=t>>23&255;return s<103?i:s>142?(i|=31744,i|=(s==255?0:1)&&t&8388607,i):s<113?(r|=2048,i|=(r>>114-s)+(r>>113-s&1),i):(i|=s-112<<10|r>>1,i+=r&1,i)}}const To=4,wr=8,ai=Math.pow(2,wr),Kb=[.125,.215,.35,.446,.526,.582],Qb=wr-To+1+Kb.length,Eo=20,li={[ln]:0,[Ur]:1,[Hl]:2,[Vd]:3,[kd]:4,[zd]:5,[Gl]:6},as=new mn({side:At,depthWrite:!1,depthTest:!1}),SD=new It(new Ni,as),gf=new So,{_lodPlanes:Fa,_sizeLods:ex,_sigmas:Xc}=ED(),tx=new Ae;let yf=null;const ls=(1+Math.sqrt(5))/2,Co=1/ls,nx=[new X(1,1,1),new X(-1,1,1),new X(1,1,-1),new X(-1,1,-1),new X(0,ls,Co),new X(0,ls,-Co),new X(Co,0,ls),new X(-Co,0,ls),new X(ls,Co,0),new X(-ls,Co,0)];function ix(n){const e=Math.max(n.r,n.g,n.b),t=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);return n.multiplyScalar(Math.pow(2,-t)),(t+128)/255}class _D{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=CD(Eo),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){yf=this._renderer.getRenderTarget();const s=this._allocateTargets();return this._sceneToCubeUV(e,i,r,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=ox(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=sx(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e2?ai:0,ai,ai),f.setRenderTarget(r),p&&f.render(SD,l),f.render(e,l)}f.toneMapping=y,f.outputEncoding=m,f.autoClear=h}_textureToCubeUV(e,t){const i=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=ox()):this._equirectShader==null&&(this._equirectShader=sx());const r=e.isCubeTexture?this._cubemapShader:this._equirectShader,s=new It(Fa[0],r),o=r.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=li[e.encoding],o.outputEncoding.value=li[t.texture.encoding],Yc(t,0,0,3*ai,2*ai),i.setRenderTarget(t),i.render(s,gf)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let r=1;rEo&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${b} samples when the maximum is set to ${Eo}`);const v=[];let g=0;for(let S=0;Swr-To?r-wr+To:0);Yc(t,_,E,3*M,2*M),u.setRenderTarget(t),u.render(h,gf)}}function TD(n){return n===void 0||n.type!==Dr?!1:n.encoding===ln||n.encoding===Ur||n.encoding===Gl}function ED(){const n=[],e=[],t=[];let i=wr;for(let r=0;rwr-To?o=Kb[r-wr+To-1]:r==0&&(o=0),t.push(o);const l=1/(s-1),u=-l/2,c=1+l/2,f=[u,u,c,u,c,c,u,u,c,c,u,c],h=6,m=6,y=3,p=2,d=1,b=new Float32Array(y*m*h),v=new Float32Array(p*m*h),g=new Float32Array(d*m*h);for(let _=0;_2?0:-1,w=[E,S,0,E+2/3,S,0,E+2/3,S+1,0,E,S,0,E+2/3,S+1,0,E,S+1,0];b.set(w,y*m*_),v.set(f,p*m*_);const T=[_,_,_,_,_,_];g.set(T,d*m*_)}const M=new Ve;M.setAttribute("position",new Ge(b,y)),M.setAttribute("uv",new Ge(v,p)),M.setAttribute("faceIndex",new Ge(g,d)),n.push(M),i>To&&i--}return{_lodPlanes:n,_sizeLods:e,_sigmas:t}}function rx(n){const e=new Vn(3*ai,3*ai,n);return e.texture.mapping=Is,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Yc(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function CD(n){const e=new Float32Array(n),t=new X(0,1,0);return new bo({name:"SphericalGaussianBlur",defines:{n},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:li[ln]},outputEncoding:{value:li[ln]}},vertexShader:vf(),fragmentShader:` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform sampler2D envMap; uniform int samples; uniform float weights[ n ]; uniform bool latitudinal; uniform float dTheta; uniform float mipInt; uniform vec3 poleAxis; ${bf()} #define ENVMAP_TYPE_CUBE_UV #include vec3 getSample( float theta, vec3 axis ) { float cosTheta = cos( theta ); // Rodrigues' axis-angle rotation vec3 sampleDirection = vOutputDirection * cosTheta + cross( axis, vOutputDirection ) * sin( theta ) + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); return bilinearCubeUV( envMap, sampleDirection, mipInt ); } void main() { vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); if ( all( equal( axis, vec3( 0.0 ) ) ) ) { axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); } axis = normalize( axis ); gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); for ( int i = 1; i < n; i++ ) { if ( i >= samples ) { break; } float theta = dTheta * float( i ); gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); } gl_FragColor = linearToOutputTexel( gl_FragColor ); } `,blending:_i,depthTest:!1,depthWrite:!1})}function sx(){const n=new Se(1,1);return new bo({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:n},inputEncoding:{value:li[ln]},outputEncoding:{value:li[ln]}},vertexShader:vf(),fragmentShader:` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform sampler2D envMap; uniform vec2 texelSize; ${bf()} #include void main() { gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); vec3 outputDirection = normalize( vOutputDirection ); vec2 uv = equirectUv( outputDirection ); vec2 f = fract( uv / texelSize - 0.5 ); uv -= f * texelSize; vec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; uv.x += texelSize.x; vec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; uv.y += texelSize.y; vec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; uv.x -= texelSize.x; vec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; vec3 tm = mix( tl, tr, f.x ); vec3 bm = mix( bl, br, f.x ); gl_FragColor.rgb = mix( tm, bm, f.y ); gl_FragColor = linearToOutputTexel( gl_FragColor ); } `,blending:_i,depthTest:!1,depthWrite:!1})}function ox(){return new bo({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:li[ln]},outputEncoding:{value:li[ln]}},vertexShader:vf(),fragmentShader:` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform samplerCube envMap; ${bf()} void main() { gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); gl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb; gl_FragColor = linearToOutputTexel( gl_FragColor ); } `,blending:_i,depthTest:!1,depthWrite:!1})}function vf(){return` precision mediump float; precision mediump int; attribute vec3 position; attribute vec2 uv; attribute float faceIndex; varying vec3 vOutputDirection; // RH coordinate system; PMREM face-indexing convention vec3 getDirection( vec2 uv, float face ) { uv = 2.0 * uv - 1.0; vec3 direction = vec3( uv, 1.0 ); if ( face == 0.0 ) { direction = direction.zyx; // ( 1, v, u ) pos x } else if ( face == 1.0 ) { direction = direction.xzy; direction.xz *= -1.0; // ( -u, 1, -v ) pos y } else if ( face == 2.0 ) { direction.x *= -1.0; // ( -u, v, 1 ) pos z } else if ( face == 3.0 ) { direction = direction.zyx; direction.xz *= -1.0; // ( -1, v, -u ) neg x } else if ( face == 4.0 ) { direction = direction.xzy; direction.xy *= -1.0; // ( -u, -1, v ) neg y } else if ( face == 5.0 ) { direction.z *= -1.0; // ( u, v, -1 ) neg z } return direction; } void main() { vOutputDirection = getDirection( uv, faceIndex ); gl_Position = vec4( position, 1.0 ); } `}function bf(){return` uniform int inputEncoding; uniform int outputEncoding; #include vec4 inputTexelToLinear( vec4 value ) { if ( inputEncoding == 0 ) { return value; } else if ( inputEncoding == 1 ) { return sRGBToLinear( value ); } else if ( inputEncoding == 2 ) { return RGBEToLinear( value ); } else if ( inputEncoding == 3 ) { return RGBMToLinear( value, 7.0 ); } else if ( inputEncoding == 4 ) { return RGBMToLinear( value, 16.0 ); } else if ( inputEncoding == 5 ) { return RGBDToLinear( value, 256.0 ); } else { return GammaToLinear( value, 2.2 ); } } vec4 linearToOutputTexel( vec4 value ) { if ( outputEncoding == 0 ) { return value; } else if ( outputEncoding == 1 ) { return LinearTosRGB( value ); } else if ( outputEncoding == 2 ) { return LinearToRGBE( value ); } else if ( outputEncoding == 3 ) { return LinearToRGBM( value, 7.0 ); } else if ( outputEncoding == 4 ) { return LinearToRGBM( value, 16.0 ); } else if ( outputEncoding == 5 ) { return LinearToRGBD( value, 256.0 ); } else { return LinearToGamma( value, 2.2 ); } } vec4 envMapTexelToLinear( vec4 color ) { return inputTexelToLinear( color ); } `}const AD=0,LD=1,RD=0,PD=1,ID=2;function OD(n){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),n}function ND(n=[]){return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),n.isMultiMaterial=!0,n.materials=n,n.clone=function(){return n.slice()},n}function DD(n,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new oo(n,e)}function BD(n){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new xa(n)}function FD(n,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new oo(n,e)}function VD(n){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new gr(n)}function kD(n){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new gr(n)}function zD(n){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new gr(n)}function UD(n,e,t){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new X(n,e,t)}function GD(n,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new Ge(n,e).setUsage(Vs)}function HD(n,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new Gy(n,e)}function WD(n,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new Hy(n,e)}function jD(n,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new Wy(n,e)}function $D(n,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new jy(n,e)}function ZD(n,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new ec(n,e)}function XD(n,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new $y(n,e)}function YD(n,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new tc(n,e)}function JD(n,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new Oe(n,e)}function qD(n,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Xy(n,e)}Mn.create=function(n,e){return console.log("THREE.Curve.create() has been deprecated"),n.prototype=Object.create(Mn.prototype),n.prototype.constructor=n,n.prototype.getPoint=e,n},Na.prototype.fromPoints=function(n){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(n)};function KD(n){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new Jb(n)}function QD(n,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Xb(n,e)}function eB(n,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new un(new Ah(n.geometry),new Ut({color:e!==void 0?e:16777215}))}jb.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Ub.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")};function tB(n,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new un(new zh(n.geometry),new Ut({color:e!==void 0?e:16777215}))}Kt.prototype.extractUrlBase=function(n){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),Fi.extractUrlBase(n)},Kt.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}};function nB(n){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new Sn(n)}function iB(n){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new ob(n)}_o.prototype.center=function(n){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(n)},_o.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},_o.prototype.isIntersectionBox=function(n){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(n)},_o.prototype.size=function(n){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(n)},pn.prototype.center=function(n){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(n)},pn.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},pn.prototype.isIntersectionBox=function(n){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(n)},pn.prototype.isIntersectionSphere=function(n){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(n)},pn.prototype.size=function(n){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(n)},Li.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()},da.prototype.setFromMatrix=function(n){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(n)},Vb.prototype.center=function(n){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(n)},kt.prototype.flattenToArrayOffset=function(n,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(n,e)},kt.prototype.multiplyVector3=function(n){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),n.applyMatrix3(this)},kt.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},kt.prototype.applyToBufferAttribute=function(n){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),n.applyMatrix3(this)},kt.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},kt.prototype.getInverse=function(n){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(n).invert()},De.prototype.extractPosition=function(n){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(n)},De.prototype.flattenToArrayOffset=function(n,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(n,e)},De.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),new X().setFromMatrixColumn(this,3)},De.prototype.setRotationFromQuaternion=function(n){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(n)},De.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},De.prototype.multiplyVector3=function(n){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)},De.prototype.multiplyVector4=function(n){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)},De.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},De.prototype.rotateAxis=function(n){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),n.transformDirection(this)},De.prototype.crossVector=function(n){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)},De.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")},De.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},De.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},De.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},De.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},De.prototype.applyToBufferAttribute=function(n){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)},De.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},De.prototype.makeFrustum=function(n,e,t,i,r,s){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(n,e,i,t,r,s)},De.prototype.getInverse=function(n){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(n).invert()},ti.prototype.isIntersectionLine=function(n){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(n)},qt.prototype.multiplyVector3=function(n){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),n.applyQuaternion(this)},qt.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()},cr.prototype.isIntersectionBox=function(n){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(n)},cr.prototype.isIntersectionPlane=function(n){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(n)},cr.prototype.isIntersectionSphere=function(n){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(n)},Pt.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},Pt.prototype.barycoordFromPoint=function(n,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(n,e)},Pt.prototype.midpoint=function(n){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(n)},Pt.prototypenormal=function(n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(n)},Pt.prototype.plane=function(n){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(n)},Pt.barycoordFromPoint=function(n,e,t,i,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Pt.getBarycoord(n,e,t,i,r)},Pt.normal=function(n,e,t,i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Pt.getNormal(n,e,t,i)},br.prototype.extractAllPoints=function(n){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(n)},br.prototype.extrude=function(n){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Hn(this,n)},br.prototype.makeGeometry=function(n){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Jr(this,n)},Se.prototype.fromAttribute=function(n,e,t){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(n,e,t)},Se.prototype.distanceToManhattan=function(n){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(n)},Se.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},X.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},X.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},X.prototype.getPositionFromMatrix=function(n){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(n)},X.prototype.getScaleFromMatrix=function(n){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(n)},X.prototype.getColumnFromMatrix=function(n,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,n)},X.prototype.applyProjection=function(n){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(n)},X.prototype.fromAttribute=function(n,e,t){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(n,e,t)},X.prototype.distanceToManhattan=function(n){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(n)},X.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},st.prototype.fromAttribute=function(n,e,t){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(n,e,t)},st.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},$e.prototype.getChildByName=function(n){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(n)},$e.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},$e.prototype.translate=function(n,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,n)},$e.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},$e.prototype.applyMatrix=function(n){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(n)},Object.defineProperties($e.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(n){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=n}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),It.prototype.setDrawMode=function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")},Object.defineProperties(It.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),wy},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),wa.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},zt.prototype.setLens=function(n,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),e!==void 0&&(this.filmGauge=e),this.setFocalLength(n)},Object.defineProperties($n.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(n){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=n}},shadowCameraLeft:{set:function(n){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=n}},shadowCameraRight:{set:function(n){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=n}},shadowCameraTop:{set:function(n){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=n}},shadowCameraBottom:{set:function(n){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=n}},shadowCameraNear:{set:function(n){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=n}},shadowCameraFar:{set:function(n){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=n}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(n){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=n}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(n){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=n}},shadowMapHeight:{set:function(n){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=n}}}),Object.defineProperties(Ge.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===Vs},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(Vs)}}}),Ge.prototype.setDynamic=function(n){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(n===!0?Vs:Fs),this},Ge.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},Ge.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},Ve.prototype.addIndex=function(n){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(n)},Ve.prototype.addAttribute=function(n,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),!(e&&e.isBufferAttribute)&&!(e&&e.isInterleavedBufferAttribute)?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(n,new Ge(arguments[1],arguments[2]))):n==="index"?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(n,e)},Ve.prototype.addDrawCall=function(n,e,t){t!==void 0&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(n,e)},Ve.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},Ve.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},Ve.prototype.removeAttribute=function(n){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(n)},Ve.prototype.applyMatrix=function(n){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(n)},Object.defineProperties(Ve.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),mr.prototype.setDynamic=function(n){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(n===!0?Vs:Fs),this},mr.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},Hn.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},Hn.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},Hn.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")},mc.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")},Uc.prototype.onUpdate=function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this},Object.defineProperties(Vt.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new Ae}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(n){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===vd}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(n){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=n}}}),Object.defineProperties(Di.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(n){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=n}}}),lt.prototype.clearTarget=function(n,e,t,i){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(n),this.clear(e,t,i)},lt.prototype.animate=function(n){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(n)},lt.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},lt.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},lt.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},lt.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},lt.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},lt.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},lt.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},lt.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},lt.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},lt.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},lt.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},lt.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},lt.prototype.enableScissorTest=function(n){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(n)},lt.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},lt.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},lt.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},lt.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},lt.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},lt.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},lt.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},lt.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},lt.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},lt.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()},Object.defineProperties(lt.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(n){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=n}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(n){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=n}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(n){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=n===!0?Ur:ln}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(wv.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}});function rB(n,e,t){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new dc(n,t)}Object.defineProperties(Vn.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(n){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=n}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(n){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=n}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(n){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=n}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(n){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=n}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(n){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=n}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(n){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=n}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(n){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=n}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(n){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=n}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(n){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=n}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(n){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=n}}}),uf.prototype.load=function(n){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const e=this;return new xb().load(n,function(i){e.setBuffer(i)}),this},Lb.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},uc.prototype.updateCubeMap=function(n,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(n,e)},uc.prototype.clear=function(n,e,t,i){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(n,e,t,i)},Hr.crossOrigin=void 0,Hr.loadTexture=function(n,e,t,i){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const r=new qh;r.setCrossOrigin(this.crossOrigin);const s=r.load(n,t,void 0,i);return e&&(s.mapping=e),s},Hr.loadTextureCube=function(n,e,t,i){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const r=new sb;r.setCrossOrigin(this.crossOrigin);const s=r.load(n,t,void 0,i);return e&&(s.mapping=e),s},Hr.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},Hr.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};function sB(){console.error("THREE.CanvasRenderer has been removed")}function oB(){console.error("THREE.JSONLoader has been removed.")}const aB={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}};function lB(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:md}})),typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=md);const cB=Ll(Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:_0,AddEquation:Nr,AddOperation:x0,AdditiveAnimationBlendMode:Bd,AdditiveBlending:bd,AlphaFormat:I0,AlwaysDepth:f0,AlwaysStencilFunc:Cy,AmbientLight:tf,AmbientLightProbe:Mb,AnimationClip:Mo,AnimationLoader:zN,AnimationMixer:Ib,AnimationObjectGroup:Pb,AnimationUtils:ft,ArcCurve:Lh,ArrayCamera:xh,ArrowHelper:xD,Audio:uf,AudioAnalyser:Lb,AudioContext:cf,AudioListener:YN,AudioLoader:xb,AxesHelper:Jb,AxisHelper:KD,BackSide:At,BasicDepthPacking:_y,BasicShadowMap:eR,BinaryTextureLoader:iB,Bone:Ma,BooleanKeyframeTrack:Qr,BoundingBoxHelper:QD,Box2:_o,Box3:pn,Box3Helper:vD,BoxBufferGeometry:Ni,BoxGeometry:Ni,BoxHelper:Xb,BufferAttribute:Ge,BufferGeometry:Ve,BufferGeometryLoader:gb,ByteType:E0,Cache:ns,Camera:ua,CameraHelper:yD,CanvasRenderer:sB,CanvasTexture:Wv,CatmullRomCurve3:Nh,CineonToneMapping:S0,CircleBufferGeometry:ao,CircleGeometry:ao,ClampToEdgeWrapping:Wt,Clock:Tb,Color:Ae,ColorKeyframeTrack:Yh,CompressedTexture:Eh,CompressedTextureLoader:UN,ConeBufferGeometry:lo,ConeGeometry:lo,CubeCamera:uc,CubeReflectionMapping:Jo,CubeRefractionMapping:qo,CubeTexture:Qs,CubeTextureLoader:sb,CubeUVReflectionMapping:Is,CubeUVRefractionMapping:Ko,CubicBezierCurve:Lc,CubicBezierCurve3:Dh,CubicInterpolant:tb,CullFaceBack:gd,CullFaceFront:Kg,CullFaceFrontBack:QL,CullFaceNone:qg,Curve:Mn,CurvePath:ab,CustomBlending:e0,CustomToneMapping:T0,CylinderBufferGeometry:yr,CylinderGeometry:yr,Cylindrical:uD,DataTexture:Xr,DataTexture2DArray:gh,DataTexture3D:yh,DataTextureLoader:ob,DataUtils:MD,DecrementStencilOp:cR,DecrementWrapStencilOp:dR,DefaultLoadingManager:rb,DepthFormat:Fr,DepthStencilFormat:Ds,DepthTexture:jv,DirectionalLight:kc,DirectionalLightHelper:gD,DiscreteInterpolant:nb,DodecahedronBufferGeometry:co,DodecahedronGeometry:co,DoubleSide:tr,DstAlphaFactor:a0,DstColorFactor:c0,DynamicBufferAttribute:GD,DynamicCopyUsage:TR,DynamicDrawUsage:Vs,DynamicReadUsage:MR,EdgesGeometry:Ah,EdgesHelper:eB,EllipseCurve:Ta,EqualDepth:m0,EqualStencilFunc:mR,EquirectangularReflectionMapping:Fl,EquirectangularRefractionMapping:Vl,Euler:$r,EventDispatcher:sr,ExtrudeBufferGeometry:Hn,ExtrudeGeometry:Hn,FaceColors:PD,FileLoader:Sn,FlatShading:vd,Float16BufferAttribute:Zy,Float32Attribute:JD,Float32BufferAttribute:Oe,Float64Attribute:qD,Float64BufferAttribute:Xy,FloatType:Ei,Fog:ma,FogExp2:pa,Font:lf,FontLoader:$N,FrontSide:er,Frustum:da,GLBufferAttribute:Nb,GLSL1:CR,GLSL3:Ud,GammaEncoding:Gl,GreaterDepth:y0,GreaterEqualDepth:g0,GreaterEqualStencilFunc:bR,GreaterStencilFunc:yR,GridHelper:jb,Group:ni,HalfFloatType:Br,HemisphereLight:Kh,HemisphereLightHelper:pD,HemisphereLightProbe:wb,IcosahedronBufferGeometry:ho,IcosahedronGeometry:ho,ImageBitmapLoader:af,ImageLoader:Oa,ImageUtils:Hr,ImmediateRenderObject:kb,IncrementStencilOp:lR,IncrementWrapStencilOp:uR,InstancedBufferAttribute:of,InstancedBufferGeometry:sf,InstancedInterleavedBuffer:Ob,InstancedMesh:Sh,Int16Attribute:$D,Int16BufferAttribute:jy,Int32Attribute:XD,Int32BufferAttribute:$y,Int8Attribute:HD,Int8BufferAttribute:Gy,IntType:A0,InterleavedBuffer:mr,InterleavedBufferAttribute:Bi,Interpolant:oi,InterpolateDiscrete:Bs,InterpolateLinear:Vr,InterpolateSmooth:zl,InvertStencilOp:hR,JSONLoader:oB,KeepStencilOp:Wl,KeyframeTrack:Wn,LOD:Av,LatheBufferGeometry:fo,LatheGeometry:fo,Layers:th,LensFlare:lB,LessDepth:p0,LessEqualDepth:Dl,LessEqualStencilFunc:gR,LessStencilFunc:pR,Light:$n,LightProbe:Ba,Line:ii,Line3:Vb,LineBasicMaterial:Ut,LineCurve:Aa,LineCurve3:Zv,LineDashedMaterial:Zh,LineLoop:Mc,LinePieces:LD,LineSegments:un,LineStrip:AD,LinearEncoding:ln,LinearFilter:wt,LinearInterpolant:Xh,LinearMipMapLinearFilter:sR,LinearMipMapNearestFilter:rR,LinearMipmapLinearFilter:Ti,LinearMipmapNearestFilter:kl,LinearToneMapping:w0,Loader:Kt,LoaderUtils:Fi,LoadingManager:Jh,LogLuvEncoding:Sy,LoopOnce:vy,LoopPingPong:xy,LoopRepeat:by,LuminanceAlphaFormat:N0,LuminanceFormat:O0,MOUSE:qL,Material:Vt,MaterialLoader:mb,Math:Wd,MathUtils:Wd,Matrix3:kt,Matrix4:De,MaxEquation:Sd,Mesh:It,MeshBasicMaterial:mn,MeshDepthMaterial:fc,MeshDistanceMaterial:pc,MeshFaceMaterial:OD,MeshLambertMaterial:jh,MeshMatcapMaterial:$h,MeshNormalMaterial:Wh,MeshPhongMaterial:Gh,MeshPhysicalMaterial:Ia,MeshStandardMaterial:Kr,MeshToonMaterial:Hh,MinEquation:Md,MirroredRepeatWrapping:Os,MixOperation:b0,MultiMaterial:ND,MultiplyBlending:wd,MultiplyOperation:Yo,NearestFilter:Lt,NearestMipMapLinearFilter:iR,NearestMipMapNearestFilter:nR,NearestMipmapLinearFilter:ea,NearestMipmapNearestFilter:Qo,NeverDepth:h0,NeverStencilFunc:fR,NoBlending:_i,NoColors:RD,NoToneMapping:nr,NormalAnimationBlendMode:Ul,NormalBlending:Ps,NotEqualDepth:v0,NotEqualStencilFunc:vR,NumberKeyframeTrack:xo,Object3D:$e,ObjectLoader:GN,ObjectSpaceNormalMap:Ey,OctahedronBufferGeometry:Yr,OctahedronGeometry:Yr,OneFactor:r0,OneMinusDstAlphaFactor:l0,OneMinusDstColorFactor:u0,OneMinusSrcAlphaFactor:Td,OneMinusSrcColorFactor:o0,OrthographicCamera:So,PCFShadowMap:yd,PCFSoftShadowMap:Qg,PMREMGenerator:_D,ParametricBufferGeometry:Dc,ParametricGeometry:Dc,Particle:BD,ParticleBasicMaterial:kD,ParticleSystem:FD,ParticleSystemMaterial:zD,Path:Na,PerspectiveCamera:zt,Plane:ti,PlaneBufferGeometry:Zr,PlaneGeometry:Zr,PlaneHelper:bD,PointCloud:DD,PointCloudMaterial:VD,PointLight:Vc,PointLightHelper:hD,Points:oo,PointsMaterial:gr,PolarGridHelper:mD,PolyhedronBufferGeometry:ri,PolyhedronGeometry:ri,PositionalAudio:qN,PropertyBinding:Qe,PropertyMixer:Rb,QuadraticBezierCurve:Rc,QuadraticBezierCurve3:Bh,Quaternion:qt,QuaternionKeyframeTrack:es,QuaternionLinearInterpolant:ib,REVISION:md,RGBADepthPacking:Ty,RGBAFormat:vn,RGBAIntegerFormat:U0,RGBA_ASTC_10x10_Format:ey,RGBA_ASTC_10x5_Format:q0,RGBA_ASTC_10x6_Format:K0,RGBA_ASTC_10x8_Format:Q0,RGBA_ASTC_12x10_Format:ty,RGBA_ASTC_12x12_Format:ny,RGBA_ASTC_4x4_Format:H0,RGBA_ASTC_5x4_Format:W0,RGBA_ASTC_5x5_Format:j0,RGBA_ASTC_6x5_Format:$0,RGBA_ASTC_6x6_Format:Z0,RGBA_ASTC_8x5_Format:X0,RGBA_ASTC_8x6_Format:Y0,RGBA_ASTC_8x8_Format:J0,RGBA_BPTC_Format:iy,RGBA_ETC2_EAC_Format:Dd,RGBA_PVRTC_2BPPV1_Format:Od,RGBA_PVRTC_4BPPV1_Format:Id,RGBA_S3TC_DXT1_Format:Cd,RGBA_S3TC_DXT3_Format:Ad,RGBA_S3TC_DXT5_Format:Ld,RGBDEncoding:zd,RGBEEncoding:Hl,RGBEFormat:D0,RGBFormat:Ci,RGBIntegerFormat:z0,RGBM16Encoding:kd,RGBM7Encoding:Vd,RGB_ETC1_Format:G0,RGB_ETC2_Format:Nd,RGB_PVRTC_2BPPV1_Format:Pd,RGB_PVRTC_4BPPV1_Format:Rd,RGB_S3TC_DXT1_Format:Ed,RGFormat:V0,RGIntegerFormat:k0,RawShaderMaterial:bo,Ray:cr,Raycaster:lD,RectAreaLight:nf,RedFormat:B0,RedIntegerFormat:F0,ReinhardToneMapping:M0,RepeatWrapping:ir,ReplaceStencilOp:aR,ReverseSubtractEquation:n0,RingBufferGeometry:po,RingGeometry:po,SRGB8_ALPHA8_ASTC_10x10_Format:my,SRGB8_ALPHA8_ASTC_10x5_Format:hy,SRGB8_ALPHA8_ASTC_10x6_Format:fy,SRGB8_ALPHA8_ASTC_10x8_Format:py,SRGB8_ALPHA8_ASTC_12x10_Format:gy,SRGB8_ALPHA8_ASTC_12x12_Format:yy,SRGB8_ALPHA8_ASTC_4x4_Format:ry,SRGB8_ALPHA8_ASTC_5x4_Format:sy,SRGB8_ALPHA8_ASTC_5x5_Format:oy,SRGB8_ALPHA8_ASTC_6x5_Format:ay,SRGB8_ALPHA8_ASTC_6x6_Format:ly,SRGB8_ALPHA8_ASTC_8x5_Format:cy,SRGB8_ALPHA8_ASTC_8x6_Format:uy,SRGB8_ALPHA8_ASTC_8x8_Format:dy,Scene:mc,SceneUtils:aB,ShaderChunk:Ye,ShaderLib:Gn,ShaderMaterial:Di,ShadowMaterial:Uh,Shape:br,ShapeBufferGeometry:Jr,ShapeGeometry:Jr,ShapePath:bb,ShapeUtils:si,ShortType:C0,Skeleton:Sa,SkeletonHelper:Ub,SkinnedMesh:wa,SmoothShading:tR,Sphere:Li,SphereBufferGeometry:qr,SphereGeometry:qr,Spherical:cD,SphericalHarmonics3:rf,SplineCurve:Pc,SpotLight:Fc,SpotLightHelper:dD,Sprite:xa,SpriteMaterial:ga,SrcAlphaFactor:_d,SrcAlphaSaturateFactor:d0,SrcColorFactor:s0,StaticCopyUsage:_R,StaticDrawUsage:Fs,StaticReadUsage:wR,StereoCamera:ZN,StreamCopyUsage:ER,StreamDrawUsage:xR,StreamReadUsage:SR,StringKeyframeTrack:ts,SubtractEquation:t0,SubtractiveBlending:xd,TOUCH:KL,TangentSpaceNormalMap:rr,TetrahedronBufferGeometry:mo,TetrahedronGeometry:mo,TextBufferGeometry:Bc,TextGeometry:Bc,Texture:Rt,TextureLoader:qh,TorusBufferGeometry:go,TorusGeometry:go,TorusKnotBufferGeometry:yo,TorusKnotGeometry:yo,Triangle:Pt,TriangleFanDrawMode:Fd,TriangleStripDrawMode:My,TrianglesDrawMode:wy,TubeBufferGeometry:vo,TubeGeometry:vo,UVMapping:Bl,Uint16Attribute:ZD,Uint16BufferAttribute:ec,Uint32Attribute:YD,Uint32BufferAttribute:tc,Uint8Attribute:WD,Uint8BufferAttribute:Hy,Uint8ClampedAttribute:jD,Uint8ClampedBufferAttribute:Wy,Uniform:Uc,UniformsLib:Le,UniformsUtils:qy,UnsignedByteType:Dr,UnsignedInt248Type:Ns,UnsignedIntType:na,UnsignedShort4444Type:L0,UnsignedShort5551Type:R0,UnsignedShort565Type:P0,UnsignedShortType:ta,VSMShadowMap:Rs,Vector2:Se,Vector3:X,Vector4:st,VectorKeyframeTrack:wo,Vertex:UD,VertexColors:ID,VideoTexture:Hv,WebGL1Renderer:Sv,WebGLCubeRenderTarget:dc,WebGLMultipleRenderTargets:Ry,WebGLMultisampleRenderTarget:$d,WebGLRenderTarget:Vn,WebGLRenderTargetCube:rB,WebGLRenderer:lt,WebGLUtils:Mv,WireframeGeometry:zh,WireframeHelper:tB,WrapAroundEnding:ia,XHRLoader:nB,ZeroCurvatureEnding:kr,ZeroFactor:i0,ZeroSlopeEnding:zr,ZeroStencilOp:oR,sRGBEncoding:Ur},Symbol.toStringTag,{value:"Module"})));function uB(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function dB(n,e){for(var t=0;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function mB(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function gB(n,e){return e&&(typeof e=="object"||typeof e=="function")?e:mB(n)}function yB(n){var e=pB();return function(){var i=Jc(n),r;if(e){var s=Jc(this).constructor;r=Reflect.construct(i,arguments,s)}else r=i.apply(this,arguments);return gB(this,r)}}function ax(n,e){return bB(n)||wB(n,e)||lx(n,e)||SB()}function qc(n){return vB(n)||xB(n)||lx(n)||MB()}function vB(n){if(Array.isArray(n))return wf(n)}function bB(n){if(Array.isArray(n))return n}function xB(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function wB(n,e){var t=n&&(typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"]);if(t!=null){var i=[],r=!0,s=!1,o,l;try{for(t=t.call(n);!(r=(o=t.next()).done)&&(i.push(o.value),!(e&&i.length===e));r=!0);}catch(u){s=!0,l=u}finally{try{!r&&t.return!=null&&t.return()}finally{if(s)throw l}}return i}}function lx(n,e){if(n){if(typeof n=="string")return wf(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return wf(n,e)}}function wf(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t0&&arguments[0]!==void 0?arguments[0]:"",s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:10,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"rgba(255, 255, 255, 1)";return uB(this,t),i=e.call(this,new Va.SpriteMaterial({map:new Va.Texture})),i._text="".concat(r),i._textHeight=s,i._color=o,i._backgroundColor=!1,i._padding=0,i._borderWidth=0,i._borderRadius=0,i._borderColor="white",i._strokeWidth=0,i._strokeColor="white",i._fontFace="Arial",i._fontSize=90,i._fontWeight="normal",i._canvas=document.createElement("canvas"),i._texture=i.material.map,i._texture.minFilter=Va.LinearFilter,i._genCanvas(),i}return hB(t,[{key:"text",get:function(){return this._text},set:function(r){this._text=r,this._genCanvas()}},{key:"textHeight",get:function(){return this._textHeight},set:function(r){this._textHeight=r,this._genCanvas()}},{key:"color",get:function(){return this._color},set:function(r){this._color=r,this._genCanvas()}},{key:"backgroundColor",get:function(){return this._backgroundColor},set:function(r){this._backgroundColor=r,this._genCanvas()}},{key:"padding",get:function(){return this._padding},set:function(r){this._padding=r,this._genCanvas()}},{key:"borderWidth",get:function(){return this._borderWidth},set:function(r){this._borderWidth=r,this._genCanvas()}},{key:"borderRadius",get:function(){return this._borderRadius},set:function(r){this._borderRadius=r,this._genCanvas()}},{key:"borderColor",get:function(){return this._borderColor},set:function(r){this._borderColor=r,this._genCanvas()}},{key:"fontFace",get:function(){return this._fontFace},set:function(r){this._fontFace=r,this._genCanvas()}},{key:"fontSize",get:function(){return this._fontSize},set:function(r){this._fontSize=r,this._genCanvas()}},{key:"fontWeight",get:function(){return this._fontWeight},set:function(r){this._fontWeight=r,this._genCanvas()}},{key:"strokeWidth",get:function(){return this._strokeWidth},set:function(r){this._strokeWidth=r,this._genCanvas()}},{key:"strokeColor",get:function(){return this._strokeColor},set:function(r){this._strokeColor=r,this._genCanvas()}},{key:"_genCanvas",value:function(){var r=this,s=this._canvas,o=s.getContext("2d"),l=Array.isArray(this.borderWidth)?this.borderWidth:[this.borderWidth,this.borderWidth],u=l.map(function(w){return w*r.fontSize*.1}),c=Array.isArray(this.borderRadius)?this.borderRadius:[this.borderRadius,this.borderRadius,this.borderRadius,this.borderRadius],f=c.map(function(w){return w*r.fontSize*.1}),h=Array.isArray(this.padding)?this.padding:[this.padding,this.padding],m=h.map(function(w){return w*r.fontSize*.1}),y=this.text.split(` `),p="".concat(this.fontWeight," ").concat(this.fontSize,"px ").concat(this.fontFace);o.font=p;var d=Math.max.apply(Math,qc(y.map(function(w){return o.measureText(w).width}))),b=this.fontSize*y.length;if(s.width=d+u[0]*2+m[0]*2,s.height=b+u[1]*2+m[1]*2,this.borderWidth){if(o.strokeStyle=this.borderColor,u[0]){var v=u[0]/2;o.lineWidth=u[0],o.beginPath(),o.moveTo(v,f[0]),o.lineTo(v,s.height-f[3]),o.moveTo(s.width-v,f[1]),o.lineTo(s.width-v,s.height-f[2]),o.stroke()}if(u[1]){var g=u[1]/2;o.lineWidth=u[1],o.beginPath(),o.moveTo(Math.max(u[0],f[0]),g),o.lineTo(s.width-Math.max(u[0],f[1]),g),o.moveTo(Math.max(u[0],f[3]),s.height-g),o.lineTo(s.width-Math.max(u[0],f[2]),s.height-g),o.stroke()}if(this.borderRadius){var M=Math.max.apply(Math,qc(u)),_=M/2;o.lineWidth=M,o.beginPath(),[!!f[0]&&[f[0],_,_,f[0]],!!f[1]&&[s.width-f[1],s.width-_,_,f[1]],!!f[2]&&[s.width-f[2],s.width-_,s.height-_,s.height-f[2]],!!f[3]&&[f[3],_,s.height-_,s.height-f[3]]].filter(function(w){return w}).forEach(function(w){var T=ax(w,4),C=T[0],R=T[1],P=T[2],L=T[3];o.moveTo(C,P),o.quadraticCurveTo(R,P,R,L)}),o.stroke()}}this.backgroundColor&&(o.fillStyle=this.backgroundColor,this.borderRadius?(o.beginPath(),o.moveTo(u[0],f[0]),[[u[0],f[0],s.width-f[1],u[1],u[1],u[1]],[s.width-u[0],s.width-u[0],s.width-u[0],u[1],f[1],s.height-f[2]],[s.width-u[0],s.width-f[2],f[3],s.height-u[1],s.height-u[1],s.height-u[1]],[u[0],u[0],u[0],s.height-u[1],s.height-f[3],f[0]]].forEach(function(w){var T=ax(w,6),C=T[0],R=T[1],P=T[2],L=T[3],A=T[4],I=T[5];o.quadraticCurveTo(C,L,R,A),o.lineTo(P,I)}),o.closePath(),o.fill()):o.fillRect(u[0],u[1],s.width-u[0]*2,s.height-u[1]*2)),o.translate.apply(o,qc(u)),o.translate.apply(o,qc(m)),o.font=p,o.fillStyle=this.color,o.textBaseline="bottom";var E=this.strokeWidth>0;E&&(o.lineWidth=this.strokeWidth*this.fontSize/10,o.strokeStyle=this.strokeColor),y.forEach(function(w,T){var C=(d-o.measureText(w).width)/2,R=(T+1)*r.fontSize;E&&o.strokeText(w,C,R),o.fillText(w,C,R)}),this._texture.image=s,this._texture.needsUpdate=!0;var S=this.textHeight*y.length+l[1]*2+h[1]*2;this.scale.set(S*s.width/s.height,S,0)}},{key:"clone",value:function(){return new this.constructor(this.text,this.textHeight,this.color).copy(this)}},{key:"copy",value:function(r){return Va.Sprite.prototype.copy.call(this,r),this.color=r.color,this.backgroundColor=r.backgroundColor,this.padding=r.padding,this.borderWidth=r.borderWidth,this.borderColor=r.borderColor,this.fontFace=r.fontFace,this.fontSize=r.fontSize,this.fontWeight=r.fontWeight,this.strokeWidth=r.strokeWidth,this.strokeColor=r.strokeColor,this}}]),t}(Va.Sprite);const TB=Ll(Object.freeze(Object.defineProperty({__proto__:null,default:_B},Symbol.toStringTag,{value:"Module"})));var Mf={exports:{}},cx;function EB(){return cx||(cx=1,function(n,e){(function(t,i){n.exports=i()})(typeof window<"u"?window:Ki,function(){if(typeof window>"u")return null;var t=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")(),i=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||function(f){return t.setTimeout(f,20)},r=t.cancelAnimationFrame||t.mozCancelAnimationFrame||t.webkitCancelAnimationFrame||function(f){t.clearTimeout(f)};function s(f,h){var m=Object.prototype.toString.call(f),y=m==="[object Array]"||m==="[object NodeList]"||m==="[object HTMLCollection]"||m==="[object Object]"||typeof jQuery<"u"&&f instanceof jQuery||typeof Elements<"u"&&f instanceof Elements,p=0,d=f.length;if(y)for(;p=2.0 are supported."));return}const c=new $B(u,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let f=0;f=0&&l[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}c.setExtensions(o),c.setPlugins(l),c.parse(i,r)}}function AB(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const nt={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_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"};class LB{constructor(e){this.parser=e,this.name=nt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let i=0,r=t.length;i=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o,l)}}class NB{constructor(e){this.parser=e,this.name=nt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,r=i.json,s=r.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],l=r.images[o.source];let u=i.textureLoader;if(l.uri){const c=i.options.manager.getHandler(l.uri);c!==null&&(u=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(e,l,u);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.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 DB{constructor(e){this.name=nt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const r=i.extensions[this.name],s=this.parser.getDependency("buffer",r.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 Promise.all([s,o.ready]).then(function(l){const u=r.byteOffset||0,c=r.byteLength||0,f=r.count,h=r.byteStride,m=new ArrayBuffer(f*h),y=new Uint8Array(l[0],u,c);return o.decodeGltfBuffer(new Uint8Array(m),f,h,y,r.mode,r.filter),m})}else return null}}const ux="glTF",ka=12,dx={JSON:1313821514,BIN:5130562};class BB{constructor(e){this.name=nt.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,ka);if(this.header={magic:Fi.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==ux)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-ka,r=new DataView(e,ka);let s=0;for(;s",t).replace("#include ",i).replace("#include ",r).replace("#include ",s).replace("#include ",o)},Object.defineProperties(this,{specular:{get:function(){return l.specular.value},set:function(u){l.specular.value=u}},specularMap:{get:function(){return l.specularMap.value},set:function(u){l.specularMap.value=u,u?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return l.glossiness.value},set:function(u){l.glossiness.value=u}},glossinessMap:{get:function(){return l.glossinessMap.value},set:function(u){l.glossinessMap.value=u,u?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}}class kB{constructor(){this.name=nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return Sf}extendParams(e,t,i){const r=t.extensions[this.name];e.color=new Ae(1,1,1),e.opacity=1;const s=[];if(Array.isArray(r.diffuseFactor)){const o=r.diffuseFactor;e.color.fromArray(o),e.opacity=o[3]}if(r.diffuseTexture!==void 0&&s.push(i.assignTexture(e,"map",r.diffuseTexture)),e.emissive=new Ae(0,0,0),e.glossiness=r.glossinessFactor!==void 0?r.glossinessFactor:1,e.specular=new Ae(1,1,1),Array.isArray(r.specularFactor)&&e.specular.fromArray(r.specularFactor),r.specularGlossinessTexture!==void 0){const o=r.specularGlossinessTexture;s.push(i.assignTexture(e,"glossinessMap",o)),s.push(i.assignTexture(e,"specularMap",o))}return Promise.all(s)}createMaterial(e){const t=new Sf(e);return t.fog=!0,t.color=e.color,t.map=e.map===void 0?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=e.aoMap===void 0?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,t.bumpMap=e.bumpMap===void 0?null:e.bumpMap,t.bumpScale=1,t.normalMap=e.normalMap===void 0?null:e.normalMap,t.normalMapType=rr,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=e.specularMap===void 0?null:e.specularMap,t.specular=e.specular,t.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=e.envMap===void 0?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}class zB{constructor(){this.name=nt.KHR_MESH_QUANTIZATION}}class Ao extends oi{constructor(e,t,i,r){super(e,t,i,r)}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,s=e*r*3+r;for(let o=0;o!==r;o++)t[o]=i[s+o];return t}}Ao.prototype.beforeStart_=Ao.prototype.copySampleValue_,Ao.prototype.afterEnd_=Ao.prototype.copySampleValue_,Ao.prototype.interpolate_=function(n,e,t,i){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=o*2,u=o*3,c=i-e,f=(t-e)/c,h=f*f,m=h*f,y=n*u,p=y-u,d=-2*m+3*h,b=m-h,v=1-d,g=b-h+f;for(let M=0;M!==o;M++){const _=s[p+M+o],E=s[p+M+l]*c,S=s[y+M+o],w=s[y+M]*c;r[M]=v*_+g*E+d*S+b*w}return r};const Vi={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},za={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},hx={9728:Lt,9729:wt,9984:Qo,9985:kl,9986:ea,9987:Ti},fx={33071:Wt,33648:Os,10497:ir},px={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},_f={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Mr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},UB={CUBICSPLINE:void 0,LINEAR:Vr,STEP:Bs},Tf={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function mx(n,e){return typeof n!="string"||n===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(n)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(n)||/^data:.*,.*$/i.test(n)||/^blob:.*$/i.test(n)?n:e+n)}function GB(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new Kr({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:er})),n.DefaultMaterial}function Ua(n,e,t){for(const i in t.extensions)n[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=t.extensions[i])}function cs(n,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(n.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function HB(n,e,t){let i=!1,r=!1;for(let l=0,u=e.length;l=2&&b.setY(C,S[w*u+1]),u>=3&&b.setZ(C,S[w*u+2]),u>=4&&b.setW(C,S[w*u+3]),u>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return b})}loadTexture(e){const t=this.json,i=this.options,r=t.textures[e],s=t.images[r.source];let o=this.textureLoader;if(s.uri){const l=i.manager.getHandler(s.uri);l!==null&&(o=l)}return this.loadTextureImage(e,s,o)}loadTextureImage(e,t,i){const r=this,s=this.json,o=this.options,l=s.textures[e],u=(t.uri||t.bufferView)+":"+l.sampler;if(this.textureCache[u])return this.textureCache[u];const c=self.URL||self.webkitURL;let f=t.uri||"",h=!1,m=!0;const y=f.search(/\.jpe?g($|\?)/i)>0||f.search(/^data\:image\/jpeg/)===0;if((t.mimeType==="image/jpeg"||y)&&(m=!1),t.bufferView!==void 0)f=r.getDependency("bufferView",t.bufferView).then(function(d){if(t.mimeType==="image/png"){const v=new DataView(d,25,1).getUint8(0,!1);m=v===6||v===4||v===3}h=!0;const b=new Blob([d],{type:t.mimeType});return f=c.createObjectURL(b),f});else if(t.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const p=Promise.resolve(f).then(function(d){return new Promise(function(b,v){let g=b;i.isImageBitmapLoader===!0&&(g=function(M){const _=new Rt(M);_.needsUpdate=!0,b(_)}),i.load(mx(d,o.path),g,void 0,v)})}).then(function(d){h===!0&&c.revokeObjectURL(f),d.flipY=!1,l.name&&(d.name=l.name),m||(d.format=Ci);const v=(s.samplers||{})[l.sampler]||{};return d.magFilter=hx[v.magFilter]||wt,d.minFilter=hx[v.minFilter]||Ti,d.wrapS=fx[v.wrapS]||ir,d.wrapT=fx[v.wrapT]||ir,r.associations.set(d,{type:"textures",index:e}),d}).catch(function(){return console.error("THREE.GLTFLoader: Couldn't load texture",f),null});return this.textureCache[u]=p,p}assignTexture(e,t,i){const r=this;return this.getDependency("texture",i.index).then(function(s){if(i.texCoord!==void 0&&i.texCoord!=0&&!(t==="aoMap"&&i.texCoord==1)&&console.warn("THREE.GLTFLoader: Custom UV set "+i.texCoord+" for texture "+t+" not yet supported."),r.extensions[nt.KHR_TEXTURE_TRANSFORM]){const o=i.extensions!==void 0?i.extensions[nt.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const l=r.associations.get(s);s=r.extensions[nt.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),r.associations.set(s,l)}}e[t]=s})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const r=t.attributes.tangent!==void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0,l=Object.keys(t.morphAttributes).length>0,u=l&&t.morphAttributes.normal!==void 0;if(e.isPoints){const c="PointsMaterial:"+i.uuid;let f=this.cache.get(c);f||(f=new gr,Vt.prototype.copy.call(f,i),f.color.copy(i.color),f.map=i.map,f.sizeAttenuation=!1,this.cache.add(c,f)),i=f}else if(e.isLine){const c="LineBasicMaterial:"+i.uuid;let f=this.cache.get(c);f||(f=new Ut,Vt.prototype.copy.call(f,i),f.color.copy(i.color),this.cache.add(c,f)),i=f}if(r||s||o||l){let c="ClonedMaterial:"+i.uuid+":";i.isGLTFSpecularGlossinessMaterial&&(c+="specular-glossiness:"),r&&(c+="vertex-tangents:"),s&&(c+="vertex-colors:"),o&&(c+="flat-shading:"),l&&(c+="morph-targets:"),u&&(c+="morph-normals:");let f=this.cache.get(c);f||(f=i.clone(),s&&(f.vertexColors=!0),o&&(f.flatShading=!0),l&&(f.morphTargets=!0),u&&(f.morphNormals=!0),r&&(f.vertexTangents=!0,f.normalScale&&(f.normalScale.y*=-1),f.clearcoatNormalScale&&(f.clearcoatNormalScale.y*=-1)),this.cache.add(c,f),this.associations.set(f,this.associations.get(i))),i=f}i.aoMap&&t.attributes.uv2===void 0&&t.attributes.uv!==void 0&&t.setAttribute("uv2",t.attributes.uv),e.material=i}getMaterialType(){return Kr}loadMaterial(e){const t=this,i=this.json,r=this.extensions,s=i.materials[e];let o;const l={},u=s.extensions||{},c=[];if(u[nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){const h=r[nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=h.getMaterialType(),c.push(h.extendParams(l,s,t))}else if(u[nt.KHR_MATERIALS_UNLIT]){const h=r[nt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),c.push(h.extendParams(l,s,t))}else{const h=s.pbrMetallicRoughness||{};if(l.color=new Ae(1,1,1),l.opacity=1,Array.isArray(h.baseColorFactor)){const m=h.baseColorFactor;l.color.fromArray(m),l.opacity=m[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(l,"map",h.baseColorTexture)),l.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,l.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(l,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(l,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(m){return m.getMaterialType&&m.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(m){return m.extendMaterialParams&&m.extendMaterialParams(e,l)})))}s.doubleSided===!0&&(l.side=tr);const f=s.alphaMode||Tf.OPAQUE;return f===Tf.BLEND?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,f===Tf.MASK&&(l.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==mn&&(c.push(t.assignTexture(l,"normalMap",s.normalTexture)),l.normalScale=new Se(1,-1),s.normalTexture.scale!==void 0&&l.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),s.occlusionTexture!==void 0&&o!==mn&&(c.push(t.assignTexture(l,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(l.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==mn&&(l.emissive=new Ae().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==mn&&c.push(t.assignTexture(l,"emissiveMap",s.emissiveTexture)),Promise.all(c).then(function(){let h;return o===Sf?h=r[nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(l):h=new o(l),s.name&&(h.name=s.name),h.map&&(h.map.encoding=Ur),h.emissiveMap&&(h.emissiveMap.encoding=Ur),cs(h,s),t.associations.set(h,{type:"materials",index:e}),s.extensions&&Ua(r,h,s),h})}createUniqueName(e){const t=Qe.sanitizeNodeName(e||"");let i=t;for(let r=1;this.nodeNamesUsed[i];++r)i=t+"_"+r;return this.nodeNamesUsed[i]=!0,i}loadGeometries(e){const t=this,i=this.extensions,r=this.primitiveCache;function s(l){return i[nt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(l,t).then(function(u){return vx(u,l,t)})}const o=[];for(let l=0,u=e.length;l0&&WB(v,s),v.name=t.createUniqueName(s.name||"mesh_"+e),cs(v,s),b.extensions&&Ua(r,v,b),t.assignFinalMaterial(v),h.push(v)}if(h.length===1)return h[0];const m=new ni;for(let y=0,p=h.length;y1?u=new ni:l.length===1?u=l[0]:u=new $e,u!==l[0])for(let c=0,f=l.length;c0},!1)}function u(c,f){for(var h={main:[f]},m={main:[]},y={main:{}};l(h);)for(var p=Object.keys(h),d=0;d(()=>{var t=[(o,l,u)=>{u(1);var c=u(2),f=c.version,h=function(){this.Revision=f,this.defaultMaterialColor=16777215,this.defaultOpacity=1,this.modelPrefix=void 0,this.Geometry=u(3).Geometry,this.Glyph=u(16).Glyph,this.Glyphset=u(18).Glyphset,this.Pointset=u(22).Pointset,this.Label=u(17).Label,this.Lines=u(24).Lines,this.TextureArray=u(25).TextureArray,this.TextureSlides=u(27).TextureSlides,this.Renderer=u(30).Renderer,this.Scene=u(32).Scene,this.GeometryCSG=u(50).GeometryCSG,this.GlyphsetCSG=u(56).GlyphsetCSG,this.Viewport=u(43).Viewport,this.CameraControls=u(43).CameraControls,this.SmoothCameraTransition=u(43).SmoothCameraTransition,this.RayCaster=u(43).RayCaster,this.CameraAutoTumble=u(43).CameraAutoTumble,this.StereoEffect=u(43).StereoEffect,this.loadExternalFile=u(5).loadExternalFile,this.loadExternalFiles=u(5).loadExternalFiles,this.THREE=u(4)};o.exports=new h},o=>{o.exports=JL()},o=>{o.exports=JSON.parse('{"name":"zincjs","version":"1.11.4","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu ","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}')},function(o,l,u){var c=u(4),f=u(5).toBufferGeometry,h=(y,p,d)=>{var b=f(y,d),v=!1;1>d.opacity&&(v=!0);var g;if(b._video===void 0){var M=d.localTimeEnabled||d.localMorphColour;p?(g=p,g.morphTargets=M,g.morphNormals=d.localTimeEnabled):b instanceof c.BufferGeometry&&b.attributes.color===void 0?g=new c.MeshPhongMaterial({color:d.colour,morphTargets:M,morphNormals:d.localTimeEnabled,transparent:v,opacity:d.opacity,side:c.DoubleSide}):g=new c.MeshPhongMaterial({color:d.colour,morphTargets:M,morphNormals:d.localTimeEnabled,vertexColors:c.VertexColors,transparent:v,opacity:d.opacity,side:c.DoubleSide}),d.localMorphColour&&b.morphAttributes.color&&(g.onBeforeCompile=u(9).augmentMorphColor())}else{var _=b._video.createCanvasVideoTexture();g=new c.MeshBasicMaterial({morphTargets:d.localTimeEnabled,color:new c.Color(1,1,1),transparent:v,opacity:d.opacity,map:_,side:c.DoubleSide}),this.videoHandler=b._video}return new c.Mesh(b,g)},m=function(){u(10).ZincObject.call(this),this.videoHandler=void 0,this.isGeometry=!0,this.createMesh=(y,p,d)=>{if(!(this.morph&&this.morph.geometry&&y!=null)){var b=h(y,p,d);this.setMesh(b,d.localTimeEnabled,d.localMorphColour)}},this.calculateUVs=()=>{this.geometry.computeBoundingBox();var y=this.geometry.boundingBox.max,p=this.geometry.boundingBox.min,d=new c.Vector2(0-p.x,0-p.y),b=new c.Vector2(y.x-p.x,y.y-p.y);this.geometry.faceVertexUvs[0]=[];for(var v=0;v{this.morph.material.wireframe=y},this.editVertices=function(y,p){if(y&&y.length){var d=this.getMorph(),b=d.geometry.getAttribute("position");if(!d||0>p)return;var v=3*p;y.forEach(g=>{b.array[v++]=g[0],b.array[v++]=g[1],b.array[v++]=g[2]}),b.needsUpdate=!0,d.geometry.computeBoundingBox(),d.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0}}};m.prototype=Object.create(u(10).ZincObject.prototype),l.Geometry=m},o=>{o.exports=cB},(o,l,u)=>{function c(w){throw new TypeError('"'+w+'" is read-only')}var f=u(4),h=u(6).Geometry,m=u(7).default;function y(w){var T=w,C=u(0).modelPrefix;return C&&(C[C.length-1]!="/"&&c("prefix"),/^(?:[a-z]+:)?\/\//i.test(w)||(T=C+w)),T}function p(w,T){var C=(P,L)=>{try{var A=new URL(P,L).href;if(P&&2>P.split("?").length){var I=L.split("?");I.length===2&&(A=A+"?"+I[1])}return A}catch{console.error("There is an issue creting the url link with: ".concat(P,"."))}};if(!Array.isArray(w))return C(w,T);var R=[];return w.forEach(P=>{R.push(C(P,T))}),R}function d(w,T,C,R,P){var L=w.morphTargetInfluences,A=void 0;w.geometry&&(A=w.geometry.morphAttributes);var I=!1;if(L&&A&&A.position){R.set(0,0,0),P.set(0,0,0);for(var O=0;O{P.readyState==4&&(P.status==200?C(P.responseText,T):R(w))},P.send(null)}function v(w,T,C){function R(O,x){A[x]=O,L++,L==P&&T(A)}for(var P=w.length,L=0,A=[],I=0;I{var C=Math.floor(T/3),R=T%3,P=0;R==0?P=w[C].r:R==1?P=w[C].g:R==2&&(P=w[C].b);var L=new f.Color(P);return[L.r,L.g,L.b]},l.updateMorphColorAttribute=function(w,T){if(T&&w&&w.morphAttributes&&w.morphAttributes.color){var C=w.morphAttributes.color,R=T.morphTargetInfluences,P=R.length;w.deleteAttribute("morphColor0"),w.deleteAttribute("morphColor1");for(var L=0,A=[],I=0;1>L||I{var C;return w instanceof h?(T.localTimeEnabled&&!w.morphNormalsReady&&(w.morphNormals==null||w.morphNormals.length==0)&&w.computeMorphNormals(),C=w.toIndexedBufferGeometry(),T.localMorphColour&&g(w,C)):w instanceof f.BufferGeometry&&(C=w.clone()),C.colorsNeedUpdate=!0,C.computeBoundingBox(),C.computeBoundingSphere(),w._video&&(C._video=w._video),C},l.copyMorphColorsToBufferGeometry=(w,T)=>{if(w&&w.morphColors&&0{if(w&&w.morphColors&&0[]))}for(var G=Math.log10(1/T),K=Math.pow(10,G),D=0;D=Math.pow(2,8)&&(oe=Uint16Array),ae.length>=Math.pow(2,16)&&(oe=Uint32Array);var le=new oe(ae),ae=null;return P===null?ae=new f.BufferAttribute(le,1):(ae=w.getIndex().clone(),ae.setArray(le)),$.setIndex(ae),$};function M(w){if(w.isMeshPhongMaterial){var T=new f.MeshToonMaterial({color:w.color.clone(),morphTargets:w.morphTargets,morphNormals:w.morphNormals,vertexColors:w.vertexColors,transparent:w.transparent,opacity:w.opacity,side:w.side});return w.map&&(T.map=w.map),T}return w}function _(w,T){if(T&&w>=T.length){var C=new f.BufferGeometry,R=new Float32Array(3*w),P=0;return T.forEach(L=>{R[P++]=L[0],R[P++]=L[1],R[P++]=L[2]}),C.setAttribute("position",new f.BufferAttribute(R,3)),C.setDrawRange(0,T.length),C}}function E(){var w=new Image;w.src=u(8);var T=new f.Texture;return T.image=w,T.needsUpdate=!0,T}function S(w,T,C,R,P,L){var A=new m(w,T,C,R,P,L);return A.fontFace=R,A.fontSize=P,A.fontWeight=L,A.material.map.generateMipmaps=!1,A.material.map.anisotropy=4,A.material.sizeAttenuation=!1,A.material.alphaTest=.5,A.material.transparent=!0,A.material.depthWrite=!1,A.material.depthTest=!1,A.center.set(.5,-1.2),A.renderOrder=1e4,A}l.getBoundingBox=d,l.createNewURL=p,l.createBufferGeometry=_,l.getCircularTexture=E,l.resolveURL=y,l.loadExternalFile=b,l.loadExternalFiles=v,l.PhongToToon=M,l.createNewSpriteText=S},(o,l,u)=>{u.r(l),u.d(l,{Face3:()=>b,Geometry:()=>p});var c=u(4),f=new c.Matrix4,h=new c.Object3D,m=new c.Vector3,y=new c.Vector3;function p(){this.uuid=c.MathUtils.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.normals=[],this.uvs=[],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1,this.morphNormalsReady=!1}p.prototype=Object.assign(Object.create(c.EventDispatcher.prototype),{constructor:p,isGeometry:!0,applyMatrix4:function(g){for(var M,_=new c.Matrix3().getNormalMatrix(g),E=0,S=this.vertices.length;Ex;x++)if(O[x]===O[(x+1)%3]){L.push(A);break}}for(var N,B=L.length-1;0<=B;B--){N=L[B],this.faces.splice(N,1);for(var D=0,V=this.faceVertexUvs.length;D{o.exports=TB},o=>{o.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg=="},(o,l)=>{l.augmentMorphColor=function(){return function(u){u.vertexShader=u.vertexShader.replace("#include ",["varying vec3 vColor;","attribute vec3 morphColor0;","attribute vec3 morphColor1;"].join(` `)),u.vertexShader=u.vertexShader.replace("#include ",["vColor.xyz = color.xyz;","#ifdef USE_MORPHTARGETS","vColor = morphColor0 * morphTargetInfluences[ 0 ];","vColor += morphColor1 * morphTargetInfluences[ 1 ];","#endif"].join(` `))}}},(o,l,u)=>{var c=u(4),f=u(5).createBufferGeometry,h=u(5).resolveURL,m=0,y=function(){return"pr"+m++},p=function(){this.isZincObject=!0,this.geometry=void 0,this.morph=void 0,this.group=new c.Group,this._lod=new(u(11)).LOD(this),this.groupName=void 0,this.timeEnabled=!1,this.morphColour=!1,this.inbuildTime=0,this.mixer=void 0,this.animationGroup=void 0,this.duration=6e3,this.clipAction=void 0,this.userData={},this.videoHandler=void 0,this.marker=void 0,this.markerNumber=void 0,this.markerUpdateRequired=!0,this.closestVertexIndex=-1,this.boundingBoxUpdateRequired=!0,this.cachedBoundingBox=new c.Box3,this.anatomicalId=void 0,this.region=void 0,this.animationClip=void 0,this.markerMode="inherited",this.uuid=y(),this._v1=new c.Vector3,this._v2=new c.Vector3,this._b1=new c.Box3,this.center=new c.Vector3,this.radius=0,this.visible=!0,this.drawRange=-1};p.prototype.setDuration=function(d){this.duration=d,this.clipAction&&this.clipAction.setDuration(this.duration)},p.prototype.getDuration=function(){return this.duration},p.prototype.setRegion=function(d){this.region=d},p.prototype.getRegion=function(){return this.region},p.prototype.getMorph=function(){var d=this._lod.getCurrentMorph();return d||this.morph},p.prototype.getGroup=function(){return this.group},p.prototype.setMorph=function(d){this.morph=d,this.group.add(this.morph);var b=this._lod.calculateDistance("far");this._lod.addLevel(d,b),this._lod.setMaterial(d.material)},p.prototype.checkTransparentMesh=function(){},p.prototype.setMesh=function(d,b,v){this.animationGroup=new c.AnimationObjectGroup(d),this.mixer=new c.AnimationMixer(this.animationGroup);var g=d.geometry;if(this.geometry=d.geometry,this.clipAction=void 0,g&&g.morphAttributes){var M=g.morphAttributes.position;M||(M=g.morphAttributes.color?g.morphAttributes.color:g.morphAttributes.normal),M&&(this.animationClip=c.AnimationClip.CreateClipsFromMorphTargetSequences(M,10,!0),this.animationClip&&this.animationClip[0]!=null&&(this.clipAction=this.mixer.clipAction(this.animationClip[0]).setDuration(this.duration),this.clipAction.loop=c.loopOnce,this.clipAction.clampWhenFinished=!0,this.clipAction.play()))}this.timeEnabled=b,this.morphColour=v,d.userData=this,d.matrixAutoUpdate=!1,this.setMorph(d),this.checkTransparentMesh(),this.timeEnabled?this.setFrustumCulled(!1):this.morphColour&&(g.setAttribute("morphTarget0",g.getAttribute("position")),g.setAttribute("morphTarget1",g.getAttribute("position"))),this.boundingBoxUpdateRequired=!0},p.prototype.setName=function(d){this.groupName=d,this._lod.setName(d)},p.prototype.getCurrentTime=function(){if(this.clipAction){var d=this.clipAction.time/this.clipAction._clip.duration;return this.duration*d}return this.inbuildTime},p.prototype.setMorphTime=function(d){var b=!1;if(this.clipAction){var v=d/this.duration,g=this.clipAction._clip.duration,M=v*g;M!=this.clipAction.time&&(this.clipAction.time=M,b=!0),b&&this.isTimeVarying()&&this.mixer.update(0)}else{var _=d;_=d>this.duration?this.duration:0>d?0:d,_!=this.inbuildTime&&(this.inbuildTime=_,b=!0)}b&&(this.boundingBoxUpdateRequired=!0,this._lod.updateMorphColorAttribute(!0),this.timeEnabled&&(this.markerUpdateRequired=!0))},p.prototype.isTimeVarying=function(){return!!(this.timeEnabled||this.morphColour)},p.prototype.getVisibility=function(){return this.visible},p.prototype.setVisibility=function(d){d!==this.visible&&(this.visible=d,this.group.visible=d,this.region&&(this.region.pickableUpdateRequired=!0))},p.prototype.setAlpha=function(d){var b=this._lod._material,v=!1;1>d&&(v=!0),b.opacity=d,b.transparent=v,this.checkTransparentMesh()},p.prototype.setFrustumCulled=function(d){this._lod.setFrustumCulled(d)},p.prototype.setVertexColors=function(d){this._lod.setVertexColors(d)},p.prototype.getColour=function(){return this._lod._material?this._lod._material.color:void 0},p.prototype.setColour=function(d){this._lod.setColour(d)},p.prototype.getColourHex=function(){return!this.morphColour&&this._lod._material&&this._lod._material.color?this._lod._material.color.getHexString():void 0},p.prototype.setColourHex=function(d){this._lod._material.color.setHex(d),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.color.setHex(d)},p.prototype.setEmissiveRGB=function(d){this._lod._material&&this._lod._material.emissive&&this._lod._material.emissive.setRGB(...d),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.emissive.setRGB(...d)},p.prototype.setMaterial=function(d){this._lod.setMaterial(d)},p.prototype.getClosestVertexIndex=function(){var d=-1,b=this.getMorph();if(b&&b.geoemtry){var v=b.geometry.attributes.position;if(this._b1.setFromBufferAttribute(v),this._b1.getCenter(this._v1),v)for(var g=-1,M=0,_=0;_M&&(g=M,d=_)}return d},p.prototype.getClosestVertex=function(d){var b=new c.Vector3;this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex());var v=this.getMorph();if(v&&v.geometry&&0<=this.closestVertexIndex){var g=v.morphTargetInfluences,M=v.geometry.morphAttributes;if(g&&M&&M.position){for(var _=!1,E=0;Ev.x||1v.y)&&(b=!1),d.getZincCameraControls().getRelativeCoordsFromNDC(v.x,v.y,v),{position:v,inView:b}}},p.prototype.setMarkerMode=function(d,b){d!==this.markerMode&&(this.markerMode=d==="on"||d==="off"?d:"inherited",this.region&&(this.region.pickableUpdateRequired=!0)),b&&(this.markerNumber=b.number,this.markerImgURL=b.imgURL)},p.prototype.render=function(d,b,v,g){if(this.visible&&!(this.timeEnabled&&b)&&this._lod.update(v,this.center),b==!0){if(this.clipAction&&this.isTimeVarying())this.mixer.update(d);else{var M=this.inbuildTime+d;M>this.duration&&(M-=this.duration),this.inbuildTime=M}this.visible&&d!=0&&(this.boundingBoxUpdateRequired=!0,this.morphColour==1&&this._lod.updateMorphColorAttribute(!0))}this.updateMarker(b,g)},p.prototype.addLOD=function(d,b,v,g,M){this._lod.addLevelFromURL(d,b,v,g,M)},p.prototype.addVertices=function(d){var b=this.getMorph(),v=void 0;if(!b)v=f(500,d),this.drawRange=d.length;else if(-1{g.setXYZ(this.drawRange,M[0],M[1],M[2]),++this.drawRange}),g.needsUpdate=!0,b.geometry.setDrawRange(0,this.drawRange),b.geometry.computeBoundingBox(),b.geometry.computeBoundingSphere(),v=b.geoemtry,this.boundingBoxUpdateRequired=!0}return v},p.prototype.setPosition=function(d,b,v){var g=this.getGroup();g&&(g.position.set(d,b,v),g.updateMatrix(),this.boundingBoxUpdateRequired=!0)},p.prototype.loadAdditionalSources=function(d){d.load(h(filename),meshloader(region,colour,opacity,localTimeEnabled,localMorphColour,void 0,void 0,void 0,void 0,finishCallback),this.onProgress(filename),this.onError(finishCallback))},p.prototype.setScaleAll=function(d){var b=this.getGroup();b&&(b.scale.set(d,d,d),b.updateMatrix(),this.boundingBoxUpdateRequired=!0)},l.ZincObject=p},(o,l,u)=>{var c=u(4),f=u(5).updateMorphColorAttribute,h=u(5).toBufferGeometry,m=function(y){this.levels=[],this._currentLevel=0,this._renderOrder=1,this._material=void 0,this._secondaryMaterial=void 0,this._loader=void 0,this._parent=y,this.addLevel=(d,b)=>{if(d){var v,g=Math.abs(b);for(v=0;v{if(d){for(var v=Math.abs(b),g=0;g{this._loader=d;var _,E=this.calculateDistance(b);for(_=0;_{var b=this.levels[d];return b.morph||b.loaded||b.loading||(b.loading=!0,this._loader.load(b.url,this.lodLoader(b.distance),void 0,void 0,{index:b.index})),b.morph===void 0},this.calculateDistance=function(d){this._parent.getBoundingBox();var b=this._parent.radius,v=0;return d==="far"?v=4.5*b:d==="medium"?v=2.5*b:d=="close"&&(v=0),v},this.containsLevels=()=>!!(this.levels&&1{var d=this.levels[this._currentLevel];this._material&&(this._material.transparent?(!this._secondaryMaterial&&(this._secondaryMaterial=this._material.clone(),this._secondaryMaterial.side=c.FrontSide),this._secondaryMaterial.opacity=this._material.opacity,this._secondaryMaterial.emissive&&this._secondaryMaterial.emissive.copy(this._material.emissive),this._secondaryMaterial.needsUpdate=!0,!d.secondaryMesh&&(d.secondaryMesh=new c.Mesh(d.morph.geometry,this._secondaryMaterial),d.secondaryMesh.renderOrder=d.morph.renderOrder+1,d.secondaryMesh.userData=d.morph.userData,d.secondaryMesh.name=d.morph.name),this._material.side=c.BackSide,this._material.needsUpdate=!0,!d.secondaryMesh.parent&&(d.morph.add(d.secondaryMesh),this._parent.animationGroup&&this._parent.animationGroup.add(d.secondaryMesh))):(d.secondaryMesh&&(d.morph.remove(d.secondaryMesh),this._parent.animationGroup&&(this._parent.animationGroup.uncache(d.secondaryMesh),this._parent.animationGroup.remove(d.secondaryMesh))),this._material.side=c.DoubleSide,this._material.needsUpdate=!0))},this.dispose=()=>{this.levels.forEach(d=>{d.morph&&d.morph.geometry&&d.morph.geometry.dispose()}),this._material&&this._material.dispose(),this._secondaryMaterial&&this._secondaryMaterial.dispose()},this.getCurrentLevel=()=>this._currentLevel,this.getCurrentMorph=()=>{var d=this.levels[this._currentLevel];return d&&d.morph?d.morph:this._parent.morph},this.lodLoader=function(d){return b=>{var v=this._material,g={localTimeEnabled:this._parent.timeEnabled,localMorphColour:this._parent.morphColour},M=h(b,g),_=void 0;this._parent.isGeometry?_=new c.Mesh(M,v):this._parent.isLines&&(_=new(u(12)).LineSegments(M,v)),_.userData=this._parent,_.renderOrder=this._renderOrder,b.dispose(),this.levelLoaded(_,d)}},this.updateMorphColorAttribute=d=>{if(this._material&&(this._material.vertexColors==c.VertexColors||this._material.vertexColors==!0))if(d){var b=this.getCurrentMorph();f(b.geometry,b)}else this.levels.forEach(v=>{v.morph&&v.morph.geometry&&f(v.morph.geometry,v.morph)})},this.setColour=d=>{this._material.color=d,this._secondaryMaterial&&(this._secondaryMaterial.color=d),p()},this.setFrustumCulled=d=>{this.levels.forEach(b=>{b.morph&&(b.morph.frustumCulled=d),b.secondaryMesh&&(b.secondaryMesh.frustumCulled=d)})},this.setMaterial=d=>{d&&(!this._material||this._material.id!==d.id)&&(this._material=d,this._secondaryMaterial&&this._secondaryMaterial.dispose(),this._secondaryMaterial=d.clone(),this._secondaryMaterial.side=c.FrontSide,this._secondaryMaterial.transparent=!0,this.levels.forEach(b=>{b.morph&&(b.morph.material=this._material,b.morph.geometry&&(b.morph.geometry.colorsNeedUpdate=!0)),b.secondaryMesh&&(b.secondaryMesh.material=this._secondaryMaterial)}))},this.setName=d=>{this.levels.forEach(b=>{b.morph&&(b.morph.name=d),b.secondaryMesh&&(b.secondaryMesh.name=d)})},this.setRenderOrder=d=>{this._renderOrder=d,this.levels.forEach(b=>{b.morph&&(b.morph.renderOrder=d),b.secondaryMesh&&(b.secondaryMesh.renderOrder=d)})},this.setVertexColors=d=>{this._material.vertexColors=d,p(),this._secondaryMaterial&&(this._secondaryMaterial.vertexColors=d)},this.update=(d,b)=>{var v=this.levels;if(1=v[g].distance;g++)v[g].morph?(-1{this.levels.forEach(v=>{v.morph&&(b?v.morph.add(d):v.morph.remove(d))})};var p=()=>{this.levels.forEach(d=>{d.morph&&d.morph.geometry&&(d.morph.geometry.colorsNeedUpdate=!0)})}};l.LOD=m},(o,l,u)=>{u.r(l),u.d(l,{LineSegments:()=>y});var c=u(13),f=u(4),h=new f.Vector3,m=new f.Vector3;class y extends c.Line{constructor(d,b){super(d,b),this.type="LineSegments"}computeLineDistances(){var d=this.geometry;if(!d.isBufferGeometry)d.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(d.index===null){for(var b=d.attributes.position,v=[],g=0,M=b.count;g{u.r(l),u.d(l,{Line:()=>M});var c=u(4),f=new c.Vector3,h=new c.Vector3,m=new c.Matrix4,y=new c.Ray,p=new c.Sphere,d=new c.Vector3,b=new c.Vector3,v=new c.Vector3,g=new c.Vector3;class M extends c.Object3D{constructor(){var S=0I)){B.applyMatrix4(this.matrixWorld);var Q=S.ray.origin.distanceTo(B);QS.far||w.push({distance:Q,point:N.clone().applyMatrix4(this.matrixWorld),index:j,face:null,faceIndex:null,object:this})}}else for(var ee=Math.max(0,P.start),ne=Math.min(G.count,P.start+P.count),Y=ee;YI)){B.applyMatrix4(this.matrixWorld);var F=S.ray.origin.distanceTo(B);FS.far||w.push({distance:F,point:N.clone().applyMatrix4(this.matrixWorld),index:Y,face:null,faceIndex:null,object:this})}}}else T.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var S=this.geometry;if(S.isBufferGeometry){var w=S.morphAttributes,T=Object.keys(w);if(0{var c=u(4),f=new Image(128,128);f.src=u(15);var h=new c.Texture;h.image=f,h.needsUpdate=!0;var m=[.02,.03,1],y=new c.SpriteMaterial({map:h,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),p=u(5).createNewSpriteText,d=function(b){u(10).ZincObject.call(this),this.texture=h;var v=void 0,g=void 0,M=void 0,_=void 0,E=void 0,S=!0;this.morph=new c.Group,this.group=this.morph,this.parent=b,this.isMarker=!0;var w=!1;this.ndc=new c.Vector3;var T=void 0,C=void 0,R=()=>{v=new c.Sprite(y),v.center.set(.5,0),this.morph.add(v),this.morph.position.set(0,0,0),this.morph.renderOrder=1e4,v.scale.set(m[0],m[1],m[2]),v.userData=this};this.updateVisual=(P,L)=>{var A=1,I=0;P!==L&&(I=1-(this.ndc.z-P)/(L-P),A=.6+.4*I),this.setSpriteSize(A)},this.updateNDC=P=>(this.ndc.copy(this.morph.position),this.ndc.project(P),this.ndc.z=Math.min(Math.max(this.ndc.z,0),1),this.ndc),this.setPosition=(P,L,A)=>{this.morph.position.set(P,L,A)},this.setSpriteSize=P=>{v.scale.set(.015,.02,1),v.scale.multiplyScalar(P)},this.setUserSprite=()=>{_&&(this.morph.add(_),S&&(this.morph.remove(v),C&&this.morph.remove(C),S=!1))},this.setImageForUserSprite=(P,L)=>{_&&(this.morph.remove(_),_=void 0),g&&g.dispose(),M&&M.dispose(),g=new c.Texture,g.image=P,g.needsUpdate=!0,M=new c.SpriteMaterial({map:g,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),L||(L=[.05,.05,1]),_=new c.Sprite(M),_.center.set(.5,0),_.scale.set(L[0],L[1],L[2]),_.userData=this,this.setUserSprite()},this.setDefaultSprite=()=>{S||(S=!0,this.morph.add(v),_&&this.morph.remove(_),C&&this.morph.add(C))},this.loadUserSprite=(P,L)=>{if(P)if(P!==E){E=P;var A=new Image(128,128);A.crossOrigin="anonymous",A.onload=()=>{this.setImageForUserSprite(A,L)},A.src=P}else this.setUserSprite()},this.dispose=()=>{this.morph&&this.morph.clear(),v&&(v.clear(),v=void 0),C&&(C.material.map.dispose(),C.material.dispose(),C=void 0)},this.isEnabled=()=>w,this.setNumber=P=>{(!P||T!=P)&&C&&(this.morph.remove(C),C.material.map.dispose(),C.material.dispose(),C=void 0),!C&&P&&(C=p(P,.012,"black","Asap",120,700),this.morph.add(C)),T=P},this.getNumber=()=>T||1,this.setVisibility=function(P){P!==this.visible&&(this.visible=P,this.group.visible=P,this.parent.region&&(this.parent.region.pickableUpdateRequired=!0))},this.enable=()=>{w=!0,this.morph.visible=!0,this.visible=!0},this.disable=()=>{w=!1,this.morph.visible=!1,this.visible=!1},R()};d.prototype=Object.create(u(10).ZincObject.prototype),l.Marker=d},o=>{o.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgdmlld0JveD0iMCAwIDM2NSA1NjAiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4NCjxkZWZzPg0KPC9kZWZzPg0KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCAwKSIgaWQ9IjgwOGVkMjgzLTI1MjQtNDQwZi04OGFlLTNiZGI0N2JiNTc0OSIgID4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4NCjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItMTgyLjUiIHk9Ii0yODAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIC8+DQo8L2c+DQo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+DQo8ZyBzdHlsZT0iIiAgID4NCjwvZz4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCA5Ny41KSIgID4NCjxnIHN0eWxlPSIiICAgPg0KPC9nPg0KPC9nPg0KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMC45OSAwIDAgMC45OSAxODIuNSAyODApIiAgPg0KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii01NDAiIHk9Ii01NDAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjEwODAiIGhlaWdodD0iMTA4MCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHBhdGggc3R5bGU9InN0cm9rZTogcmdiKDAsMCwwKTsgc3Ryb2tlLXdpZHRoOiAwOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMCw4OSwxMTYpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB0cmFuc2Zvcm09IiB0cmFuc2xhdGUoLTE4Mi45LCAtMjc5Ljg1KSIgZD0iTSAxODIuOSA1NTEuNyBDIDE4Mi45IDU1MS44MDAwMDAwMDAwMDAxIDE4My4xIDU1MiAxODMuMSA1NTIgQyAxODMuMSA1NTIgMzU4LjMgMjgzIDM1OC4zIDE5NC42IEMgMzU4LjMgNjQuNSAyNjkuNSA3LjkwMDAwMDAwMDAwMDAwNiAxODIuOSA3LjY5OTk5OTk5OTk5OTk4OSBDIDk2LjMgNy45IDcuNSA2NC41IDcuNSAxOTQuNiBDIDcuNSAyODMgMTgyLjggNTUyIDE4Mi44IDU1MiBDIDE4Mi44IDU1MiAxODIuOSA1NTEuNyAxODIuOSA1NTEuNyB6IE0gMTIyLjIgMTg3LjIgQyAxMjIuMiAxNTMuNiAxNDkuNCAxMjYuMzk5OTk5OTk5OTk5OTkgMTgzIDEyNi4zOTk5OTk5OTk5OTk5OSBDIDIxNi42IDEyNi4zOTk5OTk5OTk5OTk5OSAyNDMuOCAxNTMuNiAyNDMuOCAxODcuMiBDIDI0My44IDIyMC43OTk5OTk5OTk5OTk5OCAyMTYuNSAyNDggMTgyLjkgMjQ4IEMgMTQ5LjQgMjQ4IDEyMi4yIDIyMC44IDEyMi4yIDE4Ny4yIHoiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPg0KPGNpcmNsZSBzdHlsZT0ic3Ryb2tlOiByZ2IoMCwwLDApOyBzdHJva2Utd2lkdGg6IDA7IHN0cm9rZS1kYXNoYXJyYXk6IG5vbmU7IHN0cm9rZS1saW5lY2FwOiBidXR0OyBzdHJva2UtZGFzaG9mZnNldDogMDsgc3Ryb2tlLWxpbmVqb2luOiBtaXRlcjsgc3Ryb2tlLW1pdGVybGltaXQ6IDQ7IGZpbGw6IHJnYigyNTUsMjU1LDI1NSk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIGN4PSIwIiBjeT0iMCIgcj0iMzUiIC8+DQo8L2c+DQo8L2c+DQo8L2c+DQo8L3N2Zz4="},(o,l,u)=>{var c=u(4),f=function(h,m,y,p){u(10).ZincObject.call(this);var d;m&&(d=m.clone(),d.vertexColors=c.FaceColors),this.id=y;var b=void 0,v=void 0;this.isGlyph=!0,this.fromMesh=g=>!!(g&&g.isMesh)&&(this.morph=g.clone(),this.morph.userData=this,this.group.add(this.morph),!0),h&&d&&this.fromMesh(new c.Mesh(h,d)),this.getGlyphset=function(){return p},this.setLabel=g=>{g&&(typeof g=="string"||g instanceof String)&&(v=g,this.morph&&(this.morph.name=g)),b&&this.showLabel()},this.showLabel=g=>{if(b&&(position=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0),v&&(typeof v=="string"||v instanceof String)){var M=[0,0,0];b=new(u(17)).Label(v,g),b.setPosition(M[0],M[1],M[2]),this.group.add(b.getSprite())}},this.getLabel=()=>v,this.getMesh=()=>this.morph,this.setTransformation=(g,M,_,E)=>{this.morph&&(this.morph.matrix.elements[0]=M[0],this.morph.matrix.elements[1]=M[1],this.morph.matrix.elements[2]=M[2],this.morph.matrix.elements[3]=0,this.morph.matrix.elements[4]=_[0],this.morph.matrix.elements[5]=_[1],this.morph.matrix.elements[6]=_[2],this.morph.matrix.elements[7]=0,this.morph.matrix.elements[8]=E[0],this.morph.matrix.elements[9]=E[1],this.morph.matrix.elements[10]=E[2],this.morph.matrix.elements[11]=0,this.morph.matrix.elements[12]=g[0],this.morph.matrix.elements[13]=g[1],this.morph.matrix.elements[14]=g[2],this.morph.matrix.elements[15]=1,this.morph.matrixAutoUpdate=!1),b&&b.setPosition(g[0],g[1],g[2])},this.setColour=g=>{b&&b.setColour(g),this.secondaryMesh&&this.secondaryMesh.material&&(this.secondaryMesh.material.color=colour),this.geometry.colorsNeedUpdate=!0},this.dispose=()=>{this.material&&this.material.dispose(),this.morph=void 0}};f.prototype=Object.create(u(10).ZincObject.prototype),l.Glyph=f},(o,l,u)=>{var c=u(7).default;l.Label=function(f,h){var m=f,y=void 0;y=h?new c(m,.015,h.getStyle()):new c(m,.015),y.fontFace="Asap",y.fontWeight=700,y.material.map.generateMipmaps=!1,y.material.sizeAttenuation=!1,y.center.x=-.05,y.center.y=0,this.getPosition=()=>y?[y.position.x,y.position.y,y.position.z]:[0,0,0],this.setPosition=(p,d,b)=>{y&&y.position.set(p,d,b)},this.setColour=p=>{y.color=p.getStyle()},this.setScale=p=>{y&&0{y.dispose()},this.getSprite=()=>y,this.getString=()=>m}},(o,l,u)=>{function c(y){throw new TypeError('"'+y+'" is read-only')}var f=u(4),h=u(19).JSONLoader,m=function(){u(10).ZincObject.call(this);var y=[],p=void 0,d=void 0,b=void 0,v=void 0,g=void 0,M=void 0,_=void 0,E=0,S=0,w=[0,0,0],T=[0,0,0],C=[0,0,0],R="NONE";this.ready=!1;var P=!1,L=!1;this.isGlyphset=!0;for(var A=new f.Matrix4,I=new f.Color,O=new f.Color,x=new f.Box3,N=new f.Box3,B=new f.Box3,D=[],V=[],z=[],G=[],K=[],ie=[],j=[],H=[],W=0;8>W;W++)D[W]=new f.Vector3;this.load=(F,$,J,k,U)=>{p=F.axis1,d=F.axis2,b=F.axis3,v=F.positions,g=F.scale,M=F.colors,_=F.label,P=F.metadata.MorphColours,L=F.metadata.MorphVertices,E=F.metadata.number_of_time_steps,R=F.metadata.repeat_mode,S=F.metadata.number_of_vertices,R=="AXES_2D"||R=="MIRROR"?S*=2:R=="AXES_3D"&&(S*=3),w=F.metadata.base_size,T=F.metadata.offset,C=F.metadata.scale_factors;var oe=new h;this.geometry=new f.BufferGeometry;var le=new f.InstancedMesh(this.geometry,void 0,S);if(this.setMorph(le),k){var ae=oe.parse($);te(J,U)(ae.geometry,ae.materials),ae.geometry.dispose()}else oe.crossOrigin="Anonymous",oe.load($,te(J,U))};var q=(F,$,J,k,U,oe)=>{if(R=="NONE"||R=="MIRROR"){for(var le,ae=[0,0,0],fe=[0,0,0],ge=[0,0,0],we=[0,0,0],ue=[0,0,0],ye=[0,0,0],se=[0,0,0],be=[0,0,0],he=[0,0,0],me=0;3>me;me++)le=0>U[me]?-1:1,ae[me]=le*w[me]+U[me]*C[me];for(var me=0;3>me;me++)fe[me]=$[me]*ae[0],ge[me]=J[me]*ae[1],we[me]=k[me]*ae[2],ue[me]=F[me]+T[0]*fe[me]+T[1]*ge[me]+T[2]*we[me],R=="MIRROR"&&(ye[me]=-fe[me],se[me]=-ge[me],be[me]=-we[me],he[me]=ue[me],0>U[0]&&(ue[me]-=fe[me],he[me]-=ye[me]));0>we[0]*(fe[1]*ge[2]-fe[2]*ge[1])+we[1]*(fe[2]*ge[0]-fe[0]*ge[2])+we[2]*(fe[0]*ge[1]-fe[1]*ge[0])&&(we[0]=-we[0],we[1]=-we[1],we[2]=-we[2]),oe[0]=[ue,fe,ge,we],R=="MIRROR"&&(0>be[0]*(ye[1]*se[2]-ye[2]*se[1])+be[1]*(ye[2]*se[0]-ye[0]*se[2])+be[2]*(ye[0]*se[1]-ye[1]*se[0])&&(be[0]=-be[0],be[1]=-be[1],be[2]=-be[2]),oe[1]=[he,ye,se,be])}else if(R=="AXES_2D"||R=="AXES_3D"){for(var le,Te=[0,0,0],He=[0,0,0],me=0;3>me;me++)le=0>U[me]?-1:1,Te[me]=le*w[0]+U[me]*C[0];for(var me=0;3>me;me++)He[me]=F[me]+T[0]*Te[0]*$[me]+T[1]*Te[1]*J[me]+T[2]*Te[2]*k[me];for(var tt=glyph_repeat_mode=="AXES_2D"?2:3,Re=0;Re{var oe=1;R=="AXES_2D"||R=="MIRROR"?oe=2:R=="AXES_3D"&&(oe=3);var le=F.length/3,ae=0;H.length=oe;for(var fe=0;fe{var $=1;R=="AXES_2D"||R=="MIRROR"?$=2:R=="AXES_3D"&&($=3);for(var J,k=F.length,U=0,oe=0;oe{var F=V,$=z,J=G,k=K,U=ie,oe=j,le=this.inbuildTime/this.duration*(E-1),ae=Math.floor(le),fe=1-(le-ae),ge=Math.ceil(le);if(L){var we=v[ae.toString()],ue=v[ge.toString()],ye=p[ae.toString()],se=p[ge.toString()],be=d[ae.toString()],he=d[ge.toString()],me=b[ae.toString()],Te=b[ge.toString()],He=g[ae.toString()],tt=g[ge.toString()];V.length=we.length,z.length=we.length,G.length=we.length,K.length=we.length,ie.length=we.length;for(var Re=0;Re{for(var F=0;F{if(_!=null&&F)for(var $,J=0;J{F.isGlyph&&y.push(F),this.ready=!0,this.boundingBoxUpdateRequired=!0},this.addMeshAsGlyph=(F,$)=>{if(F.isMesh){var J=new(u(16)).Glyph(void 0,void 0,$,this);return J.fromMesh(F),y.push(J),this.morph.add(J.getGroup()),this.ready=!0,this.boundingBoxUpdateRequired=!0,J}},this.forEachGlyph=F=>{for(var $=0;$(J,k)=>{var U=J.toBufferGeometry();this.geometry.copy(U),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox(),U.dispose(),k&&k[0]&&(this.morph.material=k[0]),Y($),this.morph.name=this.groupName,this.morph.userData=this,this.setMorph(this.morph),J.dispose(),F!=null&&typeof F=="function"&&F(this)};this.getClosestVertexIndex=function(){var F=-1;if(this.morph&&this.ready){this.getBoundingBox().getCenter(this._v1);for(var $,J=v[0],k=J.length/3,U=-1,oe=0,le=0;leoe)&&(U=oe,F=le)}return F},this.getClosestVertex=function(){if(this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex()),0<=this.closestVertexIndex&&this.morph){var F=new f.Vector3;return this.morph.getMatrixAt(this.closestVertexIndex,A),F.setFromMatrixPosition(A),F}},this.getBoundingBox=()=>{if(this.morph&&this.ready&&this.morph.visible){if(this.boundingBoxUpdateRequired){x.setFromBufferAttribute(this.morph.geometry.attributes.position);for(var F=0;F{this.inbuildTime=F>this.duration?this.duration:0>F?0:F,(P||L)&&(ne(),L&&(this.markerUpdateRequired=!0))},this.isTimeVarying=()=>!!((this.ready===!1||0this.inbuildTime,this.dispose=()=>{for(var F=y.length-1;0<=F;F--)y[F].dispose();this.geometry&&this.geometry.dispose(),this.morph&&this.morph.material.dispose(),p=void 0,d=void 0,b=void 0,v=void 0,g=void 0,M=void 0,this.ready=!1,this.groupName=void 0},this.render=(F,$,J)=>{if($==!0){var k=this.inbuildTime+F;k>this.duration&&(k-=this.duration),this.inbuildTime=k,(P||L)&&ne()}this.updateMarker($,J)}};m.prototype=Object.create(u(10).ZincObject.prototype),l.Glyphset=m},(o,l,u)=>{u.r(l),u.d(l,{JSONLoader:()=>S});var c=u(4),f=u(20).Loader,h=c.LoaderUtils,m=c.AnimationClip,y=c.Vector3,p=c.Vector4,d=c.Color,b=c.Vector2,v=u(6).Face3,g=u(6).Geometry,M=c.FileLoader,_=c.DefaultLoadingManager,E=u(21).VideoHandler;function S(w){typeof w=="boolean"&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),w=void 0),this.manager=w===void 0?_:w,this.withCredentials=!1,this.paramsString=""}Object.assign(S.prototype,{load:function(T,C,R,P){var L=this,A=this.texturePath&&typeof this.texturePath=="string"?this.texturePath:h.extractUrlBase(T),I=new M(this.manager);T.split("?"),this.paramsString=T.length===2?paramsStrings[1]:"",I.setWithCredentials(this.withCredentials),I.load(T,function(O){var x=JSON.parse(O),N=x.metadata;if(N!==void 0){var B=N.type;if(B!==void 0&&B.toLowerCase()==="object")return void console.error("THREE.JSONLoader: "+T+" should be loaded with THREE.ObjectLoader instead.")}if(L&&L.parse){var D=L.parse(x,A);C(D.geometry,D.materials)}},R,P)},setTexturePath:function(T){this.texturePath=T},parse:function(){function w(P,L){function A(be,he){return be&1<O;O++)z=ae[N++],oe=k[2*z],le=k[2*z+1],U=new b(oe,le),O!==2&&L.faceVertexUvs[I][x].push(U),O!==0&&L.faceVertexUvs[I][x+1].push(U);if(W&&(V=3*ae[N++],te.normal.set(ge[V++],ge[V++],ge[V]),F.normal.copy(te.normal)),q)for(I=0;4>I;I++)V=3*ae[N++],J=new y(ge[V++],ge[V++],ge[V]),I!==2&&te.vertexNormals.push(J),I!==0&&F.vertexNormals.push(J);if(Q&&(D=ae[N++],$=we[D],te.color.setHex($),F.color.setHex($)),ee)for(I=0;4>I;I++)D=ae[N++],$=we[D],I!==2&&te.vertexColors.push(new d($)),I!==0&&F.vertexColors.push(new d($));L.faces.push(te),L.faces.push(F)}else{if(Y=new v,Y.a=ae[N++],Y.b=ae[N++],Y.c=ae[N++],j&&(G=ae[N++],Y.materialIndex=G),x=L.faces.length,H)for(I=0;IO;O++)z=ae[N++],oe=k[2*z],le=k[2*z+1],U=new b(oe,le),L.faceVertexUvs[I][x].push(U);if(W&&(V=3*ae[N++],Y.normal.set(ge[V++],ge[V++],ge[V])),q)for(I=0;3>I;I++)V=3*ae[N++],J=new y(ge[V++],ge[V++],ge[V]),Y.vertexNormals.push(J);if(Q&&(D=ae[N++],Y.color.setHex(we[D])),ee)for(I=0;3>I;I++)D=ae[N++],Y.vertexColors.push(new d(we[D]));L.faces.push(Y)}}function T(P,L){var A=P.influencesPerVertex===void 0?2:P.influencesPerVertex;if(P.skinWeights)for(var I=0,O=P.skinWeights.length;I{u.r(l),u.d(l,{Loader:()=>f});var c=u(4);u(4);function f(){}f.Handlers={handlers:[],add:function(m,y){this.handlers.push(m,y)},get:function(m){for(var y=this.handlers,p=0,d=y.length;p_.opacity&&(_.transparent=!0),p.setTextures(M),p.parse(_)}}()})},(o,l,u)=>{var c=u(4);l.VideoHandler=function(f){var h=this;this.video=void 0,this.videoTexture=void 0,this.setMorphTime=function(m,y){var p=m/y*h.video.duration;h.video.currentTime=p},this.getVideoDuration=function(){return h.video.duration},this.createCanvasVideoTexture=function(){return h.videoTexture=new c.VideoTexture(h.video),h.videoTexture.minFilter=c.LinearFilter,h.videoTexture.magFilter=c.LinearFilter,h.videoTexture.format=c.RGBFormat,h.video.currentTime=0,h.videoTexture},this.getCurrentTime=function(m){return h.video?m*(h.video.currentTime/h.video.duration):0},this.isReadyToPlay=function(){return!!(h.video&&3<=h.video.readyState)},function(){document&&(h.video=document.createElement("video"),h.video.crossOrigin="anonymous",h.video.src=f,h.video.load(),h.video.loop=!0)}()}},(o,l,u)=>{var c=u(4),f=u(23).Points,h=u(5).toBufferGeometry,m=u(5).getCircularTexture,y=u(17).Label,p=function(){u(10).ZincObject.call(this),this.isPointset=!0;var d=[];this.createMesh=(v,g,M)=>{if(v&&g){var _=h(v,M),E=m();g.map=E;var S=new f(_,g);this.setMesh(S,M.localTimeEnabled,M.localMorphColour)}};var b=(v,g,M,_)=>{if(M){var E=new c.Color(_),S=new y(M,E);S.setPosition(g[0],g[1],g[2]);var w=S.getSprite();w.material.sizeAttenuation=!1,w.material.alphaTest=.5,w.material.transparent=!0,w.material.depthWrite=!1,w.material.depthTest=!1,this.group.add(w),d[v]=S}};this.addPoints=(v,g,M)=>{if(v&&0{this.morph&&this.morph.material&&(this.morph.material.size=v,this.morph.material.needsUpdate=!0)},this.setSizeAttenuation=v=>{this.morph&&this.morph.material&&(this.morph.material.sizeAttenuation=v,this.morph.material.needsUpdate=!0)},this.getVerticesByIndex=function(v){if(0<=v&&this.drawRange>v){var g=this.getMorph().geometry.getAttribute("position");return[g.getX(v),g.getY(v),g.getZ(v)]}},this.editVertices=function(v,g){if(v&&v.length){var M=this.getMorph(),_=g+v.length-1;if(!M||0>g||_>=this.drawRange)return;var E=M.geometry.getAttribute("position"),S=g;v.forEach(w=>{var T=d[S];T&&T.setPosition(w[0],w[1],w[2]),E.setXYZ(S++,w[0],w[1],w[2])}),E.needsUpdate=!0,this.boundingBoxUpdateRequired=!0}},this.render=(v,g,M,_)=>{this.morph&&M&&(this.morph.sizePerPixel=M.pixelHeight),p.prototype.render.call(this,v,g,M,_)}};p.prototype=Object.create(u(10).ZincObject.prototype),l.Pointset=p},(o,l,u)=>{u.r(l),u.d(l,{Points:()=>b});var c=u(4),f=new c.Matrix4,h=new c.Ray,m=new c.Sphere,y=new c.Vector3,p=new c.Vector3,d=new c.Vector3;class b extends c.Object3D{constructor(){var _=0w.far)return;T.push({distance:L,distanceToRay:Math.sqrt(R),point:P,index:_,face:null,object:C})}}function g(M,_,E,S){y.fromBufferAttribute(_,S);var w=M.morphTargetInfluences;if(M.material.morphTargets&&E&&w){p.set(0,0,0);for(var T=0,C=E.length;T{var c=u(4),f=u(5).toBufferGeometry,h=function(){u(10).ZincObject.call(this),this.isLines=!0,this.createLineSegment=(m,y,p)=>{if(m&&y){var d=f(m,p);p.localMorphColour&&d.morphAttributes.color&&(y.onBeforeCompile=u(9).augmentMorphColor());var b=new(u(12)).LineSegments(d,y);this.setMesh(b,p.localTimeEnabled,p.localMorphColour)}},this.setWidth=m=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=m,this.morph.material.needsUpdate=!0)},this.addLines=(m,y)=>{if(m&&0{function c(y,p,d,b,v,g,M){try{var _=y[g](M),E=_.value}catch(S){return void d(S)}_.done?p(E):Promise.resolve(E).then(b,v)}function f(y){return function(){var p=this,d=arguments;return new Promise(function(b,v){function g(E){c(_,b,v,g,M,"next",E)}function M(E){c(_,b,v,g,M,"throw",E)}var _=y.apply(p,d);g(void 0)})}}var h=u(4),m=function(){var y=this;u(26).Texture.call(this),this.isTextureArray=!0,this.loadFromImages=function(){var p=f(function*(d){var b=1,v=1,g=0;if(d&&d.length){y.isLoading=!0;var M=new Image;M.crossOrigin="Anonymous";for(var _,E=document.createElement("canvas"),S=0,w=Array(d.length),T=0;T{C.set(R,S),S+=R.length}),y.impl=new h.DataTexture2DArray(C,b,v,g),y.size={width:b,height:v,depth:g},y.isLoading=!1,y.impl.needsUpdate=!0}});return function(){return p.apply(this,arguments)}}(),this.getMaterial=p=>{if(this.impl){var d;if(!p)d=new h.MeshBasicMaterial({color:new h.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:h.DoubleSide});else if(p.vs&&p.fs){var b=!0;p.transparent&&(b=p.transparent);var v=h.FrontSide;p.side&&(v=p.side),d=new h.ShaderMaterial({transparent:b,uniforms:p.uniforms,vertexShader:p.vs,fragmentShader:p.fs,side:v}),p.glslVersion&&(d.glslVersion=p.glslVersion)}if(d)return d.needsUpdate=!0,d}}};m.prototype=Object.create(u(26).Texture.prototype),l.TextureArray=m},(o,l,u)=>{function c(y,p,d,b,v,g,M){try{var _=y[g](M),E=_.value}catch(S){return void d(S)}_.done?p(E):Promise.resolve(E).then(b,v)}function f(y){return function(){var p=this,d=arguments;return new Promise(function(b,v){function g(E){c(_,b,v,g,M,"next",E)}function M(E){c(_,b,v,g,M,"throw",E)}var _=y.apply(p,d);g(void 0)})}}var h=u(4),m=function(){this.isTexture=!0,this.impl=void 0,this.isLoading=!1,this.size={width:1,height:1,depth:0}};m.prototype.loadImage=function(y,p){return new Promise((d,b)=>{y.onload=()=>d(y),y.onerror=b,y.src=p})},m.prototype.imageToUint8Array=function(){var y=f(function*(p,d,b,v){yield p.loadImage(d,b),v.width=d.width,v.height=d.height;var g=v.getContext("2d");return g.drawImage(d,0,0),{array:new Uint8Array(g.getImageData(0,0,v.width,v.height).data.buffer),width:v.width,height:v.height}});return function(){return y.apply(this,arguments)}}(),m.prototype.loadFromImages=function(){var y=f(function*(){});return function(){return y.apply(this,arguments)}}(),m.prototype.isReady=function(){return!(!this.impl||this.isLoading)},m.prototype.getMaterial=function(){if(this.impl)return new h.MeshBasicMaterial({color:new h.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:h.DoubleSide})},l.Texture=m},(o,l,u)=>{function c(v,g){var M=Object.keys(v);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(v);g&&(_=_.filter(function(E){return Object.getOwnPropertyDescriptor(v,E).enumerable})),M.push.apply(M,_)}return M}function f(v){for(var g,M=1;M{w.forEach(T=>this.createSlide(T))};var E=(w,T)=>{var C=w.material,R=C.uniforms;switch(w.rotation.x=0,w.rotation.y=0,w.rotation.z=0,w.position.x=0,w.position.y=0,w.position.z=0,T.direction){case"x":var P=_?-Math.PI/2:Math.PI/2;w.rotation.y=P,R.direction.value=1,R.slide.value.set(T.value,0,0),w.position.x=T.value;break;case"y":w.rotation.x=Math.PI/2,R.direction.value=2,R.slide.value.set(0,T.value,0),w.position.y=T.value;break;case"z":R.direction.value=3,R.slide.value.set(0,0,T.value),w.position.z=T.value;break}C.needsUpdate=!0,this.boundingBoxUpdateRequired=!0};this.modifySlideSettings=w=>{w&&w.id&&w.id in M&&M[w.id]&&E(M[w.id],w)},this.createSlide=w=>{if(this.texture&&this.texture.isTextureArray&&this.texture.isReady()&&w&&w.direction&&w.value!==void 0){var T=new p.PlaneGeometry(1,1);T.translate(.5,.5,0);var C=d.getUniforms();C.diffuse.value=this.texture.impl,C.depth.value=this.texture.size.depth,C.flipY.value=_;var R={fs:d.fs,vs:d.vs,uniforms:C,glslVersion:d.glslVersion,side:p.DoubleSide,transparent:!1},P=this.texture.getMaterial(R);P.needsUpdate=!0;var L=new p.Mesh(T,P);L.name=this.groupName,L.userData=this;var A={value:w.value,direction:w.direction,id:L.id};return g.push(A),E(L,A),M[L.id]=L,this.morph.add(L),this.boundingBoxUpdateRequired=!0,A}},this.getTextureSettings=()=>[...g],this.getTextureSettingsWithId=w=>{for(var T=0;Tthis.morph?[...this.morph.children]:[],this.removeSlide=w=>{w&&this.removeSlideWithId(w.id)},this.removeSlideWithId=w=>{if(this.morph&&w in M&&M[w]){if(this.morph.getObjectById(w)){var T=M[w];this.morph.remove(T),T.clear(),T.geometry&&T.geometry.dispose(),T.material&&T.material.dispose(),this.boundingBoxUpdateRequired=!0}var C=g.findIndex(R=>R.id===w);-1{this.morph.children.forEach(w=>{w.geometry&&w.geometry.dispose(),w.material&&w.material.dispose()}),u(29).TexturePrimitive.prototype.dispose.call(this),this.boundingBoxUpdateRequired=!0};var S=(w,T,C)=>{switch(T.direction.value){case 1:C.copy(T.slide.value),w.expandByPoint(C),C.setY(1),C.setZ(1),w.expandByPoint(C);break;case 2:C.copy(T.slide.value),w.expandByPoint(C),C.setX(1),C.setZ(1),w.expandByPoint(C);break;case 3:C.copy(T.slide.value),w.expandByPoint(C),C.setX(1),C.setY(1),w.expandByPoint(C);break}};this.getBoundingBox=()=>{if(this.morph&&this.morph.children&&this.morph.visible&&this.boundingBoxUpdateRequired){this.cachedBoundingBox.makeEmpty();var w=new p.Vector3(0,0,0);this.morph.children.forEach(T=>{S(this.cachedBoundingBox,T.material.uniforms,w)}),this.morph.updateMatrixWorld(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1}return this.cachedBoundingBox},this.applyTransformation=(w,T,C)=>{var R=new p.Matrix4;R.set(w[0],w[1],w[2],0,w[3],w[4],w[5],0,w[6],w[7],w[8],0,0,0,0,0);var P=new p.Quaternion().setFromRotationMatrix(R);this.morph.position.set(...T),this.morph.quaternion.copy(P),this.morph.scale.set(...C),this.morph.updateMatrix(),this.boundingBoxUpdateRequired=!0},this.initialise=(w,T)=>{if(w){var C=w.locations;C&&0{var c=u(4),f=c.GLSL3,h=` precision highp float; precision highp int; precision highp sampler2DArray; uniform sampler2DArray diffuse; in vec3 vUw; out vec4 outColor; void main() { vec4 color = texture( diffuse, vUw ); // lighten a bit outColor = vec4( color.rgb + .2, 1.0 ); } `,m=` out vec3 vUw; uniform float depth; uniform vec3 slide; uniform int direction; uniform bool flipY; void main() { vec3 slidePos = position.xyz; gl_Position = projectionMatrix * modelViewMatrix * vec4( position.xyz, 1.0 ); if (direction == 1) slidePos = vec3(slide.x, position.y, position.x); if (direction == 2) slidePos = vec3(position.x, slide.y, position.y); if (direction == 3) slidePos = vec3(position.x, position.y, slide.z); if (flipY) slidePos.y = 1.0 - slidePos.y; vUw.xyz = vec3(slidePos.x, slidePos.y, slidePos.z * depth); } `,y=function(){return{diffuse:{value:void 0},depth:{value:1},slide:{value:new c.Vector3(0,0,1)},direction:{value:1},flipY:{value:!0}}};l.fs=h,l.vs=m,l.glslVersion=f,l.getUniforms=y},(o,l,u)=>{u(4);var c=u(5).resolveURL,f=function(h){u(10).ZincObject.call(this),this.isTexturePrimitive=!0,this.texture=h,this.load=(m,y)=>{if(m&&m.images&&m.images.source){var p=new(u(25)).TextureArray,d=[];m.images.source.forEach(v=>{d.push(c(v))});var b=this;p.loadFromImages(d).then(()=>{b.texture=p,b.initialise(m,y)})}},this.initialise=(m,y)=>{y!=null&&typeof y=="function"&&y(this)}};f.prototype=Object.create(u(10).ZincObject.prototype),f.prototype.constructor=f,l.TexturePrimitive=f},(o,l,u)=>{var c=u(4),f=u(31);l.Renderer=function(h,m){var y=h,p=m,d=void 0,b=new c.Clock(!1);this.playAnimation=!0;var v=1e3,g=[],M=0,_=[],E=0,S=void 0,w=void 0,T=void 0,C=void 0,R=[],P=[],L=new c.Group,A=void 0,I=void 0,O=!1;this.getDrawingWidth=()=>y?y.clientWidth:A?typeof A.clientWidth>"u"?Math.round(A.width):Math.round(A.clientWidth):0,this.getDrawingHeight=()=>y?y.clientHeight:A?typeof A.clientHeight>"u"?Math.round(A.height):Math.round(A.clientHeight):0,this.onWindowResize=()=>{d.onWindowResize();var B=this.getDrawingWidth(),D=this.getDrawingHeight();if(p!=null){var V;y?(V=y.getBoundingClientRect(),p.setSize(B,D)):A&&(typeof A.getBoundingClientRect>"u"||(V=A.getBoundingClientRect(),A.width=B,A.height=D),p.setSize(B,D,!1)),V&&(V.left,V.top);var z=new c.Vector2;p.getSize(z),z.x,z.y,console.log("onWindowResize")}},this.initialiseVisualisation=B=>{if(B=B||{},B.antialias===void 0){var D=!1;try{/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(D=!0)}catch{D=!1}B.antialias=!D}B.canvas&&(y=void 0,A=B.canvas),p=new c.WebGLRenderer(B),y!==void 0&&y.appendChild(p.domElement),p.setClearColor(16777215,1),A&&A.style&&(A.style.height="100%",A.style.width="100%"),p.autoClear=!1;var V=this.createScene("default");this.setCurrentScene(V)},this.getCurrentScene=()=>d,this.setCurrentScene=B=>{if(B){this.removeActiveScene(B);var D=d;d=B,D&&D.setInteractiveControlEnable(!1),d.setInteractiveControlEnable(!0),d.setAdditionalScenesGroup(L),this.onWindowResize()}},this.getSceneByName=B=>R[B],this.createScene=B=>{if(R[B]==null){var D;return D=A?new(u(32)).Scene(A,p):new(u(32)).Scene(y,p),R[B]=D,D.sceneName=B,D}},this.resetView=()=>{d.resetView()},this.viewAll=()=>{if(d){var B=d.getBoundingBox();if(B){for(var D,V=0;V{d.loadModelsURL(B,D,V,z,G,K)},this.loadViewURL=B=>{d.loadViewURL(B)},this.loadFromViewURL=(B,D)=>{d.loadFromViewURL(B,D)},this.updateDirectionalLight=()=>{d.updateDirectionalLight()};var x=()=>{O?(S=requestAnimationFrame(x),this.render()):(cancelAnimationFrame(S),S=void 0)};this.stopAnimate=()=>{O&&(b.stop(),O=!1)},this.animate=()=>{O||(b.start(),O=!0,x())},this.addPreRenderCallbackFunction=B=>(++M,g[M]=B,M),this.removePreRenderCallbackFunction=B=>{B in g&&delete g[B]},this.addPostRenderCallbackFunction=B=>(++E,_[E]=B,E),this.removePostRenderCallbackFunction=B=>{B in _&&delete _[B]},this.getPlayRate=()=>v,this.setPlayRate=B=>{v=B},this.getCurrentTime=()=>d.getCurrentTime(),this.setMorphsTime=B=>{d.setMorphsTime(B)},this.getZincGeometryByID=B=>d.getZincGeometryByID(B),this.addToScene=B=>{d.addObject(B)},this.addToOrthoScene=B=>{if(T==null&&(T=new c.Scene),w==null){var D=this.getDrawingWidth(),V=this.getDrawingHeight();w=new c.OrthographicCamera(-D/2,D/2,V/2,-V/2,1,10),w.position.z=10}T.add(B)};var N=B=>D=>{D.needsUpdate=!0;var V=new c.SpriteMaterial({map:D}),z=V.map.image.width,G=V.map.image.height;B.material=V,B.scale.set(z,G,1);var K=this.getDrawingWidth(),ie=this.getDrawingHeight();B.position.set((K-z)/2,(-ie+G)/2,1),this.addToOrthoScene(B)};this.addLogo=()=>{C=new c.Sprite,c.ImageUtils.loadTexture("images/abi_big_logo_transparent_small.png",void 0,N(C))},this.render=()=>{I||(y?0p,this.isSceneActive=B=>{if(d===B)return!0;for(var D,V=0;V{this.isSceneActive(B)||(P.push(B),L.add(B.getThreeJSScene()))},this.removeActiveScene=B=>{for(var D,V=0;V{for(var B=0;B{for(var B in O&&cancelAnimationFrame(S),R)R.hasOwnProperty(B)&&R[B].clearAll();R=[],P=[],L=new c.Group,this.stopAnimate(),g=[],M=0,w=void 0,T=void 0,C=void 0;var D=this.createScene("default");this.setCurrentScene(D),I=void 0},this.transitionScene=(B,D)=>{if(d){var V=d.getZincCameraControls(),z=B.getBoundingBox();if(z){var G=z.min.distanceTo(z.max)/2,K=(z.min.x+z.max.x)/2,ie=(z.min.y+z.max.y)/2,j=(z.min.z+z.max.z)/2,H=V.getViewportFromCentreAndRadius(K,ie,j,G,40,G*4),W=V.getCurrentViewport();V.cameraTransition(W,H,D),V.enableCameraTransition()}}},this.isWebGL2=()=>!!p&&p.capabilities.isWebGL2}},o=>{o.exports=EB()},(o,l,u)=>{var c=u(4),f=u(33).MarkerCluster,h=u(35).SceneLoader,m=u(41).SceneExporter,y=u(43).Viewport,p=u(5).createBufferGeometry,d=u(5).getCircularTexture,b=0,v=function(){return"sc"+b++},g=function(){return{Duration:"6 secs",OriginalDuration:"-",TimeStamps:{}}},M=6e3;l.Scene=function(_,E){var S=this,w=_,T=void 0,C=new h(this),R=void 0,P={},L=0,A={},I=0,O=new c.Scene,x=new(u(44)).Region(void 0,this);O.add(x.getGroup());var N=new c.Group;O.add(N),this.directionalLight=void 0,this.ambient=void 0,this.camera=void 0;var B=6e3,D=void 0;this.sceneName=void 0;var V=!1,z=void 0;this.autoClearFlag=!0,this.displayMarkers=!1,this.displayMinimap=!1,this.minimapScissor={x_offset:16,y_offset:16,width:128,height:128,align:"top-left",updateRequired:!0};var G={x:0,y:0},K=g(),ie=new c.Vector2,j=[];this.forcePickableObjectsUpdate=!1,this.uuid=v();var H=new f(this);H.disable(),O.add(H.group);var W=()=>w?typeof w.clientWidth>"u"?w.width:w.clientWidth:0,q=()=>w?typeof w.clientHeight>"u"?w.height:w.clientHeight:0;this.getDownloadProgress=()=>C.getDownloadProgress(),this.onWindowResize=()=>{var F=q();this.camera.aspect=W()/F,this.camera.updateProjectionMatrix(),this.minimapScissor.updateRequired=!0,D.onResize(),D.calculateHeightPerPixelAtZeroDepth(F)},this.resetView=()=>{this.onWindowResize(),D.resetView()},this.changeZoomByScrollRateUnit=F=>{D.changeZoomByScrollRateUnit(F)};var Q=()=>{this.camera=new c.PerspectiveCamera(40,W()/q(),0,10),this.ambient=new c.AmbientLight(16777215,.2),O.add(this.ambient),this.directionalLight=new c.DirectionalLight(16777215,.8),O.add(this.directionalLight),D=new(u(43)).CameraControls(this.camera,E.domElement,E,this),D.setDirectionalLight(this.directionalLight),D.resetView(),R=new(u(49)).Minimap(this)};Q(),this.loadView=F=>{var $=new y;return $.setFromObject(F),D.setCurrentCameraSettings($),!0},this.setupMultipleViews=(F,$)=>{for(var[J,k]of Object.entries($)){var U=new y;U.setFromObject(k),D.addViewport(J,U)}D.setDefaultViewport(F)},this.getBoundingBox=()=>x.getBoundingBox(!0),this.viewAllWithBoundingBox=F=>{if(F){var $=D.getViewportFromBoundingBox(F,1);D.setCurrentCameraSettings($),D.calculateHeightPerPixelAtZeroDepth(q()),H.markerUpdateRequired=!0}},this.viewAll=()=>{var F=this.getBoundingBox();this.viewAllWithBoundingBox(F),H.markerUpdateRequired=!0},this.forEachGeometry=F=>{x.forEachGeometry(F,!0)},this.forEachGlyphset=F=>{x.forEachGlyphset(F,!0)},this.forEachPointset=F=>{x.forEachPointset(F,!0)},this.forEachLine=F=>{x.forEachLine(F,!0)},this.findGeometriesWithGroupName=F=>x.findGeometriesWithGroupName(F,!0),this.findPointsetsWithGroupName=F=>x.findPointsetsWithGroupName(F,!0),this.findGlyphsetsWithGroupName=F=>x.findGlyphsetsWithGroupName(F,!0),this.findLinesWithGroupName=F=>x.findLinesWithGroupName(F,!0),this.findObjectsWithGroupName=F=>x.findObjectsWithGroupName(F,!0),this.findObjectsWithAnatomicalId=F=>x.findObjectsWithAnatomicalId(F,!0),this.getBoundingBoxOfZincObjects=F=>{for(var $,J=void 0,k=0;k{F.project(this.camera);var $=W(),J=q(),k=$/2,U=J/2;return F.x=F.x*k+k,F.y=-(F.y*U)+U,F},this.getObjectsScreenXY=F=>{if(F&&0{var $=this.findObjectsWithGroupName(F);return this.getObjectsScreenXY($)},this.addZincObject=F=>{F&&(x.addZincObject(F),D&&D.calculateMaxAllowedDistance(this))},this.loadGlyphsetURL=(F,$,J,k)=>{C.loadGlyphsetURL(x,F,$,J,k)},this.loadPointsetURL=(F,$,J,k,U)=>{C.loadPointsetURL(x,F,$,J,k,U)},this.loadLinesURL=(F,$,J,k,U)=>{C.loadLinesURL(x,F,$,J,k,U)},this.loadSTL=(F,$,J)=>{C.loadSTL(x,F,$,J)},this.loadOBJ=(F,$,J)=>{C.loadOBJ(x,F,$,J)},this.loadMetadataURL=(F,$,J)=>{C.loadMetadataURL(x,F,$,J)},this.loadModelsURL=(F,$,J,k,U,oe)=>{C.loadModelsURL(x.urls,$,J,k,U,oe)},this.loadViewURL=F=>{C.loadViewURL(F)},this.loadFromViewURL=(F,$)=>{C.loadFromViewURL(F,$)},this.loadGLTF=(F,$,J,k)=>{C.loadGLTF(x,F,$,J,k)},this.updateDirectionalLight=()=>{D.updateDirectionalLight()},this.addObject=F=>{O.add(F)},this.removeObject=F=>{O.remove(F)},this.getCurrentTime=()=>{if(T!=null)return T.getCurrentTime(B);var F=x.getCurrentTime();return F===-1?0:F},this.setMorphsTime=F=>{T!=null&&T.setMorphTime(F,B),x.setMorphTime(F,!0)},this.isTimeVarying=()=>!!(T&&T.video&&!T.video.error)||x.isTimeVarying(),this.renderGeometries=(F,$,J)=>{var k={};if(k.camera=D,k.displayMarkers=this.displayMarkers,k.markerCluster=H,k.markersList=H.markers,k.ndcToBeUpdated=!1,J&&(k.markerCluster.markerUpdateRequired=!0),!T)C.toBeDownloaded==0?(k.ndcToBeUpdated=D.update($),k.ndcToBeUpdated&&D.calculateHeightPerPixelAtZeroDepth(q()),x.renderGeometries(F,$,J,D,k,!0)):D.update(0);else if(T.isReadyToPlay()){J?T.video.play():T.video.pause();var U=T.video.currentTime/T.getVideoDuration()*B;C.toBeDownloaded==0?(D.setTime(U),k.ndcToBeUpdated=D.update(0),k.ndcToBeUpdated&&D.calculateHeightPerPixelAtZeroDepth(q()),x.setMorphTime(U,!0),x.renderGeometries(0,0,J,D,k,!0)):D.update(0)}else myPlayRate=0},this.getThreeJSScene=()=>O,this.setVideoHandler=F=>{T||(T=F)},this.setAdditionalScenesGroup=F=>{O.add(F)};var ee=(F,$,J,k,U,oe,le)=>{var ae=0,fe=0;return fe=F.includes("top")?le-U-J:F.includes("bottom")?J:Math.floor((le-U)/2),ae=F.includes("left")?$:F.includes("right")?oe-$-k:Math.floor((oe-k)/2),{x:ae,y:fe}},ne=F=>{this.displayMinimap===!0&&(F.setScissorTest(!0),F.getSize(ie),this.minimapScissor.updateRequired&&(G=ee(this.minimapScissor.align,this.minimapScissor.x_offset,this.minimapScissor.y_offset,this.minimapScissor.width,this.minimapScissor.height,ie.x,ie.y),this.minimapScissor.updateRequired=!1),F.setScissor(G.x,G.y,this.minimapScissor.width,this.minimapScissor.height),F.setViewport(G.x,G.y,this.minimapScissor.width,this.minimapScissor.height),R.updateCamera(),O.add(R.mask),F.render(O,R.camera),O.remove(R.mask),F.setScissorTest(!1),F.setViewport(0,0,ie.x,ie.y))};this.render=F=>{this.autoClearFlag&&F.clear(),V&&z?z.render(O,this.camera):(F.render(O,this.camera),ne(F))},this.setInteractiveControlEnable=F=>{F==!0?D.enable():D.disable()},this.getZincCameraControls=()=>D,this.getThreeJSScene=()=>O,this.setDuration=F=>{x.setDuration(F),B=F,D.setPathDuration(F),C.duration=F},this.getDuration=()=>B,this.setStereoEffectEnable=F=>{F!=!0||z||(z=new u(43).StereoEffect(E)),E.setSize(W(),q()),this.camera.updateProjectionMatrix(),V=F},this.objectIsInScene=F=>x.objectIsInRegion(F,!0),this.alignBoundingBoxToCameraView=(F,$)=>{if(F){var J=new c.Vector3;F.getCenter(J);var k=this.getZincCameraControls().getCurrentViewport(),U=new c.Vector3(k.targetPosition[0],k.targetPosition[1],k.targetPosition[2]),oe=new c.Vector3(k.eyePosition[0],k.eyePosition[1],k.eyePosition[2]),le=new c.Vector3,ae=new c.Vector3;le.subVectors(U,oe).normalize(),ae.subVectors(U,J).normalize();var fe=new c.Vector3;fe.crossVectors(le,ae);var ge=le.angleTo(ae);0<$?(this.getZincCameraControls().rotateCameraTransition(fe,ge,$),this.getZincCameraControls().enableCameraTransition()):this.getZincCameraControls().rotateAboutLookAtpoint(fe,ge),H.markerUpdateRequired=!0}},this.translateBoundingBoxToCameraView=(F,$,J)=>{if(F){var k=this.getZincCameraControls().getCurrentViewport(),U=this.getZincCameraControls().getViewportFromBoundingBox(F,$);0{if(this.objectIsInScene(F)){var J=F.getBoundingBox();this.alignBoundingBoxToCameraView(J,$)}},this.setCameraTargetToObject=F=>{if(this.objectIsInScene(F)){var $=new c.Vector3,J=F.getBoundingBox(),k=this.getZincCameraControls().getCurrentViewport();J.getCenter($);var U=new c.Vector3(k.targetPosition[0],k.targetPosition[1],k.targetPosition[2]),oe=new c.Vector3(k.eyePosition[0],k.eyePosition[1],k.eyePosition[2]),le=new c.Vector3,ae=new c.Vector3;le.subVectors(oe,U),ae.addVectors($,le),k.eyePosition[0]=ae.x,k.eyePosition[1]=ae.y,k.eyePosition[2]=ae.z,k.targetPosition[0]=$.x,k.targetPosition[1]=$.y,k.targetPosition[2]=$.z,this.getZincCameraControls().setCurrentCameraSettings(k),H.markerUpdateRequired=!0}},this.isStereoEffectEnable=()=>V,this.removeZincObject=F=>{x.removeZincObject(F),D&&D.calculateMaxAllowedDistance(this),H.markerUpdateRequired=!0},this.updatePickableThreeJSObjects=()=>{j.length=0,H.isEnabled&&j.push(H.group),x.getPickableThreeJSObjects(j,!0),this.forcePickableObjectsUpdate=!1},this.getPickableThreeJSObjects=()=>((this.forcePickableObjectsUpdate||x.checkPickableUpdateRequred(!0))&&this.updatePickableThreeJSObjects(),j),this.getNormalisedMinimapCoordinates=(F,$)=>{if(this.displayMinimap){var J=new c.Vector2;F.getSize(J);var k=J.y-$.clientY;if(G.x+this.minimapScissor.width>$.clientX&&$.clientX>G.x&&G.y+this.minimapScissor.height>k&&k>G.y){var U=2*(($.clientX-G.x)/this.minimapScissor.width)-1,oe=2*((k-G.y)/this.minimapScissor.height)-1;return{x:U,y:oe}}}},this.getMinimapDiffFromNormalised=(F,$)=>R?R.getDiffFromNormalised(F,$):void 0,this.isWebGL2=()=>E.isWebGL2(),this.clearAll=()=>{H.clear(),x.clear(!0),this.clearZincObjectAddedCallbacks(),this.clearZincObjectRemovedCallbacks(),C.toBeDwonloaded=0,D&&D.calculateMaxAllowedDistance(this),H.markerUpdateRequired=!0},this.addMetadataTimeStamp=(F,$)=>{K.TimeStamps[F]=te($)},this.getMetadataTag=F=>K[F],this.getMetadata=()=>K,this.setMetadataTag=(F,$)=>{K[F]=$},this.removeMetadataTag=F=>{delete K[F]},this.resetMetadata=()=>{K=g()},this.resetDuration=()=>{this.setDuration(M)};var Y=F=>[...F.years?["".concat(F.years,"years")]:[],...F.months?["".concat(F.months,"months")]:[],...F.weeks?["".concat(F.weeks,"weeks")]:[],...F.days?["".concat(F.days,"days")]:[],...F.hours?["".concat(F.hours,"hours")]:[],...F.mins?["".concat(F.mins,"mins")]:[],...F.secs?["".concat(F.secs,"secs")]:[]].join(" "),te=F=>F.years?31536e6*F.years:0+F.months?2592e6*F.months:0+F.weeks?6048e5*F.weeks:0+F.days?864e5*F.days:0+F.hours?36e5*F.hours:0+F.mins?6e4*F.mins:0+F.secs?1e3*F.secs:0;this.setDurationFromObject=F=>{var $=Y(F),J=te(F);this.setMetadataTag("Duration",$),this.setDuration(J)},this.setOriginalDurationFromObject=F=>{var $=Y(F);this.setMetadataTag("OriginalDuration",$)},this.exportGLTF=F=>{var $=new m(this);return $.exportGLTF(F)},this.getRootRegion=()=>x,this.createLines=(F,$,J,k)=>{var U=x.findChildFromPath(F);return U===void 0&&(U=x.createChildFromPath(F)),U.createLines($,J,k)},this.createPoints=(F,$,J,k,U)=>{var oe=x.findChildFromPath(F);return oe===void 0&&(oe=x.createChildFromPath(F)),oe.createPoints($,J,k,U)},this.addZincObjectAddedCallbacks=F=>(++L,P[L]=F,L),this.addZincObjectRemovedCallbacks=F=>(++I,A[I]=F,I),this.removeZincObjectAddedCallbacks=F=>{F in L&&delete P[F]},this.removeZincObjectRemovedCallbacks=F=>{F in I&&delete A[F]},this.clearZincObjectAddedCallbacks=()=>{P={},L=0},this.clearZincObjectRemovedCallbacks=()=>{A={},I=0},this.triggerObjectAddedCallback=F=>{for(var $ in P)P.hasOwnProperty($)&&P[$](F)},this.triggerObjectRemovedCallback=F=>{for(var $ in A)A.hasOwnProperty($)&&A[$](F)},this.addTemporaryPoints=(F,$)=>{var J=p(F.length,F),k=new c.PointsMaterial({alphaTest:.5,size:15,color:$,sizeAttenuation:!1}),U=d();k.map=U;var oe=new(u(23)).Points(J,k);return N.add(oe),oe},this.addTemporaryLines=(F,$)=>{var J=p(F.length,F),k=new c.LineBasicMaterial({color:$}),U=new(u(12)).LineSegments(J,k);return N.add(U),U},this.removeTemporaryPrimitive=F=>{N.remove(F),F.geometry.dispose(),F.material.dispose()},this.clearTemporaryPrimitives=()=>{var F=0,$=N.children;return $.forEach(J=>{J.geometry.dispose(),J.material.dispose(),F++}),N.clear(),F},this.addBoundingBoxPrimitive=function(F,$,J,k,U){var oe=5{var ye;switch(ue){case"x":ye=new c.PlaneGeometry(fe.z,fe.y),ye.rotateY(Math.PI/2);break;case"y":ye=new c.PlaneGeometry(fe.x,fe.z),ye.rotateX(Math.PI/2);break;case"z":ye=new c.PlaneGeometry(fe.x,fe.y);break}var se=le.createGeometryFromThreeJSGeometry($[we],ye,J[we],k,U,10001);ge.push(se),we++}),fe.addVectors(ae.min,ae.max).multiplyScalar(.5),ge.forEach(ue=>{ue.setPosition(fe.x,fe.y,fe.z)}),ge}},this.enableMarkerCluster=F=>{F?(H.markerUpdateRequired=!0,H.enable()):(H.markerUpdateRequired=!1,H.disable()),this.forcePickableObjectsUpdate=!0}}},(o,l,u)=>{function c(E,S){var w=Object.keys(E);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(E);S&&(T=T.filter(function(C){return Object.getOwnPropertyDescriptor(E,C).enumerable})),w.push.apply(w,T)}return w}function f(E){for(var S,w=1;w{S.scale.set(.015,.02,1),S.scale.multiplyScalar(x)},this.clear=()=>{this.group.clear(),this.markers={}},this.dispose=()=>{this.clear(),this.morph&&this.morph.clear()};var L=x=>{var N=new p.Group,B=new p.Sprite(g);return B.clusterIndex=x,B.center.set(.5,0),B.position.set(0,0,0),B.renderOrder=1e4,B.scale.set(v[0],v[1],v[2]),B.userData=this,N.add(B),this.group.add(N),{group:N,marker:B,label:void 0,number:0,min:[0,0,0],max:[1,1,1]}},A=(x,N,B)=>{x.group.visible=!0,x.group.position.set(N.coords[0],N.coords[1],N.coords[2]),(x.label===void 0||B!==x.number)&&(x.label&&(x.group.remove(x.label),x.label.material.map.dispose(),x.label.material.dispose()),x.label=M(B,.012,"black","Asap",120,700),x.number=B,x.group.add(x.label)),x.min=N.min,x.max=N.max},I=x=>{var N=0;for(x.forEach(B=>{var D=B.members.length,V=0;D===1?B.members[0].setVisibility(!0):(B.members.forEach(z=>{V+=z.getNumber(),z.setVisibility(!1)}),!T[N]&&T.push(L(N)),A(T[N],B,V),N++)}),N;N{var B=!0,D={members:[],coords:[0,0,0],min:[0,0,0],max:[1,1,1]},V=0;for(var z in x)B?(C.set(x[z].ndc.x,x[z].ndc.y),this._b1.setFromPoints([x[z].morph.position]),B=!1,D.members.push(x[z]),D.coords=[x[z].morph.position.x,x[z].morph.position.y,x[z].morph.position.z],N.push(D),delete x[z]):(R.set(x[z].ndc.x,x[z].ndc.y),V=C.distanceTo(R),.1>V&&(D.members.push(x[z]),this._b1.expandByPoint(x[z].morph.position),delete x[z]));D.min=[this._b1.min.x,this._b1.min.y,this._b1.min.z],D.max=[this._b1.max.x,this._b1.max.y,this._b1.max.z],B!=!0&&O(x,N)};this.calculate=()=>{if(w){var x=Date.now();if(500w,this.enable=()=>{w=!0,this.morph.visible=!0},this.disable=()=>{for(var x in w=!1,this.morph.visible=!1,this.markers){var N;(N=this.markers[x])!==null&&N!==void 0&&N.isMarker&&this.markers[x].isEnabled()&&this.markers[x].setVisibility(!0)}},this.zoomToCluster=x=>!!(x!==void 0&&-1{if(x!==void 0&&-1{o.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZlcnNpb249IjEuMSIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIHZpZXdCb3g9IjAgMCAzNjUgNTYwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4KPGRlZnM+CjwvZGVmcz4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDApIiBpZD0iODA4ZWQyODMtMjUyNC00NDBmLTg4YWUtM2JkYjQ3YmI1NzQ5IiAgPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii0xODIuNSIgeT0iLTI4MCIgcng9IjAiIHJ5PSIwIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgLz4KPC9nPgo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+CjxnIHN0eWxlPSIiICAgPgo8L2c+CjwvZz4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDk3LjUpIiAgPgo8ZyBzdHlsZT0iIiAgID4KPC9nPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDAuOTkgMCAwIDAuOTkgMTgyLjUgMjgwKSIgID4KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItNTQwIiB5PSItNTQwIiByeD0iMCIgcnk9IjAiIHdpZHRoPSIxMDgwIiBoZWlnaHQ9IjEwODAiIC8+CjwvZz4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxwYXRoIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwxNjUsMCk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHRyYW5zZm9ybT0iIHRyYW5zbGF0ZSgtMTgyLjksIC0yNzkuODUpIiBkPSJNIDE4Mi45IDU1MS43IEMgMTgyLjkgNTUxLjgwMDAwMDAwMDAwMDEgMTgzLjEgNTUyIDE4My4xIDU1MiBDIDE4My4xIDU1MiAzNTguMyAyODMgMzU4LjMgMTk0LjYgQyAzNTguMyA2NC41IDI2OS41IDcuOTAwMDAwMDAwMDAwMDA2IDE4Mi45IDcuNjk5OTk5OTk5OTk5OTg5IEMgOTYuMyA3LjkgNy41IDY0LjUgNy41IDE5NC42IEMgNy41IDI4MyAxODIuOCA1NTIgMTgyLjggNTUyIEMgMTgyLjggNTUyIDE4Mi45IDU1MS43IDE4Mi45IDU1MS43IHogTSAxMjIuMiAxODcuMiBDIDEyMi4yIDE1My42IDE0OS40IDEyNi4zOTk5OTk5OTk5OTk5OSAxODMgMTI2LjM5OTk5OTk5OTk5OTk5IEMgMjE2LjYgMTI2LjM5OTk5OTk5OTk5OTk5IDI0My44IDE1My42IDI0My44IDE4Ny4yIEMgMjQzLjggMjIwLjc5OTk5OTk5OTk5OTk4IDIxNi41IDI0OCAxODIuOSAyNDggQyAxNDkuNCAyNDggMTIyLjIgMjIwLjggMTIyLjIgMTg3LjIgeiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiAvPgo8L2c+CgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPgo8Y2lyY2xlIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgY3g9IjAiIGN5PSIwIiByPSIzNSIgLz4KPC9nPgo8L2c+CjwvZz4KPC9zdmc+"},(o,l,u)=>{var c=u(4),f=u(5).resolveURL,h=u(5).createNewURL,m=u(36).STLLoader,y=u(37).OBJLoader,p=u(38).PrimitivesLoader;l.SceneLoader=function(d){var b=d;this.toBeDownloaded=0,this.progressMap={};var v=!1,g=!1,M=new p;this.getDownloadProgress=()=>{var j=0,H=0,W=!1;for(var q in this.progressMap){var Q=this.progressMap[q];j+=Q[1],H+=Q[0],Q[1]==0&&(W=!0)}return W&&(j=0),[j,H,g]},this.onProgress=j=>H=>{this.progressMap[j]=[H.loaded,H.total]},this.onError=j=>H=>{--this.toBeDownloaded,g=!0,console.error("There is an issue with one of the external resource: ".concat(H==null?void 0:H.responseURL,".")),j&&j()};var _=(j,H)=>{var W=H.Default;if(H.Inline)b.setupMultipleViews(W,H.Entries);else{var q=[],Q=function(te){j&&(newURL=h(ne,j),q.push(new Promise((F,$)=>{fetch(newURL).then(J=>J.json()).then(J=>F({key:te,data:J})).catch(J=>$(J))})))};for(var[ee,ne]of Object.entries(H.Entries))Q(ee);Promise.all(q).then(Y=>{var te={};Y.forEach($=>{te[$.key]=$.data}),b.setupMultipleViews(W,te);var F=b.getZincCameraControls();F&&F.setCurrentViewport(W),v=!0})}};this.loadViewURL=(j,H)=>{this.toBeDownloaded+=1;var W=new XMLHttpRequest;W.onreadystatechange=()=>{if(W.readyState==4)if(W.status==200){var Q=JSON.parse(W.responseText);b.setupMultipleViews("default",{default:Q}),b.resetView(),v=!0,--this.toBeDownloaded,H!=null&&typeof H=="function"&&H()}else this.onError()};var q=f(j);W.open("GET",q,!0),W.send()},this.loadModelsURL=(j,H,W,q,Q,ee,ne)=>{var Y=H.length;this.toBeDownloaded+=Y;for(var te=0;te{var q=new XMLHttpRequest;q.onreadystatechange=()=>{if(q.readyState==4&&q.status==200){var ee=JSON.parse(q.responseText);b.loadView(ee);for(var ne,Y=[],te=H+"_",F=0;F(te,F)=>{var $=new(u(24)).Lines,J=void 0;F&&F[0]&&(J=new c.LineBasicMaterial({color:F[0].color.clone()}),1>F[0].opacity&&(J.transparent=!0),J.opacity=F[0].opacity,J.morphTargets=H,J.vertexColors=F[0].vertexColors);var k={localTimeEnabled:H,localMorphColour:W};if($&&($.createLineSegment(te,J,k),$.setName(q),$.anatomicalId=Q,$.setRenderOrder(ee),j.addZincObject($),$.setDuration(b.getDuration()),console.log(ne),ne&&ne.levels))for(var[U,oe]of Object.entries(ne.levels))$.addLOD(M,U,oe.URL,oe.Index,ne.preload);--this.toBeDownloaded,te.dispose(),Y!=null&&typeof Y=="function"&&Y($)};this.loadLinesURL=(j,H,W,q,Q,ee,ne)=>{var Y=0;this.toBeDownloaded+=1;var te=!!(ne&&ne.isInline)&&ne.isInline,F=ne&&ne.anatomicalId?ne.anatomicalId:void 0,$=ne&&ne.renderOrder?ne.renderOrder:void 0;W!=null&&(Y=!!W);var J=0;if(q!=null&&(J=!!q),te){var k=M.parse(H);E(j,Y,J,Q,F,$,ne.lod,ee)(k.geometry,k.materials)}else M.load(H,E(j,Y,J,Q,F,$,ne.lod,ee),this.onProgress(H),this.onError(ee),ne.loaderOptions)};var S=(j,H,W,q,Q,ee)=>{var ne=ee&&ee.isInline?ee.isInline:void 0,Y=ee&&ee.anatomicalId?ee.anatomicalId:void 0,te=ee&&ee.displayLabels?ee.displayLabels:void 0,F=ee&&ee.renderOrder?ee.renderOrder:void 0,$=new(u(18)).Glyphset;$.setDuration(b.getDuration()),$.groupName=q;var J=()=>{--this.toBeDownloaded,Q!=null&&typeof Q=="function"&&Q($)};++this.toBeDownloaded,ne?$.load(H,W,J,ne,te):$.load(H,f(W),J,ne,te),$.anatomicalId=Y,$.setRenderOrder(F),j.addZincObject($)},w=(j,H,W,q,Q,ee)=>()=>{if(H.readyState==4&&H.status==200){var ne=JSON.parse(H.responseText);S(j,ne,W,q,Q,ee)}},T=(j,H,W,q,Q,ee,ne)=>(Y,te)=>{var F=new(u(22)).Pointset,$=new c.PointsMaterial({alphaTest:.5,size:10,sizeAttenuation:!1});te&&te[0]&&(1>te[0].opacity&&($.transparent=!0),$.opacity=te[0].opacity,$.color=te[0].color,$.morphTargets=H,$.vertexColors=te[0].vertexColors);var J={};J.localTimeEnabled=H,J.localMorphColour=W,F&&(F.createMesh(Y,$,J),F.setName(q),F.anatomicalId=Q,j.addZincObject(F),F.setDuration(b.getDuration()),F.setRenderOrder(ee)),Y.dispose(),--this.toBeDownloaded,ne!=null&&typeof ne=="function"&&ne(F)};this.loadSTL=(j,H,W,q)=>{this.toBeDownloaded+=1;var Q=u(0).defaultMaterialColor,ee=u(0).defaultOpacity,ne=new m;ne.crossOrigin="Anonymous",ne.load(f(H),I(j,Q,ee,!1,!1,W,void 0,void 0,void 0,q))},this.loadOBJ=(j,H,W,q)=>{this.toBeDownloaded+=1;var Q=u(0).defaultMaterialColor,ee=u(0).defaultOpacity,ne=new y;ne.crossOrigin="Anonymous",ne.load(f(H),I(j,Q,ee,!1,!1,W,void 0,void 0,void 0,q))};var C=(j,H,W,q,Q,ee,ne)=>{this.toBeDownloaded+=1;var Y=u(0).defaultMaterialColor,te=u(0).defaultOpacity,F=0,$=!!(ne&&ne.isInline)&&ne.isInline,J=ne&&ne.fileFormat?ne.fileFormat:void 0,k=ne&&ne.anatomicalId?ne.anatomicalId:void 0,U=ne&&ne.renderOrder?ne.renderOrder:void 0;W!=null&&(F=!!W);var oe=0;q!=null&&(oe=!!q);var le=M;if(J!==void 0){if(J=="STL")le=new m;else if(J=="OBJ")return le=new y,le.crossOrigin="Anonymous",void le.load(H,objloader(j,Y,te,F,oe,Q,k,ee),this.onProgress(H),this.onError,ne.loaderOptions)}if($){var ae=M.parse(H);I(j,Y,te,F,oe,Q,k,U,ne,ee)(ae.geometry,ae.materials)}else le.crossOrigin="Anonymous",M.load(H,I(j,Y,te,F,oe,Q,k,U,ne,ee),this.onProgress(H),this.onError(ee),ne.loaderOptions)},R=function(H,W,q){var Q=0;return ee=>{if(++Q,ee&&W!=null&&typeof W=="function"){W(ee);var ne=b.getZincCameraControls();ne&&ne.calculateMaxAllowedDistance(b)}Q==H&&(v==!1&&b.viewAll(),q!=null&&typeof q=="function"&&q())}};this.loadPointsetURL=(j,H,W,q,Q,ee,ne)=>{var Y=0;this.toBeDownloaded+=1,W!=null&&(Y=!!W);var te=0;q!=null&&(te=!!q);var F=!!(ne&&ne.isInline)&&ne.isInline,$=ne&&ne.anatomicalId?ne.anatomicalId:void 0,J=ne&&ne.renderOrder?ne.renderOrder:void 0;if(F){var k=M.parse(H);T(j,Y,te,Q,$,J,ee)(k.geometry,k.materials)}else M.load(H,T(j,Y,te,Q,$,J,ee),this.onProgress(H),this.onError(ee),ne.loaderOptions)};var P=(j,H,W,q,Q,ee)=>{var ne=ee&&ee.isInline?ee.isInline:void 0,Y=ee&&ee.anatomicalId?ee.anatomicalId:void 0,te=ee&&ee.renderOrder?ee.renderOrder:void 0,F=void 0;if(W){if(H&&W.images&&W.images.source)for(var $,J=W.images.source,k=0;k{--this.toBeDownloaded,Q!=null&&typeof Q=="function"&&Q(F)};++this.toBeDownloaded,F.load(W,U,ne),F.anatomicalId=Y,F.setRenderOrder(te),j.addZincObject(F)}}},L=(j,H,W,q,Q)=>()=>{if(H.readyState==4&&H.status==200){var ee=JSON.parse(H.responseText);P(j,H.responseURL,ee,W,q,Q)}};this.loadTextureURL=(j,H,W,q,Q)=>{var ee=!!(Q&&Q.isInline)&&Q.isInline;if(ee)P(j,void 0,H,W,q,Q);else{var ne=new XMLHttpRequest;ne.onreadystatechange=L(j,ne,W,q,Q),ne.open("GET",f(H),!0),ne.send()}},this.loadGlyphsetURL=(j,H,W,q,Q,ee)=>{var ne=!!(ee&&ee.isInline)&&ee.isInline;if(ne)S(j,H,W,q,Q,ee);else{var Y=new XMLHttpRequest;Y.onreadystatechange=w(j,Y,W,q,Q,ee),Y.open("GET",f(H),!0),Y.send()}};var A=(j,H,W,q,Q,ee,ne,Y,te)=>{var F={colour:W,opacity:q,localTimeEnabled:Q,localMorphColour:ee},$=new(u(3)).Geometry;return $.createMesh(H,Y,F),$.getMorph()?($.setName(te),j&&j.addZincObject($),$.setDuration(b.getDuration()),$.videoHandler&&b.setVideoHandler($.videoHandler),$):void 0},I=(j,H,W,q,Q,ee,ne,Y,te,F)=>($,J)=>{var k;J&&J[0]&&(k=J[0]);var U=A(j,$,H,W,q,Q,void 0,k,ee);if(U.anatomicalId=ne,U.setRenderOrder(Y),te.lod&&te.lod.levels)for(var[oe,le]of Object.entries(te.lod.levels))U.addLOD(M,oe,le.URL,le.Index,te.lod.preload);--this.toBeDownloaded,$.dispose(),F!=null&&typeof F=="function"&&F(U)},O=j=>{var H=/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,[,W,q,Q,ee,ne,Y,te]=j.match(H);return{years:W,months:q,weeks:Q,days:ee,hours:ne,mins:Y,secs:te}};this.loadSettings=j=>{if(j){if(j.Duration){var H=O(j.Duration);b.setDurationFromObject(H)}if(j.OriginalDuration){var W=O(j.OriginalDuration);b.setOriginalDurationFromObject(W)}if(j.TimeStamps)for(var q in j.TimeStamps){var Q=O(j.TimeStamps[q]);b.addMetadataTimeStamp(q,Q)}}};var x=(j,H,W,q,Q)=>{if(W){var ee=void 0,ne=!1;W.URL?(ee=W.URL,H&&(ee=h(ee,H))):W.Inline&&(ee=W.Inline.URL,ne=!0);var Y={};if(W.LOD&&W.LOD.Levels){Y.preload=!!W.LOD.Preload,Y.levels={};for(var[te,F]of Object.entries(W.LOD.Levels))Y.levels[te]={},Y.levels[te].URL=h(F.URL,H),Y.levels[te].Index=F.Index}var $=W.GroupName;($===void 0||$==="")&&($="_Unnamed");var J={loaderOptions:{index:W.Index},isInline:ne,fileFormat:W.FileFormat,anatomicalId:W.AnatomicalId,compression:W.compression,lod:Y,renderOrder:q};switch(W.Type){case"Surfaces":C(j,ee,W.MorphVertices,W.MorphColours,$,Q,J);break;case"Glyph":var k;ne?k=W.Inline.GlyphGeometriesURL:(k=W.GlyphGeometriesURL,k=h(W.GlyphGeometriesURL,H)),W.DisplayLabels&&(J.displayLabels=!0),this.loadGlyphsetURL(j,ee,k,$,Q,J);break;case"Points":this.loadPointsetURL(j,ee,W.MorphVertices,W.MorphColours,$,Q,J);break;case"Lines":this.loadLinesURL(j,ee,W.MorphVertices,W.MorphColours,$,Q,J);break;case"Texture":this.loadTextureURL(j,ee,$,Q,J);break}}},N=(j,H,W)=>{if(H){var q=void 0,Q=!1;switch(H.URL?(q=H.URL,j&&(q=h(H.URL,j))):H.Inline&&(q=H.Inline.URL,Q=!0),H.Type){case"View":Q?(b.setupMultipleViews("default",{default:q}),v=!0,W!=null&&typeof W=="function"&&W()):this.loadViewURL(q,W);break;case"Settings":this.loadSettings(H);break}}};this.loadGLTF=(j,H,W,q,Q)=>{var ee=new(u(39)).GLTFToZincJSLoader;ee.load(b,j,H,W,q,Q)};var B=(j,H,W,q)=>{if(W.Primitives&&W.Primitives.forEach(Y=>{var te=1;Y.Order&&(te=Y.Order),x(j,H,Y,te,q)}),W.Transformation&&j.setTransformation(W.Transformation),W.Children)for(var[Q,ee]of Object.entries(W.Children)){var ne=j.findOrCreateChildFromPath(Q);ne&&B(ne,H,ee,q)}},D=(j,H)=>{if(Array.isArray(j)){for(var W=0,q=0;q{var H=j.Primitives?D(j.Primitives,!1):0;return j.Children&&Object.values(j.Children).forEach(W=>{H+=V(W)}),H},z=j=>Array.isArray(j)?D(j,!0):typeof j=="object"&&j!==null&&j.Version==="2.0"?V(j.Regions):void 0,G=(j,H,W,q,Q)=>{var ee=j;W.RegionPath&&W.RegionPath!==""&&(ee=j.findOrCreateChildFromPath(W.RegionPath)),x(ee,H,W,2*q,Q)},K=(j,H,W,q,Q)=>{for(var ee=z(H),ne=new R(ee,q,Q),Y=0;Y{var ee=z(H),ne=new R(ee,q,Q);H.Settings&&this.loadSettings(H.Settings),H.Views&&_(W,H.Views),H.Regions&&B(j,W,H.Regions,ne)};this.loadMetadataURL=(j,H,W,q)=>{var Q=new XMLHttpRequest,ee=f(H);Q.onreadystatechange=()=>{if(Q.readyState==4&&Q.status==200){b.resetMetadata(),b.resetDuration(),v=!1;var ne=Q.responseURL;ne===void 0&&(ne=new URL(ee).href);var Y=JSON.parse(Q.responseText);Array.isArray(Y)?K(j,Y,ne,W,q):typeof Y=="object"&&Y!==null&&Y.Version=="2.0"&&ie(j,Y,ne,W,q)}},Q.open("GET",ee,!0),Q.send()}}},(o,l,u)=>{u.r(l),u.d(l,{STLLoader:()=>f});var c=u(4);class f extends c.Loader{constructor(m){super(m)}load(m,y,p,d){var b=this,v=new c.FileLoader(this.manager);v.setPath(this.path),v.setResponseType("arraybuffer"),v.setRequestHeader(this.requestHeader),v.setWithCredentials(this.withCredentials),v.load(m,function(g){try{y(b.parse(g))}catch(M){d?d(M):console.error(M),b.manager.itemError(m)}},p,d)}parse(m){function y(d,b,v){for(var g=0,M=d.length;gM;M++)if(y(g,b,M))return!1;return!0}(p)?function(d){for(var b,v,g,M,_,E,S,w,T=new DataView(d),C=T.getUint32(80,!0),R=!1,P=0;P<70;P++)T.getUint32(P,!1)==1129270351&&T.getUint8(P+4)==82&&T.getUint8(P+5)==61&&(R=!0,M=new Float32Array(3*(3*C)),_=T.getUint8(P+6)/255,E=T.getUint8(P+7)/255,S=T.getUint8(P+8)/255,w=T.getUint8(P+9)/255);for(var L=new c.BufferGeometry,A=new Float32Array(3*(3*C)),I=new Float32Array(3*(3*C)),O=0;O>5)/31,g=(31&V>>10)/31)}for(var z=1;3>=z;z++){var G=x+12*z,K=3*(3*O)+3*(z-1);A[K]=T.getFloat32(G,!0),A[K+1]=T.getFloat32(G+4,!0),A[K+2]=T.getFloat32(G+8,!0),I[K]=N,I[K+1]=B,I[K+2]=D,R&&(M[K]=b,M[K+1]=v,M[K+2]=g)}}return L.setAttribute("position",new c.BufferAttribute(A,3)),L.setAttribute("normal",new c.BufferAttribute(I,3)),R&&(L.setAttribute("color",new c.BufferAttribute(M,3)),L.hasColors=!0,L.alpha=w),L}(p):function(d){for(var b,v=new c.BufferGeometry,g=/solid([\s\S]*?)endsolid/g,M=/facet([\s\S]*?)endfacet/g,_=0,E=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,S=new RegExp("vertex"+E+E+E,"g"),w=new RegExp("normal"+E+E+E,"g"),T=[],C=[],R=new c.Vector3,P=0,L=0,A=0;(b=g.exec(d))!==null;){L=A;for(var I=b[0];(b=M.exec(I))!==null;){for(var O=0,x=0,N=b[0];(b=w.exec(N))!==null;)R.x=parseFloat(b[1]),R.y=parseFloat(b[2]),R.z=parseFloat(b[3]),x++;for(;(b=S.exec(N))!==null;)T.push(parseFloat(b[1]),parseFloat(b[2]),parseFloat(b[3])),C.push(R.x,R.y,R.z),O++,A++;x!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+_),O!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+_),_++}var B=L,D=A-L;v.addGroup(B,D,P),P++}return v.setAttribute("position",new c.Float32BufferAttribute(T,3)),v.setAttribute("normal",new c.Float32BufferAttribute(C,3)),v}(function(d){return typeof d=="string"?d:c.LoaderUtils.decodeText(new Uint8Array(d))}(m))}}},(o,l,u)=>{u.r(l),u.d(l,{OBJLoader:()=>_});var c=u(4),f=/^[og]\s*(.+)?/,h=/^mtllib /,m=/^usemtl /,y=/^usemap /,p=new c.Vector3,d=new c.Vector3,b=new c.Vector3,v=new c.Vector3,g=new c.Vector3;function M(){var E={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(w,T){if(this.object&&this.object.fromDeclaration===!1)return this.object.name=w,void(this.object.fromDeclaration=T!==!1);var C=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:w||"",fromDeclaration:T!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(L,A){var I=this._finalize(!1);I&&(I.inherited||0>=I.groupCount)&&this.materials.splice(I.index,1);var O={index:this.materials.length,name:L||"",mtllib:Array.isArray(A)&&0=this.materials[I].groupCount&&this.materials.splice(I,1);return L&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),A}},C&&C.name&&typeof C.clone=="function"){var R=C.clone(0);R.inherited=!0,this.object.materials.push(R)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(w,T){var C=parseInt(w,10);return 3*(0<=C?C-1:C+T/3)},parseNormalIndex:function(w,T){var C=parseInt(w,10);return 3*(0<=C?C-1:C+T/3)},parseUVIndex:function(w,T){var C=parseInt(w,10);return 2*(0<=C?C-1:C+T/2)},addVertex:function(w,T,C){var R=this.vertices,P=this.object.geometry.vertices;P.push(R[w+0],R[w+1],R[w+2]),P.push(R[T+0],R[T+1],R[T+2]),P.push(R[C+0],R[C+1],R[C+2])},addVertexPoint:function(w){var T=this.vertices,C=this.object.geometry.vertices;C.push(T[w+0],T[w+1],T[w+2])},addVertexLine:function(w){var T=this.vertices,C=this.object.geometry.vertices;C.push(T[w+0],T[w+1],T[w+2])},addNormal:function(w,T,C){var R=this.normals,P=this.object.geometry.normals;P.push(R[w+0],R[w+1],R[w+2]),P.push(R[T+0],R[T+1],R[T+2]),P.push(R[C+0],R[C+1],R[C+2])},addFaceNormal:function(w,T,C){var R=this.vertices,P=this.object.geometry.normals;p.fromArray(R,w),d.fromArray(R,T),b.fromArray(R,C),g.subVectors(b,d),v.subVectors(p,d),g.cross(v),g.normalize(),P.push(g.x,g.y,g.z),P.push(g.x,g.y,g.z),P.push(g.x,g.y,g.z)},addColor:function(w,T,C){var R=this.colors,P=this.object.geometry.colors;R[w]!==void 0&&P.push(R[w+0],R[w+1],R[w+2]),R[T]!==void 0&&P.push(R[T+0],R[T+1],R[T+2]),R[C]!==void 0&&P.push(R[C+0],R[C+1],R[C+2])},addUV:function(w,T,C){var R=this.uvs,P=this.object.geometry.uvs;P.push(R[w+0],R[w+1]),P.push(R[T+0],R[T+1]),P.push(R[C+0],R[C+1])},addDefaultUV:function(){var w=this.object.geometry.uvs;w.push(0,0),w.push(0,0),w.push(0,0)},addUVLine:function(w){var T=this.uvs,C=this.object.geometry.uvs;C.push(T[w+0],T[w+1])},addFace:function(w,T,C,R,P,L,A,I,O){var x=this.vertices.length,N=this.parseVertexIndex(w,x),B=this.parseVertexIndex(T,x),D=this.parseVertexIndex(C,x);if(this.addVertex(N,B,D),this.addColor(N,B,D),A!==void 0&&A!==""){var V=this.normals.length;N=this.parseNormalIndex(A,V),B=this.parseNormalIndex(I,V),D=this.parseNormalIndex(O,V),this.addNormal(N,B,D)}else this.addFaceNormal(N,B,D);if(R!==void 0&&R!==""){var z=this.uvs.length;N=this.parseUVIndex(R,z),B=this.parseUVIndex(P,z),D=this.parseUVIndex(L,z),this.addUV(N,B,D),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(w){this.object.geometry.type="Points";for(var T,C=this.vertices.length,R=0,P=w.length;R{function c(_,E){var S=Object.keys(_);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(_);E&&(w=w.filter(function(T){return Object.getOwnPropertyDescriptor(_,T).enumerable})),S.push.apply(S,w)}return S}function f(_){for(var E,S=1;S{var E=(w,T)=>{w.merge(T)};if(_&&0<_.length){for(;1<_.length;){var S=_.splice(1,1);E(_[0],S[0])}return _[0]}},g=function(E,S,w){var T=new b,C=new p;T.crossOrigin=S;var R=E,P=w,L=void 0,A=!1,I=!1,O=void 0,x=[],N=z=>{var G=L[z.index];if(G){var K=C.parse(G);z.onLoad(K.geometry,K.materials)}else B(z)},B=z=>{z.onError&&(!O&&(O={responseURL:R}),z.onError(O))};this.downloadCompleted=z=>{try{L=JSON.parse(z[0]),A=!1,I=!0,Array.isArray(L)?x.forEach(G=>N(G)):x.forEach(G=>B(G))}catch{x.forEach(K=>B(K))}};var D=()=>z=>{O=z,I=!0,A=!1,x.forEach(G=>{B(G)})},V=()=>z=>{x.forEach(G=>{G.onProgress&&G.onProgress(z)})};this.load=(z,G,K,ie)=>{var j={index:z,onLoad:G,onProgress:K,onError:ie};I?L?N(j):B(O):A?x.push(j):(x.push(j),A=!0,T.load(R,P,V,D))}},M=function(E,S){var w=[],T=E,C=S,R=0;this.itemDownloaded=(P,L)=>{if(w[P]=L,R++,R==T){for(var A=w[0][1],I=w.map(N=>N[0]),O=v(I),x=1;xN.dispose());C(O,A)}}};l.PrimitivesLoader=function(){var _=0,E=20;this.crossOrigin="Anonymous";var S=new p,w=[],T={},C=(A,I,O,x,N)=>{var B=A.length,D=new M(B,I),V=0;A.forEach(z=>{var G=N?f({},N):{};G.msHandler=D,G.order=V,V++,P(z,I,O,x,G)})},R=(A,I,O,x,N)=>{var B=N?f({},N):{},D=T[A];if(!D)if(E>_){var V=new L(void 0,this,B);++_,D=new g(A,this.crossOrigin,V),T[A]=D}else w.push({url:A,onLoad:I,onProgress:O,onError:x,options:N});D&&(B.isHandler=D,D.load(N.index,I,O,x))},P=(A,I,O,x,N)=>{if(N&&N.index!==void 0)R(A,I,O,x,N);else if(E>_){++_;var B=new L(I,this,N),D=new L(x,this,N);S.crossOrigin=this.crossOrigin,S.load(A,B,O,D)}else w.push({url:A,onLoad:I,onProgress:O,onError:x,options:N})};this.load=(A,I,O,x,N)=>{Array.isArray(A)?C(A,I,O,x,N):P(A,I,O,x,N)},this.loadFromWaitingList=()=>{for(;E>_;){var A=w.shift();if(A)this.load(A.url,A.onLoad,A.onProgress,A.onError,A.options);else return}},this.itemRemainingCheck=()=>{if(w.length===0&&_==0)for(var A in T)T.hasOwnProperty(A)&&delete T[A]};var L=function(I,O,x){return function(){--_;for(var N=arguments.length,B=Array(N),D=0;DS.parse(A)}},(o,l,u)=>{u(4);var c=u(40).GLTFLoader,f=function(){var h=this;this.parseGLTFObjects=(m,y,p,d)=>{var b=y;if(p!==0){if(m.type!=="Object3D"){var v;if(m.type==="Mesh"?v=new(u(3)).Geometry:m.type==="LineSegments"?v=new(u(24)).Lines:m.type==="Points"&&(v=new(u(22)).Pointset),v){var g=!1,M=!1;m.geometry&&m.geometry.morphAttributes&&(g=!!m.geometry.morphAttributes.position,M=!!m.geometry.morphAttributes.color),v.setMesh(m.clone(),g,M);var _=v.getMorph();v.groupName=_.name,_.matrixAutoUpdate=!0,y.addZincObject(v),d!=null&&typeof d=="function"&&d(v)}}else if(m.name!==""&&(y&&(b=y.findOrCreateChildFromPath(m.name)),b)){var E=b.getGroup();E.position.copy(m.position),E.rotation.copy(m.rotation),E.quaternion.copy(m.quaternion),E.matrixAutoUpdate=!0}}p++,m.children.forEach(S=>{h.parseGLTFObjects(S,b,p,d)})},this.setCamera=m=>{m.viewAll();var y=m.getZincCameraControls(),p=y.getCurrentViewport();y.addViewport("default",p),y.setDefaultViewport("default")},this.load=(m,y,p,d,b)=>{var v=p.substring(0,p.lastIndexOf("/")+1),g=p.substring(p.lastIndexOf("/")+1,p.length),M=new c().setPath(v);M.load(g,function(_){console.log(_),h.parseGLTFObjects(_.scene,y,0,d),h.setCamera(m),b!=null&&typeof b=="function"&&b()})}};l.GLTFToZincJSLoader=f},o=>{o.exports=XB},(o,l,u)=>{var c=u(42).GLTFExporter,f=function(h){var m=h;this.exportGLTF=y=>{var p=m.getRootRegion(),d=p.getAllObjects(!0),b=[];d.forEach(M=>{M.animationClip&&b.push({clip:M.animationClip[0],mesh:M.getMorph()})});var v=new c,g={binary:y,animations:b};return new Promise(M=>{v.parse(m.getThreeJSScene(),function(_){M(_)},g)})}};l.SceneExporter=f},(o,l,u)=>{u.r(l),u.d(l,{GLTFExporter:()=>f});var c=u(4);class f{constructor(){this.pluginCallbacks=[],this.register(function(x){return new L(x)}),this.register(function(x){return new A(x)}),this.register(function(x){return new I(x)})}register(x){return this.pluginCallbacks.indexOf(x)===-1&&this.pluginCallbacks.push(x),this}unregister(x){return this.pluginCallbacks.indexOf(x)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(x),1),this}parse(x,N,B){for(var D=new P,V=[],z=0,G=this.pluginCallbacks.length;zD&&(D=0)}if(D===0)return null;var j,H=w(x,B,D);N!==void 0&&(j=x===N.index?h.ELEMENT_ARRAY_BUFFER:h.ARRAY_BUFFER);var W=this.processBufferView(x,V,B,D,j),q={bufferView:W.id,byteOffset:W.byteOffset,componentType:V,count:D,max:H.max,min:H.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"}[x.itemSize]};return x.normalized===!0&&(q.normalized=!0),G.accessors||(G.accessors=[]),G.accessors.push(q)-1}processImage(x,N,B){var D=this,V=D.cache,z=D.json,G=D.options,K=D.pending;V.images.has(x)||V.images.set(x,{});var ie=V.images.get(x),j=N===c.RGBAFormat?"image/png":"image/jpeg",H=j+":flipY/"+B.toString();if(ie[H]!==void 0)return ie[H];z.images||(z.images=[]);var W={mimeType:j};if(G.embedImages){var q=R=R||document.createElement("canvas");q.width=Math.min(x.width,G.maxTextureSize),q.height=Math.min(x.height,G.maxTextureSize);var Q=q.getContext("2d");if(B===!0&&(Q.translate(0,q.height),Q.scale(1,-1)),typeof HTMLImageElement<"u"&&x instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&x instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&x instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&x instanceof ImageBitmap)Q.drawImage(x,0,0,q.width,q.height);else{N!==c.RGBAFormat&&N!==c.RGBFormat&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(x.width>G.maxTextureSize||x.height>G.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",x);var ee=new Uint8ClampedArray(4*(x.height*x.width));if(N===c.RGBAFormat)for(var ne=0;nehe&&be.setXYZ(he,ue.getX(he)-se.getX(he),ue.getY(he)-se.getY(he),ue.getZ(he)-se.getZ(he));else for(var Te=0,He=ue.count;Te=x.far?.001:x.far,znear:0>x.near?0:x.near}:D.perspective={aspectRatio:x.aspect,yfov:c.MathUtils.degToRad(x.fov),zfar:0>=x.far?.001:x.far,znear:0>x.near?0:x.near},x.name!==""&&(D.name=x.type),N.cameras.push(D)-1}processAnimation(x,N){var B=this.json,D=this.nodeMap;B.animations||(B.animations=[]),x=f.Utils.mergeMorphTargetTracks(x.clone(),N);for(var V=x.tracks,z=[],G=[],K=0;Kx.times[x.times.length-1]){if(Math.abs(x.times[x.times.length-1]-N)N){z.set(x.times.slice(0,j+1),0),z[j+1]=N,z.set(x.times.slice(j+1),j+2),G.set(x.values.slice(0,(j+1)*V),0),G.set(K.evaluate(N),(j+1)*V),G.set(x.values.slice((j+1)*V),(j+2)*V),B=j+1;break}}return x.times=z,x.values=G,B},mergeMorphTargetTracks:function(x,N){for(var B=[],D={},V=x.tracks,z=0;z{var c=u(4),f=u(5).resolveURL,h=function(){this.nearPlane=.168248,this.farPlane=6.82906,this.eyePosition=[.5,-2.86496,.5],this.targetPosition=[.5,.5,.5],this.upVector=[0,0,1];var E=this;this.setFromObject=S=>{var{nearPlane:w,farPlane:T,eyePosition:C,targetPosition:R,upVector:P}=S;E.nearPlane=w,E.farPlane=T,E.eyePosition=C,E.targetPosition=R,E.upVector=P}},m=function(E,S,w,T){var C={NONE:-1,DEFAULT:0,PATH:1,SMOOTH_CAMERA_TRANSITION:2,AUTO_TUMBLE:3,ROTATE_TRANSITION:4,MINIMAP:5,SYNC_CONTROL:6},R={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM:4,TOUCH_PAN:5,SCROLL:6},P={NONE:-1,FREE:1,HORIZONTAL:2,VERTICAL:3},L={};L.MAIN=R.ROTATE,L.AUXILIARY=R.ZOOM,L.SECONDARY=R.PAN,this.cameraObject=E,this.domElement=S===void 0?document:S,this.renderer=w,this.scene=T,this.tumble_rate=1.5,this.pointer_x=0,this.pointer_y=0,this.pointer_x_start=0,this.pointer_y_start=0,this.previous_pointer_x=0,this.previous_pointer_y=0,this.near_plane_fly_debt=0,this.touchZoomDistanceStart=0,this.touchZoomDistanceEnd=0,this.directionalLight=0,this.scrollRate=50,this.pixelHeight=1;var A=6e3,I=!0,O=0,x=void 0,N=void 0,B=!1,D=500,V=void 0,z="default",G=C.DEFAULT,K=void 0,ie=void 0,j=void 0,H=0,W=P.FREE;this._state=R.NONE;var q;this.targetTouchId=-1;var Q=void 0,ee=new c.Vector3,ne=new c.Vector3,Y=new c.Vector3,te=new c.Vector3,F=new c.Vector3,$=new c.Vector3,J=new c.Vector3,k=new c.Vector3,U=new c.Sphere,oe=new c.Vector3,le=!1,ae=void 0,fe=0,ge={default:new h};ge.default.nearPlane=.1,ge.default.farPlane=2e3,ge.default.eyePosition=[0,0,0],ge.default.targetPosition=[0,0,-1],ge.default.upVector=[0,1,0],this.cameraObject.target===void 0&&(this.cameraObject.target=new c.Vector3(...ge.default.targetPosition)),this.calculateMaxAllowedDistance=re=>{var Me=re.getBoundingBox();if(Me){Me.getBoundingSphere(U),fe=6*U.radius;var Ce=0;this.cameraObject&&(Ce=this.cameraObject.position.distanceTo(U.center)),fe=Ce>fe?Ce:fe}else fe=0},this.addViewport=(re,Me)=>{re&&Me&&(ge[re]=Me)},this.setDefaultViewport=re=>!!(re&&re in ge)&&(z=re,!0),this.getDefaultViewport=()=>z,this.getViewportOfName=re=>ge[re],this.setCurrentViewport=re=>re in ge&&(this.setCurrentCameraSettings(ge[re]),!0),this.setRotationMode=re=>{switch(re){case"none":W=P.NONE;break;case"horizontal":W=P.HORIZONTAL;break;case"vertical":W=P.VERTICAL;break;case"free":default:W=P.FREE}},this.onResize=()=>{Q&&(Q=void 0),ae&&ae.setCurrentCameraSettings(this.cameraObject,ge[z])},this.getVisibleHeightAtZDepth=re=>{var Me=this.cameraObject.position.distanceTo(this.cameraObject.target);re{var Me=this.getVisibleHeightAtZDepth(0);return this.pixelHeight=Me/re,this.pixelHeight},this.getNDCFromDocumentCoords=(re,Me,Ce)=>{Re(!1);var Ne=Ce||new c.Vector2,Xe=2*((re-Q.left)/Q.width)-1,it=2*-((Me-Q.top)/Q.height)+1;return Ne.set(Xe,it)},this.getRelativeCoordsFromNDC=(re,Me,Ce)=>{Re(!1);var Ne=Ce||new c.Vector2;return Ne.x=(re+1)*Q.width/2,Ne.y=(1-Me)*Q.height/2,Ne},this.setMouseButtonAction=(re,Me)=>{L[re]=R[Me]};var we=()=>{if(0re||this.cameraObject.position.distanceTo(U.center)>re}return!0},ue=re=>{oe.copy(this.cameraObject.position).add(re),we()&&(this.cameraObject.target.add(re),this.cameraObject.position.add(re),this.updateDirectionalLight())},ye=re=>{Re(!1);var Me;if(G===C.DEFAULT&&(Me=this.scene.getNormalisedMinimapCoordinates(this.renderer,re)),!Me)re.button==0?re.ctrlKey?this._state=L.AUXILIARY:re.shiftKey?this._state=L.SECONDARY:this._state=L.MAIN:re.button==1?(re.preventDefault(),this._state=L.AUXILIARY):re.button==2&&(this._state=L.SECONDARY),this.pointer_x=re.clientX-Q.left,this.pointer_y=re.clientY-Q.top,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y;else{G=C.MINIMAP;var Ce=this.scene.getMinimapDiffFromNormalised(Me.x,Me.y);ue(Ce)}},se=re=>{if(Re(!1),Q)if(this.pointer_x=re.clientX-Q.left,this.pointer_y=re.clientY-Q.top,G===C.MINIMAP){var Me=this.scene.getNormalisedMinimapCoordinates(this.renderer,re);if(Me){var Ce=this.scene.getMinimapDiffFromNormalised(Me.x,Me.y);ue(Ce)}}else this._state===R.NONE&&q!==void 0&&q.move(this,re.clientX,re.clientY,this.renderer)},be=re=>{this._state=R.NONE,G==C.MINIMAP&&(G=C.DEFAULT),q!==void 0&&this.pointer_x_start==re.clientX-Q.left&&this.pointer_y_start==re.clientY-Q.top&&q.pick(this,re.clientX,re.clientY,this.renderer)},he=re=>{this._state=R.NONE},me=re=>{Re(!1);var Me=re.touches.length;if(Me==1)this._state=R.TOUCH_ROTATE,this.pointer_x=re.touches[0].clientX-Q.left,this.pointer_y=re.touches[0].clientY-Q.top,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y;else if(Me==2){this._state=R.TOUCH_ZOOM;var Ce=re.touches[0].clientX-re.touches[1].clientX,Ne=re.touches[0].clientY-re.touches[1].clientY;this.touchZoomDistanceEnd=this.touchZoomDistanceStart=Math.sqrt(Ce*Ce+Ne*Ne)}else Me==3&&(this._state=R.TOUCH_PAN,this.targetTouchId=re.touches[0].identifier,this.pointer_x=re.touches[0].clientX-Q.left,this.pointer_y=re.touches[0].clientY-Q.top,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y)},Te=re=>{re.preventDefault(),re.stopPropagation();var Me=re.touches.length;if(Me==1)this.pointer_x=re.touches[0].clientX-Q.left,this.pointer_y=re.touches[0].clientY-Q.top;else if(Me==2){if(this._state===R.TOUCH_ZOOM){var Ce=re.touches[0].clientX-re.touches[1].clientX,Ne=re.touches[0].clientY-re.touches[1].clientY;this.touchZoomDistanceEnd=Math.sqrt(Ce*Ce+Ne*Ne)}}else if(Me==3&&this._state===R.TOUCH_PAN)for(var Xe=0;3>Xe;Xe++)re.touches[Xe].identifier==this.targetTouchId&&(this.pointer_x=re.touches[0].clientX-Q.left,this.pointer_y=re.touches[0].clientY-Q.top)},He=re=>{var Me=re.touches.length;this.touchZoomDistanceStart=this.touchZoomDistanceEnd=0,this.targetTouchId=-1,this._state=R.NONE,Me==1&&q!==void 0&&this.pointer_x_start==re.touches[0].clientX-Q.left&&this.pointer_y_start==re.touches[0].clientY-Q.top&&q.pick(this.cameraObject,re.touches[0].clientX,re.touches[0].clientY,this.renderer)},tt=()=>{Re(!0)},Re=re=>{if(re||Q===void 0){var Me=new IntersectionObserver(Ce=>{for(var Ne of Ce)Q=Ne.boundingClientRect;Me.disconnect()});Me.observe(this.domElement)}},ot=re=>{Re(!1),this._state=R.SCROLL;var Me=0;0re.deltaY&&(Me=-1*this.scrollRate),H+=Me,re.preventDefault(),re.stopImmediatePropagation()},Pe=()=>{if(typeof this.cameraObject<"u"){var re=Q.height,Me=this.cameraObject.position.distanceTo(this.cameraObject.target),Ce=0;this.cameraObject.far>this.cameraObject.near&&Me>=this.cameraObject.near&&Me<=this.cameraObject.far&&(Ce=(Me-this.cameraObject.near)/(this.cameraObject.far-this.cameraObject.near)),ne.set(this.previous_pointer_x,re-this.previous_pointer_y,0),Y.set(this.previous_pointer_x,re-this.previous_pointer_y,1),te.set(this.pointer_x,re-this.pointer_y,0),F.set(this.pointer_x,re-this.pointer_y,1),ne.unproject(this.cameraObject),Y.unproject(this.cameraObject),te.unproject(this.cameraObject),F.unproject(this.cameraObject);var Ne=-.002;te.sub(ne).multiplyScalar(1-Ce),F.sub(Y).multiplyScalar(Ce),te.add(F).multiplyScalar(Ne),ue(te)}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y};this.getVectorsFromRotateAboutLookAtPoints=(re,Me)=>{re.normalize(),J.copy(this.cameraObject.position).sub(this.cameraObject.target),k.copy(J),J.normalize(),.8{var Ce=this.getVectorsFromRotateAboutLookAtPoints(re,Me);this.cameraObject.position.copy(Ce.position),this.updateDirectionalLight(),this.cameraObject.up.copy(Ce.up)};var Je=()=>{if(typeof this.cameraObject<"u"){var re=Q.width,Me=Q.height;if(0{var re=0;return this._state===R.ZOOM?re=this.previous_pointer_y-this.pointer_y:this._state===R.SCROLL?re=H:(re=-1*(this.touchZoomDistanceEnd-this.touchZoomDistanceStart),this.touchZoomDistanceStart=this.touchZoomDistanceEnd),re};this.changeZoomByScrollRateUnit=re=>{var Me=re*this.scrollRate;this.changeZoomByValue(Me)},this.changeZoomByValue=re=>{if(typeof this.cameraObject<"u"){var Me=Q.height,Ce=this.cameraObject.position.clone();Ce.sub(this.cameraObject.target);var Ne=Ce.length(),Xe=1.5*re/Me;if(.01{var re=We();this.changeZoomByValue(re),this._state===R.ZOOM&&(this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y),this._state===R.SCROLL&&(H=0,this._state=R.NONE)};this.setDirectionalLight=re=>{this.directionalLight=re},this.updateDirectionalLight=()=>{this.directionalLight!=0&&this.directionalLight.position.set(this.cameraObject.position.x,this.cameraObject.position.y,this.cameraObject.position.z)},this.enable=function(){I=!0,this.domElement&&this.domElement.addEventListener&&(this.domElement.addEventListener("mousedown",ye,!1),this.domElement.addEventListener("mousemove",se,!1),this.domElement.addEventListener("mouseup",be,!1),this.domElement.addEventListener("mouseleave",he,!1),this.domElement.addEventListener("touchstart",me,!1),this.domElement.addEventListener("touchmove",Te,!1),this.domElement.addEventListener("touchend",He,!1),this.domElement.addEventListener("wheel",ot,!1),this.domElement.addEventListener("contextmenu",re=>{re.preventDefault()},!1),this.domElement.addEventListener("mouseenter",tt,!1))},this.disable=function(){I=!1,this.domElement&&this.domElement.removeEventListener&&(this.domElement.removeEventListener("mousedown",ye,!1),this.domElement.removeEventListener("mousemove",se,!1),this.domElement.removeEventListener("mouseup",be,!1),this.domElement.removeEventListener("mouseleave",he,!1),this.domElement.removeEventListener("touchstart",me,!1),this.domElement.removeEventListener("touchmove",Te,!1),this.domElement.removeEventListener("touchend",He,!1),this.domElement.removeEventListener("wheel",ot,!1),this.domElement.removeEventListener("mouseenter",tt,!1),this.domElement.removeEventListener("contextmenu",re=>{re.preventDefault()},!1))},this.loadPath=re=>{x=re.CameraPath,N=re.NumberOfPoints},this.loadPathURL=(re,Me)=>{var Ce=new XMLHttpRequest;Ce.onreadystatechange=()=>{if(Ce.readyState==4&&Ce.status==200){var Xe=JSON.parse(Ce.responseText);this.loadPath(Xe),Me!=null&&typeof Me=="function"&&Me()}};var Ne=f(re);Ce.open("GET",Ne,!0),Ce.send()},this.setPathDuration=re=>{A=re,K&&K.setDuration(A),ie&&ie.setDuration(A)},this.getPlayRate=()=>D,this.setPlayRate=re=>{D=re};var et=re=>{var Me=O+re;Me>A&&(Me-=A),O=Me};this.getTime=()=>O,this.setTime=re=>{O=re>A?A:0>re?0:re},this.getNumberOfTimeFrame=()=>N,this.getCurrentTimeFrame=()=>{if(2{2O&&(O=0),O>A&&(O=A))};var Tt=re=>{if(G===C.PATH&&(et(re),x)){for(var Me=this.getCurrentTimeFrame(),Ce=Me[0],Ne=Me[1],Xe=Me[2],it=[x[3*Ce],x[3*Ce+1],x[3*Ce+2]],ct=[x[3*Ne],x[3*Ne+1],x[3*Ne+2]],pt=[],Et=0;Et{Tt(0)};var xt=()=>{this._state===R.ROTATE||this._state===R.TOUCH_ROTATE?Je():this._state===R.PAN||this._state===R.TOUCH_PAN?(Pe(),ae.triggerCallback()):(this._state===R.ZOOM||this._state===R.TOUCH_ZOOM||this._state===R.SCROLL)&&(ae.zoom(We()),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y,this._state===R.SCROLL&&(this._state=R.NONE),H=0,ae.triggerCallback())};this.update=re=>{var Me=re*D,Ce=I,Ne=!0;return G===C.PATH?Tt(Me):G===C.SMOOTH_CAMERA_TRANSITION&&K?(K.update(Me),K.isTransitionCompleted()&&(G=C.DEFAULT),Ce=!1):G===C.ROTATE_CAMERA_TRANSITION&&ie?(ie.update(Me),ie.isTransitionCompleted()&&(G=C.DEFAULT),Ce=!1):G===C.AUTO_TUMBLE&&j?j.update(Me):G===C.SYNC_CONTROL&&ae?(xt(),Ce=!1):Ne=!1,Ce&&(this._state!==R.NONE&&(Ne=!0),this._state===R.ROTATE||this._state===R.TOUCH_ROTATE?Je():this._state===R.PAN||this._state===R.TOUCH_PAN?Pe():(this._state===R.ZOOM||this._state===R.TOUCH_ZOOM||this._state===R.SCROLL)&&at(),this._state!==R.NONE&&G===C.AUTO_TUMBLE&&j&&j.stopOnCameraInput,this._state===R.SCROLL&&(this._state=R.NONE)),V?(Ne=!0,V.update()):this.cameraObject.lookAt(this.cameraObject.target),Ne=Ne||le,le=!1,Ne},this.playPath=()=>{G=C.PATH},this.stopPath=()=>{G=C.DEFAULT},this.isPlayingPath=()=>G===C.PATH,this.enableDirectionalLightUpdateWithPath=re=>{B=re},this.enableDeviceOrientation=()=>{V||(V=new M(this.cameraObject))},this.disableDeviceOrientation=()=>{V&&(V.dispose(),V=void 0)},this.isDeviceOrientationEnabled=()=>!!V,this.resetView=()=>{var re=ge[z];this.cameraObject.near=re.nearPlane,this.cameraObject.far=re.farPlane,this.cameraObject.position.set(re.eyePosition[0],re.eyePosition[1],re.eyePosition[2]),this.cameraObject.target.set(re.targetPosition[0],re.targetPosition[1],re.targetPosition[2]),this.cameraObject.up.set(re.upVector[0],re.upVector[1],re.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight()},this.setCurrentCameraSettings=re=>{re.nearPlane&&(this.cameraObject.near=re.nearPlane),re.farPlane&&(this.cameraObject.far=re.farPlane),re.eyePosition&&this.cameraObject.position.set(re.eyePosition[0],re.eyePosition[1],re.eyePosition[2]),re.targetPosition&&this.cameraObject.target.set(re.targetPosition[0],re.targetPosition[1],re.targetPosition[2]),re.upVector&&this.cameraObject.up.set(re.upVector[0],re.upVector[1],re.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight(),le=!0},this.getViewportFromCentreAndRadius=(re,Me,Ce,Ne,Xe,it)=>{var ct=this.cameraObject.position.x-this.cameraObject.target.x,pt=this.cameraObject.position.y-this.cameraObject.target.y,Et=this.cameraObject.position.z-this.cameraObject.target.z,Z=1/Math.sqrt(ct*ct+pt*pt+Et*Et);ct*=Z,pt*=Z,Et*=Z;var pe=[re,Me,Ce],de=Ne/Math.tan(Xe*Math.PI/360),ve=[re+ct*de,Me+pt*de,Ce+Et*de],Ee=de+it,ce=0,xe=.95;ce=it>xe*de?(1-xe)*de:de-it;var _e=new h;return _e.nearPlane=ce,_e.farPlane=Ee,_e.eyePosition=ve,_e.targetPosition=pe,_e.upVector=[this.cameraObject.up.x,this.cameraObject.up.y,this.cameraObject.up.z],_e},this.getViewportFromBoundingBox=(re,Me)=>{var Ce=re.min.distanceTo(re.max)/2*Me,Ne=(re.min.x+re.max.x)/2,Xe=(re.min.y+re.max.y)/2,it=(re.min.z+re.max.z)/2,ct=4,pt=this.getViewportFromCentreAndRadius(Ne,Xe,it,Ce,40,Ce*ct);return pt},this.getCurrentViewport=()=>{var re=new h;return re.nearPlane=this.cameraObject.near,re.farPlane=this.cameraObject.far,re.eyePosition[0]=this.cameraObject.position.x,re.eyePosition[1]=this.cameraObject.position.y,re.eyePosition[2]=this.cameraObject.position.z,re.targetPosition[0]=this.cameraObject.target.x,re.targetPosition[1]=this.cameraObject.target.y,re.targetPosition[2]=this.cameraObject.target.z,re.upVector[0]=this.cameraObject.up.x,re.upVector[1]=this.cameraObject.up.y,re.upVector[2]=this.cameraObject.up.z,re},this.getDefaultEyePosition=()=>eyePosition,this.getDefaultTargetPosition=()=>targetPosition,this.cameraTransition=(re,Me,Ce)=>{ie==null&&(K=new y(re,Me,this,Ce))},this.rotateCameraTransition=(re,Me,Ce)=>{K==null&&(ie=new p(re,Me,this,Ce))},this.enableCameraTransition=()=>{K&&(G=C.SMOOTH_CAMERA_TRANSITION),ie&&(G=C.ROTATE_CAMERA_TRANSITION)},this.pauseCameraTransition=()=>{G=C.DEFAULT},this.stopCameraTransition=()=>{G=C.DEFAULT,K=void 0,ie=void 0},this.isTransitioningCamera=()=>G===C.SMOOTH_CAMERA_TRANSITION||G===C.ROTATE_CAMERA_TRANSITION,this.autoTumble=(re,Me,Ce)=>{j=new b(re,Me,Ce,this)},this.enableAutoTumble=()=>{G=C.AUTO_TUMBLE},this.stopAutoTumble=()=>{G=C.DEFAULT,j=void 0},this.updateAutoTumble=()=>{j&&(j.requireUpdate=!0)},this.isAutoTumble=()=>G===C.AUTO_TUMBLE,this.enableRaycaster=(re,Me,Ce)=>{q==null&&(q=new d(re,this.scene,Me,Ce,this.renderer))},this.disableRaycaster=()=>{q.disable(),q=void 0},this.isSyncControl=()=>currentMpde===C.SYNC_CONTROL,this.enableSyncControl=()=>(G=C.SYNC_CONTROL,ae||(ae=new _),ae.setCurrentCameraSettings(this.cameraObject,ge[z]),ae),this.disableSyncControl=()=>{G=C.DEFAULT,this.cameraObject.zoom=1,this.cameraObject.updateProjectionMatrix()},this.enable()},y=function(S,w,T,C){var R=S.eyePosition,P=S.targetPosition,L=S.upVector,A=w.eyePosition,I=w.targetPosition,O=w.upVector,x=T,N=C,B=0,D=!1;x.near=Math.min(S.nearPlane,w.nearPlane),x.far=Math.max(S.farPlane,w.farPlane),x.cameraObject.up.set(w.upVector[0],w.upVector[1],w.upVector[2]),this.setDuration=G=>{N=G};var V=G=>{var K=B+G;K>N&&(K=N),B=K},z=()=>{var G=B/N,K=[R[0]*(1-G)+A[0]*G,R[1]*(1-G)+A[1]*G,R[2]*(1-G)+A[2]*G],ie=[P[0]*(1-G)+I[0]*G,P[1]*(1-G)+I[1]*G,P[2]*(1-G)+I[2]*G];L[0]*(1-G)+O[0]*G,L[1]*(1-G)+O[1]*G,L[2]*(1-G)+O[2]*G,x.cameraObject.position.set(K[0],K[1],K[2]),x.cameraObject.target.set(ie[0],ie[1],ie[2])};this.update=G=>{this.enabled===!1||(V(G),z(),B==N&&(D=!0))},this.isTransitionCompleted=()=>D},p=function(S,w,T,C){var R=S,P=w,L=T,A=C,I=0,O=!1;this.setDuration=N=>{A=N};var x=N=>{var B=I,D=I+N;D>A&&(D=A),I=D;var V=I-B,z=V/A,G=z*P;L.rotateAboutLookAtpoint(R,G)};this.update=N=>{this.enabled===!1||(x(N),I==A&&(O=!0))},this.isTransitionCompleted=()=>O},d=function(S,w,T,C,R){var P=S,L=w,A=R,I=T,O=C,x=new c.Raycaster;x.params.Line.threshold=.1,x.params.Points.threshold=1;var N=new c.Vector2,B=!1,D=new Date,V=!1,z=0,G=[],K={zincCamera:void 0,x:-1,y:-1},ie=void 0;this.enable=()=>{enable=!0},this.disable=()=>{enable=!1},this.getIntersectsObject=W=>{if(L!==P){var q=P.getThreeJSScene();A.render(q,W.cameraObject)}var Q=ie||P.getPickableThreeJSObjects();return G.length=0,x.intersectObjects(Q,!0,G)},this.setPickableObjects=W=>{W===void 0?ie=void 0:(ie=[],W.forEach(q=>{q.getGroup()&&q.getGroup().visible&&ie.push(q.getGroup())}))},this.getIntersectsObjectWithOrigin=(W,q,Q)=>(x.set(q,Q),this.getIntersectsObject(W)),this.getIntersectsObjectWithCamera=(W,q,Q)=>(W.getNDCFromDocumentCoords(q,Q,N),x.setFromCamera(N,W.cameraObject),this.getIntersectsObject(W)),this.pick=(W,q,Q)=>{if(A&&P&&W&&I){this.getIntersectsObjectWithCamera(W,q,Q);for(var ee,ne=G.length,Y=0;Y{if(A&&P&&W&&O){if(this.getIntersectsObjectWithCamera(W,q,Q),D.setTime(Date.now()),G.length===0){if(V)return;V=!0}else V=!1;O(G,q,Q)}};this.move=(W,q,Q)=>{A&&P&&W&&O&&(P.displayMarkers?j(W,q,Q):(K.zincCamera=W,K.x=q,K.y=Q,!B&&(z=D?Date.now()-D.getTime():250,250<=z?j(W,q,Q):(B=!0,setTimeout(H(K),z)))))};var H=W=>function(){B=!1,j(W.zincCamera,W.x,W.y)}},b=function(S,w,T,C){var R=new c.Vector3,P=-w,L=C,A=S;this.stopOnCameraInput=T,this.requireUpdate=!0;var I=new c.Vector3,O=new c.Vector3,x=N=>{var B=Math.sqrt(N[0]*N[0]+N[1]*N[1]),D=4*Math.abs(N[0]),V=4*Math.abs(N[1]),z=.25*(D+V),G=-N[1]/B,K=N[0]/B,ie=G*N[0]+K*-N[1];ie>z?ie=z:ie<-z&&(ie=-z);var j=Math.acos(ie/z)-.5*Math.PI;R.copy(L.cameraObject.position).sub(L.cameraObject.target).normalize(),I.copy(L.cameraObject.up).normalize(),O.crossVectors(I,R).normalize().multiplyScalar(G),I.multiplyScalar(K),I.add(O).multiplyScalar(Math.cos(j)),R.multiplyScalar(Math.sin(j)).add(I)};this.update=N=>{this.enabled===!1||(this.requireUpdate&&(x(A),this.requireUpdate=!1),L.rotateAboutLookAtpoint(R,P*N/1e3))}},v=function(){this.type="StereoCamera",this.aspect=1,this.cameraL=new c.PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new c.PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1};Object.assign(v.prototype,{update:(()=>{var E,S,w,T,C,R,P=new c.Matrix4,L=new c.Matrix4;return function(I){var O=E!==I.focus||S!==I.fov||w!==I.aspect*this.aspect||T!==I.near||C!==I.far||R!==I.zoom;if(O){E=I.focus,S=I.fov,w=I.aspect*this.aspect,T=I.near,C=I.far,R=I.zoom;var x,N,B=I.projectionMatrix.clone(),D=.064/2,V=D*T/E,z=T*Math.tan(.5*(c.Math.DEG2RAD*S))/I.zoom;L.elements[12]=-D,P.elements[12]=D,x=-z*w+V,N=z*w+V,B.elements[0]=2*T/(N-x),B.elements[8]=(N+x)/(N-x),this.cameraL.projectionMatrix.copy(B),x=-z*w-V,N=z*w-V,B.elements[0]=2*T/(N-x),B.elements[8]=(N+x)/(N-x),this.cameraR.projectionMatrix.copy(B)}this.cameraL.matrixWorld.copy(I.matrixWorld).multiply(L),this.cameraR.matrixWorld.copy(I.matrixWorld).multiply(P)}})()});var g=function(S){var w=new v;w.aspect=.5,this.setSize=(T,C)=>{S.setSize(T,C)},this.render=(T,C)=>{T.updateMatrixWorld(),C.parent===null&&C.updateMatrixWorld(),w.update(C);var R=S.getSize();S.setScissorTest(!0),S.clear(),S.setScissor(0,0,R.width/2,R.height),S.setViewport(0,0,R.width/2,R.height),S.render(T,w.cameraL),S.setScissor(R.width/2,0,R.width/2,R.height),S.setViewport(R.width/2,0,R.width/2,R.height),S.render(T,w.cameraR),S.setScissorTest(!1)}},M=function(S){var w=this;this.object=S,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0;var T=P=>{w.deviceOrientation=P},C=()=>{typeof window<"u"&&(w.screenOrientation=window.orientation||0)},R=(()=>{var P=new c.Vector3(0,0,1),L=new c.Euler,A=new c.Quaternion,I=new c.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5));return(O,x,N,B,D)=>{var V=new c.Vector3(0,0,1);V.subVectors(O.target,O.position),L.set(N,x,-B,"YXZ");var z=new c.Quaternion;z.setFromEuler(L),z.multiply(I),z.multiply(A.setFromAxisAngle(P,-D)),V.applyQuaternion(z),V.addVectors(O.position,V),O.lookAt(V)}})();this.connect=()=>{C(),typeof window<"u"&&(window.addEventListener("orientationchange",C,!1),window.addEventListener("deviceorientation",T,!1)),w.enabled=!0},this.disconnect=()=>{typeof window<"u"&&(window.removeEventListener("orientationchange",C,!1),window.removeEventListener("deviceorientation",T,!1)),w.enabled=!1},this.update=()=>{if(w.enabled!==!1){var P=w.deviceOrientation.alpha?c.Math.degToRad(w.deviceOrientation.alpha):0,L=w.deviceOrientation.beta?c.Math.degToRad(w.deviceOrientation.beta):0,A=w.deviceOrientation.gamma?c.Math.degToRad(w.deviceOrientation.gamma):0,I=w.screenOrientation?c.Math.degToRad(w.screenOrientation):0;R(w.object,P,L,A,I)}},this.dispose=function(){this.disconnect()},this.connect()},_=function(){var S=void 0,w=void 0,T=void 0,C=new c.Vector3,R=new c.Vector3,P=new c.Vector3,L=new c.Vector3,A=void 0;this.setCurrentCameraSettings=(I,O)=>{S=I.clone(),w=I,T=O,S.near=T.nearPlane,T.farPlane&&(S.far=T.farPlane),T.eyePosition&&S.position.set(T.eyePosition[0],T.eyePosition[1],T.eyePosition[2]),T.upVector&&S.up.set(T.upVector[0],T.upVector[1],T.upVector[2]),T.targetPosition&&(S.target=new c.Vector3(T.targetPosition[0],T.targetPosition[1],T.targetPosition[2]),S.lookAt(S.target)),S.updateProjectionMatrix(),C.copy(S.position).project(S),R.copy(S.target).project(S)},this.getCurrentPosition=()=>(R.copy(w.target).project(S),[R.x,R.y]),this.zoom=I=>{var O=.002*I,x=Math.max(w.zoom-O,1);w.zoom=x,w.updateProjectionMatrix()},this.zoomToBox=(I,O)=>{I.getCenter(P),P.project(S),this.setCenterZoom([P.x,P.y],O)},this.getPanZoom=()=>({target:this.getCurrentPosition(),zoom:w.zoom}),this.setCenterZoom=(I,O)=>{P.set(I[0],I[1],R.z).unproject(S),L.copy(P).sub(w.target),w.target.copy(P),w.lookAt(w.target),w.position.add(L),w.zoom=O,w.updateProjectionMatrix()},this.setEventCallback=I=>{(I===void 0||typeof I=="function")&&(A=I)},this.triggerCallback=()=>{A!==void 0&&typeof A=="function"&&A()}};l.Viewport=h,l.CameraControls=m,l.SmoothCameraTransition=y,l.RotateCameraTransition=p,l.RayCaster=d,l.CameraAutoTumble=b,l.StereoEffect=g,l.NDCCameraControl=_},(o,l,u)=>{var{Group:c,Matrix4:f}=u(4),h=u(22).Pointset;u(24).Lines;var m=u(45).Lines2,y=u(3).Geometry,p=u(4),d=0,b=function(){return"re"+d++},v=function(g,M){var _=g,E=new c;E.matrixAutoUpdate=!1,E.userData=this;var S=[],w="",T=[],C=M,R=new f,P=3e3;R.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this.pickableUpdateRequired=!0,this.isRegion=!0,this.uuid=b(),this.hideAllPrimitives=()=>{S.forEach(L=>L.hideAllPrimitives()),T.forEach(L=>L.setVisibility(!1))},this.showAllPrimitives=()=>{S.forEach(L=>L.showAllPrimitives()),T.forEach(L=>L.setVisibility(!0))},this.setVisibility=L=>{L!=E.visible&&(E.visible=L,this.pickableUpdateRequired=!0)},this.getVisibility=()=>E.visible,this.getGroup=()=>E,this.setTransformation=L=>{R.set(...L),E.matrix.copy(R),E.updateMatrixWorld()},this.setName=L=>{L&&L!==""&&(w=L)},this.getName=()=>w,this.getParent=()=>_,this.getFullSeparatedPath=()=>{var L=[];if(w!==""){L.push(w);for(var A,I=_;I!==void 0;)A=I.getName(),A!==""&&L.unshift(A),I=I.getParent()}return L},this.getFullPath=()=>{var L=this.getFullSeparatedPath();if(0{A=A.concat("/",I)}),A}return""},this.createChild=L=>{var A=new v(this,C);return A.setName(L),S.push(A),E.add(A.getGroup()),A},this.getChildWithName=L=>{if(L){for(var A=L.toLowerCase(),I=0;I{if(L&&0{var A=L.split("/");return this.findChildFromSeparatedPath(A)},this.createChildFromSeparatedPath=L=>{if(0{var A=L.split("/");return this.createChildFromSeparatedPath(A)},this.findOrCreateChildFromPath=L=>{var A=this.findChildFromPath(L);return A||(A=this.createChildFromPath(L)),A},this.addZincObject=L=>{L&&(L.setRegion(this),E.add(L.getGroup()),T.push(L),this.pickableUpdateRequired=!0,C&&C.triggerObjectAddedCallback(L))},this.removeZincObject=L=>{for(var A=0;A{if(this.pickableUpdateRequired)return!0;if(L){for(var A=!1,I=0;I(E.visible&&(T.forEach(I=>{if(I.getGroup()&&I.getGroup().visible){var O=I.marker;O&&O.isEnabled()&&L.push(O.getMorph()),L.push(I.getGroup())}}),A&&S.forEach(I=>{I.getPickableThreeJSObjects(L,A)}),this.pickableUpdateRequired=!1),L),this.setDuration=L=>{P=L,T.forEach(A=>A.setDuration(L)),S.forEach(A=>A.setDuration(L))},this.getDuration=()=>P,this.getBoundingBox=L=>{var A,I;return T.forEach(O=>{I=O.getBoundingBox(),I&&(A==null?A=I.clone():A.union(I))}),L&&S.forEach(O=>{I=O.getBoundingBox(L),I&&(A==null?A=I.clone():A.union(I))}),A},this.clear=L=>{L&&S.forEach(A=>A.clear(L)),T.forEach(A=>{E.remove(A.getGroup()),A.dispose()}),S=[],T=[]},this.objectIsInRegion=(L,A)=>{for(var I=0;I{T.forEach(I=>{I.isGeometry&&L(I)}),A&&S.forEach(I=>I.forEachGeometry(L,A))},this.forEachGlyphset=(L,A)=>{T.forEach(I=>{I.isGlyphset&&L(I)}),A&&S.forEach(I=>I.forEachGlyphset(L,A))},this.forEachPointset=(L,A)=>{T.forEach(I=>{I.isPointset&&L(I)}),A&&S.forEach(I=>I.forEachPointset(L,A))},this.forEachLine=(L,A)=>{T.forEach(I=>{I.isLines&&L(I)}),A&&S.forEach(I=>I.forEachLine(L,A))},this.findObjectsWithAnatomicalId=(L,A)=>(T.forEach(I=>{I.anatomicalId===L&&objectsArray.push(I)}),A&&S.forEach(I=>{var O=I.findObjectsWithAnatomicalId(L,A);objectsArray.push(...O)}),objectsArray),this.findObjectsWithGroupName=(L,A)=>{var I=[];return T.forEach(O=>{var x=O.groupName?O.groupName.toLowerCase():O.groupName,N=L&&L.toLowerCase();x===N&&I.push(O)}),A&&S.forEach(O=>{var x=O.findObjectsWithGroupName(L,A);I.push(...x)}),I},this.findGeometriesWithGroupName=(L,A)=>{var I=this.findObjectsWithGroupName(L,A),O=I.filter(x=>x.isGeometry);return O},this.findPointsetsWithGroupName=(L,A)=>{var I=this.findObjectsWithGroupName(L,A),O=I.filter(x=>x.isPointset);return O},this.findGlyphsetsWithGroupName=(L,A)=>{var I=this.findObjectsWithGroupName(L,A),O=I.filter(x=>x.isGlyphset);return O},this.findLinesWithGroupName=(L,A)=>{var I=this.findObjectsWithGroupName(L,A),O=I.filter(x=>x.isLines);return O},this.getAllObjects=L=>{var A=[...T];return L&&S.forEach(I=>{var O=I.getAllObjects(L);A.push(...O)}),A},this.getChildRegions=L=>{var A=[...S];return L&&S.forEach(I=>{var O=I.getChildRegions(L);A.push(...O)}),A},this.getCurrentTime=()=>{if(T[0]!=null)return T[0].getCurrentTime();for(var L,A=0;A{T.forEach(I=>{I.setMorphTime(L)}),A&&S.forEach(I=>{I.setMorphTime(L)})},this.isTimeVarying=()=>{for(var L=0;L{var B,D=this.getAllObjects(N);D.forEach(V=>{V.render(L*A,I,O,x)}),x&&I===!1&&(B=x.markerCluster)!==null&&B!==void 0&&B.markerUpdateRequired&&x.markerCluster.calculate()},this.createPoints=(L,A,I,O)=>{var x=!1,N=this.findObjectsWithGroupName(L,!1),B=N.findIndex(V=>V.isPointset),D=-1{var O=!1,x=this.findObjectsWithGroupName(L,!1),N=x.findIndex(D=>D.isLines),B=-1{var B=new y,D=new p.MeshPhongMaterial({color:I,morphTargets:!1,morphNormals:!1,transparent:!0,opacity:O,side:p.DoubleSide});return B.createMesh(A,D,{localTimeEnabled:!1,localMorphColour:!1}),B.getMorph()?(B.setVisibility(!1),B.setName(L),B.setRenderOrder(N),this.addZincObject(B),B):void 0}};l.Region=v},(o,l,u)=>{u(4),u(5).toBufferGeometry;var c=u(46).LineSegments2,f=u(48).LineMaterial,h=u(47).LineSegmentsGeometry,m=function(){u(24).Lines.call(this),this.isLines2=!0;var y=Array(300);this.createLineSegment=(p,d,b)=>{if(p&&d){var v=new h;v.setPositions(p),v.colorsNeedUpdate=!0;var g=new c(v,d);g.scale.set(1,1,1),g.computeLineDistances(),this.setMesh(g,b.localTimeEnabled,b.localMorphColour)}},this.setWidth=p=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=p,this.morph.material.needsUpdate=!0)},this.addVertices=function(p){if(p&&p.length){var d=this.getMorph();d||(this.drawRange=0);var b=3*this.drawRange;if(p.forEach(v=>{y[b++]=v[0],y[b++]=v[1],y[b++]=v[2],this.drawRange++}),!d)for(;300>b;)y[b++]=p[0][0],y[b++]=p[0][1],y[b++]=p[0][2];d&&(d.geometry.setPositions(y),d.computeLineDistances(),this.boundingBoxUpdateRequired=!0)}return y},this.getVerticesByFaceIndex=function(p){var d=3*(2*p),b=this.getMorph();if(b&&3*this.drawRange>d){var v=b.geometry.getAttribute("instanceStart");return[[v.data.array[d],v.data.array[++d],v.data.array[++d]],[v.data.array[++d],v.data.array[++d],v.data.array[++d]]]}return[]},this.editVertices=function(p,d){if(p&&p.length){var b=this.getMorph(),v=d+p.length-1;if(!b||0>d||v>=this.drawRange)return;var g=3*d;for(p.forEach(M=>{y[g++]=M[0],y[g++]=M[1],y[g++]=M[2]}),g=3*this.drawRange;300>g;)y[g++]=p[0][0],y[g++]=p[0][1],y[g++]=p[0][2];b.geometry.setPositions(y),b.computeLineDistances(),this.boundingBoxUpdateRequired=!0}return y},this.addLines=(p,d)=>{if(p&&0{var p=this.getMorph().material;p.resolution.set(window.innerWidth,window.innerHeight)}};m.prototype=Object.create(u(24).Lines.prototype),m.prototype.constructor=m,l.Lines2=m},(o,l,u)=>{u.r(l),u.d(l,{LineSegments2:()=>T});var c=u(4),f=u(47),h=u(48),m=new c.Vector3,y=new c.Vector3,p=new c.Vector4,d=new c.Vector4,b=new c.Vector4,v=new c.Vector3,g=new c.Matrix4,M=new c.Line3,_=new c.Vector3,E=new c.Box3,S=new c.Sphere,w=new c.Vector4;class T extends c.Mesh{constructor(){var R=0K&&d.z>K;if(!ne){if(p.z>K){var Y=p.z-d.z,te=(p.z-K)/Y;p.lerp(d,te)}else if(d.z>K){var F=d.z-p.z,$=(d.z-K)/F;d.lerp(p,$)}p.applyMatrix4(O),d.applyMatrix4(O),p.multiplyScalar(1/p.w),d.multiplyScalar(1/d.w),p.x*=D.x/2,p.y*=D.y/2,d.x*=D.x/2,d.y*=D.y/2,M.start.copy(p),M.start.z=0,M.end.copy(d),M.end.z=0;var J=M.closestPointToPointParameter(v,!0);M.at(J,_);var k=c.MathUtils.lerp(p.z,d.z,J),U=-1<=k&&1>=k,oe=v.distanceTo(_)<.5*V;if(U&&oe){M.start.fromBufferAttribute(z,Q),M.end.fromBufferAttribute(G,Q),M.start.applyMatrix4(x),M.end.applyMatrix4(x);var le=new c.Vector3,ae=new c.Vector3;A.distanceSqToSegment(M.start,M.end,ae,le),P.push({point:ae,pointOnLine:le,distance:A.origin.distanceTo(ae),object:this,face:null,faceIndex:Q,uv:null,uv2:null})}}}}}}}T.prototype.LineSegments2=!0},(o,l,u)=>{u.r(l),u.d(l,{LineSegmentsGeometry:()=>m});var c=u(4),f=new c.Box3,h=new c.Vector3;class m extends c.InstancedBufferGeometry{constructor(){super(),this.type="LineSegmentsGeometry",this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new c.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new c.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(p){var d=this.attributes.instanceStart,b=this.attributes.instanceEnd;return d!==void 0&&(d.applyMatrix4(p),b.applyMatrix4(p),d.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(p){var d;p instanceof Float32Array?d=p:Array.isArray(p)&&(d=new Float32Array(p));var b=new c.InstancedInterleavedBuffer(d,6,1);return this.setAttribute("instanceStart",new c.InterleavedBufferAttribute(b,3,0)),this.setAttribute("instanceEnd",new c.InterleavedBufferAttribute(b,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(p){var d;p instanceof Float32Array?d=p:Array.isArray(p)&&(d=new Float32Array(p));var b=new c.InstancedInterleavedBuffer(d,6,1);return this.setAttribute("instanceColorStart",new c.InterleavedBufferAttribute(b,3,0)),this.setAttribute("instanceColorEnd",new c.InterleavedBufferAttribute(b,3,3)),this}fromWireframeGeometry(p){return this.setPositions(p.attributes.position.array),this}fromEdgesGeometry(p){return this.setPositions(p.attributes.position.array),this}fromMesh(p){return this.fromWireframeGeometry(new c.WireframeGeometry(p.geometry)),this}fromLineSegments(p){var d=p.geometry;return d.isGeometry?void console.error("THREE.LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead."):(d.isBufferGeometry&&this.setPositions(d.attributes.position.array),this)}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new c.Box3);var p=this.attributes.instanceStart,d=this.attributes.instanceEnd;p!==void 0&&d!==void 0&&(this.boundingBox.setFromBufferAttribute(p),f.setFromBufferAttribute(d),this.boundingBox.union(f))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingBox===null&&this.computeBoundingBox();var p=this.attributes.instanceStart,d=this.attributes.instanceEnd;if(p!==void 0&&d!==void 0){var b=this.boundingSphere.center;this.boundingBox.getCenter(b);for(var v=0,g=0,M=p.count;g{u.r(l),u.d(l,{LineMaterial:()=>f});var c=u(4);c.UniformsLib.line={linewidth:{value:1},resolution:{value:new c.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},dashOffset:{value:0},gapSize:{value:1},opacity:{value:1}},c.ShaderLib.line={uniforms:c.UniformsUtils.merge([c.UniformsLib.common,c.UniformsLib.fog,c.UniformsLib.line]),vertexShader:` #include #include #include #include #include uniform float linewidth; uniform vec2 resolution; attribute vec3 instanceStart; attribute vec3 instanceEnd; attribute vec3 instanceColorStart; attribute vec3 instanceColorEnd; varying vec2 vUv; #ifdef USE_DASH uniform float dashScale; attribute float instanceDistanceStart; attribute float instanceDistanceEnd; varying float vLineDistance; #endif void trimSegment( const in vec4 start, inout vec4 end ) { // trim end segment so it terminates between the camera plane and the near plane // conservative estimate of the near plane float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column float nearEstimate = - 0.5 * b / a; float alpha = ( nearEstimate - start.z ) / ( end.z - start.z ); end.xyz = mix( start.xyz, end.xyz, alpha ); } void main() { #ifdef USE_COLOR vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd; #endif #ifdef USE_DASH vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd; #endif float aspect = resolution.x / resolution.y; vUv = uv; // camera space vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 ); vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 ); // special case for perspective projection, and segments that terminate either in, or behind, the camera plane // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space // but we need to perform ndc-space calculations in the shader, so we must address this issue directly // perhaps there is a more elegant solution -- WestLangley bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column if ( perspective ) { if ( start.z < 0.0 && end.z >= 0.0 ) { trimSegment( start, end ); } else if ( end.z < 0.0 && start.z >= 0.0 ) { trimSegment( end, start ); } } // clip space vec4 clipStart = projectionMatrix * start; vec4 clipEnd = projectionMatrix * end; // ndc space vec2 ndcStart = clipStart.xy / clipStart.w; vec2 ndcEnd = clipEnd.xy / clipEnd.w; // direction vec2 dir = ndcEnd - ndcStart; // account for clip-space aspect ratio dir.x *= aspect; dir = normalize( dir ); // perpendicular to dir vec2 offset = vec2( dir.y, - dir.x ); // undo aspect ratio adjustment dir.x /= aspect; offset.x /= aspect; // sign flip if ( position.x < 0.0 ) offset *= - 1.0; // endcaps if ( position.y < 0.0 ) { offset += - dir; } else if ( position.y > 1.0 ) { offset += dir; } // adjust for linewidth offset *= linewidth; // adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ... offset /= resolution.y; // select end vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd; // back to clip space offset *= clip.w; clip.xy += offset; gl_Position = clip; vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation #include #include #include }`,fragmentShader:` uniform vec3 diffuse; uniform float opacity; #ifdef USE_DASH uniform float dashSize; uniform float dashOffset; uniform float gapSize; #endif varying float vLineDistance; #include #include #include #include #include varying vec2 vUv; void main() { #include #ifdef USE_DASH if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX #endif float alpha = opacity; #ifdef ALPHA_TO_COVERAGE // artifacts appear on some hardware if a derivative is taken within a conditional float a = vUv.x; float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; float len2 = a * a + b * b; float dlen = fwidth( len2 ); if ( abs( vUv.y ) > 1.0 ) { alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 ); } #else if ( abs( vUv.y ) > 1.0 ) { float a = vUv.x; float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; float len2 = a * a + b * b; if ( len2 > 1.0 ) discard; } #endif vec4 diffuseColor = vec4( diffuse, alpha ); #include #include gl_FragColor = vec4( diffuseColor.rgb, alpha ); #include #include #include #include }`};class f extends c.ShaderMaterial{constructor(m){super({type:"LineMaterial",uniforms:c.UniformsUtils.clone(c.ShaderLib.line.uniforms),vertexShader:c.ShaderLib.line.vertexShader,fragmentShader:c.ShaderLib.line.fragmentShader,clipping:!0}),Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(p){this.uniforms.diffuse.value=p}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(p){this.uniforms.linewidth.value=p}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(y){!!y!="USE_DASH"in this.defines&&(this.needsUpdate=!0),y===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(p){this.uniforms.dashScale.value=p}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(p){this.uniforms.dashSize.value=p}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(p){this.uniforms.dashOffset.value=p}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(p){this.uniforms.gapSize.value=p}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(p){this.uniforms.opacity.value=p}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(p){this.uniforms.resolution.value.copy(p)}},alphaToCoverage:{enumerable:!0,get:function(){return"ALPHA_TO_COVERAGE"in this.defines},set:function(p){!!p!="ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),p===!0?(this.defines.ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(m)}}f.prototype.isLineMaterial=!0},(o,l,u)=>{var c=u(4);l.Minimap=function(f){var h=f;this.camera=new c.OrthographicCamera(-.5,.5,.5,-.5,.01,10),this.helper=void 0;var m=new c.BufferGeometry,y=new Float32Array([-1,-1,1,1,-1,1,1,1,1,1,1,1,-1,1,1,-1,-1,1]),p=new c.BufferAttribute(y,3);m.setAttribute("position",p);var d=new c.MeshBasicMaterial({color:3355443,depthTest:!1,depthWrite:!1,opacity:.5,transparent:!0});this.mask=new c.Mesh(m,d);var b=new c.Box3,v=new c.Vector3;this.getDiffFromNormalised=(M,_)=>{b.setFromBufferAttribute(p).getCenter(v);var E=v.clone().project(this.camera),S=new c.Vector3(M,_,E.z).unproject(this.camera);return S.sub(v)};var g=(M,_)=>{h.camera.near&&(this.camera.near=h.camera.near),_.farPlane&&(this.camera.far=_.farPlane),_.eyePosition&&this.camera.position.set(_.eyePosition[0],_.eyePosition[1],_.eyePosition[2]),_.upVector&&this.camera.up.set(_.upVector[0],_.upVector[1],_.upVector[2]),_.targetPosition&&this.camera.lookAt(new c.Vector3(_.targetPosition[0],_.targetPosition[1],_.targetPosition[2])),this.camera.zoom=1/M,this.camera.updateProjectionMatrix()};this.getBoundary=()=>{var M=new c.Vector3().copy(h.camera.target).project(h.camera),_=new c.Vector3(-1,-1,M.z).unproject(h.camera),E=new c.Vector3(1,-1,M.z).unproject(h.camera),S=new c.Vector3(1,1,M.z).unproject(h.camera),w=new c.Vector3(-1,1,M.z).unproject(h.camera);p.copyVector3sArray([_,E,S,S,w,_]),p.needsUpdate=!0},this.updateCamera=()=>{this.getBoundary();var M=h.getZincCameraControls(),_=h.getBoundingBox();if(_){var E=_.min.distanceTo(_.max),S=E/2,w=(_.min.x+_.max.x)/2,T=(_.min.y+_.max.y)/2,C=(_.min.z+_.max.z)/2,R=M.getViewportFromCentreAndRadius(w,T,C,S,40,S*4);g(E,R)}}}},(o,l,u)=>{var c=u(4),f=u(51)(c),h=u(3).Geometry,m=u(52),y=u(53).default,p=c.BufferGeometryLoader,d=function(b){var v;b&&b.isGeometry&&(v=b);var g=void 0,M=void 0,_=!1,E=void 0,S=P=>{var L=v.getMorph().material.clone();L.morphTargets=!1;var A=new h,I=new p,O=I.parse(P),x=new c.Mesh(O.geometry,L);return A.geometry=x.geometry,x.userData=A,A.setMorph(x),A},w=P=>{switch(P.data.action){case"message":console.log(P.data.message);break;case"result":var L=new d(S(P.data.object));E&&E(L),E=void 0,_=!1;break;default:throw"Cannot handle specified action."}},T=P=>{if(m!==void 0&&(M=m(54)),!M)g=new(u(55)).GeometryCSGInternal(P);else if(P&&P.isGeometry){var L=P.getMorph(),A=L.geometry.clone().applyMatrix(L.matrix).toJSON();M.addEventListener("message",function(I){w(I)}),M.postMessage({action:"initialise",object:A})}};this.getHostGeometry=()=>{var P=new f(v.getMorph());return new C(P)},this.getGeometry=()=>v;var C=P=>{var L=v.getMorph().material.clone();L.morphTargets=!1;var A=P.toMesh(L),I=new h;return I.geometry=A.geometry,A.userData=I,I.setMorph(A),I};this.setCSG=P=>{g.setCSG(P)};var R=(P,L,A,I)=>{if(_)I("On progress");else{var O=P.getMorph(),x=O.geometry.clone().applyMatrix(O.matrix).toJSON();E=A,_=!0,M.postMessage({action:L,object:x})}};this.intersect=P=>new y((L,A)=>{if(M)R(P,"intersect",L,A);else{var I=g.intersect(P),O=new d(C(I));O.setCSG(I),L(O)}}),this.subtract=P=>new y((L,A)=>{if(M)R(P,"intersect",L,A);else{var I=g.subtract(P),O=new d(C(I));O.setCSG(I),L(O)}}),this.union=P=>new y((L,A)=>{if(M)R(P,"intersect",L,A);else{var I=g.union(P),O=new d(C(I));O.setCSG(I),L(O)}}),this.terminateWorker=()=>{M&&M.terminate()},T(b)};l.GeometryCSG=d},o=>{var l=1e-5,u=0,c=1,f=2,h=3;o.exports=function(m){var y=function(p){var d,b,v,g,M,_,E,S=[];if(p.isBufferGeometry&&(p=new m.Geometry().fromBufferGeometry(p)),p instanceof m.Geometry)this.matrix=new m.Matrix4;else if(p.isMesh)p.updateMatrix(),this.matrix=p.matrix.clone(),p=p.geometry,p.isBufferGeometry&&(p=new m.Geometry().fromBufferGeometry(p)),p.mergeVertices(),p.computeVertexNormals(!1);else{if(p instanceof y.Node)return this.tree=p,this.matrix=new m.Matrix4,this;throw"ThreeBSP: Given geometry is unsupported"}for(d=0,b=p.faces.length;d"u"?(C.vertices.push(E),g=L[E.x+","+E.y+","+E.z]=C.vertices.length-1):g=L[E.x+","+E.y+","+E.z],E=b.vertices[d-1],w.push(new m.Vector2(E.uv.x,E.uv.y)),E=new m.Vector3(E.x,E.y,E.z),E.applyMatrix4(T),typeof L[E.x+","+E.y+","+E.z]>"u"?(C.vertices.push(E),M=L[E.x+","+E.y+","+E.z]=C.vertices.length-1):M=L[E.x+","+E.y+","+E.z],E=b.vertices[d],w.push(new m.Vector2(E.uv.x,E.uv.y)),E=new m.Vector3(E.x,E.y,E.z),E.applyMatrix4(T),typeof L[E.x+","+E.y+","+E.z]>"u"?(C.vertices.push(E),_=L[E.x+","+E.y+","+E.z]=C.vertices.length-1):_=L[E.x+","+E.y+","+E.z],S=new m.Face3(g,M,_,new m.Vector3(b.normal.x,b.normal.y,b.normal.z)),C.faces.push(S),C.faceVertexUvs[0].push(w);return C},y.prototype.toBufferGeometry=function(){var p=this.toGeometry(),d=new m.BufferGeometry().fromGeometry(p);return d},y.prototype.toMesh=function(p){var d=this.toBufferGeometry(),b=new m.Mesh(d,p);return b.position.setFromMatrixPosition(this.matrix),b.rotation.setFromRotationMatrix(this.matrix),b},y.Polygon=function(p){p instanceof Array||(p=[]),this.vertices=p,0l?c:u},y.Polygon.prototype.classifySide=function(p){var d,b,v,g=0,M=0,_=p.vertices.length;for(d=0;d<_;d++)b=p.vertices[d],v=this.classifyVertex(b),v===c?g++:v===f&&M++;return 0{o.exports=YB()},o=>{o.exports=iF},(o,l,u)=>{var c=u(3).Geometry,f=u(4),h=f.BufferGeometryLoader;o.exports=function(m){var y=void 0,p=function(_){var E=new h,S=E.parse(_),w=new f.MeshPhongMaterial,T=new f.Mesh(S.geometry,w),C=new c;return C.setMorph(T),C},d=function(_){var E=p(_);y=new(u(55)).GeometryCSGInternal(E),m.postMessage({action:"message",message:"Initialised"})},b=function(_){if(y){var E=p(_),S=y.intersect(E),w=S.toBufferGeometry().toJSON();m.postMessage({action:"result",object:w})}},v=function(_){if(y){var E=p(_),S=y.subtract(E),w=S.toBufferGeometry().toJSON();m.postMessage({action:"result",object:w})}},g=function(_){if(y){var E=p(_),S=y.union(E),w=S.toBufferGeometry().toJSON();m.postMessage({action:"result",object:w})}};m.addEventListener("message",function(M){switch(M.data.action){case"initialise":d(M.data.object);break;case"intersect":b(M.data.object);break;case"subtract":v(M.data.object);break;case"union":g(M.data.object);break;default:throw"Cannot handle specified action."}})}},(o,l,u)=>{var c=u(4),f=u(51)(c);u(3).Geometry,u(50).GeometryCSG;var h=function(m){var y;m&&m.isGeometry&&(y=m);var p;this.setGeometry=b=>{b&&b.isGeometry&&(y=b),p=void 0},this.setCSG=b=>{p=b};var d=b=>{if(y&&y.morph&&b&&b.morph){p===void 0&&(p=new f(y.morph));var v=new f(b.morph);return v}};this.intersect=b=>{var v=d(b);return p&&v?p.intersect(v):void 0},this.subtract=b=>{var v=d(b);return p&&v?p.subtract(v):void 0},this.union=b=>{var v=d(b);return p&&v?p.union(v):void 0}};l.GeometryCSGInternal=h},(o,l,u)=>{var c=u(4),f=u(51)(c);u(18).Glyphset;var h=function(m){var y;m&&m.isGlyphset&&(y=m);var p=[];this.setGlyphset=v=>{v&&v.isGlyphset&&(y=v),hostCSG=void 0},this.getGlyphset=()=>y;var d=()=>v=>{var g=v.getMesh(),M=v.getLabel();if(g){var _=new f(g.geometry.clone().applyMatrix(g.matrix)),E=[];E.csg=_,E.label=M,g.material&&(E.material=g.material.clone()),p.push(E)}},b=v=>{if(y&&v&&v.getMorph()){p.length==0&&y.forEachGlyph(d());var g=new f(v.getMorph());return g}};this.intersect=v=>{var g=b(v);if(0{var l=o&&o.__esModule?()=>o.default:()=>o;return r.d(l,{a:l}),l},r.d=(o,l)=>{for(var u in l)r.o(l,u)&&!r.o(o,u)&&Object.defineProperty(o,u,{enumerable:!0,get:l[u]})},r.o=(o,l)=>Object.prototype.hasOwnProperty.call(o,l),r.r=o=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})};var s=r(0);return s})())})(Xg);var Sr=Xg.exports;const Kc=OA(Sr),Tx=(n,e)=>{if(n){let t="";n.forEach(i=>{t=i.uuid,i.region&&(t=i.region.uuid+"/"+t),i&&i.getVisibility()&&e.push(t)})}return e},Rf=(n,e)=>{const t=n[0]-e[0],i=n[1]-e[1],r=n[2]-e[2];return Math.sqrt(t*t+i*i+r*r)},rF=n=>{const e=n.zincObjects;if(e.length>0&&e[0]){const t=e[0];if(t.isEditable&&t.isLines2){const i=n.identifiers[0].extraData.intersected;if(i&&i.faceIndex>-1){const r=t.getVerticesByFaceIndex(i.faceIndex),s=n.identifiers[0].extraData.intersected.pointOnLine;if(r.length>1){const o=Rf(r[0],[s.x,s.y,s.z]),l=Rf(r[1],[s.x,s.y,s.z]);return o>l?{zincObject:t,faceIndex:i.faceIndex,vertexIndex:i.faceIndex*2+1,point:r[0]}:{zincObject:t,faceIndex:i.faceIndex,vertexIndex:i.faceIndex*2,point:r[1]}}}}}},sF=n=>{const e=n.zincObjects;if(e.length>0&&e[0]){const t=e[0];if(t.isEditable)return t}},oF=(n,e,t)=>{if(n!=null&&n.isEditable&&(n!=null&&n.isPointset)){let i=!1;for(let r=0;r<3&&!i;r++)t[r]!==0&&(i=!0);if(i&&e>-1){const r=n.getVerticesByIndex(e);return r&&(r[0]=r[0]+t[0],r[1]=r[1]+t[1],r[2]=r[2]+t[2]),n.editVertices([r],e),n.boundingBoxUpdateRequired=!0,!0}}return!1},Qc=(n,e)=>{if(n!=null&&n.isEditable&&(n!=null&&n.isLines2)&&e>-1){const t=n.getVerticesByFaceIndex(e);if(t&&t.length>1)return Rf(t[1],t[0])}return 0},Pf=(n,e,t,i)=>{if(n&&t!==0&&n.isEditable&&n.isLines2&&e>-1){const r=n.getVerticesByFaceIndex(e);let s=[r[1][0]-r[0][0],r[1][1]-r[0][1],r[1][2]-r[0][2]];const o=Math.sqrt(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]);for(let l=0;l<3;l++)s[l]=s[l]/o*t,i?r[1][l]=r[0][l]+s[l]:(r[0][l]=r[0][l]+s[l],r[1][l]=r[1][l]+s[l]);return n.editVertices(r,e*2),n.boundingBoxUpdateRequired=!0,!0}return!1},aF=(n,e)=>{const t=e.getBoundingBox(),i=new Sr.THREE.Vector3().subVectors(t.max,t.min),r=new Sr.THREE.BoxGeometry(i.x,i.y,i.z);i.addVectors(t.min,t.max).multiplyScalar(.5);const s=r.getAttribute("position"),o=s.count,l=[];for(let u=0;u{let t="";n.isRegion&&(t=`__r${n.regionPath}`),n.isPrimitives&&(t=`${n.regionPath}/${n.label}`),e.push(t),n.children&&n.children.forEach(i=>Ex(i,e))},Lo=(n,e,t,i)=>{let r=n;const s=[];if(t&&(r=n.findChildFromPath(t)),r){const o=Array.isArray(e);let l=e;o||(l=[l]),l.forEach(u=>{const c=r.findObjectsWithGroupName(u,i);s.push(...c)})}return s},If=(n,e,t)=>{const i=n.findIndex(s=>s.uuid===e);let r;return i>-1&&(r=n[i],t&&n.splice(i,1)),r},lF=(n,e)=>{const t=[];if(n&&e&&e.length>0){const i={},r={},s=[n,...n.getChildRegions(!0)];let o,l,u;e.forEach(c=>{const f=c.split("/");u=f[0],o=If(s,u,!1),o&&(r[u]||(r[u]=o.getFullPath()),f[1]?(i[u]||(i[u]=o.getAllObjects(!1)),l=If(i[u],f[1],!0),l&&t.push(`${r[u]}/${l.groupName}`)):t.push(`__r/${r[u]}`))})}return t},cF=n=>{if(n){const e=[];return n.forEach(i=>{i.isZincObject?e.push(i):i.isRegion&&e.push(...i.getAllObjects(!0))}),Object.values(e.reduce((i,r)=>({...i,[r.uuid]:r}),{}))}return[]},Cx=(n,e)=>{const t={label:"Multiple selections",regionPath:"",objects:[]};if(e&&n){const i={},r=n.getRootRegion();e.length>0&&(t.regionPath=e[0].data.region,t.label=e[0].data.group),e.forEach(s=>{s.data.region.includes(t.regionPath)||(t.regionPath=""),t.label!==s.data.group&&(t.label="Multiple selections");const o=r.findChildFromPath(s.data.region);i[o.uuid]||(i[o.uuid]=o.getAllObjects(!1));const l=If(i[o.uuid],s.data.uuid);l&&t.objects.push(l)})}return t},uF=n=>{const e=n.getMorph();let t="position";n.isLines2&&(t="instanceStart");const i=[];let r=0;const s=e.geometry.getAttribute(t);for(let o=0;o{let s;if(n.isPointset?s="MultiPoint":n.isLines2&&(s="MultiLineString"),s){const o=uF(n);let l=e.slice(-1)==="/"?e:e+"/";l=l+t;const u=l,c={resource:i,item:{id:u},body:{evidence:[],comment:r},feature:{id:u,properties:{drawn:!0,label:"Drawn annotation"},geometry:{coordinates:o,type:s}}};return r==="Deleted"&&(c.feature=void 0),c}},Ax=(n,e,t,i,r,s,o)=>{const l=dF(t,i,r,s,o);if(l)return n&&n.currentUser&&(l.creator={...n.currentUser},l.creator.orcid||(l.creator.orcid="0000-0000-0000-0000"),n.addAnnotation(e,l).then(u=>{u.annotationId||console.log("There is a problem with the submission, please try again later")}).catch(()=>{console.log("There is a problem with the submission, please try again later")})),l},Lx=async(n,e,t)=>{const i=t;return await n.drawnFeatures(e,i)},Of=(n,e)=>{n&&e.forEach(t=>{const i=t.geometry,r=decodeURIComponent(t.id),s=r.lastIndexOf("/"),o=r.substring(0,s),l=r.substring(s+1);let u;i.type==="MultiPoint"?u=n.createPoints(o,l,i.coordinates,l,8942):i.type==="MultiLineString"&&(u=n.createLines(o,l,i.coordinates,60962)),u&&(u.zincObject.isEditable=!0)})},ki=(n,e)=>{const t=n.__vccOpts||n;for(const[i,r]of e)t[i]=r;return t},hF={name:"LinesControls",components:{Button:Cs,Col:Fn,Container:ei,InputNumber:Si,Main:Mi,Slider:Ln,ElIconArrowLeft:Wi,ElIconArrowRight:ji},props:{createData:{type:Object}},data:function(){return{adjust:0,pAdjust:0,lengthScale:0,distance:0,newDistance:0,width:1,currentIndex:0,ElIconArrowLeft:a.shallowRef(Wi),ElIconArrowRight:a.shallowRef(ji),edited:!1,zincObject:void 0}},watch:{"createData.faceIndex":{handler:function(n){var e;(e=this.zincObject)!=null&&e.isLines2&&(this.currentIndex=n,this.distance=Qc(this.zincObject,this.currentIndex))},immediate:!0}},methods:{changeIndex:function(n){n?Qc(this.zincObject,this.currentIndex+1)>0&&(this.currentIndex++,this.reset()):(this.currentIndex--,this.reset())},onLengthInput:function(){this.newDistance!==0?(this.distance=this.newDistance,this.edited=Pf(this.zincObject,this.currentIndex,this.newDistance,!0)||this.edited):this.newDistance=this.distance},onLengthSliding:function(){this.newDistance=Math.pow(10,this.lengthScale)*this.distance,this.edited=Pf(this.zincObject,this.currentIndex,this.newDistance,!0)||this.edited},onMoveSliding:function(){const n=(this.adjust-this.pAdjust)*this.distance;this.edited=Pf(this.zincObject,this.currentIndex,n,!1)||this.edited,this.pAdjust=this.adjust},reset:function(){this.adjust=0,this.pAdjust=0,this.lengthScale=0,this.distance=Qc(this.zincObject,this.currentIndex),this.newDistance=this.distance,this.edited&&(this.$emit("primitivesUpdated",this.zincObject),this.edited=!1)},setObject:function(n){this.currentIndex=-1,this.distance=0,n.isLines2?(this.zincObject=a.markRaw(n),this.width=this.zincObject.getMorph().material.linewidth,n.isEditable&&(this.currentIndex=0,this.distance=Qc(n,this.currentIndex))):(this.zincObject=void 0,this.width=10)},modifyWidth:function(){this.zincObject.setWidth(this.width)}}};function fF(n,e,t,i,r,s){const o=Fn,l=Ln,u=Si,c=Qn,f=Cs,h=Mi,m=ei;return a.openBlock(),a.createBlock(m,{class:"lines-container"},{default:a.withCtx(()=>[a.createVNode(h,{class:"slides-block"},{default:a.withCtx(()=>[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createTextVNode(" Width: ")]),_:1}),a.createVNode(o,{offset:0,span:12},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.width,"onUpdate:modelValue":e[0]||(e[0]=y=>n.width=y),class:"my-slider",step:1,min:1,max:100,"show-tooltip":!1,onInput:s.modifyWidth},null,8,["modelValue","onInput"])]),_:1}),a.createVNode(o,{offset:0,span:4},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.width,"onUpdate:modelValue":e[1]||(e[1]=y=>n.width=y),step:1,min:1,max:100,controls:!1,class:"input-box number-input"},null,8,["modelValue"])]),_:1})]),_:1}),n.currentIndex>-1&&n.distance>0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:4},{default:a.withCtx(()=>[a.createVNode(f,{size:"small",disabled:n.currentIndex===0,icon:n.ElIconArrowLeft,onClick:e[2]||(e[2]=y=>s.changeIndex(!1))},null,8,["disabled","icon"])]),_:1}),a.createVNode(o,{offset:4,span:9},{default:a.withCtx(()=>[a.createTextVNode(" Editing Line "+a.toDisplayString(n.currentIndex+1),1)]),_:1}),a.createVNode(o,{offset:2,span:2},{default:a.withCtx(()=>[a.createVNode(f,{size:"small",icon:n.ElIconArrowRight,onClick:e[3]||(e[3]=y=>s.changeIndex(!0))},null,8,["icon"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createTextVNode(" Move: ")]),_:1}),a.createVNode(o,{offset:0,span:16},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.adjust,"onUpdate:modelValue":e[4]||(e[4]=y=>n.adjust=y),step:.01,min:-3,max:3,"show-tooltip":!1,onInput:e[5]||(e[5]=y=>s.onMoveSliding()),onChange:e[6]||(e[6]=y=>s.reset())},null,8,["modelValue"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createTextVNode(" Length: ")]),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.lengthScale,"onUpdate:modelValue":e[7]||(e[7]=y=>n.lengthScale=y),step:.01,min:-1,max:1,"show-tooltip":!1,onInput:e[8]||(e[8]=y=>s.onLengthSliding()),onChange:e[9]||(e[9]=y=>s.reset())},null,8,["modelValue"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.newDistance,"onUpdate:modelValue":e[10]||(e[10]=y=>n.newDistance=y),controls:!1,class:"input-box number-input",onChange:s.onLengthInput},null,8,["modelValue","onChange"])]),_:1})]),_:1})],64)):a.createCommentVNode("",!0)]),_:1})]),_:1})}const Rx=ki(hF,[["render",fF],["__scopeId","data-v-6581aa67"]]),pF={name:"PointsControls",components:{Col:Fn,Container:ei,InputNumber:Si,Main:Mi,Select:As,Slider:Ln,Row:Qn,Option:Ls,ElIconArrowLeft:Wi,ElIconArrowRight:ji},inject:["boundingDims"],data:function(){return{attenuation:!1,size:10,choices:[{value:!0,label:"On"},{value:!1,label:"off"}],min:[0,0,0],max:[1,1,1],translation:[0,0,0],pTranslation:[0,0,0],currentIndex:-1,ElIconArrowLeft:a.shallowRef(Wi),ElIconArrowRight:a.shallowRef(ji),edited:!1,zincObject:void 0}},watch:{boundingDims:{handler:function(n){const e=n.size;this.min=[-e[0]/2,-e[1]/2,-e[2]/2],this.max=[e[0]/2,e[1]/2,e[2]/2]},immediate:!0,deep:!0}},methods:{changeIndex:function(n){n?this.zincObject.drawRange>this.currentIndex+1&&(this.currentIndex++,this.reset()):(this.currentIndex--,this.reset())},onMoveSliding:function(){const n=[this.translation[0]-this.pTranslation[0],this.translation[1]-this.pTranslation[1],this.translation[2]-this.pTranslation[2]];this.edited=oF(this.zincObject,this.currentIndex,n)||this.edited;for(let e=0;e<3;e++)this.pTranslation[e]=this.translation[e]},reset:function(){this.translation=[0,0,0],this.pTranslation=[0,0,0],this.edited&&(this.$emit("primitivesUpdated",this.zincObject),this.edited=!1)},setObject:function(n){this.currentIndex=-1,n.isPointset?(this.zincObject=a.markRaw(n),this.size=this.zincObject.morph.material.size,this.attenuation=this.zincObject.morph.material.sizeAttenuation,n.isEditable&&this.zincObject.drawRange>0&&(this.currentIndex=0)):(this.zincObject=void 0,this.size=10,this.attenuation=!1)},modifyAttenuation:function(n){this.attenuation=n,this.zincObject.setSizeAttenuation(n)},modifySize:function(){this.zincObject.setSize(this.size)}}};function mF(n,e,t,i,r,s){const o=Fn,l=Ln,u=Si,c=Qn,f=Ls,h=As,m=Cs,y=Mi,p=ei;return a.openBlock(),a.createBlock(p,{class:"pointset-container"},{default:a.withCtx(()=>[a.createVNode(y,{class:"slides-block"},{default:a.withCtx(()=>[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createTextVNode(" Size: ")]),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.size,"onUpdate:modelValue":e[0]||(e[0]=d=>n.size=d),class:"my-slider",step:1,min:0,max:100,"show-tooltip":!1,onInput:e[1]||(e[1]=d=>s.modifySize())},null,8,["modelValue"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.size,"onUpdate:modelValue":e[2]||(e[2]=d=>n.size=d),step:1,min:0,max:100,controls:!1,class:"input-box number-input"},null,8,["modelValue"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:16},{default:a.withCtx(()=>[a.createTextVNode(" Size attenuation: ")]),_:1}),a.createVNode(o,{offset:0,span:5},{default:a.withCtx(()=>[a.createVNode(h,{teleported:!1,"model-value":n.attenuation,placeholder:"Select",class:"input-box","popper-class":"viewer_dropdown",onChange:e[3]||(e[3]=d=>s.modifyAttenuation(d,n.slide))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.choices,d=>(a.openBlock(),a.createBlock(f,{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])]),_:1})]),_:1}),n.currentIndex>-1?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:4},{default:a.withCtx(()=>[a.createVNode(m,{size:"small",disabled:n.currentIndex===0,icon:n.ElIconArrowLeft,onClick:e[4]||(e[4]=d=>s.changeIndex(!1))},null,8,["disabled","icon"])]),_:1}),a.createVNode(o,{offset:4,span:9},{default:a.withCtx(()=>[a.createTextVNode(" Editing Point "+a.toDisplayString(n.currentIndex+1),1)]),_:1}),a.createVNode(o,{offset:2,span:2},{default:a.withCtx(()=>[a.createVNode(m,{size:"small",icon:n.ElIconArrowRight,onClick:e[5]||(e[5]=d=>s.changeIndex(!0))},null,8,["icon"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createTextVNode(" x: ")]),_:1}),a.createVNode(o,{offset:0,span:16},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.translation[0],"onUpdate:modelValue":e[6]||(e[6]=d=>n.translation[0]=d),step:.01,min:n.min[0],max:n.max[0],"show-tooltip":!1,onInput:e[7]||(e[7]=d=>s.onMoveSliding()),onChange:e[8]||(e[8]=d=>s.reset())},null,8,["modelValue","min","max"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createTextVNode(" y: ")]),_:1}),a.createVNode(o,{offset:0,span:16},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.translation[1],"onUpdate:modelValue":e[9]||(e[9]=d=>n.translation[1]=d),step:.01,min:n.min[1],max:n.max[1],"show-tooltip":!1,onInput:e[10]||(e[10]=d=>s.onMoveSliding()),onChange:e[11]||(e[11]=d=>s.reset())},null,8,["modelValue","min","max"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createTextVNode(" z: ")]),_:1}),a.createVNode(o,{offset:0,span:16},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.translation[2],"onUpdate:modelValue":e[12]||(e[12]=d=>n.translation[2]=d),step:.01,min:n.min[2],max:n.max[2],"show-tooltip":!1,onInput:e[13]||(e[13]=d=>s.onMoveSliding()),onChange:e[14]||(e[14]=d=>s.reset())},null,8,["modelValue","min","max"])]),_:1})]),_:1})],64)):a.createCommentVNode("",!0)]),_:1})]),_:1})}const Px=ki(pF,[["render",mF],["__scopeId","data-v-d1de9c65"]]),gF={name:"TextureSlidesControls",components:{Col:Fn,Container:ei,Footer:Og,Icon:yt,InputNumber:Si,Main:Mi,Row:Qn,Select:As,Slider:Ln,Option:Ls,ElIconDelete:cl,ElIconPlus:ul},data:function(){return{settings:[],directions:[{value:"x",label:"x"},{value:"y",label:"y"},{value:"z",label:"z"}],zincObject:void 0}},methods:{setObject:function(n){n.isTextureSlides?(this.zincObject=a.markRaw(n),this.settings=this.zincObject.getTextureSettings()):(this.zincObject=void 0,this.settings=[])},addNewSlide:function(){const n={direction:"x",value:0},e=this.zincObject.createSlide(n);this.settings.push(e)},modifyDirection:function(n,e){e&&(e.direction=n,this.zincObject.modifySlideSettings(e))},modifySlide:function(n){n&&this.zincObject.modifySlideSettings(n)},removeSlide:function(n,e){this.zincObject.removeSlideWithId(e.id),this.settings.splice(n,1)}}};function yF(n,e,t,i,r,s){const o=Ls,l=As,u=Fn,c=Ln,f=Si,h=cl,m=yt,y=Qn,p=Mi,d=ul,b=Og,v=ei;return a.openBlock(),a.createBlock(v,{class:"t-slides-container"},{default:a.withCtx(()=>[a.createVNode(p,{class:"slides-block"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.settings,(g,M)=>(a.openBlock(),a.createBlock(y,{key:g.id,class:"slide-row"},{default:a.withCtx(()=>[a.createVNode(u,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(l,{teleported:!1,"model-value":g.direction,placeholder:"Select",class:"input-box","popper-class":"viewer_dropdown",onChange:_=>s.modifyDirection(_,g)},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.directions,_=>(a.openBlock(),a.createBlock(o,{key:_.value,label:_.label,value:_.value},null,8,["label","value"]))),128))]),_:2},1032,["model-value","onChange"])]),_:2},1024),a.createVNode(u,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(c,{modelValue:g.value,"onUpdate:modelValue":_=>g.value=_,class:"my-slider",step:.01,min:0,max:1,"show-tooltip":!1,onInput:_=>s.modifySlide(g)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:2},1024),a.createVNode(u,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(f,{modelValue:g.value,"onUpdate:modelValue":_=>g.value=_,step:.01,min:0,max:1,controls:!1,class:"input-box number-input"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),a.createVNode(u,{offset:0,span:2},{default:a.withCtx(()=>[a.createVNode(m,{class:"delete-icon",onClick:_=>s.removeSlide(M,g)},{default:a.withCtx(()=>[a.createVNode(h)]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:1}),a.createVNode(b,{height:"30px",class:"add-slides-text",onClick:s.addNewSlide},{default:a.withCtx(()=>[a.createVNode(y,null,{default:a.withCtx(()=>[a.createVNode(u,{span:2},{default:a.withCtx(()=>[a.createVNode(m,null,{default:a.withCtx(()=>[a.createVNode(d)]),_:1})]),_:1}),a.createVNode(u,{span:20},{default:a.withCtx(()=>[a.createTextVNode(" Add a new slide ")]),_:1})]),_:1})]),_:1},8,["onClick"])]),_:1})}const Ix=ki(gF,[["render",yF],["__scopeId","data-v-12185b7f"]]),vF={name:"TransformationControls",components:{Col:Fn,Container:ei,InputNumber:Si,Main:Mi,Slider:Ln},inject:["boundingDims"],data:function(){return{x:0,y:0,z:0,scale:1,min:[0,0,0],max:[1,1,1],zincObject:void 0}},watch:{boundingDims:{handler:function(n){const e=n.centre,t=n.size;this.min=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],this.max=[e[0]+t[0],e[1]+t[1],e[2]+t[2]]},immediate:!0,deep:!0}},methods:{setObject:function(n){if(n.isZincObject){this.zincObject=a.markRaw(n);const e=this.zincObject.getGroup();e&&e.position&&(this.x=e.position.x,this.y=e.position.y,this.z=e.position.z,this.scale=e.scale.x)}else this.zincObject=void 0,this.x=0,this.y=0,this.z=0,this.scale=1},modifyPosition:function(){this.zincObject.setPosition(this.x,this.y,this.z)},modifyScale:function(){this.zincObject.setScaleAll(this.scale)}}};function bF(n,e,t,i,r,s){const o=Fn,l=Ln,u=Si,c=Qn,f=Mi,h=ei;return a.openBlock(),a.createBlock(h,{class:"transformation-container"},{default:a.withCtx(()=>[a.createVNode(f,{class:"slides-block"},{default:a.withCtx(()=>[a.createVNode(c,{class:"tool-row"},{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createTextVNode(" x: ")]),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.x,"onUpdate:modelValue":e[0]||(e[0]=m=>n.x=m),step:.01,min:n.min[0],max:n.max[0],"show-tooltip":!1,onInput:e[1]||(e[1]=m=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.x,"onUpdate:modelValue":e[2]||(e[2]=m=>n.x=m),step:.01,min:n.min[0],max:n.max[0],controls:!1,class:"input-box number-input",onChange:e[3]||(e[3]=m=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1})]),_:1}),a.createVNode(c,{class:"tool-row"},{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createTextVNode(" y: ")]),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.y,"onUpdate:modelValue":e[4]||(e[4]=m=>n.y=m),step:.01,min:n.min[1],max:n.max[1],"show-tooltip":!1,onInput:e[5]||(e[5]=m=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.y,"onUpdate:modelValue":e[6]||(e[6]=m=>n.y=m),step:.01,min:n.min[1],max:n.max[1],controls:!1,class:"input-box number-input",onChange:e[7]||(e[7]=m=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1})]),_:1}),a.createVNode(c,{class:"tool-row"},{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createTextVNode(" z: ")]),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.z,"onUpdate:modelValue":e[8]||(e[8]=m=>n.z=m),step:.01,min:n.min[2],max:n.max[2],"show-tooltip":!1,onInput:e[9]||(e[9]=m=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.z,"onUpdate:modelValue":e[10]||(e[10]=m=>n.z=m),step:.01,min:n.min[2],max:n.max[2],controls:!1,class:"input-box number-input",onChange:e[11]||(e[11]=m=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1})]),_:1}),a.createVNode(c,{class:"tool-row"},{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createTextVNode(" Scale: ")]),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.scale,"onUpdate:modelValue":e[12]||(e[12]=m=>n.scale=m),step:.01,min:0,max:5,"show-tooltip":!1,onInput:e[13]||(e[13]=m=>s.modifyScale())},null,8,["modelValue"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.scale,"onUpdate:modelValue":e[14]||(e[14]=m=>n.scale=m),step:.01,min:0,max:5,controls:!1,class:"input-box number-input",onChange:e[15]||(e[15]=m=>s.modifyScale())},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1})}const Ox=ki(vF,[["render",bF],["__scopeId","data-v-6b3997b7"]]),xF={name:"OpacityControls",components:{Container:ei,Header:S2,Main:Mi,Slider:Ln},props:{material:void 0,zincObject:void 0},data:function(){return{displayString:"100%"}},watch:{"material.opacity":function(){this.material&&this.zincObject&&this.zincObject.setAlpha(this.material.opacity)}},methods:{formatTooltip(n){return this.displayString=Math.floor(100*n+.5)+"%",this.displayString}}},wF={class:"block"},MF={class:"display"};function SF(n,e,t,i,r,s){const o=Ln,l=ei;return t.material?(a.openBlock(),a.createBlock(l,{key:0,class:"opacity-container"},{default:a.withCtx(()=>[a.createElementVNode("div",wF,[a.createElementVNode("span",MF,a.toDisplayString(n.displayString),1),a.createVNode(o,{modelValue:t.material.opacity,"onUpdate:modelValue":e[0]||(e[0]=u=>t.material.opacity=u),class:"my-slider",step:.01,min:0,max:1,"format-tooltip":s.formatTooltip,"show-tooltip":!1},null,8,["modelValue","format-tooltip"])])]),_:1})):a.createCommentVNode("",!0)}const Nx=ki(xF,[["render",SF],["__scopeId","data-v-cbfc46a5"]]),_F={name:"PrimitiveControls",components:{Collapse:Cg,CollapseItem:Ag,LinesControls:Rx,OpacityControls:Nx,PointsControls:Px,TextureSlidesControls:Ix,TransformationControls:Ox,ElIconArrowRight:ji},props:{createData:{type:Object}},data:function(){return{activeName:"oControls",material:void 0,isTextureSlides:!1,isPointset:!1,isLines:!1,drawerOpen:!0,zincObject:void 0,isEditable:!1,displayString:"100%"}},methods:{formatTooltip:function(n){return this.displayString=Math.floor(100*n+.5)+"%",this.displayString},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setObject:function(n){var e;n?this.zincObject=a.markRaw(n):this.zincObject=void 0,this.isEditable=!!((e=this.zincObject)!=null&&e.isEditable),this.isPointset=!1,this.isTextureSlides=!1,this.isLines=!1,this.activeName="trControls",n&&(n.isTextureSlides?(this.isTextureSlides=!0,this.$refs.tSlidesControls.setObject(n),this.activeName="tsControls"):n.isPointset?(this.isPointset=!0,this.$refs.pointsetControls.setObject(n),this.activeName="pControls"):n.isLines2&&(this.isLines=!0,this.$refs.linesControls.setObject(n),this.activeName="lControls"),n.isTextureSlides||this.$refs.transformationControls.setObject(n)),n&&n.getMorph()?this.material=n.getMorph().material:this.material=void 0}}};function TF(n,e,t,i,r,s){const o=Nx,l=Ag,u=Ox,c=Ix,f=Px,h=Rx,m=Cg,y=ji,p=yt;return a.withDirectives((a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["primitive-controls",{open:n.drawerOpen,close:!n.drawerOpen}])},[a.createElementVNode("div",{class:a.normalizeClass(["my-drawer",{open:n.drawerOpen,close:!n.drawerOpen}])},[a.createVNode(m,{class:"collapse",modelValue:n.activeName,"onUpdate:modelValue":e[2]||(e[2]=d=>n.activeName=d),accordion:""},{default:a.withCtx(()=>[a.withDirectives(a.createVNode(l,{title:"Opacity",name:"oControls"},{default:a.withCtx(()=>[a.createVNode(o,{material:n.material,zincObject:n.zincObject,ref:"opacityControls"},null,8,["material","zincObject"])]),_:1},512),[[a.vShow,!n.isTextureSlides]]),a.withDirectives(a.createVNode(l,{title:"Transformation",name:"trControls"},{default:a.withCtx(()=>[a.createVNode(u,{class:"transformation-controls",ref:"transformationControls"},null,512)]),_:1},512),[[a.vShow,!n.isEditable]]),a.withDirectives(a.createVNode(l,{title:"Texture Slides",name:"tsControls"},{default:a.withCtx(()=>[a.createVNode(c,{class:"texture-controls",ref:"tSlidesControls"},null,512)]),_:1},512),[[a.vShow,n.isTextureSlides]]),a.withDirectives(a.createVNode(l,{title:"Points",name:"pControls"},{default:a.withCtx(()=>[a.createVNode(f,{class:"pointset-controls",ref:"pointsetControls",onPrimitivesUpdated:e[0]||(e[0]=d=>n.$emit("primitivesUpdated",d))},null,512)]),_:1},512),[[a.vShow,n.isPointset]]),a.withDirectives(a.createVNode(l,{title:"Lines",name:"lControls"},{default:a.withCtx(()=>[a.createVNode(h,{class:"lines-controls",ref:"linesControls",createData:t.createData,onPrimitivesUpdated:e[1]||(e[1]=d=>n.$emit("primitivesUpdated",d))},null,8,["createData"])]),_:1},512),[[a.vShow,n.isLines]])]),_:1},8,["modelValue"])],2),a.createElementVNode("div",{class:a.normalizeClass(["drawer-button",{open:n.drawerOpen,close:!n.drawerOpen}]),onClick:e[3]||(e[3]=(...d)=>s.toggleDrawer&&s.toggleDrawer(...d))},[a.createVNode(p,null,{default:a.withCtx(()=>[a.createVNode(y)]),_:1})],2)],2)),[[a.vShow,n.material||n.isTextureSlides]])}const Dx=ki(_F,[["render",TF],["__scopeId","data-v-764a8efa"]]),EF=(n,e)=>{const t=n.label.toUpperCase(),i=e.label.toUpperCase();return ti?1:0},CF={name:"ScaffoldTreeControls",components:{ElIconArrowLeft:Wi,TreeControls:Ja.TreeControls},props:{showColourPicker:Boolean,isReady:Boolean},data:function(){return{treeData:[{label:"Root",regionPath:"",id:void 0,children:[]}],active:[],hover:[],drawerOpen:!0,nodeNumbers:0,module:void 0}},computed:{treeDataEntry:function(){return this.treeData[0].children}},watch:{treeDataEntry:{deep:!0,handler:function(n){this.isReady&&this.setColourField(n)}}},methods:{addTreeItem:function(n,e,t){n.some(i=>i.label===e.label)||(Object.assign(e,{activeColour:this.getColour(e)}),n.push(e),n.sort((i,r)=>EF(i,r)),this.nodeNumbers++,this.$nextTick(()=>{!this.$refs.treeControls.$refs.regionTree.getCheckedKeys().includes(e.id)&&t.getVisibility()&&this.$refs.treeControls.$refs.regionTree.setChecked(e.id,!0)}))},findOrCreateRegion:function(n,e,t){if(this.module&&this.module.scene&&(this.treeData[0].id=this.module.scene.getRootRegion().uuid,this.treeData[0].isRegion=!0),e.length>0){const i=[...e];let r=n.children.find(l=>l.label==i[0]);const s=t+"/"+e[0],o=this.module.scene.getRootRegion().findChildFromPath(s);return r||(r={label:i[0],id:o.uuid,children:[],regionPath:s,isRegion:!0},this.addTreeItem(n.children,r,o),s==="/_helper"&&this.$nextTick(()=>{this.$refs.treeControls.$refs.regionTree.setChecked(r.id,!1)})),i.shift(),this.findOrCreateRegion(r,i,s)}else return n},zincObjectAdded:function(n){const e=n.region;if(e){const t=e.getFullSeparatedPath(),i=this.findOrCreateRegion(this.treeData[0],t,"");if(n.groupName&&i){i.children||(i.children=[]);const r={label:n.groupName,id:e.uuid+"/"+n.uuid,isPrimitives:!0,regionPath:n.region.getFullPath(),isTextureSlides:!!n.isTextureSlides};this.addTreeItem(i.children,r,n)}}},zincObjectRemoved:function(n){const e=n.groupName;if(n.region.findObjectsWithGroupName(e,!1).length===0){const i=n.region.getFullSeparatedPath(),r=this.findOrCreateRegion(this.treeData[0],i,"");if(r.children){for(let s=0;s{l.setVisibility(r)})},updateActiveUI:function(n){this.active.length=0,Tx(n,this.active)},changeActiveByPrimitives:function(n,e){n&&n.length>0?(this.updateActiveUI(n),this.$emit("object-selected",n,e)):this.removeActive(e),this.removeHover(e)},updateHoverUI:function(n){this.hover.length=0,Tx(n,this.hover)},changeHoverByPrimitives:function(n,e){n&&n.length>0?(this.updateHoverUI(n),this.$emit("object-hovered",n,e)):this.removeHover(e)},changeActiveByNames:function(n,e,t){const i=this.module.scene.getRootRegion(),r=Lo(i,n,e,!0);this.changeActiveByPrimitives(r,t)},changeHoverByNames:function(n,e,t){const i=this.module.scene.getRootRegion(),r=Lo(i,n,e,!0);this.changeHoverByPrimitives(r,t)},changeActiveByNode:function(n,e){if(n.isPrimitives||n.isRegion){const t=!!n.isRegion,i=this.getZincObjectsFromNode(n,t);this.changeActiveByPrimitives(i,e)}},changeHoverByNode:function(n,e){if(n.isPrimitives){const t=this.getZincObjectsFromNode(n,!1);this.changeHoverByPrimitives(t,e)}},removeActive:function(n){this.active=[],this.$emit("object-selected",[],n)},removeHover:function(n){this.hover=[],this.$emit("object-hovered",[],n)},clear:function(){this.active.length=0,this.hover.length=0,this.nodeNumbers=0,this.$refs.treeControls.$refs.regionTree.updateKeyChildren(this.treeData[0].id,[]),this.treeData[0].children.length=0,this.treeData[0].id=void 0,this.$emit("object-selected",[])},getColour:function(n){if(n){let t=this.getZincObjectsFromNode(n,!1)[0];if(t){let i=t.getColourHex();if(i)return"#"+i}}return"#FFFFFF"},getZincObjectsFromNode:function(n,e){const t=this.module.scene.getRootRegion();if(n.isPrimitives)return Lo(t,n.label,n.regionPath,e);if(n.isRegion&&n.regionPath){let i=t.findChildFromPath(n.regionPath);if(i)return i.getAllObjects(e)}return[]},setModule:function(n){this.module=a.markRaw(n),this.nodeNumbers=0,this.module.scene.getRootRegion().getAllObjects(!0).forEach(t=>{this.zincObjectAdded(t)}),this.module.addOrganPartAddedCallback(this.zincObjectAdded),this.module.addOrganPartRemovedCallback(this.zincObjectRemoved)},setColourField:function(n,e=void 0){n.filter(t=>e&&!t.children?t.id===e.id:!0).map(t=>{if(t.children)this.setColourField(t.children,e);else{const i=this.getColour(t);t.defaultColour||(t.defaultColour=i),t.activeColour=i}})},setColour:function(n,e){n&&n.isPrimitives&&this.getZincObjectsFromNode(n,!1).forEach(i=>{let s=(e||n.defaultColour).replace("#","0x");i.setColourHex(s),this.setColourField(this.treeData[0].children,n)})},visibilityToggle:function(n,e){this.module.changeOrganPartsVisibility(n,e),e==!1&&(this.activeRegion===n&&this.removeActive(!0),this.hoverRegion===n&&this.removeHover(!0))},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen,this.$emit("drawer-toggled",this.drawerOpen)},setTreeVisibilityWithFullPaths:function(n,e,t,i){let r=!1,s="";n.isRegion&&(s=`__r${n.regionPath}`),n.isPrimitives&&(s=`${n.regionPath}/${n.label}`);const o=e.indexOf(s);o>-1&&(r=!0,e.splice(o,1),t.push(n.id));const l=this.module.scene.getRootRegion().findChildFromPath(n.regionPath);s&&s!=="__r"&&n.isPrimitives&&l.findObjectsWithGroupName(n.label).forEach(c=>c.setVisibility(r)),n.children&&n.children.forEach(u=>{this.setTreeVisibilityWithFullPaths(u,e,t,!0)})},checkAllKeys:function(){const n=[],e=[];Ex(this.treeData[0],n),this.setTreeVisibilityWithFullPaths(this.treeData[0],n,e,!0),this.$refs.treeControls.$refs.regionTree.setCheckedKeys(e)},getState:function(){let n=this.$refs.treeControls.$refs.regionTree.getCheckedKeys();return n.length===this.nodeNumbers?{checkAll:!0,version:"2.0"}:{checkedItems:lF(this.module.scene.getRootRegion(),n),version:"2.0"}},setState:function(n){if(n){if(n.checkAll)this.checkAllKeys();else if(n.checkedItems){let e=[];n.version!=="2.0"?(e=n.checkedItems.map(i=>"/"+i),e.shift("__r/")):e.push(...n.checkedItems);const t=[];this.setTreeVisibilityWithFullPaths(this.treeData[0],e,t,!0),this.$refs.treeControls.$refs.regionTree.setCheckedKeys(t)}}}}},AF={class:"traditional-container"};function LF(n,e,t,i,r,s){const o=a.resolveComponent("TreeControls"),l=Wi,u=yt;return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["tree-controls",{open:n.drawerOpen,close:!n.drawerOpen}])},[a.createElementVNode("div",AF,[a.createVNode(o,{mapType:"scaffold",title:"Regions",isReady:t.isReady,treeData:s.treeDataEntry,active:n.active,hover:n.hover,showColourPicker:t.showColourPicker,onSetColour:s.setColour,onCheckChanged:s.checkChanged,onChangeActive:s.changeActiveByNode,onChangeHover:s.changeHoverByNode,ref:"treeControls"},null,8,["isReady","treeData","active","hover","showColourPicker","onSetColour","onCheckChanged","onChangeActive","onChangeHover"])]),a.createElementVNode("div",{class:a.normalizeClass(["drawer-button",{open:n.drawerOpen,close:!n.drawerOpen}]),onClick:e[0]||(e[0]=(...c)=>s.toggleDrawer&&s.toggleDrawer(...c))},[a.createVNode(u,null,{default:a.withCtx(()=>[a.createVNode(l)]),_:1})],2)],2)}const Bx=ki(CF,[["render",LF],["__scopeId","data-v-13a8c030"]]);var RF=!1;function eu(n,e,t){return Array.isArray(n)?(n.length=Math.max(n.length,e),n.splice(e,1,t),t):(n[e]=t,t)}function Nf(n,e){if(Array.isArray(n)){n.splice(e,1);return}delete n[e]}/*! * pinia v2.2.1 * (c) 2024 Eduardo San Martin Morote * @license MIT */let Ha;const tu=n=>Ha=n,PF=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function us(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"&&typeof n.toJSON!="function"}var Wa;(function(n){n.direct="direct",n.patchObject="patch object",n.patchFunction="patch function"})(Wa||(Wa={}));const ja=typeof window<"u";function Fx(n,e){for(const t in e){const i=e[t];if(!(t in n))continue;const r=n[t];us(r)&&us(i)&&!a.isRef(i)&&!a.isReactive(i)?n[t]=Fx(r,i):n[t]=i}return n}const Vx=()=>{};function kx(n,e,t,i=Vx){n.push(e);const r=()=>{const s=n.indexOf(e);s>-1&&(n.splice(s,1),i())};return!t&&a.getCurrentScope()&&a.onScopeDispose(r),r}function Ro(n,...e){n.slice().forEach(t=>{t(...e)})}const IF=n=>n(),zx=Symbol(),Df=Symbol();function Bf(n,e){n instanceof Map&&e instanceof Map?e.forEach((t,i)=>n.set(i,t)):n instanceof Set&&e instanceof Set&&e.forEach(n.add,n);for(const t in e){if(!e.hasOwnProperty(t))continue;const i=e[t],r=n[t];us(r)&&us(i)&&n.hasOwnProperty(t)&&!a.isRef(i)&&!a.isReactive(i)?n[t]=Bf(r,i):n[t]=i}return n}const OF=process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function NF(n){return!us(n)||!n.hasOwnProperty(OF)}const{assign:Pn}=Object;function Ux(n){return!!(a.isRef(n)&&n.effect)}function Gx(n,e,t,i){const{state:r,actions:s,getters:o}=e,l=t.state.value[n];let u;function c(){!l&&(process.env.NODE_ENV==="production"||!i)&&(t.state.value[n]=r?r():{});const f=process.env.NODE_ENV!=="production"&&i?a.toRefs(a.ref(r?r():{}).value):a.toRefs(t.state.value[n]);return Pn(f,s,Object.keys(o||{}).reduce((h,m)=>(process.env.NODE_ENV!=="production"&&m in f&&console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${m}" in store "${n}".`),h[m]=a.markRaw(a.computed(()=>{tu(t);const y=t._s.get(n);return o[m].call(y,y)})),h),{}))}return u=Ff(n,c,e,t,i,!0),u}function Ff(n,e,t={},i,r,s){let o;const l=Pn({actions:{}},t);if(process.env.NODE_ENV!=="production"&&!i._e.active)throw new Error("Pinia destroyed");const u={deep:!0};process.env.NODE_ENV!=="production"&&!RF&&(u.onTrigger=R=>{c?y=R:c==!1&&!w._hotUpdating&&(Array.isArray(y)?y.push(R):console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."))});let c,f,h=[],m=[],y;const p=i.state.value[n];!s&&!p&&(process.env.NODE_ENV==="production"||!r)&&(i.state.value[n]={});const d=a.ref({});let b;function v(R){let P;c=f=!1,process.env.NODE_ENV!=="production"&&(y=[]),typeof R=="function"?(R(i.state.value[n]),P={type:Wa.patchFunction,storeId:n,events:y}):(Bf(i.state.value[n],R),P={type:Wa.patchObject,payload:R,storeId:n,events:y});const L=b=Symbol();a.nextTick().then(()=>{b===L&&(c=!0)}),f=!0,Ro(h,P,i.state.value[n])}const g=s?function(){const{state:P}=t,L=P?P():{};this.$patch(A=>{Pn(A,L)})}:process.env.NODE_ENV!=="production"?()=>{throw new Error(`🍍: Store "${n}" is built using the setup syntax and does not implement $reset().`)}:Vx;function M(){o.stop(),h=[],m=[],i._s.delete(n)}const _=(R,P="")=>{if(zx in R)return R[Df]=P,R;const L=function(){tu(i);const A=Array.from(arguments),I=[],O=[];function x(D){I.push(D)}function N(D){O.push(D)}Ro(m,{args:A,name:L[Df],store:w,after:x,onError:N});let B;try{B=R.apply(this&&this.$id===n?this:w,A)}catch(D){throw Ro(O,D),D}return B instanceof Promise?B.then(D=>(Ro(I,D),D)).catch(D=>(Ro(O,D),Promise.reject(D))):(Ro(I,B),B)};return L[zx]=!0,L[Df]=P,L},E=a.markRaw({actions:{},getters:{},state:[],hotState:d}),S={_p:i,$id:n,$onAction:kx.bind(null,m),$patch:v,$reset:g,$subscribe(R,P={}){const L=kx(h,R,P.detached,()=>A()),A=o.run(()=>a.watch(()=>i.state.value[n],I=>{(P.flush==="sync"?f:c)&&R({storeId:n,type:Wa.direct,events:y},I)},Pn({},u,P)));return L},$dispose:M},w=a.reactive(process.env.NODE_ENV!=="production"||process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&ja?Pn({_hmrPayload:E,_customProperties:a.markRaw(new Set)},S):S);i._s.set(n,w);const C=(i._a&&i._a.runWithContext||IF)(()=>i._e.run(()=>(o=a.effectScope()).run(()=>e({action:_}))));for(const R in C){const P=C[R];if(a.isRef(P)&&!Ux(P)||a.isReactive(P))process.env.NODE_ENV!=="production"&&r?eu(d.value,R,a.toRef(C,R)):s||(p&&NF(P)&&(a.isRef(P)?P.value=p[R]:Bf(P,p[R])),i.state.value[n][R]=P),process.env.NODE_ENV!=="production"&&E.state.push(R);else if(typeof P=="function"){const L=process.env.NODE_ENV!=="production"&&r?P:_(P,R);C[R]=L,process.env.NODE_ENV!=="production"&&(E.actions[R]=P),l.actions[R]=P}else process.env.NODE_ENV!=="production"&&Ux(P)&&(E.getters[R]=s?t.getters[R]:P,ja&&(C._getters||(C._getters=a.markRaw([]))).push(R))}if(Pn(w,C),Pn(a.toRaw(w),C),Object.defineProperty(w,"$state",{get:()=>process.env.NODE_ENV!=="production"&&r?d.value:i.state.value[n],set:R=>{if(process.env.NODE_ENV!=="production"&&r)throw new Error("cannot set hotState");v(P=>{Pn(P,R)})}}),process.env.NODE_ENV!=="production"&&(w._hotUpdate=a.markRaw(R=>{w._hotUpdating=!0,R._hmrPayload.state.forEach(P=>{if(P in w.$state){const L=R.$state[P],A=w.$state[P];typeof L=="object"&&us(L)&&us(A)?Fx(L,A):R.$state[P]=A}eu(w,P,a.toRef(R.$state,P))}),Object.keys(w.$state).forEach(P=>{P in R.$state||Nf(w,P)}),c=!1,f=!1,i.state.value[n]=a.toRef(R._hmrPayload,"hotState"),f=!0,a.nextTick().then(()=>{c=!0});for(const P in R._hmrPayload.actions){const L=R[P];eu(w,P,_(L,P))}for(const P in R._hmrPayload.getters){const L=R._hmrPayload.getters[P],A=s?a.computed(()=>(tu(i),L.call(w,w))):L;eu(w,P,A)}Object.keys(w._hmrPayload.getters).forEach(P=>{P in R._hmrPayload.getters||Nf(w,P)}),Object.keys(w._hmrPayload.actions).forEach(P=>{P in R._hmrPayload.actions||Nf(w,P)}),w._hmrPayload=R._hmrPayload,w._getters=R._getters,w._hotUpdating=!1})),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&ja){const R={writable:!0,configurable:!0,enumerable:!1};["_p","_hmrPayload","_getters","_customProperties"].forEach(P=>{Object.defineProperty(w,P,Pn({value:w[P]},R))})}return i._p.forEach(R=>{if(process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&ja){const P=o.run(()=>R({store:w,app:i._a,pinia:i,options:l}));Object.keys(P||{}).forEach(L=>w._customProperties.add(L)),Pn(w,P)}else Pn(w,o.run(()=>R({store:w,app:i._a,pinia:i,options:l})))}),process.env.NODE_ENV!=="production"&&w.$state&&typeof w.$state=="object"&&typeof w.$state.constructor=="function"&&!w.$state.constructor.toString().includes("[native code]")&&console.warn(`[🍍]: The "state" must be a plain object. It cannot be state: () => new MyClass() Found in store "${w.$id}".`),p&&s&&t.hydrate&&t.hydrate(w.$state,p),c=!0,f=!0,w}function DF(n,e,t){let i,r;const s=typeof e=="function";i=n,r=s?t:e;function o(l,u){const c=a.hasInjectionContext();if(l=(process.env.NODE_ENV==="test"&&Ha&&Ha._testing?null:l)||(c?a.inject(PF,null):null),l&&tu(l),process.env.NODE_ENV!=="production"&&!Ha)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"? See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help. This will fail in production.`);l=Ha,l._s.has(i)||(s?Ff(i,e,r,l):Gx(i,r,l),process.env.NODE_ENV!=="production"&&(o._pinia=l));const f=l._s.get(i);if(process.env.NODE_ENV!=="production"&&u){const h="__hot:"+i,m=s?Ff(h,e,r,l,!0):Gx(h,Pn({},r),l,!0);u._hotUpdate(m),delete l.state.value[h],l._s.delete(h)}if(process.env.NODE_ENV!=="production"&&ja){const h=a.getCurrentInstance();if(h&&h.proxy&&!u){const m=h.proxy,y="_pStores"in m?m._pStores:m._pStores={};y[i]=f}}return f}return o.$id=i,o}function Hx(n,e){return Array.isArray(e)?e.reduce((t,i)=>(t[i]=function(){return n(this.$pinia)[i]},t),{}):Object.keys(e).reduce((t,i)=>(t[i]=function(){const r=n(this.$pinia),s=e[i];return typeof s=="function"?s.call(this,r):r[s]},t),{})}const Wx=DF("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(n){return n.userProfile.token}},actions:{setUserToken(n){this.userProfile.token=n}}}),BF={name:"ScaffoldTooltip",components:{Col:Fn,CreateTooltipContent:Ja.CreateTooltipContent,ElIconDelete:cl,Icon:yt,Popover:Pl,Row:Qn,Tooltip:Ja.Tooltip},props:{createData:{type:Object,default:{toBeConfirmed:!1,points:[],shape:"",x:0,y:0}},label:{type:String,default:""},annotationDisplay:{type:Boolean,default:!1},region:{type:String,default:""},visible:{type:Boolean,default:!1},x:{type:Number,default:200},y:{type:Number,default:200}},inject:["scaffoldUrl"],provide(){return{userApiKey:this.userToken}},data:function(){return{display:!1,annotationEntry:{},ElIconDelete:a.shallowRef(cl)}},computed:{...Hx(Wx,["userToken"]),position:function(){let n=40;return this.region&&(n=55),{left:this.x-40+"px",top:this.y-n+"px"}}},methods:{checkForDisplay:function(){if(this.visible&&this.label&&this.label!==""){if(this.display=!0,this.annotationDisplay){const n=this.region?this.region+"/":"";this.annotationEntry={featureId:n+this.label,resourceId:this.scaffoldUrl,resource:this.scaffoldUrl}}}else this.display=!1,this.annotationEntry={}},hideTriggered:function(){this.$emit("tooltip-hide")}},watch:{label:{handler:function(){this.checkForDisplay()},immediate:!0},visible:{handler:function(){this.checkForDisplay()},immediate:!0},annotationDisplay:{handler:function(){this.checkForDisplay()},immediate:!0}}},FF={class:"tooltip-text"},VF={key:0,class:"tooltip-text"},kF={key:1,class:"delete-container"};function zF(n,e,t,i,r,s){const o=a.resolveComponent("CreateTooltipContent"),l=a.resolveComponent("Tooltip"),u=Fn,c=Cs,f=Qn,h=Pl;return a.openBlock(),a.createElementBlock("div",{style:a.normalizeStyle(s.position),class:"region-tooltip"},[a.createVNode(h,{ref:"tooltip",visible:t.visible,placement:"top","show-arrow":!1,teleported:!1,trigger:"manual","popper-class":"tooltip-popper non-selectable","virtual-triggering":"",onHide:s.hideTriggered},{default:a.withCtx(()=>[a.createElementVNode("div",FF,a.toDisplayString(t.label),1),t.region?(a.openBlock(),a.createElementBlock("div",VF,"Region: "+a.toDisplayString(t.region),1)):a.createCommentVNode("",!0),a.withDirectives(a.createVNode(o,{createData:t.createData,onConfirmCreate:e[0]||(e[0]=m=>n.$emit("confirm-create",m)),onCancelCreate:e[1]||(e[1]=m=>n.$emit("cancel-create"))},null,8,["createData"]),[[a.vShow,t.createData.toBeConfirmed]]),a.withDirectives(a.createVNode(l,{class:"p-tooltip",ref:"annotationTooltip",annotationDisplay:!0,annotationEntry:n.annotationEntry},null,8,["annotationEntry"]),[[a.vShow,t.annotationDisplay&&!t.createData.toBeConfirmed]]),t.createData.toBeDeleted?(a.openBlock(),a.createElementBlock("div",kF,[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(u,{span:10},{default:a.withCtx(()=>[a.createTextVNode("Delete this feature?")]),_:1}),a.createVNode(u,{span:7},{default:a.withCtx(()=>[a.createVNode(c,{class:"delete-button",icon:n.ElIconDelete,onClick:e[2]||(e[2]=m=>n.$emit("confirm-delete"))},{default:a.withCtx(()=>[a.createTextVNode(" Delete ")]),_:1},8,["icon"])]),_:1}),a.createVNode(u,{span:6},{default:a.withCtx(()=>[a.createVNode(c,{class:"delete-button",onClick:e[3]||(e[3]=m=>n.$emit("cancel-create"))},{default:a.withCtx(()=>[a.createTextVNode(" Dismiss ")]),_:1})]),_:1})]),_:1})])):a.createCommentVNode("",!0)]),_:1},8,["visible","onHide"])],4)}const jx=ki(BF,[["render",zF],["__scopeId","data-v-e665391a"]]);/*! js-cookie v3.0.5 | MIT */function nu(n){for(var e=1;e"u")){o=nu({},e,o),typeof o.expires=="number"&&(o.expires=new Date(Date.now()+o.expires*864e5)),o.expires&&(o.expires=o.expires.toUTCString()),r=encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var u in o)o[u]&&(l+="; "+u,o[u]!==!0&&(l+="="+o[u].split(";")[0]));return document.cookie=r+"="+n.write(s,r)+l}}function i(r){if(!(typeof document>"u"||arguments.length&&!r)){for(var s=document.cookie?document.cookie.split("; "):[],o={},l=0;l{s&&(console.log("Annotation server timeout..."),o.abort())},GF);const l={method:i,signal:o.signal};let u=`${St(this,$a,"f")}/${t}`;const c=kf.get("annotation-key")||"";if(i==="GET"){const h=[];for(const[m,y]of Object.entries(r))h.push(`${m}=${encodeURIComponent(JSON.stringify(y))}`);h.push(`key=${encodeURIComponent(e)}`),h.push(`session=${encodeURIComponent(c)}`),u+="?"+h.join("&"),l.headers={Accept:"application/json; charset=utf-8","Cache-Control":"no-store"}}else if(i==="POST"){const h=Object.assign({key:e,session:c},r);l.body=JSON.stringify(h),l.headers={Accept:"application/json; charset=utf-8","Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}}const f=await fetch(u,l);return s=!1,f.ok?Promise.resolve(await f.json()):(ci(this,rn,{error:`${f.status} ${f.statusText}`},"f"),Promise.resolve(St(this,rn,"f")))};const Za={ALL:0,SELECTED:1,HIGHLIGHTED:2,MOVE:3},WF=function(n,e,t){this.eventType=n,this.identifiers=e,this.zincObjects=t},jF=function(n,e,t){this.targetedID=[];const i=n,r=e;this.targetEventType=t;const s=this;t===void 0&&(this.targetEventType=Za.ALL),this.getEventType=function(){return t},this.notify=function(o,l,u,c){if(o!==i&&(s.targetEventType===Za.ALL||s.targetEventType===l)){const f=new WF(l,u,c);r(f)}}},$F=function(){const n=[];this.publish=function(e,t,i,r){for(let s=0;s$1 support but your $0 does not seem to support it.',r=document.createElement("div");return r.id="webglmessage",r.style.fontFamily="monospace",r.style.fontSize="20px",r.style.fontWeight="normal",r.style.textAlign="center",r.style.background="#fff",r.style.color="#000",r.style.padding="1.5em",r.style.width="400px",r.style.margin="5em auto 0",t[n]?i=i.replace("$0","graphics card"):i=i.replace("$0","browser"),i=i.replace("$1",e[n]),r.innerHTML=i,r}},zf={ALL:0,DESTROYED:1,NAME_CHANGED:2,SETTINGS_CHANGED:3},_n=function(){this.typeName="Base Module",this.instanceName="default",this.onChangedCallbacks=[],this.eventNotifiers=[]};_n.prototype.setName=function(n){if(n&&this.instanceName!==n){this.instanceName=n;const e=this.onChangedCallbacks.slice();for(let t=0;t-1&&this.onChangedCallbacks.splice(e,1)},_n.prototype.addNotifier=function(n){this.eventNotifiers.push(n)};const iu=(n,e,t)=>{for(let i=0;i{const o=s.userData;o&&o.isZincObject&&s.material&&s.material.emissive&&s.material.emissive.setRGB(...e)})}},ZF=function(){let n=[],e=[];this.highlightColour=[1,0,0],this.selectColour=[0,1,0],this.originalColour=[0,0,0];const t=[],i=[],r=this,s=function(u,c){if(u.length==0&&c.length==0)return!1;for(let f=0;f{if(i&&i.object&&i.object.userData){if(i.object.userData.isMarker)return 1;if(i.object.name&&i.object.userData.isZincObject)return 2}return 0});let t=e.indexOf(1);return t=t>-1?t:e.indexOf(2),n[t]}},_t.prototype.getAnnotationsFromObjects=function(n){const e=[];for(var t=0;t0&&(l[0].coords=e,l[0].extraData=t),this.publishChanges(l,o,s)}return r},_t.prototype.setHighlightedByZincObjects=function(n,e,t,i){let r=[];return n&&n.forEach(s=>{s&&s.getMorph()&&r.push(s.getMorph())}),this.setHighlightedByObjects(r,e,t,i)},_t.prototype.setupLiveCoordinates=function(n){if(this.liveUpdatesObjects=n,n&&n.length>0){const e=this.scene.getBoundingBoxOfZincObjects(n);let t=new Uf.Vector3;e?(e.getCenter(t),this.selectedCenter==null?this.selectedCenter=t:this.selectedCenter.copy(t)):this.selectedCenter=void 0}else this.selectedCenter=void 0},_t.prototype.objectsToZincObjects=function(n){const e=[];for(let t=0;t0&&(l[0].coords=e,l[0].extraData=t),this.publishChanges(l,o,s)}}return r},_t.prototype.setSelectedByZincObjects=function(n,e,t,i){let r=[];return n&&n.forEach(s=>{if(s){const o=s.getMorph();o&&r.push(o)}}),this.setSelectedByObjects(r,e,t,i)},_t.prototype.findObjectsByGroupName=function(n){return this.scene.findObjectsWithGroupName(n)},_t.prototype.setHighlightedByGroupName=function(n,e){const t=this.findObjectsByGroupName(n);return this.setHighlightedByObjects(t,void 0,{},e)},_t.prototype.setSelectedByGroupName=function(n,e){const t=this.findObjectsByGroupName(n);return this.setSelectedByObjects(t,void 0,{},e)},_t.prototype.changeBackgroundColour=function(n){const e=new Uf.Color(n);this.zincRenderer&&this.zincRenderer.getThreeJSRenderer().setClearColor(e,1)},_t.prototype.resetView=function(){this.zincRenderer&&this.zincRenderer.resetView()},_t.prototype.viewAll=function(){this.zincRenderer&&this.zincRenderer.viewAll()},_t.prototype.playAnimation=function(n){this.zincRenderer&&(this.zincRenderer.playAnimation=n)},_t.prototype.setPlayRate=function(n){this.zincRenderer&&this.zincRenderer.setPlayRate(n)},_t.prototype.getPlayRate=function(n){return this.zincRenderer?this.zincRenderer.getPlayRate():0},_t.prototype.initialiseRenderer=function(n){if(this.zincRenderer===void 0||this.rendererContainer===void 0){let e=XF();this.Zinc=e.Zinc,this.zincRenderer=e.renderer,this.rendererContainer=e.container}n&&(this.displayArea=n,this.displayArea.appendChild(this.rendererContainer),this.zincRenderer&&this.zincRenderer.animate())},_t.prototype.destroy=function(){this.zincRenderer&&(this.zincRenderer.dispose(),this.zincRenderer.getThreeJSRenderer().dispose(),this.zincRenderer=void 0),_n.prototype.destroy.call(this)};const YF=function(){this.type="anatomical",this.data=void 0,this.isAnnotation=!0},JF=function(){this.currentName="",this.currentSystem="",this.currentPart="",this.currentSpecies="",this.metaURL="",this.viewURL="",this.timeVarying=!1,this.currentTime=0},Zx=function(n){_t.call(this);const e=this;let t;this.sceneData=new JF;const i=new Array,r=new Array,s=new Array,o=new Array;let l;const u=n;this.NDCCameraControl=void 0,e.typeName="Organ Viewer",this.getSceneData=function(){return e.sceneData},this.updateTime=function(T){let C=6e3;e.scene&&(C=e.scene.getDuration());const R=T/100*C;e.sceneData.nerveMapIsActive||e.scene&&e.scene.setMorphsTime(R),e.sceneData.currentTime=T};const c=function(){let T=3e3;e.scene&&(T=e.scene.getDuration());const C=e.zincRenderer.getCurrentTime();for(let R=0;R{let R=this.scene.getZincCameraControls();T?(R.resetView(),this.NDCCameraControl=R.enableSyncControl(),R.setRotationMode(C)):(R.disableSyncControl(),this.NDCCameraControl=void 0,R.setRotationMode("free"))},this.isSyncControl=()=>this.NDCCameraControl!==void 0,this.setSyncControlZoomToBox=T=>{this.NDCCameraControl&&this.NDCCameraControl.zoomToBox(T,2)},this.setSyncControlCallback=T=>{this.NDCCameraControl&&this.NDCCameraControl.setEventCallback(T)},this.setSyncControlCenterZoom=(T,C)=>{this.NDCCameraControl&&this.NDCCameraControl.setCenterZoom(T,C)};const f=function(){if(e.zincRenderer.playAnimation&&e.liveUpdatesObjects&&e.setupLiveCoordinates(e.liveUpdatesObjects),e.selectedCenter){const T=new Sr.THREE.Vector3;T.copy(e.selectedCenter);const C=e.scene.vectorToScreenXY(T);e.selectedScreenCoordinates.x=C.x,e.selectedScreenCoordinates.y=C.y}},h=function(){return function(){c()}},m=function(){return function(){f()}};this.addTimeChangedCallback=function(T){i.push(T)},this.setTexturePos=function(T){e.sceneData.nerveMap&&e.sceneData.nerveMap.additionalReader&&e.sceneData.nerveMap.additionalReader.setSliderPos(T)},this.addSceneChangedCallback=function(T){r.push(T)},this.addOrganPartAddedCallback=function(T){s.push(T)},this.addOrganPartRemovedCallback=function(T){o.push(T)},this.setFinishDownloadCallback=function(T){l=T},this.unsetFinishDownloadCallback=function(){l=void 0},this.getNamedObjectsToScreenCoordinates=function(T,C){const R=new Sr.THREE.Vector3;R.setFromMatrixPosition(obj.matrixWorld);const P=width/2,L=height/2;return R.project(C),R.x=R.x*P+P,R.y=-(R.y*L)+L,R};const y=function(T){let C,R;if(T!==void 0){let P=!1;T.object.userData&&T.object.userData.isMarker?(P=!0,R=T.object.userData.parent.getMorph()):R=T.object;try{R.userData.userData.annotation.data.lastActionOnMarker=P}finally{}if(R)if(R.name)C=R.name;else{const L=e.getAnnotationsFromObjects([R]);L&&L[0]&&(C=L[0].data.group)}}return{id:C,object:R}},p=function(){return function(T,C,R){var O;const P=e.getIntersectedObject(T),L=y(P),A={worldCoords:[P?P.point.x:0,P?P.point.y:0,P?P.point.z:0],intersected:P,intersects:T},I={x:C,y:R};if(L.id){A.threeID=(O=L.object)==null?void 0:O.id,L.object.userData.isGlyph?L.object.name?e.setSelectedByObjects([L.object],I,A,!0):e.setSelectedByZincObjects(L.object.userData.getGlyphset(),I,A,!0):e.setSelectedByObjects([L.object],I,A,!0);return}else e.setSelectedByObjects([],I,A,!0)}},d=function(){return function(T,C,R){var O;const P=e.getIntersectedObject(T),L=y(P),A={worldCoords:[P?P.point.x:0,P?P.point.y:0,P?P.point.z:0]},I={x:C,y:R};if(L.id){A.threeID=(O=L.object)==null?void 0:O.id,e.displayArea.style.cursor="pointer",e.setHighlightedByObjects([L.object],I,A,!0);return}else e.displayArea.style.cursor="auto",e.setHighlightedByObjects([],I,A,!0)}},b=function(T,C,R,P){if(P=="all"||P=="geometries"){const L=T.findGeometriesWithGroupName(C);for(let A=0;A-1){const R=T[C].PartName;if(e.scene.findGeometriesWithGroupName(R).length>0||e.scene.findGlyphsetsWithGroupName(R).length>0)e.changeOrganPartsVisibility(R,!0);else{const P=getOrganDetails(T[C].SystemName,R);P!=null&&e.scene.loadMetadataURL(u.getOrgansDirectoryPrefix()+"/"+P.meta)}}},this.getAvailableSpecies=function(T,C,R){const P=new Array;P.push("none");const L=Object.keys(organsFileMap);for(index in L){const A=L[index];A!=T&&organsFileMap[A].hasOwnProperty(C)&&organsFileMap[A][C].hasOwnProperty(R)&&P.push(A)}return P},this.getCentreAndSize=function(){const T=new Sr.THREE.Vector3,C=this.scene.getBoundingBox();C.getCenter(T);const R=[T.x,T.y,T.z];C.getSize(T);const P=[T.x,T.y,T.z];return{centre:R,size:P}};const S=function(T,C,R,P){e.sceneData.nerveMapIsActive=!1,e.sceneData.nerveMap=void 0,e.sceneData.metaURL="",e.sceneData.viewURL="",e.sceneData.currentSpecies=T,e.sceneData.currentSystem=C,e.sceneData.currentPart=R,e.sceneData.currentTime=0,e.sceneData.timeVarying=!1;let L="";T&&(L=T+"/"),C&&(L=C+"/"),R&&(L=R),e.sceneData.currentName=L};this.loadOrgansFromURL=function(T,C,R,P,L,A){if(e.zincRenderer&&P&&e.sceneData.metaURL!==T){S(C,R,P);const I=e.sceneData.currentName;let O=e.zincRenderer.getSceneByName(I);O?A&&O.clearAll():O=e.zincRenderer.createScene(I),e.selectObjectOnPick=!0;for(let N=0;N0&&s[s.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Dt(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var i=t.call(n),r,s=[],o;try{for(;(e===void 0||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(l){o={error:l}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return s}typeof SuppressedError=="function"&&SuppressedError;var QF="ENTRIES",Xx="KEYS",Yx="VALUES",Qt="",Gf=function(){function n(e,t){var i=e._tree,r=Array.from(i.keys());this.set=e,this._type=t,this._path=r.length>0?[{node:i,keys:r}]:[]}return n.prototype.next=function(){var e=this.dive();return this.backtrack(),e},n.prototype.dive=function(){if(this._path.length===0)return{done:!0,value:void 0};var e=Po(this._path),t=e.node,i=e.keys;if(Po(i)===Qt)return{done:!1,value:this.result()};var r=t.get(Po(i));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()},n.prototype.backtrack=function(){if(this._path.length!==0){var e=Po(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}},n.prototype.key=function(){return this.set._prefix+this._path.map(function(e){var t=e.keys;return Po(t)}).filter(function(e){return e!==Qt}).join("")},n.prototype.value=function(){return Po(this._path).node.get(Qt)},n.prototype.result=function(){switch(this._type){case Yx:return this.value();case Xx:return this.key();default:return[this.key(),this.value()]}},n.prototype[Symbol.iterator]=function(){return this},n}(),Po=function(n){return n[n.length-1]},eV=function(n,e,t){var i=new Map;if(e===void 0)return i;for(var r=e.length+1,s=r+t,o=new Uint8Array(s*r).fill(t+1),l=0;lt)continue e}Jx(n.get(y),e,t,i,r,d,o,l+y)}}}catch(A){u={error:A}}finally{try{m&&!m.done&&(c=h.return)&&c.call(h)}finally{if(u)throw u.error}}},Hf=function(){function n(e,t){e===void 0&&(e=new Map),t===void 0&&(t=""),this._size=void 0,this._tree=e,this._prefix=t}return n.prototype.atPrefix=function(e){var t,i;if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");var r=Dt(ru(this._tree,e.slice(this._prefix.length)),2),s=r[0],o=r[1];if(s===void 0){var l=Dt($f(o),2),u=l[0],c=l[1];try{for(var f=Ze(u.keys()),h=f.next();!h.done;h=f.next()){var m=h.value;if(m!==Qt&&m.startsWith(c)){var y=new Map;return y.set(m.slice(c.length),u.get(m)),new n(y,e)}}}catch(p){t={error:p}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(t)throw t.error}}}return new n(s,e)},n.prototype.clear=function(){this._size=void 0,this._tree.clear()},n.prototype.delete=function(e){return this._size=void 0,tV(this._tree,e)},n.prototype.entries=function(){return new Gf(this,QF)},n.prototype.forEach=function(e){var t,i;try{for(var r=Ze(this),s=r.next();!s.done;s=r.next()){var o=Dt(s.value,2),l=o[0],u=o[1];e(l,u,this)}}catch(c){t={error:c}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},n.prototype.fuzzyGet=function(e,t){return eV(this._tree,e,t)},n.prototype.get=function(e){var t=Wf(this._tree,e);return t!==void 0?t.get(Qt):void 0},n.prototype.has=function(e){var t=Wf(this._tree,e);return t!==void 0&&t.has(Qt)},n.prototype.keys=function(){return new Gf(this,Xx)},n.prototype.set=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=jf(this._tree,e);return i.set(Qt,t),this},Object.defineProperty(n.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var e=this.entries();!e.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),n.prototype.update=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=jf(this._tree,e);return i.set(Qt,t(i.get(Qt))),this},n.prototype.fetch=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=jf(this._tree,e),r=i.get(Qt);return r===void 0&&i.set(Qt,r=t()),r},n.prototype.values=function(){return new Gf(this,Yx)},n.prototype[Symbol.iterator]=function(){return this.entries()},n.from=function(e){var t,i,r=new n;try{for(var s=Ze(e),o=s.next();!o.done;o=s.next()){var l=Dt(o.value,2),u=l[0],c=l[1];r.set(u,c)}}catch(f){t={error:f}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}return r},n.fromObject=function(e){return n.from(Object.entries(e))},n}(),ru=function(n,e,t){var i,r;if(t===void 0&&(t=[]),e.length===0||n==null)return[n,t];try{for(var s=Ze(n.keys()),o=s.next();!o.done;o=s.next()){var l=o.value;if(l!==Qt&&e.startsWith(l))return t.push([n,l]),ru(n.get(l),e.slice(l.length),t)}}catch(u){i={error:u}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return t.push([n,e]),ru(void 0,"",t)},Wf=function(n,e){var t,i;if(e.length===0||n==null)return n;try{for(var r=Ze(n.keys()),s=r.next();!s.done;s=r.next()){var o=s.value;if(o!==Qt&&e.startsWith(o))return Wf(n.get(o),e.slice(o.length))}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},jf=function(n,e){var t,i,r=e.length;e:for(var s=0;n&&s0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Hf,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},n.prototype.discard=function(e){var t=this,i=this._idToShortId.get(e);if(i==null)throw new Error("MiniSearch: cannot discard document with ID ".concat(e,": it is not in the index"));this._idToShortId.delete(e),this._documentIds.delete(i),this._storedFields.delete(i),(this._fieldLength.get(i)||[]).forEach(function(r,s){t.removeFieldLength(i,s,t._documentCount,r)}),this._fieldLength.delete(i),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()},n.prototype.maybeAutoVacuum=function(){if(this._options.autoVacuum!==!1){var e=this._options.autoVacuum,t=e.minDirtFactor,i=e.minDirtCount,r=e.batchSize,s=e.batchWait;this.conditionalVacuum({batchSize:r,batchWait:s},{minDirtCount:i,minDirtFactor:t})}},n.prototype.discardAll=function(e){var t,i,r=this._options.autoVacuum;try{this._options.autoVacuum=!1;try{for(var s=Ze(e),o=s.next();!o.done;o=s.next()){var l=o.value;this.discard(l)}}catch(u){t={error:u}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}}finally{this._options.autoVacuum=r}this.maybeAutoVacuum()},n.prototype.replace=function(e){var t=this._options,i=t.idField,r=t.extractField,s=r(e,i);this.discard(s),this.add(e)},n.prototype.vacuum=function(e){return e===void 0&&(e={}),this.conditionalVacuum(e)},n.prototype.conditionalVacuum=function(e,t){var i=this;return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(function(){var r=i._enqueuedVacuumConditions;return i._enqueuedVacuumConditions=qf,i.performVacuuming(e,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)},n.prototype.performVacuuming=function(e,t){return qF(this,void 0,void 0,function(){var i,r,s,o,l,u,c,f,h,m,y,p,d,b,v,g,M,_,E,S,w,T,C,R,P;return KF(this,function(L){switch(L.label){case 0:if(i=this._dirtCount,!this.vacuumConditionsMet(t))return[3,10];r=e.batchSize||Jf.batchSize,s=e.batchWait||Jf.batchWait,o=1,L.label=1;case 1:L.trys.push([1,7,8,9]),l=Ze(this._index),u=l.next(),L.label=2;case 2:if(u.done)return[3,6];c=Dt(u.value,2),f=c[0],h=c[1];try{for(m=(T=void 0,Ze(h)),y=m.next();!y.done;y=m.next()){p=Dt(y.value,2),d=p[0],b=p[1];try{for(v=(R=void 0,Ze(b)),g=v.next();!g.done;g=v.next())M=Dt(g.value,1),_=M[0],!this._documentIds.has(_)&&(b.size<=1?h.delete(d):b.delete(_))}catch(A){R={error:A}}finally{try{g&&!g.done&&(P=v.return)&&P.call(v)}finally{if(R)throw R.error}}}}catch(A){T={error:A}}finally{try{y&&!y.done&&(C=m.return)&&C.call(m)}finally{if(T)throw T.error}}return this._index.get(f).size===0&&this._index.delete(f),o%r!==0?[3,4]:[4,new Promise(function(A){return setTimeout(A,s)})];case 3:L.sent(),L.label=4;case 4:o+=1,L.label=5;case 5:return u=l.next(),[3,2];case 6:return[3,9];case 7:return E=L.sent(),S={error:E},[3,9];case 8:try{u&&!u.done&&(w=l.return)&&w.call(l)}finally{if(S)throw S.error}return[7];case 9:this._dirtCount-=i,L.label=10;case 10:return[4,null];case 11:return L.sent(),this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null,[2]}})})},n.prototype.vacuumConditionsMet=function(e){if(e==null)return!0;var t=e.minDirtCount,i=e.minDirtFactor;return t=t||Kf.minDirtCount,i=i||Kf.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=i},Object.defineProperty(n.prototype,"isVacuuming",{get:function(){return this._currentVacuum!=null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dirtCount",{get:function(){return this._dirtCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dirtFactor",{get:function(){return this._dirtCount/(1+this._documentCount+this._dirtCount)},enumerable:!1,configurable:!0}),n.prototype.has=function(e){return this._idToShortId.has(e)},n.prototype.getStoredFields=function(e){var t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)},n.prototype.search=function(e,t){var i,r;t===void 0&&(t={});var s=this.executeQuery(e,t),o=[];try{for(var l=Ze(s),u=l.next();!u.done;u=l.next()){var c=Dt(u.value,2),f=c[0],h=c[1],m=h.score,y=h.terms,p=h.match,d=y.length||1,b={id:this._documentIds.get(f),score:m*d,terms:Object.keys(p),queryTerms:y,match:p};Object.assign(b,this._storedFields.get(f)),(t.filter==null||t.filter(b))&&o.push(b)}}catch(v){i={error:v}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(i)throw i.error}}return e===n.wildcard&&t.boostDocument==null&&this._options.searchOptions.boostDocument==null||o.sort(nw),o},n.prototype.autoSuggest=function(e,t){var i,r,s,o;t===void 0&&(t={}),t=dt(dt({},this._options.autoSuggestOptions),t);var l=new Map;try{for(var u=Ze(this.search(e,t)),c=u.next();!c.done;c=u.next()){var f=c.value,h=f.score,m=f.terms,y=m.join(" "),p=l.get(y);p!=null?(p.score+=h,p.count+=1):l.set(y,{score:h,terms:m,count:1})}}catch(E){i={error:E}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(i)throw i.error}}var d=[];try{for(var b=Ze(l),v=b.next();!v.done;v=b.next()){var g=Dt(v.value,2),p=g[0],M=g[1],h=M.score,m=M.terms,_=M.count;d.push({suggestion:p,terms:m,score:h/_})}}catch(E){s={error:E}}finally{try{v&&!v.done&&(o=b.return)&&o.call(b)}finally{if(s)throw s.error}}return d.sort(nw),d},Object.defineProperty(n.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"termCount",{get:function(){return this._index.size},enumerable:!1,configurable:!0}),n.loadJSON=function(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),t)},n.getDefault=function(e){if(Yf.hasOwnProperty(e))return Xf(Yf,e);throw new Error('MiniSearch: unknown option "'.concat(e,'"'))},n.loadJS=function(e,t){var i,r,s,o,l,u,c=e.index,f=e.documentCount,h=e.nextId,m=e.documentIds,y=e.fieldIds,p=e.fieldLength,d=e.averageFieldLength,b=e.storedFields,v=e.dirtCount,g=e.serializationVersion;if(g!==1&&g!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var M=new n(t);M._documentCount=f,M._nextId=h,M._documentIds=su(m),M._idToShortId=new Map,M._fieldIds=y,M._fieldLength=su(p),M._avgFieldLength=d,M._storedFields=su(b),M._dirtCount=v||0,M._index=new Hf;try{for(var _=Ze(M._documentIds),E=_.next();!E.done;E=_.next()){var S=Dt(E.value,2),w=S[0],T=S[1];M._idToShortId.set(T,w)}}catch(D){i={error:D}}finally{try{E&&!E.done&&(r=_.return)&&r.call(_)}finally{if(i)throw i.error}}try{for(var C=Ze(c),R=C.next();!R.done;R=C.next()){var P=Dt(R.value,2),L=P[0],A=P[1],I=new Map;try{for(var O=(l=void 0,Ze(Object.keys(A))),x=O.next();!x.done;x=O.next()){var N=x.value,B=A[N];g===1&&(B=B.ds),I.set(parseInt(N,10),su(B))}}catch(D){l={error:D}}finally{try{x&&!x.done&&(u=O.return)&&u.call(O)}finally{if(l)throw l.error}}M._index.set(L,I)}}catch(D){s={error:D}}finally{try{R&&!R.done&&(o=C.return)&&o.call(C)}finally{if(s)throw s.error}}return M},n.prototype.executeQuery=function(e,t){var i=this;if(t===void 0&&(t={}),e===n.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){var r=dt(dt(dt({},t),e),{queries:void 0}),s=e.queries.map(function(b){return i.executeQuery(b,r)});return this.combineResults(s,r.combineWith)}var o=this._options,l=o.tokenize,u=o.processTerm,c=o.searchOptions,f=dt(dt({tokenize:l,processTerm:u},c),t),h=f.tokenize,m=f.processTerm,y=h(e).flatMap(function(b){return m(b)}).filter(function(b){return!!b}),p=y.map(aV(f)),d=p.map(function(b){return i.executeQuerySpec(b,f)});return this.combineResults(d,f.combineWith)},n.prototype.executeQuerySpec=function(e,t){var i,r,s,o,l=dt(dt({},this._options.searchOptions),t),u=(l.fields||this._options.fields).reduce(function(N,B){var D;return dt(dt({},N),(D={},D[B]=Xf(l.boost,B)||1,D))},{}),c=l.boostDocument,f=l.weights,h=l.maxFuzzy,m=l.bm25,y=dt(dt({},ew.weights),f),p=y.fuzzy,d=y.prefix,b=this._index.get(e.term),v=this.termResults(e.term,e.term,1,b,u,c,m),g,M;if(e.prefix&&(g=this._index.atPrefix(e.term)),e.fuzzy){var _=e.fuzzy===!0?.2:e.fuzzy,E=_<1?Math.min(h,Math.round(e.term.length*_)):_;E&&(M=this._index.fuzzyGet(e.term,E))}if(g)try{for(var S=Ze(g),w=S.next();!w.done;w=S.next()){var T=Dt(w.value,2),C=T[0],R=T[1],P=C.length-e.term.length;if(P){M==null||M.delete(C);var L=d*C.length/(C.length+.3*P);this.termResults(e.term,C,L,R,u,c,m,v)}}}catch(N){i={error:N}}finally{try{w&&!w.done&&(r=S.return)&&r.call(S)}finally{if(i)throw i.error}}if(M)try{for(var A=Ze(M.keys()),I=A.next();!I.done;I=A.next()){var C=I.value,O=Dt(M.get(C),2),x=O[0],P=O[1];if(P){var L=p*C.length/(C.length+P);this.termResults(e.term,C,L,x,u,c,m,v)}}}catch(N){s={error:N}}finally{try{I&&!I.done&&(o=A.return)&&o.call(A)}finally{if(s)throw s.error}}return v},n.prototype.executeWildcardQuery=function(e){var t,i,r=new Map,s=dt(dt({},this._options.searchOptions),e);try{for(var o=Ze(this._documentIds),l=o.next();!l.done;l=o.next()){var u=Dt(l.value,2),c=u[0],f=u[1],h=s.boostDocument?s.boostDocument(f,"",this._storedFields.get(c)):1;r.set(c,{score:h,terms:[],match:{}})}}catch(m){t={error:m}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}return r},n.prototype.combineResults=function(e,t){if(t===void 0&&(t=Zf),e.length===0)return new Map;var i=t.toLowerCase();return e.reduce(rV[i])||new Map},n.prototype.toJSON=function(){var e,t,i,r,s=[];try{for(var o=Ze(this._index),l=o.next();!l.done;l=o.next()){var u=Dt(l.value,2),c=u[0],f=u[1],h={};try{for(var m=(i=void 0,Ze(f)),y=m.next();!y.done;y=m.next()){var p=Dt(y.value,2),d=p[0],b=p[1];h[d]=Object.fromEntries(b)}}catch(v){i={error:v}}finally{try{y&&!y.done&&(r=m.return)&&r.call(m)}finally{if(i)throw i.error}}s.push([c,h])}}catch(v){e={error:v}}finally{try{l&&!l.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:s,serializationVersion:2}},n.prototype.termResults=function(e,t,i,r,s,o,l,u){var c,f,h,m,y;if(u===void 0&&(u=new Map),r==null)return u;try{for(var p=Ze(Object.keys(s)),d=p.next();!d.done;d=p.next()){var b=d.value,v=s[b],g=this._fieldIds[b],M=r.get(g);if(M!=null){var _=M.size,E=this._avgFieldLength[g];try{for(var S=(h=void 0,Ze(M.keys())),w=S.next();!w.done;w=S.next()){var T=w.value;if(!this._documentIds.has(T)){this.removeTerm(g,T,t),_-=1;continue}var C=o?o(this._documentIds.get(T),t,this._storedFields.get(T)):1;if(C){var R=M.get(T),P=this._fieldLength.get(T)[g],L=oV(R,_,this._documentCount,P,E,l),A=i*v*C*L,I=u.get(T);if(I){I.score+=A,cV(I.terms,e);var O=Xf(I.match,t);O?O.push(b):I.match[t]=[b]}else u.set(T,{score:A,terms:[e],match:(y={},y[t]=[b],y)})}}}catch(x){h={error:x}}finally{try{w&&!w.done&&(m=S.return)&&m.call(S)}finally{if(h)throw h.error}}}}}catch(x){c={error:x}}finally{try{d&&!d.done&&(f=p.return)&&f.call(p)}finally{if(c)throw c.error}}return u},n.prototype.addTerm=function(e,t,i){var r=this._index.fetch(i,iw),s=r.get(e);if(s==null)s=new Map,s.set(t,1),r.set(e,s);else{var o=s.get(t);s.set(t,(o||0)+1)}},n.prototype.removeTerm=function(e,t,i){if(!this._index.has(i)){this.warnDocumentChanged(t,e,i);return}var r=this._index.fetch(i,iw),s=r.get(e);s==null||s.get(t)==null?this.warnDocumentChanged(t,e,i):s.get(t)<=1?s.size<=1?r.delete(e):s.delete(t):s.set(t,s.get(t)-1),this._index.get(i).size===0&&this._index.delete(i)},n.prototype.warnDocumentChanged=function(e,t,i){var r,s;try{for(var o=Ze(Object.keys(this._fieldIds)),l=o.next();!l.done;l=o.next()){var u=l.value;if(this._fieldIds[u]===t){this._options.logger("warn","MiniSearch: document with ID ".concat(this._documentIds.get(e),' has changed before removal: term "').concat(i,'" was not present in field "').concat(u,'". Removing a document after it has changed can corrupt the index!'),"version_conflict");return}}}catch(c){r={error:c}}finally{try{l&&!l.done&&(s=o.return)&&s.call(o)}finally{if(r)throw r.error}}},n.prototype.addDocumentId=function(e){var t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t},n.prototype.addFields=function(e){for(var t=0;te.split(/[\s/]+/)}),this.idMaps={}}addZincObject(e,t){const i=e.getRegion().getFullPath();let r=e.groupName,s=i?`${i}/${e.groupName}`:e.groupName;r=r.replaceAll('"',""),s=s.replaceAll('"',"");const o={path:s,name:r,id:t};this._searchEngine.add(o),this.idMaps[t]={path:s,zincObject:e}}removeZincObject(e,t){const i=e.getRegion().getFullPath();let r=e.groupName,s=i?`${i}/${e.groupName}`:e.groupName;r=r.replaceAll('"',""),s=s.replaceAll('"',"");const o={path:s,name:r,id:t};this._searchEngine.remove(o),delete this.idMaps[t]}addRegion(e,t){let i=e.getFullPath(),r=e.getName();i=i.replaceAll('"',""),r=r.replaceAll('"',"");const s={path:i,name:r,id:t};this._searchEngine.add(s),this.idMaps[t]={path:i,zincObject:e}}clearResults(){this._}removeAll(){this._searchEngine.removeAll(),this.idMaps={}}auto_suggest(e){let t=[];e.length>2&&["'",'"'].includes(e.slice(0,1))?(e=e.replaceAll(e.slice(0,1),""),t=this._searchEngine.search(e,{prefix:!0,combineWith:"AND"})):e.length>1&&(t=this._searchEngine.search(e,{prefix:!0}));const i=[];t.forEach(o=>{o.id in this.idMaps&&i.push(this.idMaps[o.id].path)});const r=[...new Set(i)],s=[];return r.forEach(o=>s.push({suggestion:'"'+o+'"'})),s}processResults(e,t){const i={regionPath:void 0,label:'Search Results for "'};return Array.isArray(t)?i.label+=",".join(t):i.label+=t,i.label+='"',e.length===1&&(e[0].isRegion?i.regionPath=e[0].getFullPath():e[0].isZincObject&&(i.regionPath=e[0].getRegion().getFullPath(),i.label=e[0].groupName)),i.zincObjects=cF(e),i}search(e){let t;e.length>2&&["'",'"'].includes(e.slice(0,1))?(e=e.replaceAll(e.slice(0,1),""),t=this._searchEngine.search(e,{prefix:!0,combineWith:"AND"})):e.length>1&&(t=this._searchEngine.search(e,{prefix:!0}));const i=[];return t.forEach(r=>{r.id in this.idMaps&&i.push(this.idMaps[r.id].zincObject)}),i}searchTerms(e){let t=[];return e.forEach(i=>{const r=this.search(i);t.push(...r)}),t}searchAndProcessResult(e){let t=[];return Array.isArray(e)?t=this.searchTerms(e):t=this.search(e),this.processResults(t,e)}}const hV={name:"ScaffoldVuer",components:{Button:Cs,Col:Fn,Loading:YL,Option:Ls,Popover:Pl,Row:Qn,Select:As,Slider:Ln,TabPane:jg,Tabs:Wg,MapSvgIcon:ep.MapSvgIcon,MapSvgSpriteColor:ep.MapSvgSpriteColor,PrimitiveControls:Dx,ScaffoldTooltip:jx,ElIconWarningFilled:lm,ElIconArrowDown:Lu,ElIconArrowLeft:Wi,DrawToolbar:Ja.DrawToolbar,ScaffoldTreeControls:Bx},setup(n){let e=a.inject("$annotator");return e||(e=a.markRaw(new HF(`${n.flatmapAPI}annotator`)),a.provide("$annotator",e)),{annotator:e}},props:{annotationSidebar:{type:Boolean,default:!1},url:{type:String,default:""},showColourPicker:{type:Boolean,default:!1},displayUI:{type:Boolean,default:!0},displayAtStartUp:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},helpModeActiveItem:{type:Number,default:0},helpModeDialog:{type:Boolean,default:!1},helpModeLastItem:{type:Boolean,default:!1},helpModeInitialIndex:{type:Number,default:0},displayWarning:{type:Boolean,default:!0},warningMessage:{type:String,default:"Beta feature - under active development"},displayLatestChanges:{type:Boolean,default:!1},latestChangesMessage:{type:String,default:"New feature - Local search is now available"},displayMarkers:{type:Boolean,default:!1},markerCluster:{type:Boolean,default:!1},markerLabels:{type:Object,default:function(){return{}}},displayMinimap:{type:Boolean,default:!1},format:{type:String,default:"metadata"},minimapSettings:{type:Object,default:function(){return{x_offset:16,y_offset:16,width:128,height:128,align:"top-right"}}},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array,default:function(){return[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}]}},state:{type:Object,default:void 0},region:{type:String,default:""},viewURL:{type:String,default:""},render:{type:Boolean,default:!0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},enableLocalAnnotations:{type:Boolean,default:!1}},provide(){return{flatmapAPI:this.flatmapAPI,scaffoldUrl:this.url,boundingDims:this.boundingDims}},data:function(){return{annotator:void 0,createData:{drawingBox:!1,toBeConfirmed:!1,points:[],shape:"",x:0,y:0,editingIndex:-1,faceIndex:-1,toBeDeleted:!1},currentTime:0,timeVarying:!1,isPlaying:!1,isReady:!1,isTransitioning:!1,tooltipAppendToBody:!1,hoverVisibilities:[{value:!1,ref:"zoomInPopover"},{value:!1,ref:"zoomOutPopover"},{value:!1,ref:"zoomFitPopover"},{value:!1,ref:"openMapPopover"},{value:!1,ref:"settingsPopover"},{value:!1,ref:"sliderPopover"},{value:!1,ref:"regionVisibilityPopover"},{value:!1,ref:"warningPopover"},{value:!1,ref:"whatsNewPopover"},{value:!1,refs:"toolbarPopover",ref:"editPopover"},{value:!1,refs:"toolbarPopover",ref:"pointPopover"},{value:!1,refs:"toolbarPopover",ref:"lineStringPopover"},{value:!1,refs:"toolbarPopover",ref:"deletePopover"}],inHelp:!1,helpModeActiveIndex:this.helpModeInitialIndex,loading:!1,duration:3e3,drawerOpen:!0,currentBackground:"white",availableBackground:["white","lightskyblue","black"],minimisedSlider:!1,sliderPosition:"",timeMax:100,orginalDuration:"",animateDuration:"6secs",playSpeed:[{value:.1,label:"0.1x"},{value:.5,label:"0.5x"},{value:1,label:"1x"},{value:2,label:"2x"},{value:5,label:"5x"},{value:10,label:"10x"}],currentSpeed:1,timeStamps:{},defaultCheckedKeys:[],tData:{label:"",region:"",visible:!1,x:200,y:200,active:!1},fileFormat:"metadata",previousMarkerLabels:a.markRaw({}),viewingMode:"Exploration",viewingModes:{Exploration:"View and explore detailed visualization of 3D scaffolds",Annotation:"View internal identifiers of features"},openMapRef:void 0,backgroundIconRef:void 0,userInformation:void 0,toolbarOptions:["Delete","Edit","Point","LineString"],activeDrawTool:void 0,activeDrawMode:void 0,localAnnotationsList:a.markRaw([]),boundingDims:{centre:[0,0,0],size:[1,1,1]},lastSelected:a.markRaw({region:"",group:"",isSearch:!1})}},watch:{format:{handler:function(n){this.fileFormat=n},immediate:!0},url:{handler:function(n){(this.state===void 0||this.state.url===void 0)&&this.setURL(n)},immediate:!0},region:{handler:function(n){this.state||this.viewURL||this.setFocusedRegion(n)},immediate:!0},state:{handler:function(n){this.setState(n)},immediate:!0,deep:!0},viewURL:{handler:function(n){this.updateViewURL(n)},immediate:!0},helpMode:function(n,e){n!==e&&this.setHelpMode(n)},helpModeActiveItem:function(){this.helpMode&&(this.helpModeActiveIndex+=1,this.setHelpMode(this.helpMode))},displayMarkers:function(n){this.$module.scene.displayMarkers=n,this.$module.scene.forcePickableObjectsUpdate=!0},displayMinimap:function(n){this.$module.scene.displayMinimap=n},currentTime:{handler:function(){this.$emit("timeChanged",this.currentTime)}},duration:function(){this.$module.scene.setDuration(this.duration)},minimapSettings:{deep:!0,handler:"updateMinimapScissor"},render:function(n){this.toggleRendering(n)},markerCluster:{handler:function(n){this.$module.scene.enableMarkerCluster(n)},immediate:!0},markerLabels:function(n){for(const[e,t]of Object.entries(this.previousMarkerLabels))this.setMarkerModeForObjectsWithName(e,t,"off");for(const[e,t]of Object.entries(n))this.setMarkerModeForObjectsWithName(e,t,"on");this.previousMarkerLabels=a.markRaw({...n})},annotationDisplay:function(n){if(this.annotationSidebar)if(n){const t={featureId:(this.tData.region?this.tData.region+"/":"")+this.tData.label,resourceId:this.url,resource:this.url};this.$emit("annotation-open",{annotationEntry:t,commitCallback:this.commitAnnotationEvent})}else(!this.createData.toBeConfirmed||!this.createData.toBeDeleted)&&this.$emit("annotation-close")}},beforeCreate:function(){this.$module=new Zx,this.selectedObjects=[],this.hoveredObjects=[],this.currentBackground="white",this._currentURL=void 0,this.availableBackground=["white","black","lightskyblue"],this.$_searchIndex=new dV},mounted:function(){this.openMapRef=a.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=a.shallowRef(this.$refs.backgroundIconRef),this.$refs.scaffoldTreeControls.setModule(this.$module);let n=new $F;n.subscribe(this,this.eventNotifierCallback),this.$module.addNotifier(n),this.$module.addOrganPartAddedCallback(this.zincObjectAdded),this.$module.addOrganPartRemovedCallback(this.zincObjectRemoved),this.$module.initialiseRenderer(this.$refs.display),this.toggleRendering(this.render),this.ro=new ResizeObserver(this.adjustLayout).observe(this.$refs.scaffoldContainer),this.helpTextWait=[],this.helpTextWait.length=this.hoverVisibilities.length,this.defaultRate=this.$module.getPlayRate(),this.$module.zincRenderer.addPreRenderCallbackFunction(()=>{this.currentTime=this.$module.getCurrentTime()})},beforeUnmount:function(){this.ro&&this.ro.disconnect(),this.$module.destroy(),this.$module=void 0},computed:{...Hx(Wx,["userToken"]),annotationDisplay:function(){return this.viewingMode==="Annotation"&&this.tData.active===!0&&this.activeDrawMode!=="Point"&&this.activeDrawMode!=="LineString"}},methods:{addZincObject:function(n){this.$module.scene&&this.$module.scene.addZincObject(n)},zincObjectAdded:function(n){this.loading=!1,this.$_searchIndex.addZincObject(n,n.uuid),this.timeVarying===!1&&n.isTimeVarying()&&(this.timeVarying=!0),this.$emit("zinc-object-added",n)},removeFromLocalAnnotationList:function(n,e){for(let t=0;t{this.$_searchIndex.addRegion(t,t.uuid)})},backgroundChangeCallback:function(n){this.currentBackground=n,this.$module.zincRenderer.getThreeJSRenderer().setClearColor(this.currentBackground,1)},captureScreenshotCallback:function(){this.$module.zincRenderer.removePostRenderCallbackFunction(this.captureID);let n=this.$module.zincRenderer.getThreeJSRenderer().domElement.toDataURL("image/png"),e=document.createElement("a");document.body.append(e),this.captureFilename?e.download=this.captureFilename:e.download="screenshot.png",e.href=n,e.click(),e.remove()},captureScreenshot:function(n){this.captureFilename=n,this.captureID=this.$module.zincRenderer.addPostRenderCallbackFunction(this.captureScreenshotCallback)},clearScene:function(){this.$refs.scaffoldTreeControls&&this.$refs.scaffoldTreeControls.clear(),this.$_searchIndex&&this.$_searchIndex.removeAll(),this.$module.scene&&this.$module.scene.clearAll()},addAndEditAnnotations:function(n,e,t,i){const r=Ax(this.annotator,this.userToken,t,n,e,this.url,i);if(this.enableLocalAnnotations){r.group=e;let s=n;s.slice(-1)==="/"&&(s=s.slice(0,-1)),r.region=s,this.removeFromLocalAnnotationList(s,e),this.localAnnotationsList.push(r)}this.$emit("userPrimitivesUpdated",{region:n,group:e,zincObject:t})},primitivesUpdated:function(n){if(n.isZincObject&&n.isEditable){const e=n.groupName,t=n.region.getFullPath();this.addAndEditAnnotations(t,e,n,"Position Updated")}},confirmCreate:function(n){if(n){let e;if(n.shape==="Point")e=this.$module.scene.createPoints(n.region,n.group,this.createData.points,n.group,8942);else if(n.shape==="LineString")e=this.$module.scene.createLines(n.region,n.group,[this.createData.points[0],this.createData.points[1]],60962);else if(n.editingIndex>-1&&this._editingZincObject){this._editingZincObject.editVertices([this.createData.points[1]],n.editingIndex);const t=this._editingZincObject.region.getFullPath()+"/",i=this._editingZincObject.groupName;this.addAndEditAnnotations(t,i,this._editingZincObject,"Position Updated")}e&&(this.addAndEditAnnotations(n.region,n.group,e.zincObject,"Create"),e.zincObject.isEditable=!0,this.tData.region=n.region,this.tData.label=n.group,this.changeActiveByName([n.group],n.region,!1))}this.cancelCreate()},cancelCreate:function(){this.createData.points.length=0,this.createData.toBeConfirmed=!1,this._editingZincObject=void 0,this.createData.editingIndex=-1,this.createData.faceIndex=-1,this.tData.visible=!1,this.createData.toBeDeleted=!1,this._tempLine&&(this.$module.scene.removeTemporaryPrimitive(this._tempLine),this._tempLine=void 0),this._tempPoint&&(this.$module.scene.removeTemporaryPrimitive(this._tempPoint),this._tempPoint=void 0),this.annotationSidebar&&this.$emit("annotation-close")},confirmDelete:function(){var n;if((n=this._editingZincObject)!=null&&n.isEditable){const e=this._editingZincObject.region.getFullPath()+"/",t=this._editingZincObject.groupName;Ax(this.annotator,this.userToken,this._editingZincObject,e,t,this.url,"Deleted")&&this.$module.scene.getRootRegion().findChildFromPath(e).removeZincObject(this._editingZincObject)}this.cancelCreate()},onTooltipHide:function(){this.createData.toBeConfirmed&&!this.annotationSidebar&&this.cancelCreate()},formatTooltip(n){if(this.timeMax>=1e3&&n){let e=(n%6e4/1e3).toFixed(2)+"s";return(n>6e4?(n/6e4).toFixed(0)+"m ":"")+e}return n?n.toFixed(2)+" ms":"0 ms"},fitWindow:function(){if(this.$module.scene){let n=!1;this._boundingBoxGeo&&(n=this._boundingBoxGeo.getVisibility(),this._boundingBoxGeo.setVisibility(!1)),this.$module.scene.viewAll(),this._boundingBoxGeo&&(aF(this._boundingBoxGeo,this.$module.scene),this._boundingBoxGeo.setVisibility(n))}},zoomIn:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(-1)},zoomOut:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(1)},speedChanged:function(n){this.currentSpeed=n,this.$module.setPlayRate(this.defaultRate*this.currentSpeed)},stopFreeSpin:function(){this.$module.scene.getZincCameraControls().stopAutoTumble(),this.isTransitioning=!1},findObjectsWithGroupName:function(n){let e=[];return n&&n!=""&&this.$module.scene&&(e=this.$module.scene.findObjectsWithGroupName(n)),e},toggleDrawing:function(n,e){this.createData.toBeDeleted=!1,n==="mode"?(this.cancelCreate(),this.activeDrawMode=e,this.createData.shape="",this.$module.selectObjectOnPick=!0):n==="tool"&&(this.activeDrawTool=e,this.createData.shape=this.activeDrawTool?this.activeDrawTool:"",this.$module.selectObjectOnPick=!1)},toggleDrawingBox:function(){this.createData.drawingBox=!this.createData.drawingBox},viewRegion:function(n){const e=this.$module.scene.getRootRegion(),t=Array.isArray(n)?n:[n],i=Lo(e,t,"",!0);let r=this.$module.scene.getBoundingBoxOfZincObjects(i);if(r){if(this.$module.isSyncControl())this.$module.setSyncControlZoomToBox(r);else{const s=this.$module.scene.camera.far-this.$module.scene.camera.near;this.$module.scene.viewAllWithBoundingBox(r),this.$module.scene.camera.far=this.$module.scene.camera.near+s,this.$module.scene.camera.updateProjectionMatrix()}return!0}return!1},setFocusedRegion:function(n){n&&(this.isReady?this.viewRegion(n):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({region:n})))},updateViewURL:function(n){if(n)if(this.isReady){const e=new URL(n,this.url);this.$module.scene.loadViewURL(e)}else this.$module.setFinishDownloadCallback(this.setURLFinishCallback({viewURL:n}))},createEditTemporaryLines:function(n){const e=n[0].extraData.worldCoords;if(e&&(this.createData.shape==="LineString"||this.createData.editingIndex>-1)&&this.createData.points.length===1)if(this.showRegionTooltipWithAnnotations(n,!0,!1),this.tData.x=50,this.tData.y=200,this._tempLine){const t=this._tempLine.geometry.getAttribute("position");t.setXYZ(1,e[0],e[1],e[2]),t.needsUpdate=!0}else this._tempLine=this.$module.scene.addTemporaryLines([this.createData.points[0],e],65535)},draw:function(n){n&&n.length>0&&n[0].data.group&&n[0].extraData.worldCoords&&(this.createData.shape==="Point"?this.drawPoint(n[0].extraData.worldCoords,n):(this.createData.shape==="LineString"||this.createData.editingIndex>-1)&&this.drawLine(n[0].extraData.worldCoords,n))},drawPoint:function(n,e){this.createData.toBeConfirmed===!1&&(this.createData.points.length=0,this.createData.points.push(n),this.createData.toBeConfirmed=!0,this.showRegionTooltipWithAnnotations(e,!0,!1),this.tData.x=50,this.tData.y=200,this._tempPoint=this.$module.scene.addTemporaryPoints([n],16776960))},drawLine:function(n,e){this.createData.toBeConfirmed===!1&&(this.createData.points.length===1?(this.createData.points.push(n),this.createData.toBeConfirmed=!0,this.showRegionTooltipWithAnnotations(e,!0,!1),this.tData.x=50,this.tData.y=200):(this._tempPoint=this.$module.scene.addTemporaryPoints([n],16776960),this.createData.points.push(n)))},getRendererInfo:function(){if(this.$module.zincRenderer)return this.$module.zincRenderer.getThreeJSRenderer().info},freeSpin:function(){if(this.$module.scene){let n=this.$module.scene.getZincCameraControls();this.isTransitioning=!0,n.enableAutoTumble(),n.autoTumble([1,0],Math.PI,!0),setTimeout(this.stopFreeSpin,4e3)}},activateAnnotationMode:function(n,e){if(this.userInformation||this.enableLocalAnnotations)if(this.createData.toBeDeleted=!1,this.createData.shape!==""||this.createData.editingIndex>-1)n.length>0&&e.identifiers[0].coords&&(this.createData.x=e.identifiers[0].coords.x,this.createData.y=e.identifiers[0].coords.y,this.draw(e.identifiers));else{if(this.activeDrawMode==="Edit"){const t=rF(e);t&&this.activateEditingMode(t.zincObject,t.faceIndex,t.vertexIndex,t.point)}else if(this.activeDrawMode==="Delete"){const t=sF(e);t&&(this.createData.toBeDeleted=!0,this._editingZincObject=t)}this.activeDrawMode!=="Point"&&this.activeDrawMode!=="LineString"?this.showRegionTooltipWithAnnotations(e.identifiers,!0,!1):this.showRegionTooltipWithAnnotations(e.identifiers,!0,!0)}else this.showRegionTooltipWithAnnotations(e.identifiers,!0,!0)},activateEditingMode:function(n,e,t,i){this._editingZincObject=n,this.createData.faceIndex=e,this.createData.editingIndex=t,this.drawLine(i,void 0)},eventNotifierCallback:function(n){if(!(this.createData.toBeConfirmed||this.createData.toBeDeleted)){const e=[];let t=[];(n.eventType==1||n.eventType==2)&&(n.identifiers.forEach(s=>{if(s){let o=s.data.id?s.data.id:s.data.group;e.push(o)}}),t=n.zincObjects);let i,r;if(n.identifiers.length>0&&n.identifiers[0]&&(i=n.identifiers[0].data.id?n.identifiers[0].data.id:n.identifiers[0].data.group,n.identifiers[0].data.region&&(r=n.identifiers[0].data.region)),n.eventType==1)this.viewingMode==="Annotation"?(this.tData.label=i,this.tData.region=r,this.activateAnnotationMode(e,n)):(this.$refs.scaffoldTreeControls&&(e.length>0?(this.$refs.scaffoldTreeControls.updateActiveUI(t),this.updatePrimitiveControls(t)):(this.hideRegionTooltip(),this.$refs.scaffoldTreeControls.removeActive(!1))),n.identifiers.length===1?(this.lastSelected.isSearch=!1,this.lastSelected.region=r,this.lastSelected.group=n.identifiers[0].data.group):n.identifiers.length===0&&(this.lastSelected.isSearch=!1,this.lastSelected.region="",this.lastSelected.group=""),this.$emit("scaffold-selected",n.identifiers));else if(n.eventType==2)this.selectedObjects.length===0&&(this.hideRegionTooltip(),this.$refs.scaffoldTreeControls&&(e.length>0?this.$refs.scaffoldTreeControls.updateHoverUI(t):this.$refs.scaffoldTreeControls.removeHover(!0)),n.identifiers.length>0&&n.identifiers[0]&&n.identifiers[0].coords&&(this.tData.active=!1,(this.viewingMode!=="Annotation"||!this.annotationSidebar)&&(this.tData.visible=!0),this.tData.label=i,this.tData.region=r,this.tData.x=n.identifiers[0].coords.x,this.tData.y=n.identifiers[0].coords.y,this.createEditTemporaryLines(n.identifiers)),this.$emit("scaffold-highlighted",n.identifiers));else if(n.eventType==3&&n.identifiers.length>0&&n.identifiers[0]){if(n.identifiers[0].coords){const s=this.$refs.scaffoldContainer.getBoundingClientRect();this.tData.x=n.identifiers[0].coords.x-s.left,this.tData.y=n.identifiers[0].coords.y-s.top}this.createEditTemporaryLines(n.identifiers)}}},getCoordinatesOfSelected:function(){if(this.selectedObjects&&this.selectedObjects.length>0)return this.$module.scene.getObjectsScreenXY(this.selectedObjects)},getDynamicSelectedCoordinates:function(){return this.$module.selectedScreenCoordinates},timeChange:function(n){let e=n/this.timeMax*100;e!=this.currentTime&&this.$module.updateTime(e)},updatePrimitiveControls:function(n){this.selectedObjects=n,this.selectedObjects&&this.selectedObjects.length>0?this.$refs.primitiveControls.setObject(this.selectedObjects[0]):this.$refs.primitiveControls.setObject(void 0)},objectSelected:function(n,e){this.updatePrimitiveControls(n),this.$module.setSelectedByZincObjects(n,void 0,{},e)},objectHovered:function(n,e){this.hoveredObjects=n,this.$module.setHighlightedByZincObjects(n,void 0,{},e)},changeActiveByName:function(n,e,t){const i=Array.isArray(n);if(n===void 0||i&&n.length===0)this.$refs.scaffoldTreeControls.removeActive(t);else{let r=n;i||(r=[r]),this.$refs.scaffoldTreeControls.changeActiveByNames(r,e,t)}},changeHighlightedByName:function(n,e,t){const i=Array.isArray(n);if(n===void 0||i&&n.length===0)this.$refs.scaffoldTreeControls.removeHover(t);else{let r=n;i||(r=[r]),this.$refs.scaffoldTreeControls.changeHoverByNames(r,e,t)}},play:function(n){this.$module.playAnimation(n),this.isPlaying=n},setHelpMode:function(n){const e=this.hoverVisibilities.length,t=e-1,i=this.hoverVisibilities[this.helpModeActiveIndex];if(i){const r=i==null?void 0:i.refs,s=i==null?void 0:i.ref;this.$refs[r||s]||(this.helpModeActiveIndex+=1)}n||(this.helpModeActiveIndex=this.helpModeInitialIndex),n&&this.helpModeActiveIndex>=t&&this.$emit("help-mode-last-item",!0),n&&!this.helpModeDialog?(this.inHelp=!0,this.hoverVisibilities.forEach(r=>{r.value=!0})):n&&this.helpModeDialog&&e>this.helpModeActiveIndex?this.helpModeActiveIndex>-1&&setTimeout(()=>{this.inHelp=!1,this.hoverVisibilities.forEach(r=>{r.value=!1}),this.showHelpText(this.helpModeActiveIndex,200)},300):(this.inHelp=!1,this.hoverVisibilities.forEach(r=>{r.value=!1}))},displayTooltipOfObjectsCallback:function(n,e,t,i,r){const s=this;return function(){s.$module.zincRenderer.removePostRenderCallbackFunction(s.$_regionTooltipCallback),s.$_regionTooltipCallback=void 0,s.displayTooltipOfObjects(n,e,t,i,r)}},liveUpdateTooltipPosition:function(){this.$module.selectedCenter&&(this.tData.x=this.$module.selectedScreenCoordinates.x,this.tData.y=this.$module.selectedScreenCoordinates.y)},displayTooltipOfObjects:function(n,e,t,i,r){if(e.length>0){let s=e[0].getClosestVertexDOMElementCoords(this.$module.scene);if(s)return s.inView?(n.includes("Search Results for")?this.tData.active=!1:this.tData.active=!0,this.tData.visible=!0,this.tData.label=n,this.tData.x=s.position.x,this.tData.y=s.position.y,this.tData.region=t,this.$_liveCoordinatesUpdated&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),r&&(this.$module.setupLiveCoordinates(e),this.$_liveCoordinatesUpdated=this.$module.zincRenderer.addPostRenderCallbackFunction(this.liveUpdateTooltipPosition))):(this.hideRegionTooltip(),i&&(this.$module.scene.viewAll(),this.$_regionTooltipCallback&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_regionTooltipCallback),this.$_regionTooltipCallback=this.$module.zincRenderer.addPostRenderCallbackFunction(this.displayTooltipOfObjectsCallback(n,e,t,i,r)))),!0}return this.hideRegionTooltip(),!1},showRegionTooltipWithObjects:function(n,e,t,i,r){return n&&e&&e.length>0&&this.$module.scene?this.displayTooltipOfObjects(n,e,t,i,r):(this.hideRegionTooltip(),!1)},showRegionTooltip:function(n,e,t){if(n&&this.$module.scene){const i=this.$module.scene.getRootRegion(),s=Lo(i,[n],"",!0);let o;return s&&s.length>0&&(o=s[0].getRegion().getFullPath()),this.showRegionTooltipWithObjects(n,s,o,e,t)}return this.hideRegionTooltip(),!1},showRegionTooltipWithAnnotations:function(n,e,t){if(this.$module.scene){const i=Cx(this.$module.scene,n);if(i&&i.objects.length>0)if(this.annotationSidebar){const s={featureId:(this.tData.region?this.tData.region+"/":"")+this.tData.label,resourceId:this.url,resource:this.url};this.$emit("annotation-open",{annotationEntry:s,createData:this.createData,confirmCreate:this.confirmCreate,cancelCreate:this.cancelCreate,confirmDelete:this.confirmDelete});return}else return this.showRegionTooltipWithObjects(i.label,i.objects,i.regionPath,e,t)}return this.hideRegionTooltip(),!1},changeViewingMode:function(n){if(this.$module){if(n&&(this.viewingMode=n),this.viewingMode==="Annotation"){let e=!1;this.userInformation&&(e=!0),this.userInformation=void 0,this.annotator.authenticate(this.userToken).then(t=>{t.name&&t.email&&t.canUpdate&&(this.userInformation=t,e||(Lx(this.annotator,this.userToken,this.url).then(i=>{i&&i.features&&Of(this.$module.scene,i.features)}),Lx(this.annotator,this.userToken,encodeURIComponent(this.url)).then(i=>{i&&i.features&&Of(this.$module.scene,i.features)})))})}else this.viewingMode==="Exploration"&&(this.activeDrawTool=void 0,this.activeDrawMode=void 0,this.createData.shape="");this.viewingMode==="Exploration"||this.viewingMode==="Annotation"&&this.createData.shape===""?this.$module.selectObjectOnPick=!0:this.$module.selectObjectOnPick=!1,this.cancelCreate()}},hideRegionTooltip:function(){this.$_liveCoordinatesUpdated&&(this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),this.$module.setupLiveCoordinates(void 0)),this.tData.active=!1,this.tData.visible=!1,this.tData.region=void 0},setMarkerModeForObjectsWithName:function(n,e,t){if(n&&this.$module.scene){let i=e;typeof e=="number"&&(i={number:e,imgURL:void 0});const r=this.$module.scene.getRootRegion();Lo(r,[n],"",!0).forEach(l=>l.setMarkerMode(t,i))}},setMarkerModeWithAnnotations:function(n,e){if(this.$module.scene){const t=Cx(this.$module.scene,n);t&&t.objects.length>0&&t.objects.forEach(i=>i.setMarkerMode(e))}},showHelpText:function(n,e=500){this.inHelp||(clearTimeout(this.helpTextWait[n]),this.helpTextWait[n]=setTimeout(()=>{this.hoverVisibilities[n].value=!0,this.$emit("shown-tooltip")},e))},hideHelpText:function(n,e=500){this.inHelp||(clearTimeout(this.helpTextWait[n]),this.helpTextWait[n]=setTimeout(()=>{this.hoverVisibilities[n].value=!1},e))},search:function(n,e){if(this.$_searchIndex){if(n===void 0||n===""||Array.isArray(n)&&n.length===0)return this.lastSelected.region="",this.lastSelected.group="",this.lastSelected.isSearch=!0,this.objectSelected([],!0),!1;{this.lastSelected.region="",this.lastSelected.group=n,this.lastSelected.isSearch=!0;const t=this.$_searchIndex.searchAndProcessResult(n),i=t.zincObjects;if(i.length>0){if(this.objectSelected(i,!0),e)for(let r=0;r{this.$module.scene.minimapScissor[n]=this.minimapSettings[n]}),this.$module.scene.minimapScissor.updateRequired=!0},updateSettingsfromScene:function(){this.currentSpeed=1,this.$module.setPlayRate(this.defaultRate),this.orginalDuration=this.$module.scene.getMetadataTag("OriginalDuration"),this.animateDuration=this.$module.scene.getMetadataTag("Duration");let n=this.$module.scene.getMetadataTag("TimeStamps");this.timeStamps={};for(const e in n)this.timeStamps[n[e]]=e;this.timeMax=this.$module.scene.getDuration()},restoreSettings:function(n){if(n){if(n.viewport)this.$module.scene.getZincCameraControls().setCurrentCameraSettings(n.viewport);else if(n.viewURL&&n.viewURL!==""){const t=new URL(n.viewURL,this.url);this.$module.scene.loadViewURL(t)}else n.region&&n.region!==""&&this.viewRegion(n.region);n.visibility&&this.$nextTick(()=>{this.$refs.scaffoldTreeControls.setState(n.visibility)}),n.background&&this.backgroundChangeCallback(n.background),n.viewingMode&&this.changeViewingMode(n.viewingMode);const e=n.search;e&&e.group&&(e.isSearch?this.search(e.group,!0):this.changeActiveByName(e.group,e.region,!0))}},setURLFinishCallback:function(n){return()=>{this.localAnnotationsList.length=0,this.updateSettingsfromScene(),this.$module.updateTime(.01),this.$module.updateTime(0),this.$module.unsetFinishDownloadCallback(),this.addRegionsToSearchIndex(),this.$emit("on-ready"),this.setMarkers(),this._boundingBoxGeo=this.$module.scene.addBoundingBoxPrimitive("_helper","boundingBox",4251856,.15),this._slides=this.$module.scene.addSlicesPrimitive("_helper",["x-plane","y-plane","z-plane"],[16733525,5635925,5592575],.5);const{centre:e,size:t}=this.$module.getCentreAndSize();this.boundingDims.centre=e,this.boundingDims.size=t,this.$nextTick(()=>this.restoreSettings(n)),this.isReady=!0}},getState:function(){let n={format:this.fileFormat,url:this._currentURL,viewport:void 0,visibility:void 0,background:this.currentBackground,viewingMode:this.viewingMode};if(this.$refs.scaffoldTreeControls&&(n.visibility=this.$refs.scaffoldTreeControls.getState()),this.$module.scene){let e=this.$module.scene.getZincCameraControls();n.viewport=e.getCurrentViewport()}return this.lastSelected&&this.lastSelected.group&&(n.search={...this.lastSelected}),n},setState:function(n){n&&(n.url&&n.url!==this._currentURL?this.setURLAndState(n.url,{fileFormat:n.fileFormat,viewport:n.viewport,visibility:n.visibility,background:n.background,viewingMode:this.viewingMode,search:n.search}):(n.background||n.search||n.viewport||n.viewingMode||n.visibility)&&(this.isReady&&this.$module.scene?this.restoreSettings(n):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({background:n.background,viewingMode:n.viewingMode,viewport:n.viewport,visibility:n.visibility,search:n.search}))))},exportGLTF:function(n){return this.$module.scene.exportGLTF(n)},getLocalAnnotations:function(){return[...this.localAnnotationsList]},importLocalAnnotations:function(n){if(this.enableLocalAnnotations){n.forEach(t=>{const i=t.group,r=t.region;let s=r.slice(-1)==="/"?r:r+"/";const o=s.slice(0,-1);t.region=o,s=s+i;const l=s;t.item.id=l,t.feature.id=l});const e=n.map(t=>t.feature);Of(this.$module.scene,e),n.forEach(t=>{this.localAnnotationsList.push({...t})})}},setURLAndState:function(n,e){n!=this._currentURL&&(e!=null&&e.format&&(this.fileFormat=e.format),this._currentURL=n,this.$refs.scaffoldTreeControls&&this.$refs.scaffoldTreeControls.clear(),this.loading=!0,this.timeVarying=!1,this.isReady=!1,this.$_searchIndex.removeAll(),this.hideRegionTooltip(),this.$module.setFinishDownloadCallback(this.setURLFinishCallback({background:e==null?void 0:e.background,region:this.region,search:e==null?void 0:e.search,viewingMode:e==null?void 0:e.viewingMode,viewURL:this.viewURL,viewport:e==null?void 0:e.viewport,visibility:e==null?void 0:e.visibility})),this.fileFormat==="gltf"?this.$module.loadGLTFFromURL(n,"scene",!0):this.$module.loadOrgansFromURL(n,void 0,void 0,"scene",void 0,!0),this.$module&&this.$module.scene&&(this.$module.scene.displayMarkers=this.displayMarkers,this.$module.scene.forcePickableObjectsUpdate=!0,this.$module.scene.displayMinimap=this.displayMinimap,this.updateMinimapScissor()))},setURL:function(n){this.setURLAndState(n,void 0)},drawerToggled:function(n){this.drawerOpen=n,this.adjustLayout()},adjustLayout:function(){if(this.$refs.scaffoldContainer){let n=this.$refs.scaffoldContainer.clientWidth;this.minimisedSlider=n<812,this.minimisedSlider?this.sliderPosition=this.drawerOpen?"right":"left":this.sliderPosition=""}},toggleRendering:function(n){this.$module.zincRenderer&&(n?this.$module.zincRenderer.animate():this.$module.zincRenderer.stopAnimate())},forceResize:function(){this.$module.zincRenderer&&this.$module.zincRenderer.onWindowResize()},syncControlCallback:function(){const n=this.$module.NDCCameraControl.getPanZoom();this.tData.visible&&this.showRegionTooltip(this.tData.label,!0,!0),this.$emit("scaffold-navigated",n)},toggleSyncControl:function(n,e){this.$module.toggleSyncControl(n,e),this.$module.setSyncControlCallback(this.syncControlCallback)},setMarkers:function(){for(const[n,e]of Object.entries(this.markerLabels))this.setMarkerModeForObjectsWithName(n,e,"on")}}},Qf=n=>(a.pushScopeId("data-v-3a5a2c2d"),n=n(),a.popScopeId(),n),fV={ref:"scaffoldContainer",class:"scaffold-container","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},pV=Qf(()=>a.createElementVNode("span",{class:"message-text"},"Beta",-1)),mV=Qf(()=>a.createElementVNode("span",{class:"message-text"},"What's new?",-1)),gV={class:"primitive-controls-box"},yV={class:"animation-data"},vV={class:"purple"},bV={class:"animation-data"},xV={class:"purple"},wV={class:"animation-data"},MV={class:"bottom-right-control"},SV=Qf(()=>a.createElementVNode("div",null,[a.createTextVNode(" Fit to "),a.createElementVNode("br"),a.createTextVNode(" window ")],-1)),_V={style:{"margin-bottom":"2px"}},TV={key:0,class:"viewing-mode-title"},EV=["onClick"],CV=["onClick"];function AV(n,e,t,i,r,s){const o=a.resolveComponent("map-svg-sprite-color"),l=jx,u=a.resolveComponent("DrawToolbar"),c=lm,f=yt,h=Pl,m=Bx,y=Dx,p=a.resolveComponent("map-svg-icon"),d=Ln,b=Qn,v=jg,g=Ls,M=As,_=Wg,E=Cs,S=pd;return a.withDirectives((a.openBlock(),a.createElementBlock("div",fV,[a.createVNode(o),a.createVNode(l,{createData:n.createData,label:n.tData.label,region:n.tData.region,visible:n.tData.visible,x:n.tData.x,y:n.tData.y,annotationDisplay:s.annotationDisplay,onConfirmCreate:e[0]||(e[0]=w=>s.confirmCreate(w)),onCancelCreate:e[1]||(e[1]=w=>s.cancelCreate()),onConfirmDelete:e[2]||(e[2]=w=>s.confirmDelete()),onTooltipHide:e[3]||(e[3]=w=>s.onTooltipHide())},null,8,["createData","label","region","visible","x","y","annotationDisplay"]),a.createElementVNode("div",{id:"organsDisplayArea",ref:"display",tabindex:"-1",style:{height:"100%",width:"100%"},onKeydown:e[4]||(e[4]=a.withKeys((...w)=>s.backgroundChangeCallback&&s.backgroundChangeCallback(...w),["66"]))},null,544),a.withDirectives(a.createElementVNode("div",null,[n.viewingMode==="Annotation"&&(n.userInformation||t.enableLocalAnnotations)?(a.openBlock(),a.createBlock(u,{key:0,toolbarOptions:n.toolbarOptions,activeDrawTool:n.activeDrawTool,activeDrawMode:n.activeDrawMode,hoverVisibilities:n.hoverVisibilities,onClickToolbar:s.toggleDrawing,onShowTooltip:s.showHelpText,onHideTooltip:s.hideHelpText,ref:"toolbarPopover"},null,8,["toolbarOptions","activeDrawTool","activeDrawMode","hoverVisibilities","onClickToolbar","onShowTooltip","onHideTooltip"])):a.createCommentVNode("",!0),t.displayWarning?(a.openBlock(),a.createBlock(h,{key:1,ref:"warningPopover",visible:n.hoverVisibilities[7].value,content:t.warningMessage,placement:"right",width:"max-content",teleported:!1,"popper-class":"scaffold-popper message-popper right-popper non-selectable"},{reference:a.withCtx(()=>[t.displayWarning?(a.openBlock(),a.createElementBlock("div",{key:0,class:"message-icon warning-icon",onMouseover:e[5]||(e[5]=w=>s.showHelpText(7)),onMouseout:e[6]||(e[6]=w=>s.hideHelpText(7))},[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),pV],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),t.displayLatestChanges?(a.openBlock(),a.createBlock(h,{key:2,visible:n.hoverVisibilities[8].value,content:t.latestChangesMessage,placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper message-popper right-popper non-selectable",ref:"whatsNewPopover"},{reference:a.withCtx(()=>[t.displayLatestChanges&&t.latestChangesMessage?(a.openBlock(),a.createElementBlock("div",{key:0,class:"el-icon-warning message-icon latest-changesicon",onMouseover:e[7]||(e[7]=w=>s.showHelpText(8)),onMouseout:e[8]||(e[8]=w=>s.hideHelpText(8))},[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),mV],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),a.createVNode(h,{visible:n.hoverVisibilities[6].value,content:"Change region visibility",placement:"right",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable",ref:"regionVisibilityPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{ref:"scaffoldTreeControls",isReady:n.isReady,"show-colour-picker":t.showColourPicker,onObjectSelected:s.objectSelected,onObjectHovered:s.objectHovered,onDrawerToggled:s.drawerToggled},null,8,["isReady","show-colour-picker","onObjectSelected","onObjectHovered","onDrawerToggled"])]),_:1},8,["visible"]),a.createElementVNode("div",gV,[a.createVNode(y,{ref:"primitiveControls",createData:n.createData,onPrimitivesUpdated:s.primitivesUpdated},null,8,["createData","onPrimitivesUpdated"])]),n.timeVarying?(a.openBlock(),a.createBlock(h,{key:3,ref:"sliderPopover",width:"max-content",visible:n.hoverVisibilities[5].value,content:"Move the slider to animate the region",placement:"top",teleported:!1,trigger:"manual","popper-class":"scaffold-popper top-popper non-selectable"},{reference:a.withCtx(()=>[n.timeVarying?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["time-slider-container",[n.minimisedSlider?"minimised":"",n.sliderPosition]])},[a.createVNode(_,{type:"card"},{default:a.withCtx(()=>[a.createVNode(v,{label:"Animate scaffold"},{default:a.withCtx(()=>[a.createVNode(b,{class:"tab-content"},{default:a.withCtx(()=>[n.isPlaying?(a.openBlock(),a.createBlock(p,{key:0,icon:"pause",class:"icon-button video-button",onClick:e[9]||(e[9]=w=>s.play(!1))})):(a.openBlock(),a.createBlock(p,{key:1,icon:"play",class:"video-button icon-button",onClick:e[10]||(e[10]=w=>s.play(!0))})),a.createVNode(d,{min:0,max:n.timeMax,"model-value":n.currentTime/100*n.timeMax,step:.1,"tooltip-class":"time-slider-tooltip",class:"slider","format-tooltip":s.formatTooltip,marks:n.timeStamps,onInput:e[11]||(e[11]=w=>s.timeChange(w))},null,8,["max","model-value","format-tooltip","marks"])]),_:1})]),_:1}),a.createVNode(v,{label:"Animation data"},{default:a.withCtx(()=>[a.createVNode(b,{class:"tab-content"},{default:a.withCtx(()=>[a.createElementVNode("div",yV,[a.createTextVNode(" Original duration: "),a.createElementVNode("div",vV,a.toDisplayString(n.orginalDuration),1)]),a.createElementVNode("div",bV,[a.createTextVNode(" Animation duration: "),a.createElementVNode("div",xV,a.toDisplayString(n.animateDuration),1)]),a.createElementVNode("div",wV,[a.createTextVNode(" Playback speed "),a.createVNode(M,{teleported:!0,"model-value":n.currentSpeed,placeholder:"Select",class:"scaffold-select-box speed","popper-class":"scaffold_viewer_dropdown",onChange:e[12]||(e[12]=w=>s.speedChanged(w))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.playSpeed,w=>(a.openBlock(),a.createBlock(g,{key:w.value,label:w.label,value:w.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])])]),_:1})]),_:1})]),_:1})],2)):a.createCommentVNode("",!0)]),_:1},8,["visible"])):a.createCommentVNode("",!0),a.createElementVNode("div",MV,[a.createVNode(h,{visible:n.hoverVisibilities[0].value,content:"Zoom in",width:"max-content",placement:"left",teleported:!1,trigger:"manual","popper-class":"scaffold-popper left-popper non-selectable",ref:"zoomInPopover"},{reference:a.withCtx(()=>[a.createVNode(p,{icon:"zoomIn",class:"icon-button zoomIn",onClick:e[13]||(e[13]=w=>s.zoomIn()),onMouseover:e[14]||(e[14]=w=>s.showHelpText(0)),onMouseout:e[15]||(e[15]=w=>s.hideHelpText(0))})]),_:1},8,["visible"]),a.createVNode(h,{visible:n.hoverVisibilities[1].value,content:"Zoom out",placement:"top-end",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper popper-zoomout non-selectable",ref:"zoomOutPopover"},{reference:a.withCtx(()=>[a.createVNode(p,{icon:"zoomOut",class:"icon-button zoomOut",onClick:e[16]||(e[16]=w=>s.zoomOut()),onMouseover:e[17]||(e[17]=w=>s.showHelpText(1)),onMouseout:e[18]||(e[18]=w=>s.hideHelpText(1))})]),_:1},8,["visible"]),a.createVNode(h,{visible:n.hoverVisibilities[2].value,placement:"top",teleported:!1,trigger:"manual",width:"max-content","popper-class":"scaffold-popper non-selectable",ref:"zoomFitPopover"},{reference:a.withCtx(()=>[a.createVNode(p,{icon:"fitWindow",class:"icon-button fitWindow",onClick:e[19]||(e[19]=w=>s.fitWindow()),onMouseover:e[20]||(e[20]=w=>s.showHelpText(2)),onMouseout:e[21]||(e[21]=w=>s.hideHelpText(2))})]),default:a.withCtx(()=>[SV]),_:1},8,["visible"])]),n.openMapRef?(a.openBlock(),a.createBlock(h,{key:4,ref:"open-map-popover","virtual-ref":n.openMapRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"open-map-popper","virtual-triggering":""},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.openMapOptions,w=>(a.openBlock(),a.createBlock(b,{key:w.key},{default:a.withCtx(()=>[a.createVNode(E,{type:"primary",plain:"",onClick:T=>n.$emit("open-map",w.key)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(w.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):a.createCommentVNode("",!0),a.createVNode(h,{ref:"backgroundPopover","virtual-ref":n.backgroundIconRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"background-popper non-selectable h-auto","virtual-triggering":""},{default:a.withCtx(()=>[a.createElementVNode("div",null,[a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>[a.createTextVNode("Viewing Mode")]),_:1}),a.createVNode(b,{class:"backgroundControl"},{default:a.withCtx(()=>[a.createElementVNode("div",_V,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.viewingModes,(w,T,C)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:T},[T===n.viewingMode?(a.openBlock(),a.createElementBlock("span",TV,[a.createElementVNode("b",null,a.toDisplayString(T),1)])):(a.openBlock(),a.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:R=>s.changeViewingMode(T)},a.toDisplayString(T),9,EV))],64))),128))]),a.createVNode(b,{class:"viewing-mode-description"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(n.viewingModes[n.viewingMode]),1)]),_:1})]),_:1}),a.createVNode(b,{class:"backgroundSpacer"}),a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>[a.createTextVNode(" Change background ")]),_:1}),a.createVNode(b,{class:"backgroundChooser"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.availableBackground,w=>(a.openBlock(),a.createElementBlock("div",{key:w,class:a.normalizeClass(["backgroundChoice",w,w==n.currentBackground?"active":""]),onClick:T=>s.backgroundChangeCallback(w)},null,10,CV))),128))]),_:1})])]),_:1},8,["virtual-ref"]),a.createElementVNode("div",{class:a.normalizeClass(["settings-group",{open:n.drawerOpen,close:!n.drawerOpen}])},[a.createVNode(b,null,{default:a.withCtx(()=>[a.createVNode(h,{visible:n.hoverVisibilities[3].value,content:"Open new map",placement:"right",teleported:!1,trigger:"manual",width:"max-content","popper-class":"scaffold-popper right-popper non-selectable",ref:"openMapPopover"},{reference:a.withCtx(()=>[t.enableOpenMapUI&&t.openMapOptions.length>0?(a.openBlock(),a.createBlock(p,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:e[22]||(e[22]=w=>s.showHelpText(3)),onMouseout:e[23]||(e[23]=w=>s.hideHelpText(3))},null,512)):a.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),a.createVNode(b,null,{default:a.withCtx(()=>[a.createVNode(h,{visible:n.hoverVisibilities[4].value,content:"Change background color",placement:"right",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable",ref:"settingsPopover"},{reference:a.withCtx(()=>[a.createVNode(p,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:e[24]||(e[24]=w=>s.showHelpText(4)),onMouseout:e[25]||(e[25]=w=>s.hideHelpText(4))},null,512)]),_:1},8,["visible"])]),_:1})],2)],512),[[a.vShow,t.displayUI&&!n.isTransitioning]])])),[[S,n.loading]])}const LV=ki(hV,[["render",AV],["__scopeId","data-v-3a5a2c2d"]]);Zt.ScaffoldVuer=LV,Object.defineProperty(Zt,Symbol.toStringTag,{value:"Module"})});